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">
<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>
<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" :cur="cur" @transfer="getIndex"></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,7 +70,7 @@ export default {
isShow: false,
total: 0,
marginTop: 0,
cur: 0,
active: 0,
};
},
computed: {
... ... @@ -95,8 +95,7 @@ export default {
},
methods: {
getIndex(index) {
this.cur = index;
console.log(this.cur);
this.active = Number(index);
},
scrollHandler({ y }) {
let scrollY = Math.abs(parseInt(y));
... ... @@ -198,4 +197,7 @@ export default {
left: 0;
z-index: 999;
}
.marginTop {
margin-top: 64px;
}
</style>
... ...
<template>
<div class="ScrollNav" v-if="labels.length > 0">
<ScrollNavBar :current="this.list[cur].tab_name" :labels="labels" @change="changeHandler">
<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,7 +23,7 @@ export default {
type: Array,
default: true
},
cur: {
current: {
type: Number,
default: true
}
... ... @@ -31,7 +31,7 @@ export default {
data() {
return {
index: 0,
current: this.list[0].tab_name,
// current: this.list[0].tab_name,
labels: [],
}
},
... ... @@ -56,7 +56,6 @@ export default {
let params = Object.assign({},...query);
params.isReset = true; delete params.method;
this.fetchProductList(params);
console.log(index);
this.$emit('transfer',index);
}
}
... ...
<template>
<LayoutApp :show-back="true" :title="title">
<Scroll :scrollEvents="['scroll']" :options="scrollOptions" @scroll="scroll"
v-show="!isShowEmpty"
v-if="favoriteProductList.list.length"
@pulling-up="onPullingUp">
<ProductList :list="favoriteProductList.list"></ProductList>
</Scroll>
<empty-list v-show="isShowEmpty" />
<!-- <empty-list v-show="!isShowEmpty" /> -->
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</LayoutApp>
</template>
<script>
import ProductList from '../../list/components/productList';
import EmptyList from "../../order/order-list/components/empty";
import UfoNoItem from '../../../components/ufo-no-item'
import {Scroll} from 'cube-ui';
import {createNamespacedHelpers} from 'vuex';
... ... @@ -21,7 +23,8 @@ export default {
components: {
ProductList,
Scroll,
EmptyList
EmptyList,
UfoNoItem
},
data() {
return {
... ...
... ... @@ -2,11 +2,13 @@
<LayoutApp :show-back="true" :title="title">
<Scroll
ref="scroll"
v-if="noticeList.length"
:scroll-events="['scroll-end','scroll']"
@scroll-end="fetchList"
>
<NoticeItem v-for="(item, index) in noticeList" :key="index" :data="item"></NoticeItem>
</Scroll>
<UfoNoItem :tip="`暂无数据`" v-else></UfoNoItem>
</LayoutApp>
</template>
... ... @@ -15,6 +17,7 @@ import { createNamespacedHelpers } from 'vuex';
const { mapState, mapActions} = createNamespacedHelpers('notice');
import NoticeItem from './components/noticeItem';
import UfoNoItem from '../../../components/ufo-no-item'
import {
Style,
... ... @@ -26,6 +29,7 @@ export default {
NoticeItem,
Style,
Scroll,
UfoNoItem,
RecycleList
},
data(){
... ... @@ -44,7 +48,7 @@ export default {
},
computed: {
...mapState(['noticeList','fetchNoticePage','isMore']),
...mapState(['noticeList','fetchNoticePage','isMore','isShowEmpty']),
},
methods:{
...mapActions(['fetchNoticeList']),
... ...
... ... @@ -20,16 +20,19 @@ export default function() {
console.log(data)
if(data && data.product_list){
// data.product_list.
let { page, product_list = [] } = res;
state.isShowEmpty = page === 1 && product_list === 0;
let { page, product_list = [] } = data;
let isShowEmpty = page === 1 && product_list === 0;
// console.log("isShowEmpty:"+isShowEmpty)
// state.isShowEmpty = isShowEmpty
let list = state.favoriteProductList.list.concat(product_list);
Vue.set(state.favoriteProductList, "list", list);
}else {
state.isShowEmpty = true;
// state.isShowEmpty = true;
}
},
errorData(state){
// console.log("error==isShowEmpty:")
state.isShowEmpty = true;
}
... ... @@ -41,7 +44,8 @@ export default function() {
let data =result.data;
commit('addList', { data:data });
}else {
commit('error');
// console.log("error=//=isShowEmpty:")
commit('errorData');
}
return result.data || [];
},
... ...
... ... @@ -12,7 +12,7 @@ export default {
const result = await this.$api.post('/api/ufo/home/noticelist', {
page,
size: 8,
size: 20,
lastedTime: state.fetchNoticeLastedTime || void 0
});
if (result && result.code === 200) {
... ...