merchantRecuitment.uvue 26 KB

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