subsidy.vue 15 KB

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