mycode.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. }
  177. this.conditionForm.jobStatus = res.data.jobStatus;
  178. this.conditionForm.salaryRange = res.data.salaryRange;
  179. this.salaryRangeList.forEach((item, index) => {
  180. if (res.data.salaryRange === item.value) {
  181. this.salaryRangeIndex = [index]
  182. this.conditionForm.salaryRangeName = item.label
  183. }
  184. })
  185. if (res.data.isShowButton) {
  186. this.isHeaderShow = true
  187. this.viewDetails()
  188. } else {
  189. this.isHeaderShow = false
  190. }
  191. } else {
  192. uni.showToast({
  193. icon: 'none',
  194. title: res.msg
  195. })
  196. }
  197. })
  198. },
  199. qrR(e) {
  200. // console.log(e)
  201. },
  202. /**
  203. * 跳转到指定页面
  204. */
  205. jumpPage(url) {
  206. this.$u.route(url)
  207. },
  208. /**
  209. * 查看详情
  210. */
  211. viewDetails() {
  212. this.updateShow = true
  213. setTimeout(() => {
  214. this.$refs.conditionForm.setRules(this.conditionFormRules);
  215. }, 200)
  216. },
  217. /**
  218. * 就业状态
  219. */
  220. getEmploymentStatus(){
  221. this.$u.api.getDictdataUrl({ key:'member_job_status' }).then(res => {
  222. if(res.code === 200){
  223. this.employmentStatusList = res.data.map(item => {
  224. return {
  225. ...item,
  226. value: item.text
  227. }
  228. });
  229. }
  230. });
  231. },
  232. /**
  233. * 获取薪资范围
  234. */
  235. getSalaryRange(){
  236. this.$u.api.getDictdataUrl({ key:'salary_range' }).then(res => {
  237. if(res.code === 200){
  238. this.salaryRangeList = res.data.map(item => {
  239. return {
  240. ...item,
  241. value: item.text
  242. }
  243. });
  244. }
  245. });
  246. },
  247. /**
  248. * 薪资范围下拉触发
  249. * @param {Object} e
  250. */
  251. salaryRangeChange(e) {
  252. this.conditionForm.salaryRange = e[0].value
  253. this.conditionForm.salaryRangeName = e[0].label
  254. },
  255. /**
  256. * 点击薪资范围
  257. */
  258. salaryRangeClick() {
  259. this.salaryRangeShow = true
  260. },
  261. /**
  262. * 弹框返回操作
  263. */
  264. updateCancel() {
  265. this.conditionForm.jobStatus = this.memberinfo.jobStatus;
  266. this.conditionForm.salaryRange = this.memberinfo.salaryRange;
  267. this.salaryRangeList.forEach((item, index) => {
  268. if (this.memberinfo.salaryRange === item.value) {
  269. this.salaryRangeIndex = [index]
  270. this.conditionForm.salaryRangeName = item.label
  271. }
  272. })
  273. },
  274. /**
  275. * 弹框确认操作
  276. */
  277. updateConfirm() {
  278. this.$refs.conditionForm.validate(valid => {
  279. if (valid) {
  280. const params = {
  281. salaryRange: this.conditionForm.salaryRange,
  282. jobStatus: this.conditionForm.jobStatus
  283. }
  284. this.$u.api.mine.submitEmploymentCondition(params).then(res => {
  285. if (res.code === 200) {
  286. this.getmemberinfo();
  287. this.$refs.uToast.show({
  288. title: '更新成功!',
  289. type: 'success'
  290. })
  291. this.updateShow = false
  292. } else {
  293. this.$refs.uToast.show({
  294. title: res.msg,
  295. type: 'error'
  296. })
  297. }
  298. }).catch(() => {
  299. this.$refs.uToast.show({
  300. title: '系统异常!',
  301. type: 'error'
  302. })
  303. })
  304. } else {
  305. this.$refs.uModal.clearLoading();
  306. }
  307. });
  308. }
  309. }
  310. }
  311. </script>
  312. <style lang="scss" scoped>
  313. @import './mycode.scss';
  314. </style>