mycode.vue 9.5 KB

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