mycode.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!-- 0审核中,1不通过,2通过,9未提交 -->
  2. <template>
  3. <view>
  4. <image class="bg" src="../../static/img/mycode-bg-copy.png" mode="widthFix"></image>
  5. <view class="header" v-if="isHeaderShow">
  6. <view class="header-left">
  7. <view class="header-left-point"></view>
  8. <view class="header-left-tips">请提交采集信息,提交后可获得进步积分</view>
  9. <view class="header-left-view" @click="viewDetails">查看详细<u-icon class="icon" name="arrow-right" size="20"/></view>
  10. </view>
  11. <view class="header-right">
  12. <u-icon name="close" color="#A7A7A7" size="24" @click="isHeaderShow = false"/>
  13. </view>
  14. </view>
  15. <view class="content" style="padding-top: 20vh;">
  16. <view class="qrimg">
  17. <tki-qrcode
  18. ref="qrcode"
  19. cid="cid"
  20. :showLoading="false"
  21. :val="memberinfo.id"
  22. :size="384"
  23. background="#000"
  24. foreground="#fff"
  25. pdground="#fff"
  26. :usingComponents="true"
  27. :onval="true"
  28. @result="qrR"
  29. />
  30. </view>
  31. </view>
  32. <!-- 0审核中 -->
  33. <view class="content fixed1" v-if="memberinfo.auditStatus == 0">
  34. <view class="tip">
  35. 您已提交退役军人身份审核,通过后生成退役军人码,并可享受平台提供的专享培训、就业服务,请耐心等待。
  36. </view>
  37. </view>
  38. <!-- 1不通过 -->
  39. <view class="content fixed1" v-else-if="memberinfo.auditStatus == 1">
  40. <view class="tip">
  41. 很抱歉,您提交的退役军人身份信息未通过审核,请审查后重新提交。
  42. </view>
  43. <view class="submit" @click="jumpPage('/pages/applyEducationCode/applyEducationCode')">立即提交</view>
  44. </view>
  45. <!-- 2通过审核 -->
  46. <view class="code-text" v-else-if="memberinfo.auditStatus == 2">
  47. <view class="code-id">{{ memberinfo.id }}</view>
  48. <view class="thanks">
  49. {{memberinfo.name}}{{memberinfo.menSex | verifySexFilter}},感谢您为国家的付出
  50. </view>
  51. <view v-if="!memberinfo.id">还没有退役军人码</view>
  52. </view>
  53. <!-- 3撤销审核 -->
  54. <view class="content no-submit" v-else-if="memberinfo.auditStatus == 3">
  55. <view class="tip">
  56. 您已撤销审核,请重新提交退役军人身份审核,获取退役军人码,并享受平台提供的专享培训、就业服务。
  57. </view>
  58. <view class="submit" @click="jumpPage('/pages/applyEducationCode/applyEducationCode')">立即提交</view>
  59. </view>
  60. <!-- 9未提交 -->
  61. <view class="content no-submit" v-else-if="memberinfo.auditStatus == 9">
  62. <view class="tip">
  63. 提交退役军人身份审核,获取退役军人码,并享受平台提供的专享培训、就业服务。
  64. </view>
  65. <view class="submit" @click="jumpPage('/pages/applyEducationCode/applyEducationCode')">立即提交</view>
  66. </view>
  67. <u-modal
  68. ref="uModal"
  69. v-model="updateShow"
  70. title="填写当前情况"
  71. :show-cancel-button="true"
  72. @cancel="updateCancel"
  73. @confirm="updateConfirm"
  74. :async-close="true"
  75. >
  76. <view class="slot-content">
  77. <view class="condition-form">
  78. <u-form :model="conditionForm" label-width="180" ref="conditionForm">
  79. <u-form-item label="就业状态:" prop="jobStatus" :required="true">
  80. <u-radio-group v-model="conditionForm.jobStatus" :wrap="true" icon-size="16">
  81. <u-radio v-for="(item, index) in employmentStatusList" :key="index" :name="item.value">
  82. {{ item.label }}
  83. </u-radio>
  84. </u-radio-group>
  85. </u-form-item>
  86. <u-form-item label="薪资范围:" prop="salaryRangeName" :required="true">
  87. <u-input v-model="conditionForm.salaryRangeName" placeholder="请选择您的薪资范围" type="select" @click="salaryRangeClick"/>
  88. </u-form-item>
  89. </u-form>
  90. </view>
  91. </view>
  92. </u-modal>
  93. <!-- ########################## -- 底部导航栏 -- ################################ -->
  94. <u-tabbar
  95. :list="tabbarConfig.tabbarList"
  96. :height="tabbarConfig.height"
  97. :mid-button="tabbarConfig.midButton"
  98. :inactive-color="tabbarConfig.inactiveColor"
  99. :active-color="tabbarConfig.activeColor"
  100. :mid-button-size="tabbarConfig.midButtonSize"
  101. />
  102. <!-- 工资范围下拉 -->
  103. <u-select v-model="salaryRangeShow" :list="salaryRangeList" @confirm="salaryRangeChange" :default-value="salaryRangeIndex"/>
  104. <u-toast ref="uToast" />
  105. </view>
  106. </template>
  107. <script>
  108. import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue";
  109. import tabbarconfig from 'tabbarconfig.js';
  110. export default {
  111. components: {
  112. tkiQrcode
  113. },
  114. data() {
  115. return {
  116. memberinfo: {},
  117. icon: '/static/icons/index.png',
  118. tabbarConfig: tabbarconfig,
  119. isHeaderShow: false,
  120. updateShow: false,
  121. conditionForm: {
  122. jobStatus: '',
  123. salaryRangeName: '',
  124. salaryRange: ''
  125. },
  126. conditionFormRules: {
  127. jobStatus: [
  128. {
  129. required: true,
  130. message: '请选择就业状态',
  131. trigger: ['change']
  132. }
  133. ],
  134. salaryRangeName: [
  135. {
  136. required: true,
  137. message: '请选择薪资范围',
  138. trigger: ['change', 'blur']
  139. }
  140. ]
  141. },
  142. employmentStatusList: [],
  143. // 薪资范围
  144. salaryRangeShow: false,
  145. salaryRangeList: [],
  146. salaryRangeIndex: []
  147. }
  148. },
  149. onShow() {
  150. this.getSalaryRange();
  151. this.getEmploymentStatus();
  152. this.getmemberinfo();
  153. },
  154. filters: {
  155. verifySexFilter(value) {
  156. if (value == 0) {
  157. return '先生';
  158. } else if (value == 1) {
  159. return '女士';
  160. }
  161. }
  162. },
  163. methods: {
  164. /**
  165. * 获取用户信息
  166. */
  167. getmemberinfo() {
  168. this.$u.api.getmemberinfo().then(res => {
  169. if (res.code == 200) {
  170. this.memberinfo = res.data;
  171. if (res.data.isShowButton && res.data.auditStatus == 2) {
  172. this.isHeaderShow = true
  173. this.viewDetails()
  174. } else {
  175. this.isHeaderShow = false
  176. }
  177. if (this.memberinfo.auditStatus !== 2) {
  178. this.memberinfo.id = null;
  179. this.$refs.qrcode._clearCode();
  180. } else {
  181. setTimeout(() => {
  182. this.$refs.qrcode._makeCode();
  183. }, 300)
  184. }
  185. // this.conditionForm.jobStatus = res.data.jobStatus;
  186. // this.conditionForm.salaryRange = res.data.salaryRange;
  187. this.salaryRangeList.forEach((item, index) => {
  188. if (res.data.salaryRange === item.value) {
  189. this.salaryRangeIndex = [index]
  190. this.conditionForm.salaryRangeName = item.label
  191. }
  192. })
  193. } else {
  194. uni.showToast({
  195. icon: 'none',
  196. title: res.msg
  197. })
  198. }
  199. })
  200. },
  201. qrR(e) {
  202. // console.log(e)
  203. },
  204. /**
  205. * 跳转到指定页面
  206. */
  207. jumpPage(url) {
  208. this.$u.route(url)
  209. },
  210. /**
  211. * 查看详情
  212. */
  213. viewDetails() {
  214. this.updateShow = true
  215. setTimeout(() => {
  216. this.$refs.conditionForm.setRules(this.conditionFormRules);
  217. }, 0)
  218. },
  219. /**
  220. * 就业状态
  221. */
  222. getEmploymentStatus(){
  223. this.$u.api.getDictdataUrl({ key:'member_job_status' }).then(res => {
  224. if(res.code === 200){
  225. this.employmentStatusList = res.data.map(item => {
  226. return {
  227. ...item,
  228. value: item.text
  229. }
  230. });
  231. }
  232. });
  233. },
  234. /**
  235. * 获取薪资范围
  236. */
  237. getSalaryRange(){
  238. this.$u.api.getDictdataUrl({ key:'salary_range' }).then(res => {
  239. if(res.code === 200){
  240. this.salaryRangeList = res.data.map(item => {
  241. return {
  242. ...item,
  243. value: item.text
  244. }
  245. });
  246. }
  247. });
  248. },
  249. /**
  250. * 薪资范围下拉触发
  251. * @param {Object} e
  252. */
  253. salaryRangeChange(e) {
  254. this.conditionForm.salaryRange = e[0].value
  255. this.conditionForm.salaryRangeName = e[0].label
  256. },
  257. /**
  258. * 点击薪资范围
  259. */
  260. salaryRangeClick() {
  261. this.salaryRangeShow = true
  262. },
  263. /**
  264. * 弹框返回操作
  265. */
  266. updateCancel() {
  267. this.conditionForm.jobStatus = this.memberinfo.jobStatus;
  268. this.conditionForm.salaryRange = this.memberinfo.salaryRange;
  269. this.salaryRangeList.forEach((item, index) => {
  270. if (this.memberinfo.salaryRange === item.value) {
  271. this.salaryRangeIndex = [index]
  272. this.conditionForm.salaryRangeName = item.label
  273. }
  274. })
  275. },
  276. /**
  277. * 弹框确认操作
  278. */
  279. updateConfirm() {
  280. this.$refs.conditionForm.validate(valid => {
  281. if (valid) {
  282. const params = {
  283. salaryRange: this.conditionForm.salaryRange,
  284. jobStatus: this.conditionForm.jobStatus
  285. }
  286. this.$u.api.mine.submitEmploymentCondition(params).then(res => {
  287. if (res.code === 200) {
  288. this.getmemberinfo();
  289. this.$refs.uToast.show({
  290. title: '更新成功!',
  291. type: 'success'
  292. })
  293. this.updateShow = false;
  294. } else {
  295. this.$refs.uToast.show({
  296. title: res.msg,
  297. type: 'error'
  298. })
  299. }
  300. }).catch(() => {
  301. this.$refs.uToast.show({
  302. title: '系统异常!',
  303. type: 'error'
  304. })
  305. })
  306. } else {
  307. this.$refs.uModal.clearLoading();
  308. }
  309. });
  310. }
  311. }
  312. }
  313. </script>
  314. <style lang="scss" scoped>
  315. @import './mycode.scss';
  316. </style>