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
a7863b18183458113c9e7b3e40f5d35e1ed7a34f
1 parent
1199440f
个人中心界面调整,新增交易收入页面
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
18 deletions
apps/pages/home/index.js
apps/pages/home/mine/mine.vue
apps/pages/home/tradeIncome/index.js
apps/pages/home/tradeIncome/tradeIncome.vue
apps/store/home/mine.js
config/home-api-map.js
apps/pages/home/index.js
View file @
a7863b1
import
Mine
from
'./mine'
;
import
Trade
from
'./tradeIncome'
;
export
default
[
{
name
:
'channel'
,
...
...
@@ -7,4 +7,5 @@ export default [
component
:
()
=>
import
(
/* webpackChunkName: "channel" */
'./channel/channel'
)
},
...
Mine
,
...
Trade
,
];
...
...
apps/pages/home/mine/mine.vue
View file @
a7863b1
...
...
@@ -39,13 +39,9 @@ export default {
created() {
this.fetchResource()
this.fetchFavoriteNum()
this.fetchOrderSummary().then(data => {
console.log(data)
})
this.fetchOrderSummary()
this.fetchSellerOrder()
this.fetchAssets().then(data => {
console.log(data)
})
this.fetchAssets()
},
methods: {
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets'])
...
...
apps/pages/home/tradeIncome/index.js
0 → 100644
View file @
a7863b1
export
default
[{
name
:
'mine'
,
path
:
'/xianyu/home/mine/tradeIncome'
,
component
:
()
=>
import
(
/* webpackChunkName: "mine" */
'./tradeIncome'
)
}];
...
...
apps/pages/home/tradeIncome/tradeIncome.vue
0 → 100644
View file @
a7863b1
<template>
<LayoutApp :show-back="true">
<div class="body" ref="body">
<h2>trade</h2>
</div>
</LayoutApp>
</template>
<script>
// import tabItem from './components/tabItem';
import { createNamespacedHelpers } from 'vuex';
const {mapGetters, mapActions} = createNamespacedHelpers('home/mine');
export default {
data() {
return {
}
},
computed:{
},
created() {
this.fetchAssets().then(data => {
console.log(data)
})
},
methods: {
...mapActions(['fetchAssets'])
},
components: {
}
};
</script>
<style lang="scss" scoped>
.body {
height: 100%;
overflow-y: auto;
background-color: white;
padding: 0 40px;
}
</style>
...
...
apps/store/home/mine.js
View file @
a7863b1
import
{
parseAssetList
,
maskAccount
}
from
'../../utils/mine-handler'
;
import
{
parseAssetList
,
formatNumber
,
maskAccount
}
from
'../../utils/mine-handler'
;
import
{
get
,
set
}
from
'lodash'
;
import
{
getImgUrl
}
from
'../../common/utils'
;
// const uid = '600046428';
const
uid
=
'
75339977
'
;
const
uid
=
'
500031424
'
;
const
MINE_RESOURCE_CODE1
=
'11a73219a63b50067d88e75c0fe04d10'
;
const
MINE_RESOURCE_CODE2
=
'dc2731fbbebcba6329c74a379e9c41ec'
;
...
...
@@ -20,6 +20,7 @@ export default function() {
failNum
:
0
,
favoriteNum
:
0
,
buyNum
:
0
,
askBuyNum
:
0
,
assetData
:
{
list
:
[],
currentPage
:
1
,
...
...
@@ -50,8 +51,7 @@ export default function() {
resource1
:
{
name
:
'resource1'
,
data
:
state
.
resource1
},
income
:
{
title
:
'交易收入'
,
num
:
state
.
assetData
.
totalIncome
},
buyOrder
:
{
title
:
'我购买的订单'
,
num
:
state
.
buyNum
},
// buy: {name: 'buy', title: '我的求购', num: 1},
buy
:
{
name
:
'buy'
,
title
:
'我的求购'
,
num
:
state
.
askBuyNum
},
collect
:
{
name
:
'collect'
,
title
:
'我的收藏'
,
num
:
state
.
favoriteNum
},
resource2
:
{
name
:
'resource2'
,
data
:
state
.
resource2
}
};
...
...
@@ -99,10 +99,22 @@ export default function() {
addFavoriteNum
(
state
,
{
count
})
{
state
.
favoriteNum
=
count
;
},
addOrderSummary
(
state
,
{
count
})
{
state
.
buyNum
=
count
;
addOrderSummary
(
state
,
{
data
})
{
data
.
forEach
((
item
)
=>
{
switch
(
item
.
actor
)
{
case
'buy'
:
state
.
buyNum
=
item
.
sum
;
break
;
case
'bid'
:
state
.
askBuyNum
=
item
.
sum
;
break
;
default
:
break
;
}
});
},
addAssets
(
state
,
assetData
)
{
assetData
.
totalIncome
=
formatNumber
(
assetData
.
totalIncome
);
state
.
assetData
=
Object
.
assign
({},
state
.
assetData
,
assetData
);
},
...
...
@@ -156,7 +168,6 @@ export default function() {
if
(
result
.
code
===
200
)
{
commit
(
'addSellerOrder'
,
{
orderSumList
:
result
.
data
});
}
return
result
.
data
||
[];
},
async
fetchFavoriteNum
({
commit
})
{
const
result
=
await
this
.
$api
.
get
(
'/api/ufo/mine/favoriteNum'
,
{
uid
});
...
...
@@ -164,15 +175,13 @@ export default function() {
if
(
result
.
code
===
200
)
{
commit
(
'addFavoriteNum'
,
{
count
:
result
.
data
.
product_favorite_total
});
}
return
result
.
data
||
[];
},
async
fetchOrderSummary
({
commit
})
{
const
result
=
await
this
.
$api
.
get
(
'/api/ufo/mine/order/summary'
,
{
uid
});
if
(
result
.
code
===
200
)
{
commit
(
'addOrderSummary'
,
{
count
:
result
.
data
.
buyCount
});
commit
(
'addOrderSummary'
,
{
data
:
result
.
data
});
}
return
result
.
data
||
[];
},
async
fetchAssets
({
commit
})
{
...
...
config/home-api-map.js
View file @
a7863b1
...
...
@@ -36,7 +36,7 @@ module.exports = {
},
'/api/ufo/mine/order/summary'
:
{
ufo
:
true
,
path
:
'/shopping'
,
path
:
'/
ufo-gateway/
shopping'
,
api
:
'ufo.order.summary'
,
params
:
{
uid
:
{
type
:
Number
},
...
...
Please
register
or
login
to post a comment