Authored by bevishuang

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

... ... @@ -3,7 +3,7 @@
<div class="scroll-list-wrap">
<template v-if="isShow">
<div v-for="(item, index) in channelList.list" v-if="item.template_name == 'guessLike'">
<ScrollNav :list="item.data.list"></ScrollNav>
<ScrollNav :list="item.data.list" :current="active"></ScrollNav>
</div>
</template>
<Scroll
... ... @@ -23,12 +23,12 @@
<TwoBanner :list="item.data" v-if="item.template_name == 'twoPicture'"/>
<template v-if="!isShow">
<div ref="sss" v-if="item.template_name == 'guessLike'">
<ScrollNav :list="item.data.list"></ScrollNav>
<ScrollNav :list="item.data.list" :current="active" @transfer="getIndex"></ScrollNav>
</div>
</template>
</div>
</div>
<div :style="{minHeight: total + 'px'}">
<div :style="{minHeight: total + 'px'}" :class="{marginTop: isShow}">
<ProductList :list="productList.list" v-if="productList.list.length > 0" class="bgColor"></ProductList>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</div>
... ... @@ -70,6 +70,7 @@ export default {
isShow: false,
total: 0,
marginTop: 0,
active: 0,
};
},
computed: {
... ... @@ -80,26 +81,22 @@ export default {
const params = {
isPage: true,
isHome: true,
};
}
this.fetchChannelList().then((res) => {
let windowH = document.documentElement.clientHeight || document.body.clientHeight;
this.navTop = this.$refs.sss[0].offsetTop;
this.navHeight = this.$refs.sss[0].offsetHeight;
let windowH = document.documentElement.clientHeight || document.body.clientHeight;
this.total = windowH - this.navHeight;
console.log(windowH);
console.log(this.navHeight);
console.log(this.total);
console.log('______');
});
this.fetchProductList(params);
},
created() {
},
methods: {
getIndex(index) {
this.active = Number(index);
},
scrollHandler({ y }) {
let scrollY = Math.abs(parseInt(y));
if (scrollY >= this.navTop) {
... ... @@ -200,4 +197,7 @@ export default {
left: 0;
z-index: 999;
}
.marginTop {
margin-top: 64px;
}
</style>
... ...
<template>
<div class="ScrollNav" ref="scrollNavtop" v-if="labels.length > 0">
<ScrollNavBar :current="current" :labels="labels" @change="changeHandler">
<div class="ScrollNav" v-if="labels.length > 0">
<ScrollNavBar :current="this.list[current].tab_name" :labels="labels" @change="changeHandler">
<span slot-scope="props">
{{props.txt}}
<span :ref="`getindex${props.txt}`" v-show="false">{{props.index}}</span>
... ... @@ -23,11 +23,15 @@ export default {
type: Array,
default: true
},
current: {
type: Number,
default: true
}
},
data() {
return {
index: 0,
current: this.list[0].tab_name,
// current: this.list[0].tab_name,
labels: [],
}
},
... ... @@ -40,8 +44,6 @@ export default {
},
mounted() {
this.list.map((res) => { this.labels.push(res.tab_name) });
console.log(this.$refs.scrollNavtop);
console.log("this.$refs.xxx.offsetTop2");
},
created() {
... ... @@ -54,6 +56,7 @@ export default {
let params = Object.assign({},...query);
params.isReset = true; delete params.method;
this.fetchProductList(params);
this.$emit('transfer',index);
}
}
};
... ...
... ... @@ -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,6 +287,7 @@ export default {
this.showSizeSelectSheet = true;
},
async onSelectTradeProduct(tradeProduct) {
if (this.selectSizeConfig.type === 'buy') {
try {
const info = await this.payment({
skup: tradeProduct.skup,
... ... @@ -316,7 +317,7 @@ export default {
},
onConfirm: () => {
this.$router.push({
name: this.selectSizeConfig.type === 'buy' ? 'OrderList' : 'InSaleOrderList',
name: 'OrderList',
params: {
owner: this.selectSizeConfig.type,
},
... ... @@ -328,6 +329,7 @@ export default {
} catch (e) {
// e
}
}
this.$router.push({
name: this.selectSizeConfig.dest,
... ...
... ... @@ -15,6 +15,7 @@ export default function() {
total: 0, // 总共多少条
scrollnavList: [], // 导航菜单
// scrollnavidList: [], // 导航菜单
current: 0,
},
},
mutations: {
... ...
... ... @@ -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);
}
... ...