xxstore_settled.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. <template>
  2. <view class="">
  3. <view class="store-settled" v-if='userInfo.is_shop == 0'>
  4. <view class="content">
  5. <view class="apply-form bg-white">
  6. <!-- 商家名称 -->
  7. <view class="apply-form-item">
  8. <u-field label="商家名称" v-model="form.name" label-width="160" placeholder="请输入商家名称" required />
  9. </view>
  10. <!-- 主营行业 -->
  11. <!-- <view class="apply-form-item" @tap="showPop=true">
  12. <u-field label="主营类目" v-model="form.clabel" label-width="160" style="flex: 1;"
  13. placeholder="请选择行业类目" required disabled>
  14. <u-icon name="arrow-right" slot="right" size="28" />
  15. </u-field>
  16. </view> -->
  17. <!-- 联系人姓名 -->
  18. <view class="apply-form-item">
  19. <u-field label="联系人姓名" v-model="form.nickname" label-width="160" placeholder="请输入联系人姓名"
  20. required />
  21. </view>
  22. <!-- 手机号码 -->
  23. <view class="apply-form-item">
  24. <u-field label="手机号码" v-model="form.mobile" label-width="160" placeholder="请输入手机号码" required />
  25. </view>
  26. <!-- 验证码 -->
  27. <view class="apply-form-item">
  28. <u-field label="验证码" label-width="160" placeholder="请输入验证码" required v-model="form.code">
  29. <view slot="right" class="primary send-code-btn br60 flex row-center" @tap="sendSmsFun">
  30. <u-verification-code unique-key="store-settled" ref="uCode" @change="codeChange">
  31. </u-verification-code>
  32. <view class="xs">{{codeTips}}</view>
  33. </view>
  34. </u-field>
  35. </view>
  36. <view class="apply-form-item" @click="showRegion = true">
  37. <u-field v-model="region" :disabled="true" label="所在地区" placeholder="请选择省、市、区"
  38. right-icon="arrow-right" required>
  39. </u-field>
  40. </view>
  41. <view class="apply-form-item" @click="getLocation()">
  42. <u-field v-model="dw" :disabled="true" label="所在地址" placeholder="请选择地址" right-icon="arrow-right"
  43. required>
  44. </u-field>
  45. </view>
  46. <!-- 上传图片 -->
  47. <view class="apply-form-item">
  48. <u-field label="营业执照" label-width="160" placeholder="请上传营业执照及行业相关资质证明" :border-bottom="false"
  49. required disabled />
  50. <view>
  51. <u-upload ref="uUpload" :show-progress="false" :header="{token: $store.getters.token}"
  52. :max-count="10" width="150" height="150" :action="action" upload-text="上传图片"
  53. @on-success="onSuccess" @on-remove="onRemove" />
  54. </view>
  55. <view class="muted m-t-20 m-b-30">支持jpg、png、jpeg格式的图片,最多可上传10张</view>
  56. </view>
  57. <view class="apply-form-item">
  58. <u-field label="门店头图" label-width="160" placeholder="请上传门店头图" :border-bottom="false" required
  59. disabled />
  60. <view>
  61. <u-upload ref="uUpload" :show-progress="false" :header="{token: $store.getters.token}"
  62. :max-count="5" width="150" height="150" :action="action" upload-text="上传图片"
  63. @on-success="onSuccesstt" @on-remove="onRemovett" />
  64. </view>
  65. <view class="muted m-t-20 m-b-30">支持jpg、png、jpeg格式的图片,最多可上传5张</view>
  66. </view>
  67. <!-- 同意协议 -->
  68. <view class="apply-form-item flex">
  69. <u-checkbox shape="circle" :active-color="colorConfig.primary" v-model="isAgree">
  70. <text class="sm">已阅读并同意</text>
  71. </u-checkbox>
  72. <router-link :to="{path: '/bundle/pages/server_explan/server_explan', query: {type: 3}}">
  73. <text class="primary sm">《入驻协议》</text>
  74. </router-link>
  75. </view>
  76. <!-- 提交申请 -->
  77. <view style="padding: 30rpx 20rpx 30rpx 0;">
  78. <button type="primary" size="lg" class="br60" @tap="onSubmit">提交申请</button>
  79. </view>
  80. <!-- 查阅记录 -->
  81. <router-link to="/bundle/pages/settled_recode/settled_recode">
  82. <view class="flex row-center muted">
  83. <u-icon name="order" size="32" />
  84. <view class="m-l-10">查看提交记录</view>
  85. </view>
  86. </router-link>
  87. </view>
  88. </view>
  89. <u-select v-model="showRegion" mode="mutil-column-auto" @confirm="regionChange" :list="lists"></u-select>
  90. </view>
  91. <view class="shop-show" v-else>
  92. <view class="top" :style="{
  93. backgroundImage:'url(' + (shopData.background) + ')'
  94. }">
  95. <view class="wrap">
  96. <image :src="shopData.logo" mode="" class="logo"></image>
  97. <view class="shop-info">
  98. <view class="name">
  99. {{shopData.name}}
  100. </view>
  101. <view class="tags">
  102. {{shopData.type_desc}}
  103. </view>
  104. </view>
  105. </view>
  106. <view class="num-data">
  107. <!-- <view class="item text-center">
  108. <view class="num">
  109. {{shopData.on_sale_count}}
  110. </view>
  111. <view class="desc">
  112. 在售总数
  113. </view>
  114. </view> -->
  115. <view class="item text-center">
  116. <view class="num">
  117. {{shopData.follow_num}}
  118. </view>
  119. <view class="desc">
  120. 粉丝数
  121. </view>
  122. </view>
  123. <view class="item text-center">
  124. <view class="num">
  125. {{shopData.score}}
  126. </view>
  127. <view class="desc">
  128. 店铺评分
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <view class="content">
  134. <view class="title">
  135. 恭喜您已成为入驻商家
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. import {
  143. getShopCategory,
  144. shopApply
  145. } from "@/api/shop"
  146. import {
  147. baseURL
  148. } from '@/config/app'
  149. import {
  150. sendSms
  151. } from '@/api/app'
  152. import {
  153. SMSType
  154. } from '@/utils/type'
  155. import {
  156. mapGetters,
  157. mapActions
  158. } from 'vuex'
  159. import {
  160. copy
  161. } from '@/utils/tools'
  162. import {
  163. shopApplyDetail,
  164. getShopInfo
  165. } from '@/api/shop'
  166. import area from '@/utils/area'
  167. export default {
  168. data() {
  169. return {
  170. isAgree: false,
  171. // 表单数据
  172. form: {
  173. cid: 35,
  174. clabel: '',
  175. name: '',
  176. nickname: '',
  177. mobile: '',
  178. account: '',
  179. password: '123456',
  180. code: '',
  181. province_id: '',
  182. city_id: '',
  183. district_id: '',
  184. longitude: '',
  185. latitude: ''
  186. },
  187. showRegion: false,
  188. codeTips: '',
  189. shopCategory: [],
  190. showPop: false,
  191. action: baseURL + '/api/file/formimage',
  192. fileList: [],
  193. images: [],
  194. shopData: {},
  195. lists: [],
  196. region: '',
  197. dw: '',
  198. }
  199. },
  200. onLoad() {
  201. this.getShopCategoryFun()
  202. if (this.userInfo.shop_id != 0) {
  203. this.shopDetail()
  204. }
  205. this.$nextTick(() => {
  206. this.lists = area
  207. console.log(area);
  208. })
  209. },
  210. methods: {
  211. ...mapActions(['getUser']),
  212. async getShopCategoryFun() {
  213. const {
  214. code,
  215. data
  216. } = await getShopCategory()
  217. if (code == 1) {
  218. this.shopCategory = data
  219. }
  220. },
  221. getLocation() {
  222. console.log('选择当前位置');
  223. let obj = this;
  224. uni.chooseLocation({
  225. success: function(res) {
  226. console.log('位置名称:' + res.name);
  227. console.log('详细地址:' + res.address);
  228. console.log('纬度:' + res.latitude);
  229. console.log('经度:' + res.longitude);
  230. obj.form.latitude = res.latitude;
  231. obj.form.longitude = res.longitude;
  232. if (res.address) {
  233. obj.dw = res.address;
  234. } else {
  235. obj.dw = res.name;
  236. }
  237. }
  238. });
  239. },
  240. sendSmsFun() {
  241. if (!this.$refs.uCode.canGetCode) return
  242. if (!this.form.mobile) {
  243. this.$toast({
  244. title: '请填写手机号信息'
  245. })
  246. return;
  247. }
  248. sendSms({
  249. mobile: this.form.mobile,
  250. key: SMSType.SJSQYZ
  251. }).then(res => {
  252. if (res.code == 1) {
  253. this.$toast({
  254. title: res.msg
  255. });
  256. this.$refs.uCode.start();
  257. }
  258. })
  259. },
  260. codeChange(tip) {
  261. this.codeTips = tip
  262. },
  263. regionChange(region) {
  264. this.form.province_id = region[0].value;
  265. this.form.city_id = region[1].value;
  266. this.form.district_id = region[2].value;
  267. this.region = region[0].label + " " + region[1].label + " " + region[2].label
  268. },
  269. // 提交表单
  270. async onSubmit() {
  271. const {
  272. form,
  273. isAgree,
  274. fileList,
  275. images
  276. } = this
  277. const submitObj = {
  278. ...form,
  279. license: fileList,
  280. images: images
  281. }
  282. delete submitObj.clabel
  283. submitObj.account = submitObj.mobile
  284. console.log(submitObj, '123456');
  285. if (!submitObj.city_id) {
  286. return uni.showToast({
  287. title: '请选择省市区',
  288. duration: 1500,
  289. icon: 'none'
  290. })
  291. }
  292. if (!submitObj.latitude) {
  293. return uni.showToast({
  294. title: '请选择地址',
  295. duration: 1500,
  296. icon: 'none'
  297. })
  298. }
  299. if (!isAgree) return this.$toast({
  300. title: '请先同意《入驻协议》'
  301. })
  302. const {
  303. data,
  304. code,
  305. msg
  306. } = await shopApply(submitObj)
  307. if (code == 1) {
  308. this.$toast({
  309. title: msg
  310. })
  311. setTimeout(() => {
  312. this.$Router.replace({
  313. path: '/bundle/pages/settled_result/settled_result',
  314. query: {
  315. id: data.id
  316. }
  317. })
  318. }, 1000)
  319. }
  320. },
  321. confirmSelect(e) {
  322. const {
  323. value,
  324. label
  325. } = e[0]
  326. this.form.cid = value
  327. this.form.clabel = label
  328. },
  329. onSuccess(e) {
  330. this.fileList.push(e.data.base_uri)
  331. },
  332. onRemove(index) {
  333. this.fileList.splice(index, 1)
  334. console.log(index)
  335. },
  336. onSuccesstt(e) {
  337. this.images.push(e.data.base_uri)
  338. },
  339. onRemovett(index) {
  340. this.images.splice(index, 1)
  341. console.log(index)
  342. },
  343. async shopDetail() {
  344. const {
  345. code,
  346. data
  347. } = await getShopInfo({
  348. shop_id: this.userInfo.shop_id
  349. })
  350. if (code == 1) {
  351. console.log(data)
  352. this.shopData = data
  353. }
  354. },
  355. onCopy() {
  356. copy(this.appConfig.base_domain + 'shop/')
  357. },
  358. },
  359. computed: {
  360. ...mapGetters(["userInfo", "appConfig"]),
  361. }
  362. }
  363. </script>
  364. <style lang="scss">
  365. page {
  366. background: #fff;
  367. }
  368. .store-settled {
  369. background-color: #FA844C;
  370. min-height: 100vh;
  371. background-image: url(../../static/store_recruitment_bg.png);
  372. background-repeat: no-repeat;
  373. background-size: 100% auto;
  374. overflow: hidden;
  375. .content {
  376. margin-top: 320rpx;
  377. padding: 0 20rpx 31rpx;
  378. .apply-form {
  379. border-radius: 8px;
  380. padding: 20rpx 0 30rpx 26rpx;
  381. .apply-form-item {
  382. .send-code-btn {
  383. height: 56rpx;
  384. width: 188rpx;
  385. border: 1rpx solid $-color-primary;
  386. }
  387. }
  388. .primary-btn {
  389. width: 100%;
  390. height: 88rpx;
  391. background-color: $-color-primary;
  392. }
  393. }
  394. }
  395. // .pop-categories {
  396. // .reason-item {
  397. // padding: 24rpx 20rpx;
  398. // .reason-desc {
  399. // line-height: 46rpx;
  400. // }
  401. // }
  402. // }
  403. }
  404. .shop-show {
  405. .top {
  406. width: 100%;
  407. height: 300rpx;
  408. background-size: 100% 100%;
  409. padding: 40rpx 30rpx;
  410. box-sizing: border-box;
  411. .wrap {
  412. display: flex;
  413. align-items: center;
  414. color: #fff;
  415. .logo {
  416. width: 120rpx;
  417. height: 120rpx;
  418. border-radius: 50%;
  419. margin-right: 20rpx;
  420. }
  421. .name {
  422. font-size: 40rpx;
  423. line-height: 60rpx;
  424. font-weight: bold;
  425. }
  426. .tags {
  427. font-size: 28rpx;
  428. line-height: 60rpx;
  429. }
  430. }
  431. .num-data {
  432. display: flex;
  433. justify-content: space-between;
  434. align-items: center;
  435. color: #fff;
  436. margin-top: 40rpx;
  437. .item {
  438. flex-basis: 100%;
  439. .num {
  440. font-weight: bold;
  441. font-size: 36rpx;
  442. line-height: 48rpx;
  443. }
  444. .desc {
  445. font-size: 24rpx;
  446. }
  447. }
  448. }
  449. }
  450. .content {
  451. background: transparent;
  452. padding: 40rpx 30rpx;
  453. .title {
  454. text-align: center;
  455. font-weight: bold;
  456. font-size: 48rpx;
  457. margin-bottom: 40rpx;
  458. }
  459. .cont {
  460. font-size: 32rpx;
  461. text-align: center;
  462. line-height: 60rpx;
  463. .admin_url {
  464. font-weight: bold;
  465. text-align: center;
  466. }
  467. button {
  468. width: 45%;
  469. background: linear-gradient(97deg, #ff5784, #ff2c3c);
  470. color: #fff;
  471. border-radius: 50rpx;
  472. margin: 20rpx auto;
  473. }
  474. .tips {
  475. font-size: 28rpx;
  476. }
  477. }
  478. }
  479. }
  480. </style>