edit.vue 56 KB

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