| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- "use strict";
- const common_vendor = require("../../common/vendor.js");
- const utils_assets = require("../../utils/assets.js");
- const ErpTabBar = () => "../../components/erp-tab-bar/erp-tab-bar.js";
- const _sfc_main = {
- components: {
- ErpTabBar
- },
- data() {
- return {
- assets: utils_assets.assets,
- isLogin: false,
- // 控制登录状态
- orderStates: [
- { label: "待审核", icon: utils_assets.assets.minePendingReview },
- { label: "待签批", icon: utils_assets.assets.minePendingSign },
- { label: "生产中", icon: utils_assets.assets.mineProducing },
- { label: "已完成", icon: utils_assets.assets.mineCompleted }
- ],
- menuList: [
- { label: "用户协议", icon: utils_assets.assets.mineProtocol, id: "agreement" },
- { label: "隐私政策", icon: utils_assets.assets.minePrivacy, id: "privacy" },
- { label: "投诉与建议", icon: utils_assets.assets.mineComplaint, id: "complaint" },
- { label: "联系客服", icon: utils_assets.assets.mineService, id: "service" }
- ]
- };
- },
- onShow() {
- this.isLogin = !!common_vendor.index.getStorageSync("isLogin");
- },
- methods: {
- goToLogin() {
- common_vendor.index.navigateTo({ url: "/pages/login/login?redirect=" + encodeURIComponent("/pages/mine/mine") });
- },
- // 跳转至设置页面
- goToSettings() {
- if (this.isLogin) {
- common_vendor.index.navigateTo({
- url: "/pages/mine/settings"
- });
- }
- },
- // 新增:跳转至订单列表
- goToOrderList(status) {
- if (!this.isLogin) {
- return this.goToLogin();
- }
- common_vendor.index.navigateTo({
- url: `/pages/order/list?tab=${status}`
- });
- },
- handleLogout() {
- common_vendor.index.showModal({
- title: "退出提示",
- content: "确认退出当前账号吗?",
- confirmColor: "#C1001C",
- success: (res) => {
- if (res.confirm) {
- common_vendor.index.removeStorageSync("isLogin");
- this.isLogin = false;
- }
- }
- });
- },
- // 新增:菜单点击处理
- handleMenuClick(menu) {
- if (menu.id === "agreement") {
- common_vendor.index.navigateTo({ url: "/pages/mine/agreement" });
- } else if (menu.id === "privacy") {
- common_vendor.index.navigateTo({ url: "/pages/mine/privacy" });
- } else if (menu.id === "complaint") {
- common_vendor.index.navigateTo({ url: "/pages/mine/complaint" });
- } else if (menu.id === "service") {
- common_vendor.index.showModal({
- title: "联系客服",
- content: "客服电话:138-8888-8888",
- confirmText: "立即拨打",
- confirmColor: "#C1001C",
- cancelColor: "#999999",
- success: (res) => {
- if (res.confirm) {
- common_vendor.index.makePhoneCall({
- phoneNumber: "13888888888"
- });
- }
- }
- });
- }
- }
- }
- };
- if (!Array) {
- const _easycom_erp_tab_bar2 = common_vendor.resolveComponent("erp-tab-bar");
- _easycom_erp_tab_bar2();
- }
- const _easycom_erp_tab_bar = () => "../../components/erp-tab-bar/erp-tab-bar.js";
- if (!Math) {
- _easycom_erp_tab_bar();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.isLogin
- }, $data.isLogin ? {
- b: $data.assets.mineSettings,
- c: common_vendor.o((...args) => $options.goToSettings && $options.goToSettings(...args))
- } : {
- d: $data.assets.mineArrow,
- e: common_vendor.o((...args) => $options.goToLogin && $options.goToLogin(...args))
- }, {
- f: $data.assets.mineArrow,
- g: common_vendor.o(($event) => $options.goToOrderList(0)),
- h: common_vendor.f($data.orderStates, (item, index, i0) => {
- return {
- a: item.icon,
- b: common_vendor.t(item.label),
- c: index,
- d: common_vendor.o(($event) => $options.goToOrderList(index + 1), index)
- };
- }),
- i: common_vendor.f($data.menuList, (menu, index, i0) => {
- return {
- a: menu.icon,
- b: common_vendor.t(menu.label),
- c: index,
- d: common_vendor.o(($event) => $options.handleMenuClick(menu), index)
- };
- }),
- j: $data.assets.mineArrow,
- k: $data.isLogin
- }, $data.isLogin ? {
- l: common_vendor.o((...args) => $options.handleLogout && $options.handleLogout(...args))
- } : {}, {
- m: common_vendor.p({
- active: "mine"
- })
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7c2ebfa5"]]);
- wx.createPage(MiniProgramPage);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/mine.js.map
|