modelrz.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  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. if(!that.rendl()){
  392. return
  393. }
  394. const birthday = IdCard('' + that.updata.cardId, 1);
  395. // 复制选中的服务数组
  396. let arr = [...that.updata.checkedType]
  397. let pushar=[];
  398. that.typeList.forEach(
  399. (re) => {
  400. for (let i = 0; i < arr.length; i++) {
  401. console.log(arr[i],'循环');
  402. if (+arr[i] == +re.id) {
  403. // 删除已选中的对象
  404. arr.splice(i, 1)
  405. pushar.push(re)
  406. break
  407. }
  408. }
  409. }
  410. )
  411. let data = {
  412. name: that.updata.name,
  413. avatar: that.updata.avatar,
  414. age: IdCard(that.updata.cardId, 3),
  415. twelve: getShengXiao(birthday),
  416. work_year: that.updata.work_year,
  417. constellation: getAstro(...(birthday.split('-'))),
  418. ancestral_place: that.updata.ancestral_place,
  419. minority: that.updata.minority,
  420. education: that.updata.education,
  421. service_area_all: that.updata.onCity.map(
  422. (item) => {
  423. return item.province + item.city + item.district
  424. }
  425. ),
  426. service_min_price: that.updata.minMoney,
  427. service_max_price: that.updata.maxMoney,
  428. service_time_type_title: that.updata.timetype.title,
  429. service_intro_content: that.updata.mymask,
  430. service_intro_imgs: that.updata.service_imgs,
  431. service_audit_imgs: that.updata.service_audit_imgs,
  432. service_project_ar: pushar,
  433. is_type_audit: 1
  434. }
  435. uni.setStorageSync('modeldata',data)
  436. uni.navigateTo({
  437. url: '/pages/user/model/model?mtype=' + that.modelid + '&look=2'
  438. })
  439. },
  440. // 获取用户提交数据
  441. getUserCardInfo() {
  442. const that = this;
  443. return new Promise((resolve, reject) => {
  444. getUserCardInfo().then(
  445. (data) => {
  446. const res = data.data;
  447. // 存储返回用户数据
  448. that.userModelData = res;
  449. that.updata = Object.assign(that.updata, {
  450. avatar: res.avatar, //用户头像
  451. name: res.name, //用户名称
  452. phone: res.mobile, //手机号
  453. cardId: res.idcard, //身份证号
  454. minMoney: res.service_min_price, //最低价
  455. maxMoney: res.service_max_price, //最高价
  456. time: res.birthday, //出生日期
  457. onCity: res.service_area_all.map((arr) => {
  458. return {
  459. province: arr[0].name,
  460. city: arr[1].name,
  461. district: arr[2].name
  462. }
  463. }), //选中的城市
  464. mymask: res.service_intro_content, //自评
  465. imageList: res.service_intro_imgs, //自评上传图片列表
  466. ancestral_place: res.ancestral_place, //籍贯
  467. education: res.education, //学历
  468. minority: res.minority, //民族
  469. work_year: res.work_year, //从业时长
  470. service_audit_imgs: res.service_audit_imgs, //我的证书
  471. service_imgs: res.service_imgs, //服务展示
  472. })
  473. console.log(that.updata, 'that.updata');
  474. resolve('初始化数据成功')
  475. }
  476. ).catch(
  477. (res) => {
  478. reject(res)
  479. }
  480. )
  481. })
  482. },
  483. // 选中的服务类型
  484. checkTypeChange(type) {
  485. this.updata.checkedType = type.detail.value;
  486. console.log(type)
  487. },
  488. // 选中的工作类型
  489. changeWorkType(type) {
  490. this.updata.word = this.workTypeList[type.detail.value];
  491. console.log(this.updata.word)
  492. },
  493. // 选择时间类型
  494. changetimetype(res) {
  495. this.updata.timetype = this.timeTypeList[res.detail.value];
  496. },
  497. // 时间选择
  498. changetime(time) {
  499. this.updata.time = time.detail.value;
  500. console.log(time);
  501. },
  502. // 选择省市区
  503. onCityClick({
  504. data
  505. }) {
  506. let address = {};
  507. address.province = data[0];
  508. address.city = data[1];
  509. address.district = data[2];
  510. this.updata.onCity.push(address)
  511. console.log(this.onCity, 'cs');
  512. },
  513. upLoad(path) {
  514. // #ifdef H5
  515. console.log(path, 'h5');
  516. // #endif
  517. uni.showLoading({
  518. title: '图片上传中',
  519. mask: true
  520. });
  521. return new Promise((resolve, error) => {
  522. uni.uploadFile({
  523. url: this.baseURL + '/api/user/qiniuUpload', //仅为示例,非真实的接口地址
  524. filePath: path,
  525. name: 'file',
  526. header: {
  527. "token": uni.getStorageSync('token')
  528. },
  529. success: (uploadFileRes) => {
  530. if ("string" === typeof uploadFileRes.data) {
  531. resolve(JSON.parse(uploadFileRes.data).data)
  532. } else {
  533. resolve(uploadFileRes.data.data)
  534. }
  535. },
  536. complete() {
  537. uni.hideLoading()
  538. }
  539. });
  540. })
  541. },
  542. // 图片裁切
  543. /**
  544. * @param {Number} w 裁切宽度比例
  545. * @param {Number} h 裁切高度比例
  546. * @param {Number} mw 图片最小宽度
  547. * @param {Number} mh 图片最小高度
  548. * @param {String} url url修改
  549. */
  550. navCroper(w, h, type, ind) {
  551. let that = this;
  552. let tt = (type == 'upimg' ? 2 : 1)
  553. this.onImg(tt).then((url) => {
  554. uni.navigateTo({
  555. url: `../realName/cropper?width=${w}&height=${h}`,
  556. events: {
  557. uploadSuccess(res) {
  558. that.upLoad(res).then((urldata) => {
  559. console.log(urldata);
  560. if (type == 'one') {
  561. that.updata.avatar = urldata.img
  562. } else if (type == 'all') {
  563. that.updata.imageList.push(urldata.img)
  564. } else if (type == 'tab') {
  565. that.updata.imageList.splice(ind, 1, urldata.img)
  566. } else if (type == 'audit') {
  567. that.updata.service_audit_imgs.splice(ind, 1, urldata.img)
  568. } else if (type == 'auditall') {
  569. that.updata.service_audit_imgs.push(urldata.img)
  570. } else if (type == 'service') {
  571. that.updata.service_imgs.splice(ind, 1, urldata.img)
  572. } else if (type == 'serviceall') {
  573. that.updata.service_imgs.push(urldata.img)
  574. }
  575. })
  576. }
  577. },
  578. success: function(res) {
  579. // 通过eventChannel向被打开页面传送数据
  580. res.eventChannel.emit('urlNext', {
  581. url
  582. })
  583. }
  584. })
  585. })
  586. },
  587. onImg(type) {
  588. const _this = this
  589. return new Promise((ok, erro) => {
  590. // 判断是否需要选择
  591. if (type == 1) {
  592. uni.showActionSheet({
  593. itemList: ['拍照', '选择一张照片'],
  594. success: function(res) {
  595. _this.chooseImage(res.tapIndex).then((url) => {
  596. ok(url)
  597. }).catch((res) => {
  598. erro(res)
  599. })
  600. },
  601. fail: function(res) {
  602. erro(res)
  603. console.log(res.errMsg);
  604. }
  605. });
  606. }
  607. // 判断是否只需要拍照
  608. if (type == 2) {
  609. _this.chooseImage(0).then((url) => {
  610. ok(url)
  611. }).catch((res) => {
  612. erro(res)
  613. })
  614. }
  615. })
  616. },
  617. chooseImage: function(index) {
  618. const _this = this
  619. return new Promise((ok, error) => {
  620. // 从相册/相机选择
  621. // 如需直接开相机或直接选相册,请只使用一个选项
  622. const sourceType = index === 0 ? ['camera'] : ['album']
  623. uni.chooseImage({
  624. count: 1, //默认9
  625. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  626. sourceType: sourceType,
  627. success: function(res) {
  628. ok(res.tempFilePaths[0])
  629. },
  630. fail(e) {
  631. uni.showModal({
  632. title: '文件打开错误',
  633. content: '请设置授权文件存储权限',
  634. showCancel: false,
  635. });
  636. error(e)
  637. }
  638. });
  639. })
  640. },
  641. // 实名认证
  642. confirm(e) {
  643. const that = this;
  644. if(!that.rendl()){
  645. return
  646. }
  647. that.loding = true;
  648. subInfoAudit({
  649. avatar: that.updata.avatar,
  650. name: that.updata.name,
  651. mobile: that.updata.phone,
  652. idcard: that.updata.cardId,
  653. service_type: that.updata.timetype.code,
  654. service_min_price: that.updata.minMoney,
  655. service_max_price: that.updata.maxMoney,
  656. service_area: that.updata.onCity.map((arr) => {
  657. return arr.district
  658. }),
  659. service_project: that.updata.checkedType,
  660. service_intro_content: that.updata.mymask,
  661. service_intro_imgs: that.updata.imageList,
  662. work_year: that.updata.work_year,
  663. ancestral_place: that.updata.ancestral_place,
  664. education: that.updata.education,
  665. minority: that.updata.minority,
  666. service_audit_imgs: that.updata.service_audit_imgs,
  667. service_imgs: that.updata.service_imgs,
  668. user_work_type_id: that.updata.word.id,
  669. })
  670. .then((e) => {
  671. that.loding = false;
  672. this.$api.msg(e.msg);
  673. })
  674. .catch(err => {
  675. this.loding = false;
  676. console.log(err);
  677. });
  678. },
  679. // 认证
  680. rendl(){
  681. const that = this;
  682. if (!that.updata.avatar) {
  683. uni.showModal({
  684. title: '错误',
  685. content: '请上传头像',
  686. showCancel: false,
  687. });
  688. return false
  689. }
  690. if (!that.updata.name) {
  691. uni.showModal({
  692. title: '错误',
  693. content: '请填写姓名',
  694. showCancel: false,
  695. });
  696. return false
  697. }
  698. if (!that.updata.cardId) {
  699. uni.showModal({
  700. title: '错误',
  701. content: '请填写身份证号',
  702. showCancel: false,
  703. });
  704. return
  705. } else if (!isCardNo(that.updata.cardId)) {
  706. uni.showModal({
  707. title: '错误',
  708. content: '请填写正确的身份证号',
  709. showCancel: false,
  710. });
  711. return false
  712. }
  713. if (!that.updata.phone) {
  714. uni.showModal({
  715. title: '错误',
  716. content: '请填写手机号',
  717. showCancel: false,
  718. });
  719. return false
  720. }
  721. if (!that.updata.timetype.code) {
  722. uni.showModal({
  723. title: '错误',
  724. content: '请选择收费时间类型',
  725. showCancel: false,
  726. });
  727. return false
  728. }
  729. if (!that.updata.minMoney) {
  730. uni.showModal({
  731. title: '错误',
  732. content: '请填写最低收费价',
  733. showCancel: false,
  734. });
  735. return false
  736. }
  737. if (!that.updata.maxMoney) {
  738. uni.showModal({
  739. title: '错误',
  740. content: '请填写最高收费价',
  741. showCancel: false,
  742. });
  743. return false
  744. }
  745. if (that.updata.onCity.length == 0) {
  746. uni.showModal({
  747. title: '错误',
  748. content: '请选择服务区域',
  749. showCancel: false,
  750. });
  751. return false
  752. }
  753. if (that.updata.checkedType.length == 0) {
  754. uni.showModal({
  755. title: '错误',
  756. content: '请选择服务内容',
  757. showCancel: false,
  758. });
  759. return false
  760. }
  761. return true
  762. }
  763. }
  764. };
  765. </script>
  766. <style lang="scss">
  767. .content,
  768. page {
  769. min-height: 100%;
  770. }
  771. .content {
  772. padding-bottom: 150rpx;
  773. }
  774. .item-name {
  775. margin: $page-row-spacing;
  776. font-size: $font-lg;
  777. font-weight: bold;
  778. color: $font-color-dark;
  779. }
  780. .con_box {
  781. margin: $page-row-spacing;
  782. .con_image {
  783. width: 150rpx;
  784. height: 150rpx;
  785. display: inline-block;
  786. margin-right: 20rpx;
  787. position: relative;
  788. .img {
  789. width: 100%;
  790. height: 100%;
  791. }
  792. .tip {
  793. position: absolute;
  794. top: -10rpx;
  795. right: -10rpx;
  796. width: 30rpx;
  797. height: 30rpx;
  798. background-color: #FFF;
  799. border-radius: 99rpx;
  800. }
  801. }
  802. }
  803. .listBox {
  804. margin: $page-row-spacing;
  805. margin-top: 30rpx;
  806. border-radius: 20rpx;
  807. overflow: hidden;
  808. background-color: #FFFFFF;
  809. }
  810. .list {
  811. .input {
  812. text-align: right;
  813. font-size: $font-base;
  814. color: $color-gray;
  815. width: 100%;
  816. }
  817. .listItem {
  818. padding: 35rpx 40rpx;
  819. border-bottom: 1px solid $page-color-light;
  820. }
  821. .listIconImg {
  822. width: 36rpx;
  823. }
  824. .right {
  825. color: $font-color-light;
  826. font-size: $font-base;
  827. flex-grow: 1;
  828. justify-content: flex-end;
  829. .timetype {
  830. width: 100%;
  831. justify-content: flex-end;
  832. }
  833. .citylist {
  834. .del {
  835. color: $color-red;
  836. font-size: $font-sm;
  837. border: 1px solid $color-red;
  838. border-radius: 10rpx;
  839. line-height: 1;
  840. padding: 5rpx 15rpx;
  841. }
  842. }
  843. .img {
  844. width: 26rpx;
  845. }
  846. .buttom {
  847. color: $base-color;
  848. border: 1px solid $base-color;
  849. border-radius: 10rpx;
  850. line-height: 1;
  851. padding: 10rpx 20rpx;
  852. }
  853. }
  854. .titleBox {
  855. .title {
  856. color: $font-color-base;
  857. font-size: $font-base;
  858. }
  859. }
  860. }
  861. .bg-gray {
  862. background-color: $color-gray;
  863. }
  864. .base-buttom {
  865. position: fixed;
  866. bottom: 0rpx;
  867. right: 0rpx;
  868. left: 0rpx;
  869. margin: 0;
  870. padding: 0;
  871. height: 100rpx;
  872. border-radius: 0;
  873. .updata,
  874. .ylan {
  875. width: 50%;
  876. height: 100%;
  877. justify-content: center;
  878. }
  879. .ylan {
  880. background-color: #FFF;
  881. color: $font-color-dark;
  882. }
  883. }
  884. </style>