index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  373. uni.showLoading({
  374. title: '上传中'
  375. })
  376. uni.uploadFile({
  377. url: that.config('APIHOST1') + '/alioss/upload',
  378. filePath: resPath,
  379. name: 'file',
  380. success: (uploadFileRes) => {
  381. that.detailsImg = JSON.parse(uploadFileRes.data).data
  382. console.log(that.detailsImg)
  383. uni.hideLoading()
  384. },
  385. fail: () => {
  386. uni.showToast({
  387. title: '上传失败',
  388. icon: 'error'
  389. })
  390. }
  391. })
  392. })
  393. }
  394. }
  395. })
  396. },
  397. // 图片上传
  398. addImage(e) {
  399. let that = this
  400. uni.chooseImage({
  401. count: 1,
  402. sourceType: ['album', 'camera'],
  403. success: (res) => {
  404. for (let i = 0; i < res.tempFiles.length; i++) {
  405. //这里的id和页面中写的html代码的canvas的id要一致
  406. let canvasId = 'zipCanvas'
  407. //原图的路径
  408. let imagePath = res.tempFiles[i].path
  409. //大小限制
  410. let limitSize = 1024 * 2
  411. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  412. let drawWidth = uni.getSystemInfoSync().windowWidth
  413. let that = this
  414. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  415. uni.showLoading({
  416. title: '上传中'
  417. })
  418. uni.uploadFile({
  419. url: that.config('APIHOST1') + '/alioss/upload',
  420. filePath: resPath,
  421. name: 'file',
  422. success: (uploadFileRes) => {
  423. if (e == 1) {
  424. that.shop.business = JSON.parse(uploadFileRes.data).data
  425. } else if (e == 2) {
  426. that.shop.front = JSON.parse(uploadFileRes.data).data
  427. } else if (e == 3) {
  428. that.shop.back = JSON.parse(uploadFileRes.data).data
  429. }
  430. console.log(that.detailsImg)
  431. uni.hideLoading()
  432. },
  433. fail: () => {
  434. uni.showToast({
  435. title: '上传失败',
  436. icon: 'error'
  437. })
  438. }
  439. })
  440. })
  441. }
  442. }
  443. })
  444. },
  445. config: function (name) {
  446. var info = null
  447. if (name) {
  448. var name2 = name.split('.') //字符分割
  449. if (name2.length > 1) {
  450. info = configdata[name2[0]][name2[1]] || null
  451. } else {
  452. info = configdata[name] || null
  453. }
  454. if (info == null) {
  455. let web_config = cache.get('web_config')
  456. if (web_config) {
  457. if (name2.length > 1) {
  458. info = web_config[name2[0]][name2[1]] || null
  459. } else {
  460. info = web_config[name] || null
  461. }
  462. }
  463. }
  464. }
  465. return info
  466. },
  467. // 发布
  468. submit() {
  469. console.log(this.detailsImg)
  470. this.shop.detailsImg = this.detailsImg
  471. this.shop.detailsImg = this.shop.detailsImg.toString()
  472. if (!this.shop.shopTypeName) {
  473. uni.showToast({
  474. title: '请填写商铺主营类型',
  475. icon: 'none',
  476. duration: 1000
  477. })
  478. return
  479. }
  480. if (!this.shop.name) {
  481. uni.showToast({
  482. title: '请填写商铺名称',
  483. icon: 'none',
  484. duration: 1000
  485. })
  486. return
  487. }
  488. if (!this.shop.address) {
  489. uni.showToast({
  490. title: '请填写商铺地址',
  491. icon: 'none',
  492. duration: 1000
  493. })
  494. return
  495. }
  496. if (!this.shop.detailedAddress) {
  497. uni.showToast({
  498. title: '请填写店铺详细地址',
  499. icon: 'none',
  500. duration: 1000
  501. })
  502. return
  503. }
  504. if (!this.shop.userName) {
  505. uni.showToast({
  506. title: '请填写真实姓名',
  507. icon: 'none',
  508. duration: 1000
  509. })
  510. return
  511. }
  512. if (!this.shop.isNumber) {
  513. uni.showToast({
  514. title: '请填写身份证号',
  515. icon: 'none',
  516. duration: 1000
  517. })
  518. return
  519. }
  520. if (!this.shop.phone) {
  521. uni.showToast({
  522. title: '请填写联系电话',
  523. icon: 'none',
  524. duration: 1000
  525. })
  526. return
  527. }
  528. if (!this.shop.verCode) {
  529. uni.showToast({
  530. title: '请填写验证码',
  531. icon: 'none',
  532. duration: 1000
  533. })
  534. return
  535. }
  536. if (!this.shop.detailsImg) {
  537. uni.showToast({
  538. title: '请上传商铺图片',
  539. icon: 'none',
  540. duration: 1000
  541. })
  542. return
  543. }
  544. if (!this.shop.business) {
  545. uni.showToast({
  546. title: '请上传营业执照',
  547. icon: 'none',
  548. duration: 1000
  549. })
  550. return
  551. }
  552. if (!this.shop.front) {
  553. uni.showToast({
  554. title: '请上传身份证正面',
  555. icon: 'none',
  556. duration: 1000
  557. })
  558. return
  559. }
  560. if (!this.shop.back) {
  561. uni.showToast({
  562. title: '请上传身份证反面',
  563. icon: 'none',
  564. duration: 1000
  565. })
  566. return
  567. }
  568. let data = {
  569. shopName: this.shop.name,
  570. shopTypeId: this.shop.typeid,
  571. shopTypeName: this.shop.shopTypeName,
  572. detailedAddress: this.shop.address,
  573. detailedAddress: this.shop.detailedAddress,
  574. shopLat: this.shop.latitude,
  575. shopLng: this.shop.longitude,
  576. province: this.province,
  577. city: this.city,
  578. district: this.district,
  579. realName: this.shop.userName,
  580. identitycardNumber: this.shop.isNumber,
  581. phone: this.shop.phone,
  582. code: this.shop.verCode,
  583. businessLicense: this.shop.business,
  584. identitycardPro: this.shop.front,
  585. identitycardCon: this.shop.back,
  586. shopCover: this.shop.detailsImg
  587. }
  588. // uni.setStorageSync('updataShopId', this.shop.shopId)
  589. this.$Request.postJson('/app/shop/insertShopAuthentication', data).then((res) => {
  590. if (res.code == 0) {
  591. uni.showToast({
  592. title: '提交成功,等待审核通过',
  593. icon: 'none'
  594. })
  595. setTimeout(function () {
  596. uni.navigateBack()
  597. }, 1000)
  598. } else {
  599. uni.showToast({
  600. title: res.msg,
  601. icon: 'none'
  602. })
  603. }
  604. })
  605. },
  606. sendMsg() {
  607. // const {
  608. // phone
  609. // } = this.shop;
  610. if (this.sendTime != '获取验证码') {
  611. return
  612. }
  613. console.log('this.shop.phone', this.shop.phone)
  614. if (!this.shop.phone) {
  615. this.$queue.showToast('请输入手机号')
  616. } else if (this.shop.phone.length !== 11) {
  617. this.$queue.showToast('请输入正确的手机号')
  618. } else {
  619. this.$queue.showLoading('正在发送验证码...')
  620. this.$Request.getT('/app/shop/sendMsgs/' + this.shop.phone + '/enter').then((res) => {
  621. if (res.code === 0) {
  622. this.sending = true
  623. this.$queue.showToast('验证码发送成功请注意查收')
  624. this.countDown()
  625. uni.hideLoading()
  626. } else {
  627. uni.hideLoading()
  628. uni.showModal({
  629. showCancel: false,
  630. title: '短信发送失败',
  631. content: res.msg ? res.msg : '请一分钟后再获取验证码'
  632. })
  633. }
  634. })
  635. }
  636. },
  637. countDown() {
  638. const { count } = this
  639. if (count === 1) {
  640. this.count = 60
  641. this.sending = false
  642. this.sendTime = '获取验证码'
  643. } else {
  644. this.count = count - 1
  645. this.sending = true
  646. this.sendTime = count - 1 + '秒后重新获取'
  647. setTimeout(this.countDown.bind(this), 1000)
  648. }
  649. }
  650. }
  651. }
  652. </script>
  653. <style>
  654. page {
  655. background-color: #f5f5f5;
  656. }
  657. .bg {
  658. background-color: #ffffff;
  659. }
  660. textarea::-webkit-input-placeholder {
  661. color: #303133;
  662. font-size: 20rpx;
  663. }
  664. textarea:-moz-placeholder {
  665. color: #303133;
  666. font-size: 20rpx;
  667. }
  668. textarea::-moz-placeholder {
  669. color: #303133;
  670. font-size: 20rpx;
  671. }
  672. textarea::-ms-input-placeholder {
  673. color: #303133;
  674. font-size: 20rpx;
  675. }
  676. .tabBox {
  677. border: 1rpx solid #999999;
  678. padding: 15rpx 20rpx;
  679. border-radius: 15rpx;
  680. font-size: 28rpx;
  681. }
  682. .btnnum {
  683. color: #005dff;
  684. border: 1rpx solid #005dff;
  685. }
  686. .send-msg {
  687. border-radius: 30px;
  688. color: #ffffff;
  689. /*#FCD202 */
  690. background: #fcd202;
  691. height: 60rpx;
  692. font-size: 28rpx;
  693. line-height: 60rpx;
  694. display: inline-block;
  695. width: 45%;
  696. margin-left: 4%;
  697. position: relative;
  698. top: 20rpx;
  699. }
  700. </style>