完成搜索页面
This commit is contained in:
@@ -3,17 +3,17 @@
|
||||
<div class="head">
|
||||
<span class="title">感恩功德</span>
|
||||
<div class="list">
|
||||
<span :class="[nav.id === type_id && 'current']" v-for="nav in type_nav" :key="nav.id" >{{ nav.title }}</span>
|
||||
<span :class="[nav.id === type_id && 'current']" v-for="nav in type_nav" :key="nav.id" @click="onSetType(nav)">{{ nav.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body">
|
||||
<swiper :options="swiperOptions">
|
||||
<swiper-slide v-for="slide in type_nav" :key="slide.id">
|
||||
<scroll-view>
|
||||
<div :options="swiperOptions">
|
||||
<div v-for="slide in type_nav" :key="slide.id">
|
||||
<div v-if="type_id === slide.id">
|
||||
<user-merit v-for="dynamic in slide.list" :key="dynamic.id" :data="dynamic" ></user-merit>
|
||||
</scroll-view>
|
||||
</swiper-slide>
|
||||
</swiper>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thanks-more" @click="onThankMore">查看更多</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,10 +48,11 @@ export default {
|
||||
{ id: 3, title: "总榜", list: [] },
|
||||
],
|
||||
swiperOptions: {
|
||||
onSlideChangeEnd: ({realIndex}) => {
|
||||
this.type_id = this.type_nav[realIndex].id;
|
||||
this.getOrderCompare();
|
||||
}
|
||||
|
||||
// onSlideChangeEnd: ({realIndex}) => {
|
||||
// this.type_id = this.type_nav[realIndex].id;
|
||||
// this.getOrderCompare();
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -59,9 +60,12 @@ export default {
|
||||
this.getOrderCompare();
|
||||
},
|
||||
methods: {
|
||||
onSetType(type){
|
||||
this.type_id = type.id;
|
||||
this.getOrderCompare();
|
||||
},
|
||||
async getOrderCompare(){
|
||||
const res = await getOrderCompare(this.templeId, this.type_id, this.goodsId, this.goodsType)
|
||||
console.log(res)
|
||||
const res = await getOrderCompare(this.templeId || '1', this.type_id, this.goodsId, this.goodsType)
|
||||
const current = this.type_nav.find(item => item.id === this.type_id);
|
||||
current.list = res.list
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user