info_add.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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. required
  199. v-model="form.company"
  200. label="工作单位"
  201. placeholder="请输入工作单位"
  202. ></van-field>
  203. <van-field
  204. v-model="form.job"
  205. label="职务"
  206. placeholder="请输入职务"
  207. ></van-field>
  208. <!--家庭成员-->
  209. <van-field name="form.family" label="家庭成员">
  210. <template #input>
  211. <van-row :gutter="10">
  212. <van-col span="8" v-for="(item) in family">
  213. <div :class="{btn_search_item:true,active: in_array(item,form.family)}"
  214. @click="selectFamily(item)">
  215. {{item}}
  216. <van-icon v-if="in_array(item,form.family)"
  217. class="iconfont icon-gouxuan-youxiajiaogouxuan btn_search_icon text-pink"></van-icon>
  218. </div>
  219. </van-col>
  220. </van-row>
  221. </template>
  222. </van-field>
  223. <!--籍贯-->
  224. <van-field
  225. v-model="form.native"
  226. label="籍贯"
  227. placeholder="请输入籍贯"
  228. ></van-field>
  229. <van-field
  230. v-model="form.live_place"
  231. label="居住地"
  232. placeholder="请输入居住地"
  233. ></van-field>
  234. <!--民族-->
  235. <van-field
  236. readonly
  237. clickable
  238. :value="form.nation"
  239. label="民族"
  240. placeholder="点击选择民族"
  241. @click="showNation = true"
  242. ></van-field>
  243. <van-popup position="bottom" v-model="showNation">
  244. <van-picker
  245. title="民族"
  246. show-toolbar
  247. :columns="nation"
  248. @confirm="onNationConfirm"
  249. @cancel="showNation = false"
  250. ></van-picker>
  251. </van-popup>
  252. <!--兴趣爱好-->
  253. <van-field
  254. v-model="form.hobby"
  255. autosize
  256. label="兴趣爱好"
  257. type="textarea"
  258. placeholder="请输入兴趣爱好"
  259. ></van-field>
  260. <van-field
  261. v-model="form.comment"
  262. autosize
  263. label="备注"
  264. type="textarea"
  265. placeholder="请输入备注"
  266. ></van-field>
  267. <h3 class="fz16 mb10 pt20 plr12">工作生活</h3>
  268. <!--房车,与父母同住-->
  269. <van-field
  270. readonly
  271. clickable
  272. :value="tinyint[form.have_house]"
  273. label="是否有房"
  274. placeholder="点击选择是否有房"
  275. @click="showHaveHouse = true"
  276. ></van-field>
  277. <van-popup position="bottom" v-model="showHaveHouse">
  278. <van-picker
  279. title="是否有房"
  280. show-toolbar
  281. :columns="tinyint"
  282. @confirm="onHaveHouseConfirm"
  283. @cancel="showHaveHouse = false"
  284. ></van-picker>
  285. </van-popup>
  286. <van-field
  287. readonly
  288. clickable
  289. :value="tinyint[form.have_car]"
  290. label="是否有车"
  291. placeholder="点击选择是否有车"
  292. @click="showHaveCar = true"
  293. ></van-field>
  294. <van-popup position="bottom" v-model="showHaveCar">
  295. <van-picker
  296. title="是否有车"
  297. show-toolbar
  298. :columns="tinyint"
  299. @confirm="onHaveCarConfirm"
  300. @cancel="showHaveCar = false"
  301. ></van-picker>
  302. </van-popup>
  303. <van-field
  304. readonly
  305. clickable
  306. :value="tinyint[form.with_parent_live]"
  307. label="婚后是否愿意与父母同住"
  308. placeholder="点击选择"
  309. @click="showWithParentLive = true"
  310. ></van-field>
  311. <van-popup position="bottom" v-model="showWithParentLive">
  312. <van-picker
  313. title="婚后是否愿意与父母同住"
  314. show-toolbar
  315. :columns="tinyint"
  316. @confirm="onWithParentLiveConfirm"
  317. @cancel="showWithParentLive = false"
  318. ></van-picker>
  319. </van-popup>
  320. <van-field
  321. readonly
  322. clickable
  323. :value="tinyint[form.want_birth]"
  324. label="是否愿意生育"
  325. placeholder="点击选择"
  326. @click="showWantBirth = true"
  327. ></van-field>
  328. <van-popup position="bottom" v-model="showWantBirth">
  329. <van-picker
  330. title="是否愿意生育"
  331. show-toolbar
  332. :columns="tinyint"
  333. @confirm="onWantBirthConfirm"
  334. @cancel="showWantBirth = false"
  335. ></van-picker>
  336. </van-popup>
  337. <!--是否吸烟-->
  338. <van-field
  339. readonly
  340. clickable
  341. :value="form.smoke"
  342. label="是否吸烟"
  343. placeholder="点击选择是否吸烟"
  344. @click="showSmoke = true"
  345. ></van-field>
  346. <van-popup position="bottom" v-model="showSmoke">
  347. <van-picker
  348. title="是否吸烟"
  349. show-toolbar
  350. :columns="smoke"
  351. @confirm="onSmokeConfirm"
  352. @cancel="showSmoke = false"
  353. ></van-picker>
  354. </van-popup>
  355. <!--是否喝酒-->
  356. <van-field
  357. readonly
  358. clickable
  359. :value="form.drink"
  360. label="是否喝酒"
  361. placeholder="点击选择是否喝酒"
  362. @click="showDrink = true"
  363. ></van-field>
  364. <van-popup position="bottom" v-model="showDrink">
  365. <van-picker
  366. title="是否喝酒"
  367. show-toolbar
  368. :columns="drink"
  369. @confirm="onDrinkConfirm"
  370. @cancel="showDrink = false"
  371. ></van-picker>
  372. </van-popup>
  373. <van-popup v-model="showTip" round>
  374. <div class="informed">
  375. <div class="van-dialog__header" style="font-weight:bold;">知情通知书</div>
  376. <div class="van-dialog__content">
  377. <div class="van-dialog__message van-dialog__message--has-title">
  378. <p>Hi,朋友~</p>
  379. <p>欢迎您的加入!</p>
  380. <p>1.本平台为晋江市妇女联合会联合晋江市致和社工事务所倾情打造的公益红娘信息平台。该服务属于公益性质,相关服务活动自愿参加、风险自担、责任自负。</p>
  381. <p>2.信息录入的青年必须是单身人士,请如实填写个人信息,诚信参与。</p>
  382. <p>3.所录入的信息平台会绝对保护隐私,请放心填写。</p>
  383. <p>4.红娘在提供婚恋服务的过程中,不可收取任何费用。</p>
  384. <p>如认可以上信息,请按同意,继续填写您的个人信息。</p>
  385. <p>谢谢配合!</p>
  386. </div>
  387. </div>
  388. <div class="van-hairline--top van-dialog__footer" @click="showTip = false">
  389. <button type="button" class="van-button van-button--default van-button--large van-dialog__confirm">
  390. <div class="van-button__content">
  391. <span class="van-button__text">同意</span>
  392. </div>
  393. </button>
  394. </div>
  395. </div>
  396. </van-popup>
  397. <div style="padding:16px;">
  398. <van-button block class="bg-pink" @click="onSubmit">下一步</van-button>
  399. </div>
  400. </block>
  401. <block name="script">
  402. <script>
  403. new Vue({
  404. el: '#app',
  405. data() {
  406. return {
  407. form: {
  408. matchmaker_id: {$id},
  409. realname: '',
  410. sex: 0,
  411. mobile: '',
  412. avatar: '',
  413. birthday: '',
  414. animal: '',
  415. high: 0,
  416. weight: 0,
  417. education: '',
  418. company: '',
  419. job: '',
  420. income: '',
  421. nation: '',
  422. hobby: '',
  423. smoke: '',
  424. drink: '',
  425. family: [],
  426. native: '',
  427. live_place: '',
  428. have_house: 0,
  429. want_birth: 1,
  430. have_car: 0,
  431. with_parent_live: 0,
  432. marry: '',
  433. comment: '',
  434. },
  435. showSex: false,
  436. sex: {$sex},
  437. showBirthday: false,
  438. minDate: new Date(1970, 0, 1),
  439. showHigh: false,
  440. high: {$high},
  441. showWeight: false,
  442. weight: {$weight},
  443. showMarry: false,
  444. marry: {$marry},
  445. showEducation: false,
  446. education: {$education},
  447. showIncome: false,
  448. income: {$income},
  449. showNation: false,
  450. nation: {$nation},
  451. showTalentLevel: false,
  452. showSmoke: false,
  453. smoke: {$smoke},
  454. showDrink: false,
  455. drink: {$drink},
  456. family: {$family},
  457. showHaveHouse: false,
  458. showHaveCar: false,
  459. showWithParentLive: false,
  460. tinyint: {$tinyint},
  461. animal: {$animal},
  462. showAnimal: false,
  463. showWantBirth: false,
  464. showTip: true,
  465. };
  466. },
  467. methods: {
  468. in_array(search,array){
  469. for(var i in array){
  470. if(array[i] == search){
  471. return true;
  472. }
  473. }
  474. return false;
  475. },
  476. onBack() {
  477. history.back();
  478. },
  479. onSubmit() {
  480. if (this.form.realname == '') {
  481. this.$toast('请输入真实姓名');
  482. return false;
  483. }
  484. if (this.form.mobile == '') {
  485. this.$toast('请输入电话');
  486. return false;
  487. }
  488. if (this.form.sex == 0) {
  489. this.$toast('请选择性别');
  490. return false;
  491. }
  492. if (this.form.birthday == '') {
  493. this.$toast('请选择正确的生日');
  494. return false;
  495. }
  496. if (this.form.animal == '') {
  497. this.$toast('请选择生肖');
  498. return false;
  499. }
  500. if (this.form.marry == '') {
  501. this.$toast('请选择婚姻状况');
  502. return false;
  503. }
  504. if (this.form.education == '') {
  505. this.$toast('请选择学历');
  506. return false;
  507. }
  508. if (this.form.income == '') {
  509. this.$toast('请选择年收入');
  510. return false;
  511. }
  512. if (this.form.company == '') {
  513. this.$toast('请输入工作单位');
  514. return false;
  515. }
  516. let self = this;
  517. $.post("{:url('infoAddPost')}", this.form, function (json) {
  518. if (json.code) {
  519. location.href = "{:url('matingAdd')}?id=" + json.data.id;
  520. } else {
  521. self.$toast(json.msg);
  522. }
  523. }, 'json');
  524. },
  525. onBirthdayConfirm(date) {
  526. let year = date.getFullYear();
  527. let month = date.getMonth() + 1;
  528. if (month < 10) {
  529. month = "0" + month;
  530. }
  531. let day = date.getDate();
  532. if (day < 10) {
  533. day = "0" + day;
  534. }
  535. this.form.birthday = `${year}-${month}-${day}`;
  536. this.showBirthday = false;
  537. },
  538. onHighConfirm(value) {
  539. this.form.high = value == '保密' ? 0 : value;
  540. this.showHigh = false;
  541. },
  542. onWeightConfirm(value) {
  543. this.form.weight = value == '保密' ? 0 : value;
  544. this.showWeight = false;
  545. },
  546. onMarryConfirm(value) {
  547. this.form.marry = value;
  548. this.showMarry = false;
  549. },
  550. onAnimalConfirm(value) {
  551. this.form.animal = value;
  552. this.showAnimal = false;
  553. },
  554. onEducationConfirm(value) {
  555. this.form.education = value;
  556. this.showEducation = false;
  557. },
  558. onIncomeConfirm(value) {
  559. this.form.income = value;
  560. this.showIncome = false;
  561. },
  562. onNationConfirm(value) {
  563. this.form.nation = value;
  564. this.showNation = false;
  565. },
  566. onHaveHouseConfirm(value,index) {
  567. this.form.have_house = index;
  568. this.showHaveHouse = false;
  569. },
  570. onHaveCarConfirm(value,index) {
  571. this.form.have_car = index;
  572. this.showHaveCar = false;
  573. },
  574. onWithParentLiveConfirm(value,index) {
  575. this.form.with_parent_live = index;
  576. this.showWithParentLive = false;
  577. },
  578. onWantBirthConfirm(value,index){
  579. this.form.want_birth = index;
  580. this.showWantBirth = false;
  581. },
  582. onSmokeConfirm(value) {
  583. this.form.smoke = value;
  584. this.showSmoke = false;
  585. },
  586. onDrinkConfirm(value) {
  587. this.form.drink = value;
  588. this.showDrink = false;
  589. },
  590. removeByVal(arrylist , val) {
  591. for(var i = 0; i < arrylist .length; i++) {
  592. if(arrylist[i] == val) {
  593. arrylist .splice(i, 1);
  594. break;
  595. }
  596. }
  597. },
  598. selectFamily(value) {
  599. if (this.in_array(value,this.form.family)) {
  600. this.removeByVal(this.form.family,value);
  601. } else {
  602. this.form.family.push(value);
  603. }
  604. },
  605. uploadHead(file) {
  606. let self = this;
  607. $.post("{:url('imageUpload')}",{file:file.content,name:file.file.name},function(json){
  608. if (json.code) {
  609. self.form.avatar = json.data.avatar;
  610. self.$forceUpdate();
  611. } else {
  612. self.$toast(json.msg);
  613. }
  614. },'json')
  615. },
  616. },
  617. computed: {
  618. form_high() {
  619. return this.form.high ? this.form.high + 'CM' : '保密';
  620. },
  621. form_weight() {
  622. return this.form.weight ? this.form.weight + 'KG' : '保密';
  623. },
  624. head_image() {
  625. return this.form.avatar ? this.form.avatar : '__TMPL__/public/assets/images/matchmaker/avatar2.png';
  626. }
  627. },
  628. });
  629. </script>
  630. </block>