Commit 383de0cc by wangjian

1

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