添加:商户入驻时支持设置管理员
This commit is contained in:
parent
2ba942f6b0
commit
c4188468e4
|
|
@ -359,6 +359,10 @@ export function getHotBanner(type) {
|
|||
export function create(data) {
|
||||
return request.post("intention/create", data);
|
||||
}
|
||||
// 商户入驻表单 - 判断管理员是否有效
|
||||
export function manageIsEligible(data) {
|
||||
return request.get("intention/manageIsEligible", data);
|
||||
}
|
||||
/**
|
||||
* 商户入驻短信验证码
|
||||
* @returns {*}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ import Cache from '@/utils/cache'
|
|||
export function getUserInfo() {
|
||||
return request.get('user');
|
||||
}
|
||||
// 搜索用户
|
||||
export function searchUser(data) {
|
||||
return request.get('searchUser',data);
|
||||
}
|
||||
/**
|
||||
* 头像
|
||||
*
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@
|
|||
{
|
||||
"path": "online_payment/record/quota",
|
||||
"style": {
|
||||
"navigationBarTitleText": "酒卡变更记录"
|
||||
"navigationBarTitleText": "酒卡额度变更记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,22 @@
|
|||
<text class="iconfont icon-xiangyou"></text>
|
||||
</view>
|
||||
<view class='list'>
|
||||
<view class="item">
|
||||
<view class="acea-row row-middle">
|
||||
<text class="item-name">管理员</text>
|
||||
<input type="text" placeholder="请输入用户UID/手机号" v-model="manage_search" />
|
||||
</view>
|
||||
<view v-if="manage_info.uid > 0" class="manage-info">
|
||||
<view class="left">
|
||||
<image class="left-image" :src="manage_info.avatar" />
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="nickname">{{ manage_info.nickname || manage_info.real_name || manage_info.uid }}</view>
|
||||
<view class="uid">UID:{{ manage_info.uid }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="manage_info.uid > 0 && !manage_eligible.is_eligible" class="manage-error">{{ manage_eligible.msg }}</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="acea-row row-middle">
|
||||
<text class="item-name">商户名称</text>
|
||||
|
|
@ -129,18 +145,8 @@
|
|||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
create,
|
||||
verify,
|
||||
merClassifly,
|
||||
getGoodsDetails,
|
||||
updateGoodsRecord,
|
||||
getStoreTypeApi
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
getCaptcha,
|
||||
getAgreementApi
|
||||
} from "@/api/user";
|
||||
import { manageIsEligible,create, verify, merClassifly, getGoodsDetails, updateGoodsRecord, getStoreTypeApi} from '@/api/store.js';
|
||||
import {getCaptcha, getAgreementApi, searchUser} from "@/api/user";
|
||||
import { mapGetters } from "vuex";
|
||||
import { configMap } from "@/utils";
|
||||
import parser from "@/components/jyf-parser/jyf-parser";
|
||||
|
|
@ -148,6 +154,7 @@
|
|||
import Verify from '@/components/verify/verify.vue';
|
||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||
import spread from "../../../libs/spread";
|
||||
|
||||
const app = getApp();
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -170,7 +177,14 @@
|
|||
showProtocol: false,
|
||||
isShowCode: false,
|
||||
loading: false,
|
||||
manage_info: {},
|
||||
manage_eligible:{
|
||||
is_eligible: true,
|
||||
msg: '',
|
||||
},
|
||||
manage_search: '',
|
||||
merchantData: {
|
||||
manage_uid: '',
|
||||
enterprise_name: "",
|
||||
user_name: "",
|
||||
phone: "",
|
||||
|
|
@ -229,6 +243,31 @@
|
|||
},
|
||||
onShow() {},
|
||||
onReady() {},
|
||||
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 => {});
|
||||
},
|
||||
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 => {});
|
||||
},
|
||||
deep: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getConfig() {
|
||||
this.isType = false;
|
||||
|
|
@ -256,6 +295,9 @@
|
|||
this.merchantData.phone = resData.phone
|
||||
this.merchantData.classification = resData.merchant_category_id
|
||||
this.merchantData.mer_type = resData.mer_type_id
|
||||
// 管理员相关处理
|
||||
this.merchantData.manage_uid = resData.manage_uid || ''
|
||||
this.manage_search = Number(this.merchantData.manage_uid) || ''
|
||||
})
|
||||
this.pics = resData.images
|
||||
this.mer_classification = this.getCategoryName(resData.merchant_category_id, this.array)
|
||||
|
|
@ -456,6 +498,7 @@
|
|||
if (that.validateForm() && that.validate) {
|
||||
let requestData = {
|
||||
phone: that.merchantData.phone,
|
||||
manage_uid: that.merchantData.manage_uid,
|
||||
mer_name: that.merchantData.enterprise_name,
|
||||
name: that.merchantData.user_name,
|
||||
code: that.merchantData.yanzhengma,
|
||||
|
|
@ -521,30 +564,16 @@
|
|||
validateForm: function() {
|
||||
let that = this,
|
||||
value = that.merchantData;
|
||||
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) return that.$util.Tips({
|
||||
title: '请选择商户分类'
|
||||
});
|
||||
if (!that.isAgree) return that.$util.Tips({
|
||||
title: '请勾选并同意入驻协议'
|
||||
});
|
||||
if (that.isShowCode && !that.codeVal) return that.$util.Tips({
|
||||
title: '请填写图片验证码'
|
||||
});
|
||||
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.yanzhengma) return that.$util.Tips({title: '请填写验证码'});
|
||||
if (!value.classification) return that.$util.Tips({title: '请选择商户分类'});
|
||||
if (!that.isAgree) return that.$util.Tips({title: '请勾选并同意入驻协议'});
|
||||
if (that.isShowCode && !that.codeVal) return that.$util.Tips({title: '请填写图片验证码'});
|
||||
that.validate = true;
|
||||
return true;
|
||||
},
|
||||
|
|
@ -601,6 +630,42 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.manage-info {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
.left {
|
||||
width: 100rpx;
|
||||
text-align: left;
|
||||
|
||||
.left-image {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: calc(100% - 100rpx);
|
||||
|
||||
.nickname {
|
||||
width: 100%;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.uid {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.manage-error{
|
||||
color: #f56c6c;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
|
||||
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||
border: 1px solid var(--view-theme)!important;
|
||||
|
|
|
|||
Loading…
Reference in New Issue