index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <view class="padding">
  3. <view style="padding-bottom: 20upx; color: red" v-if="auditReason && shop.status == 2">{{ auditReason }}</view>
  4. <view class="text-white padding bg radius">
  5. <u-form :model="shop" label-position="top">
  6. <u-form-item label="商铺主营类型">
  7. <u-input v-model="shop.shopTypeName" placeholder="请输入商铺主营类型" disabled @click="show = true" />
  8. </u-form-item>
  9. <u-form-item label="商铺名称">
  10. <u-input v-model="shop.name" placeholder="请填写 (必填)" />
  11. </u-form-item>
  12. <u-form-item label="省市区">
  13. <u-input v-model="shop.address" disabled placeholder="请填写" @click="bindOpen" />
  14. </u-form-item>
  15. <u-form-item label="商铺详细地址">
  16. <!-- <u-input v-model="shop.detailedAddress" placeholder="请填写" /> -->
  17. <textarea
  18. v-model="shop.detailedAddress"
  19. placeholder-style="color: #aaaaaa;font-size: 28rpx;"
  20. placeholder="请填写商铺详细地址"
  21. style="height: 120rpx; width: 100%; font-size: 28rpx"
  22. />
  23. </u-form-item>
  24. </u-form>
  25. </view>
  26. <view class="text-white padding bg radius margin-top">
  27. <u-form :model="shop" label-position="top">
  28. <u-form-item label="联系人姓名">
  29. <u-input v-model="shop.userName" placeholder="请输入真实姓名" />
  30. </u-form-item>
  31. <u-form-item label="身份证号">
  32. <u-input v-model="shop.isNumber" maxlength="20" placeholder="请填写 (必填)" />
  33. </u-form-item>
  34. <u-form-item label="联系电话">
  35. <u-input v-model="shop.phone" disabled type="number" placeholder="请填写 (必填)" />
  36. </u-form-item>
  37. <u-form-item label="验证码" v-if="shop.status == null || shop.status == 2">
  38. <u-input v-model="shop.verCode" type="number" placeholder="请填写 (必填)" style="width: 50%; display: inline-block" />
  39. <button class="send-msg" @click="sendMsg">{{ sendTime }}</button>
  40. </u-form-item>
  41. </u-form>
  42. </view>
  43. <view class="text-white padding bg radius margin-tb">
  44. <view>
  45. <view class="text-lg margin-top-sm text-black">店铺logo</view>
  46. <view class="flex" style="overflow: hidden; flex-wrap: wrap">
  47. <view v-if="detailsImg.length">
  48. <view class="margin-top flex margin-right-sm flex-wrap">
  49. <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative">
  50. <image :src="detailsImg" style="width: 100%; height: 100%"></image>
  51. <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click="removeImg(1)">
  52. <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="margin-top" @click="addImages(2)" v-if="detailsImg.length <= 0">
  58. <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
  59. <view>
  60. <view class="text-center">
  61. <image src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png" style="width: 65rpx; height: 55rpx"></image>
  62. </view>
  63. <view class="text-center text-black">添加图片</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view>
  70. <view class="text-lg margin-top-sm text-black">营业执照</view>
  71. <view class="flex" style="overflow: hidden; flex-wrap: wrap">
  72. <view v-if="shop.business.length">
  73. <view class="margin-top flex margin-right-sm flex-wrap">
  74. <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative">
  75. <image :src="shop.business" style="width: 100%; height: 100%"></image>
  76. <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click="removeImgs(1)">
  77. <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="margin-top" @click="addImage(1)" v-if="shop.business.length <= 0">
  83. <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
  84. <view>
  85. <view class="text-center">
  86. <image src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png" style="width: 65rpx; height: 55rpx"></image>
  87. </view>
  88. <view class="text-center text-black">添加图片</view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view>
  95. <view class="text-lg margin-top-sm text-black">身份证正面</view>
  96. <view class="flex" style="overflow: hidden; flex-wrap: wrap">
  97. <view v-if="shop.front.length">
  98. <view class="margin-top flex margin-right-sm flex-wrap">
  99. <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative">
  100. <image :src="shop.front" style="width: 100%; height: 100%"></image>
  101. <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click="removeImgs(2)">
  102. <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="margin-top" @click="addImage(2)" v-if="shop.front.length <= 0">
  108. <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
  109. <view>
  110. <view class="text-center">
  111. <image src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png" style="width: 65rpx; height: 55rpx"></image>
  112. </view>
  113. <view class="text-center text-black">添加图片</view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view>
  120. <view class="text-lg margin-top-sm text-black">身份证反面片</view>
  121. <view class="flex" style="overflow: hidden; flex-wrap: wrap">
  122. <view v-if="shop.back.length">
  123. <view class="margin-top flex margin-right-sm flex-wrap">
  124. <view class="flex" style="width: 200rpx; height: 200rpx; margin-right: 2rpx; position: relative">
  125. <image :src="shop.back" style="width: 100%; height: 100%"></image>
  126. <view style="z-index: 9; position: absolute; top: -15rpx; right: -15rpx" @click="removeImgs(3)">
  127. <u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="margin-top" @click="addImage(3)" v-if="shop.back.length <= 0">
  133. <view style="width: 200rpx; height: 200rpx; background: #f4f5f6" class="flex justify-center align-center">
  134. <view>
  135. <view class="text-center">
  136. <image src="https://mxys.chuanghai-tech.com/wmfile/20250814/5d7863a9adcd45df89497a870f764f15.png" style="width: 65rpx; height: 55rpx"></image>
  137. </view>
  138. <view class="text-center text-black">添加图片</view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. <u-button v-if="shop.status == null || shop.status == 2" @click="submit" class="margin-top" :custom-style="customStyle" shape="square" :hair-line="false">
  146. 提交审核
  147. </u-button>
  148. <u-button v-if="shop.status == 0" class="margin-top" disabled :custom-style="customStyle" shape="square" :hair-line="false">审核中</u-button>
  149. <!-- 分类列表 -->
  150. <u-select v-model="show" :list="shopList" valueName="id" labelName="shopTypeName" @confirm="confirm"></u-select>
  151. <!-- 用于图片压缩的canvas画布 -->
  152. <canvas
  153. :style="{
  154. width: cw + 'px',
  155. height: cw + 'px',
  156. position: 'absolute',
  157. zIndex: -1,
  158. left: '-10000rpx',
  159. top: '-10000rpx'
  160. }"
  161. canvas-id="zipCanvas"
  162. ></canvas>
  163. <!--画布结束-->
  164. </view>
  165. </template>
  166. <script>
  167. import configdata from '@/common/config.js'
  168. import getLessLimitSizeImage from '@/utils/imageCompress.js'
  169. export default {
  170. data() {
  171. return {
  172. shop: {
  173. type: '',
  174. typeid: '',
  175. name: '',
  176. address: '',
  177. shopTypeName: '',
  178. detailedAddress: '',
  179. userName: '',
  180. isNumber: '',
  181. phone: '',
  182. verCode: '',
  183. latitude: '',
  184. longitude: '',
  185. //详情图
  186. detailsImg: [],
  187. business: '',
  188. front: '',
  189. back: ''
  190. },
  191. customStyle: {
  192. backgroundColor: '#FFCC00',
  193. color: '#000000',
  194. border: 0
  195. },
  196. status: 1,
  197. //详情图
  198. detailsImg: [],
  199. shopId: '',
  200. page: 1,
  201. limit: 100,
  202. show: false,
  203. shopList: [],
  204. city: '',
  205. province: '',
  206. district: '',
  207. auditReason: '',
  208. Settedlist: [],
  209. sending: false,
  210. sendTime: '获取验证码',
  211. count: 60,
  212. XCXIsSelect: '是',
  213. //画板边长默认是屏幕宽度,正方形画布
  214. cw: uni.getSystemInfoSync().windowWidth
  215. }
  216. },
  217. onLoad(option) {
  218. this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
  219. if (this.XCXIsSelect == '否') {
  220. uni.setNavigationBarTitle({
  221. title: '隐私政策'
  222. })
  223. } else {
  224. uni.setNavigationBarTitle({
  225. title: '商家入驻'
  226. })
  227. }
  228. // uni.getLocation({
  229. // type: 'gcj02',
  230. // success: (res) => {
  231. // console.log(res.latitude);
  232. // console.log(res.longitude);
  233. // console.log("res___:" + JSON.stringify(res));
  234. // },
  235. // fail(e) {
  236. // console.log(e);
  237. // }
  238. // });
  239. // this.Settedlist = uni.getStorageSync("Settedlist")
  240. // if(this.Settedlist){
  241. // this.auditReason = this.Settedlist.auditReason
  242. // this.shop.name = this.Settedlist.shopName
  243. // this.shop.typeid = this.Settedlist.shopTypeId
  244. // this.shop.shopTypeName = this.Settedlist.shopTypeName
  245. // this.shop.address = this.Settedlist.province + this.Settedlist.city + this.Settedlist.district
  246. // this.shop.detailedAddress = this.Settedlist.detailedAddress
  247. // this.shop.latitude = this.Settedlist.shopLat
  248. // this.shop.longitude = this.Settedlist.shopLng
  249. // this.province = this.Settedlist.province
  250. // this.city = this.Settedlist.city
  251. // this.district = this.Settedlist.district
  252. // this.shop.userName =this.Settedlist.realName
  253. // this.shop.isNumber = this.Settedlist.identitycardNumber
  254. // this.shop.phone = this.Settedlist.phone
  255. // this.shop.business = this.Settedlist.businessLicense
  256. // this.shop.front = this.Settedlist.identitycardPro
  257. // this.shop.back = this.Settedlist.identitycardCon
  258. // this.shop.detailsImg = this.Settedlist.shopCover
  259. // this.detailsImg = this.Settedlist.shopCover.split(',')
  260. // }else{
  261. this.getShopList()
  262. // }
  263. this.getData()
  264. },
  265. onShow() {
  266. this.shop.phone = this.$queue.getData('phone')
  267. },
  268. onHide() {},
  269. methods: {
  270. getData() {
  271. this.$Request.get('/app/shop/selectShopByUserId').then((res) => {
  272. if (res.code == 0 && res.data) {
  273. this.auditReason = res.data.auditReason
  274. this.shop.shopTypeName = res.data.shopTypeName
  275. this.shop.name = res.data.shopName
  276. this.shop.address = res.data.province + res.data.city + res.data.district
  277. this.shop.detailedAddress = res.data.detailedAddress
  278. this.shop.userName = res.data.realName
  279. this.shop.isNumber = res.data.identitycardNumber
  280. this.shop.phone = res.data.phone
  281. this.shop.detailsImg = res.data.shopCover //商铺图片
  282. this.detailsImg = res.data.shopCover.split(',')
  283. this.shop.business = res.data.businessLicense //营业执照
  284. this.shop.front = res.data.identitycardPro //身份证正面
  285. this.shop.back = res.data.identitycardCon //身份证反面
  286. this.shop.latitude = res.data.shopLat
  287. this.shop.longitude = res.data.shopLng
  288. this.province = res.data.province
  289. this.city = res.data.city
  290. this.district = res.data.district
  291. this.shop.status = res.data.status
  292. }
  293. })
  294. },
  295. confirm(e) {
  296. console.log(e)
  297. this.shop.shopTypeName = e[0].label
  298. this.shop.typeid = e[0].value
  299. },
  300. // 店铺列表
  301. getShopList() {
  302. let data = {
  303. page: this.page,
  304. limit: this.limit
  305. }
  306. this.$Request.get('/app/shoptype/selectShopTypeList', data).then((res) => {
  307. if (res.code == 0) {
  308. this.shopList = res.data.list
  309. }
  310. })
  311. },
  312. // 详情图删除
  313. removeImg(index) {
  314. this.detailsImg = ''
  315. },
  316. // 身份证 资格证删除
  317. removeImgs(index) {
  318. if (index == 1) {
  319. this.shop.business = ''
  320. } else if (index == 2) {
  321. this.shop.front = ''
  322. } else if (index == 3) {
  323. this.shop.back = ''
  324. }
  325. },
  326. bindOpen() {
  327. const that = this
  328. uni.chooseLocation({
  329. success: function (res) {
  330. console.log('位置名称:' + res.name)
  331. console.log('详细地址:' + res.address)
  332. console.log('纬度:' + res.latitude)
  333. console.log('经度:' + res.longitude)
  334. that.shop.detailedAddress = res.address
  335. that.shop.latitude = res.latitude
  336. that.shop.longitude = res.longitude
  337. that.getcity(res.latitude, res.longitude)
  338. }
  339. })
  340. },
  341. getcity(latitude, longitude) {
  342. let data = {
  343. lat: latitude,
  344. lng: longitude
  345. }
  346. this.$Request.get('/app/address/selectCity', data).then((res) => {
  347. if (res.code == 0) {
  348. this.city = res.data.city
  349. this.province = res.data.province
  350. this.district = res.data.district
  351. this.shop.address = res.data.province + res.data.city + res.data.district
  352. }
  353. })
  354. },
  355. // 图片上传
  356. addImages(e) {
  357. let that = this
  358. uni.chooseImage({
  359. count: 1,
  360. sourceType: ['album', 'camera'],
  361. success: (res) => {
  362. for (let i = 0; i < res.tempFiles.length; i++) {
  363. //这里的id和页面中写的html代码的canvas的id要一致
  364. let canvasId = 'zipCanvas'
  365. //原图的路径
  366. let imagePath = res.tempFiles[i].path
  367. //大小限制
  368. let limitSize = 1024 * 2
  369. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  370. let drawWidth = uni.getSystemInfoSync().windowWidth
  371. let that = this
  372. let token = uni.getStorageSync('token')
  373. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  374. uni.showLoading({
  375. title: '上传中'
  376. })
  377. uni.uploadFile({
  378. url: that.config('APIHOST1') + '/app/new-file/upload',
  379. filePath: resPath,
  380. header: {
  381. token: token
  382. },
  383. name: 'file',
  384. success: (uploadFileRes) => {
  385. that.detailsImg = JSON.parse(uploadFileRes.data).data
  386. console.log(that.detailsImg)
  387. uni.hideLoading()
  388. },
  389. fail: () => {
  390. uni.showToast({
  391. title: '上传失败',
  392. icon: 'error'
  393. })
  394. }
  395. })
  396. })
  397. }
  398. }
  399. })
  400. },
  401. // 图片上传
  402. addImage(e) {
  403. let that = this
  404. uni.chooseImage({
  405. count: 1,
  406. sourceType: ['album', 'camera'],
  407. success: (res) => {
  408. for (let i = 0; i < res.tempFiles.length; i++) {
  409. //这里的id和页面中写的html代码的canvas的id要一致
  410. let canvasId = 'zipCanvas'
  411. //原图的路径
  412. let imagePath = res.tempFiles[i].path
  413. //大小限制
  414. let limitSize = 1024 * 2
  415. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  416. let drawWidth = uni.getSystemInfoSync().windowWidth
  417. let that = this
  418. let token = uni.getStorageSync('token')
  419. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  420. uni.showLoading({
  421. title: '上传中'
  422. })
  423. uni.uploadFile({
  424. url: that.config('APIHOST1') + '/app/new-file/upload',
  425. filePath: resPath,
  426. header: {
  427. token: token
  428. },
  429. name: 'file',
  430. success: (uploadFileRes) => {
  431. if (e == 1) {
  432. that.shop.business = JSON.parse(uploadFileRes.data).data
  433. } else if (e == 2) {
  434. that.shop.front = JSON.parse(uploadFileRes.data).data
  435. } else if (e == 3) {
  436. that.shop.back = JSON.parse(uploadFileRes.data).data
  437. }
  438. console.log(that.detailsImg)
  439. uni.hideLoading()
  440. },
  441. fail: () => {
  442. uni.showToast({
  443. title: '上传失败',
  444. icon: 'error'
  445. })
  446. }
  447. })
  448. })
  449. }
  450. }
  451. })
  452. },
  453. config: function (name) {
  454. var info = null
  455. if (name) {
  456. var name2 = name.split('.') //字符分割
  457. if (name2.length > 1) {
  458. info = configdata[name2[0]][name2[1]] || null
  459. } else {
  460. info = configdata[name] || null
  461. }
  462. if (info == null) {
  463. let web_config = cache.get('web_config')
  464. if (web_config) {
  465. if (name2.length > 1) {
  466. info = web_config[name2[0]][name2[1]] || null
  467. } else {
  468. info = web_config[name] || null
  469. }
  470. }
  471. }
  472. }
  473. return info
  474. },
  475. // 发布
  476. submit() {
  477. console.log(this.detailsImg)
  478. this.shop.detailsImg = this.detailsImg
  479. this.shop.detailsImg = this.shop.detailsImg.toString()
  480. if (!this.shop.shopTypeName) {
  481. uni.showToast({
  482. title: '请填写商铺主营类型',
  483. icon: 'none',
  484. duration: 1000
  485. })
  486. return
  487. }
  488. if (!this.shop.name) {
  489. uni.showToast({
  490. title: '请填写商铺名称',
  491. icon: 'none',
  492. duration: 1000
  493. })
  494. return
  495. }
  496. if (!this.shop.address) {
  497. uni.showToast({
  498. title: '请填写商铺地址',
  499. icon: 'none',
  500. duration: 1000
  501. })
  502. return
  503. }
  504. if (!this.shop.detailedAddress) {
  505. uni.showToast({
  506. title: '请填写店铺详细地址',
  507. icon: 'none',
  508. duration: 1000
  509. })
  510. return
  511. }
  512. if (!this.shop.userName) {
  513. uni.showToast({
  514. title: '请填写真实姓名',
  515. icon: 'none',
  516. duration: 1000
  517. })
  518. return
  519. }
  520. if (!this.shop.isNumber) {
  521. uni.showToast({
  522. title: '请填写身份证号',
  523. icon: 'none',
  524. duration: 1000
  525. })
  526. return
  527. }
  528. if (!this.shop.phone) {
  529. uni.showToast({
  530. title: '请填写联系电话',
  531. icon: 'none',
  532. duration: 1000
  533. })
  534. return
  535. }
  536. if (!this.shop.verCode) {
  537. uni.showToast({
  538. title: '请填写验证码',
  539. icon: 'none',
  540. duration: 1000
  541. })
  542. return
  543. }
  544. if (!this.shop.detailsImg) {
  545. uni.showToast({
  546. title: '请上传商铺图片',
  547. icon: 'none',
  548. duration: 1000
  549. })
  550. return
  551. }
  552. if (!this.shop.business) {
  553. uni.showToast({
  554. title: '请上传营业执照',
  555. icon: 'none',
  556. duration: 1000
  557. })
  558. return
  559. }
  560. if (!this.shop.front) {
  561. uni.showToast({
  562. title: '请上传身份证正面',
  563. icon: 'none',
  564. duration: 1000
  565. })
  566. return
  567. }
  568. if (!this.shop.back) {
  569. uni.showToast({
  570. title: '请上传身份证反面',
  571. icon: 'none',
  572. duration: 1000
  573. })
  574. return
  575. }
  576. let data = {
  577. shopName: this.shop.name,
  578. shopTypeId: this.shop.typeid,
  579. shopTypeName: this.shop.shopTypeName,
  580. detailedAddress: this.shop.address,
  581. detailedAddress: this.shop.detailedAddress,
  582. shopLat: this.shop.latitude,
  583. shopLng: this.shop.longitude,
  584. province: this.province,
  585. city: this.city,
  586. district: this.district,
  587. realName: this.shop.userName,
  588. identitycardNumber: this.shop.isNumber,
  589. phone: this.shop.phone,
  590. code: this.shop.verCode,
  591. businessLicense: this.shop.business,
  592. identitycardPro: this.shop.front,
  593. identitycardCon: this.shop.back,
  594. shopCover: this.shop.detailsImg
  595. }
  596. // uni.setStorageSync('updataShopId', this.shop.shopId)
  597. this.$Request.postJson('/app/shop/insertShopAuthentication', data).then((res) => {
  598. if (res.code == 0) {
  599. uni.showToast({
  600. title: '提交成功,等待审核通过',
  601. icon: 'none'
  602. })
  603. setTimeout(function () {
  604. uni.navigateBack()
  605. }, 1000)
  606. } else {
  607. uni.showToast({
  608. title: res.msg,
  609. icon: 'none'
  610. })
  611. }
  612. })
  613. },
  614. sendMsg() {
  615. // const {
  616. // phone
  617. // } = this.shop;
  618. if (this.sendTime != '获取验证码') {
  619. return
  620. }
  621. console.log('this.shop.phone', this.shop.phone)
  622. if (!this.shop.phone) {
  623. this.$queue.showToast('请输入手机号')
  624. } else if (this.shop.phone.length !== 11) {
  625. this.$queue.showToast('请输入正确的手机号')
  626. } else {
  627. this.$queue.showLoading('正在发送验证码...')
  628. this.$Request.getT('/app/shop/sendMsgs/' + this.shop.phone + '/enter').then((res) => {
  629. if (res.code === 0) {
  630. this.sending = true
  631. this.$queue.showToast('验证码发送成功请注意查收')
  632. this.countDown()
  633. uni.hideLoading()
  634. } else {
  635. uni.hideLoading()
  636. uni.showModal({
  637. showCancel: false,
  638. title: '短信发送失败',
  639. content: res.msg ? res.msg : '请一分钟后再获取验证码'
  640. })
  641. }
  642. })
  643. }
  644. },
  645. countDown() {
  646. const { count } = this
  647. if (count === 1) {
  648. this.count = 60
  649. this.sending = false
  650. this.sendTime = '获取验证码'
  651. } else {
  652. this.count = count - 1
  653. this.sending = true
  654. this.sendTime = count - 1 + '秒后重新获取'
  655. setTimeout(this.countDown.bind(this), 1000)
  656. }
  657. }
  658. }
  659. }
  660. </script>
  661. <style>
  662. page {
  663. background-color: #f5f5f5;
  664. }
  665. .bg {
  666. background-color: #ffffff;
  667. }
  668. textarea::-webkit-input-placeholder {
  669. color: #303133;
  670. font-size: 20rpx;
  671. }
  672. textarea:-moz-placeholder {
  673. color: #303133;
  674. font-size: 20rpx;
  675. }
  676. textarea::-moz-placeholder {
  677. color: #303133;
  678. font-size: 20rpx;
  679. }
  680. textarea::-ms-input-placeholder {
  681. color: #303133;
  682. font-size: 20rpx;
  683. }
  684. .tabBox {
  685. border: 1rpx solid #999999;
  686. padding: 15rpx 20rpx;
  687. border-radius: 15rpx;
  688. font-size: 28rpx;
  689. }
  690. .btnnum {
  691. color: #005dff;
  692. border: 1rpx solid #005dff;
  693. }
  694. .send-msg {
  695. border-radius: 30px;
  696. color: #ffffff;
  697. /*#FCD202 */
  698. background: #fcd202;
  699. height: 60rpx;
  700. font-size: 28rpx;
  701. line-height: 60rpx;
  702. display: inline-block;
  703. width: 45%;
  704. margin-left: 4%;
  705. position: relative;
  706. top: 20rpx;
  707. }
  708. </style>