Authored by TaoHuang

Merge remote-tracking branch 'origin/develop' into develop

<template>
<LayoutApp :show-back="true" :hide-header="hideHeader">
<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>
</div>
</template>
<Scroll
ref="scroll"
:scroll-events="scrollEvents"
@scroll="scrollHandler"
:options="options"
@pulling-up="onPullingUp"
:data="productList.list">
<div class="body" ref="body">
<div class="channel-top"></div>
<div class="marginTop">
<div v-for="(item, index) in channelList.list" :key="index" class="space-between">
<Swiper :list="item.data" v-if="item.template_name == 'threePicture'"/>
<Hot :list="item.data.list" v-if="item.template_name == 'image_list'"/>
<Banner :list="item.data" v-if="item.template_name == 'single_image'"/>
<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>
</div>
</template>
</div>
</div>
<div :style="{minHeight: total + 'px'}">
<ProductList :list="productList.list" v-if="productList.list.length > 0" class="bgColor"></ProductList>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
<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" :cur="cur"></ScrollNav>
</div>
</template>
<Scroll
ref="scroll"
:scroll-events="scrollEvents"
@scroll="scrollHandler"
:options="options"
@pulling-up="onPullingUp"
:data="productList.list">
<div class="body" ref="body">
<div class="channel-top"></div>
<div class="marginTop">
<div v-for="(item, index) in channelList.list" :key="index" class="space-between">
<Swiper :list="item.data" v-if="item.template_name == 'threePicture'"/>
<Hot :list="item.data.list" v-if="item.template_name == 'image_list'"/>
<Banner :list="item.data" v-if="item.template_name == 'single_image'"/>
<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" :cur="cur" @transfer="getIndex"></ScrollNav>
</div>
</template>
</div>
</div>
</Scroll>
</div>
<div :style="{minHeight: total + 'px'}">
<ProductList :list="productList.list" v-if="productList.list.length > 0" class="bgColor"></ProductList>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</div>
</div>
</Scroll>
</div>
</LayoutApp>
</template>
... ... @@ -70,6 +70,7 @@ export default {
isShow: false,
total: 0,
marginTop: 0,
cur: 0,
};
},
computed: {
... ... @@ -80,26 +81,23 @@ 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.cur = index;
console.log(this.cur);
},
scrollHandler({ y }) {
let scrollY = Math.abs(parseInt(y));
if (scrollY >= this.navTop) {
... ...
<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[cur].tab_name" :labels="labels" @change="changeHandler">
<span slot-scope="props">
{{props.txt}}
<span :ref="`getindex${props.txt}`" v-show="false">{{props.index}}</span>
... ... @@ -23,6 +23,10 @@ export default {
type: Array,
default: true
},
cur: {
type: Number,
default: true
}
},
data() {
return {
... ... @@ -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,8 @@ export default {
let params = Object.assign({},...query);
params.isReset = true; delete params.method;
this.fetchProductList(params);
console.log(index);
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>
... ...
... ... @@ -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({
... ...
... ... @@ -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);
}
... ...