53 lines
1.6 KiB
JavaScript
53 lines
1.6 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const common_config = require("../../common/config.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
isVip: false,
|
|
expire: "",
|
|
price: common_config.VIP_PRICE_PER_MONTH
|
|
};
|
|
},
|
|
onShow() {
|
|
this.loadVip();
|
|
},
|
|
computed: {
|
|
expireDisplay() {
|
|
const s = String(this.expire || "");
|
|
return s || "11年11月11日";
|
|
}
|
|
},
|
|
methods: {
|
|
loadVip() {
|
|
try {
|
|
this.isVip = String(common_vendor.index.getStorageSync("USER_VIP_IS_VIP") || "false").toLowerCase() === "true";
|
|
this.expire = common_vendor.index.getStorageSync("USER_VIP_END") || "";
|
|
} catch (e) {
|
|
}
|
|
},
|
|
onPay() {
|
|
common_vendor.index.showToast({ title: "静态页面演示:支付功能未接入", icon: "none" });
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: common_vendor.t($data.isVip ? "VIP会员" : "成为VIP会员"),
|
|
b: common_vendor.t($data.isVip ? "尊享专属特权" : "解锁更多权益"),
|
|
c: common_vendor.t($data.isVip ? "VIP会员" : "普通用户"),
|
|
d: $data.isVip ? 1 : "",
|
|
e: $data.isVip
|
|
}, $data.isVip ? {
|
|
f: common_vendor.t($options.expireDisplay)
|
|
} : {}, {
|
|
g: !$data.isVip
|
|
}, !$data.isVip ? {
|
|
h: common_vendor.t($data.price),
|
|
i: common_vendor.o((...args) => $options.onPay && $options.onPay(...args))
|
|
} : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/my/vip.js.map
|