489 lines
14 KiB
JavaScript
489 lines
14 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const utils_auth = require("../../utils/auth.js");
|
|
const utils_enumUtils = require("../../utils/enumUtils.js");
|
|
const utils_index = require("../../utils/index.js");
|
|
const api_order = require("../../api/order.js");
|
|
const api_auth = require("../../api/auth.js");
|
|
const CustomTabBar = () => "../../components/custom-tab-bar.js";
|
|
const _sfc_main = {
|
|
components: { CustomTabBar },
|
|
data() {
|
|
return {
|
|
userData: {},
|
|
// 当前登录对象
|
|
currentUserData: {},
|
|
// 当前登录对象
|
|
orderTemplList: [
|
|
{
|
|
id: utils_enumUtils.ORDER_TYPE.UNPAID,
|
|
title: "待支付",
|
|
url: "/static/mine/order_unpaid.png",
|
|
path: "/pages/mine_order/mine_order?type=" + utils_enumUtils.MINE_ORDER_TYPE.UNPAID,
|
|
note: "unPayNum"
|
|
},
|
|
{
|
|
id: utils_enumUtils.ORDER_TYPE.UNSHIPPED,
|
|
title: "待发货",
|
|
url: "/static/mine/order_unshipped.png",
|
|
path: "/pages/mine_order/mine_order?type=" + utils_enumUtils.MINE_ORDER_TYPE.UNSHIPPED,
|
|
note: "unSentNum"
|
|
},
|
|
{
|
|
id: utils_enumUtils.ORDER_TYPE.NOT_RECEIVE,
|
|
title: "待收货",
|
|
url: "/static/mine/order_notReceive.png",
|
|
path: "/pages/mine_order/mine_order?type=" + utils_enumUtils.MINE_ORDER_TYPE.NOT_RECEIVE,
|
|
note: "unTakeNum"
|
|
},
|
|
{
|
|
id: utils_enumUtils.ORDER_TYPE.SUCCEED,
|
|
title: "已完成",
|
|
url: "/static/mine/order_afterSale.png",
|
|
path: "/pages/mine_order/mine_order?type=" + utils_enumUtils.MINE_ORDER_TYPE.SUCCEED,
|
|
note: "unCommentNum"
|
|
}
|
|
],
|
|
applyList: [
|
|
{
|
|
id: 1,
|
|
title: "钱包",
|
|
url: "/static/mine/apply_purse.png",
|
|
path: "/pages/mine_purse/mine_purse"
|
|
},
|
|
{
|
|
id: 2,
|
|
title: "抽奖",
|
|
url: "/static/mine/apply_prize.png",
|
|
path: "/pages/turntable/turntable"
|
|
},
|
|
{
|
|
id: 4,
|
|
title: "我的团队",
|
|
url: "/static/mine/tool_team.png",
|
|
path: "/pages/mine_my_team/mine_my_team"
|
|
},
|
|
{
|
|
id: 5,
|
|
title: "加速次数",
|
|
url: "/static/mine/tool_js.png",
|
|
path: "/pages/accelerate/accelerate"
|
|
},
|
|
{
|
|
id: 3,
|
|
title: "交易",
|
|
url: "/static/mine/apply_hm.png"
|
|
}
|
|
// {
|
|
// id:4,
|
|
// title:"贡献值",
|
|
// url:'/static/mine/apply_gx.png'
|
|
// },{
|
|
// id:5,
|
|
// title:"数据",
|
|
// url:'/static/mine/apply_sj.png'
|
|
// },
|
|
],
|
|
// 应用模版
|
|
toolList: [
|
|
{
|
|
id: 5,
|
|
title: "地址管理",
|
|
url: "/static/mine/tool_dz.png",
|
|
path: "/pages/mine_address/mine_address"
|
|
},
|
|
{
|
|
id: 9,
|
|
title: "实名认证",
|
|
url: "/static/mine/tool_sm.png"
|
|
},
|
|
{
|
|
id: 10,
|
|
title: "银行卡管理",
|
|
url: "/static/mine/tool_card.png",
|
|
path: "/pages/mine_bank_card/mine_bank_card"
|
|
},
|
|
{
|
|
id: 3,
|
|
title: "邀请好友",
|
|
url: "/static/mine/tool_invite.png",
|
|
path: "/pages/invite_friends/invite_friends"
|
|
},
|
|
// {
|
|
// id:2,
|
|
// title:"我的团队",
|
|
// url:'/static/mine/tool_team.png',
|
|
// path:"/pages/mine_my_team/mine_my_team",
|
|
// },
|
|
{
|
|
id: 6,
|
|
title: "卡券",
|
|
url: "/static/mine/tool_kj.png"
|
|
// path:"/pages/mine_coupon/mine_coupon",
|
|
},
|
|
{
|
|
id: 7,
|
|
title: "联系客服",
|
|
url: "/static/mine/tool_kf.png"
|
|
},
|
|
// {
|
|
// id:4,
|
|
// title:"加速次数",
|
|
// url:'/static/mine/tool_js.png',
|
|
// path:"/pages/accelerate/accelerate"
|
|
// },
|
|
{
|
|
id: 8,
|
|
title: "商学院资讯",
|
|
url: "/static/mine/tool_sxy.png",
|
|
path: "/pages/news/news"
|
|
},
|
|
{
|
|
id: 11,
|
|
title: "RWA交易",
|
|
url: "/static/mine/tool_hxjy.png"
|
|
}
|
|
// {
|
|
// id:1,
|
|
// title:"IM聊天",
|
|
// url:'/static/mine/tool_im.png'
|
|
// },
|
|
],
|
|
// 工具
|
|
brandShow: false,
|
|
// 品牌入驻弹框
|
|
statisticsObj: {
|
|
unPayNum: 0,
|
|
//待支付数量
|
|
unSentNum: 0,
|
|
//待发货数量
|
|
unTakeNum: 0,
|
|
//待收货数量
|
|
unCommentNum: 0
|
|
//待评价数量
|
|
},
|
|
// 角标统计
|
|
serviceShow: false,
|
|
// 我的客服弹框
|
|
openShow: false
|
|
// 暂未开放
|
|
};
|
|
},
|
|
onShow() {
|
|
this.userData = utils_auth.getStorageFun(utils_auth.USER_DATA);
|
|
this.getStatistics();
|
|
this.getUserInfo();
|
|
},
|
|
mounted() {
|
|
},
|
|
methods: {
|
|
copyData: utils_index.copyData,
|
|
// 查询用户等级
|
|
async getUserInfo() {
|
|
const result = await api_auth.getUserInfo();
|
|
if (result && result.bizcode === 100) {
|
|
result.data;
|
|
this.currentUserData = result.data || {};
|
|
}
|
|
},
|
|
/**
|
|
* 跳转到工具
|
|
* @param {Object} item
|
|
*/
|
|
jumpTool(item) {
|
|
if (item.id === 7) {
|
|
this.serviceShow = true;
|
|
} else if (item.id === 9) {
|
|
const currentUserData = this.currentUserData;
|
|
let path = "/pages/mine_authentication/mine_authentication";
|
|
if (currentUserData && Object.keys(currentUserData).length !== 0 && currentUserData.certStatus && currentUserData.certStatus !== 0) {
|
|
path = "/pages/mine_authentication_ok/mine_authentication_ok";
|
|
}
|
|
common_vendor.index.navigateTo({
|
|
url: path
|
|
});
|
|
} else if (item.path) {
|
|
common_vendor.index.navigateTo({
|
|
url: item.path
|
|
});
|
|
} else {
|
|
this.openShow = true;
|
|
}
|
|
},
|
|
jumpOrder(item) {
|
|
let path = "/pages/mine_order/mine_order";
|
|
if (item && Object.keys(item).length !== 0) {
|
|
path = item.path;
|
|
}
|
|
common_vendor.index.navigateTo({
|
|
url: path
|
|
});
|
|
},
|
|
jumpLogin() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/login/login"
|
|
});
|
|
},
|
|
// 跳转到入驻页面
|
|
jumpEnter(type) {
|
|
if (type === "merchant") {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/merchant_settlement/merchant_settlement"
|
|
});
|
|
} else if (type === "brand") {
|
|
this.brandShow = true;
|
|
}
|
|
},
|
|
copyMobile(mobile) {
|
|
utils_index.copyData(mobile);
|
|
this.brandShow = false;
|
|
},
|
|
// 查询统计
|
|
async getStatistics() {
|
|
const result = await api_order.getStatistics();
|
|
if (result && result.bizcode === 100 && result.data) {
|
|
this.statisticsObj = {
|
|
...result.data,
|
|
unCommentNum: 0
|
|
//待评价数量
|
|
};
|
|
} else {
|
|
this.statisticsObj = {
|
|
unPayNum: 0,
|
|
//待支付数量
|
|
unSentNum: 0,
|
|
//待发货数量
|
|
unTakeNum: 0,
|
|
//待收货数量
|
|
unCommentNum: 0
|
|
//待评价数量
|
|
};
|
|
}
|
|
},
|
|
jumpSetting() {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/mine_settings/mine_settings"
|
|
});
|
|
}
|
|
},
|
|
beforeDestroy() {
|
|
this.statisticsObj = {
|
|
unPayNum: 0,
|
|
//待支付数量
|
|
unSentNum: 0,
|
|
//待发货数量
|
|
unTakeNum: 0,
|
|
//待收货数量
|
|
unCommentNum: 0
|
|
//待评价数量
|
|
};
|
|
}
|
|
};
|
|
if (!Array) {
|
|
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
|
const _easycom_up_badge2 = common_vendor.resolveComponent("up-badge");
|
|
const _component_CustomTabBar = common_vendor.resolveComponent("CustomTabBar");
|
|
const _easycom_up_modal2 = common_vendor.resolveComponent("up-modal");
|
|
(_easycom_up_image2 + _easycom_up_badge2 + _component_CustomTabBar + _easycom_up_modal2)();
|
|
}
|
|
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
|
const _easycom_up_badge = () => "../../uni_modules/uview-plus/components/u-badge/u-badge.js";
|
|
const _easycom_up_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
|
|
if (!Math) {
|
|
(_easycom_up_image + _easycom_up_badge + _easycom_up_modal)();
|
|
}
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: $data.currentUserData && Object.keys($data.currentUserData).length !== 0
|
|
}, $data.currentUserData && Object.keys($data.currentUserData).length !== 0 ? common_vendor.e({
|
|
b: common_vendor.p({
|
|
src: "/static/logo_y.png",
|
|
shape: "circle",
|
|
width: "80",
|
|
height: "80",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
c: common_vendor.t($data.currentUserData.name || "德商汇用户"),
|
|
d: $data.currentUserData && Object.keys($data.currentUserData).length !== 0
|
|
}, $data.currentUserData && Object.keys($data.currentUserData).length !== 0 ? {
|
|
e: common_vendor.p({
|
|
src: $data.currentUserData.gradeLevel || $data.currentUserData.gradeLevel === 0 ? "/static/mine/grade/V" + $data.currentUserData.gradeLevel + ".png" : "/static/mine/grade/V0.png",
|
|
width: "96",
|
|
height: "26",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
f: common_vendor.t($data.currentUserData.gradeName),
|
|
g: common_vendor.n($data.currentUserData.gradeName.length > 3 ? "grade_key_warp grade_key_warp3" : "grade_key_warp grade_key_warp1")
|
|
} : {}, {
|
|
h: common_vendor.t($data.currentUserData.inviteCode),
|
|
i: common_vendor.o(($event) => $options.copyData($data.currentUserData.inviteCode)),
|
|
j: common_vendor.p({
|
|
src: "/static/common/copy.png",
|
|
width: "14",
|
|
height: "14",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
k: common_vendor.p({
|
|
src: "/static/common/setting.png",
|
|
width: "22",
|
|
height: "22",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
l: common_vendor.o((...args) => $options.jumpSetting && $options.jumpSetting(...args))
|
|
}) : {
|
|
m: common_vendor.p({
|
|
src: "/static/mine/avater_not.png",
|
|
shape: "circle",
|
|
width: "80",
|
|
height: "80",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
n: common_vendor.p({
|
|
src: "/static/common/right_y_st.png",
|
|
width: "18",
|
|
height: "18",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
o: common_vendor.o((...args) => $options.jumpLogin && $options.jumpLogin(...args))
|
|
}, {
|
|
p: common_vendor.p({
|
|
src: "/static/common/right.png",
|
|
width: "14",
|
|
height: "14",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
q: common_vendor.o(($event) => $options.jumpOrder({})),
|
|
r: common_vendor.f($data.orderTemplList, (item, k0, i0) => {
|
|
return {
|
|
a: "81c02944-7-" + i0,
|
|
b: common_vendor.p({
|
|
src: item.url,
|
|
width: "30",
|
|
height: "30",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
c: common_vendor.t(item.title),
|
|
d: "81c02944-8-" + i0,
|
|
e: common_vendor.p({
|
|
absolute: true,
|
|
offset: [0, 8],
|
|
max: "99",
|
|
value: $data.statisticsObj[item.note]
|
|
}),
|
|
f: item.id,
|
|
g: common_vendor.o(($event) => $options.jumpOrder(item), item.id)
|
|
};
|
|
}),
|
|
s: common_vendor.f($data.applyList, (item, k0, i0) => {
|
|
return {
|
|
a: "81c02944-9-" + i0,
|
|
b: common_vendor.p({
|
|
src: item.url,
|
|
width: "36",
|
|
height: "36",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
c: common_vendor.t(item.title),
|
|
d: item.id,
|
|
e: common_vendor.o(($event) => $options.jumpTool(item), item.id)
|
|
};
|
|
}),
|
|
t: common_vendor.p({
|
|
src: "/static/common/right_y.png",
|
|
width: "14",
|
|
height: "14",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
v: common_vendor.p({
|
|
src: "/static/mine/enter_sj.png",
|
|
width: "50",
|
|
height: "50",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
w: common_vendor.o(($event) => $options.jumpEnter("merchant")),
|
|
x: common_vendor.p({
|
|
src: "/static/common/right_y.png",
|
|
width: "14",
|
|
height: "14",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
y: common_vendor.p({
|
|
src: "/static/mine/enter_pp.png",
|
|
width: "50",
|
|
height: "50",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
z: common_vendor.o(($event) => $options.jumpEnter("brand")),
|
|
A: common_vendor.f($data.toolList, (item, k0, i0) => {
|
|
return {
|
|
a: "81c02944-14-" + i0,
|
|
b: common_vendor.p({
|
|
src: item.url,
|
|
width: "30",
|
|
height: "30",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
c: common_vendor.t(item.title),
|
|
d: item.id,
|
|
e: common_vendor.o(($event) => $options.jumpTool(item), item.id)
|
|
};
|
|
}),
|
|
B: common_vendor.p({
|
|
tabIndex: 3
|
|
}),
|
|
C: common_vendor.p({
|
|
src: "/static/common/close.png",
|
|
width: "20",
|
|
height: "20",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
D: common_vendor.o(($event) => {
|
|
$data.brandShow = false;
|
|
}),
|
|
E: common_vendor.o(($event) => $options.copyMobile("13922786999")),
|
|
F: common_vendor.o(($event) => {
|
|
$data.brandShow = false;
|
|
}),
|
|
G: common_vendor.p({
|
|
show: $data.brandShow,
|
|
showConfirmButton: false
|
|
}),
|
|
H: common_vendor.p({
|
|
src: "/static/common/close.png",
|
|
width: "20",
|
|
height: "20",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
I: common_vendor.o(($event) => {
|
|
$data.serviceShow = false;
|
|
}),
|
|
J: common_vendor.o(($event) => $options.copyMobile("13888888888")),
|
|
K: common_vendor.o(($event) => {
|
|
$data.serviceShow = false;
|
|
}),
|
|
L: common_vendor.p({
|
|
show: $data.serviceShow,
|
|
showConfirmButton: false
|
|
}),
|
|
M: common_vendor.p({
|
|
src: "/static/common/close.png",
|
|
width: "20",
|
|
height: "20",
|
|
bgColor: "#f1f6ff00"
|
|
}),
|
|
N: common_vendor.o(($event) => {
|
|
$data.openShow = false;
|
|
}),
|
|
O: common_vendor.o(($event) => {
|
|
$data.openShow = false;
|
|
}),
|
|
P: common_vendor.p({
|
|
show: $data.openShow,
|
|
showConfirmButton: false
|
|
})
|
|
});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine/mine.js.map
|