|
@@ -105,11 +105,13 @@
|
|
</u-cell-group>
|
|
</u-cell-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view v-if='userInfo.nickname' class='quit-login' @click='quitLogin'>退出登录</view>
|
|
<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
|
|
<login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ var that
|
|
import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
import loginPopUp from "@/components/loginPopUp/index.vue"
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -126,7 +128,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
-
|
|
|
|
|
|
+ that = this
|
|
},
|
|
},
|
|
onShow(){
|
|
onShow(){
|
|
if(!uni.getStorageSync("userInfo").phone){
|
|
if(!uni.getStorageSync("userInfo").phone){
|
|
@@ -139,6 +141,34 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
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(){
|
|
editNickName(){
|
|
this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
|
|
commonUserInfo:JSON.stringify(this.userInfo)
|
|
commonUserInfo:JSON.stringify(this.userInfo)
|
|
@@ -192,6 +222,7 @@
|
|
}
|
|
}
|
|
.wrap{
|
|
.wrap{
|
|
width:92vw;
|
|
width:92vw;
|
|
|
|
+ padding:0 20rpx;
|
|
}
|
|
}
|
|
.orderList{
|
|
.orderList{
|
|
display:flex;
|
|
display:flex;
|
|
@@ -221,4 +252,12 @@
|
|
width:92vw;
|
|
width:92vw;
|
|
margin:0 auto;
|
|
margin:0 auto;
|
|
}
|
|
}
|
|
|
|
+ .quit-login{
|
|
|
|
+ background:#fff;
|
|
|
|
+ width:91%;
|
|
|
|
+ padding:10rpx 20rpx;
|
|
|
|
+ text-align:center;
|
|
|
|
+ margin:10rpx 20rpx;
|
|
|
|
+ border-radius:10rpx;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|