微信小程序顶部吸附

// pages/index/index.js// 主页点餐界面
const app = getApp();
// 请求js文件
// var common_js = require('../../utils/network.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    mychatSuanFa: {},//当前菜品的点击信息
    newfoodInfo: [],//当前菜品的信息
    //滚动的id
    scrollow: ['types0', 'setmeals0', "", ""],
    scrllowTop: {
      'lastY': 0.00
    },
    shopInfo: {}, //商家信息
    topMenu: [{
      'clickTxts': 'clickItem',
      'clickLine': "bottomLine",
      'clickTxt': "点餐"
    }, {
      'click': ' ',
      'clickLine': "",
      'clickTxt': "套餐"
    }, {
      'click': ' ',
      'clickLine': "",
      'clickTxt': "商家"
    }],
    //菜品信息
    foods: [],
    //套餐信息
    setmeals: [],
    //购物车信息(商品列表)
    mychat: [],
    // 购物车信息
    chatInfo: {},
    // 购物车信息和商品详细信息显示隐藏
    chatAndfood: {
      'chat': "none",
      'foodinfo': "none",
      "xuqiu": "none",
      "taocan": 'none'
    },
    // 顶部媳妇
    xifuInfo: { 'dangeId': 'types0', 'taocanId': 'can0' },
    scrollTop: 0
  },

  // /**
  //  * 生命周期函数--监听页面加载
  //  */
  onLoad: function (options) {
    //   //获取系统信息
    this.getProjectInfo();
    //获取店铺信息,获取菜品,获取套餐
    // this.getShopInfoAndFoodInfoAndTaoCan();
    // //获取个人信息
    // this.getOPenid();
    //获取菜品信息
    // this.getDianOrder();
  },

  // /**
  //  * 生命周期函数--监听页面初次渲染完成
  //  */
  // onReady: function () {
  //   var query = wx.createSelectorQuery();
  //   this.setData({
  //     query: query
  //   });
  // },

  // /**
  //  * 生命周期函数--监听页面显示
  //  */
  onShow: function () {
    this.getYuansuHeight();
    // this.setData({
    //   foods: app.orderingInfo,
    //   setmeals: app.setmealsInfo,
    //   mychat: app.myChat,
    //   chatInfo: app.chatInfo
    // })
  },

  // /**
  //  * 生命周期函数--监听页面隐藏
  //  */
  // onHide: function () {

  // },

  // /**
  //  * 生命周期函数--监听页面卸载
  //  */
  // onUnload: function () {

  // },

  // /**
  //  * 页面相关事件处理函数--监听用户下拉动作
  //  */
  // onPullDownRefresh: function () {

  // },

  // /**
  //  * 页面上拉触底事件的处理函数
  //  */
  // onReachBottom: function () {

  // },

  // /**
  //  * 用户点击右上角分享
  //  */
  // onShareAppMessage: function () {

  // },
  // //获取个人信息
  getProjectInfo: function () {
    this.setData({
      hostinfo: app.hostinfo
    })
  },
  // // 顶部订单改变
  // topMenuChange: function (res) {
  //   var topMenu = this.data.topMenu;
  //   var index = res.currentTarget.dataset.index;
  //   if (index == 2) {
  //     this.getShopInfoAndFoodInfoAndTaoCan();
  //   }
  //   for (var i = 0; i < topMenu.length; i++) {
  //     if (index == i) {
  //       topMenu[i].clickTxts = "clickItem";
  //       topMenu[i].clickLine = "bottomLine";
  //     } else {
  //       topMenu[i].clickTxts = "";
  //       topMenu[i].clickLine = "";
  //     }
  //   }
  //   this.setData({
  //     topMenu: topMenu
  //   })
  // },
  // //获取店铺信息,获取菜品,获取套餐
  // getShopInfoAndFoodInfoAndTaoCan: function () {
  //   console.log("获取店铺信息,获取菜品,获取套餐---->", app.shopInfo);
  //   this.setData({
  //     shopInfo: app.shopInfo
  //   })
  // },
  // //获取点餐信息
  // getDianOrder: function () {
  //   var userInfo = this.data.userInfo
  //   var data = {
  //     'shopId': app.shopId,
  //     'customerFlag': 'N',
  //     'customerGrade': -1
  //   };
  //   if (userInfo.userInfo.flag) {
  //     data.customerFlag = "Y"
  //     console.log("是会员");
  //   } else {
  //     data.customerFlag = "N"
  //     console.log("非会员");
  //   }
  //   if (userInfo.gradeSort == undefined || userInfo.gradeSort == null) {

  //   } else {
  //     data.customerGrade = userInfo.userInfo.gradeSort
  //   }

  //   common_js.getRequest(app.project.ip + app.project.projectName + "obtainProduct",
  //     data,
  //     "单品信息加载中",
  //     (res) => {
  //       console.log("获取点餐信息成功");
  //       console.log(res);
  //       console.log(res.name[0].classes);
  //       var foods = this.updateFoods(res.name);
  //       this.setData({
  //         foods: foods,
  //         'scrollow[2]': foods[0].classes
  //       })
  //       app.orderingInfo = foods; //点餐信息
  //     },
  //     (res) => {
  //       console.log("获取点餐信息失败");
  //       console.log(res);
  //     });
  // },
  // //获取套餐信息
  // obtainPackage: function () {
  //   var userInfo = this.data.userInfo
  //   var data = {
  //     'shopId': app.shopId,
  //     'customerFlag': 'N',
  //     'customerGrade': userInfo.gradeSort
  //   };

  //   if (userInfo.flag) {
  //     data.customerFlag = "Y"
  //     console.log("是会员");
  //   }
  //   common_js.getRequest(app.project.ip + app.project.projectName + "obtainPackage", data, "套餐信息加载中", (res) => {
  //     console.log("获取套餐信息成功");
  //     console.log(res);
  //     console.log(res.name[0].classes);
  //     var setmeals = this.updateFoods(res.name);
  //     this.setData({
  //       setmeals: setmeals,
  //       'scrollow[3]': setmeals[0].classes
  //     })
  //     app.setmealsInfo = setmeals; //套餐信息
  //   },
  //     (res) => {
  //       console.log("获取套餐信息失败");
  //       console.log(res);
  //     });
  // },


  // //获取个人信息
  // getUserInfo: function () {
  //   var userInfo = app.userInfo;
  //   console.log("个人信息", userInfo);
  //   if (userInfo.openid.length > 0) {
  //     var data = {
  //       'shopId': app.shopId,
  //       'openid': userInfo.openid,
  //       'type': '2'
  //     }
  //     common_js.getRequest(app.project.ip + app.project.projectName + "checkUser", data, "获取个人信息中", (res) => {
  //       console.log("获取个人信息");
  //       console.log(res);
  //       res.isyouhui = -1;
  //       app.userInfo.userInfo = res
  //       app.userInfo.isregister = 1;
  //       this.setData({
  //         userInfo: app.userInfo
  //       })
  //       // this.setData({
  //       //   'userInfo.'
  //       //   'userInfo.userInfo': app.userInfo.userInfo,
  //       //   'userInfo.isregister':1
  //       // })
  //       //获取单品信息
  //       this.getDianOrder();
  //       //获取套餐信息
  //       this.obtainPackage();
  //     },
  //       (res) => {
  //         console.log("获取个人信息失败", res);
  //         //获取单品信息
  //         this.getDianOrder();
  //         //获取套餐信息
  //         this.obtainPackage();
  //       });
  //   }
  // },
  // // 获取用户的openid
  // getOPenid: function () {
  //   wx.cloud.callFunction({
  //     name: 'login',
  //     data: {}
  //   }).then(
  //     res => {
  //       console.log("获取openid--->", res);
  //       app.userInfo.openid = res.result.openid;
  //       this.getUserInfo();
  //     }
  //   )
  // },
  // // 图片错误
  // imgError: function (res) {
  //   console.log("图片报需哦呜了");
  //   var bigindex = res.currentTarget.dataset.bigindex;
  //   var index = res.currentTarget.dataset.index;
  //   var foods = this.data.foods;
  //   foods[bigindex].list[index].image = "";
  //   this.setData({
  //     foods: foods
  //   })
  // },


  // // 套餐图片错误
  // imgError1: function (res) {
  //   console.log("图片报需哦呜了");
  //   var bigindex = res.currentTarget.dataset.bigindex;
  //   var index = res.currentTarget.dataset.index;
  //   var setmeals = this.data.setmeals;
  //   setmeals[bigindex].list[index].image = "";
  //   this.setData({
  //     setmeals: setmeals
  //   })
  // },


  // //初始化菜品信息
  // updateFoods: function (foodlist) {
  //   for (var i = 0; i < foodlist.length; i++) {
  //     foodlist[i].count = 0;
  //     //初始化类别
  //     if (i == 0) {
  //       foodlist[i].isshow = 1;
  //     } else {
  //       foodlist[i].isshow = 0;
  //     }
  //     for (var n = 0; n < foodlist[i].list.length; n++) {
  //       foodlist[i].list[n].count = 0;
  //       foodlist[i].list[n].specs = -1;
  //       foodlist[i].list[n].specsInfo = {};
  //     }
  //   }
  //   return foodlist;
  // },

  // // 点餐类别的点餐信息
  typeClick: function (res) {
    console.log(res.currentTarget.dataset);
    var index = parseInt(res.currentTarget.dataset.index);
    var foods = this.data.foods;
    console.log(index);
    for (var i = 0; i < foods.length; i++) {
      if (index == i) {
        foods[i].isshow = 1;
      } else {
        foods[i].isshow = 0;
      }
    }
    this.setData({
      foods: foods,
      'scrollow[0]': 'types' + index,
      'scrollow[2]': index
    })
  },
  // // 套餐类别的点餐信息
  // setmealsClick: function (res) {
  //   console.log(res);
  //   console.log(res.currentTarget);
  //   console.log(res.currentTarget.dataset);
  //   var index = parseInt(res.currentTarget.dataset.index);
  //   var foods = this.data.setmeals;
  //   console.log(index);
  //   for (var i = 0; i < foods.length; i++) {
  //     if (index == i) {
  //       foods[i].isshow = 1;
  //     } else {
  //       foods[i].isshow = 0;
  //     }
  //   }
  //   this.setData({
  //     setmeals: foods,
  //     'scrollow[1]': 'setmeals' + index,
  //     'scrollow[3]': foods[index].classes
  //   })
  // },


  // // 购物车的交互
  // //加入购物车
  // addchat: function (res, caozuo) {
  //   var count = res.currentTarget.dataset.count;
  //   var bigindex = res.currentTarget.dataset.bigindex;
  //   var index = res.currentTarget.dataset.index;
  //   var caozuo = res.currentTarget.dataset.caozuo;
  //   var typecount = res.currentTarget.dataset.typecount;
  //   var foods = this.data.foods;
  //   var mychat = this.data.mychat;
  //   console.log("操作--->", typecount, caozuo);
  //   // if (caozuo == 'jia') {
  //   foods[bigindex].count = typecount;
  //   // } else {
  //   //   foods[bigindex].count = foods[bigindex].count - 1;
  //   // }
  //   console.log("购物车1111", count);
  //   if (count == 0) {
  //     //删除购物车
  //     console.log("删除购物车", count);
  //     var count1 = -1;
  //     for (var i = 0; i < mychat.length; i++) {
  //       if (mychat[i].productId == foods[bigindex].list[index].productId) {
  //         count1 = i;
  //       }
  //     }
  //     mychat = this.delShuZu(mychat, count1);
  //     // mychat.splice(count1, 1)
  //     console.log("删除商品结果", mychat);
  //     foods[bigindex].list[index].count = 0;
  //     app.myChat = mychat
  //     app.orderingInfo = foods
  //     this.setData({
  //       mychat: mychat,
  //       foods: foods,
  //       'newfoodInfo.count': count,
  //       'mychatSuanFa.currentTarget.dataset.typecount': typecount
  //     })
  //     this.reckonChat();
  //   } else {
  //     console.log("修改购物车");

  //     foods[bigindex].list[index].count = count;
  //     // app.orderingInfo = foods
  //     // this.setData({
  //     //   foods: foods,
  //     //   'newfoodInfo.count': count
  //     // })
  //     // app.orderingInfo = foods
  //     this.updateChat(1, foods[bigindex].list[index], foods, count, typecount);
  //     //   foods[bigindex].list[index].count = count;
  //     //   app.orderingInfo = foods
  //     //   this.setData({
  //     //     foods: foods,
  //     //     'newfoodInfo.count': count
  //     //   })
  //     // this.updateChat(1, foods[bigindex].list[index]);
  //   }
  // },




  // //对购物车的操作
  // updateChat: function (operation, foodinfo, foods, count, typecount) {
  //   var mychat = this.data.mychat;
  //   console.log("我的购物车---->", mychat);
  //   var iss = -1;
  //   for (var i = 0; i < mychat.length; i++) {
  //     if (foodinfo.productId == mychat[i].productId) {
  //       iss = i;
  //       break;
  //     }
  //   }
  //   console.log("修改名词--->", iss);
  //   if (iss == -1) {
  //     console.log("添加近购物车");
  //     mychat.push(foodinfo);
  //   } else {
  //     console.log("修复该--------购物车", this.data.mychatSuanFa.currentTarget.dataset);
  //     mychat[i] = foodinfo
  //   }
  //   this.setData({
  //     mychat: mychat,
  //     foods: foods,
  //     'newfoodInfo.count': count,
  //     'mychatSuanFa.currentTarget.dataset.typecount': typecount
  //   });
  //   app.myChat = mychat
  //   app.orderingInfo = foods
  //   this.reckonChat();
  //   // console.log("我的购物车---->", mychat, iss);
  //   // if (iss == -1) {
  //   //   //添加进去购物车
  //   //   console.log("添加进去购物车--->");
  //   //   mychat.push(foodinfo);
  //   // } else {
  //   //   //修改购物车数量
  //   //   console.log("修改购物车数量--->", foodinfo.count);
  //   //   mychat[iss].count = foodinfo.count;
  //   // }
  //   // this.setData({
  //   //   mychat: mychat
  //   // });
  //   // app.myChat = mychat

  // },
  // //判断是否有规格信息  是否有规格信息


  // // getspecs:function(res1){
  // //   setTimeout( (res)=> {
  // //     this.getspecs1(res1);
  // //   }, 1000);
  // // },

  // getspecs: function (res1) {

  //   console.log("扫描---->", res1);
  //   this.setData({
  //     mychatSuanFa: res1
  //   })
  //   var count = res1.currentTarget.dataset.count;
  //   var bigindex = res1.currentTarget.dataset.bigindex;
  //   var index = res1.currentTarget.dataset.index;
  //   var xuqiu = res1.currentTarget.dataset.xuqiu;
  //   console.log('xuqiu--->', xuqiu);
  //   var foods = this.data.foods;
  //   var foodinfo = foods[bigindex].list[index];


  //   if (foodinfo.units != "千克") {

  //     if (foodinfo.taste == 1) {
  //       console.log(" //-----没有规格");
  //       this.setData({
  //         "newfoodInfo": foodinfo
  //       })
  //       this.addchat(res1);
  //     } else if (foodinfo.taste == 0 && foodinfo.specs == -1) {
  //       //没有请求过规格,开始请求
  //       console.log("没有请求过规格,开始请求");
  //       common_js.getRequest(
  //         app.project.ip + app.project.projectName + "3fPj5k9u4bLYddE3", {
  //           'productId': foodinfo.productId
  //         },
  //         "",
  //         res => {
  //           console.log("规格信息", res);
  //           var specsInfo = res;
  //           for (var i = 0; i < specsInfo.length; i++) {
  //             specsInfo[i].isshow = 0;
  //             for (var n = 0; n < specsInfo[i].list.length; n++) {
  //               if (n == 0) {
  //                 specsInfo[i].list[n].isshow = 1;
  //               } else {
  //                 specsInfo[i].list[n].isshow = 0;
  //               }
  //             }
  //           }
  //           foodinfo.specs = 0;
  //           foodinfo.specsInfo = res;
  //           // 生成空数组
  //           console.log("生成空数组")
  //           var selectionXuqiu = [];
  //           for (var i = 0; i < res.length; i++) {
  //             selectionXuqiu.push(res[i].list[0].tasteName);
  //           }
  //           foodinfo.selectionXuqiu = selectionXuqiu;
  //           foods[bigindex].list[index] = foodinfo
  //           res1.currentTarget.dataset.typecount = res1.currentTarget.dataset.typecount - 1;
  //           this.setData({
  //             mychatSuanFa: res1,
  //             "chatAndfood.xuqiu": "",//对话框
  //             newfoodInfo: foodinfo,
  //             foods: foods
  //           })
  //           app.orderingInfo = foods;
  //         },
  //         res => {
  //           console.log(res);
  //         });
  //     } else if (foodinfo.specs == 0 && foodinfo.specs == 0) {
  //       console.log("规格已经请求过了,开始修改购物车了");

  //       if (xuqiu == '66') {

  //         // 需求对话框的按钮
  //         this.addchat(res1, 1);

  //       } else {
  //         res1.currentTarget.dataset.typecount = res1.currentTarget.dataset.typecount - 1;
  //         this.setData({
  //           mychatSuanFa: res1,
  //           "chatAndfood.xuqiu": "",
  //           "newfoodInfo": foodinfo
  //         })
  //       }
  //     }
  //   }
  //   else {
  //     app.startLoading("对不起,该商品是称重的商品,青岛收银台点取该菜品", "none");
  //   }
  // },

  // //通过信息返回typecount
  // getTypeCount: function (res1) {
  //   var bigindex = res1.currentTarget.dataset.bigindex;
  //   var index = res1.currentTarget.dataset.index;
  //   var foods = this.data.foods;
  //   var typecount = foods[bigindex].count;
  //   return typecount;
  // },

  // //选中把规格信息  取消规格信息
  // updatexuqiu: function (res) {
  //   var bigindex = res.currentTarget.dataset.bigindex
  //   var index = parseInt(res.currentTarget.dataset.index);
  //   var info = res.currentTarget.dataset.info;
  //   var newfoodInfo = this.data.newfoodInfo;
  //   var foods = this.data.foods;
  //   for (var i = 0; i < newfoodInfo.specsInfo[bigindex].list.length; i++) {
  //     if (i == index) {
  //       console.log("对了--->", i, info, info.length);
  //       if (info.length <= 0) {
  //         console.log("取消");
  //         newfoodInfo.selectionXuqiu[bigindex] = "";
  //         newfoodInfo.specsInfo[bigindex].list[i].isshow = 0;
  //       } else {
  //         console.log("选中");
  //         newfoodInfo.selectionXuqiu[bigindex] = info;
  //         newfoodInfo.specsInfo[bigindex].list[i].isshow = 1;
  //         console.log("选中", newfoodInfo.specsInfo[bigindex].list[i].isshow);
  //       }
  //     } else {
  //       console.log("不对了--->", i, info);
  //       newfoodInfo.specsInfo[bigindex].list[i].isshow = 0;
  //     }
  //   }
  //   console.log("-->", newfoodInfo);
  //   for (var i = 0; i < foods.length; i++) {
  //     if (foods[i].classes == newfoodInfo.kindName) {
  //       for (var n = 0; n < foods[i].list.length; n++) {
  //         if (foods[i].list[n].productName == newfoodInfo.productName) {
  //           foods[i].list[n] = newfoodInfo;
  //           break;
  //         }
  //       }
  //       break;
  //     }
  //   }
  //   console.log(newfoodInfo.specsInfo[bigindex].list[index].isshow);
  //   this.setData({
  //     foods: foods,
  //     newfoodInfo: newfoodInfo
  //   })
  //   app.orderingInfo = foods;//点餐信息
  // },


  // //----------------------- 套餐----------------
  // taocanJia: function (res) {
  //   this.setData({
  //     mychatSuanFa: res
  //   })
  //   console.log("套餐开始");
  //   var bigindex = res.currentTarget.dataset.bigindex
  //   var index = parseInt(res.currentTarget.dataset.index);
  //   var info = res.currentTarget.dataset.info;
  //   var count = res.currentTarget.dataset.count;
  //   var setmeals = this.data.setmeals;
  //   var xuqiu = res.currentTarget.dataset.xuqiu;
  //   var taocan = setmeals[bigindex].list[index];
  //   var mychatSuanFa = this.data.mychatSuanFa;
  //   this.setData({
  //     newfoodInfo: taocan
  //   })
  //   console.log(taocan);
  //   if (taocan.specs != 99 && taocan.specs != 88) {
  //     console.log("开始查询套餐", taocan, taocan.productId);
  //     app.startLoading("加载套餐信息", "loading");
  //     //处理曹参ID
  //     var packageId = taocan.productId.substr(1, taocan.productId.length)
  //     common_js.getRequest(
  //       app.project.ip + app.project.projectName + "dFqvszir122ZeR9k", {
  //         'packageId': packageId, "shopId": app.shopId
  //       },
  //       "",
  //       res1 => {
  //         app.stopLoading();
  //         console.log("规格信息", res1);
  //         //修改套餐菜品信息
  //         this.updataTaoCan(res, res1.packageProduct);
  //         mychatSuanFa.currentTarget.dataset.typecount = mychatSuanFa.currentTarget.dataset.typecount - 1;
  //         if (res1.packageProduct.length > 0) {
  //           console.log("显示对话框狂");
  //           this.setData({
  //             newfoodInfo: taocan,
  //             "chatAndfood.taocan": '',
  //             mychatSuanFa: mychatSuanFa
  //           })
  //         } else {
  //           console.log("不显示对话框");
  //           this.addTaoCanChat(res);
  //         }
  //       },
  //       res => {
  //         console.log("规格信息", res);
  //       });
  //   } else if (taocan.specs == 99) {
  //     //直接修改购物车(有规格)
  //     if (xuqiu == 66) {
  //       console.log("有需求,修改购物车");
  //       this.addTaoCanChat(res);
  //     } else {
  //       mychatSuanFa.currentTarget.dataset.typecount = mychatSuanFa.currentTarget.dataset.typecount - 1;
  //       console.log("有需求,显示需求界面");
  //       this.setData({
  //         "chatAndfood.taocan": "",
  //         mychatSuanFa: mychatSuanFa
  //       })
  //     }
  //   } else if (taocan.specs == 88) {
  //     //直接修改购物车(无规格)
  //     console.log("直接修改购物车(无规格)");
  //     this.addTaoCanChat(res);
  //   }
  //   else {
  //     console.log("无套餐", taocan);
  //   }
  // },
  // //修改套餐状态(是否获取单品信息,以及对于单品信息处理)
  // updataTaoCan: function (res, guigeInfo) {
  //   console.log("修改订单状态");
  //   var bigindex = res.currentTarget.dataset.bigindex;
  //   var index = parseInt(res.currentTarget.dataset.index);
  //   var info = res.currentTarget.dataset.info;
  //   var setmeals = this.data.setmeals;
  //   if (guigeInfo.length > 0) {
  //     setmeals[bigindex].list[index].specs = 99;
  //     for (var i = 0; i < guigeInfo.length; i++) {
  //       console.log(guigeInfo[i].tasteName);
  //       //将规格信息json化
  //       guigeInfo[i].tasteName = JSON.parse(guigeInfo[i].tasteName);
  //       if (guigeInfo[i].tasteName != null) {
  //         for (var a = 0; a < guigeInfo[i].tasteName.length; a++) {
  //           guigeInfo[i].tasteName[a].isshow = 0;
  //           for (var b = 0; b < guigeInfo[i].tasteName[a].list.length; b++) {
  //             if (b == 0) {
  //               guigeInfo[i].tasteName[a].list[b].isshow = 1;
  //             } else {
  //               guigeInfo[i].tasteName[a].list[b].isshow = 0;
  //             }
  //           }
  //           var spacess = [];
  //           for (var c = 0; c < guigeInfo[i].tasteName.length; c++) {
  //             console.log("规格第一个名字");
  //             // console.log("规格第一个名字",guigeInfo[i].tasteName[c].list[0].tasteName);
  //             spacess.push(guigeInfo[i].tasteName[c].list[0].tasteName);
  //             // spacess.push("----");
  //           }
  //           guigeInfo[i].selectionXuqiu = spacess;
  //         }
  //       }
  //       console.log(guigeInfo[i].tasteName);
  //     }
  //   } else {
  //     setmeals[bigindex].list[index].specs = 88;
  //   }
  //   console.log(guigeInfo);
  //   // for (var i = 0; i < guigeInfo.length;i++)
  //   // {
  //   //     for(var n=0;n<)
  //   // }
  //   setmeals[bigindex].list[index].specsInfo = guigeInfo;


  //   this.setData({
  //     setmeals: setmeals
  //   })

  // },
  // //套餐添加进去购物车
  // addTaoCanChat: function (res) {
  //   var bigindex = res.currentTarget.dataset.bigindex
  //   var index = parseInt(res.currentTarget.dataset.index);
  //   var info = res.currentTarget.dataset.info;
  //   var count = res.currentTarget.dataset.count;
  //   var caozuo = res.currentTarget.dataset.caozuo;
  //   var typecount = res.currentTarget.dataset.typecount;
  //   var setmeals = this.data.setmeals;
  //   var taocan = setmeals[bigindex].list[index];
  //   var mychat = this.data.mychat;
  //   var setmeals = this.data.setmeals;
  //   var newfoodInfo = this.data.newfoodInfo;
  //   var mychatSuanFa = this.data.mychatSuanFa;
  //   setmeals[bigindex].count = typecount;


  //   if (count == 0) {
  //     //删除购物车
  //     console.log("删除购物车");
  //     var mychatCopy = [];
  //     for (var i = 0; i < mychat.length; i++) {
  //       if (mychat[i].productId == taocan.productId) {
  //       } else {
  //         mychatCopy.push(mychat[i]);
  //       }
  //     }
  //     setmeals[bigindex].list[index].count = 0;
  //     mychat = mychatCopy
  //   } else {
  //     console.log("修改套餐信息");
  //     var iss = -1;
  //     for (var i = 0; i < mychat.length; i++) {
  //       if (taocan.productId == mychat[i].productId) {
  //         iss = i;
  //         break;
  //       }
  //     }
  //     if (iss == -1) {
  //       console.log("添加近购物车");
  //       taocan.count = count;
  //       mychat.push(taocan);
  //       setmeals[bigindex].list[index].count = count;
  //     } else {
  //       console.log("修改购物车");
  //       mychat[iss].count = count;
  //       setmeals[bigindex].list[index].count = count;
  //     }
  //   }
  //   console.log(mychat, setmeals);
  //   this.setData({
  //     mychat: mychat,
  //     // setmeals: setmeals,
  //     newfoodInfo: taocan,
  //     'mychatSuanFa.currentTarget.dataset.typecount': mychatSuanFa.currentTarget.dataset.typecount
  //   })
  //   app.myChat = mychat;
  //   // app.setmealsInfo = setmeals
  //   this.taocanGeshu();
  //   this.reckonChat();
  // },

  // //点击规格进行处理
  // spaceClick: function (res) {
  //   var bigbigindex = res.currentTarget.dataset.bigbigindex
  //   var bigindex = res.currentTarget.dataset.bigindex
  //   var index = res.currentTarget.dataset.index
  //   var info = res.currentTarget.dataset.info
  //   console.log("infoinfoinfo--->", info);
  //   var setmeals = this.data.setmeals;
  //   var mychat = this.data.mychat;//点击加减的时候对购物车进行处理
  //   var setmeals = this.data.setmeals;
  //   var newfoodInfo = this.data.newfoodInfo;
  //   var mychatSuanFa = this.data.mychatSuanFa;
  //   console.log(bigbigindex, bigindex, index);
  //   console.log(newfoodInfo.specsInfo);
  //   newfoodInfo.specsInfo[bigbigindex].selectionXuqiu[bigindex] = info;
  //   var clickInfoBig = mychatSuanFa.currentTarget.dataset;
  //   setmeals[clickInfoBig.bigindex].list[clickInfoBig.index].specsInfo[bigbigindex].selectionXuqiu[bigindex] = info;
  //   if (info.length > 0) {
  //     for (var a = 0; a < setmeals[clickInfoBig.bigindex].list[clickInfoBig.index].specsInfo[bigbigindex].tasteName[bigindex].list.length; a++) {
  //       if (index == a) {
  //         setmeals[clickInfoBig.bigindex].list[clickInfoBig.index].specsInfo[bigbigindex].tasteName[bigindex].list[a].isshow = 1;
  //         newfoodInfo.specsInfo[bigbigindex].tasteName[bigindex].list[a].isshow = 1;
  //       } else {
  //         setmeals[clickInfoBig.bigindex].list[clickInfoBig.index].specsInfo[bigbigindex].tasteName[bigindex].list[a].isshow = 0;
  //         newfoodInfo.specsInfo[bigbigindex].tasteName[bigindex].list[a].isshow = 0;
  //       }
  //     }
  //   } else {
  //     setmeals[clickInfoBig.bigindex].list[clickInfoBig.index].specsInfo[bigbigindex].tasteName[bigindex].list[index].isshow = 0;
  //     newfoodInfo.specsInfo[bigbigindex].tasteName[bigindex].list[index].isshow = 0;
  //   }
  //   this.setData({
  //     newfoodInfo: newfoodInfo,
  //     setmeals: setmeals
  //   })
  // },

  // //通过套餐信息统计个数
  // taocanGeshu: function () {
  //   var setmeals = this.data.setmeals;
  //   for (var i = 0; i < setmeals.length; i++) {
  //     var count = 0;
  //     for (var n = 0; n < setmeals[i].list.length; n++) {
  //       count = count + setmeals[i].list[n].count;
  //     }
  //     setmeals[i].count = count;
  //   }
  //   this.setData({
  //     setmeals: setmeals
  //   })
  //   app.setmealsInfo = setmeals
  // },

  // //--------------计算购物车
  // reckonChat: function () {
  //   var chatInfo = app.reckonChat();
  //   this.setData({
  //     chatInfo: chatInfo
  //   })
  // },
  // //-----------------------------------购物车的加减按钮---------------------------
  // //清空购物车
  // delAllChat: function () {
  //   var mychatSuanFa = {};
  //   var newfoodInfo = {};
  //   var foods = this.data.foods;
  //   var mychat = [];
  //   for (var i = 0; i < foods.length; i++) {
  //     foods[i].count = 0;
  //     for (var n = 0; n < foods[i].list.length; n++) {
  //       foods[i].list[n].count = 0;
  //     }
  //   }
  //   var setmeals = this.data.setmeals;
  //   for (var i = 0; i < setmeals.length; i++) {
  //     setmeals[i].count = 0;
  //     for (var n = 0; n < setmeals[i].list.length; n++) {
  //       //种类购买个数清空
  //       setmeals[i].list[n].count = 0;
  //       for (var m = 0; m < setmeals[i].list[n].specsInfo.length; m++) {
  //         //选中的需求数组清空

  //         // console.log(setmeals[i].list[n].specsInfo[m].selectionXuqiu);
  //         // console.log(setmeals[i].list[n].specsInfo[m].selectionXuqiu.length);

  //         if (setmeals[i].list[n].specsInfo[m].selectionXuqiu != undefined) {
  //           for (var a = 0; a < setmeals[i].list[n].specsInfo[m].selectionXuqiu.length; a++) {
  //             setmeals[i].list[n].specsInfo[m].selectionXuqiu[a] = "";
  //           }
  //         }

  //         // 选中的需求清空
  //         // console.log(setmeals[i].list[n].specsInfo[m].tasteName);
  //         // console.log(setmeals[i].list[n].specsInfo[m].tasteName.length);
  //         if (setmeals[i].list[n].specsInfo[m].tasteName != null) {
  //           for (var a = 0; a < setmeals[i].list[n].specsInfo[m].tasteName.length; a++) {
  //             for (var b = 0; b < setmeals[i].list[n].specsInfo[m].tasteName[a].list.length; b++) {
  //               setmeals[i].list[n].specsInfo[m].tasteName[a].list[b].isshow = 0;
  //             }
  //           }
  //         }


  //       }
  //     }
  //   }
  //   this.setData({
  //     mychatSuanFa: {},
  //     newfoodInfo: {},
  //     foods: foods,
  //     mychat: [],
  //     setmeals: setmeals,
  //     chatInfo: { 'count': 0, 'truePrice': 0.00, 'falsePrice': 0.00 },
  //     'chatAndfood.chat': 'none'
  //   })
  //   app.foods = foods;
  //   app.myChat = mychat;
  //   app.setmeals = setmeals;
  //   app.chatInfo = { 'count': 0, 'truePrice': 0.00, 'falsePrice': 0.00 };
  // },

  // //购物车的加减按钮
  // chatUpdate: function (res) {
  //   var index = res.currentTarget.dataset.index;
  //   var count = res.currentTarget.dataset.count;
  //   var caozuo = res.currentTarget.dataset.caozuo;
  //   var mychat = this.data.mychat;
  //   var setmeals = this.data.setmeals;
  //   var foods = this.data.foods;
  //   //1.判断是套餐还是点餐
  //   // 
  //   var foodinfo = mychat[index];

  //   //模拟底界面点击
  //   var dataset = { 'bigindex': -1, 'caozuo': caozuo, 'count': count, 'index': 0 }
  //   if (foodinfo.kindId.indexOf("T") >= 0) {
  //     console.log("是套餐");
  //     for (var i = 0; i < setmeals.length; i++) {
  //       console.log(setmeals[i].kindId, foodinfo.kindId);
  //       if (setmeals[i].kindId == foodinfo.kindId) {
  //         dataset.bigindex = i;
  //         for (var n = 0; n < setmeals[i].list.length; n++) {
  //           if (setmeals[i].list[n].productId == foodinfo.productId) {
  //             dataset.index = n;
  //             break;
  //           }
  //         }
  //         break;
  //       }
  //     }
  //   } else {
  //     console.log("不是套餐");
  //     for (var i = 0; i < foods.length; i++) {
  //       if (foods[i].kindId == foodinfo.kindId) {
  //         dataset.bigindex = i;
  //         for (var n = 0; n < foods[i].list.length; n++) {
  //           if (foods[i].list[n].productId == foodinfo.productId) {
  //             dataset.index = n;
  //             break;
  //           }
  //         }
  //         break;
  //       }
  //     }
  //   }

  //   var mychatSuanFa = { 'currentTarget': { 'dataset': dataset } }


  //   this.setData({
  //     mychatSuanFa: mychatSuanFa
  //   })
  //   if (foodinfo.kindId.indexOf("T") < 0) {
  //     this.getspecs(mychatSuanFa);
  //   } else {
  //     this.taocanJia(mychatSuanFa);
  //   }

  // },


  // // ----------------------------------对话框------------------
  // // 关闭点餐规格对话框
  // xuqiuClose: function () {
  //   this.setData({
  //     "chatAndfood.xuqiu": "none"
  //   })
  // },
  // // 关闭套餐规格对话框
  // loseTaoCanalert: function () {
  //   this.setData({
  //     "chatAndfood.taocan": "none"
  //   })
  // },
  // // 打开购物车
  // openChat: function () {
  //   this.setData({
  //     'chatAndfood.chat': ''
  //   })
  // },
  // // 隐藏购物车
  // hidechat: function () {
  //   this.setData({
  //     'chatAndfood.chat': 'none'
  //   })
  // },

  // //-----------------跳转---------------
  // toSubmit: function () {
  //   wx.navigateTo({
  //     url: '/pages/orderInfo/orderInfo/orderInfo',
  //   })
  // },
  // //前往食物详细界面
  // toFoodInfo: function (res) {
  //   console.log('--------------', res);
  //   app.imgClickFoodInfo = res;
  //   var bigindex = res.currentTarget.dataset.bigindex;
  //   var index = res.currentTarget.dataset.index;
  //   var type = res.currentTarget.dataset.type;
  //   console.log(bigindex, index);
  //   var foods = this.data.foods;
  //   var setmeals = this.data.setmeals;
  //   if (type == 0) {
  //     var foodinfo = foods[bigindex].list[index];
  //   }
  //   else {
  //     var foodinfo = setmeals[bigindex].list[index];
  //   }
  //   foodinfo = JSON.stringify(foodinfo);
  //   wx.navigateTo({
  //     url: '/pages/food/foodInfo/foodInfo?info=' + foodinfo + "&type=" + type,
  //   })
  // },
  // //------------------工具--------------
  // //数组删除元素
  // delShuZu: function (list, index) {
  //   console.log("主页伤处", list, index);
  //   var bb = [];
  //   for (var i = 0; i < list.length; i++) {
  //     if (i == index) {

  //     } else {
  //       bb.push(list[i]);
  //     }
  //   }
  //   return bb
  // },

  // // 顶部媳妇
  // // scrollChange: function () {
  // //   var that = this;
  // //   // var typesId= that.data.scrollow[0];
  // //   // var index = parseInt(typesId.substring(typesId.length - 1));
  // //   var id = that.data.xifuInfo.dangeId
  // //   var index = parseInt(id.substring(id.length - 1));
  // //   var query = wx.createSelectorQuery()//创建节点查询器 query
  // //   console.log("#typess" + index);
  // //   query.select("#typess" + index).boundingClientRect()//这段代码的意思是选择Id= the - id的节点,获取节点位置信息的查询请求
  // //   console.log(that.data.scrollow[0]);
  // //   query.exec(function (res) {
  // //     console.log(res[0].top);
  // //     console.log(res[0]);
  // //     if (res[0].top <= 135) {
  // //       console.log("切换到下一个");
  // //       // var index = parseInt(that.data.scrollow[0].substring(that.data.scrollow[0].length-1));
  // //       // console.log("截取的字符串", index);
  // //       that.setData({
  // //         'xifuInfo.dangeId': 'types' + (index + 1),
  // //         menuTop: res[0].top
  // //       })
  // //       // res.currentTarget.dataset.index
  // //       var indexxx = { 'currentTarget': { 'dataset': { 'index': index + 1 } } }
  // //       that.typeClick(indexxx);
  // //     }
  // //     //  else if (res[0].top >= 175){
  // //     //   console.log("切换到下一个");
  // //     //   that.setData({
  // //     //     'xifuInfo.dangeId': 'types' + (index-1)
  // //     //   })
  // //     //   // res.currentTarget.dataset.index
  // //     //   var indexxx = { 'currentTarget': { 'dataset': { 'index': index - 1 } } }
  // //     //   that.typeClick(indexxx);
  // //     // }
  // //     that.setData({
  // //       menuTop: res[0].top
  // //     })
  // //   });

  // // }
  // scrollChange: function (res) {

  //   console.log(res);

  //   var that = this;
  //   // var typesId= that.data.scrollow[0];
  //   // var index = parseInt(typesId.substring(typesId.length - 1));
  //   var id = that.data.scrollow[0]
  //   var index = parseInt(id.substring(id.length - 1));
  //   var query = wx.createSelectorQuery()//创建节点查询器 query

  //   query.select("#types" + index).boundingClientRect()//这段代码的意思是选择Id= the - id的节点,获取节点位置信息的查询请求
  //   console.log(that.data.scrollow[0]);
  //   query.exec(function (res) {
  //     console.log(res[0].top, res[0].bottom);
  //     if (res[0].top < that.data.menuTop) {
  //       console.log("像上滑");

  //     } else {
  //       console.log("像下滑");
        
  //     }
  //     // if (res[0].top <= 135) {
  //     //   console.log("切换到下一个");
  //     //   that.setData({
  //     //     'xifuInfo.dangeId': 'types' + (index + 1),
  //     //     menuTop: res[0].top
  //     //   })
  //     //   var indexxx = { 'currentTarget': { 'dataset': { 'index': index + 1 } } }
  //     //   that.typeClick(indexxx);
  //     // }
  //     //  else if (res[0].top >= 175){
  //     //   console.log("切换到下一个");
  //     //   that.setData({
  //     //     'xifuInfo.dangeId': 'types' + (index-1)
  //     //   })
  //     //   // res.currentTarget.dataset.index
  //     //   var indexxx = { 'currentTarget': { 'dataset': { 'index': index - 1 } } }
  //     //   that.typeClick(indexxx);
  //     // }
  //     that.setData({
  //       menuTop: res[0].top
  //     })
  //   });

  // },
  scrollChange:function(res){
    console.log(res.detail.scrollTop);
    var scrollTop = res.detail.scrollTop;
    var huadongInfo = this.data.huadongInfo;
    var a=0;
    console.log(scrollTop, huadongInfo);
    for (var i = 0; i < huadongInfo.length;i++)
    {
      if (scrollTop<huadongInfo[i])
      {
        a=i;
        break;
      }
    }
    if(a==0)
    {
      a = huadongInfo.length
    }
    this.setData({
      'scrollow[0]': 'types' + (a-1)
    })
  },
  //获取元素的高
  getYuansuHeight:function(){
    wx.createSelectorQuery().selectAll('.typestypes').boundingClientRect( (rect)=> {
      console.log(rect);
      //处理结果
      var huadongInfo=[0];
      var topHeight=0;
      for (var i = 0; i < rect.length;i++)
      {
        if (i != rect.length-1)
        {
          topHeight = topHeight + rect[i].height;
          huadongInfo.push(topHeight);
        }
      }
      this.setData({
        huadongInfo: huadongInfo
      })
      console.log(huadongInfo);
    }).exec()
  }

})

 

