Commit 6bbe95d22c353af8611353a94192f67eed3ae76e

Authored by yiren
1 parent ee6d99d2

提前点餐

... ... @@ -7,15 +7,16 @@ Page({
cookbooklist: [],
sellerName: '',
probablyPrice: '',
vipProbablyPrice: '',
sellerid: '',
notes: '',
noData: false,
rid: '',
oid: '',
sellerDate:'',
region:'',
tableNum:'',
soltName:'',
sellerDate: '',
region: '',
tableNum: '',
soltName: '',
},
/**
* 生命周期函数--监听页面加载
... ... @@ -24,7 +25,6 @@ Page({
let obj = JSON.parse(wx.getStorageSync('cookbookObj'));
let cookbooklist = JSON.parse(wx.getStorageSync('cookbooklist'));
this.formatCookList(cookbooklist);
console.log('obj',{...obj});
this.setData({
sellerName: obj.sellerName,
sellerid: obj.sellerid,
... ... @@ -33,21 +33,23 @@ Page({
sellerDate: obj.sellerDate,
region: obj.region,
tableNum: obj.tableNum,
soltName:obj.soltName
soltName: obj.soltName
})
},
formatCookList(cookbooklist) {
let probablyPrice = 0;
let vipProbablyPrice = 0;
let noData = false;
cookbooklist.forEach(items => {
items.is_show = false
items.normsLen = 0
items.cookbooklist[0].forEach(item => {
console.log(item.norms);
if (item.norms && item.norms.length > 0) {
item.norms.forEach(i => {
let price = i.quantum * 1 * (i.price * 1);
let vipPrice = i.quantum * 1 * (i.member_price * 1);
probablyPrice += price;
vipProbablyPrice += vipPrice;
})
noData = true
items.is_show = true; //展示不展示
... ... @@ -58,6 +60,7 @@ Page({
this.setData({
cookbooklist,
probablyPrice,
vipProbablyPrice,
noData
})
},
... ... @@ -77,7 +80,7 @@ Page({
sellerDate: this.data.sellerDate,
region: this.data.region,
tableNum: this.data.tableNum,
soltName:this.data.soltName
soltName: this.data.soltName
}
wx.setStorageSync('cookbookObj', JSON.stringify(data))
wx.navigateTo({
... ...
... ... @@ -27,8 +27,8 @@
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<block wx:if="{{item.norms.length>0}}">
<view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
<view class="single">{{item.name}}<text>({{item.practiceName}})</text></view>
<view class="price">{{item.price}}元/{{item.unitName}}</view>{{item.price}}
<view class="single">{{item.name}}<text wx:if="{{item.practiceName}}">({{item.practiceName}})</text></view>
<view class="price">{{item.price}}元/{{item.unitName}}</view>
<view class="count flex-cc">
<image bindtap="countFun" data-type="0" data-indexs="{{indexs}}" data-index="{{index}}" data-idx="{{idx}}" src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" />
{{item.quantum}}
... ... @@ -39,7 +39,10 @@
</block>
</block>
</view>
<view wx:if="{{noData}}" class="probably">预计金额:{{probablyPrice}}元</view>
<view wx:if="{{noData}}" class="probably flex-ll">
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
</view>
</scroll-view>
<view class="btns flex-cc">
<button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button>
... ...
... ... @@ -126,4 +126,12 @@ page {
.determine1 {
background: #DBDBDB;
color: #BFC4D4;
}
.probably {
border-top: 2rpx solid #DBDBDB;
font-family: PingFang SC;
padding: 30rpx 40rpx 52rpx 40rpx;
}
.tariff {
width: 50%;
}
\ No newline at end of file
... ...
... ... @@ -16,6 +16,8 @@ Page({
check2: '', //规格
check1Name: '',
check2Name: '',
price:'',
member_price:'',
isloading: true,
toView: "inToView27",
hasEnter: false,
... ... @@ -32,9 +34,9 @@ Page({
checkObj: '',
normsIndex: '',
assortArr: [],
themeColor:'',
textColor:'',
navColor:'',
themeColor: '',
textColor: '',
navColor: '',
},
checkModal: '',
classifyModal: '',
... ... @@ -43,7 +45,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options', options);
console.log('options', {...options});
this.setData({
options: options,
})
... ... @@ -73,7 +75,6 @@ Page({
tableNum: this.data.options.tableNum,
soltName: this.data.options.soltName,
}
console.log('objobjobjobjobj', obj);
wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist))
wx.setStorageSync('cookbookObj', JSON.stringify(obj))
wx.navigateTo({
... ... @@ -94,12 +95,14 @@ Page({
// 选择规格
checkSingle2(e) {
const item = e.currentTarget.dataset['item'];
let checkItem = this.data.checkItem
checkItem.check2 = item.id
let checkItem = this.data.checkItem;
checkItem.check2 = item.id;
this.setData({
check2: item.id,
check2Name: item.specs,
checkItem
price: item.price,
member_price: item.member_price,
checkItem,
})
},
// 获取点菜数量
... ... @@ -130,9 +133,9 @@ Page({
determineFun() {
let index = this.data.checkObj.index;
let indexs = this.data.checkObj.indexs;
let price = this.data.checkObj.price;
let data = this.data.cookbooklist[indexs].cookbooklist[0][index]
let isAlike = false;
data.norms.forEach(item => {
if (this.data.check1 == item.practice && this.data.check2 == item.unit) {
isAlike = true
... ... @@ -144,15 +147,15 @@ Page({
cookbooklist: this.data.cookbooklist,
})
} else {
console.log({...data});
let obj = {
quantum: 1,
name:data.name,
name: data.name,
practice: this.data.check1 ? this.data.check1 : data.check1,
unit: this.data.check2 ? this.data.check2 : data.check2,
practiceName: this.data.check1Name ? this.data.check1Name : data.check1Name,
unitName: this.data.check2Name ? this.data.check2Name : data.check2Name,
price:price?price:''
price: this.data.price ? this.data.price : data.price,
member_price: this.data.member_price ? this.data.member_price : data.member_price,
}
this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj)
this.setData({
... ... @@ -173,7 +176,8 @@ Page({
checkObj: {
indexs,
index,
price: item.price
price: this.data.price ? this.data.price : '',
member_price: this.data.member_price ? this.data.member_price : '',
},
normsIndex,
checkItem: item
... ... @@ -181,14 +185,16 @@ Page({
let norms = this.data.cookbooklist[indexs].cookbooklist[0][index].norms
let normsNum;
// 点击下面的加号并且有规格或者做法的,弹框选规格 下面的直接加
if (type == '1' && (item.practice.length > 1 || item.spec.length > 1)) {
if (type == '1' && (item.practice.length > 1 || item.specArr.length > 1)) {
this.setData({
check1: item.practice[0].id,
check2: item.spec[0].id,
check1Name:item.practice[0].name,
check2Name:item.spec[0].spec,
check2: item.specArr[0].id,
check1Name: item.practice[0].name,
check2Name: item.specArr[0].spec,
price: item.specArr[0].price,
member_price: item.specArr[0].member_price,
})
return this.showModal()
return this.showCheckModal()
} else {
normsNum = 1;
let obj = {
... ... @@ -197,8 +203,9 @@ Page({
unit: item.unit,
practiceName: item.check1Name,
unitName: item.check2Name,
name:item.name,
price:item.price,
name: item.name,
price: this.data.price ? this.data.price :item.price,
member_price: this.data.member_price ? this.data.member_price : item.member_price,
}
if (!normsIndex && norms.length == '0') {
this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj)
... ... @@ -264,6 +271,32 @@ Page({
},
// 过滤数据
formatCookList(list) {
// 获取所有的规格
list.forEach(item => {
item.cookbooklist[0].forEach((i, idx) => {
i.specArr = []
let obj = {}
if (i.spec && i.spec.length > 0) {
i.spec.forEach(single => {
if (single.status == '1') {
obj = {
cid:single.cid,
clear_num:single.clear_num,
id:single.id,
member_price:single.member_price,
price:single.price,
specid:single.specid,
specs:single.specs,
status:single.status,
str: '¥' + single.price + '/' + single.specs,
member_str: single.member_price ? '会员 ¥' + single.member_price + '/' + single.specs : '',
}
i.specArr.push(obj)
}
})
}
})
})
//原栏目下显示
let hasShowClass = false;
//菜单中展示沽清的菜品
... ... @@ -274,7 +307,7 @@ Page({
let assortArr = [];
let check1 = '';
let check2 = '';
let that=this;
let that = this;
if (list.length > 0) {
has10CaiOpen = list[0].status == 1;
list.forEach(function (cate, i) {
... ... @@ -305,9 +338,9 @@ Page({
cook.item_clear_num = cook.clear_num;
if (!hasClearCookbook) { //不显示卖光了
let item_clear_num = cook.clear_num;
if (cook.spec) {
if (cook.specArr) {
let clear_num = null;
cook.spec.forEach(spec => {
cook.specArr.forEach(spec => {
if (spec.clear_num == 0) {
clear_num = 0;
} else {
... ... @@ -324,14 +357,16 @@ Page({
cook.norms = []; //做法规格
}
cook.type = '1';
let cook_style = cook.cook_style?that.determine(cook.cook_style):'';//判断是不是json,是json在转换为对象
let cook_style = cook.cook_style ? util.determine(cook.cook_style) : ''; //判断是不是json,是json在转换为对象
cook.cook_style = cook_style;
cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图 默认大图
cook.name_type = cook_style && cook_style.name_type ? cook_style.name_type : '3'; //1左侧,2右侧,3顶部分开 默认分开
cook.check1 = cook.practice.length > 0 ? cook.practice[0].id : '';
cook.check2 = cook.spec.length > 0 ? cook.spec[0].id : '';
cook.check2 = cook.specArr.length > 0 ? cook.specArr[0].id : '';
cook.check1Name = cook.practice.length > 0 ? cook.practice[0].name : '';
cook.check2Name = cook.spec.length > 0 ? cook.spec[0].specs : '';
cook.check2Name = cook.specArr.length > 0 ? cook.specArr[0].specs : '';
cook.price = cook.specArr.length > 0 ? cook.specArr[0].price : '';
cook.member_price = cook.specArr.length > 0 ? cook.specArr[0].member_price : '';
if (item_clear_num == 0) {
flag = false;
}
... ... @@ -359,11 +394,16 @@ Page({
})
sortArr.push(item)
})
// 大小图设置边框
let image_typeArr = [];
// 大小图设置边框
sortArr.forEach(item => {
let num = 0;
item.cookbooklist[0].forEach((i, idx) => {
if (i.image_type == '1') {
i.index = 0
num = 0
}
if (i.image_type == '2') {
num++
i.index = num;
... ... @@ -379,35 +419,15 @@ Page({
let s = i.index * 1 + 1;
item.cookbooklist[0].splice(idx + 1, 0, {
index: s,
boderNone: true
boderNone: true,
image_type: '2',
})
}
}
} else if (i.image_type == '1') {
i.index = 0
num = 0
}
})
image_typeArr.push(item)
})
// 获取所有的规格
image_typeArr.forEach(item => {
item.cookbooklist[0].forEach((i, idx) => {
i.specArr=[]
if(i.spec && i.spec.length>0){
i.spec.forEach(sigin=>{
if(sigin.status=='1'){
let obj={
str:'¥'+i.price+'/'+i.specs
}
i.specArr.push(sigin)
}
})
}
console.log(i.specArr);
})
})
setTimeout(() => {
this.setData({
check1,
... ... @@ -415,20 +435,8 @@ Page({
assortArr
})
}, 1);
console.log(image_typeArr);
return image_typeArr;
},
// 判断
determine(str) {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
return obj;
} catch (e) {
return false;
}
}
},
// 获取所有分类下所有菜品列表
getCookList() {
let cookbooklist = wx.getStorageSync('cookbooklist');
... ... @@ -463,31 +471,38 @@ Page({
}
this.GetDzSellerConfFun()
},
// 获取主题色
GetDzSellerConfFun() {
App.Seller.GetDzSellerConf({
sid: this.data.options.sid
}).then(res => {
if(res.data.cook_style){
let style=this.determine(res.data.cook_style)
let themeColor,textColor,navColor;
if(style && style.red && style.green && style.blue && style.alpha){
themeColor=style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
}else{
themeColor ='77,78,80,1'
let themeColor, textColor, navColor;
if (res.data.cook_style) {
let style = util.determine(res.data.cook_style)
if (style && style.red && style.green && style.blue && style.alpha) {
themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
} else {
themeColor = '77,78,80,1'; //未设置 为灰色
}
if(themeColor=='251,246,241,1'){
textColor="81,81,81,1"
navColor="81,81,81,1"
}else{
navColor="255,255,255,1"
if (themeColor == '251,246,241,1') {
textColor = "81,81,81,1"
navColor = "81,81,81,1"
} else {
navColor = "255,255,255,1"
}
this.setData({
themeColor,
textColor,
navColor
})
console.log(themeColor);
}
}).catch(res => {
themeColor = '77,78,80,1';
navColor = "255,255,255,1"
this.setData({
themeColor,
navColor
})
})
},
/**
... ... @@ -510,7 +525,7 @@ Page({
}
},
// 展示做法规格弹窗
showModal() {
showCheckModal() {
this.checkModal.showModal()
},
// 关闭做法规格弹窗
... ...
... ... @@ -10,7 +10,7 @@
<view class="round"></view>
<view class="line"></view>
</view>
<view class="title">{{item.class_name}}</view>
<view class="title" style="color:rgba({{navColor}})">{{item.class_name}}</view>
<view class="style_round flex-vc flex-cc">
<view class="line"></view>
<view class="round"></view>
... ... @@ -19,23 +19,52 @@
</block>
<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
<!-- name_type 1左侧,2右侧,3顶部分开 image_type 1大图,2小图 -->
<view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.index}}">
<view class="dishItem {{item.name_type=='2'?'typeB':item.name_type=='3'?'flex-lr':''}}">
<view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
{{item.name}}
<view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.index}}" data-nameType="{{item.name_type}}">
<block wx:if="{{item.name_type!='3'}}">
<view class="dishItem {{item.name_type=='2'?'typeB':''}}">
<view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
{{item.name}}
</view>
<view class="dishTexts dishRight" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
</view>
<view wx:if="{{item.taste}}" class="dishTexts dishRight" style="color:rgba({{textColor}})">
味型:{{item.taste}}
<view wx:if="{{item.specArr.length>0}}" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})">
<view wx:for="{{item.specArr}}">
{{item.str}}
{{item.member_str}}
</view>
</view>
<view wx:else class="norms {{item.name_type=='2'?'normsB':''}}">
{{'¥'+item.price+'/'+item.unit}}
{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
</view>
</block>
<view wx:else class="names">
<view class="dishItem flex-lr">
<view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
{{item.name}}
</view>
<view wx:if="{{item.specArr.length>0}}" style="color:rgba({{textColor}})" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})">
<view wx:for="{{item.specArr}}">
{{item.str}}
{{item.member_str}}
</view>
</view>
<view wx:else class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{textColor}})">
{{'¥'+item.price+'/'+item.unit}}
{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
</view>
</view>
<view class="dishTexts dishRight bottom" style="color:rgba({{textColor}})">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
</view>
<view class="norms {{item.name_type=='2'?'normsB':''}}"
style="color:rgba({{textColor}})">
{{item.price?'¥'+item.price+'/'+item.specs:''}}
{{item.member_price?'会员¥'+item.member_price+'/'+item.specs:''}}
</view>
<image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" />
<view class="greens">
<view class="news" style="color:rgba({{textColor}})">{{item.first_name}}</view>
<view class="greens" wx:if="{{item.desc}}">
<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
</view>
<view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" />
... ... @@ -47,15 +76,31 @@
</view>
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-norms="{{normsIndex}}" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
</view>
<view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
<view wx:if="{{(item.specArr.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" class="imgs" mode="aspectFill" bindtap="addition" data-norms="{{normsIndex}}" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
</view>
</view>
<view wx:else class="twoBox" data-idx="{{item.index}}">
<view wx:else class="twoBox" data-idx="{{item.index}}" data-nameType="{{item.name_type}}">
<view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}">
<view class="twoTitle" style="color:rgba({{textColor}})">{{item.name}}</view>
<view class="twoInfo">{{item.info}}{{item.vip}}</view>{{item.quantum}}
<view class="twoInfo dishTexts" wx:if="{{item.taste}}">
<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
</view>
<view wx:if="{{item.specArr.length>0}}" class="twoInfo twoSingle" style="color:rgba({{textColor}})">
<view wx:for="{{item.specArr}}">
{{item.str}}
{{item.member_str}}
</view>
</view>
<view wx:else class="twoInfo twoSingle">
{{item.price?'¥'+item.price+'/'+item.unit:''}}
{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
</view>
<image src="{{item.image}}" mode="aspectFill" />
<view class="greens" wx:if="{{item.desc}}">
<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
</view>
<view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" />
<view class="box flex-cc">
... ... @@ -105,7 +150,7 @@
<view class="checkLine"></view>
<view class="textSty">规格</view>
<view class="itemBox">
<view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.spec}}" data-item="{{item}}">
<view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.specArr}}" data-item="{{item}}">
{{item.specs}}</view>
</view>
</scroll-view>
... ... @@ -118,8 +163,10 @@
<my-modal id="classifyModal" fadeStyle="slideDown" height="100%">
<view slot="modalContent" class="assortModel">
<scroll-view scroll-y="true" style="height: 70%;">
<view wx:for="{{assortArr}}" class="assortItem font48r {{toView==('inToView'+item.id)?'underline':''}}" data-item="{{item}}" bindtap="checkItem">
{{item.class_name}}
<view class="boxs">
<view wx:for="{{assortArr}}" class="assortItem font48r {{toView==('inToView'+item.id)?'underline':''}}" data-item="{{item}}" bindtap="checkItem">
{{item.class_name}}
</view>
</view>
</scroll-view>
<image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode="" />
... ...
... ... @@ -8,9 +8,11 @@ page {
overflow-x: hidden;
box-sizing: border-box;
}
.dishItem {
padding: 0 0 30rpx 0;
}
.wrapIine {
height: 4rpx;
width: 100%;
... ... @@ -19,6 +21,7 @@ page {
.heand {
width: 100%;
border-top: 4rpx solid #dbdbdb;
}
.heand .style_round {
... ... @@ -42,14 +45,17 @@ page {
flex-wrap: wrap;
color: #fff;
}
.dishWrap:nth-last-of-type(1){
.dishWrap:nth-last-of-type(1) {
padding-bottom: 200rpx;
}
.oneBox{
.oneBox {
width: 100%;
padding-top: 40rpx;
border-top: 4rpx solid #dbdbdb;
}
.dishTexts {
padding: 20rpx 40rpx 0 40rpx;
color: #000;
... ... @@ -59,7 +65,12 @@ page {
-webkit-text-stroke: 1rpx #fff;
}
.dishTexts .texts {
margin-right: 30rpx;
}
.dishRight {
width: 40%;
font-family: PingFang SC;
font-weight: 500;
font-size: 28rpx;
... ... @@ -90,15 +101,20 @@ page {
height: 60rpx;
padding-bottom: 58rpx;
}
.oneBox .imgbox{
.oneBox .imgbox {
margin-right: 80rpx;
margin-top: 20rpx;
}
.twoItem .algorithmImg{
.twoItem .algorithmImg {
padding-top: 20rpx;
}
.twoItem .imgbox{
.twoItem .imgbox {
margin-right: 20rpx;
}
.algorithmImg .imgs {
width: 60rpx;
height: 100%;
... ... @@ -108,7 +124,7 @@ page {
padding: 20rpx 20rpx 58rpx 20rpx;
}
.oneBox .calculate{
.oneBox .calculate {
padding-right: 80rpx;
}
... ... @@ -125,10 +141,12 @@ page {
font-size: 80rpx;
-webkit-text-stroke: 1rpx #fff;
}
.practice{
.practice {
font-family: PingFang SC;
padding-right: 10rpx;
}
.num view {
color: #dbdbdb;
font-family: PingFang SC;
... ... @@ -143,11 +161,12 @@ page {
border-right: 4rpx solid #dbdbdb;
}
.borderNone{
.borderNone {
border-right: none;
}
.twoTitle {
padding: 30rpx 0 10rpx 20rpx;
padding: 30rpx 0 30rpx 10rpx;
color: #000;
font-family: PingFang SC;
font-weight: 500;
... ... @@ -155,12 +174,18 @@ page {
-webkit-text-stroke: 1rpx #fff;
}
.twoSingle,
.norms {
display: flex;
flex-direction: column;
}
.twoInfo {
color: #000;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
padding: 0 0 30rpx 20rpx;
padding: 0 10rpx 20rpx 10rpx;
-webkit-text-stroke: 1rpx #fff;
}
... ... @@ -178,7 +203,7 @@ page {
.twoBox {
width: 50%;
border-top:4rpx solid #dbdbdb;
border-top: 4rpx solid #dbdbdb;
display: flex;
flex-direction: row;
flex-wrap: wrap;
... ... @@ -209,7 +234,7 @@ page {
height: 36rpx;
}
.fixedBox .right{
.fixedBox .right {
padding: 0 20rpx;
}
... ... @@ -218,11 +243,11 @@ page {
height: 50rpx;
}
.fixedBox .right .rightBox{
.fixedBox .right .rightBox {
position: relative;
}
.fixedBox .right .num{
.fixedBox .right .num {
position: absolute;
right: -20%;
top: 0;
... ... @@ -251,6 +276,32 @@ page {
flex-direction: column;
}
.typeB .dishRight {
width: auto;
}
.names .dishRight {
width: 100%;
box-sizing: border-box;
padding: 0 40rpx 0 40rpx;
}
.names .dishTexts {
width: auto;
box-sizing: border-box;
padding: 0 40rpx 0 40rpx;
}
.names .bottom {
padding-bottom: 20rpx;
}
.names .norms {
padding-bottom: 0;
width: 40%;
text-align: right;
}
.normsB {
text-align: right;
}
... ... @@ -299,6 +350,7 @@ page {
color: #E34D59;
border: 2rpx solid #E34D59;
}
.style_round .line {
width: 100rpx;
height: 2rpx;
... ... @@ -376,6 +428,13 @@ page {
width: 100rpx;
height: 100rpx;
}
.determine{
.determine {
color: #E34D59;
}
.boxs{
height: 100%;
display: flex;
justify-content: center;
flex-direction: column;
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ Page({
sellerName: '',
sellerid: '',
probablyPrice: '',
vipProbablyPrice:'',
discount: '',
stringifyUse: '',
priceInfo: '',
... ... @@ -49,13 +50,14 @@ Page({
},
formatCookList(cookbooklist){
let probablyPrice = 0;
let vipProbablyPrice = 0;
let noData = false;
cookbooklist.forEach(items => {
items.is_show = false
items.normsLen=0
items.cookbooklist[0].forEach(item => {
item.arr=[];//arr 点菜的菜品列表
if (item.norms.length>0) {
if (item.norms && item.norms.length>0) {
item.norms.forEach(i => {
let obj={
name:item.name,
... ... @@ -66,7 +68,9 @@ Page({
}
item.arr.push(obj)
let price = i.quantum * 1 * (i.price * 1);
let vipPrice = i.quantum * 1 * (i.member_price * 1);
probablyPrice += price;
vipProbablyPrice += vipPrice;
})
noData = true
items.is_show = true;//展示不展示
... ... @@ -78,6 +82,7 @@ Page({
this.setData({
cookbooklist,
probablyPrice,
vipProbablyPrice,
noData
})
},
... ... @@ -92,7 +97,8 @@ Page({
let url=util.http_build_query({
sellerName:this.data.sellerName,
sellerid:this.data.sellerid,
oid:this.data.oid
oid:this.data.oid,
types:'2',
},'/pack-cookbook/pages/favourableList')
console.log(url);
wx.navigateTo({
... ...
... ... @@ -38,8 +38,8 @@
</block>
</block>
<view class="probably flex-ll">
<view class="tariff font24r">预计金额:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
<view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
</view>
<view class="information font36r">特别优惠</view>
<view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
... ...