123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519 |
- <template>
- <view class="">
- <view class="store-settled" v-if='userInfo.is_shop == 0'>
- <view class="content">
- <view class="apply-form bg-white">
- <!-- 商家名称 -->
- <view class="apply-form-item">
- <u-field label="商家名称" v-model="form.name" label-width="160" placeholder="请输入商家名称" required />
- </view>
- <!-- 主营行业 -->
- <!-- <view class="apply-form-item" @tap="showPop=true">
- <u-field label="主营类目" v-model="form.clabel" label-width="160" style="flex: 1;"
- placeholder="请选择行业类目" required disabled>
- <u-icon name="arrow-right" slot="right" size="28" />
- </u-field>
- </view> -->
- <!-- 联系人姓名 -->
- <view class="apply-form-item">
- <u-field label="联系人姓名" v-model="form.nickname" label-width="160" placeholder="请输入联系人姓名"
- required />
- </view>
- <!-- 手机号码 -->
- <view class="apply-form-item">
- <u-field label="手机号码" v-model="form.mobile" label-width="160" placeholder="请输入手机号码" required />
- </view>
- <!-- 验证码 -->
- <view class="apply-form-item">
- <u-field label="验证码" label-width="160" placeholder="请输入验证码" required v-model="form.code">
- <view slot="right" class="primary send-code-btn br60 flex row-center" @tap="sendSmsFun">
- <u-verification-code unique-key="store-settled" ref="uCode" @change="codeChange">
- </u-verification-code>
- <view class="xs">{{codeTips}}</view>
- </view>
- </u-field>
- </view>
- <view class="apply-form-item" @click="showRegion = true">
- <u-field v-model="region" :disabled="true" label="所在地区" placeholder="请选择省、市、区"
- right-icon="arrow-right" required>
- </u-field>
- </view>
- <view class="apply-form-item" @click="getLocation()">
- <u-field v-model="dw" :disabled="true" label="所在地址" placeholder="请选择地址" right-icon="arrow-right"
- required>
- </u-field>
- </view>
- <!-- 上传图片 -->
- <view class="apply-form-item">
- <u-field label="营业执照" label-width="160" placeholder="请上传营业执照及行业相关资质证明" :border-bottom="false"
- required disabled />
- <view>
- <u-upload ref="uUpload" :show-progress="false" :header="{token: $store.getters.token}"
- :max-count="10" width="150" height="150" :action="action" upload-text="上传图片"
- @on-success="onSuccess" @on-remove="onRemove" />
- </view>
- <view class="muted m-t-20 m-b-30">支持jpg、png、jpeg格式的图片,最多可上传10张</view>
- </view>
- <view class="apply-form-item">
- <u-field label="门店头图" label-width="160" placeholder="请上传门店头图" :border-bottom="false" required
- disabled />
- <view>
- <u-upload ref="uUpload" :show-progress="false" :header="{token: $store.getters.token}"
- :max-count="5" width="150" height="150" :action="action" upload-text="上传图片"
- @on-success="onSuccesstt" @on-remove="onRemovett" />
- </view>
- <view class="muted m-t-20 m-b-30">支持jpg、png、jpeg格式的图片,最多可上传5张</view>
- </view>
- <!-- 同意协议 -->
- <view class="apply-form-item flex">
- <u-checkbox shape="circle" :active-color="colorConfig.primary" v-model="isAgree">
- <text class="sm">已阅读并同意</text>
- </u-checkbox>
- <router-link :to="{path: '/bundle/pages/server_explan/server_explan', query: {type: 3}}">
- <text class="primary sm">《入驻协议》</text>
- </router-link>
- </view>
- <!-- 提交申请 -->
- <view style="padding: 30rpx 20rpx 30rpx 0;">
- <button type="primary" size="lg" class="br60" @tap="onSubmit">提交申请</button>
- </view>
- <!-- 查阅记录 -->
- <router-link to="/bundle/pages/settled_recode/settled_recode">
- <view class="flex row-center muted">
- <u-icon name="order" size="32" />
- <view class="m-l-10">查看提交记录</view>
- </view>
- </router-link>
- </view>
- </view>
- <u-select v-model="showRegion" mode="mutil-column-auto" @confirm="regionChange" :list="lists"></u-select>
- </view>
- <view class="shop-show" v-else>
- <view class="top" :style="{
- backgroundImage:'url(' + (shopData.background) + ')'
- }">
- <view class="wrap">
- <image :src="shopData.logo" mode="" class="logo"></image>
- <view class="shop-info">
- <view class="name">
- {{shopData.name}}
- </view>
- <view class="tags">
- {{shopData.type_desc}}
- </view>
- </view>
- </view>
- <view class="num-data">
- <!-- <view class="item text-center">
- <view class="num">
- {{shopData.on_sale_count}}
- </view>
- <view class="desc">
- 在售总数
- </view>
- </view> -->
- <view class="item text-center">
- <view class="num">
- {{shopData.follow_num}}
- </view>
- <view class="desc">
- 粉丝数
- </view>
- </view>
- <view class="item text-center">
- <view class="num">
- {{shopData.score}}
- </view>
- <view class="desc">
- 店铺评分
- </view>
- </view>
- </view>
- </view>
- <view class="content">
- <view class="title">
- 恭喜您已成为入驻商家
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getShopCategory,
- shopApply
- } from "@/api/shop"
- import {
- baseURL
- } from '@/config/app'
- import {
- sendSms
- } from '@/api/app'
- import {
- SMSType
- } from '@/utils/type'
- import {
- mapGetters,
- mapActions
- } from 'vuex'
- import {
- copy
- } from '@/utils/tools'
- import {
- shopApplyDetail,
- getShopInfo
- } from '@/api/shop'
- import area from '@/utils/area'
- export default {
- data() {
- return {
- isAgree: false,
- // 表单数据
- form: {
- cid: 35,
- clabel: '',
- name: '',
- nickname: '',
- mobile: '',
- account: '',
- password: '123456',
- code: '',
- province_id: '',
- city_id: '',
- district_id: '',
- longitude: '',
- latitude: ''
- },
- showRegion: false,
- codeTips: '',
- shopCategory: [],
- showPop: false,
- action: baseURL + '/api/file/formimage',
- fileList: [],
- images: [],
- shopData: {},
- lists: [],
- region: '',
- dw: '',
- }
- },
- onLoad() {
- this.getShopCategoryFun()
- if (this.userInfo.shop_id != 0) {
- this.shopDetail()
- }
- this.$nextTick(() => {
- this.lists = area
- console.log(area);
- })
- },
- methods: {
- ...mapActions(['getUser']),
- async getShopCategoryFun() {
- const {
- code,
- data
- } = await getShopCategory()
- if (code == 1) {
- this.shopCategory = data
- }
- },
- getLocation() {
- console.log('选择当前位置');
- let obj = this;
- uni.chooseLocation({
- success: function(res) {
- console.log('位置名称:' + res.name);
- console.log('详细地址:' + res.address);
- console.log('纬度:' + res.latitude);
- console.log('经度:' + res.longitude);
- obj.form.latitude = res.latitude;
- obj.form.longitude = res.longitude;
- if (res.address) {
- obj.dw = res.address;
- } else {
- obj.dw = res.name;
- }
- }
- });
- },
- sendSmsFun() {
- if (!this.$refs.uCode.canGetCode) return
- if (!this.form.mobile) {
- this.$toast({
- title: '请填写手机号信息'
- })
- return;
- }
- sendSms({
- mobile: this.form.mobile,
- key: SMSType.SJSQYZ
- }).then(res => {
- if (res.code == 1) {
- this.$toast({
- title: res.msg
- });
- this.$refs.uCode.start();
- }
- })
- },
- codeChange(tip) {
- this.codeTips = tip
- },
- regionChange(region) {
- this.form.province_id = region[0].value;
- this.form.city_id = region[1].value;
- this.form.district_id = region[2].value;
- this.region = region[0].label + " " + region[1].label + " " + region[2].label
- },
- // 提交表单
- async onSubmit() {
- const {
- form,
- isAgree,
- fileList,
- images
- } = this
- const submitObj = {
- ...form,
- license: fileList,
- images: images
- }
- delete submitObj.clabel
- submitObj.account = submitObj.mobile
- console.log(submitObj, '123456');
- if (!submitObj.city_id) {
- return uni.showToast({
- title: '请选择省市区',
- duration: 1500,
- icon: 'none'
- })
- }
- if (!submitObj.latitude) {
- return uni.showToast({
- title: '请选择地址',
- duration: 1500,
- icon: 'none'
- })
- }
- if (!isAgree) return this.$toast({
- title: '请先同意《入驻协议》'
- })
- const {
- data,
- code,
- msg
- } = await shopApply(submitObj)
- if (code == 1) {
- this.$toast({
- title: msg
- })
- setTimeout(() => {
- this.$Router.replace({
- path: '/bundle/pages/settled_result/settled_result',
- query: {
- id: data.id
- }
- })
- }, 1000)
- }
- },
- confirmSelect(e) {
- const {
- value,
- label
- } = e[0]
- this.form.cid = value
- this.form.clabel = label
- },
- onSuccess(e) {
- this.fileList.push(e.data.base_uri)
- },
- onRemove(index) {
- this.fileList.splice(index, 1)
- console.log(index)
- },
- onSuccesstt(e) {
- this.images.push(e.data.base_uri)
- },
- onRemovett(index) {
- this.images.splice(index, 1)
- console.log(index)
- },
- async shopDetail() {
- const {
- code,
- data
- } = await getShopInfo({
- shop_id: this.userInfo.shop_id
- })
- if (code == 1) {
- console.log(data)
- this.shopData = data
- }
- },
- onCopy() {
- copy(this.appConfig.base_domain + 'shop/')
- },
- },
- computed: {
- ...mapGetters(["userInfo", "appConfig"]),
- }
- }
- </script>
- <style lang="scss">
- page {
- background: #fff;
- }
- .store-settled {
- background-color: #FA844C;
- min-height: 100vh;
- background-image: url(../../static/store_recruitment_bg.png);
- background-repeat: no-repeat;
- background-size: 100% auto;
- overflow: hidden;
- .content {
- margin-top: 320rpx;
- padding: 0 20rpx 31rpx;
- .apply-form {
- border-radius: 8px;
- padding: 20rpx 0 30rpx 26rpx;
- .apply-form-item {
- .send-code-btn {
- height: 56rpx;
- width: 188rpx;
- border: 1rpx solid $-color-primary;
- }
- }
- .primary-btn {
- width: 100%;
- height: 88rpx;
- background-color: $-color-primary;
- }
- }
- }
- // .pop-categories {
- // .reason-item {
- // padding: 24rpx 20rpx;
- // .reason-desc {
- // line-height: 46rpx;
- // }
- // }
- // }
- }
- .shop-show {
- .top {
- width: 100%;
- height: 300rpx;
- background-size: 100% 100%;
- padding: 40rpx 30rpx;
- box-sizing: border-box;
- .wrap {
- display: flex;
- align-items: center;
- color: #fff;
- .logo {
- width: 120rpx;
- height: 120rpx;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .name {
- font-size: 40rpx;
- line-height: 60rpx;
- font-weight: bold;
- }
- .tags {
- font-size: 28rpx;
- line-height: 60rpx;
- }
- }
- .num-data {
- display: flex;
- justify-content: space-between;
- align-items: center;
- color: #fff;
- margin-top: 40rpx;
- .item {
- flex-basis: 100%;
- .num {
- font-weight: bold;
- font-size: 36rpx;
- line-height: 48rpx;
- }
- .desc {
- font-size: 24rpx;
- }
- }
- }
- }
- .content {
- background: transparent;
- padding: 40rpx 30rpx;
- .title {
- text-align: center;
- font-weight: bold;
- font-size: 48rpx;
- margin-bottom: 40rpx;
- }
- .cont {
- font-size: 32rpx;
- text-align: center;
- line-height: 60rpx;
- .admin_url {
- font-weight: bold;
- text-align: center;
- }
- button {
- width: 45%;
- background: linear-gradient(97deg, #ff5784, #ff2c3c);
- color: #fff;
- border-radius: 50rpx;
- margin: 20rpx auto;
- }
- .tips {
- font-size: 28rpx;
- }
- }
- }
- }
- </style>
|