modelrz.vue 25 KB

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