edit.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  1. <template>
  2. <view>
  3. <u-navbar back-text="编辑资料"></u-navbar>
  4. <view class="edit-head">
  5. <u-avatar :src="personal_info.faceImage" size="160" :show-level="true" level-icon="edit-pen-fill" level-bg-color ="#4E8DF6" @click="uploadPhoto"></u-avatar>
  6. </view>
  7. <view class="edit-form">
  8. <u-form :model="form" ref="uForm" label-width ="160">
  9. <u-form-item label="姓名"><u-input :disabled='true' v-model="personal_info.realName" input-align="right" placeholder="周扬青"/></u-form-item>
  10. <u-form-item label="身份证号"><u-input :disabled='true' v-model="idCard" input-align="right" placeholder="42100***************111"/></u-form-item>
  11. <u-form-item label="手机号"><u-input :disabled='true' v-model="personal_info.phone" input-align="right" placeholder="1380****9999"/></u-form-item>
  12. <u-form-item label="性别"><u-input :disabled='true' v-model="form.sex" input-align="right" placeholder="男"/></u-form-item>
  13. <u-form-item label="年龄"><u-input :disabled='true' v-model="personal_info.age" input-align="right" placeholder="31岁"/></u-form-item>
  14. <u-form-item label="身高">
  15. <u-input v-model="form.height" input-align="right" placeholder="172cm" type="select" @click="show_height = true" />
  16. <u-select v-model="show_height" :defaultValue="defaultData.height" mode="single-column" :list="height_ranges" @confirm="heightConfirm"></u-select>
  17. </u-form-item>
  18. <u-form-item label="体重">
  19. <u-input v-model="form.weight" input-align="right" placeholder="75kg" type="select" @click="show_weight = true"/>
  20. <u-select v-model="show_weight" :defaultValue="defaultData.weight" mode="single-column" :list="weight_ranges" @confirm="weightConfirm"></u-select>
  21. </u-form-item>
  22. <view class="edit-line"></view>
  23. <u-form-item label="出身地">
  24. <u-input v-model="personal_info.birthplaceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='birthdayAddressChange'/>
  25. <u-select v-model="show_birthday_address" mode="mutil-column-auto" :default-value='defaultData.address' :list="defaultColumns" @confirm="onBirthdayCityConfirm"></u-select>
  26. </u-form-item>
  27. <u-form-item label="户口所在地">
  28. <u-input v-model="personal_info.registeredResidenceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='registeredResidenceAddressChange'/>
  29. <u-select v-model="show_registered_residence" mode="mutil-column-auto" :default-value='defaultData.registered_residence' :list="defaultColumns" @confirm="onResidenceRegisteredCityConfirm"></u-select>
  30. </u-form-item>
  31. <u-form-item label="工作所在地">
  32. <u-input v-model="personal_info.workplaceN" input-align="right" placeholder="荆州市沙市区" type="select" @click='workAddressChange'/>
  33. <u-select v-model="show_work_address" mode="mutil-column-auto" :default-value='defaultData.work_address' :list="defaultColumns" @confirm="onWorkCityConfirm"></u-select>
  34. </u-form-item>
  35. <view class="edit-line"></view>
  36. <u-form-item label="学历" >
  37. <u-input v-model="personal_info.educationN" input-align="right" placeholder="大学本科" type="select" @click="show_education = true"/>
  38. <u-select v-model="show_education" :defaultValue="defaultData.education" mode="single-column" :list="base_dictionary.xlList" @confirm="educationConfirm"></u-select>
  39. </u-form-item>
  40. <u-form-item label="行业" >
  41. <u-input v-model="personal_info.industryN" input-align="right" placeholder="IT/互联网" type="select" @click="show_profession = true"/></u-form-item>
  42. <u-select v-model="show_profession" :defaultValue="defaultData.profession" mode="single-column" :list="base_dictionary.hyList" @confirm="professionConfirm"></u-select>
  43. <u-form-item label="工作单位">
  44. <u-input v-model="personal_info.workUnit" input-align="right" placeholder="湖北荆鹏软件开发有限公司" /></u-form-item>
  45. <u-form-item label="岗位">
  46. <u-input v-model="personal_info.post" input-align="right" placeholder="软件工程师" /></u-form-item>
  47. <view class="edit-line"></view>
  48. <u-form-item label="月薪" >
  49. <u-input v-model="personal_info.salaryRangeN" input-align="right" placeholder="请选择" type="select" @click="show_salary = true" />
  50. <u-select v-model="show_salary" :defaultValue="defaultData.salary_range" mode="single-column" :list="base_dictionary.yxList" @confirm="salaryConfirm"></u-select>
  51. </u-form-item>
  52. <u-form-item label="住房状况">
  53. <u-input v-model="personal_info.housingSituationN" input-align="right" placeholder="请选择" type="select" @click="show_house = true"/>
  54. <u-select v-model="show_house" :defaultValue="defaultData.house_status" mode="single-column" :list="base_dictionary.zfqkList" @confirm="houseConfirm"></u-select>
  55. </u-form-item>
  56. <u-form-item label="婚姻状况">
  57. <u-input v-model="personal_info.maritalStatusN" input-align="right" placeholder="未婚" type="select" @click="show_marriage = true"/>
  58. <u-select v-model="show_marriage" :defaultValue="defaultData.marriage_status" mode="single-column" :list="base_dictionary.hyqkList" @confirm="marriageConfirm"></u-select>
  59. </u-form-item>
  60. <u-form-item label="子女状况" >
  61. <u-input v-model="personal_info.childStatusN" input-align="right" placeholder="无" type="select" @click="show_children = true"/>
  62. <u-select v-model="show_children" :defaultValue="defaultData.children_status" mode="single-column" :list="base_dictionary.znqkList" @confirm="childrenConfirm"></u-select>
  63. </u-form-item>
  64. <view class="edit-line"></view>
  65. <view class="edit-row">
  66. <p>兴趣爱好</p>
  67. <view class="edit-label">
  68. <span v-for="(item,index) in base_dictionary.hobbyInfoList" :key="index" :class="item.isMemberSelect ? 'active' : ''" @tap="selectInterest(index)">
  69. {{item.name}}
  70. </span>
  71. <!--
  72. <span class="active">摄影</span>
  73. <span>烹饪</span>
  74. <span>健身</span>
  75. <span>打游戏</span>
  76. <span>摄影</span>
  77. <span>烹饪</span>
  78. <span>健身</span>
  79. <span>打游戏</span>-->
  80. </view>
  81. </view>
  82. <view class="edit-line"></view>
  83. <view class="edit-row" @click="editSelfEvaluation">
  84. <view class="u-flex u-row-between " >
  85. <p>自我评价</p>
  86. <u-icon custom-prefix="custom-icon" name="youjiantou"></u-icon>
  87. </view>
  88. <view class="edit-text">
  89. {{personal_info.selfEvaluation}}
  90. </view>
  91. </view>
  92. <view class="edit-title">择偶标准</view>
  93. <u-form-item label="年龄范围" >
  94. <u-input v-model="personal_info.taAgeRangeN" input-align="right" placeholder="20~35" type="select" @click="show_ta_age_ranges = true"/>
  95. <u-select v-model="show_ta_age_ranges" :defaultValue="defaultData.ta_age_range" mode="single-column" :list="base_dictionary.nlfwList" @confirm="taAgeRangeConfirm"></u-select>
  96. </u-form-item>
  97. <u-form-item label="月薪" >
  98. <u-input v-model="personal_info.taIncomeRangeN" input-align="right" placeholder="不限" type="select" @click="show_ta_salary = true"/>
  99. <u-select v-model="show_ta_salary" :defaultValue="defaultData.ta_salary_range" mode="single-column" :list="base_dictionary.yxList" @confirm="taSalaryRangeConfirm"></u-select>
  100. </u-form-item>
  101. <u-form-item label="学历" >
  102. <u-input v-model="personal_info.taEduN" input-align="right" placeholder="不限" type="select" @click="show_ta_education = true"/>
  103. <u-select v-model="show_ta_education" :defaultValue="defaultData.ta_education" mode="single-column" :list="base_dictionary.xlList" @confirm="taEducationConfirm"></u-select>
  104. </u-form-item>
  105. <u-form-item label="职业">
  106. <u-input v-model="personal_info.taOccupation" input-align="right" placeholder="不限" /></u-form-item>
  107. <u-form-item label="所在地">
  108. <u-input v-model="personal_info.taWorkplaceN" :defaultValue="defaultData.ta_work_address" input-align="right" placeholder="请选择" type="select" @click='taWorkAddressChange'/>
  109. <u-select v-model="show_ta_work_address" mode="mutil-column-auto" :default-value='defaultData.ta_work_address' :list="defaultColumns" @confirm="onTaWorkCityConfirm"></u-select>
  110. </u-form-item>
  111. <u-form-item label="其他要求">
  112. <u-input v-model="personal_info.taOther" input-align="right" placeholder="请选择" /></u-form-item>
  113. </u-form>
  114. </view>
  115. <view class="personal-btn">
  116. <u-button type="error" shape="circle" :custom-style="customStyle" @click="formsubmit">
  117. <span>保存</span>
  118. </u-button>
  119. </view>
  120. <view>
  121. <u-popup border-radius="20" v-model="showSelfEvaluation" @close="close" mode="bottom" length="90%" height="600rpx">
  122. <view style="display: flex; flex-direction: column;">
  123. <view style="display:flex;flex-direction:row;margin-top: 50rpx;justify-content: space-between; ">
  124. <view style="margin-left: 50rpx;font-weight: bold!important; font-size:30rpx;margin-bottom: 20rpx;">自我评价</view>
  125. <view style="font-color:#E5E7EA;margin-right: 50rpx;">{{selfEvaluation.length}}/200</view>
  126. </view>
  127. <view style="display: flex; uni-textarea; margin-bottom: 20rpx;justify-content: center;align-items:center;">
  128. <textarea style="width: 80%; padding-top: 10rpx;padding-bottom: 10rpx; border-radius:30rpx;padding-left: 20rpx;padding-right: 20rpx; background-color: #E5E7EA;overflow: auto;" :adjust-position="false" placeholder="请填写内容" maxlength="200" name="summary" v-model="selfEvaluation">
  129. </textarea>
  130. </view>
  131. <view>
  132. <button style="border-radius:100rpx;background-color: #FF5E5E;width:75%;color:#FFFFFF" @click="saveSelfEvaluation">保存</button>
  133. </view>
  134. </view>
  135. </u-popup>
  136. </view>
  137. <!--
  138. <u-action-sheet
  139. :show="show_education"
  140. :actions="base_dictionary.xlList"
  141. title="请选择学历"
  142. description=""
  143. @close="show_education = false"
  144. @select="educationSelect"
  145. >
  146. </u-action-sheet>
  147. <u-action-sheet
  148. :show="show_salary"
  149. :actions="base_dictionary.yxList"
  150. title="请选择月薪"
  151. description=""
  152. @close="show_salary = false"
  153. @select="salarySelect"
  154. >
  155. </u-action-sheet>
  156. <u-action-sheet
  157. :show="show_profession"
  158. :actions="base_dictionary.hyList"
  159. title="请选择行业"
  160. description=""
  161. @close="show_profession = false"
  162. @select="professionSelect"
  163. >
  164. </u-action-sheet>
  165. <u-action-sheet
  166. :show="show_house"
  167. :actions="base_dictionary.zfqkList"
  168. title="请选择住房状况"
  169. description=""
  170. @close="show_house = false"
  171. @select="houseSelect"
  172. >
  173. </u-action-sheet>
  174. <u-action-sheet
  175. :show="show_marriage"
  176. :actions="base_dictionary.hyList"
  177. title="请选择婚姻状况"
  178. description=""
  179. @close="show_marriage = false"
  180. @select="marriageSelect"
  181. >
  182. </u-action-sheet>
  183. <u-action-sheet
  184. :show="show_children"
  185. :actions="base_dictionary.znqkList"
  186. title="请选择子女状况"
  187. description=""
  188. @close="show_children = false"
  189. @select="childrenSelect"
  190. >
  191. </u-action-sheet>
  192. <u-action-sheet
  193. :show="show_ta_age_ranges"
  194. :actions="base_dictionary.nlfwList"
  195. title="请选择年龄范围"
  196. description=""
  197. @close="show_ta_age_ranges = false"
  198. @select="taAgeRangeSelect"
  199. >
  200. </u-action-sheet>
  201. <u-action-sheet
  202. :show="show_ta_education"
  203. :actions="base_dictionary.xlList"
  204. title="请选择学历"
  205. description=""
  206. @close="show_ta_education = false"
  207. @select="taEducationSelect"
  208. >
  209. </u-action-sheet>
  210. <u-action-sheet
  211. :show="show_ta_salary"
  212. :actions="base_dictionary.nlfwList"
  213. title="请选择月薪"
  214. description="xxxxxxx"
  215. @close="show_ta_salary = false"
  216. @select="taSalarySelect"
  217. >
  218. </u-action-sheet>-->
  219. </view>
  220. </template>
  221. <script>
  222. import * as loginApi from '@/apis/login.js'
  223. // import mpvueCityPicker from "@/pagesB/components/mpvue-citypicker/mpvueCityPicker.vue";
  224. // import mpvueCityPicker from "../../pagesB/components/mpvue-citypicker/mpvueCityPicker.vue";
  225. import {provinceData,cityData,areaData,setCityData,getCityData,getCityPosition} from '@/apis/city.js';
  226. let _self;
  227. export default {
  228. /* components:{
  229. mpvueCityPicker
  230. },*/
  231. data() {
  232. return {
  233. defaultColumns: [],
  234. cityPickerValueDefault:[16,6,0],
  235. customStyle: {
  236. background: '#FF5E5E'
  237. },
  238. defaultData:{
  239. height:[45],
  240. weight:[45],
  241. address:[16,6,0],
  242. registered_residence:[16,6,0],
  243. work_address:[16,6,0],
  244. education:[1],
  245. profession:[1],
  246. salary_range:[1],
  247. house_status:[1],
  248. marriage_status:[1],
  249. children_status:[1],
  250. ta_age_range:[1],
  251. ta_salary_range:[1],
  252. ta_education:[1],
  253. ta_work_address:[16,6,0]
  254. },
  255. form: {
  256. name: '',
  257. sex: '',
  258. height:'',
  259. weight:'',
  260. address:'',
  261. registered_residence:'',
  262. work_address:'',
  263. work_corporation:'',
  264. work_post:'',
  265. education:'',
  266. profession:'',
  267. salary_range:'',
  268. house_status:'',
  269. marriage_status:'',
  270. children_status:'',
  271. self_assess:'',
  272. addressId:'',
  273. registered_residenceId:'',
  274. work_addressId:'',
  275. educationId:'',
  276. professionId:'',
  277. salary_rangeId:'',
  278. house_statusId:'',
  279. marriage_statusId:'',
  280. children_statusId:'',
  281. },
  282. selfEvaluation:'',
  283. personal_info:{
  284. faceImage:' /static/img/sexMan.png'
  285. },
  286. height_ranges:[],
  287. weight_ranges:[],
  288. showSelfEvaluation:false,
  289. show_height:false,
  290. show_weight:false,
  291. show_birthday_address:false,
  292. show_registered_residence:false,
  293. show_work_address:false,
  294. show_salary:false,
  295. show_profession:false,
  296. show_education:false,
  297. show_house:false,
  298. show_marriage:false,
  299. show_children:false,
  300. show_ta_age_ranges:false,
  301. show_ta_education:false,
  302. show_ta_salary:false,
  303. show_ta_work_address:false,
  304. base_dictionary:{
  305. zfqkList:[],
  306. yxList:[],
  307. znqkList:[],
  308. qyList:[],
  309. xlList:[],
  310. hyList:[],
  311. nlfwList:[],
  312. hyqkList:[],
  313. hobbyInfoList:[],
  314. }
  315. }
  316. },
  317. computed:{
  318. idCard(){
  319. if(this.personal_info.idCard && this.personal_info.idCard.length>=15){
  320. let prefix = this.personal_info.idCard.substr(0,5);
  321. let suffix = this.personal_info.idCard.substr(this.personal_info.idCard.length-3,3);
  322. return prefix + '********'+ suffix;
  323. }
  324. return '42100********111'
  325. }
  326. },
  327. onLoad(){
  328. _self = this;
  329. // console.log('省'+JSON.stringify(provinceData))
  330. //let personalInfoPlus = this.carhelp.getPersonInfoPlus();
  331. //console.log('personalInfoPlus'+JSON.stringify(personalInfoPlus))
  332. this.personal_info = this.carhelp.getPersonInfo();
  333. // console.log('个人信息'+JSON.stringify(this.personal_info))
  334. let subject = {subject:''}
  335. loginApi.getBaseDictionary(subject).then(function(data){
  336. //console.log('基础字典'+JSON.stringify(data));
  337. let personal_info = _self.carhelp.getPersonInfo();
  338. if(data.data)
  339. {
  340. _self.base_dictionary = data.data;
  341. if(_self.base_dictionary.zfqkList){
  342. for(let i = 0;i< _self.base_dictionary.zfqkList.length;i++)
  343. {
  344. _self.base_dictionary.zfqkList[i].label = _self.base_dictionary.zfqkList[i].name;
  345. }
  346. if(_self.personal_info.housingSituation!=null && _self.personal_info.housingSituation<= _self.base_dictionary.zfqkList.length)
  347. {
  348. _self.personal_info.housingSituationN =_self.base_dictionary.zfqkList[_self.personal_info.housingSituation-1].label
  349. }
  350. }
  351. //console.log('住房情况'+JSON.stringify(_self.base_dictionary.zfqkList));
  352. if(_self.base_dictionary.yxList){
  353. for(let i = 0;i< _self.base_dictionary.yxList.length;i++)
  354. {
  355. _self.base_dictionary.yxList[i].label = _self.base_dictionary.yxList[i].name;
  356. }
  357. if(_self.personal_info.salaryRange!=null && _self.personal_info.salaryRange<= _self.base_dictionary.yxList.length)
  358. {
  359. _self.personal_info.salaryRangeN =_self.base_dictionary.yxList[_self.personal_info.salaryRange-1].label
  360. }
  361. if(_self.personal_info.taIncomeRange!=null && _self.personal_info.taIncomeRange<= _self.base_dictionary.yxList.length)
  362. {
  363. _self.personal_info.taIncomeRangeN =_self.base_dictionary.yxList[_self.personal_info.taIncomeRange-1].label
  364. }
  365. }
  366. //console.log('月薪情况'+JSON.stringify(_self.base_dictionary.yxList));
  367. if(_self.base_dictionary.znqkList){
  368. for(let i = 0;i< _self.base_dictionary.znqkList.length;i++)
  369. {
  370. _self.base_dictionary.znqkList[i].label = _self.base_dictionary.znqkList[i].name;
  371. }
  372. if(_self.personal_info.childStatus!=null && _self.personal_info.childStatus<= _self.base_dictionary.znqkList.length)
  373. {
  374. _self.personal_info.childStatusN =_self.base_dictionary.znqkList[_self.personal_info.childStatus-1].label
  375. }
  376. }
  377. //console.log('子女情况'+JSON.stringify(_self.base_dictionary.znqkList));
  378. /*
  379. if(_self.base_dictionary.qyList){
  380. for(let i = 0;i< _self.base_dictionary.qyList.length;i++)
  381. {
  382. _self.base_dictionary.qyList[i].label = _self.base_dictionary.qyList[i].name;
  383. }
  384. }
  385. console.log('区域'+JSON.stringify(_self.base_dictionary.qyList));
  386. */
  387. if(_self.base_dictionary.xlList){
  388. for(let i = 0;i< _self.base_dictionary.xlList.length;i++)
  389. {
  390. _self.base_dictionary.xlList[i].label = _self.base_dictionary.xlList[i].name;
  391. }
  392. //console.log('学历'+JSON.stringify(_self.base_dictionary.xlList.length))
  393. if(_self.personal_info.education!=null && _self.personal_info.education <= _self.base_dictionary.xlList.length)
  394. {
  395. //console.log('学历'+JSON.stringify(_self.personal_info.education))
  396. _self.personal_info.educationN =_self.base_dictionary.xlList[Number(_self.personal_info.education)-1].label
  397. }
  398. if(_self.personal_info.taEdu!=null && _self.personal_info.taEdu<= _self.base_dictionary.xlList.length)
  399. {
  400. _self.personal_info.taEduN =_self.base_dictionary.xlList[_self.personal_info.taEdu-1].label
  401. }
  402. }
  403. //console.log('学历情况'+JSON.stringify(_self.base_dictionary.xlList));
  404. if(_self.base_dictionary.hyList){
  405. for(let i = 0;i< _self.base_dictionary.hyList.length;i++)
  406. {
  407. _self.base_dictionary.hyList[i].label = _self.base_dictionary.hyList[i].name;
  408. }
  409. if(_self.personal_info.industry!=null && _self.personal_info.industry<= _self.base_dictionary.hyList.length)
  410. {
  411. _self.personal_info.industryN =_self.base_dictionary.hyList[_self.personal_info.industry-1].label
  412. }
  413. }
  414. // console.log('行业情况'+JSON.stringify(_self.base_dictionary.hyList));
  415. if(_self.base_dictionary.nlfwList){
  416. for(let i = 0;i< _self.base_dictionary.nlfwList.length;i++)
  417. {
  418. _self.base_dictionary.nlfwList[i].label = _self.base_dictionary.nlfwList[i].name;
  419. }
  420. if(_self.personal_info.taAgeRange!=null && _self.personal_info.taAgeRange<= _self.base_dictionary.nlfwList.length)
  421. {
  422. _self.personal_info.taAgeRangeN =_self.base_dictionary.nlfwList[_self.personal_info.taAgeRange-1].label
  423. }
  424. }
  425. //console.log('年龄范围'+JSON.stringify(_self.base_dictionary.nlfwList));
  426. if(_self.base_dictionary.hyqkList){
  427. for(let i = 0;i< _self.base_dictionary.hyqkList.length;i++)
  428. {
  429. _self.base_dictionary.hyqkList[i].label = _self.base_dictionary.hyqkList[i].name;
  430. }
  431. if(_self.personal_info.maritalStatus!=null && _self.personal_info.maritalStatus<= _self.base_dictionary.hyqkList.length)
  432. {
  433. _self.personal_info.maritalStatusN =_self.base_dictionary.hyqkList[_self.personal_info.maritalStatus-1].label
  434. }
  435. }
  436. //console.log('婚姻情况'+JSON.stringify(_self.base_dictionary.hyqkList));
  437. if(_self.base_dictionary.hobbyInfoList){
  438. for(let i = 0;i< _self.base_dictionary.hobbyInfoList.length;i++)
  439. {
  440. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = false;
  441. _self.base_dictionary.hobbyInfoList[i].label = _self.base_dictionary.hobbyInfoList[i].name;
  442. if(_self.personal_info.hobby!=null){
  443. // console.log('hobby'+JSON.stringify(_self.personal_info.hobby))
  444. if(_self.personal_info.hobby.indexOf(_self.base_dictionary.hobbyInfoList[i].id)>=0)
  445. {
  446. _self.base_dictionary.hobbyInfoList[i].isMemberSelect = true;
  447. // console.log('选中'+JSON.stringify(_self.base_dictionary.hobbyInfoList[i]))
  448. }
  449. }
  450. }
  451. }
  452. // console.log('兴趣爱好'+JSON.stringify(_self.base_dictionary.hobbyInfoList));
  453. if(_self.personal_info.birthplace!=null){
  454. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  455. // console.log('address'+JSON.stringify(_self.form.addressId))
  456. }
  457. if(_self.personal_info.registeredResidence!=null){
  458. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info.registeredResidence));
  459. }
  460. if(_self.personal_info.workplace!=null){
  461. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  462. }
  463. if(_self.personal_info.taWorkplace!=null){
  464. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  465. }
  466. }
  467. },function(err){
  468. console.log('获取基础字典错误'+JSON.stringify(err))
  469. })
  470. for(let i = 130;i<=220;i++)
  471. {
  472. let height_range = {value: i, label: i.toString()+"cm"};
  473. this.height_ranges.push(height_range);
  474. //this.height_ranges.push(i.toString());
  475. }
  476. for(let i = 20;i<=120;i++)
  477. {
  478. // this.weight_ranges.push(i.toString());
  479. let weight_range = {value:i, label:i.toString()+"kg"};
  480. this.weight_ranges.push(weight_range);
  481. }
  482. if(this.personal_info){
  483. this.form.sex = this.personal_info.gender?'女':'男'
  484. if(this.personal_info.height)
  485. {
  486. this.form.height = this.personal_info.height+'cm'
  487. }
  488. if(this.personal_info.weight)
  489. {
  490. this.form.weight = this.personal_info.weight+'kg'
  491. }
  492. }
  493. if(provinceData.length<=0){
  494. loginApi.getCityList().then(function(data){
  495. // console.log('获取城市成功'+JSON.stringify(data));
  496. if(data.result && data.data){
  497. setCityData(data.data);
  498. _self.init_city_data();
  499. //_self.$refs.mpvuebirtydayCityPicker.setCityData(data.data);
  500. //console.log('province data '+JSON.stringify(provinceData))
  501. if(_self.personal_info.birthplace!=null){
  502. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  503. _self.defaultData.address = getCityPosition(Number(_self.personal_info.birthplace));
  504. //this.defaultData.registered_residence = this.defaultData.address;
  505. //this.defaultData.work_address = this.defaultData.address; //
  506. console.log('address'+JSON.stringify(_self.defaultData.address))
  507. }
  508. if(_self.personal_info.registeredResidence!=null){
  509. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info.registeredResidence));
  510. _self.defaultData.registered_residence = getCityPosition(Number(_self.personal_info.registeredResidence));
  511. }
  512. if(_self.personal_info.workplace!=null){
  513. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  514. _self.defaultData.work_address = getCityPosition(Number(_self.personal_info.workplace));
  515. }
  516. if(_self.personal_info.taWorkplace!=null){
  517. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  518. _self.defaultData.ta_work_address = getCityPosition(Number(_self.personal_info.taWorkplace));
  519. }
  520. }
  521. },function(err){
  522. console.log('获取城市列表错误'+JSON.stringify(err))
  523. })
  524. }else{
  525. _self.init_city_data();
  526. if(_self.personal_info.birthplace!=null){
  527. _self.personal_info.birthplaceN = getCityData(Number(_self.personal_info.birthplace));
  528. _self.defaultData.address = getCityPosition(Number(_self.personal_info.birthplace));
  529. //this.defaultData.registered_residence = this.defaultData.address;
  530. //this.defaultData.work_address = this.defaultData.address; //
  531. console.log('address'+JSON.stringify(_self.defaultData.address))
  532. }
  533. if(_self.personal_info.registeredResidence!=null){
  534. _self.personal_info.registeredResidenceN = getCityData(Number(_self.personal_info.registeredResidence));
  535. _self.defaultData.registered_residence = getCityPosition(Number(_self.personal_info.registeredResidence));
  536. }
  537. if(_self.personal_info.workplace!=null){
  538. _self.personal_info.workplaceN = getCityData(Number(_self.personal_info.workplace));
  539. _self.defaultData.work_address = getCityPosition(Number(_self.personal_info.workplace));
  540. }
  541. if(_self.personal_info.taWorkplace!=null){
  542. _self.personal_info.taWorkplaceN = getCityData(Number(_self.personal_info.taWorkplace));
  543. _self.defaultData.ta_work_address = getCityPosition(Number(_self.personal_info.taWorkplace));
  544. }
  545. }
  546. // console.log('个人信息'+JSON.stringify(this.personal_info))
  547. },
  548. methods:{
  549. init_city_data(){
  550. for(let i = 0;i< provinceData.length;i++){
  551. let province = provinceData[i];
  552. if(cityData[i].length>0){
  553. province.children = [];
  554. for(let j = 0;j< cityData[i].length;j++){
  555. let city = cityData[i][j];
  556. if(areaData[i][j].length>0){
  557. city.children = [];
  558. for(let k = 0;k< areaData[i][j].length;k++){
  559. city.children.push(areaData[i][j][k])
  560. }
  561. }
  562. province.children.push(city);
  563. }
  564. }
  565. this.defaultColumns.push(province);
  566. }
  567. },
  568. saveSelfEvaluation(){
  569. this.showSelfEvaluation = false;
  570. this.personal_info.selfEvaluation = this.selfEvaluation;
  571. console.log('自我评价'+JSON.stringify(this.selfEvaluation))
  572. },
  573. editSelfEvaluation(){
  574. if(this.personal_info.selfEvaluation!=null)
  575. {
  576. this.selfEvaluation = this.personal_info.selfEvaluation;
  577. }else
  578. {
  579. this.selfEvaluation = ''
  580. }
  581. this.showSelfEvaluation = true
  582. console.log('editSelfEvaluation')
  583. },
  584. open() {
  585. console.log('open');
  586. },
  587. close() {
  588. this.showSelfEvaluation = false
  589. console.log('close');
  590. },
  591. selectInterest(index){
  592. // let interest = this.interests;
  593. this.base_dictionary.hobbyInfoList[index].isMemberSelect = !this.base_dictionary.hobbyInfoList[index].isMemberSelect;
  594. console.log('item'+JSON.stringify(this.base_dictionary.hobbyInfoList[index]))
  595. },
  596. birthdayAddressChange(){
  597. _self.show_birthday_address = true;
  598. // console.log('birthdayAddress change')
  599. // this.$refs.mpvuebirtydayCityPicker.show()
  600. },
  601. registeredResidenceAddressChange(){
  602. _self.show_registered_residence = true;
  603. // this.$refs.mpvueRegisteredResidenceCityPicker.show()
  604. },
  605. workAddressChange(){
  606. _self.show_work_address = true;
  607. // this.$refs.mpvueWorkCityPicker.show()
  608. },
  609. taWorkAddressChange(){
  610. _self.show_ta_work_address = true;
  611. // this.$refs.mpvueTaWorkCityPicker.show()
  612. },
  613. onBirthdayCityConfirm(e) {
  614. // console.log('e'+JSON.stringify(e))
  615. //this.defaultData.address = [this.base_dictionary.znqkList.findIndex(item => item.value === e[0].value)]
  616. //this.defaultData.address = [17,1,1]
  617. let province = e[0];
  618. let city = e[1];
  619. let area = e[2];
  620. this.defaultData.address = getCityPosition(area.value);
  621. this.defaultData.registered_residence = this.defaultData.address;
  622. this.defaultData.work_address = this.defaultData.address;
  623. // console.log('address '+JSON.stringify(this.defaultData.address))
  624. this.personal_info.birthplaceN = '';
  625. e.map((val, index) => {
  626. // this.result += this.result == '' ? val.label : '-' + val.label;
  627. let result = val.label
  628. _self.personal_info.birthplace = val.value;
  629. let name = getCityData(Number(val.value));
  630. _self.personal_info.birthplaceN = name;
  631. //
  632. _self.personal_info.registeredResidenceN= _self.personal_info.birthplaceN;
  633. _self.personal_info.registeredResidence = _self.personal_info.birthplace;
  634. _self.personal_info.workplaceN = _self.personal_info.birthplaceN;
  635. _self.personal_info.workplace = _self.personal_info.birthplace;
  636. })
  637. // console.log('地址选择'+JSON.stringify(_self.form.addressId))
  638. },
  639. onResidenceRegisteredCityConfirm(e) {
  640. let province = e[0];
  641. let city = e[1];
  642. let area = e[2];
  643. this.defaultData.registered_residence = getCityPosition(area.value);
  644. // console.log('address '+JSON.stringify(this.defaultData.address))
  645. this.personal_info.registeredResidenceN = '';
  646. e.map((val, index) => {
  647. // this.result += this.result == '' ? val.label : '-' + val.label;
  648. let result = val.label
  649. let name = getCityData(Number(val.value));
  650. _self.personal_info.registeredResidenceN = name;
  651. _self.personal_info.registeredResidence = val.value;
  652. })
  653. },
  654. onWorkCityConfirm(e) {
  655. let province = e[0];
  656. let city = e[1];
  657. let area = e[2];
  658. this.defaultData.work_address = getCityPosition(area.value);
  659. // console.log('address '+JSON.stringify(this.defaultData.address))
  660. this.personal_info.workplaceN = '';
  661. e.map((val, index) => {
  662. // this.result += this.result == '' ? val.label : '-' + val.label;
  663. let result = val.label
  664. let name = getCityData(Number(val.value));
  665. _self.personal_info.workplaceN = name;
  666. _self.personal_info.workplace = val.value;
  667. })
  668. },
  669. onTaWorkCityConfirm(e) {
  670. let province = e[0];
  671. let city = e[1];
  672. let area = e[2];
  673. this.defaultData.ta_work_address = getCityPosition(area.value);
  674. // console.log('address '+JSON.stringify(this.defaultData.address))
  675. this.personal_info.taWorkplaceN = '';
  676. e.map((val, index) => {
  677. // this.result += this.result == '' ? val.label : '-' + val.label;
  678. let result = val.label
  679. let name = getCityData(Number(val.value));
  680. _self.personal_info.taWorkplaceN = name;
  681. _self.personal_info.taWorkplace = val.value;
  682. })
  683. },
  684. formsubmit(){
  685. let personal_info = {type:1,id:this.personal_info.id};
  686. let _personal_info = this.personal_info;
  687. if(_personal_info.faceImage)
  688. {
  689. personal_info.faceImage = _personal_info.faceImage;
  690. console.log('faceImage'+personal_info.faceImage)
  691. }
  692. personal_info.hobby = ''
  693. for(let i=0;i<_self.base_dictionary.hobbyInfoList.length;i++)
  694. {
  695. if(_self.base_dictionary.hobbyInfoList[i].isMemberSelect)
  696. {
  697. if(personal_info.hobby.length>0)
  698. {
  699. personal_info.hobby+=','
  700. }
  701. personal_info.hobby += _self.base_dictionary.hobbyInfoList[i].id;
  702. }
  703. }
  704. if(_personal_info.selfEvaluation)
  705. {
  706. personal_info.selfEvaluation = _personal_info.selfEvaluation;
  707. console.log('selfEvaluation'+personal_info.selfEvaluation);
  708. }
  709. if(_personal_info.weight)
  710. {
  711. personal_info.weight = _personal_info.weight;
  712. console.log('weight'+personal_info.weight)
  713. }
  714. if(_personal_info.height)
  715. {
  716. personal_info.height = _personal_info.height;
  717. console.log('height'+personal_info.height)
  718. }
  719. if(_personal_info.education)
  720. {
  721. personal_info.education = _personal_info.education;
  722. console.log('education'+personal_info.education)
  723. }
  724. /*
  725. if(_personal_info.educationN)
  726. {
  727. personal_info.educationN = _personal_info.educationN;
  728. console.log('education'+personal_info.educationN)
  729. } */
  730. if(_personal_info.workUnit)
  731. {
  732. personal_info.workUnit = _personal_info.workUnit;
  733. console.log('workUnit'+personal_info.workUnit)
  734. }
  735. if(_personal_info.post)
  736. {
  737. personal_info.post = _personal_info.post;
  738. console.log('post'+personal_info.post)
  739. }
  740. if(_personal_info.industry)
  741. {
  742. personal_info.industry = _personal_info.industry;
  743. console.log('industry'+personal_info.industry)
  744. }
  745. /*
  746. if(_personal_info.industryN)
  747. {
  748. personal_info.industryN = _personal_info.industryN;
  749. console.log('industryN'+personal_info.industryN)
  750. } */
  751. if(_personal_info.salaryRange)
  752. {
  753. personal_info.salaryRange = _personal_info.salaryRange;
  754. console.log('salaryRange'+personal_info.salaryRange)
  755. }
  756. /*
  757. if(_personal_info.salaryRangeN)
  758. {
  759. personal_info.salaryRangeN = _personal_info.salaryRangeN;
  760. console.log('salaryRangeN'+personal_info.salaryRangeN)
  761. } */
  762. if(_personal_info.housingSituation)
  763. {
  764. personal_info.housingSituation = _personal_info.housingSituation;
  765. console.log('housingSituation'+personal_info.housingSituation)
  766. }
  767. /*
  768. if(_personal_info.housingSituationN)
  769. {
  770. personal_info.housingSituationN = _personal_info.housingSituationN;
  771. console.log('housingSituationN'+personal_info.housingSituationN)
  772. } */
  773. if(_personal_info.maritalStatus)
  774. {
  775. personal_info.maritalStatus = _personal_info.maritalStatus;
  776. console.log('maritalStatus'+personal_info.maritalStatus)
  777. }
  778. /*
  779. if(_personal_info.maritalStatusN)
  780. {
  781. personal_info.maritalStatusN = _personal_info.maritalStatusN;
  782. console.log('maritalStatusN'+personal_info.maritalStatusN)
  783. } */
  784. if(_personal_info.childStatus)
  785. {
  786. personal_info.childStatus = _personal_info.childStatus;
  787. console.log('childStatus'+personal_info.childStatus)
  788. }
  789. /*
  790. if(_personal_info.childStatusN)
  791. {
  792. personal_info.childStatusN = _personal_info.childStatusN;
  793. console.log('childStatusN'+personal_info.childStatusN)
  794. } */
  795. if(_personal_info.taIncomeRange)
  796. {
  797. personal_info.taIncomeRange = _personal_info.taIncomeRange;
  798. console.log('taIncomeRange'+personal_info.taIncomeRange)
  799. }
  800. /*
  801. if(_personal_info.taIncomeRangeN)
  802. {
  803. personal_info.taIncomeRangeN = _personal_info.taIncomeRangeN;
  804. console.log('taIncomeRangeN'+personal_info.taIncomeRangeN)
  805. } */
  806. if(_personal_info.birthplace)
  807. {
  808. personal_info.birthplace = _personal_info.birthplace;
  809. console.log('birthplace'+personal_info.birthplace)
  810. }
  811. /*
  812. if(_personal_info.birthplaceN)
  813. {
  814. personal_info.birthplaceN = _personal_info.birthplaceN;
  815. console.log('birthplaceN'+personal_info.birthplaceN)
  816. } */
  817. if(_personal_info.registeredResidence)
  818. {
  819. personal_info.registeredResidence = _personal_info.registeredResidence;
  820. console.log('registeredResidence'+personal_info.registeredResidence)
  821. }
  822. /*
  823. if(_personal_info.registeredResidenceN)
  824. {
  825. personal_info.registeredResidenceN = _personal_info.registeredResidenceN;
  826. console.log('registeredResidenceN'+personal_info.registeredResidenceN)
  827. } */
  828. if(_personal_info.workplace)
  829. {
  830. personal_info.workplace = _personal_info.workplace;
  831. console.log('workplace'+personal_info.workplace)
  832. }
  833. /*
  834. if(_personal_info.workplaceN)
  835. {
  836. personal_info.workplaceN = _personal_info.workplaceN;
  837. console.log('workplaceN'+personal_info.workplaceN)
  838. } */
  839. if(_personal_info.taWorkplace)
  840. {
  841. personal_info.taWorkplace = _personal_info.taWorkplace;
  842. console.log('taWorkplace'+personal_info.taWorkplace)
  843. }
  844. /*
  845. if(_personal_info.taWorkplaceN)
  846. {
  847. personal_info.taWorkplaceN = _personal_info.taWorkplaceN;
  848. console.log('taWorkplaceN'+personal_info.taWorkplaceN)
  849. } */
  850. if(_personal_info.taAgeRange)
  851. {
  852. personal_info.taAgeRange = _personal_info.taAgeRange;
  853. console.log('taAgeRange'+personal_info.taAgeRange)
  854. }
  855. /*
  856. if(_personal_info.taAgeRangeN)
  857. {
  858. personal_info.taAgeRangeN = _personal_info.taAgeRangeN;
  859. console.log('taAgeRangeN'+personal_info.taAgeRangeN)
  860. } */
  861. if(_personal_info.taEdu)
  862. {
  863. personal_info.taEdu = _personal_info.taEdu;
  864. console.log('taEdu'+personal_info.taEdu)
  865. }
  866. /*
  867. if(_personal_info.taEduN)
  868. {
  869. personal_info.taEduN = _personal_info.taEduN;
  870. console.log('education'+personal_info.taEduN)
  871. } */
  872. if(_personal_info.taOccupation)
  873. {
  874. personal_info.taOccupation = _personal_info.taOccupation;
  875. console.log('taOccupation'+personal_info.taOccupation)
  876. }
  877. /*
  878. if(_personal_info.taOccupationN)
  879. {
  880. personal_info.taOccupationN = _personal_info.taOccupationN;
  881. console.log('education'+personal_info.taOccupationN)
  882. } */
  883. if(_personal_info.taOther)
  884. {
  885. personal_info.taOther = _personal_info.taOther;
  886. console.log('taOther'+personal_info.taOther)
  887. }
  888. /*
  889. if(_personal_info.taOccupationN)
  890. {
  891. personal_info.taOccupationN = _personal_info.taOccupationN;
  892. console.log('education'+personal_info.taOccupationN)
  893. } */
  894. console.log('xxxx')
  895. loginApi.save_personal_info(personal_info).then(function(data){
  896. console.log('保存成功'+JSON.stringify(data));
  897. if(data.result){
  898. if(data.data){
  899. _self.findByOpenId();
  900. uni.switchTab({
  901. url:'./index'
  902. })
  903. }
  904. }
  905. //_self.findByOpenId();
  906. /*uni.navigateTo({
  907. url:'../user/index'
  908. })*/
  909. },function(err){
  910. console.log('保存失败'+JSON.stringify(personal_info)+ JSON.stringify(err));
  911. });
  912. },
  913. updatePersonInfo(){
  914. },
  915. updatePersonPlusInfo(){
  916. },
  917. childrenConfirm(e){
  918. console.log('e'+JSON.stringify(e))
  919. this.defaultData.children_status = [this.base_dictionary.znqkList.findIndex(item => item.value === e[0].value)]
  920. this.personal_info.childStatusN = '';
  921. e.map((val, index) => {
  922. // this.result += this.result == '' ? val.label : '-' + val.label;
  923. let result = val.label
  924. _self.personal_info.childStatus = val.value;
  925. this.personal_info.childStatusN += result;
  926. })
  927. },
  928. marriageConfirm(e){
  929. console.log('e'+JSON.stringify(e))
  930. this.defaultData.marriage_status = [this.base_dictionary.hyqkList.findIndex(item => item.value === e[0].value)]
  931. this.personal_info.maritalStatusN = '';
  932. e.map((val, index) => {
  933. // this.result += this.result == '' ? val.label : '-' + val.label;
  934. let result = val.label
  935. console.log('val'+JSON.stringify(val))
  936. _self.personal_info.maritalStatus =val.value;
  937. this.personal_info.maritalStatusN += result;
  938. })
  939. },
  940. houseConfirm(e){
  941. console.log('e'+JSON.stringify(e))
  942. this.defaultData.house_status = [this.base_dictionary.zfqkList.findIndex(item => item.value === e[0].value)]
  943. this.personal_info.housingSituationN = '';
  944. e.map((val, index) => {
  945. // this.result += this.result == '' ? val.label : '-' + val.label;
  946. let result = val.label
  947. _self.personal_info.housingSituation = val.value;
  948. _self.personal_info.housingSituationN += result;
  949. })
  950. },
  951. educationConfirm(e){
  952. console.log('e'+JSON.stringify(e))
  953. this.defaultData.education = [this.base_dictionary.xlList.findIndex(item => item.value === e[0].value)]
  954. this.personal_info.educationN = '';
  955. e.map((val, index) => {
  956. // this.result += this.result == '' ? val.label : '-' + val.label;
  957. let result = val.label
  958. _self.personal_info.education = val.value;
  959. _self.personal_info.educationN += result;
  960. })
  961. },
  962. professionConfirm(e){
  963. console.log('e'+JSON.stringify(e))
  964. this.defaultData.profession = [this.base_dictionary.hyList.findIndex(item => item.value === e[0].value)]
  965. this.personal_info.industryN = '';
  966. e.map((val, index) => {
  967. // this.result += this.result == '' ? val.label : '-' + val.label;
  968. let result = val.label
  969. _self.personal_info.industry = val.value;
  970. this.personal_info.industryN += result;
  971. })
  972. },
  973. salaryConfirm(e){
  974. console.log('e'+JSON.stringify(e))
  975. this.defaultData.salary_range = [this.base_dictionary.yxList.findIndex(item => item.value === e[0].value)]
  976. this.personal_info.salaryRangeN = '';
  977. e.map((val, index) => {
  978. // this.result += this.result == '' ? val.label : '-' + val.label;
  979. let result = val.label
  980. _self.personal_info.salaryRange = val.value;
  981. this.personal_info.salaryRangeN += result;
  982. })
  983. },
  984. taSalaryRangeConfirm(e){
  985. console.log('e111'+JSON.stringify(e))
  986. this.defaultData.ta_salary_range = [this.base_dictionary.yxList.findIndex(item => item.value === e[0].value)]
  987. this.personal_info.taIncomeRangeN = '';
  988. e.map((val, index) => {
  989. // this.result += this.result == '' ? val.label : '-' + val.label;
  990. console.log('val'+val + 'index '+index)
  991. let result = val.label
  992. _self.personal_info.taIncomeRange = val.value;
  993. _self.personal_info.taIncomeRangeN += result;
  994. })
  995. },
  996. taAgeRangeConfirm(e){
  997. console.log('e'+JSON.stringify(e))
  998. this.defaultData.ta_age_range = [this.base_dictionary.nlfwList.findIndex(item => item.value === e[0].value)]
  999. this.personal_info.taAgeRangeN = '';
  1000. e.map((val, index) => {
  1001. console.log('val'+val + 'index '+index)
  1002. // this.result += this.result == '' ? val.label : '-' + val.label;
  1003. let result = val.label
  1004. _self.personal_info.taAgeRange = val.value;
  1005. _self.personal_info.taAgeRangeN += result;
  1006. })
  1007. },
  1008. taEducationConfirm(e){
  1009. console.log('e'+JSON.stringify(e))
  1010. this.defaultData.ta_education = [this.base_dictionary.xlList.findIndex(item => item.value === e[0].value)]
  1011. this.personal_info.taEduN = '';
  1012. e.map((val, index) => {
  1013. console.log('val'+val + 'index '+index)
  1014. // this.result += this.result == '' ? val.label : '-' + val.label;
  1015. let result = val.label
  1016. _self.personal_info.taEdu = val.value;
  1017. _self.personal_info.taEduN += result;
  1018. })
  1019. },
  1020. /*
  1021. educationSelect(e) {
  1022. this.personal_info.education = e.value;
  1023. this.personal_info.educationN = e.name;
  1024. //this.$refs.uForm.validateField('personal_info.education')
  1025. },
  1026. salarySelect(e) {
  1027. this.personal_info.salaryRange = e.value;
  1028. this.personal_info.salaryRangeN = e.name;
  1029. //this.$refs.uForm.validateField('personal_info.salaryRange')
  1030. },
  1031. professionSelect(e) {
  1032. this.personal_info.industry = e.value;
  1033. this.personal_info.industryN = e.name;
  1034. //this.$refs.uForm.validateField('personal_info.industry')
  1035. },
  1036. houseSelect(e) {
  1037. this.personal_info.housingSituation = e.value;
  1038. this.personal_info.housingSituationN = e.name;
  1039. //this.$refs.uForm.validateField('personal_info.housingSituation')
  1040. },
  1041. childrenSelect(e) {
  1042. this.personal_info.childStatus = e.value;
  1043. this.personal_info.childStatusN = e.name;
  1044. //this.$refs.uForm.validateField('personal_info.childStatus')
  1045. },
  1046. marriageSelect(e) {
  1047. this.personal_info.maritalStatus = e.value;
  1048. this.personal_info.maritalStatusN = e.name;
  1049. //this.$refs.uForm.validateField('personal_info.maritalStatus')
  1050. },
  1051. taAgeRangeSelect(e) {
  1052. this.personal_info.taAgeRange = e.value;
  1053. this.personal_info.taAgeRangeN = e.name;
  1054. //this.$refs.uForm.validateField('personal_info.taAgeRange')
  1055. },
  1056. taEducationSelect(e) {
  1057. this.personal_info.taEdu = e.value;
  1058. this.personal_info.taEduN = e.name;
  1059. //this.$refs.uForm.validateField('personal_info.taEdu')
  1060. },
  1061. taSalarySelect(e) {
  1062. this.personal_info.taIncomeRange = e.value;
  1063. this.personal_info.taIncomeRangeN = e.name;
  1064. //this.$refs.uForm.validateField('personal_info.taIncomeRange')
  1065. },*/
  1066. heightConfirm(e){
  1067. console.log('e'+JSON.stringify(e))
  1068. this.defaultData.height = [this.height_ranges.findIndex(item => item.value === e[0].value)]
  1069. this.form.height = '';
  1070. e.map((val, index) => {
  1071. // this.result += this.result == '' ? val.label : '-' + val.label;
  1072. let result = val.label
  1073. _self.personal_info.height = val.value
  1074. this.form.height += result;
  1075. })
  1076. },
  1077. weightConfirm(e){
  1078. console.log('e'+JSON.stringify(e))
  1079. this.defaultData.weight = [this.weight_ranges.findIndex(item => item.value === e[0].value)]
  1080. this.form.weight = '';
  1081. e.map((val, index) => {
  1082. // this.result += this.result == '' ? val.label : '-' + val.label;
  1083. let result = val.label
  1084. _self.personal_info.weight = val.value;
  1085. this.form.weight += result;
  1086. })
  1087. },
  1088. uploadPhoto(){
  1089. // 上传图片
  1090. //const ctx = uni.createCanvasContext('myCanvas');
  1091. //console.log('url'+this.uploadUrl)
  1092. //console.log(this.carhelp.getToken())
  1093. let _this = this;
  1094. uni.chooseImage({
  1095. count: 1, //默认9
  1096. // sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  1097. sourceType: ['album','camera'], //从相册选择
  1098. success:(res)=> {
  1099. let imgFile = res.tempFilePaths;
  1100. console.log(process.car.BASE_URL+"mobile/member/uploadBase64")
  1101. console.log(imgFile)
  1102. console.log(process.car.NODE_ENV)
  1103. console.log()
  1104. var token=this.carhelp.getToken()
  1105. for(let i = 0;i < imgFile.length;i++)
  1106. {
  1107. wx.uploadFile({
  1108. url:process.car.BASE_URL+"uploadPicture",
  1109. // url:process.car.BASE_URL+"mobile/member/uploadBase64",
  1110. name: 'photoFile',
  1111. header: {
  1112. // 'appId': process.car.VUE_APP_WXAPPID ,
  1113. 'Authorization':token ,
  1114. // 'openId': "wxa8954f417fa7c32f" ,
  1115. 'accept': 'application/json',
  1116. //#ifdef MP-WEIXIN
  1117. "Content-Type": "multipart/form-data",//记得设置
  1118. //#endif
  1119. },
  1120. filePath: imgFile[0],
  1121. success: function(result) {
  1122. let imgUrls = JSON.parse(result.data) //百度支持 this.site_url +'/' +
  1123. //let image ={url: imgUrls.data};
  1124. //_self.fileList.push(image); //微信
  1125. _self.personal_info.faceImage = imgUrls.data;
  1126. }
  1127. })
  1128. }
  1129. },
  1130. });
  1131. },
  1132. findByOpenId(){
  1133. var openId=this.carhelp.getOpenId()
  1134. if(openId==""){
  1135. console.log("------------------")
  1136. setTimeout(()=>{
  1137. this.findByOpenId()
  1138. },1000)
  1139. return
  1140. }
  1141. uni.request({
  1142. method:'get',
  1143. url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
  1144. data: {
  1145. openId:openId,
  1146. },
  1147. header: {
  1148. 'Content-Type': 'application/x-www-form-urlencoded',
  1149. 'X-Requested-With': 'XMLHttpRequest',
  1150. }
  1151. }).then((response) => {
  1152. // console.log('findByOpenId' +JSON.stringify(response))
  1153. let [error, res] = response;
  1154. if (res.data.code == 200&&res.data.result) {
  1155. var token = res ? res.data.data.token : '';
  1156. this.carhelp.setPersonInfo(res.data.data.memberInfo );
  1157. this.carhelp.setToken(token);
  1158. this.carhelp.setPersonInfoPlus(res.data.data);
  1159. }
  1160. }).catch(error => {
  1161. })
  1162. }
  1163. }
  1164. }
  1165. </script>
  1166. <style>
  1167. page{
  1168. background-color: #f4f0f0;
  1169. }
  1170. </style>
  1171. <style lang="scss" scoped>
  1172. .edit-text{
  1173. margin-top: 10px;
  1174. color:#999;
  1175. }
  1176. .edit-row{
  1177. padding: 12px 0;
  1178. .edit-label{
  1179. display: flex;
  1180. margin-top: 10px;
  1181. flex-wrap: wrap;
  1182. span{
  1183. margin-right: 8px;
  1184. background-color: #E5E7EA ;
  1185. padding: 4px 10px;
  1186. border-radius: 4px;
  1187. font-size: 12px;
  1188. margin-bottom: 10px;
  1189. }
  1190. .active{
  1191. background-color: #FFC1BC;
  1192. }
  1193. }
  1194. }
  1195. .edit-line{
  1196. height: 12px;
  1197. background-color:#f4f0f0 ;
  1198. margin-left: -15px;
  1199. margin-right: -15px;
  1200. }
  1201. .edit-title{
  1202. padding:12px 0;
  1203. padding-left: 15px;
  1204. background-color:#f4f0f0 ;
  1205. margin-left: -15px;
  1206. margin-right: -15px;
  1207. }
  1208. .edit-head{
  1209. display: flex;
  1210. padding: 20px 0;
  1211. justify-content: center;
  1212. }
  1213. .personal-btn{
  1214. padding: 15px 50px;
  1215. }
  1216. .edit-form{
  1217. padding: 0 15px;
  1218. background-color: #fff;
  1219. }
  1220. </style>