<view class='roww'>
  <block wx:for="{{topMenu}}" wx:key="unique">
    <view class='topItem {{item.clickTxts}} colonn center_left1' bindtap='topMenuChange' data-index="{{index}}">
      <text>{{item.clickTxt}}</text>
      <view class=' {{item.clickLine}} colonn '></view>
    </view>
  </block>
</view>

<block wx:if="{{topMenu[2].clickTxts.length>0}}">
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/zhishu.png' class='icon1'></image>
      <view class='size2'>印象指数:</view>
    </view>
  </view>
  <view class='colonn' style='margin:10px;padding-left:20px;'>
    <swiper display-multiple-items="3">
      <block wx:for="{{shopInfo.shopImage}}">
        <swiper-item>
          <image src='{{item}}' class='switerimg'></image>
        </swiper-item>
      </block>
    </swiper>
  </view>
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/dianhua.png' class='icon1'></image>
      <view class='size2'>{{shopInfo.shopName.tele}}</view>
    </view>
  </view>
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/dingwei.png' class='icon1'></image>
      <view class='size2'>{{shopInfo.shopName.addr}}</view>
    </view>
  </view>
  <view class='line5'></view>
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/zhe.png' class='icon1'></image>
      <view class='size2'>打折:会员折扣</view>
    </view>
  </view>
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/ban.png' class='icon1'></image>
      <view class='size2'>半价:第二份半价</view>
    </view>
  </view>
  <view class='colonn padding1'>
    <view class='roww center_top11'>
      <image src='/images/song.png' class='icon1'></image>
      <view class='size2'>买赠:买一赠一</view>
    </view>
  </view>
