modelrz.vue 24 KB

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