diff --git a/pages/pay/index.vue b/pages/pay/index.vue
index 4afdf61..57b9803 100644
--- a/pages/pay/index.vue
+++ b/pages/pay/index.vue
@@ -38,7 +38,7 @@
- 余额: {{ fen2yuan(userInfo.money) }}元
+ 余额: {{ fen2yuan(userWallet.money) }}元
sheep.$store('user').userInfo);
+ const userWallet = computed(() => sheep.$store('user').userWallet);
// 检测支付环境
const state = reactive({
@@ -189,6 +189,8 @@
state.orderType = options.orderType;
}
setOrder(id);
+ // 刷新钱包的缓存
+ sheep.$store('user').getWallet();
});
diff --git a/pages/pay/recharge.vue b/pages/pay/recharge.vue
index 32c2723..9432886 100644
--- a/pages/pay/recharge.vue
+++ b/pages/pay/recharge.vue
@@ -9,7 +9,7 @@
]">
当前余额(元)
- {{ fen2yuan(userInfo.money) }}
+ {{ fen2yuan(userWallet.balance) }}
- {{ state.showMoney ? fen2yuan(userInfo.money) : '*****' }}
+ {{ state.showMoney ? fen2yuan(userWallet.balance) : '*****' }}
@@ -122,7 +122,8 @@
value: '2',
},
];
- const userInfo = computed(() => sheep.$store('user').userInfo);
+
+ const userWallet = computed(() => sheep.$store('user').userWallet);
// 格式化时间段
const dateFilterText = computed(() => {
@@ -167,6 +168,8 @@
state.date = [state.today, state.today];
getLogList();
getSummary();
+ // 刷新钱包的缓存
+ sheep.$store('user').getWallet();
});
// 处理 tab 切换
diff --git a/sheep/api/member/user.js b/sheep/api/member/user.js
index 8db9143..a2316fa 100644
--- a/sheep/api/member/user.js
+++ b/sheep/api/member/user.js
@@ -1,6 +1,17 @@
import request from '@/sheep/request';
const UserApi = {
+ // 获得基本信息
+ getUserInfo: () => {
+ return request({
+ url: '/app-api/member/user/get',
+ method: 'GET',
+ custom: {
+ showLoading: false,
+ auth: true,
+ },
+ });
+ },
// 修改基本信息
updateUser: (data) => {
return request({
diff --git a/sheep/api/pay/wallet.js b/sheep/api/pay/wallet.js
index 9287fbe..3a86b47 100644
--- a/sheep/api/pay/wallet.js
+++ b/sheep/api/pay/wallet.js
@@ -1,6 +1,17 @@
import request from '@/sheep/request';
const PayWalletApi = {
+ // 获取钱包
+ getPayWallet() {
+ return request({
+ url: '/app-api/pay/wallet/get',
+ method: 'GET',
+ custom: {
+ showLoading: false,
+ auth: true,
+ },
+ });
+ },
// 获得钱包流水分页
getWalletTransactionPage: (params) => {
const queryString = Object.keys(params)
diff --git a/sheep/api/promotion/coupon.js b/sheep/api/promotion/coupon.js
index be8364e..38b5dcb 100644
--- a/sheep/api/promotion/coupon.js
+++ b/sheep/api/promotion/coupon.js
@@ -57,6 +57,17 @@ const CouponApi = {
params: { id },
});
},
+ // 获得未使用的优惠劵数量
+ getUnusedCouponCount: () => {
+ return request({
+ url: '/app-api/promotion/coupon/get-unused-count',
+ method: 'GET',
+ custom: {
+ showLoading: false,
+ auth: true,
+ },
+ });
+ }
};
export default CouponApi;
\ No newline at end of file
diff --git a/sheep/api/trade/order.js b/sheep/api/trade/order.js
index f2a2b69..372c60c 100644
--- a/sheep/api/trade/order.js
+++ b/sheep/api/trade/order.js
@@ -90,6 +90,17 @@ const OrderApi = {
},
});
},
+ // 获得交易订单数量
+ getOrderCount: () => {
+ return request2({
+ url: '/app-api/trade/order/get-count',
+ method: 'GET',
+ custom: {
+ showLoading: false,
+ auth: true,
+ },
+ });
+ },
// 创建单个评论
createOrderItemComment: (data) => {
return request2({
diff --git a/sheep/api/user.js b/sheep/api/user.js
index 4e8dade..c8e6157 100644
--- a/sheep/api/user.js
+++ b/sheep/api/user.js
@@ -12,24 +12,6 @@ export default {
auth: true,
},
}),
- profile: () =>
- request2({
- url: 'member/user/get',
- method: 'GET',
- custom: {
- showLoading: false,
- auth: true,
- },
- }),
- balance: () =>
- request2({
- url: '/app-api/pay/wallet/get',
- method: 'GET',
- custom: {
- showLoading: false,
- auth: true,
- },
- }),
// 账号登录
accountLogin: (data) =>
request({
@@ -41,28 +23,6 @@ export default {
loadingMsg: '登录中',
},
}),
- // 短信登录
- smsLogin: (data) =>
- request({
- url: '/user/api/user/smsLogin',
- method: 'POST',
- data,
- custom: {
- showSuccess: true,
- loadingMsg: '登录中',
- },
- }),
- // 短信注册
- smsRegister: (data) =>
- request({
- url: '/user/api/user/smsRegister',
- method: 'POST',
- data,
- custom: {
- showSuccess: true,
- loadingMsg: '正在注册',
- },
- }),
// 绑定、更换手机号
changeMobile: (data) =>
@@ -76,28 +36,6 @@ export default {
},
}),
- // 更新小程序信息
- updateMpUserInfo: (data) =>
- request({
- url: '/user/api/user/updateMpUserInfo',
- method: 'POST',
- data,
- }),
-
- // 第三方授权信息
- thirdOauthInfo: () =>
- request({
- url: '/user/api/user/thirdOauth',
- method: 'GET',
- params: {
- provider: $platform.provider,
- platform: $platform.platform,
- },
- custom: {
- showLoading: false,
- },
- }),
-
// 添加分享记录
addShareLog: (data) =>
request({
@@ -132,14 +70,6 @@ export default {
}),
address: {
- // default: () =>
- // request({
- // url: 'user/address/default',
- // method: 'GET',
- // custom: {
- // showError: false,
- // },
- // }),
default: () =>
request2({
url: 'member/address/get-default',
@@ -278,33 +208,5 @@ export default {
auth: true,
},
}),
- },
- //数量接口
- // data: () =>
- // request({
- // url: 'user/user/data',
- // method: 'GET',
- // custom: {
- // showLoading: false,
- // auth: true,
- // },
- // }),
- data: () =>
- request2({
- url: 'trade/order/get-count',
- method: 'GET',
- custom: {
- showLoading: false,
- auth: true,
- },
- }),
- data2: () =>
- request2({
- url: 'trade/after-sale/get-applying-count',
- method: 'GET',
- custom: {
- showLoading: false,
- auth: true,
- },
- }),
+ }
};
\ No newline at end of file
diff --git a/sheep/components/s-order-card/s-order-card.vue b/sheep/components/s-order-card/s-order-card.vue
index a5f0eb0..095e6cf 100644
--- a/sheep/components/s-order-card/s-order-card.vue
+++ b/sheep/components/s-order-card/s-order-card.vue
@@ -9,11 +9,11 @@
>
-
+
@@ -34,6 +34,7 @@
icon: '/static/img/shop/order/no_pay.png',
path: '/pages/order/list',
type: 'unpaid',
+ count: 'unpaidCount',
},
{
title: '待收货',
@@ -41,6 +42,7 @@
icon: '/static/img/shop/order/no_take.png',
path: '/pages/order/list',
type: 'noget',
+ count: 'deliveredCount',
},
{
title: '待评价',
@@ -48,6 +50,7 @@
icon: '/static/img/shop/order/no_comment.png',
path: '/pages/order/list',
type: 'nocomment',
+ count: 'uncommentedCount',
},
{
title: '售后单',
@@ -55,6 +58,7 @@
icon: '/static/img/shop/order/change_order.png',
path: '/pages/order/aftersale/list',
type: 'aftersale',
+ count: 'afterSaleCount',
},
{
title: '全部订单',
@@ -65,7 +69,6 @@
];
const numData = computed(() => sheep.$store('user').numData);
- console.log('更换后的yuda订单数量',numData)