applicationForm.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. <template>
  2. <view class="content">
  3. <view class="red-box">申请登记</view>
  4. <view class="jg"></view>
  5. <view class="box">
  6. <view class="box-1">
  7. <view class="box-left">
  8. 姓名
  9. <text class="imp"></text>
  10. </view>
  11. <input type="text" value="" class="list-input" v-model="name" placeholder="请输入您的姓名" />
  12. </view>
  13. <view class="box-1">
  14. <view class="box-left">性别:</view>
  15. <picker @change="bindPickerSex" :value="index" :range="array" class="box-right">
  16. <text :class="{'action': !sex}">{{ sex || '请输入您的性别' }}</text>
  17. </picker>
  18. </view>
  19. <view class="box-1">
  20. <view class="box-left">出生年月:</view>
  21. <picker mode="date" :value="birthday" fields="month" :start="startDate" :end="endDate" @change="bindDateChange" class="box-right">
  22. <view :class="{'action': !birthday}">{{ birthday || '请输入您的生日' }}</view>
  23. </picker>
  24. </view>
  25. <view class="box-1">
  26. <view class="box-left">文化程度:</view>
  27. <picker @change="bindPickerEdu" :value="index" :range="chooseEdu" class="box-right">
  28. <text :class="{'action': !education}">{{ education || '请输入您的文化程度' }}</text>
  29. </picker>
  30. </view>
  31. <view class="box-1">
  32. <view class="box-left">职业:</view>
  33. <input type="text" value="" class="list-input" v-model="occupation" placeholder="请输入您的职业"/>
  34. </view>
  35. <view class="box-1">
  36. <view class="box-left">身份证号码:</view>
  37. <input type="text" value="" class="list-input" v-model="card" placeholder="请输入您的身份证号"/>
  38. </view>
  39. <view class="box-1">
  40. <view class="box-left">申请日期:</view>
  41. <picker mode="date" :value="add_time" fields="day" :start="startDate" :end="endDate" @change="fillingDateChange" class="box-right">
  42. <view :class="{'action': !sex}">{{ add_time || '请输入申请日期'}}</view>
  43. </picker>
  44. </view>
  45. <view class="box-1">
  46. <view class="box-left">移动电话:</view>
  47. <input type="text" class="list-input" v-model="phone" placeholder="请输入移动电话"/>
  48. </view>
  49. <view class="box-1">
  50. <view class="box-left">固定电话:</view>
  51. <input type="text" class="list-input" v-model="tel" placeholder="请输入固定电话"/>
  52. </view>
  53. <view class="box-1">
  54. <view class="box-left">居住地址:</view>
  55. <input type="text" class="list-input" v-model="address" placeholder="请输入居住地址"/>
  56. </view>
  57. <view class="check-box">
  58. <!-- <view class="info">( 请在选项□内打√ )</view> -->
  59. <radio-group @change="radioChange">
  60. <label class="check-main" v-for="(item, index) in items" :key="item.value">
  61. <view><radio :value="item.value" :checked="index === current" color="#f3392c" style="transform:scale(0.7)" /></view>
  62. <view class="check-text">{{ item.value }}</view>
  63. </label>
  64. </radio-group>
  65. </view>
  66. <view class="box-2">
  67. 我指定:该亲属为我的遗体捐献执行人,全权负责本人的遗体捐赠事宜。
  68. </view>
  69. <view class="box-1">
  70. <view class="box-left">捐献执行人:</view>
  71. <input type="text" class="list-input" v-model="exexutor" placeholder="请输入捐赠执行人姓名"/>
  72. </view>
  73. <view class="box-1">
  74. <view class="box-left">身份证号码:</view>
  75. <input type="text" class="list-input" v-model="sfz" placeholder="请输入执行人身份证号码"/>
  76. </view>
  77. <view class="box-1">
  78. <view class="box-left max-line">与捐献志愿者关系:</view>
  79. <input type="text" class="list-input" v-model="relation" placeholder="请输入与执行人关系"/>
  80. </view>
  81. <view class="box-1">
  82. <view class="box-left max-line">捐献执行人移动电话:</view>
  83. <input type="text" class="list-input" v-model="n_phone" placeholder="请输入执行人移动电话"/>
  84. </view>
  85. <view class="box-1">
  86. <view class="box-left max-line">捐献执行人固定电话:</view>
  87. <input type="text" class="list-input" v-model="n_tel" placeholder="请输入执行人固定电话"/>
  88. </view>
  89. <view class="box-1" style="border-bottom: none;"><view>我保证填写的以上信息准确真实,如发生变更或个人意愿发生变化时,及时告知登记机构。</view></view>
  90. </view>
  91. <view class="buttom" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view>
  92. </view>
  93. </template>
  94. <script>
  95. import { mapState, mapMutations } from 'vuex';
  96. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  97. import { joinSecc } from '@/api/index.js';
  98. import { upload } from '@/api/ask.js';
  99. export default {
  100. data() {
  101. const currentDate = this.getDate({
  102. format: true
  103. });
  104. return {
  105. loding: false, //是否提交中
  106. array: ['男', '女'],
  107. chooseEdu: ['博士后', '博士', '硕士', '本科', '专科', '其他'],
  108. chooseVol: ['是', '否'],
  109. chooseExp: ['是', '否'],
  110. items: [
  111. {
  112. value: '我自愿捐献全部遗体(含器官组织)'
  113. },
  114. {
  115. value: '或只捐献眼角膜'
  116. }
  117. ],
  118. current: '',
  119. index: 0,
  120. mz: '',
  121. cardimg: '', //证件照
  122. checklist: [],
  123. name: '',
  124. sex: '',
  125. birthday: '',
  126. card: '',
  127. occupation: '',
  128. education: '',
  129. add_time: '',
  130. remark: '',
  131. phone: '',
  132. tel: '',
  133. zd_name: '',
  134. address: '',
  135. exexutor: '',
  136. sfz: '',
  137. relation: '',
  138. n_phone: '',
  139. n_tel: ''
  140. };
  141. },
  142. computed: {
  143. ...mapState('user', ['userInfo', 'baseURL', 'hasLogin']),
  144. startDate() {
  145. return this.getDate('start');
  146. },
  147. endDate() {
  148. return this.getDate('end');
  149. }
  150. },
  151. onShow() {
  152. saveUrl();
  153. // let token = uni.getStorageSync('token');
  154. if (!this.hasLogin) {
  155. // 登录拦截
  156. // interceptor();
  157. uni.showModal({
  158. title: '登录',
  159. content: '您未登录,是否马上登陆?',
  160. success: e => {
  161. if (e.confirm) {
  162. interceptor();
  163. }
  164. },
  165. fail: e => {
  166. console.log(e);
  167. }
  168. });
  169. } else {
  170. // this.loadData();
  171. }
  172. },
  173. methods: {
  174. async join() {
  175. let obj = this;
  176. if (obj.name == '') {
  177. obj.$api.msg('请输入您的姓名');
  178. return;
  179. }
  180. if (obj.sex == '') {
  181. obj.$api.msg('请输入您的性别');
  182. return;
  183. }
  184. if (obj.birthday == '') {
  185. obj.$api.msg('请填写您的生日');
  186. return;
  187. }
  188. let reg1 = /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/;
  189. if (!reg1.test(obj.card)) {
  190. obj.$api.msg('请填写正确的身份证信息');
  191. return;
  192. }
  193. if (obj.tel == ''){
  194. obj.$api.msg('请填写您的固定电话');
  195. return;
  196. }
  197. if (obj.occupation == '') {
  198. obj.$api.msg('请填写您的职业');
  199. return;
  200. }
  201. if (obj.address == '') {
  202. obj.$api.msg('请填写您的地址');
  203. return;
  204. }
  205. if (obj.education == '') {
  206. obj.$api.msg('请选择您的文化程度');
  207. return;
  208. }
  209. if (obj.phone == ''){
  210. obj.$api.msg('请填写您的手机号');
  211. return;
  212. }
  213. if (obj.current !== 0 && obj.current !== 1) {
  214. obj.$api.msg('请在选项中打√');
  215. return;
  216. }
  217. if (obj.add_time == '') {
  218. obj.$api.msg('请填写申请日期');
  219. return;
  220. }
  221. if (obj.exexutor == ''){
  222. obj.$api.msg('请填写执行人的姓名');
  223. return;
  224. }
  225. if (obj.relation == ''){
  226. obj.$api.msg('请填写执行人与你的关系');
  227. return;
  228. }
  229. if (obj.sfz == ''){
  230. obj.$api.msg('请填写执行人的身份证');
  231. return;
  232. }
  233. if (obj.n_phone == ''){
  234. obj.$api.msg('请填写执行人的手机号');
  235. return;
  236. }
  237. if (obj.n_tel == ''){
  238. obj.$api.msg('请填写执行人的固定电话');
  239. return;
  240. }
  241. obj.loding = true;
  242. joinSecc({
  243. name: obj.name,
  244. sex: obj.sex,
  245. education: obj.education,
  246. birthday: obj.birthday,
  247. card: obj.card,
  248. phone: obj.phone,
  249. tel: obj.tel,
  250. occupation: obj.occupation,
  251. add_time: obj.add_time,
  252. remark: obj.remark,
  253. address: obj.address,
  254. executor: obj.exexutor,
  255. relation: obj.relation,
  256. sfz: obj.sfz,
  257. n_phone:obj.n_phone,
  258. n_tel:obj.n_tel
  259. })
  260. .then(e => {
  261. console.log(e,'ddddddddddddddddddddddddddd')
  262. obj.name = '';
  263. obj.sex = '';
  264. obj.education = '';
  265. obj.birthday = '';
  266. obj.card = '';
  267. obj.occupation = '';
  268. obj.add_time = '';
  269. obj.phone = '';
  270. obj.tel = '';
  271. obj.zd_name = '';
  272. obj.address = '';
  273. obj.exexutor = '';
  274. obj.sfz = '';
  275. obj.relation = '';
  276. obj.n_phone = '';
  277. obj.n_tel = '';
  278. uni.navigateTo({
  279. url: '../joinSuc/joinNow'
  280. });
  281. })
  282. .catch(function(e) {
  283. console.log('出错了');
  284. console.log(e);
  285. });
  286. },
  287. imgsub() {
  288. console.log('imgsub');
  289. upload({
  290. filename: ''
  291. }).then(data => {
  292. this.cardimg = data[0].url;
  293. });
  294. },
  295. // 选择性别
  296. bindPickerSex: function(e) {
  297. this.sex = this.array[e.target.value];
  298. this.index = e.target.value + 1;
  299. },
  300. // 选择教育程度
  301. bindPickerEdu: function(e) {
  302. this.education = this.chooseEdu[e.target.value];
  303. // console.log('选择选择教育程度',this.education)
  304. this.index = e.target.value + 1;
  305. },
  306. // 选择日期
  307. bindDateChange: function(e) {
  308. this.birthday = e.target.value;
  309. },
  310. //选择填写日期
  311. fillingDateChange: function(e) {
  312. this.add_time = e.target.value;
  313. },
  314. // 是否参加志愿活动
  315. bindPickerVol: function(e) {
  316. this.is_vol = this.chooseVol[e.target.value];
  317. this.index = e.target.value + 1;
  318. },
  319. // 有无服务经验
  320. bindPickerExp: function(e) {
  321. console.log('有无服务经验', e.target.value);
  322. this.is_experience = this.chooseExp[e.target.value];
  323. this.index = e.target.value + 1;
  324. },
  325. // 选择捐献
  326. radioChange: function(evt) {
  327. // console.log('选择捐献',evt)
  328. for (let i = 0; i < this.items.length; i++) {
  329. if (this.items[i].value === evt.target.value) {
  330. this.remark = evt.target.value;
  331. console.log('this.remark', this.remark);
  332. this.current = i;
  333. console.log('this.current', this.current);
  334. break;
  335. }
  336. }
  337. },
  338. getDate(type) {
  339. const date = new Date();
  340. let year = date.getFullYear();
  341. let month = date.getMonth() + 1;
  342. let day = date.getDate();
  343. if (type === 'start') {
  344. year = year - 60;
  345. } else if (type === 'end') {
  346. year = year + 2;
  347. }
  348. month = month > 9 ? month : '0' + month;
  349. day = day > 9 ? day : '0' + day;
  350. return `${year}-${month}-${day}`;
  351. },
  352. // 选择可提供时间
  353. // this.quantum = item.detail.value.join(',');
  354. checktime1(e) {
  355. // var items = this.timeList,
  356. // let quantum = [];
  357. this.quantum = e.detail.value.join(',');
  358. console.log(this.quantum);
  359. },
  360. checktime2(e) {
  361. // var items = this.timeList,
  362. let values = e.detail.value;
  363. // let quantum = [];
  364. console.log(values);
  365. },
  366. checktime3(e) {
  367. // var items = this.timeList,
  368. let values = e.detail.value;
  369. // let quantum = [];
  370. console.log(values);
  371. },
  372. //选择有兴趣参与的工作
  373. checkjob(item) {
  374. this.taste = item.detail.value.join(',');
  375. },
  376. // 选择专长checkspeciality
  377. checkspeciality(item) {
  378. this.speciali = item.detail.value.join(',');
  379. }
  380. }
  381. };
  382. </script>
  383. <style lang="scss">
  384. page {
  385. background-color: #fdcbc2;
  386. height: 100%;
  387. }
  388. .content {
  389. padding-top: 16rpx;
  390. background-color: #fdcbc2;
  391. .top {
  392. width: 100%;
  393. height: 188rpx;
  394. image {
  395. width: 100%;
  396. height: 188rpx;
  397. }
  398. }
  399. .info-box {
  400. text-indent: 64rpx;
  401. margin: 12rpx 0 54rpx;
  402. padding: 0 32rpx 20rpx;
  403. // border: 3rpx solid #009100;
  404. width: 100%;
  405. display: flex;
  406. flex-direction: column;
  407. border-radius: 25rpx;
  408. color: #e63931;
  409. }
  410. .buttom {
  411. // width: 660rpx;
  412. // height: 100rpx;
  413. // background: linear-gradient(0deg, #c90f1b, #f14d33);
  414. // // background: $motif-color;
  415. // border-radius: 50rpx;
  416. // margin: 50rpx auto;
  417. // font-size: 36rpx;
  418. // font-weight: 400;
  419. // color: #ffffff;
  420. // line-height: 100rpx;
  421. // text-align: center;
  422. margin-top: 50rpx;
  423. width: 750rpx;
  424. height: 100rpx;
  425. background: #fa7e67;
  426. // position: fixed;
  427. // bottom: 0;
  428. font-size: 34rpx;
  429. font-family: PingFang SC;
  430. font-weight: 500;
  431. color: #fff;
  432. line-height: 100rpx;
  433. text-align: center;
  434. &.action {
  435. background: #999999;
  436. }
  437. }
  438. .box {
  439. // margin-top: 44rpx;
  440. width: 690rpx;
  441. margin: 20rpx auto 0;
  442. background-color: #ffffff;
  443. border-radius: 10rpx;
  444. padding: 28rpx 20rpx 84rpx 20rpx;
  445. position: relative;
  446. box-shadow: 0 0 20rpx rgba($color: #000000, $alpha: 0.1);
  447. .red-box {
  448. width: 405rpx;
  449. line-height: 66rpx;
  450. text-align: center;
  451. background: linear-gradient(0deg, #c90f1b, #f14d33);
  452. border-radius: 10rpx;
  453. font-size: 30rpx;
  454. font-weight: 500;
  455. color: #FA7E67;
  456. position: absolute;
  457. top: -36rpx;
  458. left: 50%;
  459. transform: translateX(-50%);
  460. z-index: 1;
  461. }
  462. .box-check {
  463. font-size: 28rpx;
  464. font-weight: 500;
  465. color: #666666;
  466. line-height: 100rpx;
  467. }
  468. .imp {
  469. color: red;
  470. margin-left: 5rpx;
  471. }
  472. .check-box {
  473. margin: 44rpx 0rpx;
  474. padding: 25rpx 25rpx;
  475. // border: 3rpx solid #e9b2af;
  476. width: 100%;
  477. display: flex;
  478. flex-direction: column;
  479. border-radius: 25rpx;
  480. color: #ff4500;
  481. .info {
  482. margin-bottom: 32rpx;
  483. }
  484. .info-3 {
  485. margin-top: 12rpx;
  486. line-height: 46rpx;
  487. }
  488. .info-1 {
  489. display: flex;
  490. align-items: center;
  491. input {
  492. height: 56rpx;
  493. width: 400rpx;
  494. line-height: 56rpx;
  495. // margin-top: 32rpx;
  496. width: 300rpx;
  497. // height: 88rpx;
  498. }
  499. .list-input {
  500. padding-left: 24rpx;
  501. display: flex;
  502. align-items: center;
  503. width: 280rpx;
  504. font-size: 36rpx;
  505. // flex: 1;
  506. color: #ff9797;
  507. // border-bottom: 1rpx solid #f3afad;
  508. text-align: center;
  509. padding-right: 24rpx;
  510. .input-placeholder {
  511. width: 400rpx;
  512. height: 70rpx;
  513. color: #ff9797;
  514. }
  515. }
  516. }
  517. .check-main {
  518. display: flex;
  519. align-items: center;
  520. // justify-content: space-between;
  521. width: 100%;
  522. .check-text {
  523. margin-right: 12rpx;
  524. color: #000;
  525. }
  526. .checkbox,
  527. .uni-checkbox-input,
  528. .uni-checkbox-input-checked {
  529. border: 1px solid #ff4500;
  530. background: #ff4500;
  531. color: #fff !important;
  532. }
  533. }
  534. }
  535. .box-2 {
  536. display: flex;
  537. // flex-direction: column;
  538. align-items: center;
  539. width: 100%;
  540. margin-top: 32rpx;
  541. color: #FF4C4C;
  542. .box-left {
  543. padding-left: 2rpx;
  544. // width: 190rpx;
  545. text-align: left;
  546. color: #ff4500;
  547. }
  548. .line {
  549. width: 200rpx;
  550. border-bottom: 1rpx solid #ff9797;
  551. }
  552. }
  553. .box-1 {
  554. display: flex;
  555. align-items: center;
  556. justify-content: space-between;
  557. width: 100%;
  558. border-bottom: solid 1px #f0f0f0;
  559. .box-left {
  560. font-size: 28rpx;
  561. width: 200rpx;
  562. // display: inline-block;
  563. padding-left: 2rpx;
  564. // width: 100%;
  565. text-align: left;
  566. color: #000;
  567. line-height: 1.5;
  568. }
  569. .max-line {
  570. width: 200rpx;
  571. padding-right: 50rpx;
  572. }
  573. input {
  574. margin-right: 36rpx;
  575. display: block;
  576. // width: 460rpx;
  577. height: 99rpx;
  578. line-height: 99rpx;
  579. margin-top: 32rpx;
  580. // height: 88rpx;
  581. font-size: 28rpx;
  582. font-family: PingFang SC;
  583. font-weight: 500;
  584. color: #000;
  585. // line-height: 100px;
  586. }
  587. .list-input {
  588. // padding-left: 24rpx;
  589. // margin: 12rpx 0 ;
  590. // line-height: 66rpx;
  591. display: flex;
  592. align-items: center;
  593. width: 100%;
  594. font-size: 28rpx;
  595. flex: 1;
  596. // color: #FF9797;
  597. // border: 1rpx solid #f3afad;
  598. // border-radius: 22rpx;
  599. text-align: left;
  600. padding-left: 25rpx;
  601. height: 99rpx;
  602. line-height: 99rpx;
  603. margin-top: 0 !important;
  604. .input-placeholder {
  605. height: 99rpx;
  606. color: #999;
  607. }
  608. }
  609. .box-right {
  610. width: 460rpx;
  611. display: flex;
  612. align-items: center;
  613. padding-left: 24rpx;
  614. height: 66rpx;
  615. line-height: 66rpx;
  616. // border: 1rpx solid #f3afad;
  617. border-radius: 22rpx;
  618. // margin: 32rpx 36rpx 0 36rpx;
  619. margin-right: 36rpx;
  620. margin-left: 32rpx;
  621. // width: 96%;
  622. font-size: 28rpx;
  623. // color: #FF9797;
  624. text-align: left;
  625. // line-height: 1;
  626. .action {
  627. color: #999;
  628. }
  629. }
  630. }
  631. .upload-box {
  632. width: 100%;
  633. height: 247rpx;
  634. background: #ffffff;
  635. // border: 1px solid #E63931;
  636. border-radius: 27rpx;
  637. display: flex;
  638. flex-direction: column;
  639. padding: 30rpx 40rpx 30rpx 0;
  640. margin: 0 auto 30rpx;
  641. .upload-left {
  642. font-weight: 400;
  643. color: #e63931;
  644. }
  645. .upload-right {
  646. flex: 1;
  647. display: flex;
  648. align-items: center;
  649. justify-content: center;
  650. .upload-img {
  651. width: 103rpx;
  652. height: 103rpx;
  653. margin-top: 24rpx;
  654. }
  655. }
  656. }
  657. }
  658. }
  659. .red-box {
  660. text-align: center;
  661. font-size: 38rpx;
  662. font-family: PingFang SC;
  663. font-weight: bold;
  664. color: #FA7E67;
  665. padding-top: 50rpx;
  666. }
  667. .jg {
  668. width: 215rpx;
  669. height: 17rpx;
  670. margin: -15rpx auto 34rpx;
  671. background: #fff;
  672. opacity: 0.26;
  673. }
  674. .line-b {
  675. display: inline-block;
  676. height: 20rpx;
  677. border-bottom: 1px solid #e63931;
  678. }
  679. </style>