以下是示例代码:
Page({
onLoad: function() {
// 检测是否登录
if (!wx.getStorageSync("isLogin")) {
// 如果没登录,弹窗提醒
wx.showModal({
title: "提示",
content: "请先登录",
showCancel: false
});
return;
}
// 如果已登录,判断是否有设计点数
if (wx.getStorageSync("designPo