<!--
|
* @Author: 小明丶
|
* @Date: 2020-11-09 11:44:43
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2020-11-11 16:51:59
|
* @Description: 信息补充页面
|
-->
|
<template>
|
<div class="information-supplement">
|
<v-navbar title="信息补充"></v-navbar>
|
<div class="content-box">
|
<van-cell-group>
|
<van-field
|
v-model.trim="info.userName"
|
label="姓名"
|
input-align="right"
|
placeholder="请填写真实姓名"
|
clearable
|
/>
|
<van-field
|
v-model.trim="info.email"
|
clearable
|
input-align="right"
|
label="邮箱"
|
placeholder="请输入邮箱"
|
/>
|
<van-field
|
v-model.trim="info.orgName"
|
is-link
|
disabled
|
label="归属门店"
|
input-align="right"
|
placeholder="请选择归属门店"
|
@click="show=true"
|
/>
|
</van-cell-group>
|
<van-button round type="info" color="#896EDB" style="width:100%;margin-top:150px" @click="hanldClick">完成</van-button>
|
</div>
|
<van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
|
<van-picker
|
title="选择归属门店"
|
show-toolbar
|
value-key="orgName"
|
:columns="storeList"
|
@confirm="onConfirm"
|
@cancel="onCancel"
|
/>
|
</van-popup>
|
</div>
|
</template>
|
<script>
|
import Vue from 'vue';
|
import { Toast } from 'vant';
|
import { mapActions } from 'vuex';
|
Vue.use(Toast);
|
export default {
|
data() {
|
return {
|
info:{
|
orgId:'',
|
orgName:'',
|
email:'',
|
userName:'',
|
},
|
show:false,
|
storeList:[],
|
}
|
},
|
created(){
|
this.init()
|
},
|
methods:{
|
...mapActions(['loginByOpenId']),
|
/**
|
* @description:初始化
|
* @returns void
|
* **/
|
init(){
|
|
this.storeList = JSON.parse(this.$route.query.storeList)
|
|
},
|
/**
|
* @description:确认归属门店选择
|
* @returns void
|
* **/
|
onConfirm(value){
|
this.info.orgName = value.orgName
|
this.info.orgId = value.orgId
|
this.show = false
|
},
|
/**
|
* @description:取消选择门店
|
* @returns void
|
* **/
|
onCancel(){
|
this.show = false
|
},
|
/**
|
* @description:提交
|
* @returns void
|
* **/
|
hanldClick(){
|
let v = this.$tool;
|
if (v.checkValEmpty(this.info.userName)) {
|
Toast.fail('请输入姓名');
|
return;
|
}
|
if (v.checkValEmpty(this.info.email)) {
|
Toast.fail('请输入邮箱');
|
return;
|
}
|
if (!v.checkEmail(this.info.email)) {
|
Toast.fail('请输入正确的邮箱');
|
return;
|
}
|
if (v.checkValEmpty(this.info.orgId)) {
|
Toast.fail('请选择归属门店');
|
return;
|
}
|
this.$api.userAddStoreManager({
|
email: this.info.email,
|
mblNo: localStorage.sib_wx_mblNo,
|
merId: sessionStorage.sib_wx_merId,
|
storeId: this.info.orgId,
|
username: this.info.userName,
|
wechatOpenId: localStorage.sib_wx_openId
|
}).then(res=>{
|
localStorage.sib_wx_userId = res.body.userId
|
this.loginByOpenId({
|
vm: this,
|
loginType:2,
|
mblNo:localStorage.sib_wx_mblNo,
|
merId:sessionStorage.sib_wx_merId,
|
wechatOpenId:localStorage.sib_wx_openId,
|
userId:localStorage.sib_wx_userId
|
})
|
|
|
// this.$router.push({
|
// path:'/main/mine',
|
// query:{
|
// isLoginByOpenId:1
|
// }
|
// })
|
})
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
.information-supplement {
|
& {
|
background-color: #f5f5f5;
|
min-height: 100vh;
|
}
|
.content-box{
|
width: 96vw;
|
margin: auto;
|
margin-top: 10px;
|
}
|
}
|
</style>
|