Преглед изворни кода

Merge refs/remotes/origin/pink into refs/heads/pink

人右 пре 2 година
родитељ
комит
42d2f540a4
3 измењених фајлова са 12 додато и 12 уклоњено
  1. 9 8
      pages/search/index.js
  2. 2 3
      pages/search/index.wxss
  3. 1 1
      project.config.json

+ 9 - 8
pages/search/index.js

@@ -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) {
-
   },
 
   /**

+ 2 - 3
pages/search/index.wxss

@@ -1,6 +1,4 @@
-page{
-  background-color: #FF8700;
-}
+
 .inputContent {
   width: 95%;
   margin: 0 auto;
@@ -55,6 +53,7 @@ page{
 /* search false */
 .search_content_false {
 
+  margin-top: 15rpx;
   height: 340rpx;
   width: 100%;
   background-color: rgb(233, 233, 233);

+ 1 - 1
project.config.json

@@ -47,7 +47,7 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.19.4",
-  "appid": "wxe1ecd56185c011f9",
+  "appid": "wxc06fe0355f1e6452",
   "projectname": "miniprogram-92",
   "condition": {},
   "editorSetting": {