Commit 383de0cc by wangjian

1

parent 3bfdd35b
......@@ -11,7 +11,7 @@
<view class="name">{{userInfo.staffName}}</view>
<view class="shop">{{userInfo.accountName}}</view>
</view>
<view class="select-acccount" v-if="userInfo.allowSwitching>0">
<view class="select-acccount" v-if="userInfo.allowSwitching>0" @click="$router.push('SelectAccount',{'isSettingEnter':true})">
切换行号
<image class="img" src="../../static/arrow-right-w.png" mode=""></image>
</view>
......@@ -78,12 +78,17 @@
showRecover: false
};
},
onLoad() {
onLoad(options) {
this.getUserInfo()
},
onShow() {
this.userInfo = {}
this.getUserInfo()
console.log(this.$store.state);
if (this.$store.state.selectAccount) {
this.$store.commit('refreshSelectAccount', true)
this.toast('账号切换成功')
}
},
onTabItemTap () {
if (!this.$store.state.isLogin) {
......
......@@ -29,7 +29,7 @@ export default {
return;
}
this.$net
.post('/meta/sms', { codeType: 20, mobile: this.$store.state.userInfo.mobile })
.post('/staff/sms', { codeType: 20, mobile: this.$store.state.userInfo.mobile })
.then(res => {
if (res.code == 200) {
this.toast('验证码发送成功');
......
......@@ -2,8 +2,8 @@
<view class="container">
<view class="top">{{topTitle}}</view>
<view class="sub">{{subTitle}}</view>
<view>
<view class="item" v-for="(item, index) in accountList" :style="{'margin-top':index===0?'128rpx':'', 'opacity':item.staffState!==200?'0.6':''}" :key="index" @click="goAccount(item)">
<view class="account-content">
<view class="item" v-for="(item, index) in accountList" :style="{'opacity':item.staffState!==200?'0.6':''}" :key="index" @click="goAccount(item)">
<image class="left" :src="item.avatar" mode=""></image>
<view class="middle">
<view class="middle-item">{{item.staffName}}</view>
......@@ -12,7 +12,7 @@
<image class="right" src="../../static/arrow-right.png" mode=""></image>
</view>
</view>
<view class="bottom">
<view class="bottom" v-if="!isSettingEnter">
<image v-if="!selectTips" class="select-img" src="../../static/select-n.png" mode="" @click="selectTips=!selectTips"></image>
<image v-else class="select-img" src="../../static/select-h.png" mode="" @click="selectTips=false"></image>
<view class="tips">
......@@ -29,21 +29,35 @@
topTitle: '选择账号',
subTitle: '系统检测到该手机号已在多家公司注册',
accountList: [],
selectTips: false
selectTips: false,
isSettingEnter: false
};
},
created() {
onLoad(options) {
this.isSettingEnter = options.isSettingEnter || false
if (this.isSettingEnter) {
this.topTitle = '切换账号'
this.subTitle = '点击下方账号信息即可完成切换'
}
this.getAllAccount()
},
created() {
},
methods: {
goAccount(item) {
if (!this.selectTips) {
if (!this.selectTips && !this.isSettingEnter) {
this.toast('请先查看并同意《隐私政策》和《服务协议》')
return
}
this.$net.post('/account/change', {'accountCode': item.accountCode}).then(res => {
if (res.code === 200) {
this.$router.pop()
if (this.isSettingEnter) {
this.$router.replaceTo('Mine')
this.$store.commit('refreshSelectAccount', true)
} else {
this.$router.pop()
}
} else {
this.toast(res.message)
}
......@@ -75,45 +89,50 @@
color: #666666;
margin-top: 16rpx;
}
.first-item{
.account-content {
height: 550rpx;
overflow-y: auto;
margin-top: 128rpx;
}
.item {
margin-top: 40rpx;
border-radius: 16rpx;
border: 2rpx solid #F0F0F0;
display: flex;
padding: 24rpx;
align-items: center;
.left {
display: block;
height: 96rpx;
width: 96rpx;
background-color: #18BC37;
border-radius: 96rpx;
.first-item{
margin-top: 0;
}
.middle {
height: 86rpx;
margin-left: 24rpx;
font-size: 26rpx;
color: #333333;
.middle-item {
height: 36rpx;
line-height: 38rpx;
width: 402rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.item {
margin-top: 40rpx;
border-radius: 16rpx;
border: 2rpx solid #F0F0F0;
display: flex;
padding: 24rpx;
align-items: center;
.left {
display: block;
height: 96rpx;
width: 96rpx;
background-color: #18BC37;
border-radius: 96rpx;
}
.middle-next-item {
margin-top: 14rpx;
.middle {
height: 86rpx;
margin-left: 24rpx;
font-size: 26rpx;
color: #333333;
.middle-item {
height: 36rpx;
line-height: 38rpx;
width: 402rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.middle-next-item {
margin-top: 14rpx;
}
}
.right {
display: block;
margin-left: 40rpx;
height: 20rpx;
width: 12rpx;
}
}
.right {
display: block;
margin-left: 40rpx;
height: 20rpx;
width: 12rpx;
}
}
.bottom {
......
......@@ -17,7 +17,7 @@
</view>
<uni-popup class="pop" ref="popup" type="center">
<view class="dialog">
<view class="title">是否退出登</view>
<view class="title">是否退出登</view>
<view class="button-layout">
<text class="cancel" @click="cancel">取消</text>
<text class="sure" @click="sure">确认</text>
......@@ -46,7 +46,7 @@
if (this.$store.state.userInfo.allowSwitching == 0) {
this.toast('暂无可切换账号')
} else {
this.$router.push('SelectAccount')
this.$router.push('SelectAccount', {'isSettingEnter': true})
}
// this.$router.push('SelectAccount')
},
......
......@@ -12,7 +12,8 @@ const store = createStore({
state: {
isLogin: false,
userInfo: {},
submitGoods: {}
submitGoods: {},
selectAccount: false
},
mutations: {
refreshUserLogin(state, isLogin) {
......@@ -23,6 +24,9 @@ const store = createStore({
},
refreshSubmitGoods(state, info) {
state.submitGoods = info
},
refreshSelectAccount(state, value) {
state.selectAccount = value
}
},
getters: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment