Commit b7a1b0a5320283c430493928b3e0acb6abe25641

Authored by yiren
1 parent f3bff751

提前点餐页面

... ... @@ -36,7 +36,7 @@ Page({
}
]
},
modal:'',
/**
* 生命周期函数--监听页面加载
*/
... ...
... ... @@ -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,
... ...
... ... @@ -3,12 +3,7 @@
"navigationBarBackgroundColor": "#4d4e50",
"navigationBarTextStyle": "white",
"usingComponents": {
"foodCard": "../components/food-card/food-card",
"cookClass": "../components/cook-class/cook-class",
"nav":"/components/nav/nav",
"cart":"../components/cart/cart",
"formids":"/components/formids/formids",
"userinfo":"/components/userinfo/userinfo",
"network":"/components/network/network"
"my-modal": "/components/modal/modal"
}
}
\ No newline at end of file
... ...
... ... @@ -117,8 +117,8 @@
</view>
</view>
<view class="fixedBox flex-lr">
<view class="left flex-cmc">
<image src="https://qn.colorcun.com/WechatIMG701.png" mode="" />
<view class="left flex-cmc" bindtap="showClassifyModal">
<image src="https://qn.colorcun.com/WechatIMG700.png" mode="" />
<view class="fixedName">
菜品分类
</view>
... ... @@ -129,4 +129,39 @@
已选菜品
</view>
</view>
</view>
\ No newline at end of file
</view>
<my-modal id="checkModal" height="410px" fadeStyle="center">
<view slot="modalContent" class="normsModel">
<scroll-view scroll-y style="height: 78%;overflow: auto;">
<view class="textSty">
做法
</view>
<view class="itemBox">
<view class="single {{check1==index?'active':''}}" bindtap="checkSingle1" wx:for="{{arr1}}" data-index="{{index}}">
{{item.name}}</view>
</view>
<view class="checkLine"></view>
<view class="textSty">
规格
</view>
<view class="itemBox">
<view class="single {{check2==index?'active':''}}" bindtap="checkSingle2" wx:for="{{arr2}}" data-index="{{index}}">{{item.name}}</view>
</view>
</scroll-view>
<view class="btns">
<button class="font32r cancellation btn" bindtap="closeModal">取消</button>
<button class="font32r determine btn" bindtap="determineFun">确定</button>
</view>
</view>
</my-modal>
<my-modal id="classifyModal" fadeStyle="slideDown" height="100%">
<view slot="modalContent" class="assortModel">
<view class="assortItem items font48r">
10道必点菜
</view>
<view wx:for="{{assortArr}}" class="assortItem font48r" data-item="{{item}}" bindtap="checkItem">
{{item.name}}
</view>
<image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode=""/>
</view>
</my-modal>
\ No newline at end of file
... ...
/* pack-cookbook/pages/index_new.wxss */
page{
page {
background-color: #4d4e50;
}
.wrapIine{
.wrapIine {
height: 4rpx;
width: 100%;
background-color: #dbdbdb;
}
.heand{
.heand {
width: 100%;
}
.heand .style_round{
.heand .style_round {
width: 160rpx;
}
.style_round .line{
.style_round .line {
width: 100rpx;
height: 2rpx;
background: #dbdbdb;
}
.style_round .round{
.style_round .round {
width: 8rpx;
height: 8rpx;
background: #dbdbdb;
border-radius: 50%;
}
.heand .title{
.heand .title {
color: #fff;
padding: 10rpx 0;
}
.dishWrap{
.dishWrap {
color: #fff;
padding-top: 40rpx;
}
.dishTexts{
.dishTexts {
padding: 0 40rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
-webkit-text-stroke: 1rpx black;
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
-webkit-text-stroke: 1rpx black;
}
.dishRight{
.dishRight {
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
font-weight: 500;
font-size: 28rpx;
}
.norms{
.norms {
margin-top: 10rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-size: 24rpx;
padding:0 40rpx 30rpx 40rpx;
padding: 0 40rpx 30rpx 40rpx;
}
.dishImg{
.dishImg {
width: 100%;
}
.greens{
.greens {
padding: 20rpx 32rpx 58rpx 32rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-size: 24rpx;
font-family: PingFang SC;
font-size: 24rpx;
}
.Textcolor{
.Textcolor {
color: #EBDD3C;
}
.algorithmImg{
.algorithmImg {
height: 60rpx;
padding-bottom: 58rpx;
}
.algorithmImg .imgs{
.algorithmImg .imgs {
width: 60rpx;
height: 100%;
margin-right: 80rpx;
margin-right: 80rpx;
}
.calculate{
.calculate {
padding: 0 80rpx 58rpx 80rpx;
}
.calculate .imgs{
.calculate .imgs {
width: 60rpx;
height: 60rpx;
margin: 0;
}
.box .num{
.box .num {
color: #e34d59;
font-family: PingFang SC;
font-weight: 500;
font-size: 80rpx;
}
.num view{
.num view {
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 32rpx;
margin:0 20rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 32rpx;
margin: 0 20rpx;
}
.twoItem{
.twoItem {
width: 50%;
box-sizing: border-box;
border-bottom: 4rpx solid #dbdbdb;
}
.twoItem:nth-of-type(odd){
.twoItem:nth-of-type(odd) {
border-right: 4rpx solid #dbdbdb;
}
.twoTitle{
.twoTitle {
padding: 30rpx 0 10rpx 20rpx;
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 40rpx;
}
.twoInfo{
.twoInfo {
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
padding: 0 0 30rpx 20rpx;
}
.twoItem image{
.twoItem image {
height: 247rpx;
}
.oneImg{
.oneImg {
margin: 38rpx 40rpx 0 0;
}
.twoImgs{
.twoImgs {
margin: 38rpx 40rpx 0 40rpx;
}
.twoBox .imgs{
.twoBox {
padding-bottom: 118rpx;
}
.twoBox .imgs {
margin-right: 0;
}
.reduceImg{
.reduceImg {
width: 90rpx;
height: 8rpx !important;
}
.fixedBox{
.fixedBox {
position: fixed;
bottom: 0;
left: 0;
... ... @@ -142,40 +174,145 @@ page{
box-sizing: border-box;
background-color: #4D4E50;
}
.fixedBox .left image{
.fixedBox .left image {
width: 44rpx;
height: 36rpx;
height: 36rpx;
}
.fixedBox .right image{
.fixedBox view {
padding: 0 20rpx;
}
.fixedBox .right image {
width: 41rpx;
height: 36rpx;
height: 36rpx;
}
.fixedName{
.fixedName {
color: #dbdbdb;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
margin-top: 10rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
margin-top: 10rpx;
}
.typeB{
.typeB {
display: flex;
align-items: flex-end;
flex-direction: column;
}
.normsB{
.normsB {
text-align: right;
}
#checkModal .mymodal {
width: 80% !important;
}
.normsModel {
padding: 80rpx 50rpx 0 50rpx;
position: relative;
height: 95%;
box-sizing: border-box;
}
.text {
color: #515151;
font-family: PingFang SC;
font-size: 32rpx;
}
.itemBox {
display: flex;
flex-wrap: wrap;
}
.textSty {
color: red;
margin-bottom: 30rpx;
}
.single {
display: flex;
justify-content: center;
align-items: center;
padding: 6rpx 36rpx;
border: 2rpx solid #dbdbdb;
margin: 0 36rpx 30rpx 0;
}
.single:nth-child(3n) {
margin-right: 0;
}
.active {
color: #E34D59;
border: 2rpx solid #E34D59;
}
.checkLine {
width: 100%;
height: 2rpx;
background-color: #DBDBDB;
margin: 20rpx 0;
}
.btns {
width: 100%;
position: absolute;
left: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
height: 108rpx;
border-top: 2rpx solid #DBDBDB;
}
#checkModal .mymodal-content {
padding: 30rpx 0 0 0 !important;
height: 100% !important;
}
.btn {
margin: 0;
width: 50%;
}
#classifyModal .mymodal {
top: 120rpx !important;
}
#classifyModal .mymodal-content {
padding: 0 !important;
height: 100% !important;
box-sizing: border-box;
}
.assortModel {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
padding-top: 20%;
background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
}
.assortItem {
text-align: center;
color: #ffffff;
font-family: PingFang SC;
padding: 30rpx 0;
}
.items {
text-decoration: underline;
}
.assortImg {
margin-top: 30rpx;
width: 100rpx;
height: 100rpx;
}
\ No newline at end of file
... ...
... ... @@ -66,11 +66,11 @@ Page({
let sid=e.currentTarget.dataset['sid'];
console.log('todetailid',id);
if(expire=='0' && examine=='0'){
wx.reLaunch({
wx.navigateTo({
url: '/pack-activity/pack/examineCertificate?id='+id,
})
}else{
wx.reLaunch({
wx.navigateTo({
url: `/pages/pinglun/create?oid=${id}&sellername=${sellername}&sid=${sid}&types=3`,
})
}
... ...