applicationForm.vue 16 KB

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