166 lines
6.5 KiB
JavaScript
166 lines
6.5 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_user = require("../../api/user.js");
|
|
const utils_helper = require("../../utils/helper.js");
|
|
const api_order = require("../../api/order.js");
|
|
const api_config = require("../../api/config.js");
|
|
if (!Array) {
|
|
const _easycom_nut_avatar2 = common_vendor.resolveComponent("nut-avatar");
|
|
const _easycom_nut_icon2 = common_vendor.resolveComponent("nut-icon");
|
|
const _easycom_nut_grid_item2 = common_vendor.resolveComponent("nut-grid-item");
|
|
const _easycom_nut_grid2 = common_vendor.resolveComponent("nut-grid");
|
|
const _easycom_nut_cell_group2 = common_vendor.resolveComponent("nut-cell-group");
|
|
const _easycom_nut_cell2 = common_vendor.resolveComponent("nut-cell");
|
|
(_easycom_nut_avatar2 + _easycom_nut_icon2 + _easycom_nut_grid_item2 + _easycom_nut_grid2 + _easycom_nut_cell_group2 + _easycom_nut_cell2)();
|
|
}
|
|
const _easycom_nut_avatar = () => "../../uni_modules/nutui-uni/components/avatar/avatar.js";
|
|
const _easycom_nut_icon = () => "../../uni_modules/nutui-uni/components/icon/icon.js";
|
|
const _easycom_nut_grid_item = () => "../../uni_modules/nutui-uni/components/griditem/griditem.js";
|
|
const _easycom_nut_grid = () => "../../uni_modules/nutui-uni/components/grid/grid.js";
|
|
const _easycom_nut_cell_group = () => "../../uni_modules/nutui-uni/components/cellgroup/cellgroup.js";
|
|
const _easycom_nut_cell = () => "../../uni_modules/nutui-uni/components/cell/cell.js";
|
|
if (!Math) {
|
|
(_easycom_nut_avatar + _easycom_nut_icon + _easycom_nut_grid_item + _easycom_nut_grid + _easycom_nut_cell_group + _easycom_nut_cell)();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "index",
|
|
setup(__props) {
|
|
const audit = common_vendor.ref(true);
|
|
const showMyOrder = common_vendor.ref(false);
|
|
const phone = common_vendor.ref("");
|
|
const uid = common_vendor.ref(0);
|
|
const userInfo = common_vendor.reactive({});
|
|
const countInfo = common_vendor.reactive({
|
|
all: 0,
|
|
payment: 0,
|
|
delivery: 0,
|
|
received: 0
|
|
});
|
|
common_vendor.onLoad((options) => {
|
|
});
|
|
const makePhoneCall = (phoneNumber) => {
|
|
common_vendor.index.__f__("log", "at pages/mine/index.vue:163", 123);
|
|
common_vendor.index.makePhoneCall({
|
|
phoneNumber,
|
|
success: () => {
|
|
common_vendor.index.__f__("log", "at pages/mine/index.vue:167", "拨打电话成功");
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/mine/index.vue:170", "拨打电话失败:", err);
|
|
}
|
|
});
|
|
};
|
|
const getConfig = () => {
|
|
api_config.fetchGetConfig().then((res) => {
|
|
common_vendor.index.__f__("log", "at pages/mine/index.vue:179", "getConfig=====>", res);
|
|
audit.value = res.appConfig.is_audit == 1;
|
|
phone.value = res.appConfig.shop_phone;
|
|
});
|
|
};
|
|
common_vendor.onShow(() => {
|
|
common_vendor.index.__f__("log", "at pages/mine/index.vue:190", "init");
|
|
let userId = common_vendor.index.getStorageSync("uid");
|
|
common_vendor.index.__f__("log", "at pages/mine/index.vue:193", "userId", userId);
|
|
uid.value = userId;
|
|
getConfig();
|
|
if (uid.value > 0) {
|
|
api_user.fetchUserInfo().then((res) => {
|
|
Object.assign(userInfo, res);
|
|
showMyOrder.value = true;
|
|
api_order.fetchOrderTotalCount().then((res2) => {
|
|
Object.assign(countInfo, res2);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: uid.value > 0
|
|
}, uid.value > 0 ? {
|
|
b: common_vendor.p({
|
|
size: "large"
|
|
}),
|
|
c: common_vendor.t(userInfo.nickName),
|
|
d: common_vendor.t(userInfo.user_id)
|
|
} : {
|
|
e: common_vendor.p({
|
|
name: "my"
|
|
}),
|
|
f: common_vendor.p({
|
|
size: "large"
|
|
}),
|
|
g: common_vendor.o(($event) => common_vendor.unref(utils_helper.goToLoginPage)()),
|
|
h: common_vendor.o(($event) => common_vendor.unref(utils_helper.goToLoginPage)())
|
|
}, {
|
|
i: common_vendor.p({
|
|
name: "people"
|
|
}),
|
|
j: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/store")),
|
|
k: common_vendor.p({
|
|
text: "商城配置"
|
|
}),
|
|
l: common_vendor.p({
|
|
name: "refresh"
|
|
}),
|
|
m: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/price")),
|
|
n: common_vendor.p({
|
|
text: "价格调整"
|
|
}),
|
|
o: common_vendor.p({
|
|
name: "shop"
|
|
}),
|
|
p: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/goodsList")),
|
|
q: common_vendor.p({
|
|
text: "商品管理"
|
|
}),
|
|
r: common_vendor.p({
|
|
name: "order"
|
|
}),
|
|
s: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/config/shopOrder/index?tab=0")),
|
|
t: common_vendor.p({
|
|
text: "店铺订单"
|
|
}),
|
|
v: common_vendor.p({
|
|
title: "店铺管理"
|
|
}),
|
|
w: showMyOrder.value && !audit.value
|
|
}, showMyOrder.value && !audit.value ? {
|
|
x: common_vendor.t(countInfo.all),
|
|
y: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/order/index?tab=0")),
|
|
z: common_vendor.p({
|
|
text: "全部"
|
|
}),
|
|
A: common_vendor.t(countInfo.payment),
|
|
B: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/order/index?tab=1")),
|
|
C: common_vendor.p({
|
|
text: "待付款"
|
|
}),
|
|
D: common_vendor.t(countInfo.delivery),
|
|
E: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/order/index?tab=2")),
|
|
F: common_vendor.p({
|
|
text: "待发货"
|
|
}),
|
|
G: common_vendor.t(countInfo.received),
|
|
H: common_vendor.o(($event) => common_vendor.unref(utils_helper.navigateTo)("/pages/order/index?tab=3")),
|
|
I: common_vendor.p({
|
|
text: "待收货"
|
|
}),
|
|
J: common_vendor.p({
|
|
title: "我的订单"
|
|
})
|
|
} : {}, {
|
|
K: common_vendor.o(($event) => makePhoneCall(phone.value)),
|
|
L: common_vendor.p({
|
|
title: phone.value
|
|
}),
|
|
M: common_vendor.p({
|
|
title: "联系我们"
|
|
})
|
|
});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-569e925a"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/index.js.map
|