|
@@ -5,9 +5,105 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
-
|
|
|
+ foods: [{
|
|
|
+ id: 0,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 4,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 5,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 6,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 7,
|
|
|
+ foodsImg: 'https://bpic.588ku.com/back_origin_min_pic/20/11/05/a7438bbf54ace893e790545815e14ef3.jpg',
|
|
|
+ foodsName: '麻辣烫',
|
|
|
+ foodsDesc: '包含香菜、菠菜、面、豆芽、海带',
|
|
|
+ initPrice: 28.80,
|
|
|
+ nowPrice: 10.98
|
|
|
+
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ show: false,
|
|
|
+ totalPrice: 0,
|
|
|
+ info: ''
|
|
|
+ },
|
|
|
+ onInput(e) {
|
|
|
+ this.setData({
|
|
|
+ info: e.detail.value
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onChange(e) {
|
|
|
+ let id = e.currentTarget.dataset.id;
|
|
|
+ let count = e.detail;
|
|
|
+ let foodsPrice = this.data.foods[id].nowPrice;
|
|
|
+ // console.log(id,foodsPrice);
|
|
|
+ },
|
|
|
+ onSearch() {
|
|
|
+ let list = this.data.foods;
|
|
|
+ let x = list.map(res => {
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+ console.log(x);
|
|
|
+ this.setData({
|
|
|
+ show: !this.data.show,
|
|
|
+
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|