You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

87 lines
3.1 KiB

"use strict";
const common_vendor = require("../../../common/vendor.js");
const config_site_config = require("../../../config/site.config.js");
const config_api = require("../../../config/api.js");
const store_index = require("../../../store/index.js");
if (!Array) {
const _component_avabtnBox = common_vendor.resolveComponent("avabtnBox");
const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
(_component_avabtnBox + _easycom_u_icon2)();
}
const _easycom_u_icon = () => "../../../uni_modules/uview-plus/components/u-icon/u-icon.js";
if (!Math) {
_easycom_u_icon();
}
const _sfc_main = {
__name: "mine",
setup(__props) {
const { imgUrl } = config_site_config.obj;
const topBgUrl = imgUrl + "minebg.png";
const counterStore = store_index.userStore();
const configList = common_vendor.ref([
{ text: "用户协议", url: "/pages/subPage/privacyAgreement/privacyAgreement?type=2" },
{ text: "隐私政策", url: "/pages/subPage/privacyAgreement/privacyAgreement?type=1" }
]);
function logOutFn() {
common_vendor.index.showModal({
content: "确定要退出登录吗?",
success: async function(res) {
if (res.confirm) {
await config_api.logOut();
counterStore.goLogin();
} else if (res.cancel) {
console.log("用户点击取消");
}
}
});
}
async function getUserInfoFn() {
const { data: res } = await config_api.getUserInfo();
counterStore.upDateUseInfo("name", res.userName);
counterStore.upDateUseInfo("userPhone", res.userPhone);
console.log(res);
}
common_vendor.onShow(() => {
counterStore.upDateUseInfo("name", "");
if (counterStore.token && !counterStore.userInfo.name) {
getUserInfoFn();
}
});
return (_ctx, _cache) => {
return common_vendor.e({
a: _ctx.avaUrl
}, _ctx.avaUrl ? {
b: _ctx.avaUrl
} : {}, {
c: common_vendor.unref(counterStore).token
}, common_vendor.unref(counterStore).token ? {
d: common_vendor.t(common_vendor.unref(counterStore).userInfo.name),
e: common_vendor.t(common_vendor.unref(counterStore).userInfo.userPhone)
} : {
f: common_vendor.o(($event) => _ctx.$goPage("/pages/subPage/login/login"))
}, {
g: common_vendor.f(configList.value, (item, index, i0) => {
return {
a: common_vendor.t(item.text),
b: "23ed4277-1-" + i0,
c: index,
d: common_vendor.o(($event) => _ctx.$goPage(item.url), index)
};
}),
h: common_vendor.p({
name: "arrow-right"
}),
i: common_vendor.p({
name: "arrow-right"
}),
j: common_vendor.unref(counterStore).token
}, common_vendor.unref(counterStore).token ? {
k: common_vendor.o(logOutFn)
} : {}, {
l: "url(" + topBgUrl + ") #F5F5F5 no-repeat"
});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-23ed4277"]]);
wx.createPage(MiniProgramPage);