Commit 7d9d45fe by shibukun

退出账号

parent b15bd44f
...@@ -7,14 +7,23 @@ ...@@ -7,14 +7,23 @@
<image class="item-right-row" src="../../static/arrow-right.png"></image> <image class="item-right-row" src="../../static/arrow-right.png"></image>
</view> </view>
</view> </view>
<view class="item"> <view class="item" @click="changeAccount">
<text class="item-title" @click="changeAccount">切换账号</text> <text class="item-title">切换账号</text>
<image class="item-right-row" src="../../static/arrow-right.png"></image> <image class="item-right-row" src="../../static/arrow-right.png"></image>
</view> </view>
<view class="item1"> <view class="item1">
<text class="item-quit" @click="quit">退出账号</text> <text class="item-quit" @click="quit">退出账号</text>
</view> </view>
<uni-popup class="pop" ref="popup" type="center">
<view class="dialog">
<view class="title">是否退出登陆?</view>
<view class="button-layout">
<text class="cancel" @click="cancel">取消</text>
<text class="sure" @click="sure">确认</text>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
...@@ -34,10 +43,23 @@ ...@@ -34,10 +43,23 @@
this.$router.push('SetPwd') this.$router.push('SetPwd')
}, },
changeAccount() { changeAccount() {
if (this.$store.state.userInfo.allowSwitching == 0) {
this.toast('暂无可切换账号')
} else {
this.$router.push('SelectAccount')
}
// this.$router.push('SelectAccount')
}, },
quit() { quit() {
this.$refs.popup.open()
},
cancel() {
this.$refs.popup.close()
},
sure() {
this.$store.commit("refreshUserInfo", {})
this.$net.tokenSave('')
this.$router.pop()
} }
} }
} }
...@@ -92,5 +114,48 @@ ...@@ -92,5 +114,48 @@
width: 100%; width: 100%;
} }
} }
.pop {
.dialog {
width: 640rpx;
// height: 309rpx;
background: #FFFFFF;
border-radius: 16rpx;
padding-top: 80rpx;
padding-bottom: 40rpx;
.title {
font-size: 32rpx;
color: #333333;
line-height: 48rpx;
text-align: center;
margin:0 auto;
}
.button-layout {
margin: 80rpx 40rpx 0 40rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
.cancel {
width: 260rpx;
height: 80rpx;
background: #EFEFEF;
border-radius: 40rpx;
font-size: 32rpx;
color: #666666;
line-height: 80rpx;
text-align: center;
}
.sure {
width: 260rpx;
height: 80rpx;
background: #FF0520;
border-radius: 40rpx;
font-size: 32rpx;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
}
}
}
}
} }
</style> </style>
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