|
@@ -8,7 +8,7 @@ Page({
|
|
|
foods: [{
|
|
|
id: 0,
|
|
|
foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
- foodsName: '麻辣烫',
|
|
|
+ foodsName: '麻烫',
|
|
|
foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
initPrice: 28.80,
|
|
|
nowPrice: 10.98
|
|
@@ -17,11 +17,10 @@ Page({
|
|
|
{
|
|
|
id: 1,
|
|
|
foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
- foodsName: '麻辣烫',
|
|
|
+ foodsName: '麻辣',
|
|
|
foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
initPrice: 28.80,
|
|
|
nowPrice: 10.98
|
|
|
-
|
|
|
},
|
|
|
{
|
|
|
id: 2,
|
|
@@ -95,20 +94,22 @@ Page({
|
|
|
},
|
|
|
onSearch() {
|
|
|
let list = this.data.foods;
|
|
|
- let x = list.map(res => {
|
|
|
- console.log(res);
|
|
|
+ let arr=[];
|
|
|
+ list.forEach(res=>{
|
|
|
+ if(this.data.info===res.foodsName)
|
|
|
+ {
|
|
|
+ arr.push(res)
|
|
|
+ }
|
|
|
})
|
|
|
- console.log(x);
|
|
|
+ console.log(arr);
|
|
|
this.setData({
|
|
|
show: !this.data.show,
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
-
|
|
|
},
|
|
|
|
|
|
|