merchantRecuitment.uvue 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. <!-- 商户招募 -->
  2. <template>
  3. <!-- #ifdef APP -->
  4. <scroll-view style="flex:1">
  5. <!-- #endif -->
  6. <view class="body">
  7. <!-- 背景图 -->
  8. <image class="wh" src="/static/other/shzm-bg.png" mode="widthFix">
  9. </image>
  10. <image class="jiarwm-box" src="/static/other/shzm-jrwm.png" mode="widthFix">
  11. </image>
  12. <view class="center-box">
  13. <view class="formData-box">
  14. <view class="title-info-box" v-if="stateNum !== 3 && stateNum !== 1">
  15. <image class="tit-bg" src="/static/other/btzs-icon.png" mode="widthFix">
  16. </image>
  17. <text class="title-bg-text">
  18. 商户招募信息
  19. </text>
  20. <!-- 表单 -->
  21. <form @submit="onFormSubmit" @reset="onFormReset">
  22. <view class="uni-form-item">
  23. <text class="title">您的邀请人(选填)</text>
  24. <input class="uni-input-ellipis" name="invite_code" style="width: 50%" :value="
  25. formData.invite_code" placeholder="请填写邀请人专属码" maxlength="11" />
  26. </view>
  27. <view class="uni-form-item">
  28. <text class="title">您的姓名</text>
  29. <input class="uni-input-ellipis" name="real_name" :value="formData.real_name"
  30. placeholder="请填写本人姓名" maxlength="11" minlength="2" />
  31. </view>
  32. <text class="tis-red-box">*艺名长度四个字以内,默认使用您的姓名</text>
  33. <view class="uni-form-item">
  34. <text class="title">工作艺名(选填)</text>
  35. <input class="uni-input-ellipis" name="nickname" :value="formData.nickname"
  36. placeholder="请填写您的艺名" maxlength="4" />
  37. </view>
  38. <view class="uni-form-item">
  39. <text class="title">性别</text>
  40. <radio-group name="gender" class="flex-row">
  41. <view class="group-item">
  42. <radio value="0" :checked="formData.gender==0" />
  43. <text>男</text>
  44. </view>
  45. <view class="group-item">
  46. <radio value="1" :checked="formData.gender==1" />
  47. <text>女</text>
  48. </view>
  49. </radio-group>
  50. </view>
  51. <view class="uni-form-item">
  52. <text class="title">手机号码</text>
  53. <input class="uni-input-ellipis" type="number" name="mobile" v-model="formData.mobile"
  54. placeholder="请填写本人手机号码" maxlength="11" />
  55. </view>
  56. <view class="ss-flex-2 code-box uni-form-item">
  57. <input class="input-field" type="number" name="code" placeholder="请输入验证码"
  58. :value="formData.code" maxlength="6" />
  59. <text class="code-btn" :class="{ disabled: !canSend }" @click="sendCode">
  60. {{ codeText }}
  61. </text>
  62. </view>
  63. <view class="uni-form-item" required>
  64. <text class="title">年龄</text>
  65. <input class="uni-input-ellipis" type="number" name="age" style="width:80%"
  66. placeholder-class="placeholder-class" :value="formData.age"
  67. placeholder="请输入本人实际年龄,18岁以上" />
  68. </view>
  69. <view class="uni-form-item" required>
  70. <text class="title">意向合作城市</text>
  71. <uni-data-picker :localdata="areaDate" class="custom-picker" popup-title="请选择您意向城市"
  72. @change="onchange" @nodeclick="onnodeclick"></uni-data-picker>
  73. </view>
  74. <view class="upload-card-box" v-if="stateNum === 0 || stateNum === 3">
  75. <view class="yaoqi-box"><text style="color: red;font-size: 28rpx;">*</text
  76. class="title">请上传身份证正面<text
  77. style="font-size: 24rpx;color: #999999;">(图片不得超过10M)</text></view>
  78. <view class="ss-flex-2" style="margin-top: 20rpx;">
  79. <view class="image-border-box" v-if="frontIdCardImage.length > 0"
  80. v-for="item in frontIdCardImage" :key="item?.id">
  81. <image class="wh" :src="item?.url">
  82. </image>
  83. <image style="width: 42rpx;height: 42rpx;border-radius: 50%;"
  84. @click="deleteFront" src="/static/other/upload-chah.png"
  85. class="upload-chah">
  86. </image>
  87. </view>
  88. <view class="image-border-box" v-if="frontIdCardImage.length === 0"
  89. @click="uploadIdCardFront">
  90. <image style="width: 52rpx;height: 52rpx;" src="/static/other/shzm-jiah.png"
  91. mode="widthFix">
  92. </image>
  93. </view>
  94. </view>
  95. </view>
  96. <view class="upload-card-box" v-if="stateNum === 0 || stateNum === 3">
  97. <view class="yaoqi-box"><text style="color: red;font-size: 28rpx;">*</text><text
  98. class="title"> 请上传身份证反面</text><text
  99. style="font-size: 24rpx;color: #999999;">(图片不得超过10M)</text></view>
  100. <view class="ss-flex-2" style="margin-top: 20rpx;">
  101. <view class="image-border-box" v-if="backIdCardImage.length > 0"
  102. v-for="item in backIdCardImage" :key="item?.id">
  103. <image class="wh" :src="item?.url">
  104. </image>
  105. <image style="width: 42rpx;height: 42rpx;border-radius: 50%;"
  106. @click="deleteBack" src="/static/other/upload-chah.png" class="upload-chah">
  107. </image>
  108. </view>
  109. <view class="image-border-box" v-if="backIdCardImage.length === 0"
  110. @click="uploadIdCardBack">
  111. <image style="width: 52rpx;height: 52rpx;" src="/static/other/shzm-jiah.png"
  112. mode="widthFix">
  113. </image>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="upload-card-box" v-if="stateNum === 0 || stateNum === 3">
  118. <view class="yaoqi-box"><text style="color: red;font-size: 28rpx;">*</text><text
  119. class="title">请上传近期照</text>
  120. </view>
  121. <view class="yaoqi-box" style="margin-top: 6rpx;"><text
  122. style="font-size: 24rpx;color: red;">请提供艺术照用于P图,正方形不得大于10M。</text>
  123. </view>
  124. <view class="ss-flex-2" style="margin-top: 20rpx;">
  125. <view class="image-border-box" v-if="lifePhone.length > 0" v-for="item in lifePhone"
  126. :key="item?.id">
  127. <image class="wh" :src="item?.url">
  128. </image>
  129. <image style="width: 42rpx;height: 42rpx;border-radius: 50%;"
  130. @click="deleteLifePhone()" src="/static/other/upload-chah.png"
  131. class="upload-chah">
  132. </image>
  133. </view>
  134. <view class="image-border-box" v-if="lifePhone.length < 6" @click="uploadLifePhone">
  135. <image style="width: 52rpx;height: 52rpx;" src="/static/other/shzm-jiah.png"
  136. mode="widthFix">
  137. </image>
  138. </view>
  139. </view>
  140. </view>
  141. <text class="tix-box" v-if="stateNum === 0 || stateNum === 3">
  142. 注:信息只做审核,绝对保密
  143. </text>
  144. <view class="savesubmit">
  145. <!-- <view class="saveInfo" v-if="stateNum === 0" @click="saveFormInfo">提交</view> -->
  146. <button class="saveInfo" form-type="submit" type="primary">提交</button>
  147. </view>
  148. </form>
  149. </view>
  150. <!-- <view v-if="stateNum === 1">
  151. <view class="ss-flex-2 shenz-box">
  152. <view class="ss-flex-1"></view>
  153. <image style="width: 346rpx;height: 268rpx;"
  154. src="/static/clientImage/clientImages/other/shzm-1.png" mode="widthFix">
  155. </image>
  156. <view class="ss-flex-1"></view>
  157. </view>
  158. <view class="miaos-2-box">您的信息已提交,平台正在审核中,请耐心等待~</view>
  159. </view> -->
  160. <!-- <view v-if="stateNum === 3">
  161. <view class="ss-flex-2 shenz-box">
  162. <view class="ss-flex-1"></view>
  163. <image style="width: 346rpx;height: 268rpx;"
  164. src="/static/clientImage/clientImages/other/shzm-3.png" mode="widthFix">
  165. </image>
  166. <view class="ss-flex-1"></view>
  167. </view>
  168. <view class="shib-box">审核失败</view>
  169. <view class="miaos-2-box">您的信息有误,请重新提交~</view>
  170. <view class="miaos-2-box" style="color: #F78342;font-size: 26rpx;">审核备注:{{
  171. coachDetaile?.base_info?.audit_remark
  172. }}</view>
  173. <view class="ss-flex-2 shenz-box" style="margin-top: 20rpx;">
  174. <view class="ss-flex-1"></view>
  175. <view class="tij-box" @click="againForm">重新提交</view>
  176. <view class="ss-flex-1"></view>
  177. </view>
  178. </view> -->
  179. </view>
  180. </view>
  181. </view>
  182. <!-- #ifdef APP -->
  183. </scroll-view>
  184. <!-- #endif -->
  185. </template>
  186. <script setup>
  187. import {
  188. ref
  189. } from 'vue';
  190. import { newUploadImage } from '../../utils/api/tool.uts';
  191. // 引入城市json
  192. import cityJson from '../../static/pca-code.json'
  193. import { fetchSendcode, fetchLogin } from '@/utils/api/login.uts'
  194. import { submitQualification } from '@/utils/api/masterInfoApi.uts'
  195. // 根据view中的表单需求修改数据结构和初始化值
  196. type MerchantFormData = {
  197. invite_code : string; // 邀请码
  198. real_name : string; // 姓名
  199. nickname : string; // 昵称
  200. gender : number; // 性别
  201. mobile : string; // 手机号码
  202. code : string; // 验证码
  203. age : string; // 年龄
  204. intention_city : string; // 意向城市
  205. }
  206. const formData = reactive<MerchantFormData>({
  207. invite_code: '',
  208. real_name: '',
  209. nickname: '',
  210. gender: 2,
  211. mobile: '',
  212. code: '',
  213. age: '',
  214. intention_city: '',
  215. })
  216. type DataType = {
  217. nickname : string;
  218. gender : string;
  219. age : number;
  220. loves : string[];
  221. switch : boolean;
  222. timeZoneIndex : number;
  223. // timeZoneList : string[];
  224. // multiArray : string[][];
  225. }
  226. const data = reactive({
  227. nickname: '',
  228. gender: '0',
  229. age: 18,
  230. loves: ['0'],
  231. switch: true,
  232. timeZoneIndex: 0,
  233. // timeZoneList: ['中国', '美国', '巴西', '日本'],
  234. // multiArray: [
  235. // ['亚洲', '欧洲'],
  236. // ['中国', '日本'],
  237. // ['北京', '上海', '广州']
  238. // ],
  239. // multiIndex: [0, 0, 0],
  240. // datePickerValue: getDate(null),
  241. // startDate: getDate('start'),
  242. // endDate: getDate('end'),
  243. // timePickerValue: '12:01',
  244. // time: [date.getHours() - 1, date.getMinutes() - 1],
  245. // hours: hours,
  246. // minutes: minutes,
  247. // comment: '',
  248. // formData: {},
  249. // // 仅测试
  250. // testVerifySubmit: false,
  251. // testVerifyReset: false
  252. } as DataType)
  253. // 定义定时器变量
  254. let timer : number | null = null;
  255. const countdown = ref<number>(0);
  256. const canSend = computed(() => formData.mobile.length === 11 && countdown.value === 0);
  257. // const canLogin = computed(() => phone.value.length === 11 && mobileCode.value.length === 6 && isAgree.value);
  258. const codeText = computed(() => countdown.value > 0 ? `${countdown.value}s 后重试` : '获取验证码');
  259. // //城市列表
  260. const areaDate = ref<string[]>(cityJson as any as string[]);
  261. console.log(areaDate, 'areaDate');
  262. //表单校验规则
  263. const rules = ref({
  264. real_name: {
  265. rules: [{
  266. required: true,
  267. errorMessage: '请输入姓名',
  268. }],
  269. },
  270. gender: {
  271. rules: [{
  272. required: true,
  273. errorMessage: '请选择性别',
  274. },],
  275. },
  276. mobile: {
  277. rules: [
  278. { required: true, errorMessage: '请输入手机号', trigger: 'blur' },
  279. { pattern: '^1[3-9]\\d{9}$', errorMessage: '手机号格式不正确' }
  280. ]
  281. },
  282. // code: {
  283. // rules: [{
  284. // required: true,
  285. // errorMessage: '请填写验证码',
  286. // }, {
  287. // validateFunction: function (rule, value, data, callback) {
  288. // let codeReg = /^\d{6}$/;
  289. // if (!codeReg.test(value)) {
  290. // callback('验证码必须是六位数字');
  291. // }
  292. // return true;
  293. // }
  294. // }],
  295. // },
  296. // age: {
  297. // rules: [{
  298. // required: true,
  299. // errorMessage: '请填写年龄',
  300. // }, {
  301. // validateFunction: function (rule, value, data, callback) {
  302. // if (value < 18 || value > 50) {
  303. // callback('年龄必须大于18岁小于50岁');
  304. // }
  305. // return true;
  306. // }
  307. // }],
  308. // },
  309. intention_city: {
  310. rules: [{
  311. required: true,
  312. errorMessage: '请选择城市',
  313. },],
  314. },
  315. })
  316. // const cityMapping = {};
  317. // 上传身份证正面照片
  318. const frontIdCardImage = ref<UTSJSONObject[]>([])
  319. // 上传身份证反面照片
  320. const backIdCardImage = ref<UTSJSONObject[]>([])
  321. //近期生活照
  322. const lifePhone = ref<UTSJSONObject[]>([])
  323. // //是否是待审核状态
  324. const stateNum = ref(0);
  325. // //技师详情
  326. // const coachDetaile = ref()
  327. // onLoad(async () => {
  328. // frontIdCardImage.value = []
  329. // backIdCardImage.value = []
  330. // lifePhone.value = []
  331. // countdown.value = 0
  332. // stateNum.value = 0
  333. // coachDetaile.value = ''
  334. // await getCoachInfo()
  335. // await getUserInfo()
  336. // })
  337. // //获取用户信息
  338. // const getUserInfo = async () => {
  339. // try {
  340. // const res = await myInfoApi.getUserInfo();
  341. // if (res && (res.code === 200 || res.code === 0)) {
  342. // const userInfo = res.data;
  343. // if (userInfo?.coach?.base_info_state === 2 || userInfo?.coach?.state === 2) {
  344. // uni.showToast({
  345. // title: '您已是尊贵的商户!',
  346. // icon: 'none',
  347. // duration: 2000
  348. // });
  349. // setTimeout(() => {
  350. // uni.redirectTo({
  351. // url: '/pages/clientProject/myHome/index'
  352. // });
  353. // }, 2500);
  354. // }
  355. // }
  356. // } catch (e) {
  357. // uni.showToast({ title: '获取用户信息失败', icon: 'none' });
  358. // }
  359. // }
  360. // //重新提交
  361. // const againForm = async () => {
  362. // stateNum.value = 0
  363. // }
  364. // //获取技师基本信息
  365. // const getCoachInfo = async () => {
  366. // coachInfoApi.getCoachInfo().then(res => {
  367. // if ((res.code === 200 || res.code === 0) && res.data?.base_info) {
  368. // coachDetaile.value = res?.data
  369. // const item = res?.data?.base_info
  370. // stateNum.value = item?.state
  371. // const itemInfo = res?.data?.real_name
  372. // let info = {
  373. // invite_code: item?.invite_code || '',
  374. // real_name: itemInfo?.real_name,
  375. // nickname: item?.nickname,
  376. // gender: item?.gender - 0,
  377. // mobile: item?.mobile,
  378. // code: '',
  379. // age: item?.age,
  380. // intention_city: item?.intention_city,
  381. // id: item?.id || ''
  382. // }
  383. // formData.value = info
  384. // frontIdCardImage.value = [itemInfo?.id_card_front_photo_url]
  385. // backIdCardImage.value = [itemInfo?.id_card_back_photo_url]
  386. // lifePhone.value = item?.life_photo_urls
  387. // }
  388. // })
  389. // }
  390. // const baseForm = ref(null)
  391. // const onFormSubmit = async () => {
  392. // if (!formData.value.real_name) {
  393. // uni.showToast({
  394. // title: '请填写您的姓名',
  395. // icon: 'none',
  396. // duration: 2500
  397. // })
  398. // return
  399. // }
  400. // if (!formData.value.gender) {
  401. // uni.showToast({
  402. // title: '请选择性别',
  403. // icon: 'none',
  404. // duration: 2500
  405. // })
  406. // return
  407. // }
  408. // if (!formData.value.mobile) {
  409. // uni.showToast({
  410. // title: '请填写手机号码',
  411. // icon: 'none',
  412. // duration: 2500
  413. // })
  414. // return
  415. // }
  416. // if (!formData.value.code) {
  417. // uni.showToast({
  418. // title: '请填写手机验证码',
  419. // icon: 'none',
  420. // duration: 2500
  421. // })
  422. // return
  423. // }
  424. // if (!formData.value.age) {
  425. // uni.showToast({
  426. // title: '请填写年龄',
  427. // icon: 'none',
  428. // duration: 2500
  429. // })
  430. // return
  431. // }
  432. // if (!formData.value.intention_city) {
  433. // uni.showToast({
  434. // title: '请选择意向合作城市',
  435. // icon: 'none',
  436. // duration: 2500
  437. // })
  438. // return
  439. // }
  440. // const isFlag = await baseForm.value.validate();
  441. // if (!isFlag) return;
  442. // //判断是否上传身份证正反面
  443. // if (frontIdCardImage.value.length === 0) {
  444. // uni.showToast({
  445. // title: '请上传身份证正面照片',
  446. // icon: 'none',
  447. // duration: 2000
  448. // })
  449. // return
  450. // }
  451. // if (backIdCardImage.value.length === 0) {
  452. // uni.showToast({
  453. // title: '请上传身份证反面照片',
  454. // icon: 'none',
  455. // duration: 2000
  456. // })
  457. // return
  458. // }
  459. // if (lifePhone.value.length === 0) {
  460. // uni.showToast({
  461. // title: '请上传近期照片',
  462. // icon: 'none',
  463. // duration: 2000
  464. // })
  465. // return
  466. // }
  467. // if (lifePhone.value.length < 3) {
  468. // uni.showToast({
  469. // title: '请上传近期至少3张照片',
  470. // icon: 'none',
  471. // duration: 2000
  472. // })
  473. // return
  474. // }
  475. // const lifeId = []
  476. // for (let i = 0; i < lifePhone.value.length; i++) {
  477. // lifeId.push(lifePhone.value[i].id)
  478. // }
  479. // const info = {
  480. // invite_code: formData.value.invite_code ?? '',
  481. // gender: formData.value.gender + '',
  482. // life_photos: lifeId,
  483. // mobile: formData.value.mobile,
  484. // age: formData.value.age - 0,
  485. // intention_city: formData.value.intention_city,
  486. // real_name: formData.value.real_name,
  487. // nickname: formData.value.nickname,
  488. // id_card_front_photo: frontIdCardImage.value[0].id - 0,
  489. // id_card_back_photo: backIdCardImage.value[0].id - 0,
  490. // code: formData.value.code,
  491. // }
  492. // coachInfoApi.setBaseInfoForm(info).then(res => {
  493. // uni.showToast({
  494. // title: '商户信息提交成功,等待审核',
  495. // icon: 'none',
  496. // duration: 2000
  497. // })
  498. // stateNum.value = 1
  499. // uni.redirectTo({
  500. // url: '/pages/clientProject/clientFeat/merchantRecruitment/index'
  501. // })
  502. // setTimeout(() => {
  503. // uni.reLaunch({
  504. // url: '/pages/clientProject/myHome/index'
  505. // })
  506. // }, 8000)
  507. // })
  508. // }
  509. const onTimeZoneChange = (e : any) => {
  510. const eventObj = e as UTSJSONObject
  511. // const detail = eventObj.getJSONObject("detail")
  512. // const value = detail.getNumber("value")
  513. // data.timeZoneIndex = value
  514. console.log('时区选择改变,携带值为:' + e)
  515. }
  516. // #ifdef APP-HARMONY
  517. const onchange = (e : UniPickerColumnChangeEvent) => {
  518. console.log('修改的列为:' + e.detail.column + ',值为:' + e.detail.value)
  519. data.multiIndex[e.detail.column] = e.detail.value
  520. }
  521. // #endif
  522. // #ifndef APP-HARMONY
  523. const onchange = (e : any) => {
  524. // const column = (e as any).detail.column as number
  525. // const value = (e as any).detail as any
  526. console.log('修改的列为:' + + ',值为:' + e)
  527. // ... 后续逻辑
  528. }
  529. // #endif
  530. const onnodeclick = () => { };
  531. //上传身份证正面
  532. const uploadIdCardFront = async () => {
  533. if (frontIdCardImage.value.length >= 1) {
  534. uni.showToast({
  535. title: '只允许上传一张图片',
  536. icon: 'none',
  537. duration: 1000
  538. })
  539. return
  540. }
  541. let res = await newUploadImage('photo-images', 'real-photo')
  542. const code = (res as UTSJSONObject)["code"] as number | null;
  543. const data = (res as UTSJSONObject)["data"] as UTSJSONObject | null;
  544. const message = (res as UTSJSONObject)["message"] as string ?? '';
  545. if (code == 200) {
  546. uni.showToast({
  547. title: message,
  548. icon: 'none',
  549. duration: 1000
  550. })
  551. frontIdCardImage.value.push(data as UTSJSONObject)
  552. }
  553. }
  554. //上传身份证反面
  555. const uploadIdCardBack = async () => {
  556. if (backIdCardImage.value.length >= 1) {
  557. uni.showToast({
  558. title: '只允许上传一张图片',
  559. icon: 'none',
  560. duration: 1000
  561. })
  562. return
  563. }
  564. let res = await newUploadImage('photo-images', 'real-photo')
  565. const code = (res as UTSJSONObject)["code"] as number | null;
  566. const data = (res as UTSJSONObject)["data"] as UTSJSONObject | null;
  567. const message = (res as UTSJSONObject)["message"] as string ?? '';
  568. if (code == 200) {
  569. uni.showToast({
  570. title: message,
  571. icon: 'none',
  572. duration: 1000
  573. })
  574. backIdCardImage.value.push(data as UTSJSONObject)
  575. }
  576. }
  577. //上传近期生活照
  578. const uploadLifePhone = async () => {
  579. if (lifePhone.value.length >= 6) {
  580. uni.showToast({
  581. title: '近期照片最多上传6张',
  582. icon: 'none',
  583. duration: 2000
  584. })
  585. return
  586. }
  587. let res = await newUploadImage('photo-images', 'life-photo')
  588. const code = (res as UTSJSONObject)["code"] as number | null;
  589. const data = (res as UTSJSONObject)["data"] as UTSJSONObject | null;
  590. const message = (res as UTSJSONObject)["message"] as string ?? '';
  591. if (code == 200) {
  592. uni.showToast({
  593. title: message,
  594. icon: 'none',
  595. duration: 2000
  596. })
  597. lifePhone.value.push(data as UTSJSONObject)
  598. }
  599. }
  600. //删除身份证正面
  601. const deleteFront = async () => {
  602. frontIdCardImage.value = []
  603. }
  604. //删除身份证反面
  605. const deleteBack = async () => {
  606. backIdCardImage.value = []
  607. }
  608. //删除近期照片
  609. const deleteLifePhone = async () => {
  610. // const imageArr = JSON.parse(JSON.stringify(lifePhone.value))
  611. // const setImageArr = []
  612. // for (let i = 0; i < imageArr.length; i++) {
  613. // const info = imageArr[i]
  614. // if (info.id !== item.id) {
  615. // setImageArr.push(info)
  616. // }
  617. // }
  618. // lifePhone.value = setImageArr
  619. }
  620. const sendCode = async () => {
  621. console.log(formData.mobile, formData.mobile.length, 'mobile')
  622. if (!canSend.value) return;
  623. const res = await fetchSendcode({ mobile: formData.mobile });
  624. const currentTimer = timer;
  625. if (currentTimer !== null) {
  626. clearInterval(currentTimer);
  627. }
  628. timer = null;
  629. countdown.value = 60;
  630. uni.showToast({ title: '验证码已发送', icon: 'success' });
  631. timer = setInterval(() => {
  632. countdown.value--;
  633. if (countdown.value <= 0) {
  634. const t = timer;
  635. if (t !== null) {
  636. clearInterval(t);
  637. }
  638. timer = null;
  639. countdown.value = 0;
  640. }
  641. }, 1000);
  642. };
  643. //提交
  644. const onFormSubmit = async (e : UniFormSubmitEvent) => {
  645. // formData = e.detail.value
  646. console.log(e.detail.value, 'e.detail.value');
  647. // // 仅测试
  648. // data.testVerifySubmit = (e.type == 'submit' && (e.target?.tagName ?? '') == "FORM")
  649. const res = await submitQualification(e.detail.value);
  650. console.log(res, 'res')
  651. uni.showToast({
  652. title: '商户信息提交成功,等待审核',
  653. icon: 'none',
  654. duration: 2000
  655. })
  656. // stateNum.value = 1
  657. uni.redirectTo({
  658. url: '/pages/index/console'
  659. })
  660. }
  661. const onFormReset = (e : UniFormResetEvent) => {
  662. // data.formData = {}
  663. // data.timeZoneIndex = 0
  664. // // 仅测试
  665. // data.testVerifyReset = (e.type == 'reset' && (e.target?.tagName ?? '') == "FORM")
  666. }
  667. </script>
  668. <style scoped lang="scss">
  669. .tis-red-box {
  670. font-size: 24rpx;
  671. color: red;
  672. }
  673. .shenz-box {
  674. width: 100%;
  675. margin-top: 200rpx;
  676. align-items: center;
  677. }
  678. .upload-chah {
  679. position: absolute;
  680. top: -20rpx;
  681. right: -20rpx;
  682. }
  683. .code-box {
  684. width: 100%;
  685. height: 100rpx;
  686. border-radius: 16rpx;
  687. background-color: #FFFDD7;
  688. margin-bottom: 20rpx;
  689. align-items: center;
  690. box-sizing: border-box;
  691. }
  692. .miaos-2-box {
  693. width: 64%;
  694. margin-left: 18%;
  695. font-size: 28rpx;
  696. color: #3A3330;
  697. letter-spacing: 1rpx;
  698. margin-top: 26rpx;
  699. text-align: center;
  700. box-sizing: border-box;
  701. }
  702. .shib-box {
  703. font-size: 32rpx;
  704. color: #3A3330;
  705. font-weight: 600;
  706. letter-spacing: 2rpx;
  707. text-align: center;
  708. margin-top: 36rpx;
  709. box-sizing: border-box;
  710. }
  711. .tij-box {
  712. width: 286rpx;
  713. height: 76rpx;
  714. line-height: 76rpx;
  715. border-radius: 50rpx;
  716. font-size: 30rpx;
  717. color: #3A3330;
  718. font-weight: 600;
  719. letter-spacing: 2rpx;
  720. text-align: center;
  721. background: linear-gradient(to bottom, #FFDA59, #FFDC62);
  722. }
  723. //修改输入框样式
  724. .searc-input {
  725. position: relative;
  726. display: block;
  727. height: 100rpx !important;
  728. line-height: 100rpx !important;
  729. text-align: left !important;
  730. letter-spacing: 1rpx !important;
  731. text-indent: 20rpx !important;
  732. font-size: 28rpx !important;
  733. }
  734. .getcode-box {
  735. font-size: 28rpx;
  736. color: #AECC59;
  737. letter-spacing: 2rpx;
  738. padding-right: 20rpx;
  739. }
  740. // .formData-two-box {
  741. // position: relative;
  742. // width: 100%;
  743. // // min-height: 1950rpx;
  744. // border-radius: 32rpx;
  745. // padding: 32rpx;
  746. // background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.65));
  747. // box-sizing: border-box;
  748. // }
  749. // 上中下布局样式
  750. .body {
  751. position: relative;
  752. // height: 2650rpx;
  753. background-color: #FEF9CF;
  754. box-sizing: border-box;
  755. }
  756. .wh {
  757. width: 100%;
  758. position: absolute;
  759. // top:0;
  760. // left:0
  761. }
  762. .uni-form-item {
  763. background-color: #FFFDD7;
  764. border-radius: 16rpx;
  765. height: 100rpx;
  766. margin: 10rpx 0;
  767. flex-direction: row;
  768. align-items: center;
  769. justify-content: space-between;
  770. padding: 0 20rpx;
  771. box-sizing: border-box;
  772. }
  773. .title {
  774. font-size: 28rpx;
  775. }
  776. //商户招募样式
  777. .center-box {
  778. // position: absolute;
  779. // top: 0;
  780. // left: 0;
  781. // bottom: 0;
  782. // right: 0;
  783. // width: 100vw;
  784. height: 100%;
  785. box-sizing: border-box;
  786. width: 100%;
  787. position: relative;
  788. padding: 32rpx 20rpx;
  789. }
  790. .formData-box {
  791. // position: relative;
  792. // width: 94%;
  793. // margin-left: 3%;
  794. // // min-height: 1950rpx;
  795. border-radius: 32rpx 32rpx 0 0;
  796. margin-top: 406rpx;
  797. background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.65));
  798. box-sizing: border-box;
  799. background: rgba(255, 255, 255, 0.8);
  800. padding: 32rpx 20rpx;
  801. }
  802. .input-field {
  803. flex: 1;
  804. font-size: 28rpx;
  805. color: #333;
  806. }
  807. .uni-input-ellipis {
  808. text-align: right;
  809. width: 60%;
  810. overflow: hidden;
  811. white-space: nowrap;
  812. text-overflow: ellipsis;
  813. font-size: 28rpx;
  814. font-family: AlimamaDaoLiTiOTF;
  815. }
  816. .custom-picker {
  817. font-size: 24rpx;
  818. width: 80%;
  819. overflow: hidden;
  820. white-space: nowrap;
  821. text-overflow: ellipsis;
  822. font-size: 28rpx;
  823. font-family: AlimamaDaoLiTiOTF;
  824. text-align: right;
  825. }
  826. .custom-picker ::v-deep .input-value-border {
  827. border: none;
  828. }
  829. .placeholder-class {
  830. overflow: hidden;
  831. white-space: nowrap;
  832. text-overflow: ellipsis;
  833. }
  834. .flex-row {
  835. flex-direction: row;
  836. align-items: center;
  837. }
  838. .group-item {
  839. flex-direction: row;
  840. margin-right: 20px;
  841. }
  842. .code-btn {
  843. font-size: 26rpx;
  844. color: #ffc107;
  845. font-weight: bold;
  846. white-space: nowrap;
  847. }
  848. .code-btn.disabled {
  849. color: #ccc;
  850. }
  851. .jiarwm-box {
  852. position: absolute;
  853. top: 12%;
  854. left: 90rpx;
  855. width: 312rpx;
  856. height: 122rpx;
  857. z-index: 1
  858. }
  859. .title-info-box {
  860. position: relative;
  861. margin-top: 8rpx;
  862. font-size: 36rpx;
  863. color: #3D444E;
  864. font-weight: 600;
  865. letter-spacing: 2rpx;
  866. box-sizing: border-box;
  867. }
  868. .tit-bg {
  869. width: 180rpx;
  870. height: 52rpx;
  871. }
  872. .title-bg-text {
  873. position: absolute;
  874. top: -10rpx;
  875. left: 0;
  876. width: 280rpx;
  877. height: 52rpx;
  878. line-height: 52rpx;
  879. font-size: 36rpx;
  880. color: #3A3330;
  881. font-weight: 700;
  882. letter-spacing: 2rpx;
  883. box-sizing: border-box;
  884. }
  885. .upload-card-box {
  886. width: 100%;
  887. min-height: 280rpx;
  888. border-radius: 24rpx;
  889. background-color: #FFFDD7;
  890. margin-bottom: 20rpx;
  891. padding: 24rpx;
  892. box-sizing: border-box;
  893. }
  894. .yaoqi-box {
  895. font-size: 28rpx;
  896. color: #3A3330;
  897. letter-spacing: 1rpx;
  898. flex-direction: row;
  899. }
  900. .image-border-box {
  901. width: 168rpx;
  902. height: 168rpx;
  903. border-radius: 16rpx;
  904. background-color: #FFFEEE;
  905. border: 2rpx dashed #E1D650;
  906. display: flex;
  907. flex-wrap: nowrap;
  908. align-items: center;
  909. justify-content: center;
  910. margin-right: 26rpx;
  911. margin-bottom: 20rpx;
  912. box-sizing: border-box;
  913. }
  914. .tix-box {
  915. width: 100%;
  916. margin-top: 20rpx;
  917. font-size: 24rpx;
  918. color: #CCCCCC;
  919. }
  920. .savesubmit {
  921. width: 100%;
  922. padding-left: 32rpx;
  923. padding-right: 32rpx;
  924. margin-top: 40rpx;
  925. box-sizing: border-box;
  926. }
  927. .saveInfo {
  928. width: 100%;
  929. height: 100rpx;
  930. line-height: 100rpx;
  931. text-align: center;
  932. font-size: 32rpx;
  933. color: #3A3330;
  934. font-weight: 600;
  935. letter-spacing: 4rpx;
  936. background-color: #FFDB5A;
  937. border-radius: 24rpx;
  938. box-sizing: border-box;
  939. }
  940. //old样式
  941. .icon-navigation {
  942. font-size: 32rpx;
  943. color: #3D444E;
  944. font-weight: 700;
  945. }
  946. </style>