modelrz.vue 24 KB

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