上传代码
This commit is contained in:
270
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.js
vendored
Normal file
270
distribution/unpackage/dist/dev/mp-alipay/pages/my/my.js
vendored
Normal file
@ -0,0 +1,270 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const API_api = require("../../API/api.js");
|
||||
if (!Array) {
|
||||
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
||||
const _easycom_uni_popup2 = common_vendor.resolveComponent("uni-popup");
|
||||
(_easycom_uni_icons2 + _easycom_uni_popup2)();
|
||||
}
|
||||
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
||||
const _easycom_uni_popup = () => "../../uni_modules/uni-popup/components/uni-popup/uni-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_uni_icons + _easycom_uni_popup)();
|
||||
}
|
||||
const __default__ = {
|
||||
data() {
|
||||
return {
|
||||
items: [
|
||||
{
|
||||
label: "我的订单"
|
||||
},
|
||||
{
|
||||
label: "收入查询"
|
||||
},
|
||||
{
|
||||
label: "我的钱包"
|
||||
},
|
||||
{
|
||||
label: "身份认证"
|
||||
},
|
||||
{
|
||||
label: "申诉中心"
|
||||
},
|
||||
{
|
||||
label: "服务评价"
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
||||
__name: "my",
|
||||
setup(__props) {
|
||||
common_vendor.index.getStorageSync("userInfo");
|
||||
const login = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/user/logout",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res);
|
||||
common_vendor.index.removeStorageSync("userInfo");
|
||||
common_vendor.index.removeStorageSync("currentUser");
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/login/login"
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const signOut = () => {
|
||||
common_vendor.index.showModal({
|
||||
title: "是否注销账号",
|
||||
content: "注销账号后将无法再次登录",
|
||||
showCancel: true,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log("点击了确定按钮");
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errand/delete",
|
||||
method: "POST",
|
||||
success(res2) {
|
||||
console.log(res2);
|
||||
common_vendor.index.reLaunch({
|
||||
url: "/pages/login/login"
|
||||
});
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log("点击了取消按钮");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
const changeUserMessage = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/changeUserMessage/changeUserMessage"
|
||||
});
|
||||
};
|
||||
const navigateToOrder = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/order/order"
|
||||
});
|
||||
};
|
||||
const popupRef = common_vendor.ref("敬请期待");
|
||||
const purse = () => {
|
||||
popupRef.value.open();
|
||||
setTimeout(() => {
|
||||
popupRef.value.close();
|
||||
}, 1e3);
|
||||
};
|
||||
const navigateToAuthentication = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/authentication/authentication"
|
||||
});
|
||||
};
|
||||
const navigateToAppeal = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/appeal/appeal"
|
||||
});
|
||||
};
|
||||
const navigateToServiceEvaluation = () => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/serviceEvaluation/serviceEvaluation"
|
||||
});
|
||||
};
|
||||
const user = common_vendor.ref({ username: "未登录" });
|
||||
const loginState = common_vendor.ref({ loginName: "去登录" });
|
||||
const getCurrentUser = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errand/get/current",
|
||||
method: "POST",
|
||||
header: {
|
||||
"cookie": common_vendor.index.getStorageSync("cookie")
|
||||
},
|
||||
success(res) {
|
||||
console.log(res);
|
||||
if (res.data.code === 0) {
|
||||
common_vendor.index.setStorageSync("currentUser", res.data.data);
|
||||
user.value = res.data.data;
|
||||
loginState.value = { loginName: "退出登录" };
|
||||
} else {
|
||||
user.value = { username: "未登录" };
|
||||
}
|
||||
},
|
||||
fail(err) {
|
||||
console.error("请求失败:", err);
|
||||
user.value = { username: "未登录" };
|
||||
}
|
||||
});
|
||||
};
|
||||
common_vendor.onShow(() => {
|
||||
getCurrentUser(), getOrderNumber(), getOrderMoney();
|
||||
getwaitMoney();
|
||||
getallMoney();
|
||||
});
|
||||
const OrderNumber = common_vendor.ref(0);
|
||||
const getOrderNumber = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errandIncome/count/number",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res.data.data);
|
||||
OrderNumber.value = res.data.data;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const OrderMoney = common_vendor.ref(0);
|
||||
const getOrderMoney = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errandIncome/count/money",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res);
|
||||
OrderMoney.value = res.data.data;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const waitMoney = common_vendor.ref(0);
|
||||
const getwaitMoney = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errandIncome/count/money/no",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res);
|
||||
waitMoney.value = res.data.data;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
const allMoney = common_vendor.ref(0);
|
||||
const getallMoney = () => {
|
||||
common_vendor.index.request({
|
||||
url: API_api.apiImageUrl + "/api/errandIncome/count/money/no",
|
||||
method: "POST",
|
||||
success(res) {
|
||||
console.log(res);
|
||||
allMoney.value = res.data.data;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: user.value.errandAvatarUrl || "../../static/logo.png",
|
||||
b: common_vendor.o(changeUserMessage),
|
||||
c: common_vendor.t(user.value.errandName || "未登录"),
|
||||
d: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
e: common_vendor.t(allMoney.value),
|
||||
f: common_vendor.t(OrderNumber.value),
|
||||
g: common_vendor.o(navigateToOrder),
|
||||
h: common_vendor.t(OrderMoney.value),
|
||||
i: common_vendor.o(purse),
|
||||
j: common_vendor.t(waitMoney.value),
|
||||
k: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
l: common_vendor.o(navigateToOrder),
|
||||
m: common_vendor.p({
|
||||
type: "right",
|
||||
size: "25"
|
||||
}),
|
||||
n: common_vendor.o(purse),
|
||||
o: () => ({
|
||||
r: popupRef,
|
||||
k: "popupRef"
|
||||
}),
|
||||
p: common_vendor.p({
|
||||
type: "center",
|
||||
["background-color"]: "#fff"
|
||||
}),
|
||||
q: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
r: common_vendor.o(navigateToAuthentication),
|
||||
s: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
t: common_vendor.o(navigateToAppeal),
|
||||
v: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
w: common_vendor.o(navigateToServiceEvaluation),
|
||||
x: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
y: common_vendor.o(signOut),
|
||||
z: common_vendor.t(loginState.value.loginName),
|
||||
A: common_vendor.p({
|
||||
type: "right",
|
||||
size: "16"
|
||||
}),
|
||||
B: common_vendor.o(login)
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-2f1ef635"]]);
|
||||
my.createPage(MiniProgramPage);
|
Reference in New Issue
Block a user