applicationForm.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="title">登记选择</view>
  5. <view class="info-box">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
  6. <view class="uni-list">
  7. <radio-group class="radio-box" @change="radioChange">
  8. <label v-for="(item, index) in items" :key="item.id">
  9. <label class="radio">
  10. {{ item.name }}
  11. <radio :checked="index === current" color="#E62129" style="transform:scale(0.5)" :value="item.id+''" />
  12. <text></text>
  13. </label>
  14. </label>
  15. </radio-group>
  16. </view>
  17. </view>
  18. <view class="box">
  19. <view class="box-1">
  20. <view class="box-left">姓名</view>
  21. <input type="text" placeholder="请填写你的名字" placeholder-class="placeholder" value="" class="list-input" v-model="name" />
  22. </view>
  23. <view class="box-1">
  24. <view class="box-left">出生年月</view>
  25. <picker mode="date" :value="birthday" :start="startDate" :end="endDate" @change="bindDateChange" class="box-right">
  26. <view>{{ birthday }}</view>
  27. </picker>
  28. </view>
  29. <view class="box-1">
  30. <view class="box-left">性别</view>
  31. <picker @change="bindPickerSex" :value="index" :range="array" class="box-right">
  32. <text>{{ sex == '0' ? '男' : sex == '1' ? '女' : sex }}</text>
  33. </picker>
  34. </view>
  35. <view class="box-1">
  36. <view class="box-left">学历</view>
  37. <picker @change="bindPickerEdu" :value="index" :range="chooseEdu" class="box-right">
  38. <text>{{ education }}</text>
  39. </picker>
  40. </view>
  41. <view class="box-1">
  42. <view class="box-left">身份证号</view>
  43. <input type="text" placeholder="请填写你的身份证号" placeholder-class="placeholder" value="" class="list-input" v-model="card" />
  44. </view>
  45. <view class="box-1">
  46. <view class="box-left">移动电话</view>
  47. <input type="text" placeholder="请填写你的联系电话" placeholder-class="placeholder" value="" class="list-input" v-model="phone" />
  48. </view>
  49. <view class="box-1">
  50. <view class="box-left">职业/职务</view>
  51. <input type="text" value="" placeholder="请填写你的职业/职务" placeholder-class="placeholder" class="list-input" v-model="occupation" />
  52. </view>
  53. </view>
  54. <view class="top">
  55. <view class="title">个人声明</view>
  56. <view class="info-box">遗体器官捐献是服务医疗事业,造福人类的高尚行为,是“人道、博爱、奉献”精神的崇高体现,我已了解遗体器官捐献的基本常识和有关政策法规。</view>
  57. <view class="info-box" style="padding-top: 0;">我自愿登记成为遗体器官捐献志愿者,自愿无偿捐献:</view>
  58. <view class="uni-list" style="display: block;">
  59. <checkbox-group v-if="type == '人体器官' && ready" @change="checkAllClick" style="padding-left: 50rpx;">
  60. <label class="checkbox">
  61. <checkbox :checked="checkAll.type" color="#E62129" style="transform:scale(0.6);margin: 0;padding: 0;" :value="checkAll.name" />
  62. {{ checkAll.name }}
  63. </label>
  64. </checkbox-group>
  65. <view style="display: flex;">
  66. <view class="" v-if="type == '人体器官'" style="width: 50rpx;">或:</view>
  67. <checkbox-group v-if="type == '人体器官'" style="display: inline-block;width: 600rpx;" @change="checkboxChange">
  68. <label class="checkbox" v-for="item in apparatus" :key="item.name">
  69. <checkbox :checked="item.type" color="#E62129" style="transform:scale(0.6);margin: 0;padding: 0;" :value="item.name" />
  70. {{ item.name }}
  71. </label>
  72. </checkbox-group>
  73. </view>
  74. <view class="font">请执行人和所有亲属尊重我的决定。</view>
  75. </view>
  76. </view>
  77. <view class="top">
  78. <view class="title">人体器官捐献执行人信息</view>
  79. <view class="info-box">我指定该亲属为我的器官捐献执行人,全权负责本人的器官捐献事宜,我保证填写的内容信息真实,如发生变更及时告知登记机构。</view>
  80. <view class="uni-list" style="display: block;">
  81. <view class="box-1" style="margin-top: 0rpx;">
  82. <view class="box-left">捐献执行人</view>
  83. <input type="text" value="" placeholder-class="placeholder" placeholder="请填写执行人姓名" class="list-input" v-model="executor" />
  84. </view>
  85. <view class="box-1" style="margin-top: 20rpx;">
  86. <view class="box-left">亲属关系</view>
  87. <input type="text" value="" placeholder-class="placeholder" placeholder="请填写与本人的关系" class="list-input" v-model="relation" />
  88. </view>
  89. <view class="box-1" style="margin-top: 20rpx;">
  90. <view class="box-left">身份证号</view>
  91. <input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属身份证号" class="list-input" v-model="sfz" />
  92. </view>
  93. <view class="box-1" style="margin-top: 20rpx;">
  94. <view class="box-left">联系电话</view>
  95. <input type="text" value="" placeholder-class="placeholder" placeholder="请填写亲属联系电话" class="list-input" v-model="n_phone" />
  96. </view>
  97. </view>
  98. </view>
  99. <view class="buttomBox"><view class="buttom" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view></view>
  100. </view>
  101. </template>
  102. <script>
  103. import { joinSecc, getList, donate_ify } from '@/api/index.js';
  104. import { upload } from '@/api/ask.js';
  105. export default {
  106. data() {
  107. const currentDate = this.getDate({
  108. format: true
  109. });
  110. return {
  111. ready: true,
  112. all: false,
  113. isall: false,
  114. type: '',
  115. loding: false, //是否提交中
  116. array: ['男', '女'],
  117. chooseEdu: ['小学以下', '小学', '初中', '高中/中专', '大专/本科', '硕士', '博士', '博士后'],
  118. chooseVol: ['是', '否'],
  119. chooseExp: ['是', '否'],
  120. items: [],
  121. remark: '',
  122. current: '',
  123. index: 0,
  124. mz: '',
  125. cardimg: '', //证件照
  126. checklist: [],
  127. name: '',
  128. sex: '请选择你的性别',
  129. birthday: '请选择你的出生年月',
  130. card: '',
  131. occupation: '',
  132. education: '请选择你的文化程度',
  133. educationid: '',
  134. phone: '',
  135. executor: '', //执行人名字
  136. relation: '', //执行人关系
  137. n_phone: '', //执行人电话
  138. sfz: '', //执行人身份证号
  139. Getchecked: false,
  140. Getcheckeds: false,
  141. address: '',
  142. work: '',
  143. other: '',
  144. friendOnename: '',
  145. friendOnerelation: '',
  146. friendOnephone: '',
  147. friendOneaddress: '',
  148. friendOneweixin: '',
  149. friendTwoname: '',
  150. friendTworelation: '',
  151. friendTwophone: '',
  152. friendTwoaddress: '',
  153. friendTwoweixin: ''
  154. };
  155. },
  156. computed: {
  157. startDate() {
  158. return this.getDate('start');
  159. },
  160. endDate() {
  161. return this.getDate('end');
  162. }
  163. },
  164. onLoad() {
  165. donate_ify().then(e => {
  166. this.items = e.data;
  167. });
  168. },
  169. methods: {
  170. async join() {
  171. const obj = this
  172. joinSecc({
  173. full_name: obj.name, //姓名
  174. sex: obj.sex, //性别0男1女
  175. birthday: obj.birthday, //生日
  176. id_card: obj.card, //身份证号
  177. vocation: obj.occupation, //职业
  178. education: obj.educationid, //学历
  179. category_ids: obj.type, //捐献类型
  180. mobile: obj.phone, //移动电话
  181. executor: obj.executor, //捐献执行人
  182. executor_id_card: obj.sfz, //执行人身份证号
  183. executor_mobile: obj.n_phone, //执行人移动电话
  184. executor_relation: obj.relation //执行人关系
  185. })
  186. .then(e => {
  187. console.log(e, '2322222222222222222222222222222222222222');
  188. obj.name = '';
  189. obj.sex = '请选择你的性别';
  190. obj.education = '请选择你的文化程度';
  191. obj.birth = '请选择你的出生年月';
  192. obj.executor = '';
  193. obj.sfz = '';
  194. obj.n_phone = '';
  195. obj.relation = '';
  196. uni.navigateTo({
  197. url: '../joinSuc/joinNow'
  198. });
  199. })
  200. .catch(function(e) {
  201. console.log('出错了');
  202. console.log(e);
  203. });
  204. },
  205. imgsub() {
  206. console.log('imgsub');
  207. upload({
  208. filename: ''
  209. }).then(data => {
  210. this.cardimg = data[0].url;
  211. });
  212. },
  213. // 选择性别
  214. bindPickerSex: function(e) {
  215. this.sex = e.target.value;
  216. this.index = e.target.value + 1;
  217. },
  218. // 选择教育程度
  219. bindPickerEdu: function(e) {
  220. this.education = this.chooseEdu[e.target.value];
  221. this.educationid = e.target.value;
  222. console.log(this.educationid);
  223. },
  224. // 选择日期
  225. bindDateChange: function(e) {
  226. console.log(e);
  227. this.birthday = e.target.value;
  228. console.log(this.birthday);
  229. },
  230. //选择填写日期
  231. fillingDateChange: function(e) {
  232. this.add_time = e.target.value;
  233. },
  234. // 是否参加志愿活动
  235. bindPickerVol: function(e) {
  236. this.is_vol = this.chooseVol[e.target.value];
  237. this.index = e.target.value + 1;
  238. },
  239. // 有无服务经验
  240. bindPickerExp: function(e) {
  241. console.log('有无服务经验', e.target.value);
  242. this.is_experience = this.chooseExp[e.target.value];
  243. this.index = e.target.value + 1;
  244. },
  245. // 选择捐献
  246. radioChange: function(evt) {
  247. console.log('选择捐献', evt);
  248. for (let i = 0; i < this.items.length; i++) {
  249. console.log(this.items[i].id,evt.detail.value)
  250. if (this.items[i].id == evt.detail.value) {
  251. this.type = evt.detail.value;
  252. console.log('this.type', this.type);
  253. this.current = i;
  254. console.log('this.current', this.current);
  255. break;
  256. }
  257. }
  258. if (this.type == '遗体捐献') {
  259. this.remark = '遗体捐献';
  260. this.all = true;
  261. }
  262. },
  263. checkboxChangeAll(e) {
  264. const obj = this;
  265. for (let i = 0; i < obj.apparatus.length; i++) {
  266. obj.apparatus[i].type = false;
  267. }
  268. if (obj.remark != ' ') {
  269. obj.remark = '';
  270. }
  271. console.log(e, '`11111');
  272. obj.remark = e.detail.value.join(',');
  273. console.log(obj.remark);
  274. obj.all = true;
  275. },
  276. //器官捐献时选择要捐献的器官
  277. checkboxChange(e) {
  278. const obj = this;
  279. obj.all = false;
  280. this.checkAll.type = false;
  281. this.reload();
  282. if (obj.remark != '') {
  283. if (obj.remark.indexOf('all') != -1) {
  284. obj.remark = '';
  285. }
  286. }
  287. obj.remark = e.detail.value.join(',');
  288. for (let i = 0; i < obj.apparatus.length; i++) {
  289. if (obj.remark.indexOf(obj.apparatus[i].name) != -1) {
  290. obj.apparatus[i].type = true;
  291. }
  292. }
  293. console.log(obj.remark);
  294. },
  295. Getcheckbox() {
  296. let obj = this;
  297. obj.Getchecked = !obj.Getchecked;
  298. },
  299. Getcheckboxs() {
  300. let obj = this;
  301. obj.Getcheckeds = !obj.Getcheckeds;
  302. },
  303. getDate(type) {
  304. const date = new Date();
  305. let year = date.getFullYear();
  306. let month = date.getMonth() + 1;
  307. let day = date.getDate();
  308. if (type === 'start') {
  309. year = year - 60;
  310. } else if (type === 'end') {
  311. year = year + 2;
  312. }
  313. month = month > 9 ? month : '0' + month;
  314. day = day > 9 ? day : '0' + day;
  315. return `${year}-${month}-${day}`;
  316. },
  317. // 选择可提供时间
  318. // this.quantum = item.detail.value.join(',');
  319. checktime1(e) {
  320. // var items = this.timeList,
  321. // let quantum = [];
  322. this.quantum = e.detail.value.join(',');
  323. console.log(this.quantum);
  324. },
  325. checktime2(e) {
  326. // var items = this.timeList,
  327. let values = e.detail.value;
  328. // let quantum = [];
  329. console.log(values);
  330. },
  331. checktime3(e) {
  332. // var items = this.timeList,
  333. let values = e.detail.value;
  334. // let quantum = [];
  335. console.log(values);
  336. },
  337. //选择有兴趣参与的工作
  338. checkjob(item) {
  339. this.taste = item.detail.value.join(',');
  340. },
  341. // 选择专长checkspeciality
  342. checkspeciality(item) {
  343. this.speciali = item.detail.value.join(',');
  344. },
  345. reload() {
  346. this.ready = false;
  347. this.$nextTick(function() {
  348. this.ready = true;
  349. });
  350. },
  351. checkAllClick(e) {
  352. let obj = this;
  353. console.log(e.detail.value[0]);
  354. if (e.detail.value[0]) {
  355. this.remark = e.detail.value[0];
  356. for (let i = 0; i < obj.apparatus.length; i++) {
  357. obj.apparatus[i].type = false;
  358. }
  359. } else {
  360. this.remark = '';
  361. }
  362. console.log(this.remark);
  363. }
  364. }
  365. };
  366. </script>
  367. <style lang="scss">
  368. page {
  369. background: #f2f2f2;
  370. }
  371. .content {
  372. background: #f2f2f2;
  373. .top {
  374. margin-top: 16rpx;
  375. background: #ffffff;
  376. position: relative;
  377. .title {
  378. height: 106rpx;
  379. text-align: center;
  380. line-height: 106rpx;
  381. border-bottom: 2rpx #acacac dashed;
  382. font-size: 34rpx;
  383. font-family: PingFang SC;
  384. font-weight: 500;
  385. color: #101010;
  386. }
  387. .info-box {
  388. font-size: 24rpx;
  389. font-family: PingFang SC;
  390. font-weight: 500;
  391. color: #666666;
  392. text-indent: 1em;
  393. padding: 37rpx 60rpx 0rpx 36rpx;
  394. text {
  395. color: #101010;
  396. font-family: PingFang-SC-Medium;
  397. font-weight: bold;
  398. }
  399. // border: 3rpx solid #009100;
  400. }
  401. .uni-list {
  402. padding: 26rpx 34rpx 50rpx 35rpx;
  403. // .radio:first-child {
  404. // margin: -6rpx;
  405. // }
  406. .radio {
  407. margin-left: 50rpx;
  408. flex: 1;
  409. align-items: center;
  410. font-size: 24rpx;
  411. font-family: PingFang SC;
  412. font-weight: 500;
  413. color: #191919;
  414. }
  415. .checkbox {
  416. display: inline-block;
  417. font-size: 24rpx;
  418. font-family: PingFang SC;
  419. font-weight: 500;
  420. color: #191919;
  421. }
  422. .box-2 {
  423. display: flex;
  424. justify-content: space-between;
  425. align-items: center;
  426. width: 100%;
  427. margin-top: 8rpx;
  428. // height: 133rpx;
  429. .box-left {
  430. padding-left: 2rpx;
  431. text-align: left;
  432. width: 62rpx;
  433. font-size: 24rpx;
  434. font-family: PingFang SC;
  435. font-weight: 500;
  436. color: #191919;
  437. }
  438. input {
  439. height: 66rpx;
  440. line-height: 66rpx;
  441. // height: 88rpx;
  442. }
  443. .list-input {
  444. padding-left: 22rpx;
  445. // margin: 12rpx 0 ;
  446. font-size: 28rpx;
  447. display: flex;
  448. justify-content: center;
  449. // line-height: 66rpx;
  450. display: flex;
  451. align-items: center;
  452. flex: 1;
  453. color: #000000;
  454. border: 1px solid #d2d2d2;
  455. text-align: left;
  456. .input-placeholder {
  457. height: 70rpx;
  458. color: #959595;
  459. }
  460. }
  461. .box-right {
  462. display: flex;
  463. padding-left: 22rpx;
  464. height: 66rpx;
  465. line-height: 66rpx;
  466. border: 1px solid #d2d2d2;
  467. // margin: 32rpx 36rpx 0 36rpx;
  468. width: 500rpx;
  469. font-size: 28rpx;
  470. color: #959595;
  471. text-align: left !important;
  472. // line-height: 1;
  473. }
  474. }
  475. .font {
  476. margin-top: 22rpx;
  477. font-size: 24rpx;
  478. font-family: PingFang SC;
  479. font-weight: 500;
  480. color: #666666;
  481. }
  482. }
  483. .agree {
  484. display: flex;
  485. align-items: center;
  486. padding: 37rpx 60rpx 40rpx 36rpx;
  487. font-size: 24rpx;
  488. font-family: PingFang SC;
  489. font-weight: 500;
  490. color: #191919;
  491. }
  492. }
  493. .buttomBox {
  494. height: 100rpx;
  495. // padding-bottom: 40rpx;
  496. }
  497. .buttom {
  498. width: 100%;
  499. height: 100rpx;
  500. background: #f3392c;
  501. font-size: 36rpx;
  502. font-weight: 400;
  503. color: #ffffff;
  504. line-height: 100rpx;
  505. text-align: center;
  506. &.action {
  507. background: #999999;
  508. }
  509. }
  510. .box {
  511. margin-top: 16rpx;
  512. width: 100%;
  513. background-color: #ffffff;
  514. border-radius: 10rpx;
  515. padding: 28rpx 20rpx 32rpx 20rpx;
  516. position: relative;
  517. .red-box {
  518. width: 405rpx;
  519. line-height: 66rpx;
  520. text-align: center;
  521. background: linear-gradient(0deg, #c90f1b, #f14d33);
  522. border-radius: 10rpx;
  523. font-size: 30rpx;
  524. font-weight: 500;
  525. color: #ffffff;
  526. // position: relative;
  527. position: absolute;
  528. top: -36rpx;
  529. left: 50%;
  530. transform: translateX(-50%);
  531. z-index: 1;
  532. }
  533. .box-check {
  534. font-size: 28rpx;
  535. font-weight: 500;
  536. color: #666666;
  537. line-height: 100rpx;
  538. }
  539. .upload-box {
  540. width: 100%;
  541. height: 247rpx;
  542. background: #ffffff;
  543. // border: 1px solid #E63931;
  544. border-radius: 27rpx;
  545. display: flex;
  546. flex-direction: column;
  547. padding: 30rpx 40rpx 30rpx 0;
  548. margin: 42rpx auto 30rpx;
  549. .upload-left {
  550. font-weight: 400;
  551. color: #000000;
  552. }
  553. .upload-right {
  554. flex: 1;
  555. display: flex;
  556. align-items: center;
  557. justify-content: center;
  558. .upload-img {
  559. width: 150rpx;
  560. height: 150rpx;
  561. margin-top: 24rpx;
  562. }
  563. }
  564. }
  565. }
  566. .box-1 {
  567. display: flex;
  568. justify-content: space-between;
  569. align-items: center;
  570. width: 100%;
  571. margin-top: 42rpx;
  572. // height: 133rpx;
  573. .box-left {
  574. padding-left: 2rpx;
  575. width: 184rpx;
  576. text-align: left;
  577. font-size: 28rpx;
  578. font-family: PingFang SC;
  579. font-weight: 500;
  580. color: #191919;
  581. }
  582. input {
  583. height: 66rpx;
  584. line-height: 66rpx;
  585. // height: 88rpx;
  586. }
  587. .list-input {
  588. padding-left: 22rpx;
  589. // margin: 12rpx 0 ;
  590. font-size: 28rpx;
  591. // line-height: 66rpx;
  592. display: flex;
  593. align-items: center;
  594. flex: 1;
  595. color: #000000;
  596. width: 500rpx;
  597. border: 1px solid #d2d2d2;
  598. text-align: left;
  599. .input-placeholder {
  600. height: 70rpx;
  601. color: #959595;
  602. }
  603. }
  604. .box-right {
  605. display: flex;
  606. padding-left: 22rpx;
  607. height: 66rpx;
  608. line-height: 66rpx;
  609. border: 1px solid #d2d2d2;
  610. // margin: 32rpx 36rpx 0 36rpx;
  611. width: 500rpx;
  612. font-size: 28rpx;
  613. color: #959595;
  614. text-align: left !important;
  615. // line-height: 1;
  616. }
  617. }
  618. }
  619. .placeholder {
  620. line-height: 66rpx;
  621. }
  622. </style>