info_add.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. <extend name="public/base"/>
  2. <block name="css">
  3. <style>
  4. .van-nav-bar--fixed {z-index:100;}
  5. .van-nav-bar .van-icon,.van-nav-bar__text {color:white;}
  6. .van-step--horizontal .van-step__title {font-size:16px;}
  7. .van-step--horizontal .van-step__icon {font-size:16px;}
  8. .van-step__circle {width:10px;height:10px;}
  9. .van-row {width:100%;}
  10. .btn_search_item{background:#f2f6ff;display:inline-block;border-radius:5px;line-height:35px;height:35px;text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:relative;font-size:13px;width:100%;color:#666;margin-bottom:10px;}
  11. .btn_search_item.active{color:var(--pink);background:#fff7fa;}
  12. .btn_search_icon{position:absolute;bottom:-3px;right:-3px;font-size:30px;}
  13. .van-uploader__input-wrapper {width:100%;}
  14. .informed {width:90vw;border-radius:10px;position:relative;box-sizing:border-box;}
  15. .van-dialog__message{text-align:left;white-space:unset;}
  16. .van-dialog__message p {margin-top:10px;text-indent:2em;}
  17. </style>
  18. </block>
  19. <block name="body">
  20. <!--头部-->
  21. <van-nav-bar
  22. class="bg-pink"
  23. left-text="返回"
  24. left-arrow
  25. @click-left="onBack"
  26. fixed="true"
  27. >
  28. <template #title>
  29. <span style="color:white;">基本资料(1/2)</span>
  30. </template>
  31. </van-nav-bar>
  32. <div style="width:100%;height:46px;"></div>
  33. <van-steps :active="0">
  34. <van-step>基本资料</van-step>
  35. <van-step>择偶要求</van-step>
  36. </van-steps>
  37. <!--头图-->
  38. <van-uploader :max-count="1" :after-read="uploadHead" style="padding:20px 0;width:100%;">
  39. <van-image width="30%" style="display:block;margin:0 auto;" :src="head_image"></van-image>
  40. <div style="text-align:center;font-size:14px;color:#999;">点击上传头像</div>
  41. </van-uploader>
  42. <!--增空-->
  43. <van-field
  44. v-model="form.realname"
  45. label="真实姓名"
  46. placeholder="请输入真实姓名"
  47. required
  48. ></van-field>
  49. <van-field
  50. v-model="form.mobile"
  51. label="电话"
  52. placeholder="请输入电话号码"
  53. required
  54. ></van-field>
  55. <van-field name="radio" label="单选框" required>
  56. <template #input>
  57. <van-radio-group v-model="form.sex" direction="horizontal">
  58. <van-radio :name="1">男</van-radio>
  59. <van-radio :name="2">女</van-radio>
  60. </van-radio-group>
  61. </template>
  62. </van-field>
  63. <!--生日-->
  64. <van-field
  65. required
  66. readonly
  67. clickable
  68. :value="form.birthday"
  69. label="生日"
  70. placeholder="点击选择生日"
  71. @click="showBirthday = true"
  72. ></van-field>
  73. <van-popup position="bottom" v-model="showBirthday">
  74. <van-datetime-picker
  75. title="生日"
  76. :value="new Date(form.birthday)"
  77. type="date"
  78. :min-date="minDate"
  79. @confirm="onBirthdayConfirm"
  80. @cancel="showBirthday = false"
  81. ></van-datetime-picker>
  82. </van-popup>
  83. <!--身高-->
  84. <van-field
  85. required
  86. readonly
  87. clickable
  88. :value="form_high"
  89. label="身高"
  90. placeholder="请选择身高(CM)"
  91. @click="showHigh = true"
  92. ></van-field>
  93. <van-popup position="bottom" v-model="showHigh">
  94. <van-picker
  95. title="身高"
  96. show-toolbar
  97. :columns="high"
  98. @confirm="onHighConfirm"
  99. @cancel="showHigh = false"
  100. ></van-picker>
  101. </van-popup>
  102. <!--体重-->
  103. <van-field
  104. required
  105. readonly
  106. clickable
  107. :value="form_weight"
  108. label="体重"
  109. placeholder="请选择体重(KG)"
  110. @click="showWeight = true"
  111. ></van-field>
  112. <van-popup position="bottom" v-model="showWeight">
  113. <van-picker
  114. title="体重"
  115. show-toolbar
  116. :columns="weight"
  117. @confirm="onWeightConfirm"
  118. @cancel="showWeight = false"
  119. ></van-picker>
  120. </van-popup>
  121. <van-field
  122. required
  123. readonly
  124. clickable
  125. :value="form.marry"
  126. label="婚姻状况"
  127. placeholder="请选择婚姻状况"
  128. @click="showMarry = true"
  129. ></van-field>
  130. <van-popup position="bottom" v-model="showMarry">
  131. <van-picker
  132. title="婚姻状况"
  133. show-toolbar
  134. :columns="marry"
  135. @confirm="onMarryConfirm"
  136. @cancel="showMarry = false"
  137. ></van-picker>
  138. </van-popup>
  139. <!--生肖-->
  140. <van-field
  141. required
  142. readonly
  143. clickable
  144. :value="form.animal"
  145. label="生肖"
  146. placeholder="点击选择生肖"
  147. @click="showAnimal = true"
  148. ></van-field>
  149. <van-popup position="bottom" v-model="showAnimal">
  150. <van-picker
  151. title="生肖"
  152. show-toolbar
  153. :columns="animal"
  154. @confirm="onAnimalConfirm"
  155. @cancel="showAnimal = false"
  156. ></van-picker>
  157. </van-popup>
  158. <!--学历-->
  159. <van-field
  160. required
  161. readonly
  162. clickable
  163. :value="form.education"
  164. label="学历"
  165. placeholder="点击选择学历"
  166. @click="showEducation = true"
  167. ></van-field>
  168. <van-popup position="bottom" v-model="showEducation">
  169. <van-picker
  170. title="学历"
  171. show-toolbar
  172. :columns="education"
  173. @confirm="onEducationConfirm"
  174. @cancel="showEducation = false"
  175. ></van-picker>
  176. </van-popup>
  177. <!--年收入-->
  178. <van-field
  179. required
  180. readonly
  181. clickable
  182. :value="form.income"
  183. label="年收入"
  184. placeholder="点击选择年收入"
  185. @click="showIncome = true"
  186. ></van-field>
  187. <van-popup position="bottom" v-model="showIncome">
  188. <van-picker
  189. title="年收入"
  190. show-toolbar
  191. :columns="income"
  192. @confirm="onIncomeConfirm"
  193. @cancel="showIncome = false"
  194. ></van-picker>
  195. </van-popup>
  196. <!--工作单位和职务-->
  197. <van-field
  198. v-model="form.company"
  199. label="工作单位"
  200. placeholder="请输入工作单位"
  201. ></van-field>
  202. <van-field
  203. v-model="form.job"
  204. label="职务"
  205. placeholder="请输入职务"
  206. ></van-field>
  207. <!--家庭成员-->
  208. <van-field name="form.family" label="家庭成员">
  209. <template #input>
  210. <van-row :gutter="10">
  211. <van-col span="8" v-for="(item) in family">
  212. <div :class="{btn_search_item:true,active: in_array(item,form.family)}"
  213. @click="selectFamily(item)">
  214. {{item}}
  215. <van-icon v-if="in_array(item,form.family)"
  216. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  217. </div>
  218. </van-col>
  219. </van-row>
  220. </template>
  221. </van-field>
  222. <!--籍贯-->
  223. <van-field
  224. v-model="form.native"
  225. label="籍贯"
  226. placeholder="请输入籍贯"
  227. ></van-field>
  228. <van-field
  229. v-model="form.live_place"
  230. label="居住地"
  231. placeholder="请输入居住地"
  232. ></van-field>
  233. <!--民族-->
  234. <van-field
  235. readonly
  236. clickable
  237. :value="form.nation"
  238. label="民族"
  239. placeholder="点击选择民族"
  240. @click="showNation = true"
  241. ></van-field>
  242. <van-popup position="bottom" v-model="showNation">
  243. <van-picker
  244. title="民族"
  245. show-toolbar
  246. :columns="nation"
  247. @confirm="onNationConfirm"
  248. @cancel="showNation = false"
  249. ></van-picker>
  250. </van-popup>
  251. <!--兴趣爱好-->
  252. <van-field
  253. v-model="form.hobby"
  254. autosize
  255. label="兴趣爱好"
  256. type="textarea"
  257. placeholder="请输入兴趣爱好"
  258. ></van-field>
  259. <van-field
  260. v-model="form.comment"
  261. autosize
  262. label="备注"
  263. type="textarea"
  264. placeholder="请输入备注"
  265. ></van-field>
  266. <h3 class="fz16 mb10 pt20 plr12">工作生活</h3>
  267. <!--房车,与父母同住-->
  268. <van-field
  269. readonly
  270. clickable
  271. :value="tinyint[form.have_house]"
  272. label="是否有房"
  273. placeholder="点击选择是否有房"
  274. @click="showHaveHouse = true"
  275. ></van-field>
  276. <van-popup position="bottom" v-model="showHaveHouse">
  277. <van-picker
  278. title="是否有房"
  279. show-toolbar
  280. :columns="tinyint"
  281. @confirm="onHaveHouseConfirm"
  282. @cancel="showHaveHouse = false"
  283. ></van-picker>
  284. </van-popup>
  285. <van-field
  286. readonly
  287. clickable
  288. :value="tinyint[form.have_car]"
  289. label="是否有车"
  290. placeholder="点击选择是否有车"
  291. @click="showHaveCar = true"
  292. ></van-field>
  293. <van-popup position="bottom" v-model="showHaveCar">
  294. <van-picker
  295. title="是否有车"
  296. show-toolbar
  297. :columns="tinyint"
  298. @confirm="onHaveCarConfirm"
  299. @cancel="showHaveCar = false"
  300. ></van-picker>
  301. </van-popup>
  302. <van-field
  303. readonly
  304. clickable
  305. :value="tinyint[form.with_parent_live]"
  306. label="婚后是否愿意与父母同住"
  307. placeholder="点击选择"
  308. @click="showWithParentLive = true"
  309. ></van-field>
  310. <van-popup position="bottom" v-model="showWithParentLive">
  311. <van-picker
  312. title="婚后是否愿意与父母同住"
  313. show-toolbar
  314. :columns="tinyint"
  315. @confirm="onWithParentLiveConfirm"
  316. @cancel="showWithParentLive = false"
  317. ></van-picker>
  318. </van-popup>
  319. <van-field
  320. readonly
  321. clickable
  322. :value="tinyint[form.want_birth]"
  323. label="是否愿意生育"
  324. placeholder="点击选择"
  325. @click="showWantBirth = true"
  326. ></van-field>
  327. <van-popup position="bottom" v-model="showWantBirth">
  328. <van-picker
  329. title="是否愿意生育"
  330. show-toolbar
  331. :columns="tinyint"
  332. @confirm="onWantBirthConfirm"
  333. @cancel="showWantBirth = false"
  334. ></van-picker>
  335. </van-popup>
  336. <!--是否吸烟-->
  337. <van-field
  338. readonly
  339. clickable
  340. :value="form.smoke"
  341. label="是否吸烟"
  342. placeholder="点击选择是否吸烟"
  343. @click="showSmoke = true"
  344. ></van-field>
  345. <van-popup position="bottom" v-model="showSmoke">
  346. <van-picker
  347. title="是否吸烟"
  348. show-toolbar
  349. :columns="smoke"
  350. @confirm="onSmokeConfirm"
  351. @cancel="showSmoke = false"
  352. ></van-picker>
  353. </van-popup>
  354. <!--是否喝酒-->
  355. <van-field
  356. readonly
  357. clickable
  358. :value="form.drink"
  359. label="是否喝酒"
  360. placeholder="点击选择是否喝酒"
  361. @click="showDrink = true"
  362. ></van-field>
  363. <van-popup position="bottom" v-model="showDrink">
  364. <van-picker
  365. title="是否喝酒"
  366. show-toolbar
  367. :columns="drink"
  368. @confirm="onDrinkConfirm"
  369. @cancel="showDrink = false"
  370. ></van-picker>
  371. </van-popup>
  372. <van-popup v-model="showTip" round>
  373. <div class="informed">
  374. <div class="van-dialog__header" style="font-weight:bold;">知情通知书</div>
  375. <div class="van-dialog__content">
  376. <div class="van-dialog__message van-dialog__message--has-title">
  377. <p>Hi,朋友~</p>
  378. <p>欢迎您的加入!</p>
  379. <p>1.本平台为晋江市妇女联合会联合晋江市致和社工事务所倾情打造的公益红娘信息平台。该服务属于公益性质,相关服务活动自愿参加、风险自担、责任自负。</p>
  380. <p>2.信息录入的青年必须是单身人士,请如实填写个人信息,诚信参与。</p>
  381. <p>3.所录入的信息平台会绝对保护隐私,请放心填写。</p>
  382. <p>4.红娘在提供婚恋服务的过程中,不可收取任何费用。</p>
  383. <p>如认可以上信息,请按同意,继续填写您的个人信息。</p>
  384. <p>谢谢配合!</p>
  385. </div>
  386. </div>
  387. <div class="van-hairline--top van-dialog__footer" @click="showTip = false">
  388. <button type="button" class="van-button van-button--default van-button--large van-dialog__confirm">
  389. <div class="van-button__content">
  390. <span class="van-button__text">同意</span>
  391. </div>
  392. </button>
  393. </div>
  394. </div>
  395. </van-popup>
  396. <div style="padding:16px;">
  397. <van-button block class="bg-pink" @click="onSubmit">下一步</van-button>
  398. </div>
  399. </block>
  400. <block name="script">
  401. <script>
  402. new Vue({
  403. el: '#app',
  404. data() {
  405. return {
  406. form: {
  407. matchmaker_id: {$id},
  408. realname: '',
  409. sex: 0,
  410. mobile: '',
  411. avatar: '',
  412. birthday: '',
  413. animal: '',
  414. high: 0,
  415. weight: 0,
  416. education: '',
  417. company: '',
  418. job: '',
  419. income: '',
  420. nation: '',
  421. hobby: '',
  422. smoke: '',
  423. drink: '',
  424. family: [],
  425. native: '',
  426. live_place: '',
  427. have_house: 0,
  428. want_birth: 1,
  429. have_car: 0,
  430. with_parent_live: 0,
  431. marry: '',
  432. comment: '',
  433. },
  434. showSex: false,
  435. sex: {$sex},
  436. showBirthday: false,
  437. minDate: new Date(1970, 0, 1),
  438. showHigh: false,
  439. high: {$high},
  440. showWeight: false,
  441. weight: {$weight},
  442. showMarry: false,
  443. marry: {$marry},
  444. showEducation: false,
  445. education: {$education},
  446. showIncome: false,
  447. income: {$income},
  448. showNation: false,
  449. nation: {$nation},
  450. showTalentLevel: false,
  451. showSmoke: false,
  452. smoke: {$smoke},
  453. showDrink: false,
  454. drink: {$drink},
  455. family: {$family},
  456. showHaveHouse: false,
  457. showHaveCar: false,
  458. showWithParentLive: false,
  459. tinyint: {$tinyint},
  460. animal: {$animal},
  461. showAnimal: false,
  462. showWantBirth: false,
  463. showTip: true,
  464. };
  465. },
  466. methods: {
  467. in_array(search,array){
  468. for(var i in array){
  469. if(array[i] == search){
  470. return true;
  471. }
  472. }
  473. return false;
  474. },
  475. onBack() {
  476. history.back();
  477. },
  478. onSubmit() {
  479. if (this.form.realname == '') {
  480. this.$toast('请输入真实姓名');
  481. return false;
  482. }
  483. if (this.form.mobile == '') {
  484. this.$toast('请输入电话');
  485. return false;
  486. }
  487. if (this.form.sex == 0) {
  488. this.$toast('请选择性别');
  489. return false;
  490. }
  491. if (this.form.birthday == '') {
  492. this.$toast('请选择正确的生日');
  493. return false;
  494. }
  495. if (this.form.animal == '') {
  496. this.$toast('请选择生肖');
  497. return false;
  498. }
  499. if (this.form.marry == '') {
  500. this.$toast('请选择婚姻状况');
  501. return false;
  502. }
  503. if (this.form.education == '') {
  504. this.$toast('请选择学历');
  505. return false;
  506. }
  507. if (this.form.income == '') {
  508. this.$toast('请选择年收入');
  509. return false;
  510. }
  511. let self = this;
  512. $.post("{:url('infoAddPost')}", this.form, function (json) {
  513. if (json.code) {
  514. location.href = "{:url('matingAdd')}?id=" + json.data.id;
  515. } else {
  516. self.$toast(json.msg);
  517. }
  518. }, 'json');
  519. },
  520. onBirthdayConfirm(date) {
  521. let year = date.getFullYear();
  522. let month = date.getMonth() + 1;
  523. if (month < 10) {
  524. month = "0" + month;
  525. }
  526. let day = date.getDate();
  527. if (day < 10) {
  528. day = "0" + day;
  529. }
  530. this.form.birthday = `${year}-${month}-${day}`;
  531. this.showBirthday = false;
  532. },
  533. onHighConfirm(value) {
  534. this.form.high = value == '保密' ? 0 : value;
  535. this.showHigh = false;
  536. },
  537. onWeightConfirm(value) {
  538. this.form.weight = value == '保密' ? 0 : value;
  539. this.showWeight = false;
  540. },
  541. onMarryConfirm(value) {
  542. this.form.marry = value;
  543. this.showMarry = false;
  544. },
  545. onAnimalConfirm(value) {
  546. this.form.animal = value;
  547. this.showAnimal = false;
  548. },
  549. onEducationConfirm(value) {
  550. this.form.education = value;
  551. this.showEducation = false;
  552. },
  553. onIncomeConfirm(value) {
  554. this.form.income = value;
  555. this.showIncome = false;
  556. },
  557. onNationConfirm(value) {
  558. this.form.nation = value;
  559. this.showNation = false;
  560. },
  561. onHaveHouseConfirm(value,index) {
  562. this.form.have_house = index;
  563. this.showHaveHouse = false;
  564. },
  565. onHaveCarConfirm(value,index) {
  566. this.form.have_car = index;
  567. this.showHaveCar = false;
  568. },
  569. onWithParentLiveConfirm(value,index) {
  570. this.form.with_parent_live = index;
  571. this.showWithParentLive = false;
  572. },
  573. onWantBirthConfirm(value,index){
  574. this.form.want_birth = index;
  575. this.showWantBirth = false;
  576. },
  577. onSmokeConfirm(value) {
  578. this.form.smoke = value;
  579. this.showSmoke = false;
  580. },
  581. onDrinkConfirm(value) {
  582. this.form.drink = value;
  583. this.showDrink = false;
  584. },
  585. removeByVal(arrylist , val) {
  586. for(var i = 0; i < arrylist .length; i++) {
  587. if(arrylist[i] == val) {
  588. arrylist .splice(i, 1);
  589. break;
  590. }
  591. }
  592. },
  593. selectFamily(value) {
  594. if (this.in_array(value,this.form.family)) {
  595. this.removeByVal(this.form.family,value);
  596. } else {
  597. this.form.family.push(value);
  598. }
  599. },
  600. uploadHead(file) {
  601. let self = this;
  602. $.post("{:url('imageUpload')}",{file:file.content,name:file.file.name},function(json){
  603. if (json.code) {
  604. self.form.avatar = json.data.avatar;
  605. self.$forceUpdate();
  606. } else {
  607. self.$toast(json.msg);
  608. }
  609. },'json')
  610. },
  611. },
  612. computed: {
  613. form_high() {
  614. return this.form.high ? this.form.high + 'CM' : '保密';
  615. },
  616. form_weight() {
  617. return this.form.weight ? this.form.weight + 'KG' : '保密';
  618. },
  619. head_image() {
  620. return this.form.avatar ? this.form.avatar : '__TMPL__/public/assets/images/matchmaker/avatar2.png';
  621. }
  622. },
  623. });
  624. </script>
  625. </block>