98 lines
2.2 KiB
Vue
98 lines
2.2 KiB
Vue
<template>
|
|
<view class="pad">
|
|
<view class="top">
|
|
<image src="../../static/img/icon.png" @click="tohome()"></image>
|
|
<view class="search" @click="tosearch()">
|
|
<i class="iconfont"></i>
|
|
<span>搜索百万菜谱</span>
|
|
</view>
|
|
<view class="sousuo" @click="tosearch()">搜索</view>
|
|
<view class="caipu" @click="totype()">菜谱大全</view>
|
|
</view>
|
|
<view class="content">
|
|
<view class="title">{{title}}做法T0P10</view>
|
|
<view class="list">
|
|
<view class="list_1" v-for="(v,i) in MenuList" :key="i" @click="toinfo(v.url)">
|
|
<image :src="v.img"></image>
|
|
<view class="text">
|
|
<p>{{v.title}}</p>
|
|
<view>
|
|
<image src="../../static/img/xx.png" class="xx"></image>
|
|
<image src="../../static/img/xx.png" class="xx"></image>
|
|
<image src="../../static/img/xx.png" class="xx"></image>
|
|
<image src="../../static/img/xx.png" class="xx"></image>
|
|
<image src="../../static/img/xx.png" class="xx"></image>
|
|
</view>
|
|
<view class="neb">
|
|
<image src="../../static/img/y.png"></image>
|
|
<span>{{v.like}}</span>
|
|
<image src="../../static/img/c.png"></image>
|
|
<span>{{v.view}}</span>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
urls: '',
|
|
title: '',
|
|
MenuList: [],
|
|
page: 0
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.urls = option.url
|
|
this.title = option.title
|
|
this.getMenuList()
|
|
},
|
|
onReachBottom() {
|
|
this.page = this.page + 1
|
|
this.getMenuList()
|
|
},
|
|
methods: {
|
|
async getMenuList() {
|
|
let res = await this.$http.index.rightMenuList({
|
|
url: this.urls,
|
|
p: this.page
|
|
})
|
|
console.log("left", res)
|
|
this.MenuList = [
|
|
...this.MenuList,
|
|
...res
|
|
]
|
|
},
|
|
tosearch() {
|
|
uni.navigateTo({
|
|
url: '/pages/search/search'
|
|
})
|
|
},
|
|
tohome() {
|
|
uni.switchTab({
|
|
url: '/pages/index/index'
|
|
})
|
|
},
|
|
totype() {
|
|
uni.switchTab({
|
|
url: '/pages/classification/classification'
|
|
})
|
|
},
|
|
toinfo(v) {
|
|
uni.navigateTo({
|
|
url: '/pages/info/info?url=' + v
|
|
})
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
@import "../../common/less/page/rightM.less";
|
|
</style>
|