store_settled.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. <!-- 验证码 -->
  37. <view class="apply-form-item">
  38. <u-field label="创建账号" v-model="form.account" label-width="160" placeholder="请设置登录账号(可用手机号代替)"
  39. required />
  40. </view>
  41. <!-- 设置密码 -->
  42. <view class="apply-form-item">
  43. <u-field label="设置密码" :password="true" v-model="form.password" label-width="160"
  44. placeholder="请设置登录密码" required />
  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. <!-- 同意协议 -->
  58. <view class="apply-form-item flex">
  59. <u-checkbox shape="circle" :active-color="colorConfig.primary" v-model="isAgree">
  60. <text class="sm">已阅读并同意</text>
  61. </u-checkbox>
  62. <router-link :to="{path: '/bundle/pages/server_explan/server_explan', query: {type: 3}}">
  63. <text class="primary sm">《入驻协议》</text>
  64. </router-link>
  65. </view>
  66. <!-- 提交申请 -->
  67. <view style="padding: 30rpx 20rpx 30rpx 0;">
  68. <button type="primary" size="lg" class="br60" @tap="onSubmit">提交申请</button>
  69. </view>
  70. <!-- 查阅记录 -->
  71. <router-link to="/bundle/pages/settled_recode/settled_recode">
  72. <view class="flex row-center muted">
  73. <u-icon name="order" size="32" />
  74. <view class="m-l-10">查看提交记录</view>
  75. </view>
  76. </router-link>
  77. </view>
  78. </view>
  79. <u-select v-model="showPop" mode="single-column" value-name="id" label-name="name" :list="shopCategory"
  80. @confirm="confirmSelect"></u-select>
  81. </view>
  82. <view class="shop-show" v-else>
  83. <view class="top" :style="{
  84. backgroundImage:'url(' + (shopData.background) + ')'
  85. }">
  86. <view class="wrap">
  87. <image :src="shopData.logo" mode="" class="logo"></image>
  88. <view class="shop-info">
  89. <view class="name">
  90. {{shopData.name}}
  91. </view>
  92. <view class="tags">
  93. {{shopData.type_desc}}
  94. </view>
  95. </view>
  96. </view>
  97. <view class="num-data">
  98. <view class="item text-center">
  99. <view class="num">
  100. {{shopData.on_sale_count}}
  101. </view>
  102. <view class="desc">
  103. 在售总数
  104. </view>
  105. </view>
  106. <view class="item text-center">
  107. <view class="num">
  108. {{shopData.follow_num}}
  109. </view>
  110. <view class="desc">
  111. 粉丝数
  112. </view>
  113. </view>
  114. <view class="item text-center">
  115. <view class="num">
  116. {{shopData.score}}
  117. </view>
  118. <view class="desc">
  119. 店铺评分
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="content">
  125. <view class="title">
  126. 恭喜您已成为入驻商家
  127. </view>
  128. <view class="cont">
  129. <view class="">
  130. PC浏览器打开以下网址即可进行店铺管理操作:
  131. </view>
  132. <view class="admin_url">
  133. {{appConfig.base_domain + 'shop/'}}
  134. </view>
  135. <button @tap='onCopy'>点我一键复制链接</button>
  136. <view class="tips">
  137. 注:使用商家入驻申请时所填写的账号密码登录哦
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import {
  146. getShopCategory,
  147. shopApply
  148. } from "@/api/shop"
  149. import {
  150. baseURL
  151. } from '@/config/app'
  152. import {
  153. sendSms
  154. } from '@/api/app'
  155. import {
  156. SMSType
  157. } from '@/utils/type'
  158. import {
  159. mapGetters,
  160. mapActions
  161. } from 'vuex'
  162. import {
  163. copy
  164. } from '@/utils/tools'
  165. import {
  166. shopApplyDetail,
  167. getShopInfo
  168. } from '@/api/shop'
  169. export default {
  170. data() {
  171. return {
  172. isAgree: false,
  173. // 表单数据
  174. form: {
  175. cid: '',
  176. clabel: '',
  177. name: '',
  178. nickname: '',
  179. mobile: '',
  180. account: '',
  181. password: '',
  182. code: ''
  183. },
  184. codeTips: '',
  185. shopCategory: [],
  186. showPop: false,
  187. action: baseURL + '/api/file/formimage',
  188. fileList: [],
  189. shopData: {}
  190. }
  191. },
  192. onLoad() {
  193. this.getShopCategoryFun()
  194. if (this.userInfo.shop_id != 0) {
  195. this.shopDetail()
  196. }
  197. },
  198. methods: {
  199. ...mapActions(['getUser']),
  200. async getShopCategoryFun() {
  201. const {
  202. code,
  203. data
  204. } = await getShopCategory()
  205. if (code == 1) {
  206. this.shopCategory = data.filter(e => {
  207. return e.id != 35
  208. })
  209. }
  210. },
  211. sendSmsFun() {
  212. if (!this.$refs.uCode.canGetCode) return
  213. if (!this.form.mobile) {
  214. this.$toast({
  215. title: '请填写手机号信息'
  216. })
  217. return;
  218. }
  219. sendSms({
  220. mobile: this.form.mobile,
  221. key: SMSType.SJSQYZ
  222. }).then(res => {
  223. if (res.code == 1) {
  224. this.$toast({
  225. title: res.msg
  226. });
  227. this.$refs.uCode.start();
  228. }
  229. })
  230. },
  231. codeChange(tip) {
  232. this.codeTips = tip
  233. },
  234. // 提交表单
  235. async onSubmit() {
  236. const {
  237. form,
  238. isAgree,
  239. fileList
  240. } = this
  241. const submitObj = {
  242. ...form,
  243. license: fileList
  244. }
  245. delete submitObj.clabel
  246. console.log(submitObj, 'info');
  247. if (!isAgree) return this.$toast({
  248. title: '请先同意《入驻协议》'
  249. })
  250. const {
  251. data,
  252. code,
  253. msg
  254. } = await shopApply(submitObj)
  255. if (code == 1) {
  256. this.$toast({
  257. title: msg
  258. })
  259. setTimeout(() => {
  260. this.$Router.replace({
  261. path: '/bundle/pages/settled_result/settled_result',
  262. query: {
  263. id: data.id
  264. }
  265. })
  266. }, 1000)
  267. }
  268. },
  269. confirmSelect(e) {
  270. const {
  271. value,
  272. label
  273. } = e[0]
  274. this.form.cid = value
  275. this.form.clabel = label
  276. },
  277. onSuccess(e) {
  278. this.fileList.push(e.data.base_uri)
  279. },
  280. onRemove(index) {
  281. this.fileList.splice(index, 1)
  282. console.log(index)
  283. },
  284. async shopDetail() {
  285. const {
  286. code,
  287. data
  288. } = await getShopInfo({
  289. shop_id: this.userInfo.shop_id
  290. })
  291. if (code == 1) {
  292. console.log(data)
  293. this.shopData = data
  294. }
  295. },
  296. onCopy() {
  297. copy(this.appConfig.base_domain + 'shop/')
  298. },
  299. },
  300. computed: {
  301. ...mapGetters(["userInfo", "appConfig"]),
  302. }
  303. }
  304. </script>
  305. <style lang="scss">
  306. page {
  307. background: #fff;
  308. }
  309. .store-settled {
  310. background-color: #FA844C;
  311. min-height: 100vh;
  312. background-image: url(../../static/store_recruitment_bg.png);
  313. background-repeat: no-repeat;
  314. background-size: 100% auto;
  315. overflow: hidden;
  316. .content {
  317. margin-top: 320rpx;
  318. padding: 0 20rpx 31rpx;
  319. .apply-form {
  320. border-radius: 8px;
  321. padding: 20rpx 0 30rpx 26rpx;
  322. .apply-form-item {
  323. .send-code-btn {
  324. height: 56rpx;
  325. width: 188rpx;
  326. border: 1rpx solid $-color-primary;
  327. }
  328. }
  329. .primary-btn {
  330. width: 100%;
  331. height: 88rpx;
  332. background-color: $-color-primary;
  333. }
  334. }
  335. }
  336. // .pop-categories {
  337. // .reason-item {
  338. // padding: 24rpx 20rpx;
  339. // .reason-desc {
  340. // line-height: 46rpx;
  341. // }
  342. // }
  343. // }
  344. }
  345. .shop-show {
  346. .top {
  347. width: 100%;
  348. height: 300rpx;
  349. background-size: 100% 100%;
  350. padding: 40rpx 30rpx;
  351. box-sizing: border-box;
  352. .wrap {
  353. display: flex;
  354. align-items: center;
  355. color: #fff;
  356. .logo {
  357. width: 120rpx;
  358. height: 120rpx;
  359. border-radius: 50%;
  360. margin-right: 20rpx;
  361. }
  362. .name {
  363. font-size: 40rpx;
  364. line-height: 60rpx;
  365. font-weight: bold;
  366. }
  367. .tags {
  368. font-size: 28rpx;
  369. line-height: 60rpx;
  370. }
  371. }
  372. .num-data {
  373. display: flex;
  374. justify-content: space-between;
  375. align-items: center;
  376. color: #fff;
  377. margin-top: 40rpx;
  378. .item {
  379. flex-basis: 100%;
  380. .num {
  381. font-weight: bold;
  382. font-size: 36rpx;
  383. line-height: 48rpx;
  384. }
  385. .desc {
  386. font-size: 24rpx;
  387. }
  388. }
  389. }
  390. }
  391. .content {
  392. background: transparent;
  393. padding: 40rpx 30rpx;
  394. .title {
  395. text-align: center;
  396. font-weight: bold;
  397. font-size: 48rpx;
  398. margin-bottom: 40rpx;
  399. }
  400. .cont {
  401. font-size: 32rpx;
  402. text-align: center;
  403. line-height: 60rpx;
  404. .admin_url {
  405. font-weight: bold;
  406. text-align: center;
  407. }
  408. button {
  409. width: 45%;
  410. background: linear-gradient(97deg, #ff5784, #ff2c3c);
  411. color: #fff;
  412. border-radius: 50rpx;
  413. margin: 20rpx auto;
  414. }
  415. .tips {
  416. font-size: 28rpx;
  417. }
  418. }
  419. }
  420. }
  421. </style>