</block>





<!-- 套餐 -->
<block wx:if="{{topMenu[1].clickTxts.length>0}}">
  <view class='roww'>
    <view style='width:90px;height:{{hostinfo.height-115}}px;padding-bottom:60px;background:#f5f5f5;margin-right:10px;'>
      <scroll-view style='width:90px;height:{{hostinfo.height-115}}px;' scroll-y="true">
        <block wx:for="{{setmeals}}">
          <i-badge count="{{item.count}}">
            <block wx:if="{{item.isshow==1}}">
              <view class='roww' style='width:90px;'>
                <view class='leftLint2'></view>
                <view class='leftMenuTxtOn1'>{{item.classes}}</view>
              </view>
            </block>
            <block wx:else>
              <view class='roww' style='width:90px;'>
                <view class='leftLint1'></view>
                <view class='leftMenuTxtOn' catchtap='setmealsClick' data-index="{{index}}">{{item.classes}}</view>
              </view>
            </block>
          </i-badge>
        </block>
      </scroll-view>
    </view>
    <view style='width:{{hostinfo.width-150}}px;height:{{hostinfo.height-75}}px;padding:10px 10px 10px 0px;' scroll-y="true" scroll-into-view="{{scrollow[1]}}">
      <view class='roww' style='padding:10px;'>
        <view style='width:3px;background:#1e90ff;'></view>
        <view style='font-size:15px;margin-left:5px;'>{{scrollow[3]}}</view>
      </view>
      <view style='width:{{hostinfo.width-120}}px;height:{{hostinfo.height-115}}px;'>
        <scroll-view style='width:{{hostinfo.width-120}}px;height:{{hostinfo.height-115}}px;' scroll-y="true" scroll-with-animation="true" scroll-into-view="{{scrollow[1]}}">
          <block wx:for="{{setmeals}}">
            <text class="size1" style="margin-left:10px;" id="setmeals{{index}}">{{item.classes}}</text>
            <block wx:for="{{item.list}}" wx:for-item="foodinfo" wx:for-index="index1">
              <view class='roww' style='padding:10px 10px 10px 0px;'>
                <block wx:if="{{foodinfo.image.length<=0||foodinfo.image==null}}">
                  <image src='/images/shangpinfenleimoren.png' class='foodicon' data-bigindex="{{index}}" data-index="{{index1}}" bindtap='toFoodInfo' data-type='{{1}}'></image>
                </block>
                <block wx:else>
                  <image src='{{foodinfo.image}}' class='foodicon' binderror="imgError1" data-bigindex="{{index}}" data-index="{{index1}}" bindtap='toFoodInfo' data-type='{{1}}'></image>
                </block>
                <view class='colonn allline'>
                  <text class='size1' style='height:33px;font-weight:bold;'>{{foodinfo.productName}}</text>
                  <text class='size1' style='height:33px;'>赞0</text>
                  <view class='roww   center_top11' style='height:33px;'>
                    <view class='colonn   allline '>
                      <view class='roww'>
                        <view class=' color1' style='font-size:18px;'>¥{{foodinfo.discount}}</view>
                        <view class='size1 huadiao' style='line-height:30px;color:#BDBDBD;'>
                          ¥{{foodinfo.price}}</view>
                      </view>
                      <!-- <view class='roww center_top11'>
                        <image src='/images/shuoming.png' style='width:10px;height:10px;margin-right:5px;'></image>
                        <text style='font-size:10px;color:red;'>买一赠一</text>
                      </view> -->
                    </view>
                    <view class='roww center_top'>
                      <block wx:if="{{foodinfo.count>0}}">
                        <image src='/images/jian1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{foodinfo.count-1}}" data-typecount="{{item.count-1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jian"></image>
                        <text style='padding:0px 5px;'>{{foodinfo.count}}</text>
                        <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{foodinfo.count+1}}" data-typecount="{{item.count+1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jia"></image>
                      </block>
                      <block wx:else>
                        <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{1}}" data-typecount="{{item.count+1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jia"></image>
                      </block>
                    </view>
                  </view>
                </view>
              </view>
            </block>
          </block>

          <view style="height:50px;width:100%;"></view>
        </scroll-view>
      </view>
    </view>
  </view>
</block>





<!-- 点餐 -->
<block wx:if="{{topMenu[0].clickTxts.length>0}}">
  <view class='roww'>
    <view style='width:100px;height:{{hostinfo.height-115}}px;padding-bottom:60px;background:#f5f5f5;margin-right:10px;'>
      <scroll-view style='width:100px;height:{{hostinfo.height-115}}px;background:#f5f5f5;' scroll-y="true">
        <block wx:for="{{[1,1,1,1,1,1,1,1,1,1,1,1]}}">
          <i-badge count="2">
            <!-- <view class='roww' style='width:90px;'> -->
            <!-- <block wx:if="{{item.isshow==1}}"> -->
            <view class='roww' style='width:100px;'>
              <view class='leftLint2'></view>
              <view class='leftMenuTxtOn1' catchtap='typeClick' data-index="{{index}}">我是类型{{index}}</view>
            </view>
            <!-- </block>
            <block wx:else>
              <view class='roww' style='width:100px;background:#f5f5f5;'>
                <view class='leftLint1'></view>
                <view class='leftMenuTxtOn' catchtap='typeClick' data-index="{{index}}">{{item.classes}}</view>
              </view>
            </block> -->
            <!-- </view> -->
          </i-badge>
        </block>
      </scroll-view>
    </view>
    <view style='width:{{hostinfo.width-150}}px;height:{{hostinfo.height-75}}px;padding:10px 10px 10px 0px;' scroll-y="true">
      <view class='roww' style='padding:10px;'>
        <view style='width:3px;background:#1e90ff;'></view>
        <view style='font-size:15px;margin-left:5px;'>{{scrollow[0]}}</view>
      </view>
      <view style='width:{{hostinfo.width-120}}px;height:{{hostinfo.height-115}}px;'>
        <scroll-view style='width:{{hostinfo.width-120}}px;height:{{hostinfo.height-115}}px;' scroll-y="true" scroll-into-view="{{scrollow[0]}}" scroll-with-animation="true" bindscroll="scrollChange">

          <block wx:for="{{[1,1,1,1,1,1,1,1,1,1,1,1]}}">

            <!--  id="types{{index}}" -->
            <!-- <view slot="title" id="types{{index}}"> -->
            <view class='colonn' class='typestypes'>
              <view slot="title" id="types" >
                逻辑层{{index}}
              </view>
              <block wx:for="{{[1,1,1,1,1,1,1,1,1,1]}}" wx:for-item="foodinfo" wx:for-index="index1">
                <view slot="content">
                  <view class='roww' style='padding:10px 10px 10px 0px;'>
                    <block wx:if="{{foodinfo.image.length<=0||foodinfo.image==null}}">
                      <image src='/images/shangpinfenleimoren.png' class='foodicon' bindtap='toFoodInfo' data-bigindex="{{index}}" data-index="{{index1}}" data-type='{{0}}'></image>
                    </block>
                    <block wx:else>
                      <image src='{{foodinfo.image}}' class='foodicon' binderror="imgError" data-bigindex="{{index}}" data-index="{{index1}}" bindtap='toFoodInfo' data-type='{{0}}'></image>
                    </block>
                    <view class='colonn allline'>
                      <text class='size1' style='height:33px;font-weight:bold;'>食物名字</text>
                      <text class='size1' style='height:33px;'>赞0</text>
                      <view class='roww   center_top11' style='height:33px;'>
                        <view class='colonn   allline '>
                          <view class='roww'>
                            <view class=' color1' style='font-size:18px;'>¥521</view>
                            <view class='size1 huadiao' style='line-height:30px;color:#BDBDBD;'>
                              ¥22</view>
                          </view>
                          <!-- <view class='roww center_top11'>
                        <image src='/images/shuoming.png' style='width:10px;height:10px;margin-right:5px;'></image>
                        <text style='font-size:10px;color:red;'>买一赠一</text>
                      </view> -->
                        </view>
                        <view class='roww center_top'>
                          <block wx:if="{{foodinfo.count>0}}">
                            <!-- <block wx:if="{{isClick==0}}"> -->
                            <image src='/images/jian1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{foodinfo.count-1}}" data-typecount="{{item.count-1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jian"></image>
                            <!-- </block> -->
                            <!-- <block wx:else>
                          <image src='/images/jian1.png' style='width:25px;height:25px;' data-count="{{foodinfo.count-1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jian"></image>
                        </block> -->
                            <text style='padding:0px 5px;'>{{foodinfo.count}}</text>
                            <!-- <block wx:if="{{isClick==0}}"> -->
                            <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{foodinfo.count+1}}" data-typecount="{{item.count+1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jia"></image>
                            <!-- </block> -->
                            <!-- <block wx:else>
                          <image src='/images/jia1.png' style='width:25px;height:25px;' data-count="{{foodinfo.count+1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jia"></image>
                        </block> -->
                          </block>
                          <block wx:else>
                            <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{1}}" data-typecount="{{item.count+1}}" data-bigindex="{{index}}" data-index="{{index1}}" data-caozuo="jia"></image>
                          </block>

                        </view>
                      </view>
                    </view>
                  </view>
                  <!-- <block wx:if="{{(index1+1)==item.list.length}}">
                      <view id="typess{{index}}"></view>
                    </block> -->
                </view>
              </block>
            </view>

          </block>
          <view style="height:50px;width:100%;"></view>
        </scroll-view>
      </view>
    </view>
  </view>
</block>

<block wx:if="{{chatInfo.count>0}}">
  <view class='viewbottom roww center_top11 chat' style='z-index:1000;'>
    <view class='chatIcon weiyi1'>
      <i-badge count="{{chatInfo.count}}">
        <image src='/images/mychat.png' class='chaticon1' catchtap='openChat'></image>
      </i-badge>
    </view>
    <view style='flex:1;'>
      <text>¥{{chatInfo.truePrice}}</text>
      <text class='nomoney huadiao'>¥{{chatInfo.falsePrice}}</text>
    </view>
    <view class='padding1okBtn' catchtap='toSubmit'>
      选好了
    </view>
  </view>
</block>
<block wx:else>
  <view class='viewbottom roww center_top11 chat' style='z-index:1000;'>
    <view class='chatIcon weiyi1'>
      <image src='/images/mychat.png' class='chaticon1'></image>
    </view>
    <view style='flex:1;'>
      <text>购物车空空如也</text>
    </view>
  </view>
</block>





<!-- 购物车 -->
<block wx:if="{{mychat.length>0}}">
  <view class='chchat' style='height:{{hostinfo.height}}px;display:{{chatAndfood.chat}}' catchtouchmove="preventTouchMove" catchtap='hidechat'>
    <view class='colonn bottom ooo' style='width:100%;' catchtap='hidechatisss'>
      <view class='roww chatTop' style='width:{{hostinfo.width-10}}px;'>
        <view class='allline'>已选商品</view>
        <view class='roww allline endend' bindtap='delAllChat'>
          <image src='/images/lajitong.png' class='chaticon'></image>
          <view>清空</view>
        </view>
      </view>
      <scroll-view class='  shangpinInfo1 roww scroll' scroll-y="true">
        <view class='shangpinInfo roww' wx:for="{{mychat}}" wx:key="unique">
          <view class='colonn' style='width:35%;'>
            <text style='margin-left:10px; font-size: 15px;'>{{item.productName}}</text>
            <!-- <text style='margin-left:10px; font-size: 10px;color:#c0c0c0;'>{{item.demand}}</text> -->
          </view>
          <view class='roww' style=' align-items: center;font-size:15px;color:#ff6600;width:60%;                                   justify-content: flex-end;'>
            <text class='roww'>¥{{item.discount}}</text>
            <view class='roww jiajianjian' style=' align-items: center;width:40%;                                                    justify-content: flex-end;margin-right:5%;'>
              <image lazy-load="true" src='/images/jian1.png' style='width:20px;height:20px;' data-index="{{index}}" data-caozuo="jian" data-count="{{item.count-1}}" catchtap='chatUpdate'></image>
              <text style='width:auto;color:black;'>{{item.count}}</text>
              <image lazy-load="true" src='/images/jia1.png' style='width:20px;height:20px;' data-index="{{index}}" data-caozuo="jia" data-count="{{item.count+1}}" catchtap='chatUpdate'></image>
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
  </view>
</block>
<!--  -->

<!-- 商品详情开始 -->
<!-- 需求 -->
<view class='goodsdemand' style='display:{{chatAndfood.xuqiu}};'>
  <view class='goodsdemand_view colonn' style='width:{{hostinfo.width-20}}px;'>
    <view class='goodsdemand_title roww'>
      <text>{{newfoodInfo.productName}}</text>
      <view class='roww rightDiy'>
        <image src='/images/error.png' catchtap='xuqiuClose'></image>
      </view>
    </view>
    <block wx:for="{{newfoodInfo.specsInfo}}" wx:key="unique">
      <view class='goodsdemand_xuqiu_name'>
        <text>请选择{{item.parentName}}</text>
      </view>
      <view class='goodsdemand_xuqiu_info'>
        <block wx:for="{{item.list}}" wx:for-item="info" wx:key="unique" wx:for-index="index1">
          <block wx:if="{{info.isshow==0}}">
            <text class='text1' catchtap='updatexuqiu' data-bigindex="{{index}}" data-index="{{index1}}" data-info="{{info.tasteName}}">{{info.tasteName}}</text>
          </block>
          <block wx:else>
            <text class='text2' catchtap='updatexuqiu' data-bigindex="{{index}}" data-index="{{index1}}" data-info="">{{info.tasteName}}</text>
          </block>
        </block>
      </view>
    </block>
    <view class='goodsdemand_xuqiu_price roww center_top11' style='margin:15px 0px;'>
      <view class='roww' style='flex:5'>
        <view style=' color: #ff6600;font-size: 19px; margin-right: 5px;'>
          ¥{{newfoodInfo.discount}}
        </view>
        <view class='allline txtShowLength xuqiu'>
          <block wx:for="{{newfoodInfo.selectionXuqiu}}">
            <block wx:if="{{newfoodInfo.selectionXuqiu.length-1==index}}">
              {{item}}
            </block>
            <block wx:else>
              {{item}}|
            </block>
          </block>
        </view>
      </view>
      <view class='roww jiajianjian' style=' align-items: center;justify-content: flex-end;flex:1'>
        <block wx:if="{{newfoodInfo.count>0}}">
          <image src='/images/jian1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{newfoodInfo.count-1}}" data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}" data-index="{{mychatSuanFa.currentTarget.dataset.index}}"
            data-xuqiu="{{66}}" data-caozuo="jian"></image>
          <text style='padding:0px 5px;'>{{newfoodInfo.count}}</text>
          <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{newfoodInfo.count+1}}" data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount+1}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}"
            data-index="{{mychatSuanFa.currentTarget.dataset.index}}" data-xuqiu="{{66}}" data-caozuo="jia"></image>
        </block>
        <block wx:else>
          <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='getspecs' data-count="{{1}}" data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount+1}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}" data-index="{{mychatSuanFa.currentTarget.dataset.index}}"
            data-xuqiu="{{66}}" data-caozuo="jia"></image>
        </block>
      </view>
    </view>
    <view class='btn' catchtap='xuqiuClose'>
      确定
    </view>
  </view>
