import Dialog from '@vant/weapp/dialog/dialog'; import {getUserScoreSum} from "../../../api/index"; const app = getApp() Page({ data: { totalScore: 0, userInfo: {} }, onShow(options) { this.setData({ userInfo: app.globalData.userInfo, }) this.getUserScoreSum() }, async getUserScoreSum() { let resData = await getUserScoreSum({USER_ID: app.globalData.userInfo.USER_ID}) this.setData({ totalScore: resData.totalScore }) }, logOut() { Dialog.confirm({ title: '提示', message: '确认退出登陆吗?', }).then(() => { app.globalData.userInfo = {} wx.reLaunch({ url: '/pages/login/login' }) }).catch(() => { }) } })