mycode.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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 fixed" v-if="memberinfo.auditStatus == 0">
  34. <view class="tip">
  35. 您已提交退役军人身份审核,通过后生成退役军人码,并可享受平台提供的专享培训、就业服务,请耐心等待。
  36. </view>
  37. </view>
  38. <!-- 1不通过 -->
  39. <view class="content fixed" 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', 'blur']
  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. onLoad(page) {
  150. this.getSalaryRange();
  151. this.getEmploymentStatus();
  152. },
  153. onShow() {
  154. this.getmemberinfo();
  155. },
  156. filters: {
  157. verifySexFilter(value) {
  158. if (value == 0) {
  159. return '先生';
  160. } else if (value == 1) {
  161. return '女士';
  162. }
  163. }
  164. },
  165. methods: {
  166. /**
  167. * 获取用户信息
  168. */
  169. getmemberinfo() {
  170. this.$u.api.getmemberinfo().then(res => {
  171. if (res.code == 200) {
  172. this.memberinfo = res.data;
  173. if (this.memberinfo.auditStatus !== 2) {
  174. this.memberinfo.id = null;
  175. this.$refs.qrcode._clearCode();
  176. } else {
  177. setTimeout(() => {
  178. this.$refs.qrcode._makeCode();
  179. }, 300)
  180. }
  181. this.conditionForm.jobStatus = res.data.jobStatus;
  182. this.conditionForm.salaryRange = res.data.salaryRange;
  183. this.salaryRangeList.forEach((item, index) => {
  184. if (res.data.salaryRange === item.value) {
  185. this.salaryRangeIndex = [index]
  186. this.conditionForm.salaryRangeName = item.label
  187. }
  188. })
  189. if (res.data.isShowButton) {
  190. this.isHeaderShow = true
  191. this.viewDetails()
  192. } else {
  193. this.isHeaderShow = false
  194. }
  195. } else {
  196. uni.showToast({
  197. icon: 'none',
  198. title: res.msg
  199. })
  200. }
  201. })
  202. },
  203. qrR(e) {
  204. // console.log(e)
  205. },
  206. /**
  207. * 跳转到指定页面
  208. */
  209. jumpPage(url) {
  210. this.$u.route(url)
  211. },
  212. /**
  213. * 查看详情
  214. */
  215. viewDetails() {
  216. this.updateShow = true
  217. setTimeout(() => {
  218. this.$refs.conditionForm.setRules(this.conditionFormRules);
  219. }, 200)
  220. },
  221. /**
  222. * 就业状态
  223. */
  224. getEmploymentStatus(){
  225. this.$u.api.getDictdataUrl({ key:'member_job_status' }).then(res => {
  226. if(res.code === 200){
  227. this.employmentStatusList = res.data.map(item => {
  228. return {
  229. ...item,
  230. value: item.text
  231. }
  232. });
  233. }
  234. });
  235. },
  236. /**
  237. * 获取薪资范围
  238. */
  239. getSalaryRange(){
  240. this.$u.api.getDictdataUrl({ key:'salary_range' }).then(res => {
  241. if(res.code === 200){
  242. this.salaryRangeList = res.data.map(item => {
  243. return {
  244. ...item,
  245. value: item.text
  246. }
  247. });
  248. }
  249. });
  250. },
  251. /**
  252. * 薪资范围下拉触发
  253. * @param {Object} e
  254. */
  255. salaryRangeChange(e) {
  256. this.conditionForm.salaryRange = e[0].value
  257. this.conditionForm.salaryRangeName = e[0].label
  258. },
  259. /**
  260. * 点击薪资范围
  261. */
  262. salaryRangeClick() {
  263. this.salaryRangeShow = true
  264. },
  265. /**
  266. * 弹框返回操作
  267. */
  268. updateCancel() {
  269. this.conditionForm.jobStatus = this.memberinfo.jobStatus;
  270. this.conditionForm.salaryRange = this.memberinfo.salaryRange;
  271. this.salaryRangeList.forEach((item, index) => {
  272. if (this.memberinfo.salaryRange === item.value) {
  273. this.salaryRangeIndex = [index]
  274. this.conditionForm.salaryRangeName = item.label
  275. }
  276. })
  277. },
  278. /**
  279. * 弹框确认操作
  280. */
  281. updateConfirm() {
  282. this.$refs.conditionForm.validate(valid => {
  283. if (valid) {
  284. const params = {
  285. salaryRange: this.conditionForm.salaryRange,
  286. jobStatus: this.conditionForm.jobStatus
  287. }
  288. this.$u.api.mine.submitEmploymentCondition(params).then(res => {
  289. if (res.code === 200) {
  290. this.getmemberinfo();
  291. this.$refs.uToast.show({
  292. title: '更新成功!',
  293. type: 'success'
  294. })
  295. this.updateShow = false;
  296. } else {
  297. this.$refs.uToast.show({
  298. title: res.msg,
  299. type: 'error'
  300. })
  301. }
  302. }).catch(() => {
  303. this.$refs.uToast.show({
  304. title: '系统异常!',
  305. type: 'error'
  306. })
  307. })
  308. } else {
  309. this.$refs.uModal.clearLoading();
  310. }
  311. });
  312. }
  313. }
  314. }
  315. </script>
  316. <style lang="scss" scoped>
  317. @import './mycode.scss';
  318. </style>