</view>






<!-- 套餐对话框 -->
<view class='goodsdemand' style='display:{{chatAndfood.taocan}};'>
  <view class='goodsdemand_view colonn' style='width:{{hostinfo.width-20}}px;height:{{hostinfo.height*0.7+70}}px;'>
    <view class='width roww endend' style='height:30px;z-index:10001'>
      <image src='/images/error.png' style='width:30px;height:30px;margin:10px;' bindtap='loseTaoCanalert'></image>
    </view>
    <scroll-view scroll-y="true" class='goodsdemand_view1' style='width:{{hostinfo.width-20}}px;  height:{{hostinfo.height*0.5}}px;'>
      <block wx:for="{{newfoodInfo.specsInfo}}" wx:key="unique">
        <!-- 套擦中的单个菜品信息结束 -->
        <block wx:if="{{item.tasteName!=null}}">
          <view class='goodsdemand_title roww'>
            <text>{{item.productName}}</text>
          </view>
          <block wx:for="{{item.tasteName}}" wx:for-item="info" wx:key="unique" wx:for-index="index1">
            <view class='goodsdemand_xuqiu_info'>
              <view class='goodsdemand_xuqiu_name'>
                <text>请选择{{info.parentName}}</text>
              </view>
              <view class='goodsdemand_xuqiu_info'>

                <!-- 规格开始 -->
                <block wx:for="{{info.list}}" wx:for-item="tinfo" wx:key="unique" wx:for-index="tindex1">
                  <block wx:if="{{tinfo.isshow==0}}">
                    <text class='text1' catchtap='spaceClick' data-bigbigindex="{{index}}" data-bigindex="{{index1}}" data-index="{{tindex1}}" data-info="{{tinfo.tasteName}}">{{tinfo.tasteName}}</text>
                  </block>
                  <block wx:else>
                    <text class='text2' catchtap='spaceClick' data-bigbigindex="{{index}}" data-bigindex="{{index1}}" data-index="{{tindex1}}" data-info="">{{tinfo.tasteName}}</text>
                  </block>
                </block>
              </view>
              <!-- 规格结束 -->
            </view>
          </block>
          <!-- 套擦中的单个菜品信息结束 -->
        </block>
      </block>


    </scroll-view>


    <view class='goodsdemand_xuqiu_price roww center_top11' style='margin:15px 0px;'>
      <view class='roww' style='flex:5'>
        <view style=' color: #ff6600;font-size: 19px; margin-right: 5px;'>
          ¥{{newfoodInfo.discount}}
        </view>
        <view class='allline txtShowLength xuqiu'>
          <block wx:for="{{newfoodInfo.specsInfo}}" wx:key="unique">
            <block wx:for="{{item.selectionXuqiu}}" wx:key="unique" wx:for-item="info" wx:for-index="index1">
              <block wx:if="{{newfoodInfo.specsInfo.length-1==index&&index1==item.selectionXuqiu.length-1}}">
              </block>
              {{info}}|
            </block>
          </block>
        </view>
      </view>
      <view class='roww jiajianjian' style=' align-items: center;justify-content: flex-end;flex:1'>
        <block wx:if="{{newfoodInfo.count>0}}">
          <image src='/images/jian1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{newfoodInfo.count-1}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}" data-index="{{mychatSuanFa.currentTarget.dataset.index}}" data-xuqiu="{{66}}"
            data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount-1}}" data-caozuo="jian"></image>
          <text style='padding:0px 5px;'>{{newfoodInfo.count}}</text>
          <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{newfoodInfo.count+1}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}" data-index="{{mychatSuanFa.currentTarget.dataset.index}}" data-xuqiu="{{66}}"
            data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount+1}}" data-caozuo="jia"></image>
        </block>
        <block wx:else>
          <image src='/images/jia1.png' style='width:25px;height:25px;' catchtap='taocanJia' data-count="{{1}}" data-bigindex="{{mychatSuanFa.currentTarget.dataset.bigindex}}" data-index="{{mychatSuanFa.currentTarget.dataset.index}}" data-xuqiu="{{66}}" data-caozuo="jia"
            data-typecount="{{mychatSuanFa.currentTarget.dataset.typecount+1}}"></image>
        </block>
      </view>
    </view>
    <view class='btn' catchtap='loseTaoCanalert'>
      确定
    </view>
  </view>
