mycode.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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-item label="求职意向:" prop="jobIntention" :required="true">
  90. <u-input v-model="conditionForm.jobIntention" placeholder="请输入您的求职意向" type="textarea"/>
  91. </u-form-item>
  92. </u-form>
  93. </view>
  94. </view>
  95. </u-modal>
  96. <!-- ########################## -- 底部导航栏 -- ################################ -->
  97. <u-tabbar
  98. :list="tabbarConfig.tabbarList"
  99. :height="tabbarConfig.height"
  100. :mid-button="tabbarConfig.midButton"
  101. :inactive-color="tabbarConfig.inactiveColor"
  102. :active-color="tabbarConfig.activeColor"
  103. :mid-button-size="tabbarConfig.midButtonSize"
  104. />
  105. <!-- 工资范围下拉 -->
  106. <u-select v-model="salaryRangeShow" :list="salaryRangeList" @confirm="salaryRangeChange" :default-value="salaryRangeIndex"/>
  107. <u-toast ref="uToast" />
  108. </view>
  109. </template>
  110. <script>
  111. import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue";
  112. import tabbarconfig from 'tabbarconfig.js';
  113. export default {
  114. components: {
  115. tkiQrcode
  116. },
  117. data() {
  118. return {
  119. memberinfo: {},
  120. icon: '/static/icons/index.png',
  121. tabbarConfig: tabbarconfig,
  122. isHeaderShow: false,
  123. updateShow: false,
  124. conditionForm: {
  125. jobStatus: '',
  126. salaryRangeName: '',
  127. salaryRange: '',
  128. jobIntention: ''
  129. },
  130. conditionFormRules: {
  131. jobStatus: [
  132. {
  133. required: true,
  134. message: '请选择就业状态',
  135. trigger: ['change']
  136. }
  137. ],
  138. salaryRangeName: [
  139. {
  140. required: true,
  141. message: '请选择薪资范围',
  142. trigger: ['change', 'blur']
  143. }
  144. ],
  145. jobIntention: [
  146. {
  147. required: true,
  148. message: '请填写求职意向',
  149. trigger: ['change', 'blur']
  150. }
  151. ]
  152. },
  153. employmentStatusList: [],
  154. // 薪资范围
  155. salaryRangeShow: false,
  156. salaryRangeList: [],
  157. salaryRangeIndex: []
  158. }
  159. },
  160. onShow() {
  161. this.getSalaryRange();
  162. this.getEmploymentStatus();
  163. this.getmemberinfo();
  164. },
  165. filters: {
  166. verifySexFilter(value) {
  167. if (value == 0) {
  168. return '先生';
  169. } else if (value == 1) {
  170. return '女士';
  171. }
  172. }
  173. },
  174. methods: {
  175. /**
  176. * 获取用户信息
  177. */
  178. getmemberinfo() {
  179. this.$u.api.getmemberinfo().then(res => {
  180. if (res.code == 200) {
  181. this.memberinfo = res.data;
  182. if (res.data.isShowButton && res.data.auditStatus == 2) {
  183. this.isHeaderShow = true
  184. this.viewDetails()
  185. } else {
  186. this.isHeaderShow = false
  187. }
  188. if (this.memberinfo.auditStatus !== 2) {
  189. this.memberinfo.id = null;
  190. this.$refs.qrcode._clearCode();
  191. } else {
  192. setTimeout(() => {
  193. this.$refs.qrcode._makeCode();
  194. }, 300)
  195. }
  196. // this.conditionForm.jobStatus = res.data.jobStatus;
  197. // this.conditionForm.salaryRange = res.data.salaryRange;
  198. this.salaryRangeList.forEach((item, index) => {
  199. if (res.data.salaryRange === item.value) {
  200. this.salaryRangeIndex = [index]
  201. this.conditionForm.salaryRangeName = item.label
  202. }
  203. })
  204. } else {
  205. uni.showToast({
  206. icon: 'none',
  207. title: res.msg
  208. })
  209. }
  210. })
  211. },
  212. qrR(e) {
  213. // console.log(e)
  214. },
  215. /**
  216. * 跳转到指定页面
  217. */
  218. jumpPage(url) {
  219. this.$u.route(url)
  220. },
  221. /**
  222. * 查看详情
  223. */
  224. viewDetails() {
  225. this.updateShow = true
  226. setTimeout(() => {
  227. this.$refs.conditionForm.setRules(this.conditionFormRules);
  228. }, 0)
  229. },
  230. /**
  231. * 就业状态
  232. */
  233. getEmploymentStatus(){
  234. this.$u.api.getDictdataUrl({ key:'member_job_status' }).then(res => {
  235. if(res.code === 200){
  236. this.employmentStatusList = res.data.map(item => {
  237. return {
  238. ...item,
  239. value: item.text
  240. }
  241. });
  242. }
  243. });
  244. },
  245. /**
  246. * 获取薪资范围
  247. */
  248. getSalaryRange(){
  249. this.$u.api.getDictdataUrl({ key:'salary_range' }).then(res => {
  250. if(res.code === 200){
  251. this.salaryRangeList = res.data.map(item => {
  252. return {
  253. ...item,
  254. value: item.text
  255. }
  256. });
  257. }
  258. });
  259. },
  260. /**
  261. * 薪资范围下拉触发
  262. * @param {Object} e
  263. */
  264. salaryRangeChange(e) {
  265. this.conditionForm.salaryRange = e[0].value
  266. this.conditionForm.salaryRangeName = e[0].label
  267. },
  268. /**
  269. * 点击薪资范围
  270. */
  271. salaryRangeClick() {
  272. this.salaryRangeShow = true
  273. },
  274. /**
  275. * 弹框返回操作
  276. */
  277. updateCancel() {
  278. this.conditionForm.jobStatus = this.memberinfo.jobStatus;
  279. this.conditionForm.salaryRange = this.memberinfo.salaryRange;
  280. this.salaryRangeList.forEach((item, index) => {
  281. if (this.memberinfo.salaryRange === item.value) {
  282. this.salaryRangeIndex = [index]
  283. this.conditionForm.salaryRangeName = item.label
  284. }
  285. })
  286. },
  287. /**
  288. * 弹框确认操作
  289. */
  290. updateConfirm() {
  291. this.$refs.conditionForm.validate(valid => {
  292. if (valid) {
  293. const params = {
  294. salaryRange: this.conditionForm.salaryRange,
  295. jobStatus: this.conditionForm.jobStatus,
  296. jobIntention: this.conditionForm.jobIntention
  297. }
  298. this.$u.api.mine.submitEmploymentCondition(params).then(res => {
  299. if (res.code === 200) {
  300. this.getmemberinfo();
  301. this.$refs.uToast.show({
  302. title: '更新成功!',
  303. type: 'success'
  304. })
  305. this.updateShow = false;
  306. } else {
  307. this.$refs.uToast.show({
  308. title: res.msg,
  309. type: 'error'
  310. })
  311. }
  312. }).catch(() => {
  313. this.$refs.uToast.show({
  314. title: '系统异常!',
  315. type: 'error'
  316. })
  317. })
  318. } else {
  319. this.$refs.uModal.clearLoading();
  320. }
  321. });
  322. }
  323. }
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. @import './mycode.scss';
  328. </style>