|
...
|
...
|
@@ -10,6 +10,8 @@ Page({ |
|
|
|
data: {
|
|
|
|
type:'C',//样式A,B,C
|
|
|
|
scrollTop: 0,
|
|
|
|
check1:0,//做法
|
|
|
|
check2:0,//规格
|
|
|
|
isloading: true,
|
|
|
|
toView: "",
|
|
|
|
hasEnter: false,
|
|
...
|
...
|
@@ -22,6 +24,56 @@ Page({ |
|
|
|
showSkeleton: true,
|
|
|
|
order: {},
|
|
|
|
orderItemCount:0,
|
|
|
|
checkObj:'',
|
|
|
|
quantum:'',
|
|
|
|
arr1:[
|
|
|
|
{
|
|
|
|
name:'香辣',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'清蒸',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'爆炒',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'清汤',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'爆炒',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'清汤',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
arr2:[
|
|
|
|
{
|
|
|
|
name:'小份',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'中份',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'份',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'位',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'例',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name:'两只',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
normsList:[
|
|
|
|
{
|
|
|
|
text:'做饭',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text:'规格',
|
|
|
|
}
|
|
|
|
],
|
|
|
|
twoList:[
|
|
|
|
{
|
|
|
|
title:'烤鸽子',
|
|
...
|
...
|
@@ -45,6 +97,15 @@ Page({ |
|
|
|
quantum:0,
|
|
|
|
}
|
|
|
|
],
|
|
|
|
assortArr:[
|
|
|
|
{name:'淮扬热菜'},
|
|
|
|
{name:'精品凉菜'},
|
|
|
|
{name:'广式烧腊'},
|
|
|
|
{name:'海鲜'},
|
|
|
|
{name:'汤羹'},
|
|
|
|
{name:'四季时蔬'},
|
|
|
|
{name:'酒水'},
|
|
|
|
],
|
|
|
|
dishList:[
|
|
|
|
{
|
|
|
|
image:'https://img.zcool.cn/community/0143e15b0239e4a801218cf4503272.jpg@3000w_1l_0o_100sh.jpg',
|
|
...
|
...
|
@@ -74,7 +135,8 @@ Page({ |
|
|
|
},
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
checkModal:'',
|
|
|
|
classifyModal:'',
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
...
|
...
|
@@ -92,7 +154,9 @@ Page({ |
|
|
|
"statReachBottom": true,
|
|
|
|
"lauchOpts": options, //渠道分析
|
|
|
|
});
|
|
|
|
},
|
|
|
|
this.checkModal = this.selectComponent("#checkModal");
|
|
|
|
this.classifyModal = this.selectComponent("#classifyModal");
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
...
|
...
|
@@ -100,17 +164,64 @@ Page({ |
|
|
|
onReady() {
|
|
|
|
|
|
|
|
},
|
|
|
|
// 选择做法
|
|
|
|
checkSingle1(e){
|
|
|
|
const check1= e.currentTarget.dataset['index'];
|
|
|
|
this.setData({
|
|
|
|
check1
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 选择规格
|
|
|
|
checkSingle2(e){
|
|
|
|
const check2= e.currentTarget.dataset['index'];
|
|
|
|
this.setData({
|
|
|
|
check2
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 展示做法规格弹窗
|
|
|
|
showModal() {
|
|
|
|
this.checkModal.showModal()
|
|
|
|
},
|
|
|
|
// 关闭做法规格弹窗
|
|
|
|
closeModal() {
|
|
|
|
this.checkModal.closeModal()
|
|
|
|
},
|
|
|
|
// 展示菜品分类弹框
|
|
|
|
showClassifyModal() {
|
|
|
|
this.classifyModal.showModal()
|
|
|
|
},
|
|
|
|
// 关闭菜品分类弹框
|
|
|
|
closeClassifyModal() {
|
|
|
|
this.classifyModal.closeModal()
|
|
|
|
},
|
|
|
|
// 选择菜品分类
|
|
|
|
checkItem(e){
|
|
|
|
const item= e.currentTarget.dataset['item'];
|
|
|
|
console.log(item);
|
|
|
|
},
|
|
|
|
// 选择做法和规格后点击确定
|
|
|
|
determineFun(){
|
|
|
|
let checkObj =this.data.checkObj;
|
|
|
|
let quantum =this.data.quantum;
|
|
|
|
this.setData({
|
|
|
|
[checkObj]:quantum,
|
|
|
|
})
|
|
|
|
this.closeModal()
|
|
|
|
},
|
|
|
|
// 点击加号
|
|
|
|
addition(e){
|
|
|
|
const item= e.currentTarget.dataset['item'];
|
|
|
|
const index= e.currentTarget.dataset['key'];
|
|
|
|
const type= e.currentTarget.dataset['type'];
|
|
|
|
let quantum = item.quantum * 1 + 1;
|
|
|
|
let obj;
|
|
|
|
if(type=='one') obj=`dishList[${index}].quantum`;
|
|
|
|
if(type=='two') obj=`twoList[${index}].quantum`;
|
|
|
|
let checkObj;
|
|
|
|
if(type=='one') checkObj=`dishList[${index}].quantum`;
|
|
|
|
if(type=='two') checkObj=`twoList[${index}].quantum`;
|
|
|
|
console.log(checkObj,quantum);
|
|
|
|
this.showModal()
|
|
|
|
this.setData({
|
|
|
|
[obj]:quantum
|
|
|
|
checkObj,
|
|
|
|
quantum,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 点击减号
|
|
...
|
...
|
@@ -119,13 +230,15 @@ Page({ |
|
|
|
const index= e.currentTarget.dataset['key'];
|
|
|
|
const type= e.currentTarget.dataset['type'];
|
|
|
|
let quantum = item.quantum * 1 - 1;
|
|
|
|
let obj;
|
|
|
|
if(type=='one') obj=`dishList[${index}].quantum`;
|
|
|
|
if(type=='two') obj=`twoList[${index}].quantum`;
|
|
|
|
let checkObj;
|
|
|
|
if(type=='one') checkObj=`dishList[${index}].quantum`;
|
|
|
|
if(type=='two') checkObj=`twoList[${index}].quantum`;
|
|
|
|
this.setData({
|
|
|
|
[obj]:quantum
|
|
|
|
checkObj,
|
|
|
|
quantum,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 扫桌码点餐
|
|
|
|
initOrder() {
|
|
|
|
App.Advance.CreateOrder({
|
|
|
|
rid: this.data.options.rid,
|
|
...
|
...
|
@@ -221,7 +334,8 @@ Page({ |
|
|
|
}
|
|
|
|
return flist;
|
|
|
|
},
|
|
|
|
getCookList: function (orderid) {
|
|
|
|
// 获取所有分类下所有菜品列表
|
|
|
|
getCookList(orderid) {
|
|
|
|
let param = {
|
|
|
|
sellerid: this.data.options.sid,
|
|
|
|
identity: this.data.options.identity,
|
...
|
...
|
|