modelrz.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. <template>
  2. <view class="content ">
  3. <view class="item-name">
  4. 上传头像
  5. </view>
  6. <view class="con_box">
  7. <view class="con_image">
  8. <image class="img" @click="navCroper(400,400,'one')"
  9. :src="updata.avatar||`../../../static/image/upImg.png`">
  10. </image>
  11. </view>
  12. </view>
  13. <view class="item-name">
  14. 基本信息
  15. </view>
  16. <view class="listBox">
  17. <view class="list">
  18. <view class="flex listItem">
  19. <view class="flex titleBox">
  20. <text class="font-color-red font-size-sm">✲</text> <text class="title">真实姓名</text>
  21. </view>
  22. <view class="right flex">
  23. <input class="input" v-model="updata.name" type="text" placeholder="请填写真实姓名"
  24. placeholder-class="placeholder" />
  25. </view>
  26. </view>
  27. <view class="flex listItem">
  28. <view class="flex titleBox">
  29. <text class="font-color-red font-size-sm">✲</text><text class="title">手机号</text>
  30. </view>
  31. <view class="right flex">
  32. <input class="input" v-model="updata.phone" type="text" placeholder="请填写手机号"
  33. placeholder-class="placeholder" />
  34. </view>
  35. </view>
  36. <view class="flex listItem">
  37. <view class="flex titleBox">
  38. <text class="font-color-red font-size-sm">✲</text><text class="title">身份证号</text>
  39. </view>
  40. <view class="right flex">
  41. <input class="input" v-model="updata.cardId" type="text" placeholder="请填写身份证号"
  42. placeholder-class="placeholder" />
  43. </view>
  44. </view>
  45. <view class="flex listItem">
  46. <view class="flex titleBox">
  47. <text class="title">从业时长</text>
  48. </view>
  49. <view class="right flex">
  50. <input class="input" v-model="updata.work_year" type="number" placeholder="请填写从业时长"
  51. placeholder-class="placeholder" />
  52. </view>
  53. </view>
  54. <view class="flex listItem">
  55. <view class="flex titleBox">
  56. <text class="title">籍贯</text>
  57. </view>
  58. <view class="right flex">
  59. <pickerAddress @change="changeAncestralPlace">
  60. {{
  61. updata.ancestral_place||'请选择籍贯'
  62. }}
  63. </pickerAddress>
  64. </view>
  65. </view>
  66. <view class="flex listItem">
  67. <view class="flex titleBox">
  68. <text class="title">学历</text>
  69. </view>
  70. <view class="right flex">
  71. <picker class="input" :range='educationList' mode="selector" @change="changeEducation">
  72. <view>
  73. {{updata.education||'选择学历'}}
  74. </view>
  75. </picker>
  76. </view>
  77. </view>
  78. <view class="flex listItem">
  79. <view class="flex titleBox">
  80. <text class="title">民族</text>
  81. </view>
  82. <view class="right flex">
  83. <input class="input" v-model="updata.minority" type="text" placeholder="请填写民族"
  84. placeholder-class="placeholder" />
  85. </view>
  86. </view>
  87. <!-- <view class="flex listItem">
  88. <view class="flex titleBox">
  89. <text class="title">出生日期</text>
  90. </view>
  91. <view class="right flex">
  92. <picker class="input" value='2000-01-01' mode="date" @change="changetime">
  93. <view>
  94. {{updata.time||'请选择日期'}}
  95. </view>
  96. </picker>
  97. </view>
  98. </view> -->
  99. <view class="flex listItem">
  100. <view class="flex titleBox">
  101. <text class="font-color-red font-size-sm">✲</text><text class="title">职业</text>
  102. </view>
  103. <view class="right flex">
  104. <picker class="input" :range='workTypeList' range-key='title' mode="selector"
  105. @change="changeWorkType">
  106. <view>
  107. {{updata.word.title||'选择职业'}}
  108. </view>
  109. </picker>
  110. </view>
  111. </view>
  112. <view class="flex listItem">
  113. <view class="flex titleBox">
  114. <text class="font-color-red font-size-sm">✲</text><text class="title">收费类型</text>
  115. </view>
  116. <view class="right flex">
  117. <picker class="input" :value="updata.timetype.ind" :range='timeTypeList' range-key='title'
  118. mode="selector" @change="changetimetype">
  119. <view>
  120. {{updata.timetype.title||'收费时间类型'}}
  121. </view>
  122. </picker>
  123. </view>
  124. </view>
  125. <view class="flex listItem">
  126. <view class="flex titleBox">
  127. <text class="font-color-red font-size-sm">✲</text><text class="title">最低价</text>
  128. </view>
  129. <view class="right flex">
  130. <input class="input" v-model="updata.minMoney" type="number" placeholder="请输入最低收费价"
  131. placeholder-class="placeholder" />
  132. </view>
  133. </view>
  134. <view class="flex listItem">
  135. <view class="flex titleBox">
  136. <text class="font-color-red font-size-sm">✲</text><text class="title">最高价</text>
  137. </view>
  138. <view class="right flex">
  139. <input class="input" v-model="updata.maxMoney" type="number" placeholder="请输入最高收费价"
  140. placeholder-class="placeholder" />
  141. </view>
  142. </view>
  143. <view class="flex listItem">
  144. <view class="flex titleBox">
  145. <text class="font-color-red font-size-sm">✲</text><text class="title">服务区域</text>
  146. </view>
  147. <view class="right">
  148. <view class="citylist">
  149. <view class="flex margin-b-20" v-for="(item,ind) in updata.onCity" :key="ind">
  150. <view></view>
  151. <view>
  152. {{item.province+item.city+item.district}}
  153. <text class="margin-l-10 del" @click="updata.onCity.splice(ind,1)">
  154. 删除
  155. </text>
  156. </view>
  157. </view>
  158. <view class="flex">
  159. <view></view>
  160. <pickerAddress class="buttom" @change="onCityClick">添加地区</pickerAddress>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. <view class="flex listItem">
  166. <view class="flex titleBox">
  167. <text class="font-color-red font-size-sm">✲</text><text class="title">服务内容</text>
  168. </view>
  169. <view class="right">
  170. <checkbox-group @change="checkTypeChange">
  171. <label class="flex timetype margin-b-10" v-for="(item,ind) in typeList" :key="item.id">
  172. <view class="margin-r-10">{{item.title}}</view>
  173. <view>
  174. <checkbox :value="`${item.id}`" :checked="item.checked" />
  175. </view>
  176. </label>
  177. </checkbox-group>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <view class="item-name">
  183. 自我展示
  184. </view>
  185. <view class="listBox">
  186. <view class="list">
  187. <view class="listItem">
  188. <textarea class="textarea" auto-height :maxlength='-1' v-model="updata.mymask" type="text" placeholder="自我评价\n\n本人从业***年,已经服务***名客户\n成长经历:\n从事母婴工作之前是做***行业的,于***年经过专业培训后进入母婴行业;先后学习了***\n性格特征:\n本人性格直爽,具有很强的服务意识,做事认真负责,擅长……类工作\n服务格言:\n全心全意服务好每一位客户" placeholder-class="textareaplaceholder" />
  189. </view>
  190. </view>
  191. <view class="con_box">
  192. <view class="con_image" v-for="(item,ind) in updata.imageList">
  193. <image class="img" @click="navCroper(400,400,'tab',ind)" :src="item"></image>
  194. <image @click="updata.imageList.splice(ind,1)" class="tip" src="../../../static/icon/goodsExit.png"
  195. mode="scaleToFill"></image>
  196. </view>
  197. <view class="con_image">
  198. <image class="img" @click="navCroper(400,400,'all')" src="../../../static/image/upImg.png"></image>
  199. </view>
  200. </view>
  201. </view>
  202. <view class="item-name">
  203. 我的证书
  204. </view>
  205. <view class="listBox">
  206. <view class="con_box">
  207. <view class="con_image" v-for="(item,ind) in updata.service_audit_imgs">
  208. <image class="img" @click="navCroper(400,400,'audit',ind)" :src="item"></image>
  209. <image @click="updata.service_audit_imgs.splice(ind,1)" class="tip"
  210. src="../../../static/icon/goodsExit.png" mode="scaleToFill"></image>
  211. </view>
  212. <view class="con_image">
  213. <image class="img" @click="navCroper(400,400,'auditall')" src="../../../static/image/upImg.png">
  214. </image>
  215. </view>
  216. </view>
  217. </view>
  218. <view class="item-name">
  219. 服务展示
  220. </view>
  221. <view class="listBox">
  222. <view class="con_box">
  223. <view class="con_image" v-for="(item,ind) in updata.service_imgs">
  224. <image class="img" @click="navCroper(400,400,'service',ind)" :src="item"></image>
  225. <image @click="updata.service_imgs.splice(ind,1)" class="tip"
  226. src="../../../static/icon/goodsExit.png" mode="scaleToFill"></image>
  227. </view>
  228. <view class="con_image">
  229. <image class="img" @click="navCroper(400,400,'serviceall')" src="../../../static/image/upImg.png">
  230. </image>
  231. </view>
  232. </view>
  233. </view>
  234. <view class="base-buttom flex">
  235. <view class="updata flex flex-center" :class="{ 'bg-gray': loding }" @click="loding ? '' : confirm()">
  236. 提交
  237. </view>
  238. <view class="ylan flex flex-center" @click="look">
  239. 预览
  240. </view>
  241. </view>
  242. </view>
  243. </template>
  244. <script>
  245. import {
  246. getServiceTimeTypeList,
  247. getServiceTypeList,
  248. subInfoAudit,
  249. getUserWorkTypeList,
  250. getUserCardInfo
  251. } from '@/api/model.js';
  252. import {
  253. isCardNo
  254. } from '@/utils/rocessor.js';
  255. import {
  256. getAstro,
  257. getShengXiao,
  258. IdCard
  259. } from '@/utils/twelve.js';
  260. import {
  261. mapState
  262. } from "vuex"
  263. import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue';
  264. export default {
  265. components: {
  266. pickerAddress
  267. },
  268. data() {
  269. return {
  270. // 上传数据
  271. updata: {
  272. avatar: '', //用户头像
  273. name: '', //用户名称
  274. phone: '', //手机号
  275. cardId: '', //身份证号
  276. minMoney: '', //最低价
  277. maxMoney: '', //最高价
  278. checkedType: [], //选中的服务类型
  279. time: '', //出生日期
  280. timetype: {
  281. title: '',
  282. code: '',
  283. ind: 0 //默认0
  284. }, //选中的时间类型
  285. onCity: [], //选中的城市
  286. mymask: '', //自评
  287. imageList: [], //自评上传图片列表
  288. ancestral_place: '', //籍贯
  289. education: '', //学历
  290. minority: '', //民族
  291. work_year: '', //从业时长
  292. word: {
  293. title: '',
  294. id: ''
  295. },
  296. service_audit_imgs: [], //我的证书
  297. service_imgs: [], //服务展示
  298. },
  299. typeList: [], //服务类型
  300. timeTypeList: [], //时间类型
  301. workTypeList: [], //工作类型
  302. loding: false, //是否载入中
  303. type: 0, //0为新增,1为修改2为商品页进入注册
  304. userModelData: {}, //保存获取的用户模板
  305. modelid: '', //保存要预览的模板id
  306. educationList: ['小学', '初中', '高中', '大专', '本科', '研究生', '博士'] //学历列表
  307. };
  308. },
  309. async onLoad(options) {
  310. this.modelid = options.modelid
  311. if (options.type == 1) {
  312. this.type = 1;
  313. await this.getUserCardInfo()
  314. } else if (options.type == 2) {
  315. this.type = 0
  316. }
  317. this.init()
  318. },
  319. computed: {
  320. // #ifdef H5
  321. ...mapState(['urlFile']),
  322. // #endif
  323. ...mapState(['baseURL']),
  324. },
  325. methods: {
  326. // 选择学历
  327. changeEducation(res) {
  328. this.updata.education = this.educationList[res.detail.value];
  329. console.log(res);
  330. },
  331. // 初始化
  332. init() {
  333. const that = this;
  334. getServiceTimeTypeList().then(
  335. (res) => {
  336. that.timeTypeList = res.data.list.map((arr) => {
  337. return arr
  338. })
  339. if (that.type == 0) {
  340. that.updata.timetype = that.timeTypeList[0];
  341. } else
  342. if (that.type == 1) {
  343. for (let i = 0; i < that.timeTypeList.length; i++) {
  344. if (that.timeTypeList[i].code == that.userModelData.service_type) {
  345. that.updata.timetype = that.timeTypeList[i]
  346. that.updata.timetype.ind = i;
  347. break
  348. }
  349. }
  350. }
  351. }
  352. ).catch(
  353. (res) => {
  354. console.log(res);
  355. }
  356. )
  357. getServiceTypeList().then(
  358. (res) => {
  359. that.typeList = res.data.list
  360. if (that.type == 1) {
  361. for (let i = 0; i < that.userModelData.service_project_ar.length; i++) {
  362. for (let a = 0; a < that.typeList.length; a++) {
  363. if (+that.typeList[a].id == +that.userModelData.service_project_ar[i].id) {
  364. that.typeList[a].checked = true;
  365. that.updata.checkedType.push('' + that.typeList[a].id)
  366. }
  367. }
  368. }
  369. }
  370. console.log(res, '服务');
  371. }
  372. ).catch(
  373. (res) => {
  374. console.log(res);
  375. }
  376. )
  377. getUserWorkTypeList().then(
  378. (res) => {
  379. console.log(res);
  380. that.workTypeList = res.data.list
  381. if (that.type == 0) {
  382. that.updata.word = that.workTypeList[0];
  383. } else if (that.type == 1) {
  384. for (let i = 0; i < that.workTypeList.length; i++) {
  385. console.log(that.userModelData.user_work_type_id, 'word', that.workTypeList[i].id);
  386. if (that.workTypeList[i].id == that.userModelData.user_work_type_id) {
  387. that.updata.word = that.workTypeList[i];
  388. break
  389. }
  390. }
  391. }
  392. }
  393. ).catch(
  394. (res) => {
  395. console.log(res);
  396. }
  397. )
  398. },
  399. // 跳转查看预览页面
  400. look() {
  401. const that = this;
  402. if (!that.rendl()) {
  403. return
  404. }
  405. const birthday = IdCard('' + that.updata.cardId, 1);
  406. // 复制选中的服务数组
  407. let arr = [...that.updata.checkedType]
  408. let pushar = [];
  409. that.typeList.forEach(
  410. (re) => {
  411. for (let i = 0; i < arr.length; i++) {
  412. console.log(arr[i], '循环');
  413. if (+arr[i] == +re.id) {
  414. // 删除已选中的对象
  415. arr.splice(i, 1)
  416. pushar.push(re)
  417. break
  418. }
  419. }
  420. }
  421. )
  422. let data = {
  423. name: that.updata.name,
  424. avatar: that.updata.avatar,
  425. age: IdCard(that.updata.cardId, 3),
  426. twelve: getShengXiao(birthday),
  427. work_year: that.updata.work_year,
  428. constellation: getAstro(...(birthday.split('-'))),
  429. ancestral_place: that.updata.ancestral_place,
  430. minority: that.updata.minority,
  431. education: that.updata.education,
  432. service_area_all: that.updata.onCity.map(
  433. (item) => {
  434. return item.province + item.city + item.district
  435. }
  436. ),
  437. service_min_price: that.updata.minMoney,
  438. service_max_price: that.updata.maxMoney,
  439. service_time_type_title: that.updata.timetype.title,
  440. service_intro_content: that.updata.mymask,
  441. service_intro_imgs: that.updata.service_imgs,
  442. service_audit_imgs: that.updata.service_audit_imgs,
  443. service_project_ar: pushar,
  444. is_type_audit: 1
  445. }
  446. uni.setStorageSync('modeldata', data)
  447. uni.navigateTo({
  448. url: '/pages/user/model/model?mtype=' + that.modelid + '&type=1'
  449. })
  450. },
  451. // 获取用户提交数据
  452. getUserCardInfo() {
  453. const that = this;
  454. return new Promise((resolve, reject) => {
  455. getUserCardInfo().then(
  456. (data) => {
  457. const res = data.data;
  458. // 存储返回用户数据
  459. that.userModelData = res;
  460. that.updata = Object.assign(that.updata, {
  461. avatar: res.avatar, //用户头像
  462. name: res.name, //用户名称
  463. phone: res.mobile, //手机号
  464. cardId: res.idcard, //身份证号
  465. minMoney: res.service_min_price, //最低价
  466. maxMoney: res.service_max_price, //最高价
  467. time: res.birthday, //出生日期
  468. onCity: res.service_area_all.map((arr) => {
  469. return {
  470. province: arr[0].name,
  471. city: arr[1].name,
  472. district: arr[2].name
  473. }
  474. }), //选中的城市
  475. mymask: res.service_intro_content, //自评
  476. imageList: res.service_intro_imgs, //自评上传图片列表
  477. ancestral_place: res.ancestral_place, //籍贯
  478. education: res.education, //学历
  479. minority: res.minority, //民族
  480. work_year: res.work_year, //从业时长
  481. service_audit_imgs: res.service_audit_imgs, //我的证书
  482. service_imgs: res.service_imgs, //服务展示
  483. })
  484. console.log(that.updata, 'that.updata');
  485. resolve('初始化数据成功')
  486. }
  487. ).catch(
  488. (res) => {
  489. reject(res)
  490. }
  491. )
  492. })
  493. },
  494. // 选中的服务类型
  495. checkTypeChange(type) {
  496. this.updata.checkedType = type.detail.value;
  497. console.log(type)
  498. },
  499. // 选中的工作类型
  500. changeWorkType(type) {
  501. this.updata.word = this.workTypeList[type.detail.value];
  502. console.log(this.updata.word)
  503. },
  504. // 选择时间类型
  505. changetimetype(res) {
  506. this.updata.timetype = this.timeTypeList[res.detail.value];
  507. },
  508. // 时间选择
  509. changetime(time) {
  510. this.updata.time = time.detail.value;
  511. console.log(time);
  512. },
  513. // 选择籍贯
  514. changeAncestralPlace({
  515. data
  516. }) {
  517. this.updata.ancestral_place = data[2];
  518. },
  519. // 选择省市区
  520. onCityClick({
  521. data
  522. }) {
  523. let address = {};
  524. address.province = data[0];
  525. address.city = data[1];
  526. address.district = data[2];
  527. this.updata.onCity.push(address)
  528. console.log(this.onCity, 'cs');
  529. },
  530. upLoad(path) {
  531. // #ifdef H5
  532. console.log(path, 'h5');
  533. // #endif
  534. uni.showLoading({
  535. title: '图片上传中',
  536. mask: true
  537. });
  538. return new Promise((resolve, error) => {
  539. uni.uploadFile({
  540. url: this.baseURL + '/api/user/qiniuUpload', //仅为示例,非真实的接口地址
  541. filePath: path,
  542. name: 'file',
  543. header: {
  544. "token": uni.getStorageSync('token')
  545. },
  546. success: (uploadFileRes) => {
  547. if ("string" === typeof uploadFileRes.data) {
  548. resolve(JSON.parse(uploadFileRes.data).data)
  549. } else {
  550. resolve(uploadFileRes.data.data)
  551. }
  552. },
  553. complete() {
  554. uni.hideLoading()
  555. }
  556. });
  557. })
  558. },
  559. // 图片裁切
  560. /**
  561. * @param {Number} w 裁切宽度比例
  562. * @param {Number} h 裁切高度比例
  563. * @param {Number} mw 图片最小宽度
  564. * @param {Number} mh 图片最小高度
  565. * @param {String} url url修改
  566. */
  567. navCroper(w, h, type, ind) {
  568. let that = this;
  569. let tt = (type == 'upimg' ? 2 : 1)
  570. this.onImg(tt).then((url) => {
  571. uni.navigateTo({
  572. url: `../realName/cropper?width=${w}&height=${h}`,
  573. events: {
  574. uploadSuccess(res) {
  575. that.upLoad(res).then((urldata) => {
  576. console.log(urldata);
  577. if (type == 'one') {
  578. that.updata.avatar = urldata.img
  579. } else if (type == 'all') {
  580. that.updata.imageList.push(urldata.img)
  581. } else if (type == 'tab') {
  582. that.updata.imageList.splice(ind, 1, urldata.img)
  583. } else if (type == 'audit') {
  584. that.updata.service_audit_imgs.splice(ind, 1, urldata.img)
  585. } else if (type == 'auditall') {
  586. that.updata.service_audit_imgs.push(urldata.img)
  587. } else if (type == 'service') {
  588. that.updata.service_imgs.splice(ind, 1, urldata.img)
  589. } else if (type == 'serviceall') {
  590. that.updata.service_imgs.push(urldata.img)
  591. }
  592. })
  593. }
  594. },
  595. success: function(res) {
  596. // 通过eventChannel向被打开页面传送数据
  597. res.eventChannel.emit('urlNext', {
  598. url
  599. })
  600. }
  601. })
  602. })
  603. },
  604. onImg(type) {
  605. const _this = this
  606. return new Promise((ok, erro) => {
  607. // 判断是否需要选择
  608. if (type == 1) {
  609. uni.showActionSheet({
  610. itemList: ['拍照', '选择一张照片'],
  611. success: function(res) {
  612. _this.chooseImage(res.tapIndex).then((url) => {
  613. ok(url)
  614. }).catch((res) => {
  615. erro(res)
  616. })
  617. },
  618. fail: function(res) {
  619. erro(res)
  620. console.log(res.errMsg);
  621. }
  622. });
  623. }
  624. // 判断是否只需要拍照
  625. if (type == 2) {
  626. _this.chooseImage(0).then((url) => {
  627. ok(url)
  628. }).catch((res) => {
  629. erro(res)
  630. })
  631. }
  632. })
  633. },
  634. chooseImage: function(index) {
  635. const _this = this
  636. return new Promise((ok, error) => {
  637. // 从相册/相机选择
  638. // 如需直接开相机或直接选相册,请只使用一个选项
  639. const sourceType = index === 0 ? ['camera'] : ['album']
  640. uni.chooseImage({
  641. count: 1, //默认9
  642. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  643. sourceType: sourceType,
  644. success: function(res) {
  645. ok(res.tempFilePaths[0])
  646. },
  647. fail(e) {
  648. uni.showModal({
  649. title: '文件打开错误',
  650. content: '请设置授权文件存储权限',
  651. showCancel: false,
  652. });
  653. error(e)
  654. }
  655. });
  656. })
  657. },
  658. // 实名认证
  659. confirm(e) {
  660. const that = this;
  661. if (!that.rendl()) {
  662. return
  663. }
  664. that.loding = true;
  665. subInfoAudit({
  666. avatar: that.updata.avatar,
  667. name: that.updata.name,
  668. mobile: that.updata.phone,
  669. idcard: that.updata.cardId,
  670. service_type: that.updata.timetype.code,
  671. service_min_price: that.updata.minMoney,
  672. service_max_price: that.updata.maxMoney,
  673. service_area: that.updata.onCity.map((arr) => {
  674. return arr.district
  675. }),
  676. service_project: that.updata.checkedType,
  677. service_intro_content: that.updata.mymask,
  678. service_intro_imgs: that.updata.imageList,
  679. work_year: that.updata.work_year,
  680. ancestral_place: that.updata.ancestral_place,
  681. education: that.updata.education,
  682. minority: that.updata.minority,
  683. service_audit_imgs: that.updata.service_audit_imgs,
  684. service_imgs: that.updata.service_imgs,
  685. user_work_type_id: that.updata.word.id,
  686. })
  687. .then((e) => {
  688. that.loding = false;
  689. this.$api.msg(e.msg);
  690. })
  691. .catch(err => {
  692. this.loding = false;
  693. console.log(err);
  694. });
  695. },
  696. // 认证
  697. rendl() {
  698. const that = this;
  699. if (!that.updata.avatar) {
  700. uni.showModal({
  701. title: '错误',
  702. content: '请上传头像',
  703. showCancel: false,
  704. });
  705. return false
  706. }
  707. if (!that.updata.name) {
  708. uni.showModal({
  709. title: '错误',
  710. content: '请填写姓名',
  711. showCancel: false,
  712. });
  713. return false
  714. }
  715. if (!that.updata.cardId) {
  716. uni.showModal({
  717. title: '错误',
  718. content: '请填写身份证号',
  719. showCancel: false,
  720. });
  721. return
  722. } else if (!isCardNo(that.updata.cardId)) {
  723. uni.showModal({
  724. title: '错误',
  725. content: '请填写正确的身份证号',
  726. showCancel: false,
  727. });
  728. return false
  729. }
  730. if (!that.updata.phone) {
  731. uni.showModal({
  732. title: '错误',
  733. content: '请填写手机号',
  734. showCancel: false,
  735. });
  736. return false
  737. }
  738. if (!that.updata.timetype.code) {
  739. uni.showModal({
  740. title: '错误',
  741. content: '请选择收费时间类型',
  742. showCancel: false,
  743. });
  744. return false
  745. }
  746. if (!that.updata.minMoney) {
  747. uni.showModal({
  748. title: '错误',
  749. content: '请填写最低收费价',
  750. showCancel: false,
  751. });
  752. return false
  753. }
  754. if (!that.updata.maxMoney) {
  755. uni.showModal({
  756. title: '错误',
  757. content: '请填写最高收费价',
  758. showCancel: false,
  759. });
  760. return false
  761. }
  762. if (that.updata.onCity.length == 0) {
  763. uni.showModal({
  764. title: '错误',
  765. content: '请选择服务区域',
  766. showCancel: false,
  767. });
  768. return false
  769. }
  770. if (that.updata.checkedType.length == 0) {
  771. uni.showModal({
  772. title: '错误',
  773. content: '请选择服务内容',
  774. showCancel: false,
  775. });
  776. return false
  777. }
  778. return true
  779. }
  780. }
  781. };
  782. </script>
  783. <style lang="scss">
  784. .content,
  785. page {
  786. min-height: 100%;
  787. }
  788. .content {
  789. padding-bottom: 150rpx;
  790. }
  791. .item-name {
  792. margin: $page-row-spacing;
  793. font-size: $font-lg;
  794. font-weight: bold;
  795. color: $font-color-dark;
  796. }
  797. .con_box {
  798. margin: $page-row-spacing;
  799. .con_image {
  800. width: 150rpx;
  801. height: 150rpx;
  802. display: inline-block;
  803. margin-right: 20rpx;
  804. position: relative;
  805. .img {
  806. width: 100%;
  807. height: 100%;
  808. }
  809. .tip {
  810. position: absolute;
  811. top: -10rpx;
  812. right: -10rpx;
  813. width: 30rpx;
  814. height: 30rpx;
  815. background-color: #FFF;
  816. border-radius: 99rpx;
  817. }
  818. }
  819. }
  820. .listBox {
  821. margin: $page-row-spacing;
  822. margin-top: 30rpx;
  823. border-radius: 20rpx;
  824. overflow: hidden;
  825. background-color: #FFFFFF;
  826. }
  827. .list {
  828. .input {
  829. text-align: right;
  830. font-size: $font-base;
  831. color: $color-gray;
  832. width: 100%;
  833. }
  834. .listItem {
  835. padding: 35rpx 40rpx;
  836. border-bottom: 1px solid $page-color-light;
  837. .textarea{
  838. font-size: $font-base;
  839. width: 100%;
  840. word-wrap: break-word;
  841. white-space: pre-line;
  842. min-height: 9rem;
  843. }
  844. /deep/ .textareaplaceholder{
  845. word-wrap: break-word;
  846. white-space: pre-line;
  847. }
  848. }
  849. .listIconImg {
  850. width: 36rpx;
  851. }
  852. .right {
  853. color: $font-color-light;
  854. font-size: $font-base;
  855. flex-grow: 1;
  856. justify-content: flex-end;
  857. .timetype {
  858. width: 100%;
  859. justify-content: flex-end;
  860. }
  861. .citylist {
  862. .del {
  863. color: $color-red;
  864. font-size: $font-sm;
  865. border: 1px solid $color-red;
  866. border-radius: 10rpx;
  867. line-height: 1;
  868. padding: 5rpx 15rpx;
  869. }
  870. }
  871. .img {
  872. width: 26rpx;
  873. }
  874. .buttom {
  875. color: $base-color;
  876. border: 1px solid $base-color;
  877. border-radius: 10rpx;
  878. line-height: 1;
  879. padding: 10rpx 20rpx;
  880. }
  881. }
  882. .titleBox {
  883. .title {
  884. color: $font-color-base;
  885. font-size: $font-base;
  886. }
  887. }
  888. }
  889. .bg-gray {
  890. background-color: $color-gray;
  891. }
  892. .base-buttom {
  893. position: fixed;
  894. bottom: 0rpx;
  895. right: 0rpx;
  896. left: 0rpx;
  897. margin: 0;
  898. padding: 0;
  899. height: 100rpx;
  900. border-radius: 0;
  901. .updata,
  902. .ylan {
  903. width: 50%;
  904. height: 100%;
  905. justify-content: center;
  906. }
  907. .ylan {
  908. background-color: #FFF;
  909. color: $font-color-dark;
  910. }
  911. }
  912. </style>