//logs.js
var util = require('../../utils/util.js')
var sliderWidth = 190// 需要设置slider的宽度,用于计算中间位置
// 最大行数
var max_row_height = 5;
// 行高
var food_row_height = 50;
// 底部栏偏移量
var cart_offset = 90;
Page({
data: {
logs: [],
tabs: ["今日菜单", "我的订单"],
activeIndex: 0,
sliderOffset: 0,
sliderLeft: 0,
sliderWidth: 0.5,
// 右菜单
menu_list: [],
// 左菜单
foodList: [],//展示菜品
allFoodList: [],//所有获取到的菜品
//我的订单列表
orderList: [],
// 购物车
cartList: [],
hasList: false,// 列表是否有数据
totalPrice: 0,// 总价,初始为0
totalNum: 0, //总数,初始为0
// 购物车动画
animationData: {},
animationMask: {},
maskVisual: "hidden",
maskFlag: true,
// 左右两侧菜单的初始显示次序
curNav: 0,
//判断是否登录会员
loginFlag: true,
//判断是否已经发送验证码
sendingF: false,
// 倒计时时间
second: 60,
},
onLoad: function (options) {
var that = this
// 获取购物车缓存数据
var arr = wx.getStorageSync('cart') || [];
// 左分类菜单
var menu_list = this.data.menu_list;
// 获取左侧分类菜单数据
var categories = [
{
"id": 0,
"name": "全部"
},
{
"id": 9,
"name": "活动品"
},
{
"id": 1,
"name": "汤·粥"
},
{
"id": 2,
"name": "热菜"
},
{
"id": 5,
"name": "面点"
},
{
"id": 6,
"name": "特色"
},
{
"id": 7,
"name": "小吃"
},
{
"id": 8,
"name": "水吧"
}
]
that.setData({
menu_list: categories,
})
// 右菜品菜单
var foodList = this.data.foodList;
var allFoodList = this.data.allFoodList;
// 购物车总量、总价
var totalPrice = this.data.totalPrice
var totalNum = this.data.totalNum
// 获取右侧菜品列表数据
var resFood = [
{
"id": 6,
"name": "美地麻辣小龙虾",
"thumb": "",
"price": "98.00",
"unit": "份",
"catid": 6,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 7,
"name": "水吧鸡尾酒",
"thumb": "",
"price": "39.00",
"unit": "杯",
"catid": 8,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 9,
"name": "九塔香辣子鸡",
"thumb": "",
"price": "68.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 10,
"name": "跳舞茄盒",
"thumb": "",
"price": "40.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 12,
"name": "土匪猪肝",
"thumb": "",
"price": "40.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 13,
"name": "小炒黄牛肉",
"thumb": "",
"price": "58.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 14,
"name": "小酥肉",
"thumb": "",
"price": "19.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 15,
"name": "橄榄油腊鲜有机花菜\t",
"thumb": "",
"price": "28.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 19,
"name": "榴莲面包",
"thumb": "",
"price": "29.80",
"unit": "份",
"catid": 5,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 20,
"name": "泡芙",
"thumb": "",
"price": "6.00",
"unit": "斤",
"catid": 5,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 21,
"name": "手撕包菜",
"thumb": "",
"price": "19.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 22,
"name": "糖醋里脊",
"thumb": "",
"price": "97.90",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 24,
"name": "我是热菜区的new菜",
"thumb": "",
"price": "25.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 25,
"name": "美地麻辣小龙虾",
"thumb": "",
"price": "125.00",
"unit": "份",
"catid": 6,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 26,
"name": "美地甜点",
"thumb": "",
"price": "20.00",
"unit": "15",
"catid": 7,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 27,
"name": "特色小龙虾",
"thumb": "/uploads/20178/201708311002557FPpnEyE.jpg",
"price": "89.90",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 28,
"name": "雕黄醉蟹钳",
"thumb": "/uploads/20178/20170831165625IyWlwdFM.jpg",
"price": "48.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 29,
"name": "雕黄醉蟹钳1",
"thumb": "/uploads/20178/20170831165711bLN478bK.jpg",
"price": "48.00",
"unit": "份",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 30,
"name": "百合莲子红豆露",
"thumb": "",
"price": "32.00",
"unit": "扎",
"catid": 8,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 31,
"name": "屈臣氏香草苏打水",
"thumb": "",
"price": "15.00",
"unit": "瓶",
"catid": 8,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 32,
"name": "赫默父子夏瑟尼蒙哈榭干白",
"thumb": "",
"price": "1888.00",
"unit": "瓶",
"catid": 8,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 33,
"name": "美地特殊热菜",
"thumb": "",
"price": "35.00",
"unit": "20",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 34,
"name": "醋溜白菜",
"thumb": "",
"price": "15.00",
"unit": "12",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
{
"id": 35,
"name": "东北乱炖",
"thumb": "",
"price": "38.00",
"unit": "30",
"catid": 2,
"sales": 0,
"note": "",
"quantity": 0
},
微信点餐小程序
4星 · 超过85%的资源 需积分: 48 4 浏览量
2017-10-13
16:21:48
上传
评论 44
收藏 141KB ZIP 举报
shenglongok
- 粉丝: 20
- 资源: 2
- 1
- 2
前往页