parent
79dda39119
commit
d37a522905
@ -0,0 +1,84 @@
|
|||||||
|
// pages/searchfood/searchfood.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
re:[]
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
console.log(JSON.parse(options.re),"1")
|
||||||
|
let re = JSON.parse(options.re);
|
||||||
|
let that = this
|
||||||
|
that.setData({
|
||||||
|
re: re
|
||||||
|
})
|
||||||
|
console.log(re)
|
||||||
|
},
|
||||||
|
|
||||||
|
toDetail: function (event) {
|
||||||
|
// 获取 event 事件对象
|
||||||
|
// 获取点击对应的下标
|
||||||
|
var index = event.currentTarget.dataset.foodid;
|
||||||
|
console.log(index);
|
||||||
|
//抓取id进行赋
|
||||||
|
//wx.navigateTo 会触发页面隐藏onHide
|
||||||
|
console.log('11111')
|
||||||
|
wx.navigateTo({
|
||||||
|
url:'/pages/detail/detail?id='+ index,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
/* pages/searchfood/searchfood.wxss */
|
||||||
|
.foodist {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a {
|
||||||
|
padding: 20px;
|
||||||
|
border-bottom: #b4b3b3 solid 1px;
|
||||||
|
background-color: #fff9f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .img {
|
||||||
|
float: left;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .img image {
|
||||||
|
width: 200rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .info {
|
||||||
|
float: left;
|
||||||
|
height: 200rpx;
|
||||||
|
width: 60%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .info .title {
|
||||||
|
margin-top: 5px;
|
||||||
|
color: black;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .info .price {
|
||||||
|
color: #FF2727;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.foodlist .a .info .num {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
bottom: 5px;
|
||||||
|
color: #747474;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clear {
|
||||||
|
clear: both;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
Loading…
Reference in new issue