1047 lines
32 KiB
Vue
1047 lines
32 KiB
Vue
<template>
|
||
<view>
|
||
<u--form :model="formSupplier" errorType="toast" labelWidth="216rpx" ref="supplierForm">
|
||
<view class="box-state" v-if="stateTitle && isDraft!==1">
|
||
<u-alert :center="stateType==='primary'" :title="stateTitle" :type="stateType"/>
|
||
</view>
|
||
|
||
<u-cell-group :title="infoTitle+'供应商基本信息'" :border="false" :customStyle="{'fontSize':'40rpx'}">
|
||
|
||
<u-form-item prop="name">
|
||
<u-cell title="供应商名称" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="formSupplier.name" border="none" placeholder="请填写供应商名称"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="avatar">
|
||
<u-cell title="头像" :border="false">
|
||
<template #label>
|
||
<view class="box-upload" @click="chooseLogoImg('supplier')">
|
||
<view class="btn-upload" v-if="formSupplier.avatar.length===0">上传图片</view>
|
||
<image class="img-preview" :src="formSupplier.avatar" v-else/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="contact">
|
||
<u-cell title="联系人姓名" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="formSupplier.contact" border="none" placeholder="请填写联系人姓名"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="phone">
|
||
<u-cell title="联系方式" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="formSupplier.phone" border="none" placeholder="请填写联系方式"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="captcha">
|
||
<u-cell title="验证码" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="formSupplier.captcha" border="none" placeholder="请填写验证码">
|
||
<template slot="suffix">
|
||
<u-code
|
||
ref="uCode"
|
||
@change="codeChange"
|
||
seconds="30"
|
||
changeText="X秒重新获取"
|
||
></u-code>
|
||
<u-button
|
||
@tap="getCode"
|
||
:text="tips"
|
||
type="success"
|
||
size="normal"
|
||
></u-button>
|
||
</template>
|
||
</u-input>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<!-- <u-form-item prop="qualification">-->
|
||
<!-- <view class="licence-section">-->
|
||
<!-- <u-cell title="营业执照" :border="false">-->
|
||
<!-- <template #icon>-->
|
||
<!-- <text class="required">*</text>-->
|
||
<!-- </template>-->
|
||
<!-- </u-cell>-->
|
||
<!-- </view>-->
|
||
<!-- <view class="licence-image">-->
|
||
<!-- <u-cell :border="false">-->
|
||
<!-- <template #title>-->
|
||
<!-- <view class="box-upload" @click="chooseLogoImg('licence')">-->
|
||
<!-- <view class="btn-upload" v-if="formSupplier.qualification.length===0">上传图片</view>-->
|
||
<!-- <image class="img-preview" :src="formSupplier.qualification" v-else/>-->
|
||
<!-- </view>-->
|
||
<!-- </template>-->
|
||
<!-- </u-cell>-->
|
||
<!-- </view>-->
|
||
<!-- </u-form-item>-->
|
||
|
||
<view class="full-title">
|
||
<u-cell :border="false">
|
||
<template #title>
|
||
<view v-if="infoTitle==='特产'">商家资质
|
||
<text class="font-color-red">(营业执照、食品经营许可证、生产许可证等行业资质)</text>
|
||
</view>
|
||
<view v-else>商家资质
|
||
<text class="font-color-red">(请上传营业执照及行业相关资质证明)</text>
|
||
</view>
|
||
</template>
|
||
<template #label>
|
||
<u-upload
|
||
:fileList="quaPics"
|
||
@afterRead="quaAfterRead"
|
||
@delete="quaDeletePic"
|
||
name="quaPics"
|
||
multiple
|
||
:maxCount="9"
|
||
></u-upload>
|
||
</template>
|
||
</u-cell>
|
||
</view>
|
||
|
||
<!-- <u-form-item prop="typeText">
|
||
<u-cell title="类型" :border="false" isLink @click="showSupplierType=true">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<picker
|
||
:value="indexSupplierType"
|
||
:range="columnsSupplierType"
|
||
mode=selector
|
||
range-key="value"
|
||
class="picker"
|
||
@change="supplierTypeChange"
|
||
>
|
||
<u--text v-if="formSupplier.typeText" :text="formSupplier.typeText"></u--text>
|
||
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
|
||
</picker>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item> -->
|
||
|
||
<u-form-item prop="area">
|
||
<u-cell title="省市区" :border="false" isLink>
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<view class="u-text__value" :class="{'area-item':formSupplier.area.length===0}">
|
||
<CitySelect ref="cityselect" :defaultValue="formSupplier.area" @callback="resultSupplier"
|
||
:items="district"/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="address">
|
||
<u-cell title="详细地址" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="formSupplier.address" border="none" placeholder="请填写详细地址"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="position">
|
||
<u-cell title="地理定位选择" :border="false" isLink @click="chooLocation('supplier')">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u--text :text="formSupplier.position" v-if="formSupplier.position"></u--text>
|
||
<u--text text="请选择" color="#c0c4cc" v-else></u--text>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
</u-cell-group>
|
||
</u--form>
|
||
|
||
<u--form :model="form" errorType="toast" labelWidth="216rpx" ref="shopForm">
|
||
<u-cell-group title="店铺基本信息" :border="false" :customStyle="{'fontSize':'40rpx'}">
|
||
|
||
<u-form-item prop="name">
|
||
<u-cell title="店铺名称" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="form.name" border="none" placeholder="请填写店铺名称"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
<u-form-item prop="coverType">
|
||
<u-cell title="封面类型" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-radio-group
|
||
v-model="form.coverType"
|
||
placement="row"
|
||
>
|
||
<u-radio
|
||
:name="1"
|
||
:customStyle="{marginRight: '16px'}"
|
||
active-color="red"
|
||
label="图片"
|
||
/>
|
||
<u-radio
|
||
:name="2"
|
||
active-color="red"
|
||
label="视频"
|
||
/>
|
||
</u-radio-group>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
<u-form-item v-if="form.coverType === 1" prop="cover">
|
||
<u-cell title="店铺封面图" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
</u-cell>
|
||
<u-cell :border="false">
|
||
<template #title>
|
||
<view class="box-upload" @click="chooseLogoImg('cover')">
|
||
<view class="btn-upload" v-if="form.cover.length===0 || form.cover==null">上传图片</view>
|
||
<image class="img-preview" :src="form.cover" v-else/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
<u-form-item v-if="form.coverType === 2" prop="coverVideo">
|
||
<u-cell title="店铺视频封面" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
</u-cell>
|
||
<u-cell :border="false">
|
||
<template #title>
|
||
<view class="box-upload" @click="chooseLogoVideo()">
|
||
<view
|
||
v-if="!form.coverVideo"
|
||
class="btn-upload"
|
||
>上传视频</view>
|
||
<video
|
||
v-else
|
||
:src="form.coverVideo"
|
||
:poster="form.coverVideo + '?vframe/jpg/offset/1'"
|
||
:controls="false"
|
||
play-btn-position="center"
|
||
class="video-item"
|
||
/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="pics">
|
||
<u-cell title="店铺图片" :border="false">
|
||
<template #label>
|
||
<u-upload
|
||
:fileList="pics"
|
||
@afterRead="afterRead"
|
||
@delete="deletePic"
|
||
name="pics"
|
||
multiple
|
||
:maxCount="9"
|
||
></u-upload>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="logo">
|
||
<u-cell title="店铺logo" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
</u-cell>
|
||
<u-cell :border="false">
|
||
<template #title>
|
||
<view class="box-upload" @click="chooseLogoImg('logo')">
|
||
<view class="btn-upload" v-if="form.logo.length===0 || form.logo==null">上传图片</view>
|
||
<image class="img-preview" :src="form.logo" v-else/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="typeText">
|
||
<u-cell title="店铺类型" :border="false" isLink>
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<picker
|
||
:value="indexType"
|
||
:range="columnsType"
|
||
mode=selector
|
||
range-key="name"
|
||
class="picker"
|
||
@change="typeChange"
|
||
>
|
||
<u--text v-if="form.typeText" :text="form.typeText"></u--text>
|
||
<u--text v-else text="请选择类型" color="#c0c4cc"></u--text>
|
||
</picker>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="contact">
|
||
<u-cell title="联系人姓名" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="form.contact" border="none" placeholder="请填写联系人姓名"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="phone">
|
||
<u-cell title="联系方式" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="form.phone" border="none" placeholder="请填写联系方式"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="area">
|
||
<u-cell title="省市区" :border="false" isLink>
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<view class="u-text__value" :class="{'area-item':form.area.length===0}">
|
||
<CitySelect ref="cityselect" :defaultValue="form.area" @callback="result" :items="district"/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="address">
|
||
<u-cell title="详细地址" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u-input v-model="form.address" border="none" placeholder="请填写详细地址"/>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="position">
|
||
<u-cell title="地理定位选择" :border="false" isLink @click="chooLocation">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
<template #value>
|
||
<u--text :text="form.position" v-if="form.position"></u--text>
|
||
<u--text text="请选择" color="#c0c4cc" v-else></u--text>
|
||
</template>
|
||
</u-cell>
|
||
</u-form-item>
|
||
|
||
<u-form-item prop="content">
|
||
<u-cell title="一句话介绍" :border="false">
|
||
<template #icon>
|
||
<text class="required">*</text>
|
||
</template>
|
||
</u-cell>
|
||
|
||
<view class="content-section">
|
||
<u-cell :border="false">
|
||
<template #title>
|
||
<view class="line">
|
||
<u-input v-model="form.content" border="none" placeholder="请填写一句话..."/>
|
||
</view>
|
||
</template>
|
||
</u-cell>
|
||
</view>
|
||
</u-form-item>
|
||
|
||
<!-- <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> -->
|
||
|
||
<view style="height: 100rpx;width: 100%;"></view>
|
||
|
||
</u-cell-group>
|
||
<view class="btn-submit btn-remove" v-if="reviewStatus===0 && isDraft!==1" @click="changeRemove(true)">撤销申请
|
||
</view>
|
||
<view class="btn-submit" @click="onSubmit" v-else>提交申请</view>
|
||
</u--form>
|
||
|
||
<u-modal :show="showRemove" content="您确定撤销申请吗?" showCancelButton @cancel="changeRemove(false)"
|
||
@confirm="onRemove"></u-modal>
|
||
|
||
<u-popup :show="show" mode="center" round="10" closeable @close="show=false">
|
||
<view class="popup-body">
|
||
<view class="tc bold">入驻申请须知</view>
|
||
<view class="content">
|
||
<rich-text :nodes="notice" />
|
||
</view>
|
||
<view class="agree-box">
|
||
<checkbox-group @change="changeAgree">
|
||
<label>
|
||
<checkbox value="yes" style="transform:scale(0.8)"/>
|
||
</label>
|
||
<text>我已仔细阅读并同意</text>
|
||
</checkbox-group>
|
||
</view>
|
||
<u-button type="error" text="确定" :disabled="!isAgree" @click="save"></u-button>
|
||
</view>
|
||
</u-popup>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import CitySelect from "@/components/CitySelect";
|
||
import {getShopData, getShopInfo, removeApply, saveSupplier, saveWenwanSupplier} from "@/api/join";
|
||
import {getCity, registerVerify} from "@/api/user";
|
||
import {
|
||
chooseImage,
|
||
moreImage,
|
||
uploadImage,
|
||
chooseVideoToUpload
|
||
} from "@/utils"
|
||
import { pageListenMixins } from '@/mixins/pageListenMixins'
|
||
|
||
export default {
|
||
name: "PkgJoinSupplier",
|
||
components: {
|
||
CitySelect
|
||
},
|
||
mixins: [pageListenMixins],
|
||
data() {
|
||
return {
|
||
partnerId: "",
|
||
tips: "",
|
||
infoTitle: "",
|
||
pics: [],
|
||
quaPics: [],
|
||
|
||
formSupplier: {
|
||
name: "",
|
||
avatar: "",
|
||
contact: "",
|
||
phone: "",
|
||
captcha: "",
|
||
qualification: "",
|
||
subType: "",
|
||
area: "",
|
||
address: "",
|
||
position: ""
|
||
},
|
||
form: {
|
||
name: "",
|
||
cover: "",
|
||
coverVideo: '',
|
||
coverType: 1, // coverType: 1-图片,2-视频
|
||
logo: "",
|
||
type: 0,
|
||
typeText: "",
|
||
phone: "",
|
||
area: "",
|
||
address: "",
|
||
position: "",
|
||
content: ""
|
||
},
|
||
rulesSupplier: {
|
||
'name': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写供应商名称',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'contact': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写联系人姓名',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'phone': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写联系方式',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'captcha': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写验证码',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'qualification': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请上传营业执照',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'typeText': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择类型',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'area': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择所在省市',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'address': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写详细地址',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'position': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择定位信息',
|
||
trigger: ['blur', 'change']
|
||
}
|
||
},
|
||
rules: {
|
||
'name': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写店铺名称',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'cover': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请上传店铺封面图',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'coverVideo': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请上传店铺视频方面',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'logo': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请上传店铺LOGO',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'typeText': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择店铺类型',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'contact': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写联系人姓名',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'phone': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写联系方式',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'area': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择所在省市',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'address': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写详细地址',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'position': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请选择定位信息',
|
||
trigger: ['blur', 'change']
|
||
},
|
||
'content': {
|
||
type: 'string',
|
||
required: true,
|
||
message: '请填写介绍内容',
|
||
trigger: ['blur', 'change']
|
||
}
|
||
},
|
||
columnsType: [],
|
||
indexType: 0,
|
||
columnsSupplierType: [],
|
||
indexSupplierType: 0,
|
||
|
||
district: [],
|
||
|
||
isAgree: false,
|
||
show: false,
|
||
notice: "",
|
||
showRemove: false,
|
||
|
||
isDraft: null,
|
||
reviewStatus: null,
|
||
stateTitle: "",
|
||
stateType: "primary",
|
||
isPass: false,
|
||
pageKeyId: ''
|
||
}
|
||
},
|
||
onLoad(options) {
|
||
this.partnerId = options.partnerId || ''
|
||
const type = options.type
|
||
this.formSupplier.subType = type
|
||
if (type === 'goods_supplier') {
|
||
this.infoTitle = '特产'
|
||
this.pageKeyId = 'merchantApplyGoodsSupplier'
|
||
} else {
|
||
this.infoTitle = '文玩'
|
||
this.pageKeyId = 'merchantApplyWenwanSupplier'
|
||
}
|
||
uni.setNavigationBarTitle({
|
||
title: this.infoTitle + '供应商入驻'
|
||
})
|
||
this.init();
|
||
},
|
||
onReady() {
|
||
this.$refs.shopForm.setRules(this.rules);
|
||
this.$refs.supplierForm.setRules(this.rulesSupplier);
|
||
},
|
||
methods: {
|
||
changeRemove(state){
|
||
this.showRemove=state
|
||
},
|
||
codeChange(text) {
|
||
this.tips = text;
|
||
},
|
||
getCode() {
|
||
if (this.formSupplier.phone.length === 0) return;
|
||
if (this.$refs.uCode.canGetCode) {
|
||
uni.showLoading({
|
||
title: '正在获取验证码'
|
||
})
|
||
registerVerify({phone: this.formSupplier.phone, type: "merchantApply"}).then(() => {
|
||
uni.hideLoading();
|
||
// 这里此提示会被this.start()方法中的提示覆盖
|
||
uni.$u.toast('验证码已发送');
|
||
// 通知验证码组件内部开始倒计时
|
||
this.$refs.uCode.start();
|
||
}).catch(err => {
|
||
uni.hideLoading();
|
||
uni.$u.toast(err.msg);
|
||
})
|
||
} else {
|
||
uni.$u.toast('倒计时结束后再发送');
|
||
}
|
||
},
|
||
|
||
init() {
|
||
getCity().then(({data}) => {
|
||
this.district = data;
|
||
});
|
||
|
||
getShopData().then(({data}) => {
|
||
this.columnsType = data.hotelTypeList
|
||
this.columnsSupplierType = data.supplierTypeList
|
||
this.notice = data.merchantApplyNotice;
|
||
this.initInfo();
|
||
});
|
||
},
|
||
|
||
initInfo() {
|
||
getShopInfo().then(({data}) => {
|
||
if (data.partnerId != null) {
|
||
this.partnerId = data.partnerId;
|
||
}
|
||
this.isDraft = data.isDraft;
|
||
this.reviewStatus = data.reviewStatus;
|
||
|
||
switch (data.reviewStatus) {
|
||
case 0:
|
||
this.stateTitle = "审核中";
|
||
this.stateType = "primary";
|
||
break;
|
||
case 1:
|
||
this.isPass = true;
|
||
break;
|
||
case 2:
|
||
this.stateTitle = "审核驳回:" + data.reviewMsg;
|
||
this.stateType = "error";
|
||
break;
|
||
}
|
||
|
||
if (data.hotelInfo) {
|
||
// 店铺图片
|
||
this.pics = []
|
||
this.form = data.hotelInfo
|
||
const picsTemp = this.form.pics.split(",")
|
||
if (picsTemp.length > 0) {
|
||
picsTemp.map(item => {
|
||
if (item) {
|
||
this.pics.push({url: item})
|
||
}
|
||
})
|
||
}
|
||
// 商家资质
|
||
this.quaPics = []
|
||
const quaPicsTemp = this.form.qualification.split(",")
|
||
if (quaPicsTemp.length > 0) {
|
||
quaPicsTemp.map(item => {
|
||
if (item) {
|
||
this.quaPics.push({url: item})
|
||
}
|
||
})
|
||
}
|
||
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type);
|
||
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.area = `${this.form.provinceName} ${this.form.cityName} ${this.form.areaName}`;
|
||
if (data.hotelInfo.coverType === 2) {
|
||
this.form.coverVideo = data.hotelInfo.cover
|
||
this.form.cover = ''
|
||
}
|
||
}
|
||
|
||
if (data.supplierInfo) {
|
||
if (this.infoTitle === "特产" && data.applyType !== 1) return;
|
||
if (this.infoTitle === "文玩" && data.applyType !== 3) return;
|
||
|
||
this.formSupplier = data.supplierInfo;
|
||
this.indexSupplierType = this.columnsSupplierType.findIndex(item => item.key === this.formSupplier.subType);
|
||
this.formSupplier.typeText = this.columnsSupplierType[this.indexSupplierType].value;
|
||
this.formSupplier.position = this.$forceToDecimal(this.formSupplier.longitude, 6) + ',' + this.$forceToDecimal(this.formSupplier.latitude, 6);
|
||
this.formSupplier.area = `${this.formSupplier.provinceName} ${this.formSupplier.cityName} ${this.formSupplier.areaName}`;
|
||
}
|
||
});
|
||
},
|
||
|
||
chooseLogoImg(target) {
|
||
chooseImage(img => {
|
||
switch (target) {
|
||
case "supplier":
|
||
this.formSupplier.avatar = img;
|
||
break;
|
||
case "licence":
|
||
this.formSupplier.qualification = img;
|
||
break;
|
||
case "cover":
|
||
this.form.cover = img;
|
||
break;
|
||
case "logo":
|
||
this.form.logo = img;
|
||
break;
|
||
}
|
||
});
|
||
},
|
||
chooseLogoVideo() {
|
||
chooseVideoToUpload(path => {
|
||
this.form.coverVideo = path
|
||
this.$forceUpdate()
|
||
})
|
||
},
|
||
|
||
chooseShopImg() {
|
||
let that = this;
|
||
let count = 0;
|
||
moreImage(9, (img, total) => {
|
||
if (img) that.pics.push(img);
|
||
count++;
|
||
if (count === total) {
|
||
that.form.pics = that.pics.join(",");
|
||
}
|
||
})
|
||
},
|
||
|
||
// 删除图片
|
||
deletePic(event) {
|
||
this[`${event.name}`].splice(event.index, 1)
|
||
},
|
||
|
||
afterRead(event) {
|
||
let that = this;
|
||
if (event.file.length > 0) {
|
||
event.file.map(item => {
|
||
uploadImage(item.url, img => {
|
||
that.pics.push({url: img})
|
||
})
|
||
})
|
||
}
|
||
},
|
||
|
||
// 删除图片
|
||
quaDeletePic(event) {
|
||
this[`${event.name}`].splice(event.index, 1)
|
||
},
|
||
|
||
quaAfterRead(event) {
|
||
let that = this;
|
||
if (event.file.length > 0) {
|
||
event.file.map(item => {
|
||
uploadImage(item.url, img => {
|
||
that.quaPics.push({url: img})
|
||
})
|
||
})
|
||
}
|
||
},
|
||
|
||
confirmSupplierType(e) {
|
||
this.indexSupplierType = e.indexs;
|
||
this.formSupplier.subType = e.value[0].key;
|
||
this.formSupplier.typeText = e.value[0].value;
|
||
this.showSupplierType = false;
|
||
},
|
||
typeChange(e) {
|
||
const idx = parseInt(e.detail.value)
|
||
this.columnsType.map((item, index) => {
|
||
if (index === idx) {
|
||
this.form.typeText = item.name
|
||
this.indexType = index
|
||
this.form.type = item.id
|
||
}
|
||
})
|
||
},
|
||
supplierTypeChange(e) {
|
||
const idx = parseInt(e.detail.value)
|
||
this.columnsSupplierType.map((item, index) => {
|
||
if (index === idx) {
|
||
this.formSupplier.typeText = item.value
|
||
this.indexSupplierType = index
|
||
this.formSupplier.type = item.key
|
||
}
|
||
})
|
||
},
|
||
|
||
resultSupplier(values) {
|
||
let address = {
|
||
province: values.province.name || "",
|
||
city: values.city.name || "",
|
||
district: values.district.name || "",
|
||
provinceId: values.province.id,
|
||
cityId: values.city.id,
|
||
areaId: values.district.id
|
||
};
|
||
this.formSupplier.area = `${address.province} ${address.city} ${address.district}`;
|
||
this.formSupplier.provinceId = values.province.id;
|
||
this.formSupplier.cityId = values.city.id;
|
||
this.formSupplier.areaId = values.district.id;
|
||
},
|
||
|
||
// 省市区
|
||
result(values) {
|
||
let address = {
|
||
province: values.province.name || "",
|
||
city: values.city.name || "",
|
||
district: values.district.name || "",
|
||
provinceId: values.province.id,
|
||
cityId: values.city.id,
|
||
areaId: values.district.id
|
||
};
|
||
this.form.area = `${address.province} ${address.city} ${address.district}`;
|
||
this.form.provinceId = values.province.id;
|
||
this.form.cityId = values.city.id;
|
||
this.form.areaId = values.district.id;
|
||
},
|
||
|
||
// 定位
|
||
chooLocation(target) {
|
||
let that = this;
|
||
uni.chooseLocation({
|
||
success: function (res) {
|
||
if (target === "supplier") {
|
||
that.formSupplier.address = res.address;
|
||
that.formSupplier.longitude = that.$forceToDecimal(res.longitude, 6);
|
||
that.formSupplier.latitude = that.$forceToDecimal(res.latitude, 6);
|
||
that.formSupplier.position = that.$forceToDecimal(res.longitude, 6) + ',' + that.$forceToDecimal(res.latitude, 6);
|
||
} else {
|
||
that.form.address = res.address;
|
||
that.form.longitude = that.$forceToDecimal(res.longitude, 6);
|
||
that.form.latitude = that.$forceToDecimal(res.latitude, 6);
|
||
that.form.position = that.$forceToDecimal(res.longitude, 6) + ',' + that.$forceToDecimal(res.latitude, 6);
|
||
}
|
||
}
|
||
});
|
||
},
|
||
|
||
onSubmit() {
|
||
let that = this;
|
||
this.$refs.shopForm.validate().then(res => {
|
||
// 校验通过
|
||
this.$refs.supplierForm.validate().then(() => {
|
||
that.show = true;
|
||
})
|
||
}).catch(errors => {
|
||
// 校验失败
|
||
})
|
||
},
|
||
|
||
onRemove() {
|
||
removeApply().then(res => {
|
||
uni.showToast({
|
||
title: res.msg,
|
||
icon: "none",
|
||
duration: 3000,
|
||
success: () => {
|
||
this.showRemove = false;
|
||
setTimeout(() => {
|
||
uni.navigateBack();
|
||
}, 3000)
|
||
}
|
||
})
|
||
});
|
||
},
|
||
|
||
changeAgree(event) {
|
||
this.isAgree = event.detail.value.length > 0
|
||
},
|
||
|
||
save() {
|
||
this.form.pics = ''
|
||
const picsLength = this.pics.length
|
||
if (picsLength > 0) {
|
||
const tempArr = []
|
||
this.pics.map(item => {
|
||
item.url && tempArr.push(item.url)
|
||
})
|
||
this.form.pics = tempArr.join(',')
|
||
}
|
||
|
||
this.formSupplier.qualification = ''
|
||
const quaPicsLength = this.quaPics.length
|
||
if (quaPicsLength > 0) {
|
||
const tempArr = []
|
||
this.quaPics.map(item => {
|
||
item.url && tempArr.push(item.url)
|
||
})
|
||
this.formSupplier.qualification = tempArr.join(',')
|
||
}
|
||
const postData = Object.assign({}, this.form)
|
||
if (postData.coverType === 2) {
|
||
postData.cover = postData.coverVideo
|
||
}
|
||
|
||
if (this.infoTitle === "特产") {
|
||
saveSupplier(postData, this.formSupplier, this.partnerId).then(res => {
|
||
if (res.status === 200) {
|
||
uni.showToast({
|
||
title: "您的入驻申请已提交成功,请耐心等待审核",
|
||
icon: "none",
|
||
success: () => {
|
||
this.initInfo();
|
||
this.show = false;
|
||
}
|
||
})
|
||
}
|
||
}).catch(err => {
|
||
uni.showToast({
|
||
title: err.msg,
|
||
icon: "none",
|
||
success: () => {
|
||
this.show = false;
|
||
}
|
||
})
|
||
})
|
||
} else {
|
||
saveWenwanSupplier(postData, this.formSupplier, this.partnerId).then(res => {
|
||
if (res.status === 200) {
|
||
uni.showToast({
|
||
title: "您的入驻申请已提交成功,请耐心等待审核",
|
||
icon: "none",
|
||
success: () => {
|
||
this.initInfo();
|
||
this.show = false;
|
||
}
|
||
})
|
||
}
|
||
}).catch(err => {
|
||
uni.showToast({
|
||
title: err.msg,
|
||
icon: "none",
|
||
success: () => {
|
||
this.show = false;
|
||
}
|
||
})
|
||
})
|
||
}
|
||
|
||
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="less">
|
||
@import "@/assets/css/pkg_join.less";
|
||
|
||
.licence-image {
|
||
.u-cell__body {
|
||
padding-top: 0 !important;
|
||
}
|
||
|
||
.box-upload {
|
||
margin-top: 0;
|
||
}
|
||
}
|
||
|
||
/deep/ .cityselect-nav {
|
||
.item {
|
||
font-size: 30rpx !important;
|
||
}
|
||
}
|
||
|
||
/deep/ .cityselect-item {
|
||
.cityselect-item-box {
|
||
font-size: 30rpx !important;
|
||
}
|
||
}
|
||
|
||
/deep/ .full-title {
|
||
.u-cell__title {
|
||
width: 100% !important;
|
||
}
|
||
}
|
||
|
||
.font-color-red {
|
||
font-size: 22rpx;
|
||
}
|
||
</style>
|