index.vue 24 KB

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