优化:商户入驻减少必填信息 优化入驻流程

优化:商户入驻自主申请时支持选择商户入驻类别
This commit is contained in:
wuhui_zzw 2024-07-12 14:13:12 +08:00
parent 99f678e3f4
commit 904b72d358
1 changed files with 174 additions and 84 deletions

View File

@ -10,6 +10,25 @@
<text class="iconfont icon-xiangyou"></text>
</view>
<view class='list'>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name">入驻类别</text>
<picker
@change="changeMerchantType"
:value="merchant_type_index"
:range="merchant_type_list"
range-key="title"
:disabled="default_merchant_type !== ''">
<input placeholder="请选择商户类别" type="text" disabled readonly v-model="merchant_type_title">
<view v-if="merchant_type_title" class="iconfont icon-guanbi2"></view>
<view class='iconfont icon-jiantou'></view>
</picker>
</view>
</view>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">管理员</text>
@ -28,42 +47,42 @@
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">品牌名称</text>
<input type="text" maxlength="30" placeholder="请输入品牌名称" v-model="merchantData.enterprise_name" @input="validateBtn"
<text class="item-name">商户名称</text>
<input type="text" maxlength="30" placeholder="请输入商户名称" v-model="merchantData.enterprise_name" @input="validateBtn"
placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<!--<view class="item">
<view class="acea-row row-middle">
<text class="item-name">负责人姓名</text>
<input type="text" placeholder="请输入负责人姓名" v-model="merchantData.user_name" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
</view>-->
<!--<view class="item">
<view class="acea-row row-middle">
<text class="item-name">负责人电话</text>
<input type="text" placeholder="请输入负责人电话" v-model="merchantData.phone" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<!--<view class="item rel">-->
<!-- <view class="acea-row row-middle">-->
<!-- <text class="item-name">验证码</text>-->
<!-- <input type="text" placeholder="填写验证码" v-model="merchantData.yanzhengma" @input="validateBtn" class="codeIput"-->
<!-- placeholder-class='placeholder' />-->
<!-- <button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">-->
<!-- {{ text }}-->
<!-- </button>-->
<!-- </view>-->
<!--</view>-->
<view class="item" v-if="isShowCode">
</view>-->
<!--<view class="item rel">
<view class="acea-row row-middle">
<text class="item-name">验证码</text>
<input type="text" placeholder="填写验证码" v-model="merchantData.yanzhengma" @input="validateBtn" class="codeIput"
placeholder-class='placeholder' />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
{{ text }}
</button>
</view>
</view>-->
<!--<view class="item" v-if="isShowCode">
<view class="acea-row row-middle">
<text class="item-name">验证码</text>
<input type="text" placeholder="请输入验证码" class="codeIput" v-model="codeVal" @input="validateBtn"
placeholder-class='placeholder' />
<view class="imageCode" @click="again"><image :src="codeUrl" /></view>
</view>
</view>
<view class="item" v-if="![1,3,4,5,6,7].includes(Number(merchant_type))">
</view>-->
<!--<view class="item" v-if="![1,3,4,5,6,7].includes(Number(merchant_type))">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
@ -75,8 +94,8 @@
</view>
</view>
</view>
</view>
<view class="item" v-if="![1,3,4,5,6,7].includes(Number(merchant_type))">
</view>-->
<!--<view class="item" v-if="![1,3,4,5,6,7].includes(Number(merchant_type))">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
@ -90,22 +109,22 @@
</view>
</view>
</view>
</view>
<view class="item" v-if="[0,1].includes(Number(merchant_type))">
</view>-->
<!--<view class="item" v-if="[0,1].includes(Number(merchant_type))">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name">商户类型</text>
<picker @change="changeSubType" :value="sub_type_index" :range="subTypeList" range-key="title">
<input placeholder="请选择店铺类型" type="text" disabled readonly v-model="sub_type_title">
<input placeholder="请选择商户类型" type="text" disabled readonly v-model="sub_type_title">
<view v-if="sub_type_title" @tap.stop="sub_type_title=''" class="iconfont icon-guanbi2"></view>
<view class='iconfont icon-jiantou'></view>
</picker>
</view>
</view>
</view>
</view>
<view class="item no-border">
</view>-->
<!--<view class="item no-border">
<view class='acea-row row-middle'>
<text class="item-title">请上传营业执照及行业相关资质证明图片</text>
<text class="item-desc">(图片最多可上传10张,图片格式支持JPGPNGJPEG)</text>
@ -120,12 +139,12 @@
</view>
</view>
</view>
</view>
<!--<view class="item no-border">-->
<!-- <checkbox-group @change='ChangeIsAgree'>-->
<!-- <checkbox class="checkbox" :checked="isAgree ? true : false" />已阅读并同意</checkbox-group>-->
<!-- <button class="settleAgree" @click="getConfig">入驻协议</button>-->
<!--</view>-->
</view>-->
<!--<view class="item no-border">
<checkbox-group @change='ChangeIsAgree'>
<checkbox class="checkbox" :checked="isAgree ? true : false" />已阅读并同意</checkbox-group>
<button class="settleAgree" @click="getConfig">入驻协议</button>
</view>-->
<button class='submitBtn' :class="validate === true ? 'on':''" @click="formSubmit">提交申请</button>
</view>
</view>
@ -143,8 +162,13 @@
<view class='loadingicon acea-row row-center-wrapper' v-if="loading">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
</view>
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
<!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
<view class="settledSuccessMain" v-else :style="viewColor">
<view class="settledSuccessful">
@ -157,6 +181,7 @@
</view>
</view>
</template>
<script>
import { manageIsEligible,create, verify, merClassifly, getGoodsDetails, updateGoodsRecord, getStoreTypeApi} from '@/api/store.js';
import {getCaptcha, getAgreementApi, searchUser} from "@/api/user";
@ -176,12 +201,14 @@
},
data() {
return {
//
isAuto: false, //
isShowAuth: false,//
domain: HTTP_REQUEST_URL,
cartId: '', //id
pinkId: 0, //id
couponId: 0, //id
isAuto: false, //
isShowAuth: false, //
text: "获取验证码",
codeUrl: "",
disabled: false,
@ -229,7 +256,8 @@
isType: false,
//
agent_id: 0,
merchant_type: 0,
merchant_type: '',
default_merchant_type: '',
pageTitle: '',
//
subTypeList: [{
@ -237,7 +265,21 @@
value: ''
}],
sub_type_index: 0,
sub_type_title: ''
sub_type_title: '',
//
merchant_type_index: '',
merchant_type_title: '',
merchant_type_list: [
{ title: '联盟商家', value: 0},
{ title: '酒道馆', value: 1},
{ title: '供应商', value: 2},
{ title: '烟酒店', value: 3},
{ title: '超市', value: 4},
{ title: '省公司门店', value: 5},
{ title: '城市会客厅', value: 6},
{ title: '惠民健康体检馆', value: 7},
],
};
},
@ -247,26 +289,28 @@
computed: configMap({sys_intention_agree:''},mapGetters(['isLogin','uid','viewColor','keyColor'])),
onLoad(options) {
let _this = this;
//
if(options.scene){
console.log('转换前参数:',options.scene)
let scene = _this.$util.getUrlParams(decodeURIComponent(options.scene));
// console.log("",scene)
_this.agent_id = scene.aid || 0;
_this.merchant_type = scene.mt || 0;
_this.default_merchant_type = _this.merchant_type
// 0=1=2=3=4=5=6=
_this.pageTitle = _this.$util.getMerchantTypeText( _this.merchant_type);
uni.setNavigationBarTitle({
title: _this.pageTitle + '申请入驻'
})
}
//
if (this.isLogin) {
this.getClassfication();
this.getStoreType();
this.getSubTypeList();
this.init();
} else {
this.isAuto = true;
this.isShowAuth = true
}
//
if (options.mer_i_id) {
this.mer_i_id = options.mer_i_id
uni.showLoading({
@ -284,29 +328,53 @@
watch: {
'manage_search':{
handler(val) {
let _this = this;
searchUser({ id_and_phone: _this.manage_search}).then(res => {
_this.manage_info = res.data;
_this.merchantData.manage_uid = res.data.uid;
}).catch(err => {});
this.manageUserSearch();
},
deep: false
},
'merchantData.manage_uid':{
handler(val) {
let _this = this;
let params = {
manage_uid: _this.merchantData.manage_uid,
mer_intention_id: _this.mer_i_id
};
manageIsEligible(params).then(res => {
_this.manage_eligible = res.data;
}).catch(err => {});
this.manageIsEligibleHandle();
},
deep: false
}
},
'merchant_type':{
handler(val) {
this.manageIsEligibleHandle();
},
deep: false
},
},
methods: {
//
onLoadFun() {
if(this.isLogin){
this.isShowAuth = false;
this.init();
}
},
//
authClose(e) {
this.isShowAuth = e
},
//
init(){
this.getClassfication();
this.getStoreType();
this.getSubTypeList();
this.manageUserSearch();
this.$set(this, 'manage_search', this.uid);
if(this.merchant_type != ''){
let merchantTypeList = Object.assign({}, this.merchant_type_list);
for (const item of Object.values(merchantTypeList)) {
if(Number(this.merchant_type) === Number(item.value)){
this.merchant_type_title = item.title || '';
this.validateBtn();
break;
}
}
}
},
getConfig() {
this.isType = false;
this.showProtocol = true;
@ -419,14 +487,6 @@
});
}
},
//
onLoadFun: function() {
this.isShowAuth = false;
},
//
authColse: function(e) {
this.isShowAuth = e
},
toggleTab(str) {
this.$refs[str].show();
},
@ -592,31 +652,33 @@
validateBtn: function() {
let that = this,
value = that.merchantData;//value.yanzhengma &&
if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone) && that.isAgree && (value.classification || [1,3,4,5,6,7].includes(Number(this.merchant_type)))) {
if (!that.isShowCode) {
that.validate = true;
} else {
if (that.codeVal) {
that.validate = true;
} else {
that.validate = false;
}
}
}else{
that.validate = false;
}
// if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone) && that.isAgree && (value.classification || [1,3,4,5,6,7].includes(Number(this.merchant_type)))) {
// if (!that.isShowCode) {
// that.validate = true;
// } else {
// if (that.codeVal) {
// that.validate = true;
// } else {
// that.validate = false;
// }
// }
// }else{
// that.validate = false;
// }
that.validate = Number(this.merchantData.manage_uid) > 0 && this.merchant_type !== '';
},
validateForm: function() {
let that = this,
value = that.merchantData;
if (!value.manage_uid) return that.$util.Tips({title: '请设置管理员'});
else if (value.manage_uid && !that.manage_eligible.is_eligible) return that.$util.Tips({title: '请设置有效管理员'});
if (!value.enterprise_name) return that.$util.Tips({title: '请输入企业名称'});
if (!value.user_name) return that.$util.Tips({title: '请输入姓名'});
if (!value.phone) return that.$util.Tips({title: '请输入手机号'});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({title: '请输入正确的手机号码'});
// if (!value.enterprise_name) return that.$util.Tips({title: ''});
// if (!value.user_name) return that.$util.Tips({title: ''});
// if (!value.phone) return that.$util.Tips({title: ''});
// if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({title: ''});
// if (!value.yanzhengma) return that.$util.Tips({title: ''});
if (!value.classification && ![1,3,4,5,6,7].includes(Number(this.merchant_type))) return that.$util.Tips({title: '请选择商户分类'});
// if (!value.classification && ![1,3,4,5,6,7].includes(Number(this.merchant_type))) return that.$util.Tips({title: ''});
if (!that.isAgree) return that.$util.Tips({title: '请勾选并同意入驻协议'});
if (that.isShowCode && !that.codeVal) return that.$util.Tips({title: '请填写图片验证码'});
@ -676,8 +738,35 @@
}
}
},
//
manageUserSearch(){
let _this = this;
searchUser({ id_and_phone: _this.manage_search}).then(res => {
_this.manage_info = res.data;
_this.merchantData.manage_uid = res.data.uid;
_this.validateBtn();
}).catch(err => {});
},
//
manageIsEligibleHandle(){
let _this = this;
let params = {
manage_uid: _this.merchantData.manage_uid,
mer_intention_id: _this.mer_i_id,
merchant_type: _this.merchant_type
};
manageIsEligible(params).then(res => {
_this.manage_eligible = res.data;
}).catch(err => {});
},
//
changeMerchantType(e){
this.merchant_type_index = e.detail.value || e.target.value;
let info = this.merchant_type_list[this.merchant_type_index] || {};
this.merchant_type = info.value || 0;
this.merchant_type_title = info.title || '';
this.validateBtn();
}
@ -780,8 +869,9 @@
line-height: 0;
}
.merchantsSettled {
background-image: linear-gradient(var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
height: 140vh;
background-image: linear-gradient(#e93423 0%, var(--view-bntColor22) 100%);
//height: 140vh;
min-height: 100vh!important;
}
.merchantsSettled .merchantBg {
width: 750rpx;