81 lines
1.7 KiB
Vue
81 lines
1.7 KiB
Vue
<template>
|
|
<view class="food_list">
|
|
<view class="food" v-for="(v,i) in content" :key="i" @click="InfoVideoInfo(v)">
|
|
<view class="food_img">
|
|
<image :src="v.bd_photo" mode="aspectFill"></image>
|
|
<i class="content_img_play"></i>
|
|
</view>
|
|
<view class="food_text">
|
|
<p>{{v.seo_title}}</p>
|
|
<view class="food_icon">
|
|
<view class="food_icon_lift">
|
|
<image src="../../static/img/user.jpg"></image>
|
|
<span>美食杰</span>
|
|
</view>
|
|
<view class="food_icon_right">
|
|
<i></i>
|
|
<span>{{v.click_num}}</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
total_page: 0,
|
|
page: 1,
|
|
content: []
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.getvideo()
|
|
},
|
|
onReachBottom() {
|
|
this.page = this.page + 1
|
|
if (this.page < this.total_page) {
|
|
this.getvideo()
|
|
}
|
|
}, //触底判断请求
|
|
onNavigationBarButtonTap(e) {
|
|
console.log(e)
|
|
if(e.index == 0||e.index == 1){
|
|
uni.switchTab({
|
|
url: '/pages/index/index'
|
|
})
|
|
}else {
|
|
uni.navigateTo({
|
|
url: '/pages/search/search'
|
|
})
|
|
}
|
|
},
|
|
methods: {
|
|
async getvideo() {
|
|
let res = await this.$http.index.video({
|
|
page: this.page
|
|
});
|
|
this.total_page = res.total_page
|
|
this.content = [
|
|
...this.content,
|
|
...res.items
|
|
|
|
]
|
|
console.log(this.content);
|
|
},
|
|
InfoVideoInfo(VInfoData) {
|
|
var sti =JSON.stringify(VInfoData)
|
|
uni.navigateTo({
|
|
url: "/pages/videoinfo/videoinfo?str="+sti
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import "../../common/less/page/video.less";
|
|
</style>
|