+51
-49
@@ -1,23 +1,42 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="pkg-join-index">
|
<view class="pkg-join-index">
|
||||||
<image class="img-banner" :src="images.topImage" mode="scaleToFill"/>
|
<image
|
||||||
|
:src="images.topImage"
|
||||||
<!-- <view class="box flex flex-col ai-center">-->
|
class="img-banner"
|
||||||
<!-- <image class="img-title" :src="webUrl+'/20230413103123003753.png'" mode="scaleToFill"/>-->
|
mode="scaleToFill"
|
||||||
<!-- </view>-->
|
/>
|
||||||
|
<image
|
||||||
<image class="img-item" mode="widthFix" :src="images.goodSupplierImage"
|
v-show="partnerType === 'province_partner' || partnerType === ''"
|
||||||
@click="goto('goods_supplier')" v-show="partnerType==='province_partner'||partnerType===''"/>
|
:src="images.goodSupplierImage"
|
||||||
<image class="img-item" mode="widthFix" :src="images.wenwanSupplierImage"
|
class="img-item"
|
||||||
@click="goto('wenwan_supplier')" v-show="partnerType==='pioneer'||partnerType===''"/>
|
mode="widthFix"
|
||||||
<image class="img-item" mode="widthFix" :src="images.hotelImage"
|
@click="goto('goods_supplier')"
|
||||||
@click="goto('shop')" v-show="partnerType==='pioneer'||partnerType===''"/>
|
/>
|
||||||
<image class="img-item" mode="widthFix" :src="images.wholesalerImage" @click="goto('wholesaler')"/>
|
<image
|
||||||
|
v-show="partnerType === 'pioneer' || partnerType === ''"
|
||||||
|
:src="images.wenwanSupplierImage"
|
||||||
|
class="img-item"
|
||||||
|
mode="widthFix"
|
||||||
|
@click="goto('wenwan_supplier')"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
v-show="partnerType === 'pioneer' || partnerType === ''"
|
||||||
|
:src="images.hotelImage"
|
||||||
|
class="img-item"
|
||||||
|
mode="widthFix"
|
||||||
|
@click="goto('shop')"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
:src="images.wholesalerImage"
|
||||||
|
class="img-item"
|
||||||
|
mode="widthFix"
|
||||||
|
@click="goto('wholesaler')"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getImages, getShopData} from '@/api/join'
|
import { getImages, getShopData } from '@/api/join'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
export default {
|
export default {
|
||||||
name: 'PkgJoinIndex',
|
name: 'PkgJoinIndex',
|
||||||
@@ -37,63 +56,46 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.partnerId = options.partnerId || ''
|
this.partnerId = options.partnerId || ''
|
||||||
getImages().then(({data}) => this.images = data);
|
getImages().then(({data}) => this.images = data)
|
||||||
getShopData(this.partnerId).then(({data}) => {
|
getShopData(this.partnerId).then(({data}) => {
|
||||||
this.partnerType = data.partnerType;
|
this.partnerType = data.partnerType
|
||||||
this.hotelId = data.hotelId;
|
this.hotelId = data.hotelId
|
||||||
this.hasHotel = data.hasHotel;
|
this.hasHotel = data.hasHotel
|
||||||
this.hasSupplier = data.hasSupplier;
|
this.hasSupplier = data.hasSupplier
|
||||||
this.hasWholesaler = data.hasWholesaler;
|
this.hasWholesaler = data.hasWholesaler
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goto(target) {
|
goto(target) {
|
||||||
|
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case "goods_supplier":
|
case 'goods_supplier':
|
||||||
if (this.hasSupplier === 1) {
|
if (this.hasSupplier === 1) {
|
||||||
this.$global.goSupplierMini();
|
this.$global.goSupplierMini()
|
||||||
// uni.showToast({
|
|
||||||
// title: "您已成为供应商/员工,无需重复申请",
|
|
||||||
// icon: "none"
|
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
|
this.$yrouter.push(`/pkg_join/views/supplier?type=goods_supplier&partnerId=${this.partnerId}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case "wenwan_supplier":
|
case 'wenwan_supplier':
|
||||||
if (this.hasSupplier === 1) {
|
if (this.hasSupplier === 1) {
|
||||||
this.$global.goSupplierMini();
|
this.$global.goSupplierMini()
|
||||||
// uni.showToast({
|
|
||||||
// title: "您已成为供应商/员工,无需重复申请",
|
|
||||||
// icon: "none"
|
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
|
this.$yrouter.push(`/pkg_join/views/supplier?type=wenwan_supplier&partnerId=${this.partnerId}`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case "shop":
|
case 'shop':
|
||||||
if (this.hasHotel === 1) {
|
if (this.hasHotel === 1) {
|
||||||
// uni.showToast({
|
this.$yrouter.push('/pagesInn/inn/innHome?id='+this.hotelId)
|
||||||
// title: "您已开通店铺,无需重复申请",
|
|
||||||
// icon: "none"
|
|
||||||
// })
|
|
||||||
this.$yrouter.push("/pagesInn/inn/innHome?id="+this.hotelId)
|
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
|
this.$yrouter.push('/pkg_join/views/shop?partnerId=' + this.partnerId)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
case "wholesaler":
|
case 'wholesaler':
|
||||||
if (this.hasWholesaler === 1) {
|
if (this.hasWholesaler === 1) {
|
||||||
this.$global.goSupplierMini();
|
this.$global.goSupplierMini()
|
||||||
// uni.showToast({
|
|
||||||
// title: "您已成为采购批发商,无需重复申请",
|
|
||||||
// icon: "none"
|
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.$yrouter.push(`/pkg_join/views/wholesaler`)
|
this.$yrouter.push(`/pkg_join/views/wholesaler`)
|
||||||
}
|
}
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+228
-156
@@ -1,18 +1,37 @@
|
|||||||
<template>
|
<template>
|
||||||
<u--form :model="form" errorType="toast" labelWidth="216rpx" ref="shopForm">
|
<u--form
|
||||||
<view class="box-state" v-if="stateTitle && isDraft!==1">
|
ref="shopForm"
|
||||||
<u-alert :center="stateType==='primary'" :title="stateTitle" :type="stateType"/>
|
:model="form"
|
||||||
|
errorType="toast"
|
||||||
|
labelWidth="216rpx"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="stateTitle && isDraft !== 1"
|
||||||
|
class="box-state"
|
||||||
|
>
|
||||||
|
<u-alert
|
||||||
|
:center="stateType === 'primary'"
|
||||||
|
:title="stateTitle"
|
||||||
|
:type="stateType"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<u-cell-group
|
||||||
<u-cell-group title="店铺基本信息" :border="false" :customStyle="{'fontSize':'40rpx'}">
|
:border="false"
|
||||||
|
:customStyle="{'fontSize':'40rpx'}"
|
||||||
|
title="店铺基本信息"
|
||||||
|
>
|
||||||
<u-form-item prop="name">
|
<u-form-item prop="name">
|
||||||
<u-cell title="店铺名称" :border="false">
|
<u-cell title="店铺名称" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.name" border="none" placeholder="请填写店铺名称"/>
|
<u-input
|
||||||
|
v-model="form.name"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写店铺名称"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -24,6 +43,7 @@
|
|||||||
<template #value>
|
<template #value>
|
||||||
<u-radio-group
|
<u-radio-group
|
||||||
v-model="form.coverType"
|
v-model="form.coverType"
|
||||||
|
:disabled="reviewing"
|
||||||
placement="row"
|
placement="row"
|
||||||
>
|
>
|
||||||
<u-radio
|
<u-radio
|
||||||
@@ -94,22 +114,21 @@
|
|||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="pics">
|
<u-form-item prop="pics">
|
||||||
<u-cell title="店铺图片" :border="false">
|
<u-cell title="店铺图片" :border="false">
|
||||||
<template #label>
|
<template #label>
|
||||||
<u-upload
|
<u-upload
|
||||||
:fileList="pics"
|
:fileList="pics"
|
||||||
@afterRead="afterRead"
|
:maxCount="9"
|
||||||
@delete="deletePic"
|
:disabled="reviewing"
|
||||||
name="pics"
|
name="pics"
|
||||||
multiple
|
multiple
|
||||||
:maxCount="9"
|
@afterRead="afterRead"
|
||||||
></u-upload>
|
@delete="deletePic"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="logo">
|
<u-form-item prop="logo">
|
||||||
<u-cell title="店铺logo" :border="false">
|
<u-cell title="店铺logo" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -119,13 +138,19 @@
|
|||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="box-upload" @click="chooseLogoImg('logo')">
|
<view class="box-upload" @click="chooseLogoImg('logo')">
|
||||||
<view class="btn-upload" v-if="form.logo.length===0 || form.logo==null">上传图片</view>
|
<view
|
||||||
<image class="img-preview" :src="form.logo" v-else/>
|
v-if="!form.logo"
|
||||||
|
class="btn-upload"
|
||||||
|
>上传图片</view>
|
||||||
|
<image
|
||||||
|
v-else
|
||||||
|
:src="form.logo"
|
||||||
|
class="img-preview"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<view class="full-title">
|
<view class="full-title">
|
||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
@@ -137,17 +162,17 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #label>
|
<template #label>
|
||||||
<u-upload
|
<u-upload
|
||||||
:fileList="quaPics"
|
:maxCount="9"
|
||||||
@afterRead="quaAfterRead"
|
:fileList="quaPics"
|
||||||
@delete="quaDeletePic"
|
:disabled="reviewing"
|
||||||
name="quaPics"
|
name="quaPics"
|
||||||
multiple
|
multiple
|
||||||
:maxCount="9"
|
@afterRead="quaAfterRead"
|
||||||
></u-upload>
|
@delete="quaDeletePic"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-form-item prop="typeText">
|
<u-form-item prop="typeText">
|
||||||
<u-cell title="店铺类型" :border="false" isLink>
|
<u-cell title="店铺类型" :border="false" isLink>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -157,6 +182,7 @@
|
|||||||
<picker
|
<picker
|
||||||
:value="indexType"
|
:value="indexType"
|
||||||
:range="columnsType"
|
:range="columnsType"
|
||||||
|
:disabled="reviewing"
|
||||||
mode=selector
|
mode=selector
|
||||||
range-key="name"
|
range-key="name"
|
||||||
class="picker"
|
class="picker"
|
||||||
@@ -174,22 +200,31 @@
|
|||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.contact" border="none" placeholder="请填写姓名"/>
|
<u-input
|
||||||
|
v-model="form.contact"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写姓名"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="phone">
|
<u-form-item prop="phone">
|
||||||
<u-cell title="联系方式" :border="false">
|
<u-cell title="联系方式" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.phone" border="none" placeholder="请填写联系方式"/>
|
<u-input
|
||||||
|
v-model="form.phone"
|
||||||
|
:disabled="reviewing"
|
||||||
|
type="number"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写联系方式"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="captcha">
|
<u-form-item prop="captcha">
|
||||||
<u-cell title="验证码" :border="false">
|
<u-cell title="验证码" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -198,9 +233,14 @@
|
|||||||
<template #value>
|
<template #value>
|
||||||
<view class="captcha-wrap">
|
<view class="captcha-wrap">
|
||||||
<view class="captcha-wrap-input">
|
<view class="captcha-wrap-input">
|
||||||
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码" />
|
<u-input
|
||||||
|
v-model="form.captcha"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写验证码"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="captcha-wrap-ft">
|
<view v-if="!reviewing" class="captcha-wrap-ft">
|
||||||
<u-code
|
<u-code
|
||||||
ref="uCode"
|
ref="uCode"
|
||||||
seconds="30"
|
seconds="30"
|
||||||
@@ -218,7 +258,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="area">
|
<u-form-item prop="area">
|
||||||
<u-cell title="省市区" :border="false" isLink>
|
<u-cell title="省市区" :border="false" isLink>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -226,74 +265,99 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<view class="u-text__value" :class="{'area-item':form.area.length===0}">
|
<view class="u-text__value" :class="{'area-item':form.area.length===0}">
|
||||||
<CitySelect ref="cityselect" :defaultValue="form.area" @callback="result" :items="district"/>
|
<CitySelect
|
||||||
|
ref="cityselect"
|
||||||
|
:defaultValue="form.area"
|
||||||
|
:disabled="reviewing"
|
||||||
|
:items="district"
|
||||||
|
@callback="result"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="address">
|
<u-form-item prop="address">
|
||||||
<u-cell title="详细地址" :border="false">
|
<u-cell title="详细地址" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.address" border="none" placeholder="请填写详细地址"/>
|
<u-input
|
||||||
|
v-model="form.address"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写详细地址"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="position">
|
<u-form-item prop="position">
|
||||||
<u-cell title="地理定位选择" :border="false" isLink @click="chooLocation">
|
<u-cell
|
||||||
|
title="地理定位选择"
|
||||||
|
:border="false"
|
||||||
|
isLink
|
||||||
|
@click="chooLocation"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u--text :text="form.position" v-if="form.position"></u--text>
|
<u--text v-if="form.position" :text="form.position"></u--text>
|
||||||
<u--text text="请选择" color="#c0c4cc" v-else></u--text>
|
<u--text v-else text="请选择" color="#c0c4cc"></u--text>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="content">
|
<u-form-item prop="content">
|
||||||
<u-cell title="一句话介绍" :border="false">
|
<u-cell title="一句话介绍" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
|
|
||||||
<view class="content-section">
|
<view class="content-section">
|
||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="line">
|
<view class="line">
|
||||||
<u-input v-model="form.content" border="none" placeholder="请填写一句话..."/>
|
<u-input
|
||||||
|
v-model="form.content"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写一句话..."
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</view>
|
</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<view style="height: 100rpx;width: 100%;"></view>
|
<view style="height: 100rpx;width: 100%;"></view>
|
||||||
<!-- <u-form-item prop="desc">
|
|
||||||
<view class="content-section">
|
|
||||||
<u-cell title="店铺简介" :border="false">
|
|
||||||
<template #label>
|
|
||||||
<view class="line">
|
|
||||||
<u--textarea v-model="form.desc" border="none" placeholder="请填写店铺简介..."></u--textarea>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
</u-cell>
|
|
||||||
</view>
|
|
||||||
</u-form-item> -->
|
|
||||||
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请</view>
|
<view
|
||||||
<view class="btn-submit" @click="onSubmit" v-else>提交申请</view>
|
v-if="reviewStatus === 0 && isDraft !== 1"
|
||||||
|
class="btn-submit btn-remove"
|
||||||
<u-modal :show="showRemove" content="您确定撤销申请吗?" showCancelButton @cancel="changeRemove(false)"
|
@click="changeRemove(true)"
|
||||||
@confirm="onRemove"></u-modal>
|
>
|
||||||
|
撤销申请
|
||||||
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
|
</view>
|
||||||
|
<view
|
||||||
|
v-else
|
||||||
|
class="btn-submit"
|
||||||
|
@click="onSubmit"
|
||||||
|
>
|
||||||
|
提交申请
|
||||||
|
</view>
|
||||||
|
<u-modal
|
||||||
|
:show="showRemove"
|
||||||
|
content="您确定撤销申请吗?"
|
||||||
|
showCancelButton
|
||||||
|
@cancel="changeRemove(false)"
|
||||||
|
@confirm="onRemove"
|
||||||
|
/>
|
||||||
|
<u-popup
|
||||||
|
:show="show"
|
||||||
|
mode="center"
|
||||||
|
round="10"
|
||||||
|
closeable
|
||||||
|
@close="show=false"
|
||||||
|
>
|
||||||
<view class="popup-body">
|
<view class="popup-body">
|
||||||
<view class="tc bold">入驻申请须知</view>
|
<view class="tc bold">入驻申请须知</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
@@ -307,34 +371,39 @@
|
|||||||
<text>我已仔细阅读并同意</text>
|
<text>我已仔细阅读并同意</text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<u-button type="error" text="确定" :disabled="!isAgree" @click="save"></u-button>
|
<u-button
|
||||||
|
type="error"
|
||||||
|
text="确定"
|
||||||
|
:disabled="!isAgree"
|
||||||
|
@click="save"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</u--form>
|
</u--form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CitySelect from "@/components/CitySelect"
|
import CitySelect from '@/components/CitySelect'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
import {
|
import {
|
||||||
getShopData,
|
getShopData,
|
||||||
getShopInfo,
|
getShopInfo,
|
||||||
removeApply,
|
removeApply,
|
||||||
saveShop
|
saveShop
|
||||||
} from "@/api/join"
|
} from '@/api/join'
|
||||||
import {
|
import {
|
||||||
getCity,
|
getCity,
|
||||||
registerVerify
|
registerVerify
|
||||||
} from "@/api/user"
|
} from '@/api/user'
|
||||||
import {
|
import {
|
||||||
chooseImage,
|
chooseImage,
|
||||||
moreImage,
|
moreImage,
|
||||||
uploadImage,
|
uploadImage,
|
||||||
chooseVideoToUpload
|
chooseVideoToUpload
|
||||||
} from "@/utils"
|
} from '@/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PkgJoinShop",
|
name: 'PkgJoinShop',
|
||||||
components: {
|
components: {
|
||||||
CitySelect
|
CitySelect
|
||||||
},
|
},
|
||||||
@@ -344,7 +413,7 @@ export default {
|
|||||||
partnerId: null,
|
partnerId: null,
|
||||||
pics: [],
|
pics: [],
|
||||||
quaPics: [],
|
quaPics: [],
|
||||||
tips: '',
|
tips: '获取验证码',
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
cover: '',
|
cover: '',
|
||||||
@@ -447,45 +516,56 @@ export default {
|
|||||||
reviewStatus: null,
|
reviewStatus: null,
|
||||||
stateTitle: '',
|
stateTitle: '',
|
||||||
stateType: 'primary',
|
stateType: 'primary',
|
||||||
isPass: false,
|
// 是否为审核中
|
||||||
|
reviewing: false,
|
||||||
pageKeyId: Object.freeze('merchantApplyHotel')
|
pageKeyId: Object.freeze('merchantApplyHotel')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.partnerId = options.partnerId;
|
this.partnerId = options.partnerId
|
||||||
this.init();
|
this.init()
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.shopForm.setRules(this.rules);
|
this.$refs.shopForm.setRules(this.rules)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeRemove(state){
|
changeRemove(state){
|
||||||
this.showRemove=state
|
this.showRemove = state
|
||||||
},
|
},
|
||||||
codeChange(text) {
|
codeChange(text) {
|
||||||
this.tips = text;
|
this.tips = text
|
||||||
},
|
},
|
||||||
getCode() {
|
getCode() {
|
||||||
if (this.form.phone.length === 0) return;
|
if (this.reviewing) return
|
||||||
|
if (this.form.phone.length === 0) {
|
||||||
|
uni.$u.toast('请输入位手机号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.form.phone.length !== 11) {
|
||||||
|
uni.$u.toast('请输入11位手机号')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.$refs.uCode.canGetCode) {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在获取验证码'
|
title: '正在获取验证码'
|
||||||
})
|
})
|
||||||
registerVerify({phone: this.form.phone, type: "merchantApply"}).then(() => {
|
registerVerify({
|
||||||
uni.hideLoading();
|
phone: this.form.phone,
|
||||||
|
type: 'merchantApply'
|
||||||
|
}).then(() => {
|
||||||
|
uni.hideLoading()
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
uni.$u.toast('验证码已发送');
|
uni.$u.toast('验证码已发送')
|
||||||
// 通知验证码组件内部开始倒计时
|
// 通知验证码组件内部开始倒计时
|
||||||
this.$refs.uCode.start();
|
this.$refs.uCode.start()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
uni.$u.toast(err.msg);
|
uni.$u.toast(err.msg)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast('倒计时结束后再发送');
|
uni.$u.toast('倒计时结束后再发送')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
getCity().then(({data}) => {
|
getCity().then(({data}) => {
|
||||||
this.district = data
|
this.district = data
|
||||||
@@ -500,30 +580,30 @@ export default {
|
|||||||
initInfo() {
|
initInfo() {
|
||||||
getShopInfo().then(({data}) => {
|
getShopInfo().then(({data}) => {
|
||||||
if (data.partnerId != null) {
|
if (data.partnerId != null) {
|
||||||
this.partnerId = data.partnerId;
|
this.partnerId = data.partnerId
|
||||||
}
|
}
|
||||||
this.isDraft = data.isDraft;
|
this.isDraft = data.isDraft
|
||||||
this.reviewStatus = data.reviewStatus;
|
this.reviewStatus = data.reviewStatus
|
||||||
|
|
||||||
switch (data.reviewStatus) {
|
switch (data.reviewStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
this.stateTitle = "审核中";
|
this.stateTitle = '审核中'
|
||||||
this.stateType = "primary";
|
this.stateType = 'primary'
|
||||||
break;
|
this.reviewing = true
|
||||||
|
break
|
||||||
case 1:
|
case 1:
|
||||||
this.isPass = true;
|
this.reviewing = false
|
||||||
break;
|
break
|
||||||
case 2:
|
case 2:
|
||||||
this.stateTitle = "审核驳回:" + data.reviewMsg;
|
this.stateTitle = '审核驳回:' + data.reviewMsg
|
||||||
this.stateType = "error";
|
this.stateType = 'error'
|
||||||
break;
|
this.reviewing = false
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.hotelInfo) {
|
if (data.hotelInfo) {
|
||||||
// 店铺图片
|
// 店铺图片
|
||||||
this.pics = []
|
this.pics = []
|
||||||
this.form = data.hotelInfo
|
this.form = data.hotelInfo
|
||||||
const picsTemp = this.form.pics.split(",")
|
const picsTemp = this.form.pics.split(',')
|
||||||
if (picsTemp.length > 0) {
|
if (picsTemp.length > 0) {
|
||||||
picsTemp.map(item => {
|
picsTemp.map(item => {
|
||||||
if (item) {
|
if (item) {
|
||||||
@@ -533,7 +613,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// 商家资质
|
// 商家资质
|
||||||
this.quaPics = []
|
this.quaPics = []
|
||||||
const quaPicsTemp = this.form.qualification.split(",")
|
const quaPicsTemp = this.form.qualification.split(',')
|
||||||
if (quaPicsTemp.length > 0) {
|
if (quaPicsTemp.length > 0) {
|
||||||
quaPicsTemp.map(item => {
|
quaPicsTemp.map(item => {
|
||||||
if (item) {
|
if (item) {
|
||||||
@@ -545,57 +625,55 @@ export default {
|
|||||||
if (this.indexType !== -1) {
|
if (this.indexType !== -1) {
|
||||||
this.form.typeText = this.columnsType[this.indexType].name
|
this.form.typeText = this.columnsType[this.indexType].name
|
||||||
}
|
}
|
||||||
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
|
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
|
||||||
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
|
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseLogoImg(target) {
|
chooseLogoImg(target) {
|
||||||
|
if (this.reviewing) return
|
||||||
chooseImage(img => {
|
chooseImage(img => {
|
||||||
this.form[target] = img;
|
this.form[target] = img
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
chooseLogoVideo() {
|
chooseLogoVideo() {
|
||||||
|
if (this.reviewing) return
|
||||||
chooseVideoToUpload(path => {
|
chooseVideoToUpload(path => {
|
||||||
this.form.coverVideo = path
|
this.form.coverVideo = path
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseShopImg() {
|
chooseShopImg() {
|
||||||
let that = this;
|
if (this.reviewing) return
|
||||||
let count = 0;
|
const _this = this
|
||||||
|
let count = 0
|
||||||
moreImage(9, (img, total) => {
|
moreImage(9, (img, total) => {
|
||||||
if (img) that.pics.push(img);
|
if (img) {
|
||||||
count++;
|
_this.pics.push(img)
|
||||||
|
count++
|
||||||
|
}
|
||||||
if (count === total) {
|
if (count === total) {
|
||||||
that.form.pics = that.pics.join(",");
|
_this.form.pics = _this.pics.join(',')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除图片
|
// 删除图片
|
||||||
deletePic(event) {
|
deletePic(event) {
|
||||||
this[`${event.name}`].splice(event.index, 1)
|
this[`${event.name}`].splice(event.index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRead(event) {
|
afterRead(event) {
|
||||||
let that = this;
|
const _this = this
|
||||||
if (event.file.length > 0) {
|
if (event.file.length > 0) {
|
||||||
event.file.map(item => {
|
event.file.map(item => {
|
||||||
uploadImage(item.url, img => {
|
uploadImage(item.url, img => {
|
||||||
that.pics.push({url: img})
|
_this.pics.push({url: img})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除图片
|
|
||||||
quaDeletePic(event) {
|
quaDeletePic(event) {
|
||||||
this[`${event.name}`].splice(event.index, 1)
|
this[`${event.name}`].splice(event.index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
quaAfterRead(event) {
|
quaAfterRead(event) {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (event.file.length > 0) {
|
if (event.file.length > 0) {
|
||||||
@@ -616,73 +694,68 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 省市区
|
// 省市区
|
||||||
result(values) {
|
result(values) {
|
||||||
this.address = {
|
this.address = {
|
||||||
province: values.province.name || "",
|
province: values.province.name || '',
|
||||||
city: values.city.name || "",
|
city: values.city.name || '',
|
||||||
district: values.district.name || "",
|
district: values.district.name || '',
|
||||||
provinceId: values.province.id,
|
provinceId: values.province.id,
|
||||||
cityId: values.city.id,
|
cityId: values.city.id,
|
||||||
areaId: values.district.id
|
areaId: values.district.id
|
||||||
};
|
}
|
||||||
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`;
|
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`
|
||||||
this.form.provinceId = values.province.id;
|
this.form.provinceId = values.province.id
|
||||||
this.form.cityId = values.city.id;
|
this.form.cityId = values.city.id
|
||||||
this.form.areaId = values.district.id;
|
this.form.areaId = values.district.id
|
||||||
},
|
},
|
||||||
|
|
||||||
// 定位
|
// 定位
|
||||||
chooLocation() {
|
chooLocation() {
|
||||||
let that = this;
|
const _this = this
|
||||||
uni.chooseLocation({
|
uni.chooseLocation({
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
that.form.address = res.address;
|
_this.form.address = res.address
|
||||||
that.form.longitude = that.$forceToDecimal(res.longitude, 6);
|
_this.form.longitude = _this.$forceToDecimal(res.longitude, 6)
|
||||||
that.form.latitude = that.$forceToDecimal(res.latitude, 6);
|
_this.form.latitude = _this.$forceToDecimal(res.latitude, 6)
|
||||||
that.form.position = that.$forceToDecimal(res.longitude, 6) + ',' + that.$forceToDecimal(res.latitude, 6);
|
_this.form.position = _this.$forceToDecimal(res.longitude, 6) + ',' + _this.$forceToDecimal(res.latitude, 6)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if (this.reviewStatus === 0) return;
|
if (this.reviewStatus === 0) return
|
||||||
if (this.quaPics.length === 0) {
|
if (this.quaPics.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请上传营业执照",
|
title: '请上传营业执照',
|
||||||
icon: "none"
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
this.$refs.shopForm.validate().then(res => {
|
this.$refs.shopForm.validate().then(res => {
|
||||||
// 校验通过
|
// 校验通过
|
||||||
this.show = true;
|
this.show = true
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
// 校验失败
|
// 校验失败
|
||||||
|
console.log(errors)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onRemove() {
|
onRemove() {
|
||||||
removeApply().then(res => {
|
removeApply().then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
success: () => {
|
success: () => {
|
||||||
this.showRemove = false;
|
this.showRemove = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack()
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeAgree(event) {
|
changeAgree(event) {
|
||||||
this.isAgree = event.detail.value.length > 0
|
this.isAgree = event.detail.value.length > 0
|
||||||
},
|
},
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.form.pics = ''
|
this.form.pics = ''
|
||||||
const picsLength = this.pics.length
|
const picsLength = this.pics.length
|
||||||
@@ -693,7 +766,6 @@ export default {
|
|||||||
})
|
})
|
||||||
this.form.pics = tempArr.join(',')
|
this.form.pics = tempArr.join(',')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.form.qualification = ''
|
this.form.qualification = ''
|
||||||
const quaPicsLength = this.quaPics.length
|
const quaPicsLength = this.quaPics.length
|
||||||
if (quaPicsLength > 0) {
|
if (quaPicsLength > 0) {
|
||||||
@@ -710,20 +782,20 @@ export default {
|
|||||||
saveShop(postData, this.partnerId).then(res => {
|
saveShop(postData, this.partnerId).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "您的入驻申请已提交成功,请耐心等待审核",
|
title: '您的入驻申请已提交成功,请耐心等待审核',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
success: () => {
|
success: () => {
|
||||||
this.initInfo();
|
this.initInfo()
|
||||||
this.show = false;
|
this.show = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
success: () => {
|
success: () => {
|
||||||
this.show = false;
|
this.show = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+378
-318
File diff suppressed because it is too large
Load Diff
+215
-130
@@ -1,82 +1,122 @@
|
|||||||
<template>
|
<template>
|
||||||
<u--form :model="form" errorType="toast" labelWidth="216rpx" ref="wholesalerForm">
|
<u--form
|
||||||
<view class="box-state" v-if="stateTitle && isDraft!==1 && applyType === 4">
|
ref="wholesalerForm"
|
||||||
<u-alert :center="stateType==='primary'" :title="stateTitle" :type="stateType"/>
|
:model="form"
|
||||||
|
errorType="toast"
|
||||||
|
labelWidth="216rpx"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="stateTitle && isDraft!==1 && applyType === 4"
|
||||||
|
class="box-state"
|
||||||
|
>
|
||||||
|
<u-alert
|
||||||
|
:center="stateType === 'primary'"
|
||||||
|
:title="stateTitle"
|
||||||
|
:type="stateType"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
<u-cell-group
|
||||||
<u-cell-group title="采购批发商基本信息" :border="false" :customStyle="{'fontSize':'40rpx'}">
|
:border="false"
|
||||||
|
:customStyle="{'fontSize':'40rpx'}"
|
||||||
|
title="采购批发商基本信息"
|
||||||
|
>
|
||||||
<u-form-item prop="name">
|
<u-form-item prop="name">
|
||||||
<u-cell title="批发商名称" :border="false">
|
<u-cell title="批发商名称" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.name" border="none" placeholder="请填写批发商名称"/>
|
<u-input
|
||||||
|
v-model="form.name"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写批发商名称"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="avatar">
|
<u-form-item prop="avatar">
|
||||||
<u-cell title="头像" :border="false"/>
|
<u-cell title="头像" :border="false"/>
|
||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="box-upload" @click="chooseLogoImg('avatar')">
|
<view class="box-upload" @click="chooseLogoImg('avatar')">
|
||||||
<view class="btn-upload" v-if="form.avatar.length===0">上传图片</view>
|
<view
|
||||||
<image class="img-preview" :src="form.avatar" v-else/>
|
v-if="!form.avatar"
|
||||||
|
class="btn-upload"
|
||||||
|
>上传图片</view>
|
||||||
|
<image
|
||||||
|
v-else
|
||||||
|
:src="form.avatar"
|
||||||
|
class="img-preview"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="contact">
|
<u-form-item prop="contact">
|
||||||
<u-cell title="联系人姓名" :border="false">
|
<u-cell title="联系人姓名" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.contact" border="none" placeholder="请填写联系人姓名"/>
|
<u-input
|
||||||
|
v-model="form.contact"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写姓名"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="phone">
|
<u-form-item prop="phone">
|
||||||
<u-cell title="联系方式" :border="false">
|
<u-cell title="联系方式" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.phone" border="none" placeholder="请填写联系方式"/>
|
<u-input
|
||||||
|
v-model="form.phone"
|
||||||
|
:disabled="reviewing"
|
||||||
|
type="number"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写联系方式"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="captcha">
|
<u-form-item prop="captcha">
|
||||||
<u-cell title="验证码" :border="false">
|
<u-cell title="验证码" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.captcha" border="none" placeholder="请填写验证码">
|
<view class="captcha-wrap">
|
||||||
<template slot="suffix">
|
<view class="captcha-wrap-input">
|
||||||
|
<u-input
|
||||||
|
v-model="form.captcha"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写验证码"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="captcha-wrap-ft">
|
||||||
<u-code
|
<u-code
|
||||||
ref="uCode"
|
ref="uCode"
|
||||||
@change="codeChange"
|
seconds="30"
|
||||||
seconds="30"
|
changeText="X秒重新获取"
|
||||||
changeText="X秒重新获取"
|
@change="codeChange"
|
||||||
></u-code>
|
/>
|
||||||
<u-button
|
<u-button
|
||||||
@tap="getCode"
|
:text="tips"
|
||||||
:text="tips"
|
type="success"
|
||||||
type="success"
|
size="normal"
|
||||||
size="normal"
|
@tap="getCode"
|
||||||
></u-button>
|
/>
|
||||||
</template>
|
</view>
|
||||||
</u-input>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="qualification">
|
<u-form-item prop="qualification">
|
||||||
<view class="licence-section">
|
<view class="licence-section">
|
||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
@@ -92,14 +132,20 @@
|
|||||||
<u-cell :border="false">
|
<u-cell :border="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="box-upload" @click="chooseLogoImg('licence')">
|
<view class="box-upload" @click="chooseLogoImg('licence')">
|
||||||
<view class="btn-upload" v-if="form.qualification.length===0">上传图片</view>
|
<view
|
||||||
<image class="img-preview" :src="form.qualification" v-else/>
|
v-if="!form.qualification"
|
||||||
|
class="btn-upload"
|
||||||
|
>上传图片</view>
|
||||||
|
<image
|
||||||
|
v-else
|
||||||
|
:src="form.qualification"
|
||||||
|
class="img-preview"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</view>
|
</view>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="area">
|
<u-form-item prop="area">
|
||||||
<u-cell title="省市区" :border="false" isLink>
|
<u-cell title="省市区" :border="false" isLink>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -107,30 +153,54 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<view class="u-text__value" :class="{'area-item':form.area.length===0}">
|
<view class="u-text__value" :class="{'area-item':form.area.length===0}">
|
||||||
<CitySelect ref="cityselect" :defaultValue="form.area" @callback="result" :items="district"/>
|
<CitySelect
|
||||||
|
ref="cityselect"
|
||||||
|
:defaultValue="form.area"
|
||||||
|
:disabled="reviewing"
|
||||||
|
:items="district"
|
||||||
|
@callback="result"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
<u-form-item prop="address">
|
<u-form-item prop="address">
|
||||||
<u-cell title="详细地址" :border="false">
|
<u-cell title="详细地址" :border="false">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<text class="required">*</text>
|
<text class="required">*</text>
|
||||||
</template>
|
</template>
|
||||||
<template #value>
|
<template #value>
|
||||||
<u-input v-model="form.address" border="none" placeholder="请填写详细地址"/>
|
<u-input
|
||||||
|
v-model="form.address"
|
||||||
|
:disabled="reviewing"
|
||||||
|
border="none"
|
||||||
|
placeholder="请填写详细地址"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请</view>
|
<view
|
||||||
<view class="btn-submit" @click="onSubmit" v-else>提交申请</view>
|
v-if="reviewStatus === 0 && isDraft !== 1"
|
||||||
|
class="btn-submit btn-remove"
|
||||||
<u-modal :show="showRemove" content="您确定撤销申请吗?" showCancelButton @cancel="changeRemove(false)"
|
@click="changeRemove(true)"
|
||||||
@confirm="onRemove"></u-modal>
|
>
|
||||||
|
撤销申请
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
v-else
|
||||||
|
class="btn-submit"
|
||||||
|
@click="onSubmit"
|
||||||
|
>
|
||||||
|
提交申请
|
||||||
|
</view>
|
||||||
|
<u-modal
|
||||||
|
:show="showRemove"
|
||||||
|
content="您确定撤销申请吗?"
|
||||||
|
showCancelButton
|
||||||
|
@cancel="changeRemove(false)"
|
||||||
|
@confirm="onRemove"
|
||||||
|
/>
|
||||||
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
|
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
|
||||||
<view class="popup-body">
|
<view class="popup-body">
|
||||||
<view class="tc bold">入驻申请须知</view>
|
<view class="tc bold">入驻申请须知</view>
|
||||||
@@ -145,37 +215,42 @@
|
|||||||
<text>我已仔细阅读并同意</text>
|
<text>我已仔细阅读并同意</text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
<u-button type="error" text="确定" :disabled="!isAgree" @click="save"></u-button>
|
<u-button
|
||||||
|
type="error"
|
||||||
|
text="确定"
|
||||||
|
:disabled="!isAgree"
|
||||||
|
@click="save"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
</u--form>
|
</u--form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CitySelect from "@/components/CitySelect";
|
import CitySelect from '@/components/CitySelect'
|
||||||
import {getShopData, getWholesaler, removeApply, saveWholesaler} from "@/api/join";
|
import {getShopData, getWholesaler, removeApply, saveWholesaler} from '@/api/join'
|
||||||
import {getCity, registerVerify} from "@/api/user";
|
import {getCity, registerVerify} from '@/api/user'
|
||||||
import {chooseImage} from "@/utils";
|
import {chooseImage} from '@/utils'
|
||||||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "pkgJoinWholesaler",
|
name: 'pkgJoinWholesaler',
|
||||||
components: {
|
components: {
|
||||||
CitySelect
|
CitySelect
|
||||||
},
|
},
|
||||||
mixins: [pageListenMixins],
|
mixins: [pageListenMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tips: "",
|
tips: '获取验证码',
|
||||||
form: {
|
form: {
|
||||||
name: "",
|
name: '',
|
||||||
avatar: "",
|
avatar: '',
|
||||||
contact: "",
|
contact: '',
|
||||||
phone: "",
|
phone: '',
|
||||||
captcha: "",
|
captcha: '',
|
||||||
qualification: "",
|
qualification: '',
|
||||||
area: "",
|
area: '',
|
||||||
address: ""
|
address: ''
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'name': {
|
'name': {
|
||||||
@@ -221,175 +296,178 @@ export default {
|
|||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
district: [],
|
district: [],
|
||||||
address: {},
|
address: {},
|
||||||
|
|
||||||
isAgree: false,
|
isAgree: false,
|
||||||
show: false,
|
show: false,
|
||||||
notice: "",
|
notice: '',
|
||||||
showRemove: false,
|
showRemove: false,
|
||||||
|
|
||||||
applyType: null,
|
applyType: null,
|
||||||
isDraft: null,
|
isDraft: null,
|
||||||
reviewStatus: null,
|
reviewStatus: null,
|
||||||
stateTitle: "",
|
stateTitle: '',
|
||||||
stateType: "primary",
|
stateType: 'primary',
|
||||||
isPass: false,
|
// 是否为审核中
|
||||||
|
reviewing: false,
|
||||||
pageKeyId: Object.freeze('merchantApplyWholesaler')
|
pageKeyId: Object.freeze('merchantApplyWholesaler')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init();
|
this.init()
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
this.$refs.wholesalerForm.setRules(this.rules);
|
this.$refs.wholesalerForm.setRules(this.rules)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeRemove(state){
|
changeRemove(state){
|
||||||
this.showRemove=state
|
this.showRemove = state
|
||||||
},
|
},
|
||||||
codeChange(text) {
|
codeChange(text) {
|
||||||
this.tips = text;
|
this.tips = text
|
||||||
},
|
},
|
||||||
getCode() {
|
getCode() {
|
||||||
if (this.form.phone.length === 0) return;
|
if (this.reviewing) return
|
||||||
|
if (this.form.phone.length === 0) {
|
||||||
|
uni.$u.toast('请输入位手机号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.form.phone.length !== 11) {
|
||||||
|
uni.$u.toast('请输入11位手机号')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.$refs.uCode.canGetCode) {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '正在获取验证码'
|
title: '正在获取验证码'
|
||||||
})
|
})
|
||||||
registerVerify({phone: this.form.phone, type: "merchantApply"}).then(() => {
|
registerVerify({
|
||||||
uni.hideLoading();
|
phone: this.form.phone,
|
||||||
|
type: 'merchantApply'
|
||||||
|
}).then(() => {
|
||||||
|
uni.hideLoading()
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
uni.$u.toast('验证码已发送');
|
uni.$u.toast('验证码已发送')
|
||||||
// 通知验证码组件内部开始倒计时
|
// 通知验证码组件内部开始倒计时
|
||||||
this.$refs.uCode.start();
|
this.$refs.uCode.start()
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
uni.$u.toast(err.msg);
|
uni.$u.toast(err.msg)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast('倒计时结束后再发送');
|
uni.$u.toast('倒计时结束后再发送')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
getCity().then(({data}) => {
|
getCity().then(({data}) => {
|
||||||
this.district = data;
|
this.district = data
|
||||||
});
|
})
|
||||||
|
|
||||||
getShopData().then(({data}) => {
|
getShopData().then(({data}) => {
|
||||||
this.notice = data.merchantApplyNotice;
|
this.notice = data.merchantApplyNotice
|
||||||
this.initInfo();
|
this.initInfo()
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
initInfo() {
|
initInfo() {
|
||||||
getWholesaler().then(({data}) => {
|
getWholesaler().then(({data}) => {
|
||||||
this.applyType = data.applyType;
|
this.applyType = data.applyType
|
||||||
if (data.applyType === 4) {
|
if (data.applyType === 4) {
|
||||||
this.isDraft = data.isDraft;
|
this.isDraft = data.isDraft
|
||||||
this.reviewStatus = data.reviewStatus;
|
this.reviewStatus = data.reviewStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (data.reviewStatus) {
|
switch (data.reviewStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
this.stateTitle = "审核中";
|
this.stateTitle = '审核中'
|
||||||
this.stateType = "primary";
|
this.stateType = 'primary'
|
||||||
|
this.reviewing = true
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
this.isPass = true;
|
this.reviewing = false
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.stateTitle = "审核驳回:" + data.reviewMsg;
|
this.stateTitle = '审核驳回:' + data.reviewMsg
|
||||||
this.stateType = "error";
|
this.stateType = 'error'
|
||||||
|
this.reviewing = false
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.wholesalerInfo) {
|
if (data.wholesalerInfo) {
|
||||||
this.form = data.wholesalerInfo;
|
this.form = data.wholesalerInfo
|
||||||
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6);
|
this.form.position = this.$forceToDecimal(this.form.longitude, 6) + ',' + this.$forceToDecimal(this.form.latitude, 6)
|
||||||
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
|
this.form.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
chooseLogoImg(target) {
|
chooseLogoImg(target) {
|
||||||
|
if (this.reviewing) return
|
||||||
chooseImage(img => {
|
chooseImage(img => {
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case "avatar":
|
case 'avatar':
|
||||||
this.form.avatar = img;
|
this.form.avatar = img
|
||||||
break;
|
break
|
||||||
case "licence":
|
case 'licence':
|
||||||
this.form.qualification = img;
|
this.form.qualification = img
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 省市区
|
// 省市区
|
||||||
result(values) {
|
result(values) {
|
||||||
this.address = {
|
this.address = {
|
||||||
province: values.province.name || "",
|
province: values.province.name || '',
|
||||||
city: values.city.name || "",
|
city: values.city.name || '',
|
||||||
district: values.district.name || "",
|
district: values.district.name || '',
|
||||||
provinceId: values.province.id,
|
provinceId: values.province.id,
|
||||||
cityId: values.city.id,
|
cityId: values.city.id,
|
||||||
areaId: values.district.id
|
areaId: values.district.id
|
||||||
};
|
}
|
||||||
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`;
|
this.form.area = `${this.address.province} ${this.address.city} ${this.address.district}`
|
||||||
this.form.provinceId = values.province.id;
|
this.form.provinceId = values.province.id
|
||||||
this.form.cityId = values.city.id;
|
this.form.cityId = values.city.id
|
||||||
this.form.areaId = values.district.id;
|
this.form.areaId = values.district.id
|
||||||
},
|
},
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$refs.wholesalerForm.validate().then(res => {
|
this.$refs.wholesalerForm.validate().then(res => {
|
||||||
// 校验通过
|
// 校验通过
|
||||||
this.show = true;
|
this.show = true
|
||||||
}).catch(errors => {
|
}).catch(errors => {
|
||||||
// 校验失败
|
// 校验失败
|
||||||
|
console.log(errors)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onRemove() {
|
onRemove() {
|
||||||
removeApply().then(res => {
|
removeApply().then(res => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
success: () => {
|
success: () => {
|
||||||
this.showRemove = false;
|
this.showRemove = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack()
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeAgree(event) {
|
changeAgree(event) {
|
||||||
this.isAgree = event.detail.value.length > 0
|
this.isAgree = event.detail.value.length > 0
|
||||||
},
|
},
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
saveWholesaler(this.form).then(res => {
|
saveWholesaler(this.form).then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "您的入驻申请已提交成功,请耐心等待审核",
|
title: '您的入驻申请已提交成功,请耐心等待审核',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
success: () => {
|
success: () => {
|
||||||
this.initInfo();
|
this.initInfo()
|
||||||
this.show = false;
|
this.show = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg,
|
title: err.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
success: () => {
|
success: () => {
|
||||||
this.show = false;
|
this.show = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -421,4 +499,11 @@ export default {
|
|||||||
.font-color-red{
|
.font-color-red{
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
.captcha-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.captcha-wrap-input {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user