Authored by Tao

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

... ... @@ -69,11 +69,11 @@ export default {
methods: {
...mapActions(['fetchWallet']),
onPullingDown() {
this.fetchWallet({isRefresh:true})
this.fetchWallet({isRefresh:true, tradeType: this.walletData.tradeType})
},
onPullingUp() {
if(!this.walletData.endReached) {
this.fetchWallet({isRefresh:false})
this.fetchWallet({isRefresh:false, tradeType: this.walletData.tradeType})
} else {
this.$refs.scroll.forceUpdate()
}
... ...
<template>
<div class="single-image">
<a :href="data.url" class="link">
<LayoutLink :href="data.url" class="link">
<img :src="data.src" :alt="data.title" class="img" :style="style">
</a>
</LayoutLink>
</div>
</template>
... ...
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="支付成功">
<div class="body">
<div class="header">
<i class="iconfont iconOk icon-class"></i>
... ...
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="确认订单">
<div class="body">
<TitleComp txt="确认订单" class="title-class"></TitleComp>
<AddressInfo :data="address" class="order-item" :show-tip="false"></AddressInfo>
<ProductInfo :data="orderDetail.good" class="product-info order-item"></ProductInfo>
<Coupon class="order-item" v-if="couponList.length > 0" :data="orderDetail.recommendedCouponInfo"
... ...
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="支付中">
<div class="timer-wrapper">
<div class="timer">{{count}}s</div>
</div>
... ... @@ -26,7 +26,7 @@ export default {
props: ['orderCode', 'payParams', 'extra'],
data() {
return {
count: 10,
count: 60,
page: null,
timer: null
};
... ... @@ -42,7 +42,7 @@ export default {
this.page = JSON.parse(this.extra || '{}');
}
},
beforeDestroy() {
beforeRouteLeave () {
if (this.timer) {
clearTimeout(this.timer);
}
... ...
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="上架成功">
<div class="body">
<div class="header">
<i class="iconfont iconOk icon-class"></i>
... ...
<template>
<LayoutApp :show-back="true">
<LayoutApp :show-back="true" title="确认出售">
<div class="body">
<TitleComp txt="出售"></TitleComp>
<ProductInfo :data="productDetail" class="product-info"></ProductInfo>
<InputPrice @input="changePrice" :value="price" class="input-price" @on-blur="compute"></InputPrice>
<OrderMargin class="order-item order-margin" :data="fee"></OrderMargin>
... ...
... ... @@ -287,46 +287,48 @@ export default {
this.showSizeSelectSheet = true;
},
async onSelectTradeProduct(tradeProduct) {
try {
const info = await this.payment({
skup: tradeProduct.skup,
});
/**
* {
* "message": "您有未支付的订单,支付或取消后可提交新的订单",
* "code": 512
* }
*/
if (info.code === 512) {
return this.$createDialog({
type: 'confirm',
content: info.message,
confirmBtn: {
text: '查看订单',
active: true,
disabled: false,
href: 'javascript:;'
},
cancelBtn: {
text: '取消',
active: false,
disabled: false,
href: 'javascript:;'
},
onConfirm: () => {
this.$router.push({
name: this.selectSizeConfig.type === 'buy' ? 'OrderList' : 'InSaleOrderList',
params: {
owner: this.selectSizeConfig.type,
},
});
this.showSizeSelectSheet = false;
},
}).show();
if (this.selectSizeConfig.type === 'buy') {
try {
const info = await this.payment({
skup: tradeProduct.skup,
});
/**
* {
* "message": "您有未支付的订单,支付或取消后可提交新的订单",
* "code": 512
* }
*/
if (info.code === 512) {
return this.$createDialog({
type: 'confirm',
content: info.message,
confirmBtn: {
text: '查看订单',
active: true,
disabled: false,
href: 'javascript:;'
},
cancelBtn: {
text: '取消',
active: false,
disabled: false,
href: 'javascript:;'
},
onConfirm: () => {
this.$router.push({
name: 'OrderList',
params: {
owner: this.selectSizeConfig.type,
},
});
this.showSizeSelectSheet = false;
},
}).show();
}
} catch (e) {
// e
}
} catch (e) {
// e
}
this.$router.push({
... ...
... ... @@ -141,15 +141,11 @@ export default function() {
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('-'));
let a = moment(endTime.split('-'));
let b = moment(beginTime.split('-'));
let yearNum = a.diff(b, 'years');
let monthNum = a.diff(b, 'months');
let beginYear = beginTime.split('-')[0];
... ... @@ -239,9 +235,7 @@ export default function() {
},
addWallet(state, walletData) {
walletData.list.map(item => {
item.time = moment(new Date(item.createTime * 1000)).format(
'YYYY.MM.DD HH:mm',
);
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;
});
... ... @@ -440,8 +434,7 @@ 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);
}
... ...