index.vue 24 KB

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