| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const _sfc_main = {
- __name: "mine",
- setup(__props) {
- const isLoggedIn = common_vendor.ref(false);
- const userInfo = common_vendor.ref({
- nickName: "",
- avatarUrl: ""
- });
- const points = common_vendor.ref(900);
- const toggleLogin = () => {
- if (isLoggedIn.value) {
- isLoggedIn.value = false;
- userInfo.value = { nickName: "", avatarUrl: "" };
- common_vendor.index.showToast({ title: "已退出登录", icon: "none" });
- } else {
- isLoggedIn.value = true;
- userInfo.value = {
- nickName: "测试用户",
- // Using a placeholder or one of the existing images as a mock avatar
- avatarUrl: "/static/images/tab_mine_active.png"
- };
- common_vendor.index.showToast({ title: "登录成功", icon: "success" });
- }
- };
- const handleRecharge = () => {
- if (!isLoggedIn.value) {
- common_vendor.index.showToast({ title: "请先登录", icon: "none" });
- return;
- }
- common_vendor.index.showToast({ title: "充值功能开发中", icon: "none" });
- };
- const handleHistory = () => {
- if (!isLoggedIn.value) {
- common_vendor.index.showToast({ title: "请先登录", icon: "none" });
- return;
- }
- common_vendor.index.showToast({ title: "记录功能开发中", icon: "none" });
- };
- return (_ctx, _cache) => {
- return {
- a: isLoggedIn.value && userInfo.value.avatarUrl ? userInfo.value.avatarUrl : "/static/images/tab_mine_active.png",
- b: common_vendor.t(isLoggedIn.value ? userInfo.value.nickName || "微信用户" : "游客"),
- c: common_vendor.t(isLoggedIn.value ? points.value : 0),
- d: common_vendor.o(handleRecharge),
- e: common_vendor.o(handleHistory),
- f: common_vendor.t(isLoggedIn.value ? "退出登录" : "登录"),
- g: common_vendor.o(toggleLogin)
- };
- };
- }
- };
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "D:/program/miniprogram-1/src/pages/mine/mine.vue"]]);
- wx.createPage(MiniProgramPage);
|