subsidy.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <view class="content">
  3. <image src="../../static/img/bz-bg.png" mode="widthFix" class="bz-bg"></image>
  4. <view class="bz-tit flex">
  5. <view class="hx"></view>
  6. <view class="">
  7. 报名申请
  8. </view>
  9. <view class="hx"></view>
  10. </view>
  11. <view class="tab ">
  12. <view class="bd-wrap flex">
  13. <view class="bg-name">
  14. 姓名:
  15. </view>
  16. <view class="bg-val">
  17. <input type="text" value="" placeholder="请输入您的姓名" class="val-ipt" v-model="name"/>
  18. </view>
  19. </view>
  20. <view class="bd-wrap flex">
  21. <view class="bg-name">
  22. 年龄:
  23. </view>
  24. <view class="bg-val">
  25. <input type="text" value="" placeholder="请输入您的年龄" class="val-ipt" v-model="age"/>
  26. </view>
  27. </view>
  28. <view class="bd-wrap flex">
  29. <view class="bg-name">
  30. 身份证号:
  31. </view>
  32. <view class="bg-val">
  33. <input type="idcard" value="" placeholder="请输入您的身份证号" class="val-ipt" v-model="cid"/>
  34. </view>
  35. </view>
  36. <view class="bd-wrap flex">
  37. <view class="bg-name">
  38. 配偶姓名:
  39. </view>
  40. <view class="bg-val">
  41. <input type="text" value="" placeholder="请输入您的配偶姓名" class="val-ipt" v-model="sname"/>
  42. </view>
  43. </view>
  44. <view class="bd-wrap flex">
  45. <view class="bg-name">
  46. 配偶年龄:
  47. </view>
  48. <view class="bg-val">
  49. <input type="text" value="" placeholder="请输入您的配偶年龄" class="val-ipt" v-model="sage"/>
  50. </view>
  51. </view>
  52. <view class="bd-wrap flex">
  53. <view class="bg-name">
  54. 配偶身份证号:
  55. </view>
  56. <view class="bg-val">
  57. <input type="text" value="" placeholder="请输入配偶身份证号" class="val-ipt" v-model="scid"/>
  58. </view>
  59. </view>
  60. <view class="bd-wrap flex">
  61. <view class="bg-name">
  62. 银行卡号:
  63. </view>
  64. <view class="bg-val">
  65. <input type="text" value="" placeholder="请输入银行卡号" class="val-ipt" v-model="bcd"/>
  66. </view>
  67. </view>
  68. <view class="bd-wrap flex">
  69. <view class="bg-name">
  70. 开户行:
  71. </view>
  72. <view class="bg-val">
  73. <input type="text" value="" placeholder="请输入开户行" class="val-ipt" v-model="bank"/>
  74. </view>
  75. </view>
  76. <view class="bd-wrap flex">
  77. <view class="bg-name">
  78. 联系电话:
  79. </view>
  80. <view class="bg-val">
  81. <input type="text" value="" placeholder="请输入联系电话" class="val-ipt" v-model="phone"/>
  82. </view>
  83. </view>
  84. <view class="bd-wrap flex">
  85. <view class="bg-name">
  86. 产检次数:
  87. </view>
  88. <view class="bg-val">
  89. <input type="text" value="" placeholder="请输入产检次数" class="val-ipt" v-model="check"/>
  90. </view>
  91. </view>
  92. <view class="bd-wrap flex">
  93. <view class="bg-name">
  94. 家庭年总收入:
  95. </view>
  96. <view class="bg-val">
  97. <input type="text" value="" placeholder="请输入家庭年总收入" class="val-ipt" v-model="income"/>
  98. </view>
  99. </view>
  100. <view class="bd-wrap flex">
  101. <view class="bg-name">
  102. 家庭人口:
  103. </view>
  104. <view class="bg-val">
  105. <input type="text" value="" placeholder="请输入家庭人口" class="val-ipt" v-model="person"/>
  106. </view>
  107. </view>
  108. <view class="bd-wrap flex">
  109. <view class="bg-name">
  110. 现居住地址:
  111. </view>
  112. <view class="bg-val">
  113. <input type="text" value="" placeholder="请输入现居住地址" class="val-ipt" v-model="address"/>
  114. </view>
  115. </view>
  116. <view class="bd-wrap flex">
  117. <view class="bg-name">
  118. 户籍地址:
  119. </view>
  120. <view class="bg-val">
  121. <input type="text" value="" placeholder="请输入户籍地址" class="val-ipt" v-model="reg"/>
  122. </view>
  123. </view>
  124. <view class="bd-wrap flex">
  125. <view class="bg-name">
  126. 验证码:
  127. </view>
  128. <view class="bg-val">
  129. <input type="text" value="" placeholder="请输入验证码" class="val-ipt" v-model="code"/>
  130. </view>
  131. <view class="code" @click="verification">{{ countDown == 0 ? '获取验证码' : countDown }}</view>
  132. </view>
  133. <view class="sm-wrap">
  134. <view class="sm-tit">
  135. 有无其他妊娠合并疾病,如有,请说明:
  136. </view>
  137. <textarea value="" placeholder="" class="text-area" v-model="explain"/>
  138. </view>
  139. <view class="sm-wrap">
  140. <view class="sm-tit">
  141. 孕产妇身份证正反面:
  142. </view>
  143. <view class="pic-num">
  144. {{cidimg | showNum}}/2
  145. </view>
  146. <view class="img-list flex">
  147. <view class="img-item" v-for="(sfzItem,sfzIndex) in cidimg" @click="upImag(sfzIndex,cidimg)" v-show="sfzShow">
  148. <image :src="sfzItem" mode="" class="upimg" v-if="sfzItem"></image>
  149. <image src="../../static/img/up-img.png" mode="" class="upimg" v-else></image>
  150. <image src="../../static/icon/delimg.png" mode="" class="delimg" @click.stop="delImg(sfzIndex,cidimg)"
  151. v-if="sfzItem"></image>
  152. </view>
  153. </view>
  154. </view>
  155. <view class="sm-wrap">
  156. <view class="sm-tit" style="padding-right: 30rpx;">
  157. 孕期检查信息(母子健康中心小程序上将带有孕妇姓名的检查页进行截屏上传)
  158. </view>
  159. <view class="img-list flex">
  160. <view class="img-item" v-for="(checkItem,checkIndex) in checkimg" @click="upImag(checkIndex,checkimg)">
  161. <image :src="checkItem" mode="" class="upimg" v-if="checkItem"></image>
  162. <image src="../../static/img/up-img.png" mode="" class="upimg" v-else></image>
  163. <image src="../../static/icon/delimg.png" mode="" class="delimg" @click.stop="delImg(checkIndex,checkimg)"
  164. v-if="checkItem"></image>
  165. </view>
  166. </view>
  167. </view>
  168. <view class="sm-wrap">
  169. <view class="sm-tit" style="padding-right: 100rpx;">
  170. 银行卡带有账号信息面(须为孕产妇本人名下)
  171. </view>
  172. <view class="img-list flex">
  173. <view class="img-item" @click="upImag1()">
  174. <image :src="bcdimg" mode="" class="upimg" v-if="bcdimg"></image>
  175. <image src="../../static/img/up-img.png" mode="" class="upimg" v-else></image>
  176. <image src="../../static/icon/delimg.png" mode="" class="delimg" @click.stop="delImg1()"
  177. v-if="bcdimg"></image>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <view class="sub" @click="sub">
  183. 提交申请
  184. </view>
  185. </view>
  186. </template>
  187. <script>
  188. //孕期检查信息(母子健康中心小程序上将带有孕妇姓名 的检查页进行截屏上传)
  189. import {
  190. mapState,
  191. mapMutations
  192. } from 'vuex';
  193. import {
  194. saveUrl,
  195. interceptor
  196. } from '@/utils/loginUtils.js';
  197. import {
  198. upload,
  199. addrescuer,
  200. verify,
  201. sub_list
  202. } from '@/api/ask.js';
  203. export default {
  204. data() {
  205. return {
  206. name: '', //姓名
  207. age: '', //年龄
  208. cid: '', //身份证号
  209. sname: '', //配偶姓名
  210. sage: '', //配偶年龄
  211. scid: '', //配偶身份证号
  212. bcd: '', //银行卡号
  213. bank: '', //开户行
  214. phone: '', //联系电话
  215. check: '', //产检次数
  216. income: '', //收入
  217. person: '', //人口
  218. address: '', //地址
  219. explain: '', //说明
  220. cidimg: ['',''], //身份证正反面
  221. checkimg: ['','',''], //检查图片截图
  222. bcdimg: '', //银行卡图片
  223. code: '', //验证码
  224. reg: '', //户籍
  225. sfzShow: true,
  226. checkShow: true,
  227. sfzNum: 0,
  228. countDown: 0,
  229. loadingType: 'more'
  230. }
  231. },
  232. filters: {
  233. showNum(val) {
  234. let i = 0
  235. if(val) {
  236. val.forEach(e => {
  237. if(e) {
  238. i++
  239. }
  240. })
  241. }
  242. return i
  243. }
  244. },
  245. watch:{
  246. countDown(i) {
  247. if (i == 0) {
  248. clearInterval(this.time);
  249. }
  250. }
  251. },
  252. computed: {
  253. ...mapState('user', ['hasLogin', 'userInfo']),
  254. },
  255. onShow() {
  256. console.log(this);
  257. // 判断是否已经登录
  258. if (this.hasLogin) {
  259. } else {
  260. saveUrl();
  261. uni.showModal({
  262. title: '登录',
  263. content: '您未登录,是否马上登陆?',
  264. success: e => {
  265. if (e.confirm) {
  266. interceptor();
  267. }
  268. },
  269. fail: e => {
  270. console.log(e);
  271. }
  272. });
  273. }
  274. },
  275. methods: {
  276. //发送验证码
  277. verification() {
  278. let obj = this;
  279. if (this.phone == '') {
  280. this.$api.msg('请输入电话号码');
  281. return;
  282. }
  283. if (this.phone.length < 11) {
  284. this.$api.msg('请输入正确的手机号');
  285. return;
  286. }
  287. // 判断是否在倒计时
  288. if (obj.countDown > 0) {
  289. return false;
  290. } else {
  291. obj.countDown = 60;
  292. obj.time = setInterval(() => {
  293. obj.countDown--;
  294. }, 1000);
  295. //调用验证码接口
  296. verify({
  297. phone: obj.phone,
  298. type: 'VERIFICATION_CODE'
  299. })
  300. .then(({ data }) => {})
  301. .catch(err => {
  302. console.log(err);
  303. });
  304. }
  305. },
  306. //
  307. upImag(index,list) {
  308. console.log('上传')
  309. let obj = this
  310. upload({
  311. filename: ''
  312. }).then(res => {
  313. console.log(res[0].url)
  314. obj.sfzShow = false
  315. list[index] = res[0].url
  316. obj.sfzShow = true
  317. });
  318. },
  319. upImag1() {
  320. console.log('上传')
  321. let obj = this
  322. upload({
  323. filename: ''
  324. }).then(res => {
  325. console.log(res[0].url)
  326. obj.bcdimg = res[0].url
  327. });
  328. },
  329. delImg(index,list) {
  330. console.log('删除')
  331. this.sfzShow = false
  332. list[index] = ''
  333. this.sfzShow = true
  334. },
  335. delImg1() {
  336. this.bcdimg = ''
  337. },
  338. sub() {
  339. let obj = this
  340. if(obj.loadingType == 'loading') {
  341. return
  342. }
  343. // 校验
  344. if (obj.name == '') {
  345. return obj.$api.msg('请输入您的姓名')
  346. }
  347. if (obj.age == '') {
  348. return obj.$api.msg('请输入您的年龄')
  349. }
  350. if (obj.cid == '') {
  351. return obj.$api.msg('请输入您的身份证号')
  352. }
  353. if (obj.sname == '') {
  354. return obj.$api.msg('请输入您的配偶姓名')
  355. }
  356. if (obj.sage == '') {
  357. return obj.$api.msg('请输入您的配偶年龄')
  358. }
  359. if (obj.scid == '') {
  360. return obj.$api.msg('请输入您的配偶身份证号')
  361. }
  362. if (obj.bcd == '') {
  363. return obj.$api.msg('请输入您的银行卡号')
  364. }
  365. if (obj.bank == '') {
  366. return obj.$api.msg('请输入开户行')
  367. }
  368. if (obj.phone == '') {
  369. return obj.$api.msg('请输入您的联系电话')
  370. }
  371. if (obj.check == '') {
  372. return obj.$api.msg('请输入您的产检次数')
  373. }
  374. if (obj.income == '') {
  375. return obj.$api.msg('请输入家庭年总收入')
  376. }
  377. if (obj.address == '') {
  378. return obj.$api.msg('请输入现居住地址')
  379. }
  380. if (obj.reg == '') {
  381. return obj.$api.msg('请输入户籍地址')
  382. }
  383. if(obj.code == '') {
  384. return obj.$api.msg('请输入验证码')
  385. }
  386. // 身份证正反面拼接
  387. let cidimg = obj.cidimg[0] + ',' + obj.cidimg[1]
  388. if(obj.cidimg[0] == '' || obj.cidimg[1] == '') {
  389. return obj.$api.msg('请上传身份证正反面')
  390. }
  391. // 孕期检查信息拼接
  392. let checkimg = ''
  393. obj.checkimg.forEach(e => {
  394. if(e) {
  395. checkimg = e + ',' + checkimg
  396. }
  397. })
  398. if(checkimg.length == 0) {
  399. return obj.$api.msg('请上传孕期检查信息')
  400. }else {
  401. checkimg = checkimg.substr(0, checkimg.length - 1)
  402. }
  403. if (obj.bcdimg == '') {
  404. return obj.$api.msg('请上传银行卡照片')
  405. }
  406. obj.loadingType = 'loading'
  407. sub_list({
  408. name: obj.name, //姓名
  409. age: obj.age, //年龄
  410. cid: obj.cid, //身份证号
  411. sname: obj.sname, //配偶姓名
  412. sage: obj.sage, //配偶年龄
  413. scid: obj.scid, //配偶身份证号
  414. bcd: obj.bcd, //银行卡号
  415. bank: obj.bank,//开户行
  416. phone: obj.phone, //联系电话
  417. check: obj.check, //产检次数
  418. income: obj.income, //收入
  419. person: obj.person, //人口
  420. address: obj.address, //地址
  421. explain: obj.explain, //说明
  422. cidimg: cidimg, //身份证正反面
  423. checkimg: checkimg, //检查图片截图
  424. bcdimg: obj.bcdimg, //银行卡图片
  425. code: obj.code, //验证码
  426. reg: obj.reg, //户籍
  427. }).then(res => {
  428. obj.loadingType = 'more'
  429. uni.showToast({
  430. title: '提交成功',
  431. duration: 2000
  432. });
  433. })
  434. }
  435. }
  436. }
  437. </script>
  438. <style lang="scss" scoped>
  439. .bz-bg {
  440. width: 750rpx;
  441. }
  442. .bz-tit {
  443. align-items: center;
  444. justify-content: center;
  445. margin-top: 40rpx;
  446. font-size: 36rpx;
  447. font-weight: bold;
  448. color: #f3392c;
  449. .hx {
  450. width: 70rpx;
  451. height: 2rpx;
  452. background-color: #f99a93;
  453. margin: 0 25rpx;
  454. }
  455. }
  456. .tab {
  457. width: 690rpx;
  458. border-radius: 20rpx;
  459. overflow: hidden;
  460. margin: 36rpx auto 0;
  461. box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, 0.2);
  462. }
  463. .bd-wrap {
  464. width: 690rpx;
  465. height: 100rpx;
  466. background-color: #fff;
  467. border-bottom: 1px solid #f2f2f2;
  468. line-height: 100rpx;
  469. font-size: 32rpx;
  470. position: relative;
  471. .code {
  472. position: absolute;
  473. width: 100rpx;
  474. height: 100rpx;
  475. right: 10rpx;
  476. color: #f64342;
  477. font-size: 23rpx;
  478. }
  479. .bg-name {
  480. width: 260rpx;
  481. height: 100%;
  482. padding-left: 20rpx;
  483. }
  484. .bg-val {
  485. width: 430rpx;
  486. height: 100%;
  487. .val-ipt {
  488. display: inline-block;
  489. width: 100%;
  490. height: 100%;
  491. // background-color: #009100;
  492. padding-left: 10rpx;
  493. }
  494. }
  495. }
  496. .sub {
  497. margin-top: 100rpx;
  498. text-align: center;
  499. font-size: 40rpx;
  500. color: #fff;
  501. font-weight: bold;
  502. line-height: 100rpx;
  503. width: 750rpx;
  504. background-color: #f3392c;
  505. }
  506. .sm-wrap {
  507. background-color: #fff;
  508. padding-bottom: 28rpx;
  509. border-bottom: 1px solid #f2f2f2;
  510. position: relative;
  511. .sm-tit {
  512. // line-height: 87rpx;
  513. padding: 20rpx;
  514. font-size: 32rpx;
  515. line-height: 1.5;
  516. // padding-left: 20rpx;
  517. }
  518. .text-area {
  519. height: 156rpx;
  520. width: 634rpx;
  521. border-radius: 20rpx;
  522. border: 1px solid #e8e8e8;
  523. margin: auto;
  524. padding: 10rpx;
  525. }
  526. .pic-num {
  527. position: absolute;
  528. width: 75rpx;
  529. line-height: 34rpx;
  530. border-radius: 17rpx;
  531. background-color: #f3392c;
  532. color: #fff;
  533. font-size: 28rpx;
  534. text-align: center;
  535. right: 10rpx;
  536. top: 22rpx;
  537. }
  538. .img-list {
  539. padding-left: 28rpx;
  540. .img-item {
  541. width: 160rpx;
  542. height: 160rpx;
  543. position: relative;
  544. margin-right: 20rpx;
  545. .upimg {
  546. width: 160rpx;
  547. height: 160rpx;
  548. }
  549. .delimg {
  550. width: 39rpx;
  551. height: 38rpx;
  552. position: absolute;
  553. top: 0;
  554. right: 0;
  555. }
  556. }
  557. }
  558. }
  559. </style>