Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
xianyu-ufo-app-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
baoss
5 years ago
Commit
c93a2317fc2c5dd6d95c7280f57b5fd777b7a53e
1 parent
1e0d1efd
个人中心增加优惠券数量
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
8 deletions
apps/pages/home/mine/mine.vue
apps/store/home/mine.js
config/home-api-map.js
apps/pages/home/mine/mine.vue
View file @
c93a231
...
...
@@ -43,9 +43,10 @@ export default {
this.fetchSellerOrder()
// this.fetchAssets(true)
this.fetchUserWalletInfo()
this.fetchCoupon()
},
methods: {
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets', 'fetchUserWalletInfo'])
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets', 'fetchUserWalletInfo'
,'fetchCoupon'
])
},
components: {
tabItem,
...
...
apps/store/home/mine.js
View file @
c93a231
...
...
@@ -23,6 +23,7 @@ export default function() {
favoriteNum
:
0
,
buyNum
:
0
,
askBuyNum
:
0
,
couponNum
:
0
,
assetData
:
{
isFetching
:
false
,
list
:
[],
...
...
@@ -79,7 +80,7 @@ export default function() {
buyOrder
:
{
title
:
'我的订单'
,
num
:
state
.
buyNum
,
page
:
''
},
buy
:
{
name
:
'buy'
,
title
:
'我的求购'
,
num
:
state
.
askBuyNum
,
page
:
''
},
collect
:
{
name
:
'collect'
,
title
:
'我的收藏'
,
num
:
state
.
favoriteNum
,
page
:
'favorite'
},
coupon
:
{
name
:
'coupon'
,
title
:
'我的优惠券'
,
num
:
state
.
favorite
Num
,
page
:
''
},
coupon
:
{
name
:
'coupon'
,
title
:
'我的优惠券'
,
num
:
state
.
coupon
Num
,
page
:
''
},
service
:
{
name
:
'service'
,
title
:
'我的客服'
,
page
:
'service'
},
resource2
:
{
name
:
'resource2'
,
data
:
state
.
resource2
}
};
...
...
@@ -171,6 +172,9 @@ export default function() {
}
});
},
addCouponSummary
(
state
,
{
count
})
{
state
.
couponNum
=
count
;
},
addAssets
(
state
,
assetData
)
{
assetData
.
totalIncome
=
formatNumber
(
assetData
.
totalIncome
);
assetData
.
compensateIncome
=
formatNumber
(
assetData
.
compensateIncome
);
...
...
@@ -281,7 +285,13 @@ export default function() {
commit
(
'addOrderSummary'
,
{
data
:
result
.
data
});
}
},
async
fetchCoupon
({
commit
})
{
const
result
=
await
this
.
$api
.
get
(
'/api/ufo/mine/coupon'
,
{
uid
});
if
(
result
.
code
===
200
)
{
commit
(
'addCouponSummary'
,
{
count
:
result
.
data
});
}
},
async
fetchAssets
({
commit
,
state
},
isRefresh
)
{
let
{
isFetching
,
endReached
,
currentPage
,
list
,
pageSize
}
=
state
.
assetData
;
...
...
config/home-api-map.js
View file @
c93a231
...
...
@@ -60,17 +60,20 @@ module.exports = {
auth
:
true
,
path
:
'/ufo-gateway/shopping'
,
api
:
'ufo.order.summary'
,
params
:
{
uid
:
{
type
:
Number
},
},
params
:
{},
},
'/api/ufo/mine/coupon'
:
{
ufo
:
true
,
auth
:
true
,
path
:
'/ufo-gateway/coupon'
,
api
:
'ufo.coupons.cnt'
,
params
:
{},
},
'/api/ufo/mine/resource'
:
{
ufo
:
true
,
api
:
'ufo.resource.get'
,
params
:
{
content_code
:
{
type
:
String
},
uid
:
{
type
:
Number
},
},
content_code
:
{
type
:
String
}},
},
'/api/ufo/home/noticelist'
:
{
ufo
:
true
,
...
...
Please
register
or
login
to post a comment