applicationForm.vue 17 KB

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