Commit 8dc1169807700e4c22ed2dc8904c4490481339c0

Authored by yiren
1 parent ec352012

提前点餐

@@ -24,6 +24,7 @@ Page({ @@ -24,6 +24,7 @@ Page({
24 let obj = JSON.parse(wx.getStorageSync('cookbookObj')); 24 let obj = JSON.parse(wx.getStorageSync('cookbookObj'));
25 let cookbooklist = JSON.parse(wx.getStorageSync('cookbooklist')); 25 let cookbooklist = JSON.parse(wx.getStorageSync('cookbooklist'));
26 this.formatCookList(cookbooklist); 26 this.formatCookList(cookbooklist);
  27 + console.log('obj',{...obj});
27 this.setData({ 28 this.setData({
28 sellerName: obj.sellerName, 29 sellerName: obj.sellerName,
29 sellerid: obj.sellerid, 30 sellerid: obj.sellerid,
@@ -42,23 +43,15 @@ Page({ @@ -42,23 +43,15 @@ Page({
42 items.is_show = false 43 items.is_show = false
43 items.normsLen = 0 44 items.normsLen = 0
44 items.cookbooklist[0].forEach(item => { 45 items.cookbooklist[0].forEach(item => {
45 - item.arr = []; //arr 点菜的菜品列表  
46 - if (item.norms.length > 0) { 46 + console.log(item.norms);
  47 + if (item.norms && item.norms.length > 0) {
47 item.norms.forEach(i => { 48 item.norms.forEach(i => {
48 - let obj = {  
49 - name: item.name,  
50 - practice: i.practice,  
51 - unit: i.unit,  
52 - price: i.price,  
53 - quantum: i.quantum,  
54 - }  
55 - item.arr.push(obj)  
56 let price = i.quantum * 1 * (i.price * 1); 49 let price = i.quantum * 1 * (i.price * 1);
57 probablyPrice += price; 50 probablyPrice += price;
58 }) 51 })
59 noData = true 52 noData = true
60 items.is_show = true; //展示不展示 53 items.is_show = true; //展示不展示
61 - items.normsLen += item.arr.length; //菜品数量 54 + items.normsLen += item.norms.length; //菜品数量
62 } 55 }
63 }) 56 })
64 }) 57 })
@@ -25,10 +25,10 @@ @@ -25,10 +25,10 @@
25 <view class="rightTitle">{{item.normsLen}}道</view> 25 <view class="rightTitle">{{item.normsLen}}道</view>
26 </view> 26 </view>
27 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index"> 27 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
28 - <block wx:if="{{item.arr.length>0}}">  
29 - <view wx:for="{{item.arr}}" wx:for-index="idx" class="content flex-lr">  
30 - <view class="single">{{item.name}}<text>({{item.practice}})</text></view>  
31 - <view class="price">{{item.price}}元/{{item.unit}}</view> 28 + <block wx:if="{{item.norms.length>0}}">
  29 + <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
  30 + <view class="single">{{item.name}}<text>({{item.practiceName}})</text></view>
  31 + <view class="price">{{item.price}}元/{{item.unitName}}</view>{{item.price}}
32 <view class="count flex-cc"> 32 <view class="count flex-cc">
33 <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="" /> 33 <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="" />
34 {{item.quantum}} 34 {{item.quantum}}
@@ -14,8 +14,8 @@ Page({ @@ -14,8 +14,8 @@ Page({
14 options: {}, 14 options: {},
15 check1: '', //做法 15 check1: '', //做法
16 check2: '', //规格 16 check2: '', //规格
17 - check1Name:'',  
18 - check2Name:'', 17 + check1Name: '',
  18 + check2Name: '',
19 isloading: true, 19 isloading: true,
20 toView: "inToView27", 20 toView: "inToView27",
21 hasEnter: false, 21 hasEnter: false,
@@ -32,6 +32,9 @@ Page({ @@ -32,6 +32,9 @@ Page({
32 checkObj: '', 32 checkObj: '',
33 normsIndex: '', 33 normsIndex: '',
34 assortArr: [], 34 assortArr: [],
  35 + themeColor:'',
  36 + textColor:'',
  37 + navColor:'',
35 }, 38 },
36 checkModal: '', 39 checkModal: '',
37 classifyModal: '', 40 classifyModal: '',
@@ -80,25 +83,26 @@ Page({ @@ -80,25 +83,26 @@ Page({
80 // 选择做法 83 // 选择做法
81 checkSingle1(e) { 84 checkSingle1(e) {
82 const item = e.currentTarget.dataset['item']; 85 const item = e.currentTarget.dataset['item'];
83 - let checkItem=this.data.checkItem  
84 - checkItem.check1=item.id 86 + let checkItem = this.data.checkItem
  87 + checkItem.check1 = item.id
85 this.setData({ 88 this.setData({
86 - check1:item.id,  
87 - check1Name:item.name, 89 + check1: item.id,
  90 + check1Name: item.name,
88 checkItem 91 checkItem
89 }) 92 })
90 }, 93 },
91 // 选择规格 94 // 选择规格
92 checkSingle2(e) { 95 checkSingle2(e) {
93 const item = e.currentTarget.dataset['item']; 96 const item = e.currentTarget.dataset['item'];
94 - let checkItem=this.data.checkItem  
95 - checkItem.check2=item.id 97 + let checkItem = this.data.checkItem
  98 + checkItem.check2 = item.id
96 this.setData({ 99 this.setData({
97 - check2:item.id,  
98 - check2Name:item.specs, 100 + check2: item.id,
  101 + check2Name: item.specs,
99 checkItem 102 checkItem
100 }) 103 })
101 }, 104 },
  105 + // 获取点菜数量
102 getNormsLen() { 106 getNormsLen() {
103 let cookbooklist = this.data.cookbooklist; 107 let cookbooklist = this.data.cookbooklist;
104 let normsLen = 0; 108 let normsLen = 0;
@@ -140,13 +144,15 @@ Page({ @@ -140,13 +144,15 @@ Page({
140 cookbooklist: this.data.cookbooklist, 144 cookbooklist: this.data.cookbooklist,
141 }) 145 })
142 } else { 146 } else {
  147 + console.log({...data});
143 let obj = { 148 let obj = {
144 quantum: 1, 149 quantum: 1,
145 - practice: this.data.check1?this.data.check1:data.check1,  
146 - unit: this.data.check2?this.data.check2:data.check2,  
147 - practiceName:this.data.check1Name?this.data.check1Name:data.check1Name,  
148 - unitName:this.data.check2Name?this.data.check2Name:data.check2Name,  
149 - price 150 + name:data.name,
  151 + practice: this.data.check1 ? this.data.check1 : data.check1,
  152 + unit: this.data.check2 ? this.data.check2 : data.check2,
  153 + practiceName: this.data.check1Name ? this.data.check1Name : data.check1Name,
  154 + unitName: this.data.check2Name ? this.data.check2Name : data.check2Name,
  155 + price:price?price:''
150 } 156 }
151 this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) 157 this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj)
152 this.setData({ 158 this.setData({
@@ -175,29 +181,33 @@ Page({ @@ -175,29 +181,33 @@ Page({
175 let norms = this.data.cookbooklist[indexs].cookbooklist[0][index].norms 181 let norms = this.data.cookbooklist[indexs].cookbooklist[0][index].norms
176 let normsNum; 182 let normsNum;
177 // 点击下面的加号并且有规格或者做法的,弹框选规格 下面的直接加 183 // 点击下面的加号并且有规格或者做法的,弹框选规格 下面的直接加
178 - if (type == '1' && (item.practice.length>1 || item.spec.length>1)) { 184 + if (type == '1' && (item.practice.length > 1 || item.spec.length > 1)) {
179 this.setData({ 185 this.setData({
180 - check1:item.practice.length>0?item.practice[0].id:'',  
181 - check2:item.spec.length>0?item.spec[0].id:'', 186 + check1: item.practice[0].id,
  187 + check2: item.spec[0].id,
  188 + check1Name:item.practice[0].name,
  189 + check2Name:item.spec[0].spec,
182 }) 190 })
183 return this.showModal() 191 return this.showModal()
184 - }else { 192 + } else {
185 normsNum = 1; 193 normsNum = 1;
186 - let obj={  
187 - quantum:normsNum, 194 + let obj = {
  195 + quantum: normsNum,
188 practice: item.check1Name, 196 practice: item.check1Name,
189 - unit:item.unit,  
190 - practiceName:item.check1Name,  
191 - unitName:item.check2Name, 197 + unit: item.unit,
  198 + practiceName: item.check1Name,
  199 + unitName: item.check2Name,
  200 + name:item.name,
  201 + price:item.price,
192 } 202 }
193 - if(!normsIndex && norms.length == '0'){ 203 + if (!normsIndex && norms.length == '0') {
194 this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) 204 this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj)
195 } 205 }
196 } 206 }
197 if (type == '0' && norms.length != '0') { 207 if (type == '0' && norms.length != '0') {
198 normsNum = this.data.cookbooklist[indexs].cookbooklist[0][index].norms[normsIndex].quantum * 1 + 1; 208 normsNum = this.data.cookbooklist[indexs].cookbooklist[0][index].norms[normsIndex].quantum * 1 + 1;
199 this.data.cookbooklist[indexs].cookbooklist[0][index].norms[normsIndex].quantum = normsNum; 209 this.data.cookbooklist[indexs].cookbooklist[0][index].norms[normsIndex].quantum = normsNum;
200 - }else{ 210 + } else {
201 normsNum = 1 211 normsNum = 1
202 } 212 }
203 this.setData({ 213 this.setData({
@@ -264,6 +274,7 @@ Page({ @@ -264,6 +274,7 @@ Page({
264 let assortArr = []; 274 let assortArr = [];
265 let check1 = ''; 275 let check1 = '';
266 let check2 = ''; 276 let check2 = '';
  277 + let that=this;
267 if (list.length > 0) { 278 if (list.length > 0) {
268 has10CaiOpen = list[0].status == 1; 279 has10CaiOpen = list[0].status == 1;
269 list.forEach(function (cate, i) { 280 list.forEach(function (cate, i) {
@@ -313,14 +324,14 @@ Page({ @@ -313,14 +324,14 @@ Page({
313 cook.norms = []; //做法规格 324 cook.norms = []; //做法规格
314 } 325 }
315 cook.type = '1'; 326 cook.type = '1';
316 - let cook_style=cook.cook_style?JSON.parse(cook.cook_style):''; 327 + let cook_style = cook.cook_style?that.determine(cook.cook_style):'';//判断是不是json,是json在转换为对象
317 cook.cook_style = cook_style; 328 cook.cook_style = cook_style;
318 - cook.image_type = cook_style.image_type?cook_style.image_type:'1';//1大图,2小图 默认大图  
319 - cook.name_type = cook_style.name_type?cook_style.name_type:'3';//1左侧,2右侧,3顶部分开 默认分开  
320 - cook.check1 = cook.practice.length>0?cook.practice[0].id:'';  
321 - cook.check2 = cook.spec.length>0?cook.spec[0].id:'';  
322 - cook.check1Name = cook.practice.length>0?cook.practice[0].name:'';  
323 - cook.check2Name = cook.spec.length>0?cook.spec[0].specs:''; 329 + cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图 默认大图
  330 + cook.name_type = cook_style && cook_style.name_type ? cook_style.name_type : '3'; //1左侧,2右侧,3顶部分开 默认分开
  331 + cook.check1 = cook.practice.length > 0 ? cook.practice[0].id : '';
  332 + cook.check2 = cook.spec.length > 0 ? cook.spec[0].id : '';
  333 + cook.check1Name = cook.practice.length > 0 ? cook.practice[0].name : '';
  334 + cook.check2Name = cook.spec.length > 0 ? cook.spec[0].specs : '';
324 if (item_clear_num == 0) { 335 if (item_clear_num == 0) {
325 flag = false; 336 flag = false;
326 } 337 }
@@ -340,41 +351,63 @@ Page({ @@ -340,41 +351,63 @@ Page({
340 } 351 }
341 }) 352 })
342 } 353 }
343 - let sortArr=[]  
344 - flist.forEach(item=>{  
345 - item.cookbooklist[0].sort((a,b)=>{  
346 - return a.order_o-b.order_o 354 + // 排序
  355 + let sortArr = []
  356 + flist.forEach(item => {
  357 + item.cookbooklist[0].sort((a, b) => {
  358 + return a.order_o - b.order_o
347 }) 359 })
348 sortArr.push(item) 360 sortArr.push(item)
349 }) 361 })
350 - let image_typeArr=[];  
351 - sortArr.forEach(item=>{  
352 - let num=0;  
353 - item.cookbooklist[0].forEach((i,idx)=>{  
354 - if(i.image_type=='2'){ 362 + // 大小图设置边框
  363 + let image_typeArr = [];
  364 + sortArr.forEach(item => {
  365 + let num = 0;
  366 + item.cookbooklist[0].forEach((i, idx) => {
  367 + if (i.image_type == '2') {
355 num++ 368 num++
356 - i.index=num;  
357 - if(i.index%2!=0){  
358 - i.boderNone=false;  
359 - }else{  
360 - i.boderNone=true; 369 + i.index = num;
  370 + if (i.index % 2 != 0) {
  371 + i.boderNone = false;
  372 + } else {
  373 + i.boderNone = true;
361 } 374 }
362 // 下一个是大图 不是最后一个 375 // 下一个是大图 不是最后一个
363 - if(item.cookbooklist[0][idx+1].image_type=='1' && idx!=item.cookbooklist[0].length-1){ 376 + if (item.cookbooklist[0][idx + 1].image_type == '1' && idx != item.cookbooklist[0].length - 1) {
364 // 是奇数 377 // 是奇数
365 - if(num%2!=0){  
366 - let s=i.index*1+1;  
367 - item.cookbooklist[0].splice(idx+1,0,{index:s,boderNone:true}) 378 + if (num % 2 != 0) {
  379 + let s = i.index * 1 + 1;
  380 + item.cookbooklist[0].splice(idx + 1, 0, {
  381 + index: s,
  382 + boderNone: true
  383 + })
368 } 384 }
369 } 385 }
370 - }else if(i.image_type=='1'){  
371 - i.index=0  
372 - num=0 386 + } else if (i.image_type == '1') {
  387 + i.index = 0
  388 + num = 0
373 } 389 }
374 }) 390 })
375 image_typeArr.push(item) 391 image_typeArr.push(item)
376 }) 392 })
377 - console.log('image_typeArr',image_typeArr); 393 + // 获取所有的规格
  394 + image_typeArr.forEach(item => {
  395 + item.cookbooklist[0].forEach((i, idx) => {
  396 + i.specArr=[]
  397 + if(i.spec && i.spec.length>0){
  398 + i.spec.forEach(sigin=>{
  399 + if(sigin.status=='1'){
  400 + let obj={
  401 + str:'¥'+i.price+'/'+i.specs
  402 + }
  403 + i.specArr.push(sigin)
  404 + }
  405 + })
  406 + }
  407 + console.log(i.specArr);
  408 + })
  409 + })
  410 +
378 setTimeout(() => { 411 setTimeout(() => {
379 this.setData({ 412 this.setData({
380 check1, 413 check1,
@@ -382,10 +415,22 @@ Page({ @@ -382,10 +415,22 @@ Page({
382 assortArr 415 assortArr
383 }) 416 })
384 }, 1); 417 }, 1);
  418 + console.log(image_typeArr);
385 return image_typeArr; 419 return image_typeArr;
386 }, 420 },
  421 + // 判断
  422 + determine(str) {
  423 + if (typeof str == 'string') {
  424 + try {
  425 + var obj = JSON.parse(str);
  426 + return obj;
  427 + } catch (e) {
  428 + return false;
  429 + }
  430 + }
  431 + },
387 // 获取所有分类下所有菜品列表 432 // 获取所有分类下所有菜品列表
388 - getCookList(orderid) { 433 + getCookList() {
389 let cookbooklist = wx.getStorageSync('cookbooklist'); 434 let cookbooklist = wx.getStorageSync('cookbooklist');
390 let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : ''; 435 let cookbooklistStorage = cookbooklist ? JSON.parse(cookbooklist) : '';
391 console.log('cookbooklist历史数据', cookbooklistStorage); 436 console.log('cookbooklist历史数据', cookbooklistStorage);
@@ -402,9 +447,9 @@ Page({ @@ -402,9 +447,9 @@ Page({
402 orderid: this.data.options.oid, 447 orderid: this.data.options.oid,
403 status: '0,1', 448 status: '0,1',
404 }; 449 };
405 - App.Advance.GetCookbookByClass(param).then(json => {  
406 - let cookbooklist=this.formatCookList(json.data[0].list)  
407 - // console.log('cookbooklist',cookbooklist); 450 + App.Cookbook.GetCookbookByClass(param).then(json => {
  451 + let cookbooklist = this.formatCookList(json.data[0].list)
  452 + console.log('cookbooklist', cookbooklist);
408 setTimeout(() => { 453 setTimeout(() => {
409 this.setData({ 454 this.setData({
410 cookbooklist, 455 cookbooklist,
@@ -416,6 +461,34 @@ Page({ @@ -416,6 +461,34 @@ Page({
416 console.log(res); 461 console.log(res);
417 }); 462 });
418 } 463 }
  464 + this.GetDzSellerConfFun()
  465 + },
  466 + GetDzSellerConfFun() {
  467 + App.Seller.GetDzSellerConf({
  468 + sid: this.data.options.sid
  469 + }).then(res => {
  470 + if(res.data.cook_style){
  471 + let style=this.determine(res.data.cook_style)
  472 + let themeColor,textColor,navColor;
  473 + if(style && style.red && style.green && style.blue && style.alpha){
  474 + themeColor=style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
  475 + }else{
  476 + themeColor ='77,78,80,1'
  477 + }
  478 + if(themeColor=='251,246,241,1'){
  479 + textColor="81,81,81,1"
  480 + navColor="81,81,81,1"
  481 + }else{
  482 + navColor="255,255,255,1"
  483 + }
  484 + this.setData({
  485 + themeColor,
  486 + textColor,
  487 + navColor
  488 + })
  489 + console.log(themeColor);
  490 + }
  491 + })
419 }, 492 },
420 /** 493 /**
421 * 生命周期函数--监听页面显示 494 * 生命周期函数--监听页面显示
1 <!--pack-cookbook/pages/index_new.wxml--> 1 <!--pack-cookbook/pages/index_new.wxml-->
2 -<nav backgroundColor="#4d4e50" color="#fff">{{options.sellerName||'提前点菜'}}</nav> 2 +<nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提前点菜'}}</nav>
3 <loading wx:if="{{isloading}}">数据加载中</loading> 3 <loading wx:if="{{isloading}}">数据加载中</loading>
4 -<scroll-view style="height:100vh;" class="content" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true"> 4 +<scroll-view style="height:100vh;background: rgba({{themeColor}});" class="content" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true">
5 <block wx:for="{{cookbooklist}}" wx:key="cookbooklist-key" wx:for-index="indexs"> 5 <block wx:for="{{cookbooklist}}" wx:key="cookbooklist-key" wx:for-index="indexs">
6 <view class="dishWrap" id="{{ 'inToView'+item.id}}"> 6 <view class="dishWrap" id="{{ 'inToView'+item.id}}">
7 - <block wx:if="{{item.class_type=='1'}}"> 7 + <block>
8 <view class="heand flex-vc flex-cc"> 8 <view class="heand flex-vc flex-cc">
9 <view class="style_round flex-vc flex-cc"> 9 <view class="style_round flex-vc flex-cc">
10 <view class="round"></view> 10 <view class="round"></view>
@@ -20,92 +20,74 @@ @@ -20,92 +20,74 @@
20 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index"> 20 <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
21 <!-- name_type 1左侧,2右侧,3顶部分开 image_type 1大图,2小图 --> 21 <!-- name_type 1左侧,2右侧,3顶部分开 image_type 1大图,2小图 -->
22 <view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.index}}"> 22 <view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.index}}">
23 - <view class="dishItem flex-lr">  
24 - <view class="dishLeft dishTexts">{{item.name}}</view>  
25 - <view class="dishTexts dishRight">味型:price</view>  
26 - </view>  
27 - <view class="norms">味型:{{item.taste}}</view>  
28 - <block wx:if="{{type=='B'}}">  
29 - <view class="dishItem typeB">  
30 - <view class="dishLeft dishTexts">{{item.title}}</view>  
31 - <view class="dishTexts dishRight">{{item.first_name}}</view> 23 + <view class="dishItem {{item.name_type=='2'?'typeB':item.name_type=='3'?'flex-lr':''}}">
  24 + <view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
  25 + {{item.name}}
32 </view> 26 </view>
33 - <view class="norms normsB">{{item.first_name}}</view>  
34 - </block>  
35 - <block wx:if="{{type=='C'}}">  
36 - <view class="dishItem">  
37 - <view class="dishLeft dishTexts">{{item.title}}</view>  
38 - <view class="dishTexts dishRight">{{item.first_name}}</view> 27 + <view wx:if="{{item.taste}}" class="dishTexts dishRight" style="color:rgba({{textColor}})">
  28 + 味型:{{item.taste}}
39 </view> 29 </view>
40 - <view class="norms">{{item.first_name}}</view>  
41 - </block>  
42 - <image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" /> 30 + </view>
  31 + <view class="norms {{item.name_type=='2'?'normsB':''}}"
  32 + style="color:rgba({{textColor}})">
  33 + {{item.price?'¥'+item.price+'/'+item.specs:''}}
  34 + {{item.member_price?'会员¥'+item.member_price+'/'+item.specs:''}}
  35 + </view>
  36 + <image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" />
43 <view class="greens"> 37 <view class="greens">
44 - <view class="news">{{item.first_name}}</view> 38 + <view class="news" style="color:rgba({{textColor}})">{{item.first_name}}</view>
45 </view> 39 </view>
46 <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> 40 <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
47 - <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 41 + <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}}" />
48 <view class="box flex-cc"> 42 <view class="box flex-cc">
49 <view class="num flex-cc"> 43 <view class="num flex-cc">
50 - {{item.quantum}}<view>{{item.unitName}}</view> 44 + {{item.quantum}}<view style="color:rgba({{textColor}})">{{item.unitName}}</view>
51 </view> 45 </view>
52 - <view class="practice">{{item.practiceName}}</view> 46 + <view class="practice" style="color:rgba({{textColor}})">{{item.practiceName}}</view>
53 </view> 47 </view>
54 - <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-norms="{{normsIndex}}" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 48 + <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}}" />
55 </view> 49 </view>
56 <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox"> 50 <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
57 - <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-norms="{{normsIndex}}" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 51 + <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}}" />
58 </view> 52 </view>
59 - <!-- <view class="wrapIine"></view> -->  
60 </view> 53 </view>
61 <view wx:else class="twoBox" data-idx="{{item.index}}"> 54 <view wx:else class="twoBox" data-idx="{{item.index}}">
62 <view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}"> 55 <view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}">
63 - <view class="twoTitle">{{item.name}}</view> 56 + <view class="twoTitle" style="color:rgba({{textColor}})">{{item.name}}</view>
64 <view class="twoInfo">{{item.info}}{{item.vip}}</view>{{item.quantum}} 57 <view class="twoInfo">{{item.info}}{{item.vip}}</view>{{item.quantum}}
65 <image src="{{item.image}}" mode="aspectFill" /> 58 <image src="{{item.image}}" mode="aspectFill" />
66 <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> 59 <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
67 - <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 60 + <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}}" />
68 <view class="box flex-cc"> 61 <view class="box flex-cc">
69 <view class="num flex-cc"> 62 <view class="num flex-cc">
70 - {{item.quantum}}<view>{{item.unitName}}</view> 63 + {{item.quantum}}<view style="color:rgba({{textColor}})">{{item.unitName}}</view>
71 </view> 64 </view>
72 - <view class="practice">{{item.practiceName}}</view> 65 + <view class="practice" style="color:rgba({{textColor}})">{{item.practiceName}}</view>
73 </view> 66 </view>
74 - <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-norms="{{normsIndex}}" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 67 + <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}}" />
75 </view> 68 </view>
76 <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox"> 69 <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
77 - <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-norms="{{normsIndex}}" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> 70 + <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}}" />
78 </view> 71 </view>
79 - <!-- <view class="wrapIine"></view> -->  
80 - <!-- <view class="algorithmImg flex-rr oneImg">  
81 - <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" bindtap="subtraction" data-item="{{item}}" data-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" />  
82 - </view>  
83 - <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-lr twoImgs">  
84 - <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-norms="{{normsIndex}}" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />  
85 - <view class="box flex-cc">  
86 - <view class="num flex-cc">{{item.quantum}}</view>  
87 - </view>  
88 - <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-norms="{{normsIndex}}" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}"/>  
89 - </view> -->  
90 </view> 72 </view>
91 </view> 73 </view>
92 </block> 74 </block>
93 </view> 75 </view>
94 </block> 76 </block>
95 </scroll-view> 77 </scroll-view>
96 -<view class="fixedBox flex-lr"> 78 +<view class="fixedBox flex-lr" style="background: rgba({{themeColor}});">
97 <view class="left flex-cmc" bindtap="showClassifyModal"> 79 <view class="left flex-cmc" bindtap="showClassifyModal">
98 - <image src="https://qn.colorcun.com/WechatIMG700.png" mode="" />  
99 - <view class="fixedName"> 80 + <image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG700.png':'https://qn.colorcun.com/s1.png'}}" mode="" />
  81 + <view class="fixedName" style="color:rgba({{textColor}})">
100 菜品分类 82 菜品分类
101 </view> 83 </view>
102 </view> 84 </view>
103 <view class="right flex-cmc" bindtap="gotoShoppingCart"> 85 <view class="right flex-cmc" bindtap="gotoShoppingCart">
104 <view class="rightBox"> 86 <view class="rightBox">
105 - <image src="https://qn.colorcun.com/WechatIMG701.png" mode="" /> 87 + <image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG701.png':'https://qn.colorcun.com/s2.png'}}" mode="" />
106 <view class="num" wx:if="{{normsLen}}">{{normsLen}}</view> 88 <view class="num" wx:if="{{normsLen}}">{{normsLen}}</view>
107 </view> 89 </view>
108 - <view class="fixedName"> 90 + <view class="fixedName" style="color:rgba({{textColor}})">
109 已选菜品 91 已选菜品
110 </view> 92 </view>
111 </view> 93 </view>
1 /* pack-cookbook/pages/index_new.wxss */ 1 /* pack-cookbook/pages/index_new.wxss */
2 page { 2 page {
3 - background-color: #4d4e50;  
4 width: 100%; 3 width: 100%;
5 height: 100vh; 4 height: 100vh;
6 display: block; 5 display: block;
@@ -9,7 +8,9 @@ page { @@ -9,7 +8,9 @@ page {
9 overflow-x: hidden; 8 overflow-x: hidden;
10 box-sizing: border-box; 9 box-sizing: border-box;
11 } 10 }
12 - 11 +.dishItem {
  12 + padding: 0 0 30rpx 0;
  13 +}
13 .wrapIine { 14 .wrapIine {
14 height: 4rpx; 15 height: 4rpx;
15 width: 100%; 16 width: 100%;
@@ -50,12 +51,12 @@ page { @@ -50,12 +51,12 @@ page {
50 border-top: 4rpx solid #dbdbdb; 51 border-top: 4rpx solid #dbdbdb;
51 } 52 }
52 .dishTexts { 53 .dishTexts {
53 - padding: 0 40rpx;  
54 - color: #dbdbdb; 54 + padding: 20rpx 40rpx 0 40rpx;
  55 + color: #000;
55 font-family: PingFang SC; 56 font-family: PingFang SC;
56 font-weight: 500; 57 font-weight: 500;
57 font-size: 40rpx; 58 font-size: 40rpx;
58 - -webkit-text-stroke: 1rpx black; 59 + -webkit-text-stroke: 1rpx #fff;
59 } 60 }
60 61
61 .dishRight { 62 .dishRight {
@@ -65,11 +66,11 @@ page { @@ -65,11 +66,11 @@ page {
65 } 66 }
66 67
67 .norms { 68 .norms {
68 - margin-top: 10rpx;  
69 - color: #dbdbdb; 69 + color: #000;
70 font-family: PingFang SC; 70 font-family: PingFang SC;
71 font-size: 24rpx; 71 font-size: 24rpx;
72 padding: 0 40rpx 30rpx 40rpx; 72 padding: 0 40rpx 30rpx 40rpx;
  73 + -webkit-text-stroke: 1rpx #fff;
73 } 74 }
74 75
75 .dishImg { 76 .dishImg {
@@ -89,13 +90,15 @@ page { @@ -89,13 +90,15 @@ page {
89 height: 60rpx; 90 height: 60rpx;
90 padding-bottom: 58rpx; 91 padding-bottom: 58rpx;
91 } 92 }
92 -.imgbox{  
93 - margin-right: 20rpx; 93 +.oneBox .imgbox{
  94 + margin-right: 80rpx;
94 } 95 }
95 .twoItem .algorithmImg{ 96 .twoItem .algorithmImg{
96 padding-top: 20rpx; 97 padding-top: 20rpx;
97 } 98 }
98 - 99 +.twoItem .imgbox{
  100 + margin-right: 20rpx;
  101 +}
99 .algorithmImg .imgs { 102 .algorithmImg .imgs {
100 width: 60rpx; 103 width: 60rpx;
101 height: 100%; 104 height: 100%;
@@ -105,6 +108,10 @@ page { @@ -105,6 +108,10 @@ page {
105 padding: 20rpx 20rpx 58rpx 20rpx; 108 padding: 20rpx 20rpx 58rpx 20rpx;
106 } 109 }
107 110
  111 +.oneBox .calculate{
  112 + padding-right: 80rpx;
  113 +}
  114 +
108 .calculate .imgs { 115 .calculate .imgs {
109 width: 60rpx; 116 width: 60rpx;
110 height: 60rpx; 117 height: 60rpx;
@@ -116,8 +123,12 @@ page { @@ -116,8 +123,12 @@ page {
116 font-family: PingFang SC; 123 font-family: PingFang SC;
117 font-weight: 500; 124 font-weight: 500;
118 font-size: 80rpx; 125 font-size: 80rpx;
  126 + -webkit-text-stroke: 1rpx #fff;
  127 +}
  128 +.practice{
  129 + font-family: PingFang SC;
  130 + padding-right: 10rpx;
119 } 131 }
120 -  
121 .num view { 132 .num view {
122 color: #dbdbdb; 133 color: #dbdbdb;
123 font-family: PingFang SC; 134 font-family: PingFang SC;
@@ -137,18 +148,20 @@ page { @@ -137,18 +148,20 @@ page {
137 } 148 }
138 .twoTitle { 149 .twoTitle {
139 padding: 30rpx 0 10rpx 20rpx; 150 padding: 30rpx 0 10rpx 20rpx;
140 - color: #dbdbdb; 151 + color: #000;
141 font-family: PingFang SC; 152 font-family: PingFang SC;
142 font-weight: 500; 153 font-weight: 500;
143 font-size: 40rpx; 154 font-size: 40rpx;
  155 + -webkit-text-stroke: 1rpx #fff;
144 } 156 }
145 157
146 .twoInfo { 158 .twoInfo {
147 - color: #dbdbdb; 159 + color: #000;
148 font-family: PingFang SC; 160 font-family: PingFang SC;
149 font-weight: 500; 161 font-weight: 500;
150 font-size: 24rpx; 162 font-size: 24rpx;
151 padding: 0 0 30rpx 20rpx; 163 padding: 0 0 30rpx 20rpx;
  164 + -webkit-text-stroke: 1rpx #fff;
152 } 165 }
153 166
154 .twoItem image { 167 .twoItem image {
@@ -179,6 +192,7 @@ page { @@ -179,6 +192,7 @@ page {
179 .reduceImg { 192 .reduceImg {
180 width: 70rpx; 193 width: 70rpx;
181 height: 8rpx !important; 194 height: 8rpx !important;
  195 + padding: 10rpx;
182 } 196 }
183 197
184 .fixedBox { 198 .fixedBox {
@@ -188,7 +202,6 @@ page { @@ -188,7 +202,6 @@ page {
188 width: 100%; 202 width: 100%;
189 padding: 18rpx 80rpx 18rpx 80rpx; 203 padding: 18rpx 80rpx 18rpx 80rpx;
190 box-sizing: border-box; 204 box-sizing: border-box;
191 - background-color: #4D4E50;  
192 } 205 }
193 206
194 .fixedBox .left image { 207 .fixedBox .left image {
@@ -286,6 +299,11 @@ page { @@ -286,6 +299,11 @@ page {
286 color: #E34D59; 299 color: #E34D59;
287 border: 2rpx solid #E34D59; 300 border: 2rpx solid #E34D59;
288 } 301 }
  302 +.style_round .line {
  303 + width: 100rpx;
  304 + height: 2rpx;
  305 + background: #dbdbdb;
  306 +}
289 307
290 .checkLine { 308 .checkLine {
291 width: 100%; 309 width: 100%;
@@ -685,4 +685,14 @@ export default { @@ -685,4 +685,14 @@ export default {
685 'App.Activity.GetNewRechargeList':{ 685 'App.Activity.GetNewRechargeList':{
686 openid:'openid' 686 openid:'openid'
687 }, 687 },
  688 +
  689 + // 获取商家订座配置
  690 + 'App.Seller.GetDzSellerConf':{
  691 + openid:'openid'
  692 + },
  693 +
  694 + // 获取所有分类下所有菜品列表
  695 + 'App.Cookbook.GetCookbookByClass':{
  696 + openid:'openid'
  697 + },
688 } 698 }