index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864
  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.detailedAddress//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 = this.Settedlist.detailedAddress//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.address = res.address//
  398. that.shop.latitude = res.latitude
  399. that.shop.longitude = res.longitude
  400. that.getcity(res.latitude, res.longitude)
  401. }
  402. })
  403. },
  404. getcity(latitude, longitude) {
  405. let data = {
  406. lat: latitude,
  407. lng: longitude
  408. }
  409. this.$Request.get('/app/address/selectCity', data).then((res) => {
  410. console.log(res,'lkjj')
  411. if (res.code == 0) {
  412. console.log(res,res.data.city,'lkjj')
  413. this.city = res.data.city
  414. this.province = res.data.province
  415. this.district = res.data.district
  416. this.shop.address = res.data.province + res.data.city + res.data.district
  417. }
  418. })
  419. },
  420. // 图片上传
  421. addImages(e) {
  422. let that = this
  423. uni.chooseImage({
  424. count: 1,
  425. sourceType: ['album', 'camera'],
  426. success: (res) => {
  427. for (let i = 0; i < res.tempFiles.length; i++) {
  428. //这里的id和页面中写的html代码的canvas的id要一致
  429. let canvasId = 'zipCanvas'
  430. //原图的路径
  431. let imagePath = res.tempFiles[i].path
  432. //大小限制
  433. let limitSize = 1024 * 2
  434. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  435. let drawWidth = uni.getSystemInfoSync().windowWidth
  436. let that = this
  437. let token = uni.getStorageSync('shopToken')
  438. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  439. uni.showLoading({
  440. title: '上传中'
  441. })
  442. uni.uploadFile({
  443. url: that.config('APIHOST1') + '/app/new-file/limit-upload',
  444. filePath: resPath,
  445. header: {
  446. token: token
  447. },
  448. name: 'file',
  449. success: (uploadFileRes) => {
  450. that.detailsImg = JSON.parse(uploadFileRes.data).data
  451. console.log(that.detailsImg)
  452. uni.hideLoading()
  453. },
  454. fail: () => {
  455. uni.showToast({
  456. title: '上传失败',
  457. icon: 'error'
  458. })
  459. }
  460. })
  461. })
  462. }
  463. }
  464. })
  465. },
  466. // 图片上传
  467. addImage(e) {
  468. let that = this
  469. if (e == 1) {
  470. var num = ''
  471. }
  472. {
  473. var num = 1
  474. }
  475. uni.chooseImage({
  476. count: num,
  477. sourceType: ['album', 'camera'],
  478. success: (res) => {
  479. for (let i = 0; i < res.tempFiles.length; i++) {
  480. //这里的id和页面中写的html代码的canvas的id要一致
  481. let canvasId = 'zipCanvas'
  482. //原图的路径
  483. let imagePath = res.tempFiles[i].path
  484. //大小限制
  485. let limitSize = 1024 * 2
  486. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  487. let drawWidth = uni.getSystemInfoSync().windowWidth
  488. let that = this
  489. let token = uni.getStorageSync('shopToken')
  490. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  491. uni.showLoading({
  492. title: '上传中'
  493. })
  494. uni.uploadFile({
  495. url: that.config('APIHOST1') + '/app/new-file/limit-upload',
  496. filePath: resPath,
  497. header: {
  498. token: token
  499. },
  500. name: 'file',
  501. success: (uploadFileRes) => {
  502. if (e == 1) {
  503. that.business.push(JSON.parse(uploadFileRes.data).data)
  504. } else if (e == 2) {
  505. that.shop.front = JSON.parse(uploadFileRes.data).data
  506. } else if (e == 3) {
  507. that.shop.back = JSON.parse(uploadFileRes.data).data
  508. }
  509. console.log(that.detailsImg, that.shop.business, 'lll')
  510. uni.hideLoading()
  511. },
  512. fail: () => {
  513. uni.showToast({
  514. title: '上传失败',
  515. icon: 'error'
  516. })
  517. }
  518. })
  519. })
  520. }
  521. }
  522. })
  523. },
  524. config: function (name) {
  525. var info = null
  526. if (name) {
  527. var name2 = name.split('.') //字符分割
  528. if (name2.length > 1) {
  529. info = configdata[name2[0]][name2[1]] || null
  530. } else {
  531. info = configdata[name] || null
  532. }
  533. if (info == null) {
  534. let web_config = cache.get('web_config')
  535. if (web_config) {
  536. if (name2.length > 1) {
  537. info = web_config[name2[0]][name2[1]] || null
  538. } else {
  539. info = web_config[name] || null
  540. }
  541. }
  542. }
  543. }
  544. return info
  545. },
  546. // 发布
  547. submit() {
  548. let that = this
  549. console.log(this.detailsImg)
  550. uni.getSystemInfo({
  551. success: function (res) {
  552. console.log(res.model)
  553. if (res.model == 'iPhone') {
  554. that.sysphone = 2
  555. } else if (res.model != 'iPhone') {
  556. that.sysphone = 1
  557. }
  558. }
  559. })
  560. if (!this.shop.shopTypeName) {
  561. uni.showToast({
  562. title: '请填写商铺主营类型',
  563. icon: 'none',
  564. duration: 1000
  565. })
  566. return
  567. }
  568. if (!this.shop.name) {
  569. uni.showToast({
  570. title: '请填写商铺名称',
  571. icon: 'none',
  572. duration: 1000
  573. })
  574. return
  575. }
  576. if (!this.shop.address) {
  577. uni.showToast({
  578. title: '请填写商铺地址',
  579. icon: 'none',
  580. duration: 1000
  581. })
  582. return
  583. }
  584. if (!this.shop.detailedAddress) {
  585. uni.showToast({
  586. title: '请填写店铺详细地址',
  587. icon: 'none',
  588. duration: 1000
  589. })
  590. return
  591. }
  592. if (!this.shop.userName) {
  593. uni.showToast({
  594. title: '请填写真实姓名',
  595. icon: 'none',
  596. duration: 1000
  597. })
  598. return
  599. }
  600. if (!this.shop.isNumber) {
  601. uni.showToast({
  602. title: '请填写身份证号',
  603. icon: 'none',
  604. duration: 1000
  605. })
  606. return
  607. }
  608. 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]$/
  609. if (!regX.test(this.shop.isNumber)) {
  610. uni.showToast({
  611. title: '请输入正确的身份证号',
  612. icon: 'none',
  613. duration: 1000
  614. })
  615. return
  616. }
  617. if (!this.shop.phone) {
  618. uni.showToast({
  619. title: '请填写联系电话',
  620. icon: 'none',
  621. duration: 1000
  622. })
  623. return
  624. }
  625. if (!this.shop.verCode) {
  626. uni.showToast({
  627. title: '请填写验证码',
  628. icon: 'none',
  629. duration: 1000
  630. })
  631. return
  632. }
  633. if (!this.shop.detailsImg) {
  634. uni.showToast({
  635. title: '请上传商铺图片',
  636. icon: 'none',
  637. duration: 1000
  638. })
  639. return
  640. }
  641. if (this.business.length < 3) {
  642. uni.showToast({
  643. title: '请上传营业执照,食品经营许可和健康证',
  644. icon: 'none',
  645. duration: 1000
  646. })
  647. return
  648. }
  649. if (!this.shop.front) {
  650. uni.showToast({
  651. title: '请上传身份证正面',
  652. icon: 'none',
  653. duration: 1000
  654. })
  655. return
  656. }
  657. if (!this.shop.back) {
  658. uni.showToast({
  659. title: '请上传身份证反面',
  660. icon: 'none',
  661. duration: 1000
  662. })
  663. return
  664. }
  665. this.shop.detailsImg = this.detailsImg
  666. this.shop.detailsImg = this.shop.detailsImg.toString()
  667. this.shop.business = this.business.toString()
  668. var openId = this.$queue.getData('openid') ? this.$queue.getData('openid') : ''
  669. let data = {
  670. msg: this.shop.verCode,
  671. phone: this.shop.phone,
  672. userType: 1,
  673. openId: openId,
  674. platform: this.platform,
  675. sysPhone: this.sysphone,
  676. shopName: this.shop.name,
  677. shopTypeId: this.shop.typeid,
  678. shopTypeName: this.shop.shopTypeName,
  679. detailedAddress: this.shop.address,
  680. detailedAddress: this.shop.detailedAddress,
  681. shopLat: this.shop.latitude,
  682. shopLng: this.shop.longitude,
  683. province: this.province,
  684. city: this.city,
  685. district: this.district,
  686. realName: this.shop.userName,
  687. identitycardNumber: this.shop.isNumber,
  688. // phone: this.shop.phone,
  689. // code: this.shop.verCode,
  690. businessLicense: this.shop.business,
  691. identitycardPro: this.shop.front,
  692. identitycardCon: this.shop.back,
  693. shopCover: this.shop.detailsImg
  694. // schoolId:this.shop.schoolId
  695. }
  696. // uni.setStorageSync('updataShopId', this.shop.shopId)
  697. if (this.Settedlist) {
  698. data.shopId = this.shopId
  699. this.$Request.postJson('/admin/goodsShop/updateGoodsShop', data).then((res) => {
  700. if (res.code == 0) {
  701. uni.showToast({
  702. title: '提交成功,等待审核通过',
  703. icon: 'none'
  704. })
  705. setTimeout(function () {
  706. uni.navigateBack()
  707. }, 1000)
  708. } else {
  709. uni.showToast({
  710. title: res.msg,
  711. icon: 'none'
  712. })
  713. }
  714. })
  715. } else {
  716. this.$Request.postJson('/admin/goodsShop/quickGoodsShop', data).then((res) => {
  717. if (res.code == 0) {
  718. uni.showToast({
  719. title: '提交成功,等待审核通过',
  720. icon: 'none'
  721. })
  722. setTimeout(function () {
  723. uni.navigateBack()
  724. }, 1000)
  725. } else {
  726. uni.showModal({
  727. title: '提示',
  728. content: res.msg,
  729. success: function (res) {
  730. if (res.confirm) {
  731. } else if (res.cancel) {
  732. }
  733. }
  734. })
  735. }
  736. })
  737. }
  738. },
  739. sendMsg() {
  740. // const {
  741. // phone
  742. // } = this.shop;
  743. if (this.sendTime != '获取验证码') {
  744. return
  745. }
  746. console.log('this.shop.phone', this.shop.phone)
  747. if (!this.shop.phone) {
  748. this.$queue.showToast('请输入手机号')
  749. } else if (this.shop.phone.length !== 11) {
  750. this.$queue.showToast('请输入正确的手机号')
  751. } else {
  752. this.$queue.showLoading('正在发送验证码...')
  753. this.$Request.getT('/app/Login/sendMsg/' + this.shop.phone + '/ruzhu').then((res) => {
  754. if (res.code === 0) {
  755. this.sending = true
  756. this.$queue.showToast('验证码发送成功请注意查收')
  757. this.countDown()
  758. uni.hideLoading()
  759. } else {
  760. uni.hideLoading()
  761. uni.showModal({
  762. showCancel: false,
  763. title: '短信发送失败',
  764. content: res.msg ? res.msg : '请一分钟后再获取验证码'
  765. })
  766. }
  767. })
  768. }
  769. },
  770. countDown() {
  771. const { count } = this
  772. if (count === 1) {
  773. this.count = 60
  774. this.sending = false
  775. this.sendTime = '获取验证码'
  776. } else {
  777. this.count = count - 1
  778. this.sending = true
  779. this.sendTime = count - 1 + '秒后重新获取'
  780. setTimeout(this.countDown.bind(this), 1000)
  781. }
  782. }
  783. }
  784. }
  785. </script>
  786. <style>
  787. page {
  788. background-color: #f5f5f5;
  789. }
  790. .bg {
  791. background-color: #ffffff;
  792. }
  793. textarea::-webkit-input-placeholder {
  794. color: #303133;
  795. font-size: 20rpx;
  796. }
  797. textarea:-moz-placeholder {
  798. color: #303133;
  799. font-size: 20rpx;
  800. }
  801. textarea::-moz-placeholder {
  802. color: #303133;
  803. font-size: 20rpx;
  804. }
  805. textarea::-ms-input-placeholder {
  806. color: #303133;
  807. font-size: 20rpx;
  808. }
  809. .tabBox {
  810. border: 1rpx solid #999999;
  811. padding: 15rpx 20rpx;
  812. border-radius: 15rpx;
  813. font-size: 28rpx;
  814. }
  815. .btnnum {
  816. color: #005dff;
  817. border: 1rpx solid #005dff;
  818. }
  819. .send-msg {
  820. border-radius: 30px;
  821. color: #ffffff;
  822. /*#FCD202 */
  823. background: #fcd202;
  824. height: 60rpx;
  825. font-size: 28rpx;
  826. line-height: 60rpx;
  827. display: inline-block;
  828. width: 45%;
  829. margin-left: 4%;
  830. position: relative;
  831. /* #ifndef MP-WEIXIN */
  832. top: 0;
  833. /* #endif */
  834. /* #ifdef MP-WEIXIN */
  835. top: 20rpx;
  836. /* #endif */
  837. }
  838. </style>