qa-education-exam-weapp/pages/mine/index/index.js

36 lines
847 B
JavaScript
Raw Normal View History

2026-04-17 16:26:28 +08:00
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(() => {
})
}
})