index.vue 24 KB

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