|
@@ -105,11 +105,13 @@
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出登录</view>
|
|
|
<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ var that
|
|
|
import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
|
export default {
|
|
|
components: {
|
|
@@ -126,7 +128,7 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
-
|
|
|
+ that = this
|
|
|
},
|
|
|
onShow(){
|
|
|
if(!uni.getStorageSync("userInfo").phone){
|
|
@@ -139,6 +141,34 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ quitLogin(){
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定退出当前账号?',
|
|
|
+ success (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.removeStorageSync("userInfo")
|
|
|
+ that.userInfo = {}
|
|
|
+ setTimeout(()=>{
|
|
|
+ that.reload()
|
|
|
+ },500)
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ reload() {
|
|
|
+ // 页面重载
|
|
|
+ const pages = getCurrentPages()
|
|
|
+ // 声明一个pages使用getCurrentPages方法
|
|
|
+ const curPage = pages[pages.length - 1]
|
|
|
+ // 声明一个当前页面
|
|
|
+ curPage.onLoad(curPage.options) // 传入参数
|
|
|
+ curPage.onShow()
|
|
|
+ curPage.onReady()
|
|
|
+ // 执行刷新
|
|
|
+ },
|
|
|
editNickName(){
|
|
|
this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
|
commonUserInfo:JSON.stringify(this.userInfo)
|
|
@@ -192,6 +222,7 @@
|
|
|
}
|
|
|
.wrap{
|
|
|
width:92vw;
|
|
|
+ padding:0 20rpx;
|
|
|
}
|
|
|
.orderList{
|
|
|
display:flex;
|
|
@@ -221,4 +252,12 @@
|
|
|
width:92vw;
|
|
|
margin:0 auto;
|
|
|
}
|
|
|
+ .quit-login{
|
|
|
+ background:#fff;
|
|
|
+ width:91%;
|
|
|
+ padding:10rpx 20rpx;
|
|
|
+ text-align:center;
|
|
|
+ margin:10rpx 20rpx;
|
|
|
+ border-radius:10rpx;
|
|
|
+ }
|
|
|
</style>
|