diff --git a/components.d.ts b/components.d.ts
index 6df8adc..8316022 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -23,6 +23,7 @@ declare module '@vue/runtime-core' {
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
+ NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPrice: typeof import('@nutui/nutui-taro')['Price']
@@ -33,6 +34,8 @@ declare module '@vue/runtime-core' {
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
+ NutUploader: typeof import('@nutui/nutui-taro')['Uploader']
Pay: typeof import('./src/components/Pay.vue')['default']
+ Upload: typeof import('./src/components/Upload.vue')['default']
}
}
diff --git a/package.json b/package.json
index dc66776..b53ff35 100644
--- a/package.json
+++ b/package.json
@@ -52,6 +52,7 @@
"@tarojs/runtime": "3.6.11",
"@tarojs/shared": "3.6.11",
"@tarojs/taro": "3.6.11",
+ "dayjs": "^1.11.9",
"pinia": "^2.1.6",
"vue": "^3.2.40"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f022802..2bbb069 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -56,12 +56,12 @@ dependencies:
'@tarojs/taro':
specifier: 3.6.11
version: 3.6.11(postcss@8.4.27)(vue@3.2.40)
+ dayjs:
+ specifier: ^1.11.9
+ version: 1.11.9
pinia:
specifier: ^2.1.6
version: 2.1.6(typescript@4.1.2)(vue@3.2.40)
- uqrcodejs:
- specifier: ^4.0.7
- version: 4.0.7
vue:
specifier: ^3.2.40
version: 3.2.40
@@ -6423,6 +6423,10 @@ packages:
whatwg-url: 12.0.1
dev: true
+ /dayjs@1.11.9:
+ resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==}
+ dev: false
+
/debug@2.6.9:
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
peerDependencies:
@@ -13809,10 +13813,6 @@ packages:
tslib: 2.6.1
dev: false
- /uqrcodejs@4.0.7:
- resolution: {integrity: sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==}
- dev: false
-
/uri-js@4.4.1:
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
dependencies:
diff --git a/src/api/goods.ts b/src/api/goods.ts
index 11214ea..de1ed3a 100644
--- a/src/api/goods.ts
+++ b/src/api/goods.ts
@@ -25,4 +25,18 @@ export const getActiveGoods = () => request('/goods', {}, 'POST')
export const getActiveGoodsDetail = (data: object) => request('/goods/details', data, 'POST')
// 活动商品下单
-export const createActiveOrder = (data: object) => request('/order/place', data, 'POST')
\ No newline at end of file
+export const createActiveOrder = (data: object) => request('/order/place', data, 'POST')
+
+// 活动订单列表
+export const getActiveOrderList = (data: object) => request('/user/order', data, 'POST')
+
+// 获取分类列表
+export const getCategoryList = () => request('/goods/class', {}, 'POST')
+
+
+// 活动订单删除
+export const deleteActiveOrder = (data: object) => request('/user/order/remove', data, 'POST')
+
+
+// 积分订单删除
+export const deleteJfOrder = (data: object) => request('/user/point/remove', data, 'POST')
\ No newline at end of file
diff --git a/src/api/order.ts b/src/api/order.ts
index 4b08776..14c7178 100644
--- a/src/api/order.ts
+++ b/src/api/order.ts
@@ -1,4 +1,8 @@
import request from '@/utils/request'
// 订单支付
-export const payOrder = (data: object) => request('/order/confirmOrder', data, 'POST')
\ No newline at end of file
+export const payOrder = (data: object) => request('/order/confirmOrder', data, 'POST')
+
+
+// 获取订单统计
+export const getOrderStatistics = (data: object) => request('/user/order/count', data, 'POST')
\ No newline at end of file
diff --git a/src/api/user.ts b/src/api/user.ts
index 985f7be..31a425e 100644
--- a/src/api/user.ts
+++ b/src/api/user.ts
@@ -4,16 +4,18 @@ import request from "@/utils/request";
export const login = (data: object) => request("/login", data, "POST");
// 获取用户信息
-export const getUserInfo = () => request("/user/detail", {}, "GET");
+// export const getUserInfo = () => request("/user/detail", {}, "GET");
// 获取短信验证码
-export const getVerifyCode = (data: object) => request("/getSmsCode", data, "POST");
+export const getVerifyCode = (data: object) =>
+ request("/getSmsCode", data, "POST");
// 商家入驻申请
-export const applyMer = (data: object) => request("/store/settle", data, "POST");
+export const applyMer = (data: object) =>
+ request("/store/settle", data, "POST");
// 获取商家类型列表
-export const getMerTypeList = () => request("/store/getOther", {},"POST");
+export const getMerTypeList = () => request("/store/getOther", {}, "POST");
// 获取个人信息
export const getPersonalInfo = () => request("/user/info", {}, "POST");
@@ -22,4 +24,32 @@ export const getPersonalInfo = () => request("/user/info", {}, "POST");
export const getBanner = () => request("/rotation", {}, "POST");
// 获取积分订单列表
-export const getIntegralOrderList = (data: object) => request("/user/pointOrder", data, "POST");
+export const getIntegralOrderList = (data: object) =>
+ request("/user/pointOrder", data, "POST");
+
+// 修改个人信息
+export const editPersonalInfo = (data: object) =>
+ request("/user/editInfo", data, "POST");
+
+// 积分明细
+export const getIntegralDetail = (data: object) =>
+ request("/user/pulseRecord", data, "POST");
+
+// 豆子明细
+export const getBeanDetail = (data: object) =>
+ request("/user/pointRecord", data, "POST");
+
+// 授权手机号
+export const getPhone = (data: object) =>
+ request("/user/getPhone", data, "POST");
+
+// 获取推广积分明细
+export const getTGIntegralDetail = (data: object) =>
+ request("/user/referee/point", data, "POST");
+
+// 获取推广用户列表
+export const getTGUserList = (data: object) =>
+ request("/user/referee/list", data, "POST");
+
+// 绑定上级
+export const bindParent = (data: object) => request("/user/bindCode", data, "POST");
diff --git a/src/app.config.ts b/src/app.config.ts
index 9658966..72c0bbb 100644
--- a/src/app.config.ts
+++ b/src/app.config.ts
@@ -15,6 +15,9 @@ export default defineAppConfig({
"settled_mer/index",
"order_list_detail/index",
"account/index",
+ "distribution/index",
+ "distribution/integral/index",
+ "distribution/userlist/index",
],
},
{
@@ -35,7 +38,7 @@ export default defineAppConfig({
},
{
root: "pages/hotGoods",
- pages: ["index/index"],
+ pages: ["index/index", "hot_list/index"],
},
],
window: {
@@ -56,18 +59,18 @@ export default defineAppConfig({
selectedIconPath: "static/tabbar/1-002.png",
text: "首页",
},
- {
- pagePath: "pages/category/index",
- iconPath: "static/tabbar/2-001.png",
- selectedIconPath: "static/tabbar/2-002.png",
- text: "分类",
- },
- {
- pagePath: "pages/cart/index",
- iconPath: "static/tabbar/3-001.png",
- selectedIconPath: "static/tabbar/3-002.png",
- text: "购物车",
- },
+ // {
+ // pagePath: "pages/category/index",
+ // iconPath: "static/tabbar/2-001.png",
+ // selectedIconPath: "static/tabbar/2-002.png",
+ // text: "分类",
+ // },
+ // {
+ // pagePath: "pages/cart/index",
+ // iconPath: "static/tabbar/3-001.png",
+ // selectedIconPath: "static/tabbar/3-002.png",
+ // text: "购物车",
+ // },
{
pagePath: "pages/user/index",
iconPath: "static/tabbar/4-001.png",
@@ -84,4 +87,5 @@ export default defineAppConfig({
requiredBackgroundModes: ["audio", "location"],
// @ts-ignore
requiredPrivateInfos: ["getLocation"],
+ lazyCodeLoading: "requiredComponents",
});
diff --git a/src/components/Pay.vue b/src/components/Pay.vue
index b17dce0..2df4ad7 100644
--- a/src/components/Pay.vue
+++ b/src/components/Pay.vue
@@ -29,7 +29,7 @@
@@ -46,10 +46,12 @@
+
+
diff --git a/src/pages/admin/verify/index.vue b/src/pages/admin/verify/index.vue
index 9251f1a..6f445ff 100644
--- a/src/pages/admin/verify/index.vue
+++ b/src/pages/admin/verify/index.vue
@@ -34,9 +34,9 @@ const scanCode = () => {
scanType: ["qrCode"],
success: async (res) => {
try {
- const user = JSON.parse(Taro.getStorageSync("userInfo"));
+ const mer_type = JSON.parse(Taro.getStorageSync("mer_type"));
let data;
- if (user.mer_type === 1) {
+ if (mer_type === 1) {
data = await activeOrderVerify({
oid: res.result,
});
@@ -44,6 +44,7 @@ const scanCode = () => {
data = await orderVerify({
oid: res.result,
});
+
}
Taro.showToast({
title: data.msg,
diff --git a/src/pages/category/index.vue b/src/pages/category/index.vue
index cb888d3..98df524 100644
--- a/src/pages/category/index.vue
+++ b/src/pages/category/index.vue
@@ -1,39 +1,43 @@
-
- Tab {{ item.name }}
+
+
+ Tab {{ item.name }}
-
+
diff --git a/src/pages/game/gamedetail/index.vue b/src/pages/game/gamedetail/index.vue
index fcb2ca7..b24f784 100644
--- a/src/pages/game/gamedetail/index.vue
+++ b/src/pages/game/gamedetail/index.vue
@@ -1,6 +1,11 @@
-
+
\ No newline at end of file
+
+.tabs-box {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-evenly;
+ align-items: center;
+ height: auto;
+ background-color: #fff;
+ padding: 0 20px;
+ text-align: center;
+
+ .text {
+ margin: 10px 20px;
+ align-items: center;
+ }
+
+ .line {
+ margin: 0 auto;
+ width: 50px;
+ height: 5px;
+ border-radius: 30px;
+ transition: all 0.3s ease-in-out;
+ }
+
+ .lineColor {
+ background-color: #ff0000;
+ }
+}
+.card-list {
+ margin: 10px 20px;
+ background-color: #fff;
+ display: flex;
+ border-radius: 10px;
+ padding: 20px;
+ justify-content: space-between;
+ align-items: center;
+}
+
diff --git a/src/pages/users/distribution/index.config.ts b/src/pages/users/distribution/index.config.ts
new file mode 100644
index 0000000..a3f7e34
--- /dev/null
+++ b/src/pages/users/distribution/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: "我的推广",
+});
diff --git a/src/pages/users/distribution/index.vue b/src/pages/users/distribution/index.vue
new file mode 100644
index 0000000..54a74bb
--- /dev/null
+++ b/src/pages/users/distribution/index.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/users/distribution/integral/index.config.ts b/src/pages/users/distribution/integral/index.config.ts
new file mode 100644
index 0000000..922df3a
--- /dev/null
+++ b/src/pages/users/distribution/integral/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: "积分明细",
+});
diff --git a/src/pages/users/distribution/integral/index.vue b/src/pages/users/distribution/integral/index.vue
new file mode 100644
index 0000000..9865572
--- /dev/null
+++ b/src/pages/users/distribution/integral/index.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+ 昵称:{{ item.nick_name }}
+ 购买商品:{{ item.goods_name }}
+ 支付时间:{{ item.add_time.slice(0, 10) }}
+
+
+ +{{ item.number }}积分
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/users/distribution/userlist/index.config.ts b/src/pages/users/distribution/userlist/index.config.ts
new file mode 100644
index 0000000..a8a7a0e
--- /dev/null
+++ b/src/pages/users/distribution/userlist/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: "推广人统计",
+});
diff --git a/src/pages/users/distribution/userlist/index.vue b/src/pages/users/distribution/userlist/index.vue
new file mode 100644
index 0000000..59501e9
--- /dev/null
+++ b/src/pages/users/distribution/userlist/index.vue
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+ {{ item.nickName }}
+ {{ item.phone }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/users/order_list/index.js b/src/pages/users/order_list/index.js
new file mode 100644
index 0000000..e8a1f12
--- /dev/null
+++ b/src/pages/users/order_list/index.js
@@ -0,0 +1,9 @@
+const obj = {
+ a: 1,
+ b: 3,
+ c: 10,
+};
+
+Object.keys(obj).forEach((item, index) => {
+ console.log(obj[item]);
+});
diff --git a/src/pages/users/order_list/index.vue b/src/pages/users/order_list/index.vue
index bce8f97..085ec9d 100644
--- a/src/pages/users/order_list/index.vue
+++ b/src/pages/users/order_list/index.vue
@@ -9,6 +9,8 @@ import {
} from "@tarojs/taro";
import Pay from "@/components/Pay.vue";
import { getIntegralOrderList } from "@/api/user";
+import { deleteJfOrder } from "@/api/goods";
+import { getOrderStatistics } from "@/api/order";
const tabValue = ref(0);
@@ -18,7 +20,7 @@ const tabsList = ref([
{
title: "全部",
value: 0,
- num: 3,
+ num: 0,
},
{
title: "待付款",
@@ -28,23 +30,24 @@ const tabsList = ref([
{
title: "待使用",
value: 2,
- num: 1,
+ num: 0,
},
{
title: "已使用",
value: 3,
- num: 1,
+ num: 0,
},
{
title: "已失效",
value: 4,
- num: 1,
+ num: 0,
},
]);
const jfInfo = ref({});
interface OrderList {
+ oid: string;
add_time: string;
status: number;
BindGoods: {
@@ -68,6 +71,7 @@ const getList = async () => {
const res = await getIntegralOrderList({
status: tabValue.value,
});
+
console.log(res);
orderList.value = res.data.data;
} catch (error) {
@@ -76,6 +80,7 @@ const getList = async () => {
icon: "none",
});
}
+ getTj();
};
const tabChange = (index: number) => {
@@ -88,9 +93,8 @@ useReachBottom(() => {
});
const openPay = (item: OrderList) => {
- console.log("openPay", item);
isShowPay.value = true;
- jfInfo.value = item;
+ jfInfo.value = [item];
};
const errPay = () => {
@@ -100,6 +104,7 @@ const errPay = () => {
icon: "none",
});
jfInfo.value = {};
+ getList();
};
const closePay = () => {
isShowPay.value = false;
@@ -108,6 +113,7 @@ const closePay = () => {
icon: "none",
});
jfInfo.value = {};
+ getList();
};
const toDetail = (item: any) => {
@@ -116,6 +122,40 @@ const toDetail = (item: any) => {
url: `/pages/users/order_list_detail/index?orderId=${item.oid}`,
});
};
+
+const delOrder = async (oid: string) => {
+ try {
+ const res = await deleteJfOrder({ oid });
+ console.log(res);
+ } catch (error) {
+ showToast({
+ title: error.msg,
+ icon: "none",
+ });
+ }
+ getList();
+};
+
+const countInfo = ref({});
+
+const getTj = async () => {
+ try {
+ const res = await getOrderStatistics({
+ type: 2,
+ });
+ countInfo.value = res.data.data;
+ tabsList.value[0].num = countInfo.value.A || 0;
+ tabsList.value[1].num = countInfo.value.B || 0;
+ tabsList.value[2].num = countInfo.value.C || 0;
+ tabsList.value[3].num = countInfo.value.D || 0;
+ tabsList.value[4].num = countInfo.value.F || 0;
+ } catch (error) {
+ showToast({
+ title: error.msg,
+ icon: "none",
+ });
+ }
+};
@@ -124,7 +164,7 @@ const toDetail = (item: any) => {
订单信息
消费订单:{{ 10 || 0 }} 总消费积分:{{ 12312 || 0 }}
+ >总消费积分:{{ countInfo.Total || 0 }}
@@ -167,17 +207,17 @@ const toDetail = (item: any) => {
{{ item.BindGoods.name }}
- {{ item.BindGoods.number }}
+ {{ item.number }}
x{{ item.count }}
-
共{{ item.count }}件商品,实付积分:
{{ item.number }}
-
+ -->
@@ -186,6 +226,7 @@ const toDetail = (item: any) => {
plain
size="small"
type="primary"
+ @click="delOrder(item.oid)"
>取消订单
{{ goodInfo.BindGoods.name }}
- {{ goodInfo.BindGoods.number }}
+ {{ goodInfo.number }}
x{{ goodInfo.count }}
@@ -59,6 +59,15 @@
title="下单时间:"
:desc="goodInfo.add_time.slice(0, 19)"
>
+
实付款(积分):
+ >实付款({{ type === "1" ? "元" : "积分" }}):
- 取消订单
-
+ -->
+
@@ -139,9 +155,11 @@ import {
getStorageSync,
makePhoneCall,
openLocation,
+ showToast,
} from "@tarojs/taro";
import { Service, Find } from "@nutui/icons-vue-taro";
import { ref } from "vue";
+import dayjs from "dayjs";
const goodInfo = ref({});
@@ -165,11 +183,15 @@ const statusList = ref([
]);
const isShowCode = ref(false);
+const isShowPay = ref(false);
+const jfInfo = ref({});
+
+const type = ref("");
const url = ref("");
useLoad((options) => {
- console.log("options", options);
+ type.value = options.type;
goodInfo.value = getStorageSync("item");
});
@@ -187,7 +209,27 @@ const toAdder = () => {
});
};
-const openPay = () => {};
+const openPay = () => {
+ isShowPay.value = true;
+ jfInfo.value = getStorageSync("item");
+};
+
+const errPay = () => {
+ isShowPay.value = false;
+ showToast({
+ title: "支付失败",
+ icon: "none",
+ });
+ jfInfo.value = {};
+};
+const closePay = () => {
+ isShowPay.value = false;
+ showToast({
+ title: "支付取消",
+ icon: "none",
+ });
+ jfInfo.value = {};
+};
const openCode = () => {
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
diff --git a/src/pages/users/settled_mer/index.vue b/src/pages/users/settled_mer/index.vue
index 478016d..e639c32 100644
--- a/src/pages/users/settled_mer/index.vue
+++ b/src/pages/users/settled_mer/index.vue
@@ -1,213 +1,388 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
{{ smsStr }}
-
-
+
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 提交
+ 提交
-
{
page {
background-image: url("~@/static/merchantBg.jpg");
background-size: 100%;
- background-color: #E93423;
+ background-color: #e93423;
background-repeat: no-repeat;
}
-
.form {
position: relative;
- top: 300px;
+ top: 200px;
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
.btn {
padding: 20px;
@@ -247,4 +423,4 @@ page {
justify-content: space-between;
align-items: center;
}
-
\ No newline at end of file
+
diff --git a/src/pages/users/user_setting/index.vue b/src/pages/users/user_setting/index.vue
index b7b5447..8cf5c95 100644
--- a/src/pages/users/user_setting/index.vue
+++ b/src/pages/users/user_setting/index.vue
@@ -1,94 +1,218 @@
-
-
- 管理我的账号
-
-
-
-
-
- 微信用户
-
-
-
-
-
-
-
-
-
-
-
- 退出登录
-
+
+
+ 管理我的账号
+
+
+
+
+
+
+
+
-
+ {{ userInfo.nickName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存信息
+
+
+ 退出登录
+
+
\ No newline at end of file
+.nut-input {
+ width: 400px !important;
+ padding: 0 !important;
+}
+
+.nut-cell {
+ display: flex;
+ align-items: center;
+}
+
+.phoneBtn {
+ padding: 0 !important;
+ margin: 0 !important;
+ border-radius: 0 !important;
+ background-color: transparent !important;
+ border: none !important;
+}
+
diff --git a/src/static/user/1.png b/src/static/user/1.png
new file mode 100644
index 0000000..937278d
Binary files /dev/null and b/src/static/user/1.png differ
diff --git a/src/static/user/2.png b/src/static/user/2.png
new file mode 100644
index 0000000..b4cf28e
Binary files /dev/null and b/src/static/user/2.png differ
diff --git a/src/static/user/3.png b/src/static/user/3.png
new file mode 100644
index 0000000..e9c55a8
Binary files /dev/null and b/src/static/user/3.png differ
diff --git a/src/static/user/4.png b/src/static/user/4.png
new file mode 100644
index 0000000..cd4b0d9
Binary files /dev/null and b/src/static/user/4.png differ
diff --git a/src/utils/request.ts b/src/utils/request.ts
index 667d29e..9cd61bd 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -1,6 +1,9 @@
-import Taro from '@tarojs/taro'
+import Taro from "@tarojs/taro";
-const BASE_URL = process.env.NODE_ENV === 'development' ? 'http://192.168.2.3:9000' : 'https://www.wanzhuanyongcheng.cn'
+export const BASE_URL =
+ process.env.NODE_ENV === "development"
+ ? "http://192.168.2.3:9000/app"
+ : "https://www.wanzhuanyongcheng.cn/app";
interface Res {
code: number;
@@ -8,41 +11,47 @@ interface Res {
msg: string;
}
-type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
+type Method = "GET" | "POST" | "PUT" | "DELETE";
const request = (
url: string,
data: object = {},
- method: Method = 'GET'
+ method: Method = "GET"
): Promise> => {
return new Promise((resolve, reject) => {
Taro.showLoading({
- title: '加载中...',
- mask: true
- })
+ title: "加载中...",
+ mask: true,
+ });
Taro.request({
- url: BASE_URL + '/app' + url,
+ url: BASE_URL + url,
data: data,
method: method,
header: {
- 'content-type': 'application/json',
- token: Taro.getStorageSync('token')
+ "content-type": "application/json",
+ token: Taro.getStorageSync("token"),
},
- success: ({data}) => {
- Taro.hideLoading()
- if (data.code !== 200)
- return reject({code: 1, msg: data.msg})
- resolve(data)
+ success: ({ data }) => {
+ Taro.hideLoading();
+ if (data.code !== 200) {
+ Taro.showToast({
+ title: data.msg,
+ icon: "none",
+ });
+ reject(data);
+ return;
+ }
+ resolve(data);
},
fail: () => {
Taro.showToast({
- title: '服务器异常',
- icon: 'none'
- })
- reject({code: 1, msg: '服务器异常'})
- }
- })
- })
-}
+ title: "服务器异常",
+ icon: "none",
+ });
+ reject({ code: 1, msg: "服务器异常" });
+ },
+ });
+ });
+};
-export default request
\ No newline at end of file
+export default request;