Authored by yyq

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

<template>
<div class="no-item" v-else>
<div class="no-item-bg">
<div class="no-item-bg-top"></div>
<div class="no-item-bg-bottom"></div>
</div>
<p>{{tip}}</p>
</div>
</template>
<script>
export default {
name: 'UfoNoItem',
props: {
tip: String
}
};
</script>
<style lang="scss" scoped>
.no-item {
position: relative;
display: flex;
width: 100%;
min-height: 8rem;
flex-direction: column;
align-items: center;
justify-content: center;
.no-item-bg {
position: relative;
width: 186px;
height: 242px;
background-size: 100% 100%;
&-top {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 2;
background-image: url("~statics/image/order/ufo-empty-top.png");
background-size: 100% 100%;
animation: animateUFO 3s linear infinite;
}
&-bottom {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
z-index: 1;
background-image: url("~statics/image/order/ufo-empty-bottom.png");
background-size: 100% 100%;
animation: animateLight 3s linear infinite;
}
}
p {
color: #999;
line-height: 32px;
}
}
@keyframes animateUFO {
0% {
transform: translateY(0px);
}
25% {
transform: translateY(10px);
}
50% {
transform: translateY(0px);
}
75% {
transform: translateY(10px);
}
100% {
transform: translateY(0px);
}
}
@keyframes animateLight {
0% {
transform: skewX(0deg);
}
25% {
transform: skewX(10deg);
}
50% {
transform: skewX(0deg);
}
75% {
transform: skewX(-10deg);
}
100% {
transform: skewX(0deg);
}
}
</style>
... ...
export default [{
export default [
{
name: 'favorite',
path: '/xianyu/home/favorite.html',
component: () => import(/* webpackChunkName: "mine" */ './favorite')
}];
\ No newline at end of file
component: () => import(/* webpackChunkName: "mine" */ './favorite'),
},
];
... ...
<template>
<div class="orders">
<div v-for="(value, key) in getOrderNums" :key="key" @click="goPage(value.page)" class="order-cell">
<p class="order-num">{{value.num}}</p>
<p class="order-text">{{value.name}}</p>
</div>
<div
v-for="(value, key) in getOrderNums"
:key="key"
@click="goPage(value.page)"
class="order-cell"
>
<p class="order-num">{{ value.num }}</p>
<p class="order-text">{{ value.name }}</p>
</div>
</div>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
import { createNamespacedHelpers } from "vuex";
import { ownType } from "../../../../../constants/order-constants";
const {mapGetters, mapActions} = createNamespacedHelpers('home/mine');
const { mapGetters, mapActions } = createNamespacedHelpers("home/mine");
export default {
name: 'order',
props: {
},
name: "order",
props: {},
data() {
return {
};
return {};
},
computed: {
...mapGetters(['getOrderNums'])
},
mounted() {
...mapGetters(["getOrderNums"])
},
mounted() {},
methods: {
goPage({name, status}) {
goPage({ name, status }) {
this.$router.push({
name,
params: {
owner: 'buy',
owner: ownType.SELL,
status
}
})
});
}
}
};
</script>
<style lang="scss" scoped>
.orders {
display: flex;
height: 100px;
justify-content: space-between;
}
.order-cell {
flex: 1;
justify-content: center;
align-items: center;
&:not(:last-child) {
position: relative;
&::after {
content: '';
position: absolute;
width: 1px;
height: 80px;
top: 10px;
right: 0;
background: linear-gradient(#fff, #F0F0F0,#fff)
}
}
}
.order-num {
font-family: 'Alte DIN 1451 Mittelschrift';
font-size: 32px;
text-align: center;
}
.order-text {
padding-top: 10px;
font-size: 24;
color: #444;
text-align: center;
.orders {
display: flex;
height: 100px;
justify-content: space-between;
}
.order-cell {
flex: 1;
justify-content: center;
align-items: center;
&:not(:last-child) {
position: relative;
&:after {
content: "";
position: absolute;
width: 1px;
height: 80px;
top: 10px;
right: 0;
background: linear-gradient(#fff, #f0f0f0, #fff);
}
}
}
.order-num {
font-family: "Alte DIN 1451 Mittelschrift";
font-size: 32px;
text-align: center;
}
.order-text {
padding-top: 10px;
font-size: 24;
color: #444;
text-align: center;
}
</style>
... ...
<template>
<div class="tab-item" :class="itemClass" @click="goPage(data.page)">
<div class="title" :class="titleClass">{{data.title}}</div>
<slot><div class="text">{{data.num}}</div></slot>
<i class="cubeic-arrow"></i>
<div class="tab-item" :class="itemClass" @click="goPage(data)">
<div class="title" :class="titleClass">{{ data.title }}</div>
<slot
><div class="text">{{ data.num }}</div></slot
>
<i class="cubeic-arrow"></i>
</div>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
import { createNamespacedHelpers } from "vuex";
const {mapActions} = createNamespacedHelpers('home/mine');
const { mapActions } = createNamespacedHelpers("home/mine");
export default {
name: 'tabItem',
name: "tabItem",
props: {
data: {
type: Object,
default: {}
},
noLine: {
type: Boolean,
default: false
},
small: {
type: Boolean,
default: false
},
grey: {
type: Boolean,
default: false
},
titleBold: {
type: Boolean,
default: false
},
titleSmall: {
type: Boolean,
default:false
}
data: {
type: Object,
default: {}
},
noLine: {
type: Boolean,
default: false
},
small: {
type: Boolean,
default: false
},
grey: {
type: Boolean,
default: false
},
titleBold: {
type: Boolean,
default: false
},
titleSmall: {
type: Boolean,
default: false
}
},
data() {
return {
};
return {};
},
computed: {
itemClass() {
return {
'line': !this.noLine,
'grey': this.grey,
'small': this.small
}
},
titleClass() {
return {
'title-bold': this.titleBold,
'title-size': this.titleSmall
}
}
itemClass() {
return {
line: !this.noLine,
grey: this.grey,
small: this.small
};
},
mounted() {
titleClass() {
return {
"title-bold": this.titleBold,
"title-size": this.titleSmall
};
}
},
mounted() {},
methods: {
goPage(pagename) {
if(!pagename) {
goPage({ page: name, params = {} }) {
if (!name) {
return;
}
if(name === 'service') {
this.$createDialog({
type: 'alert',
content: '请致电 <a href="tel:400-889-9646"> 400-889-9646 </a>联系有货客服',
confirmBtn: {
text: '我知道了',
active: true
}
}).show()
return
}
this.$router.push({ name: pagename})
}
this.$router.push({ name, params });
}
}
};
</script>
<style lang="scss" scoped>
.tab-item {
display: flex;
height: 120px;
line-height: 120px;
display: flex;
height: 120px;
line-height: 120px;
}
.small {
height: 90px;
line-height: 90px;
height: 90px;
line-height: 90px;
}
.grey {
background-color: #F5F7F9;
margin: 0 -40px;
padding: 0 40px;
background-color: #f5f7f9;
margin: 0 -40px;
padding: 0 40px;
}
.line {
border-bottom: solid 1px #eee;
border-bottom: solid 1px #eee;
}
.title {
flex: 1;
font-size: 32px;
color: black;
min-width: 100px;
flex: 1;
font-size: 32px;
color: black;
min-width: 100px;
}
.title-bold {
font-weight: bold;
font-weight: bold;
}
.title-size {
font-size: 28px;
font-size: 28px;
}
.text {
font-family: 'Alte DIN 1451 Mittelschrift';
color: black;
text-align: right;
font-size: 32px;
font-family: "Alte DIN 1451 Mittelschrift";
color: black;
text-align: right;
font-size: 32px;
}
.cubeic-arrow {
color: #D8D8D8;
margin-left: 10px;
font-size: 32px;
color: #d8d8d8;
margin-left: 10px;
font-size: 32px;
}
</style>
... ...
... ... @@ -41,10 +41,12 @@ export default {
this.fetchFavoriteNum()
this.fetchOrderSummary()
this.fetchSellerOrder()
this.fetchAssets(true)
// this.fetchAssets(true)
this.fetchUserWalletInfo()
this.fetchCoupon()
},
methods: {
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets'])
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets', 'fetchUserWalletInfo','fetchCoupon'])
},
components: {
tabItem,
... ...
... ... @@ -30,6 +30,8 @@ import OrderListItem from "./components/order-item";
import OrderInfo from "./components/order-info.vue";
import EmptyList from "./components/empty";
import OrderItemFooter from "./components/order-footer";
import { routeNames } from "../order-detail";
import { ownType } from "../../../../constants/order-constants";
const { mapActions, mapState, mapGetters } = createNamespacedHelpers(
"order/inSaleOrderList"
... ... @@ -63,6 +65,19 @@ export default {
},
mounted() {
this.fetchData();
const { code } = this.$route.params;
// 调价跳转
if (!!code) {
this.$nextTick(() => {
this.$router.push({
name: routeNames.SELL_ORDER_DETIAL,
params: {
owner: ownType.SELL,
code
}
});
});
}
},
methods: {
...mapActions(["fetchEntryOrderList", "fetchNotEntryOrderList"]),
... ...
... ... @@ -12,7 +12,7 @@ const routers = [
// owner 默认为sell
{
name: 'InSaleOrderList',
path: '/xianyu/in/sale/order/list',
path: '/xianyu/in/sale/order/list/:code?',
component: () => import('./in-sell-order-list'),
},
];
... ...
<template>
<div class="payment-confirm-wrapper">
</div>
</template>
<script>
export default {
name: 'paymentSheet'
};
</script>
<style lang="scss" scoped>
.payment-confirm-wrapper {
position: fixed;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 99;
}
</style>
... ... @@ -6,14 +6,12 @@
@on-change-price="onChangePrice"
@on-no-sale="onNoSale"></ProductItem>
</div>
<div class="no-item" v-else>
<div class="no-item-bg"></div>
<p>暂无数据</p>
</div>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</template>
<script>
import ProductItem from './product-item';
import UfoNoItem from '../../../../components/ufo-no-item';
import {createNamespacedHelpers} from 'vuex';
const {mapActions} = createNamespacedHelpers('order/priceChange');
... ... @@ -31,7 +29,7 @@ export default {
this.$emit('on-no-sale', params);
}
},
components: {ProductItem}
components: {ProductItem, UfoNoItem}
};
</script>
... ... @@ -43,25 +41,4 @@ export default {
overflow: hidden;
}
.no-item {
position: relative;
display: flex;
height: 70%;
flex-direction: column;
align-items: center;
justify-content: center;
.no-item-bg {
width: 186px;
height: 242px;
background-image: url("~statics/image/order/ufo-empty.png");
background-size: 100% 100%;
}
p {
color: #999;
line-height: 32px;
}
}
</style>
... ...
... ... @@ -5,7 +5,7 @@ export default [{
path: '/xianyu/order/priceChangeEntry/:orderId(\\d+).html',
name: 'PriceChangeEntry',
component: () => import(/* webpackChunkName: "priceChange" */ './entry-detail')
},{
}, {
path: '/xianyu/order/priceChangeNoEntry/:orderCode(\\d+).html',
name: 'PriceChangeNoEntry',
component: () => import(/* webpackChunkName: "priceChangeNoEntry" */ './no-entry-detail')
... ...
... ... @@ -18,8 +18,8 @@
@select="onSelectSize"
@add="onAdd" />
<div class="footer">
<cube-button v-if="config.type === 'sell'" @click="magic">变现 <span><i>¥</i>{{399}}</span></cube-button>
<cube-button @click="select" :class="{active: selectedSize.size_id }">{{config.title}}</cube-button>
<cube-button v-if="config.type === 'sell'" @click="convertToCash" :class="{active: isMarketable}">变现<span> <i>¥</i>{{cashPrice}}</span></cube-button>
<cube-button @click="select" :class="{active: isTradable }">{{config.title}}</cube-button>
</div>
</div>
</div>
... ... @@ -83,6 +83,31 @@ export default {
},
canAddSize() {
return get(this.product, 'goods_list[0].canAddSize', false);
},
/**
* 可交易(购买|出售)
*/
isTradable() {
return this.selectedSize && this.selectedSize.size_id;
},
/**
* 变现价格,使用bid_moster_price
*/
cashPrice() {
if (this.selectedSize && this.selectedSize.hasOwnProperty('bid_moster_price')) {
return this.selectedSize.bid_moster_price;
}
return '-';
},
/**
* 是否可变现
*/
isMarketable() {
return this.cashPrice !== '-' && this.cashPrice > 0;
}
},
mounted() {
... ... @@ -106,12 +131,18 @@ export default {
this.$emit('add');
},
select() {
if (!this.isTradable) {
return;
}
this.$emit('select', {
productId: this.product.product_id,
storageId: this.selectedSize.storage_id,
});
},
magic() {
convertToCash() {
if (!this.isMarketable) {
return;
}
this.hide();
// TODO: TBD
... ...
... ... @@ -64,7 +64,7 @@ export default {
.row {
overflow: hidden;
margin: -8px;
margin: 0 -8px;
.col {
width: 33.3333%;
... ...
... ... @@ -17,7 +17,7 @@ $sub-color : #64ad88;
}
&.active {
border: 0;
border-color: $primary-color;
background: $primary-color;
color: #fff;
}
... ...
... ... @@ -178,7 +178,9 @@ export default {
this.imageHideThreadhold = -window.innerWidth * 0.693;
},
activated() {
this.loadData(this.productId);
if (this.productId !== this.productDetail.product_id) {
this.loadData(this.productId);
}
},
methods: {
...mapActions(['fetchProductInfo', 'fetchTop3', 'toggleFav', 'updateTradeInfo', 'getSelectedTradeProduct']),
... ...
import {parseAssetList, formatNumber, maskAccount} from '../../utils/mine-handler';
import { parseAssetList, formatNumber } from '../../utils/mine-handler';
import { get, set } from 'lodash';
import { getImgUrl } from '../../common/utils';
import moment from 'moment';
import { sellerOrderStatus, ownType } from '../../../constants/order-constants';
// const uid = '600046428';
const uid = '500031424';
... ... @@ -23,6 +24,7 @@ export default function() {
favoriteNum: 0,
buyNum: 0,
askBuyNum: 0,
couponNum: 0,
assetData: {
isFetching: false,
list: [],
... ... @@ -31,7 +33,7 @@ export default function() {
endReached: false,
compensateIncome: '¥0.00',
goodsIncome: '¥0.00',
totalIncome: '¥0.00'
totalIncome: '¥0.00',
},
walletData: {
isFetching: false,
... ... @@ -41,52 +43,110 @@ export default function() {
endReached: false,
tradeType: 0,
startTime: 0,
endTime: 0
endTime: 0,
},
userWalletInfo: {
totalAmount: 0.00,
totalAmount: 0.0,
withdrawLimit: 0,
withdrawAmount: 0,
shareSettlementAmount: 0,
walletAmount: 0.00
walletAmount: 0.0,
},
filterData: {
tradeTypes: [],
beginTime: 0,
endTime: 0
endTime: 0,
},
resource1: {},
resource2: {}
resource2: {},
},
getters: {
getOrderNums(state) {
let orderSum = {
ready: {name: '待发货', num: state.readyNum, page: {name: 'OrderList', status: 0} },
sent: {name: '已发货', num: state.sentNum, page: {name: 'OrderList', status: 1}},
finish: {name: '交易成功', num: state.finishNum, page: {name: 'OrderList', status: 2}},
fail: {name: '交易失败', num: state.failNum, page: {name: 'OrderList', status: 3}}
ready: {
name: '待发货',
num: state.readyNum,
page: {
name: 'OrderList',
status: sellerOrderStatus.TO_BE_DELIVERED,
},
},
sent: {
name: '已发货',
num: state.sentNum,
page: { name: 'OrderList', status: sellerOrderStatus.SHIPPED },
},
finish: {
name: '交易成功',
num: state.finishNum,
page: { name: 'OrderList', status: sellerOrderStatus.DONE },
},
fail: {
name: '交易失败',
num: state.failNum,
page: { name: 'OrderList', status: sellerOrderStatus.FAILED },
},
};
return orderSum;
},
getMineList(state) {
let tabList = {
board: { title: '公告栏', page: 'noticeList'},
sale: { title: '出售中', num: state.sellerNum, page: ''},
order: {name: 'order'},
resource1: {name: 'resource1', data: state.resource1},
income: {title: '交易收入', num: state.assetData.totalIncome, page: 'income'}, // 原交易收入 tradeIncome
buyOrder: {title: '我购买的订单', num: state.buyNum, page: ''},
buy: {name: 'buy', title: '我的求购', num: state.askBuyNum, page: ''},
collect: {name: 'collect', title: '我的收藏', num: state.favoriteNum, page: 'favorite'},
resource2: {name: 'resource2', data: state.resource2}
board: { title: '公告栏', page: 'noticeList' },
sale: {
title: '出售中',
num: state.sellerNum,
page: 'InSaleOrderList',
},
order: { name: 'order' },
resource1: { name: 'resource1', data: state.resource1 },
income: {
title: '我的收入',
num: '¥' + state.userWalletInfo.walletAmount,
page: 'income',
}, // 原交易收入 tradeIncome
buyOrder: {
title: '我的订单',
num: state.buyNum,
page: 'OrderList',
params: { owner: ownType.BUY },
},
buy: {
name: 'buy',
title: '我的求购',
num: state.askBuyNum,
page: '',
},
collect: {
name: 'collect',
title: '我的收藏',
num: state.favoriteNum,
page: 'favorite',
},
coupon: {
name: 'coupon',
title: '我的优惠券',
num: state.couponNum,
page: ''
},
service: {
name: 'service',
title: '我的客服',
page: 'service'
},
resource2: { name: 'resource2', data: state.resource2 },
};
return tabList;
},
getYearMonth(state) {
let beginTime = moment(new Date(state.filterData.beginTime * 1000)).format('YYYY-MM');
let endTime = moment(new Date(state.filterData.endTime * 1000)).format('YYYY-MM');
let beginTime = moment(
new Date(state.filterData.beginTime * 1000),
).format('YYYY-MM');
let endTime = moment(new Date(state.filterData.endTime * 1000)).format(
'YYYY-MM',
);
var a = moment(endTime.split('-'));
var b = moment(beginTime.split('-'));
... ... @@ -100,17 +160,17 @@ export default function() {
for (let i = 0; i <= yearNum; i++) {
let year = '' + (Number(beginYear) + i);
yearsData.push({text: year, value: year});
yearsData.push({ text: year, value: year });
}
for (let i = 0; i <= monthNum; i++) {
let month = Number(beginMonth) + i;
month = month < 10 ? '0' + month : month;
monthsData.push({text: month, value: month});
monthsData.push({ text: month, value: month });
}
return [yearsData, monthsData];
}
},
},
mutations: {
addList(state, { list }) {
... ... @@ -128,8 +188,7 @@ export default function() {
state.animate = false;
},
addSellerOrder(state, { orderSumList }) {
orderSumList.forEach((item) => {
orderSumList.forEach(item => {
switch (item.listType) {
case 1:
state.sellerNum = item.sum;
... ... @@ -152,11 +211,11 @@ export default function() {
});
},
addFavoriteNum(state, {count}) {
addFavoriteNum(state, { count }) {
state.favoriteNum = count;
},
addOrderSummary(state, {data}) {
data.forEach((item) => {
addOrderSummary(state, { data }) {
data.forEach(item => {
switch (item.actor) {
case 'buy':
state.buyNum = item.sum;
... ... @@ -169,6 +228,9 @@ export default function() {
}
});
},
addCouponSummary(state, {count}) {
state.couponNum = count;
},
addAssets(state, assetData) {
assetData.totalIncome = formatNumber(assetData.totalIncome);
assetData.compensateIncome = formatNumber(assetData.compensateIncome);
... ... @@ -176,8 +238,10 @@ export default function() {
state.assetData = Object.assign({}, state.assetData, assetData);
},
addWallet(state, walletData) {
walletData.list.map((item) => {
item.time = moment(new Date(item.createTime * 1000)).format('YYYY.MM.DD HH:mm');
walletData.list.map(item => {
item.time = moment(new Date(item.createTime * 1000)).format(
'YYYY.MM.DD HH:mm',
);
item.amount = Number(Math.abs(item.amount)).toFixed(2);
return item;
});
... ... @@ -186,7 +250,7 @@ export default function() {
changeWalletType(state, data) {
state.walletData.tradeType = data;
},
changeWalletTime(state, {startTime, endTime}) {
changeWalletTime(state, { startTime, endTime }) {
state.walletData.startTime = startTime;
state.walletData.endTime = endTime;
},
... ... @@ -196,7 +260,7 @@ export default function() {
addfilterData(state, data) {
let tradeTypes = [];
data.tradeTypes.forEach((item) => {
data.tradeTypes.forEach(item => {
let typeItem = {};
typeItem.text = item.desc;
... ... @@ -206,14 +270,14 @@ export default function() {
data.tradeTypes = tradeTypes;
state.filterData = data;
},
assetFetching(state, {isFetching}) {
assetFetching(state, { isFetching }) {
state.assetData.isFetching = isFetching;
},
addResource(state, {resource1 = {}, resource2 = {}}) {
addResource(state, { resource1 = {}, resource2 = {} }) {
state.resource1 = Object.assign({}, state.resource1, resource1);
state.resource2 = Object.assign({}, state.resource1, resource2);
}
},
},
actions: {
async fetchRollBoardList({ commit }) {
... ... @@ -232,56 +296,85 @@ export default function() {
commit('setTimer', timer);
},
async hideMarquee({commit}) {
async hideMarquee({ commit }) {
commit('setTimer', null);
},
async fetchResource({commit}) {
async fetchResource({ commit }) {
const result = await this.$api.get('/api/ufo/mine/resource', {
content_code: MINE_RESOURCE_CODE1,
uid
uid,
});
const result1 = await this.$api.get('/api/ufo/mine/resource', {
content_code: MINE_RESOURCE_CODE2,
uid
uid,
});
if (result.code === 200) {
let src = getImgUrl(get(result, 'data[0].data[0].src') || '', 1000, 240);
let src = getImgUrl(
get(result, 'data[0].data[0].src') || '',
1000,
240,
);
set(result, 'data[0].data[0].src', src);
commit('addResource', {resource1: result.data[0]});
commit('addResource', { resource1: result.data[0] });
}
if (result1.code === 200) {
let src = getImgUrl(get(result1, 'data[0].data[0].src') || '', 1000, 240);
let src = getImgUrl(
get(result1, 'data[0].data[0].src') || '',
1000,
240,
);
set(result1, 'data[0].data[0].src', src);
commit('addResource', {resource2: result1.data[0]});
commit('addResource', { resource2: result1.data[0] });
}
},
async fetchSellerOrder({ commit }) {
const result = await this.$api.get('/api/ufo/mine/seller/orderSummary', {uid});
const result = await this.$api.get(
'/api/ufo/mine/seller/orderSummary',
{ uid },
);
if (result.code === 200) {
commit('addSellerOrder', { orderSumList: result.data });
}
},
async fetchFavoriteNum({ commit }) {
const result = await this.$api.get('/api/ufo/mine/favoriteNum', {uid});
const result = await this.$api.get('/api/ufo/mine/favoriteNum', {
uid,
});
if (result.code === 200) {
commit('addFavoriteNum', { count: result.data.product_favorite_total });
commit('addFavoriteNum', {
count: result.data.product_favorite_total,
});
}
},
async fetchOrderSummary({ commit }) {
const result = await this.$api.get('/api/ufo/mine/order/summary', {uid});
const result = await this.$api.get('/api/ufo/mine/order/summary', {
uid,
});
if (result.code === 200) {
commit('addOrderSummary', { data: result.data});
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;
let {
isFetching,
endReached,
currentPage,
list,
pageSize,
} = state.assetData;
if (isFetching || (!isRefresh && endReached)) {
return;
... ... @@ -290,7 +383,11 @@ export default function() {
// commit('assetFetching', {isFetching: true});
let page = isRefresh ? 1 : currentPage + 1;
const result = await this.$api.get('/api/ufo/mine/assets', {page, limit: pageSize, uid});
const result = await this.$api.get('/api/ufo/mine/assets', {
page,
limit: pageSize,
uid,
});
// commit('assetFetching', {isFetching: false});
if (result.code === 200) {
... ... @@ -304,12 +401,21 @@ export default function() {
}
},
async fetchWallet({ commit, state }, {isRefresh, tradeType = 0, startTime = 0, endTime = 0}) {
async fetchWallet(
{ commit, state },
{ isRefresh, tradeType = 0, startTime = 0, endTime = 0 },
) {
if (isRefresh) {
commit('changeWalletType', tradeType);
commit('changeWalletTime', {startTime, endTime});
commit('changeWalletTime', { startTime, endTime });
}
let {isFetching, endReached, currentPage, list, pageSize} = state.walletData;
let {
isFetching,
endReached,
currentPage,
list,
pageSize,
} = state.walletData;
tradeType = state.walletData.tradeType;
startTime = state.walletData.startTime;
... ... @@ -321,7 +427,14 @@ export default function() {
// commit('assetFetching', {isFetching: true});
let page = isRefresh ? 1 : currentPage + 1;
const result = await this.$api.get('/api/ufo/mine/wallet', {page, limit: pageSize, uid, tradeType, startTime, endTime});
const result = await this.$api.get('/api/ufo/mine/wallet', {
page,
limit: pageSize,
uid,
tradeType,
startTime,
endTime,
});
// commit('assetFetching', {isFetching: false});
if (result.code === 200) {
... ... @@ -331,26 +444,31 @@ export default function() {
let newList = [...oldList, ...data.list];
walletData.currentPage = data.page;
walletData.endReached = data.list.length === 0 || data.page === data.totalPage;
walletData.endReached =
data.list.length === 0 || data.page === data.totalPage;
walletData.list = newList;
commit('addWallet', walletData);
}
},
async fetchUserWalletInfo({ commit }) {
const result = await this.$api.get('/api/ufo/mine/userWalletInfo', {uid});
const result = await this.$api.get('/api/ufo/mine/userWalletInfo', {
uid,
});
if (result.code === 200) {
commit('addUserWalletInfo', result.data);
}
},
async fetchWalletFilter({ commit }) {
const result = await this.$api.get('/api/ufo/mine/walletFilter', {uid});
const result = await this.$api.get('/api/ufo/mine/walletFilter', {
uid,
});
if (result.code === 200) {
commit('addfilterData', result.data);
}
}
},
},
};
}
... ...
... ... @@ -75,49 +75,50 @@ export default {
code: 200,
data:
{ attributes: 1,
bankTransferFee: '-¥0.09',
bankTransferFee: '-¥0.29',
bidType: 0,
buttons: [ [Object], [Object] ],
createTime: '2019-09-29 10:54:00',
earnestMoney: 0.36,
earnestMoneyStr: '¥0.36',
createTime: '2019-10-08 16:57:48',
earnestMoney: 1.16,
earnestMoneyStr: '¥1.16',
goodsInfo:
{ batchNo: 1226211663688,
{ batchNo: 1232760577857,
bidType: 0,
colorName: '黑色',
entryFlag: false,
goodImg:
'http://img11.static.yhbimg.com/goodsimg/2019/02/25/10/018b0d26a7e4bc0b39a93c329dd8c13d8e.jpg?imageMogr2/thumbnail/{width}x{height}/background/d2hpdGU=/position/center/quality/80',
goodPrice: '9.00',
leastPrice: 9,
leastPriceOfSkuTips: '最低现货价¥9',
price: 9,
goodPrice: '29.00',
leastPrice: 29,
leastPriceOfSkuTips: '最低现货价¥29',
price: 29,
productId: 10001266,
productName: 'Air Jordan 1 复刻黑绿脚趾 范闲',
sizeName: '37',
skup: 19168,
skup: 19356,
storageId: 10090816 },
income: '¥8.47',
income: '¥28.69',
isAdvance: 'N',
isPaid: 1,
orderCode: 1226211663688,
orderCode: 1232760577857,
payStartTime: 1570525068,
payment: 2,
paymentStr: '支付宝',
platformFee:
{ amount: '-¥0.44',
{ amount: '-¥0.02',
appraiseFee: '¥0.01',
goodsPaymentRatePercent: '4.70%',
goodsPaymentRatePercent: '0.00%',
packageFee: '¥0.01',
payChannelPercentage: '1.00%',
serviceFee: '¥0.42' },
secendLevelCreateTime: 1569725640,
serviceFee: '¥0.00' },
secendLevelCreateTime: 1570525068,
statusDetail:
{ detailDesc: '商品出售中,待买家购买',
expressShow: false,
paymentTips: '交易成功后自动退还',
statuStr: '出售中',
status: 1 },
submitOrderTimeStr: '2019-09-29 10:54:00',
submitOrderTimeStr: '2019-10-08 16:57:48',
uid: 349709,
userAddress:
{ address: '嘉陵江东街18号南京国家广告产****17楼',
... ... @@ -129,7 +130,7 @@ export default {
mobile: '138****0257',
phone: '',
zipCode: '' } },
md5: 'aa8b0d59cf55a6266304ac1edf6dbd43',
md5: '6ae15b6dee1a7ac6ba39244894671ad5',
message: '订单详情' };
commit(Types.FETCH_NOENTRY_ORDER_PRODUCT_SUCCESS, {
order: result
... ...
... ... @@ -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,
... ...
... ... @@ -15,6 +15,7 @@ export const sellerOrderStatus = {
// 买家订单状态,接口对应查询参数: type
export const buyerOrderStatus = {
ALL: 1, // 全部
UNPAID: 2, // 未付款
TO_BE_DELIVERED: 3, // 待发货
PENDING_RECEIPT: 4, // 待收货
... ...