我的页面

This commit is contained in:
姚亚男
2021-10-11 16:49:22 +08:00
parent e4e2740c0b
commit 224833685d
28 changed files with 216 additions and 5738 deletions
+23 -2
View File
@@ -1,11 +1,12 @@
// pages/mine/mine.js
import UserApi from '../../assets/js/http/userApi'
Page({
/**
* 页面的初始数据
*/
data: {
userId: ''
},
// 个人信息
mineInfo(){
@@ -41,11 +42,31 @@ Page({
url: '../mineContract/mineContract',
})
},
// 退出登录
logout(){
wx.showModal({
cancelColor: '取消',
content: '确定退出登录?',
confirmColor: '#069F99',
success (res) {
if (res.confirm) {
UserApi.logout().then(res=>{
if(res.success){
wx.clearStorage()
wx.redirectTo({
url: '../login/login',
})
}
})
} else if (res.cancel) {}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
+1 -1
View File
@@ -72,6 +72,6 @@
</view>
</view>
<view class="logout">
<text>退出登录</text>
<text bindtap="logout">退出登录</text>
</view>
</view>