</view>



<!-- 套餐的详细信息 -->















<!-- 商品详情结束 -->

@import "/style/style.wxss";



/* 顶部样式 */

.topItem {
  flex: 1;
  padding: 10px 0px;
  text-align: center;
  font-size: 20px;
}
.clickItem {
  color: #1e90ff;
}

.bottomLine {
  width: 30px;
  background-color: #1e90ff;
  height: 3px;
  margin-top: 5px;
  border-radius: 6px;
  font-size: 25px;
}

/* 外边框 */

.padding1 {
  padding-left: 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.size1 {
  font-size: 15px;
}
.size2{
   font-size: 20px;
}

/*  */

.switerimg {
  height: 80px;
  width: 100px;
}

/* 白界线 */
txt1
.line1 {
  height: 5px;
  width: 100%;
  background-color: white;
}

/* 左边分界线 */

.leftLint1 {
  width: 5px;
  /* background-color: white; */
}

.leftLint2 {
  width: 5px;
  background-color: #1e90ff;
}

/* 组件样式修改 */

swiper {
  height: 100px;
}

.back {
  background-color: #f4f4f4;
}

/* ---------------------------左边的菜单样式 */

.leftMenuTxtOn {
  font-size: 15px;
  padding: 20px 10px;
  word-wrap: break-word;
  line-height:20px;
}
.leftMenuTxtOn1 {
  font-size: 15px;
  padding: 20px 10px;
  word-wrap: break-word;
  line-height:20px;
  background-color: white;
  width: 85px;
  font-weight: bold;
}
.color1 {
  color: red;
  font-size: 20px;
}

/* 右边的样式 */

.foodicon {
  width: 100px;
  height: 90px;
  margin-right: 10px;
  border-radius: 10px;
}

/* 底部购物车 */

.chat {
  width: 100%;
  background: #808080;
  height: 50px;
  color: white;
}
.chaticon1 {
  width: 50px;
  height: 50px;
    padding: 5px 10px;
}


.chaticon {
  width: 25px;
  height: 25px;
    padding: 5px 10px;
}

.weiyi1 {
  position: relative;
  top: -23px;
  left: 0px;
}

.padding1okBtn {
  background: -webkit-linear-gradient(left, #ffd700, #ff9c00); /* Safari 5.1 - 6.0 */
  background: -o-linear-gradient(right, #ffd700, #ff9c00); /* Opera 11.1 - 12.0 */
  background: -moz-linear-gradient(right, #ffd700, #ff9c00); /* Firefox 3.6 - 15 */
  background: linear-gradient(to right, rgba(255, 215, 0, 1), #ff9c00);
  padding: 12px 20px;
}

.nomoney {
  font-size: 15px;
  color: #d3d3d3;
}

/* 购物车开始 */

.scroll {
  min-height: 100px;
  max-height: 200px;
  padding-bottom: 80px;
}

.chchat {
  width: 100%;
  position: fixed;
  left: 0px;
  bottom: 0px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.ooo {
  z-index: 999;
}

.mychatShow {
  flex: 1;
  align-items: flex-end;
  background-color: #f5f5f5;
  height: 30px;
  justify-content: center;
  filter: 1;
  z-index: 999;
}

.mychatQing image {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  margin-right: 5px;
}

.mychatQing text {
  line-height: 20px;
  font-size: 12px;
  color: #808080;
}

.shangpinInfo {
  height: 50px;
  width: 100%;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  background-color: white;
}

.shangpinInfo1 {
  width: 100%;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  background-color: white;
}

/* .shangpinInfo text{
  font-size: 15px;
} */

.jiajianjian {
  margin-left: 5px;
}

.jiajianjian text {
  margin-left: 5px;
  margin-right: 5px;
}

.bottom {
  position: absolute;
  bottom: 0px;
  left: 0px;
}

.ooo {
  z-index: 999;
}

.chatTop {
  background: #f4f4f4;
  width: 100%;
  font-size: 15px;
  padding: 5px;
  height: 30px;
  line-height: 30px;
}

/* 购物车结束 */

/* 商品的详细信息开始 */

.rightDiy {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.goodsdemand {
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0px;
  left: 0px;
  z-index: 1000;
}

.goodsdemand_view {
  padding: 10px;
  background: white;
  max-height: 70%;
  position: fixed;
  bottom: 0px;
  left: 0px;
}

.goodsdemand_view1 {
  background: white;
}

.goodsdemand_title {
  margin-bottom: 10px;
  margin-top: 5px;
  font-weight: bold;
}

.goodsdemand_title text {
  font-size: 18px;
  width: 50%;
}

.goodsdemand_title view {
  width: 50%;
}

.goodsdemand_title view image {
  width: 20px;
  height: 20px;
}

.goodsdemand_xuqiu_name {
  font-size: 13px;
  color: #a9a9a9;
  margin: 5px 0px 5px 1%;
}

.goodsdemand_xuqiu_info {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

/* .goodsdemand_xuqiu_info text {
  font-size: 13px;
  color: #a9a9a9;
  width: 22%;
  margin: 1%;
  border: 1px solid #a9a9a9;
  border-radius: 3px;
  text-align: center;
  padding: 5px 0px 5px 0px;
} */

/* 规格是否显示 */
/* //没选中 */
 .text1 {
  font-size: 13px;
  color: #a9a9a9;
  width: 22%;
  margin: 1%;
  border: 1px solid #a9a9a9;
  border-radius: 3px;
  text-align: center;
  padding: 5px 0px 5px 0px;
}
 .text2 {
  font-size: 13px;
  color: #3495EE;
  width: 22%;
  margin: 1%;
  border: 1px solid #3495EE;
  border-radius: 3px;
  text-align: center;
  padding: 5px 0px 5px 0px;
  background-color: #F0F8FF;
}

.btn {
  width: 100%;
  background: #f60;
  font-size: 20px;
  color: white;
  text-align: center;
  padding: 10px 0px 10px 0px;
  margin-top: 15px;
  border-radius: 5px;
}

.goodsdemand_xuqiu_price {
  width: 100%;
}

.goodsdemand_xuqiu_price view text {
  font-size: 13px;
  color: #a9a9a9;
}

.xuqiu {
  color: #808080;
  font-size: 15px;
  line-height: 30px;
}

/* 商品的详细信息结束 */

hostinfo: { "width": 0, "height": 0 },【设备的宽和高】

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞飞翼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值