Showing
8 changed files
with
266 additions
and
125 deletions
| @@ -7,15 +7,16 @@ Page({ | @@ -7,15 +7,16 @@ Page({ | ||
| 7 | cookbooklist: [], | 7 | cookbooklist: [], |
| 8 | sellerName: '', | 8 | sellerName: '', |
| 9 | probablyPrice: '', | 9 | probablyPrice: '', |
| 10 | + vipProbablyPrice: '', | ||
| 10 | sellerid: '', | 11 | sellerid: '', |
| 11 | notes: '', | 12 | notes: '', |
| 12 | noData: false, | 13 | noData: false, |
| 13 | rid: '', | 14 | rid: '', |
| 14 | oid: '', | 15 | oid: '', |
| 15 | - sellerDate:'', | ||
| 16 | - region:'', | ||
| 17 | - tableNum:'', | ||
| 18 | - soltName:'', | 16 | + sellerDate: '', |
| 17 | + region: '', | ||
| 18 | + tableNum: '', | ||
| 19 | + soltName: '', | ||
| 19 | }, | 20 | }, |
| 20 | /** | 21 | /** |
| 21 | * 生命周期函数--监听页面加载 | 22 | * 生命周期函数--监听页面加载 |
| @@ -24,7 +25,6 @@ Page({ | @@ -24,7 +25,6 @@ Page({ | ||
| 24 | let obj = JSON.parse(wx.getStorageSync('cookbookObj')); | 25 | let obj = JSON.parse(wx.getStorageSync('cookbookObj')); |
| 25 | let cookbooklist = JSON.parse(wx.getStorageSync('cookbooklist')); | 26 | let cookbooklist = JSON.parse(wx.getStorageSync('cookbooklist')); |
| 26 | this.formatCookList(cookbooklist); | 27 | this.formatCookList(cookbooklist); |
| 27 | - console.log('obj',{...obj}); | ||
| 28 | this.setData({ | 28 | this.setData({ |
| 29 | sellerName: obj.sellerName, | 29 | sellerName: obj.sellerName, |
| 30 | sellerid: obj.sellerid, | 30 | sellerid: obj.sellerid, |
| @@ -33,21 +33,23 @@ Page({ | @@ -33,21 +33,23 @@ Page({ | ||
| 33 | sellerDate: obj.sellerDate, | 33 | sellerDate: obj.sellerDate, |
| 34 | region: obj.region, | 34 | region: obj.region, |
| 35 | tableNum: obj.tableNum, | 35 | tableNum: obj.tableNum, |
| 36 | - soltName:obj.soltName | 36 | + soltName: obj.soltName |
| 37 | }) | 37 | }) |
| 38 | }, | 38 | }, |
| 39 | formatCookList(cookbooklist) { | 39 | formatCookList(cookbooklist) { |
| 40 | let probablyPrice = 0; | 40 | let probablyPrice = 0; |
| 41 | + let vipProbablyPrice = 0; | ||
| 41 | let noData = false; | 42 | let noData = false; |
| 42 | cookbooklist.forEach(items => { | 43 | cookbooklist.forEach(items => { |
| 43 | items.is_show = false | 44 | items.is_show = false |
| 44 | items.normsLen = 0 | 45 | items.normsLen = 0 |
| 45 | items.cookbooklist[0].forEach(item => { | 46 | items.cookbooklist[0].forEach(item => { |
| 46 | - console.log(item.norms); | ||
| 47 | if (item.norms && item.norms.length > 0) { | 47 | if (item.norms && item.norms.length > 0) { |
| 48 | item.norms.forEach(i => { | 48 | item.norms.forEach(i => { |
| 49 | let price = i.quantum * 1 * (i.price * 1); | 49 | let price = i.quantum * 1 * (i.price * 1); |
| 50 | + let vipPrice = i.quantum * 1 * (i.member_price * 1); | ||
| 50 | probablyPrice += price; | 51 | probablyPrice += price; |
| 52 | + vipProbablyPrice += vipPrice; | ||
| 51 | }) | 53 | }) |
| 52 | noData = true | 54 | noData = true |
| 53 | items.is_show = true; //展示不展示 | 55 | items.is_show = true; //展示不展示 |
| @@ -58,6 +60,7 @@ Page({ | @@ -58,6 +60,7 @@ Page({ | ||
| 58 | this.setData({ | 60 | this.setData({ |
| 59 | cookbooklist, | 61 | cookbooklist, |
| 60 | probablyPrice, | 62 | probablyPrice, |
| 63 | + vipProbablyPrice, | ||
| 61 | noData | 64 | noData |
| 62 | }) | 65 | }) |
| 63 | }, | 66 | }, |
| @@ -77,7 +80,7 @@ Page({ | @@ -77,7 +80,7 @@ Page({ | ||
| 77 | sellerDate: this.data.sellerDate, | 80 | sellerDate: this.data.sellerDate, |
| 78 | region: this.data.region, | 81 | region: this.data.region, |
| 79 | tableNum: this.data.tableNum, | 82 | tableNum: this.data.tableNum, |
| 80 | - soltName:this.data.soltName | 83 | + soltName: this.data.soltName |
| 81 | } | 84 | } |
| 82 | wx.setStorageSync('cookbookObj', JSON.stringify(data)) | 85 | wx.setStorageSync('cookbookObj', JSON.stringify(data)) |
| 83 | wx.navigateTo({ | 86 | wx.navigateTo({ |
| @@ -27,8 +27,8 @@ | @@ -27,8 +27,8 @@ | ||
| 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.norms.length>0}}"> | 28 | <block wx:if="{{item.norms.length>0}}"> |
| 29 | <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr"> | 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}} | 30 | + <view class="single">{{item.name}}<text wx:if="{{item.practiceName}}">({{item.practiceName}})</text></view> |
| 31 | + <view class="price">{{item.price}}元/{{item.unitName}}</view> | ||
| 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}} |
| @@ -39,7 +39,10 @@ | @@ -39,7 +39,10 @@ | ||
| 39 | </block> | 39 | </block> |
| 40 | </block> | 40 | </block> |
| 41 | </view> | 41 | </view> |
| 42 | - <view wx:if="{{noData}}" class="probably">预计金额:{{probablyPrice}}元</view> | 42 | + <view wx:if="{{noData}}" class="probably flex-ll"> |
| 43 | + <view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view> | ||
| 44 | + <view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view> | ||
| 45 | + </view> | ||
| 43 | </scroll-view> | 46 | </scroll-view> |
| 44 | <view class="btns flex-cc"> | 47 | <view class="btns flex-cc"> |
| 45 | <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button> | 48 | <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button> |
| @@ -126,4 +126,12 @@ page { | @@ -126,4 +126,12 @@ page { | ||
| 126 | .determine1 { | 126 | .determine1 { |
| 127 | background: #DBDBDB; | 127 | background: #DBDBDB; |
| 128 | color: #BFC4D4; | 128 | color: #BFC4D4; |
| 129 | +} | ||
| 130 | +.probably { | ||
| 131 | + border-top: 2rpx solid #DBDBDB; | ||
| 132 | + font-family: PingFang SC; | ||
| 133 | + padding: 30rpx 40rpx 52rpx 40rpx; | ||
| 134 | +} | ||
| 135 | +.tariff { | ||
| 136 | + width: 50%; | ||
| 129 | } | 137 | } |
| @@ -16,6 +16,8 @@ Page({ | @@ -16,6 +16,8 @@ Page({ | ||
| 16 | check2: '', //规格 | 16 | check2: '', //规格 |
| 17 | check1Name: '', | 17 | check1Name: '', |
| 18 | check2Name: '', | 18 | check2Name: '', |
| 19 | + price:'', | ||
| 20 | + member_price:'', | ||
| 19 | isloading: true, | 21 | isloading: true, |
| 20 | toView: "inToView27", | 22 | toView: "inToView27", |
| 21 | hasEnter: false, | 23 | hasEnter: false, |
| @@ -32,9 +34,9 @@ Page({ | @@ -32,9 +34,9 @@ Page({ | ||
| 32 | checkObj: '', | 34 | checkObj: '', |
| 33 | normsIndex: '', | 35 | normsIndex: '', |
| 34 | assortArr: [], | 36 | assortArr: [], |
| 35 | - themeColor:'', | ||
| 36 | - textColor:'', | ||
| 37 | - navColor:'', | 37 | + themeColor: '', |
| 38 | + textColor: '', | ||
| 39 | + navColor: '', | ||
| 38 | }, | 40 | }, |
| 39 | checkModal: '', | 41 | checkModal: '', |
| 40 | classifyModal: '', | 42 | classifyModal: '', |
| @@ -43,7 +45,7 @@ Page({ | @@ -43,7 +45,7 @@ Page({ | ||
| 43 | * 生命周期函数--监听页面加载 | 45 | * 生命周期函数--监听页面加载 |
| 44 | */ | 46 | */ |
| 45 | onLoad: function (options) { | 47 | onLoad: function (options) { |
| 46 | - console.log('options', options); | 48 | + console.log('options', {...options}); |
| 47 | this.setData({ | 49 | this.setData({ |
| 48 | options: options, | 50 | options: options, |
| 49 | }) | 51 | }) |
| @@ -73,7 +75,6 @@ Page({ | @@ -73,7 +75,6 @@ Page({ | ||
| 73 | tableNum: this.data.options.tableNum, | 75 | tableNum: this.data.options.tableNum, |
| 74 | soltName: this.data.options.soltName, | 76 | soltName: this.data.options.soltName, |
| 75 | } | 77 | } |
| 76 | - console.log('objobjobjobjobj', obj); | ||
| 77 | wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist)) | 78 | wx.setStorageSync('cookbooklist', JSON.stringify(cookbooklist)) |
| 78 | wx.setStorageSync('cookbookObj', JSON.stringify(obj)) | 79 | wx.setStorageSync('cookbookObj', JSON.stringify(obj)) |
| 79 | wx.navigateTo({ | 80 | wx.navigateTo({ |
| @@ -94,12 +95,14 @@ Page({ | @@ -94,12 +95,14 @@ Page({ | ||
| 94 | // 选择规格 | 95 | // 选择规格 |
| 95 | checkSingle2(e) { | 96 | checkSingle2(e) { |
| 96 | const item = e.currentTarget.dataset['item']; | 97 | const item = e.currentTarget.dataset['item']; |
| 97 | - let checkItem = this.data.checkItem | ||
| 98 | - checkItem.check2 = item.id | 98 | + let checkItem = this.data.checkItem; |
| 99 | + checkItem.check2 = item.id; | ||
| 99 | this.setData({ | 100 | this.setData({ |
| 100 | check2: item.id, | 101 | check2: item.id, |
| 101 | check2Name: item.specs, | 102 | check2Name: item.specs, |
| 102 | - checkItem | 103 | + price: item.price, |
| 104 | + member_price: item.member_price, | ||
| 105 | + checkItem, | ||
| 103 | }) | 106 | }) |
| 104 | }, | 107 | }, |
| 105 | // 获取点菜数量 | 108 | // 获取点菜数量 |
| @@ -130,9 +133,9 @@ Page({ | @@ -130,9 +133,9 @@ Page({ | ||
| 130 | determineFun() { | 133 | determineFun() { |
| 131 | let index = this.data.checkObj.index; | 134 | let index = this.data.checkObj.index; |
| 132 | let indexs = this.data.checkObj.indexs; | 135 | let indexs = this.data.checkObj.indexs; |
| 133 | - let price = this.data.checkObj.price; | ||
| 134 | let data = this.data.cookbooklist[indexs].cookbooklist[0][index] | 136 | let data = this.data.cookbooklist[indexs].cookbooklist[0][index] |
| 135 | let isAlike = false; | 137 | let isAlike = false; |
| 138 | + | ||
| 136 | data.norms.forEach(item => { | 139 | data.norms.forEach(item => { |
| 137 | if (this.data.check1 == item.practice && this.data.check2 == item.unit) { | 140 | if (this.data.check1 == item.practice && this.data.check2 == item.unit) { |
| 138 | isAlike = true | 141 | isAlike = true |
| @@ -144,15 +147,15 @@ Page({ | @@ -144,15 +147,15 @@ Page({ | ||
| 144 | cookbooklist: this.data.cookbooklist, | 147 | cookbooklist: this.data.cookbooklist, |
| 145 | }) | 148 | }) |
| 146 | } else { | 149 | } else { |
| 147 | - console.log({...data}); | ||
| 148 | let obj = { | 150 | let obj = { |
| 149 | quantum: 1, | 151 | quantum: 1, |
| 150 | - name:data.name, | 152 | + name: data.name, |
| 151 | practice: this.data.check1 ? this.data.check1 : data.check1, | 153 | practice: this.data.check1 ? this.data.check1 : data.check1, |
| 152 | unit: this.data.check2 ? this.data.check2 : data.check2, | 154 | unit: this.data.check2 ? this.data.check2 : data.check2, |
| 153 | practiceName: this.data.check1Name ? this.data.check1Name : data.check1Name, | 155 | practiceName: this.data.check1Name ? this.data.check1Name : data.check1Name, |
| 154 | unitName: this.data.check2Name ? this.data.check2Name : data.check2Name, | 156 | unitName: this.data.check2Name ? this.data.check2Name : data.check2Name, |
| 155 | - price:price?price:'' | 157 | + price: this.data.price ? this.data.price : data.price, |
| 158 | + member_price: this.data.member_price ? this.data.member_price : data.member_price, | ||
| 156 | } | 159 | } |
| 157 | this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) | 160 | this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) |
| 158 | this.setData({ | 161 | this.setData({ |
| @@ -173,7 +176,8 @@ Page({ | @@ -173,7 +176,8 @@ Page({ | ||
| 173 | checkObj: { | 176 | checkObj: { |
| 174 | indexs, | 177 | indexs, |
| 175 | index, | 178 | index, |
| 176 | - price: item.price | 179 | + price: this.data.price ? this.data.price : '', |
| 180 | + member_price: this.data.member_price ? this.data.member_price : '', | ||
| 177 | }, | 181 | }, |
| 178 | normsIndex, | 182 | normsIndex, |
| 179 | checkItem: item | 183 | checkItem: item |
| @@ -181,14 +185,16 @@ Page({ | @@ -181,14 +185,16 @@ Page({ | ||
| 181 | let norms = this.data.cookbooklist[indexs].cookbooklist[0][index].norms | 185 | let norms = this.data.cookbooklist[indexs].cookbooklist[0][index].norms |
| 182 | let normsNum; | 186 | let normsNum; |
| 183 | // 点击下面的加号并且有规格或者做法的,弹框选规格 下面的直接加 | 187 | // 点击下面的加号并且有规格或者做法的,弹框选规格 下面的直接加 |
| 184 | - if (type == '1' && (item.practice.length > 1 || item.spec.length > 1)) { | 188 | + if (type == '1' && (item.practice.length > 1 || item.specArr.length > 1)) { |
| 185 | this.setData({ | 189 | this.setData({ |
| 186 | check1: item.practice[0].id, | 190 | check1: item.practice[0].id, |
| 187 | - check2: item.spec[0].id, | ||
| 188 | - check1Name:item.practice[0].name, | ||
| 189 | - check2Name:item.spec[0].spec, | 191 | + check2: item.specArr[0].id, |
| 192 | + check1Name: item.practice[0].name, | ||
| 193 | + check2Name: item.specArr[0].spec, | ||
| 194 | + price: item.specArr[0].price, | ||
| 195 | + member_price: item.specArr[0].member_price, | ||
| 190 | }) | 196 | }) |
| 191 | - return this.showModal() | 197 | + return this.showCheckModal() |
| 192 | } else { | 198 | } else { |
| 193 | normsNum = 1; | 199 | normsNum = 1; |
| 194 | let obj = { | 200 | let obj = { |
| @@ -197,8 +203,9 @@ Page({ | @@ -197,8 +203,9 @@ Page({ | ||
| 197 | unit: item.unit, | 203 | unit: item.unit, |
| 198 | practiceName: item.check1Name, | 204 | practiceName: item.check1Name, |
| 199 | unitName: item.check2Name, | 205 | unitName: item.check2Name, |
| 200 | - name:item.name, | ||
| 201 | - price:item.price, | 206 | + name: item.name, |
| 207 | + price: this.data.price ? this.data.price :item.price, | ||
| 208 | + member_price: this.data.member_price ? this.data.member_price : item.member_price, | ||
| 202 | } | 209 | } |
| 203 | if (!normsIndex && norms.length == '0') { | 210 | if (!normsIndex && norms.length == '0') { |
| 204 | this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) | 211 | this.data.cookbooklist[indexs].cookbooklist[0][index].norms.push(obj) |
| @@ -264,6 +271,32 @@ Page({ | @@ -264,6 +271,32 @@ Page({ | ||
| 264 | }, | 271 | }, |
| 265 | // 过滤数据 | 272 | // 过滤数据 |
| 266 | formatCookList(list) { | 273 | formatCookList(list) { |
| 274 | + // 获取所有的规格 | ||
| 275 | + list.forEach(item => { | ||
| 276 | + item.cookbooklist[0].forEach((i, idx) => { | ||
| 277 | + i.specArr = [] | ||
| 278 | + let obj = {} | ||
| 279 | + if (i.spec && i.spec.length > 0) { | ||
| 280 | + i.spec.forEach(single => { | ||
| 281 | + if (single.status == '1') { | ||
| 282 | + obj = { | ||
| 283 | + cid:single.cid, | ||
| 284 | + clear_num:single.clear_num, | ||
| 285 | + id:single.id, | ||
| 286 | + member_price:single.member_price, | ||
| 287 | + price:single.price, | ||
| 288 | + specid:single.specid, | ||
| 289 | + specs:single.specs, | ||
| 290 | + status:single.status, | ||
| 291 | + str: '¥' + single.price + '/' + single.specs, | ||
| 292 | + member_str: single.member_price ? '会员 ¥' + single.member_price + '/' + single.specs : '', | ||
| 293 | + } | ||
| 294 | + i.specArr.push(obj) | ||
| 295 | + } | ||
| 296 | + }) | ||
| 297 | + } | ||
| 298 | + }) | ||
| 299 | + }) | ||
| 267 | //原栏目下显示 | 300 | //原栏目下显示 |
| 268 | let hasShowClass = false; | 301 | let hasShowClass = false; |
| 269 | //菜单中展示沽清的菜品 | 302 | //菜单中展示沽清的菜品 |
| @@ -274,7 +307,7 @@ Page({ | @@ -274,7 +307,7 @@ Page({ | ||
| 274 | let assortArr = []; | 307 | let assortArr = []; |
| 275 | let check1 = ''; | 308 | let check1 = ''; |
| 276 | let check2 = ''; | 309 | let check2 = ''; |
| 277 | - let that=this; | 310 | + let that = this; |
| 278 | if (list.length > 0) { | 311 | if (list.length > 0) { |
| 279 | has10CaiOpen = list[0].status == 1; | 312 | has10CaiOpen = list[0].status == 1; |
| 280 | list.forEach(function (cate, i) { | 313 | list.forEach(function (cate, i) { |
| @@ -305,9 +338,9 @@ Page({ | @@ -305,9 +338,9 @@ Page({ | ||
| 305 | cook.item_clear_num = cook.clear_num; | 338 | cook.item_clear_num = cook.clear_num; |
| 306 | if (!hasClearCookbook) { //不显示卖光了 | 339 | if (!hasClearCookbook) { //不显示卖光了 |
| 307 | let item_clear_num = cook.clear_num; | 340 | let item_clear_num = cook.clear_num; |
| 308 | - if (cook.spec) { | 341 | + if (cook.specArr) { |
| 309 | let clear_num = null; | 342 | let clear_num = null; |
| 310 | - cook.spec.forEach(spec => { | 343 | + cook.specArr.forEach(spec => { |
| 311 | if (spec.clear_num == 0) { | 344 | if (spec.clear_num == 0) { |
| 312 | clear_num = 0; | 345 | clear_num = 0; |
| 313 | } else { | 346 | } else { |
| @@ -324,14 +357,16 @@ Page({ | @@ -324,14 +357,16 @@ Page({ | ||
| 324 | cook.norms = []; //做法规格 | 357 | cook.norms = []; //做法规格 |
| 325 | } | 358 | } |
| 326 | cook.type = '1'; | 359 | cook.type = '1'; |
| 327 | - let cook_style = cook.cook_style?that.determine(cook.cook_style):'';//判断是不是json,是json在转换为对象 | 360 | + let cook_style = cook.cook_style ? util.determine(cook.cook_style) : ''; //判断是不是json,是json在转换为对象 |
| 328 | cook.cook_style = cook_style; | 361 | cook.cook_style = cook_style; |
| 329 | cook.image_type = cook_style && cook_style.image_type ? cook_style.image_type : '1'; //1大图,2小图 默认大图 | 362 | 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顶部分开 默认分开 | 363 | 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 : ''; | 364 | cook.check1 = cook.practice.length > 0 ? cook.practice[0].id : ''; |
| 332 | - cook.check2 = cook.spec.length > 0 ? cook.spec[0].id : ''; | 365 | + cook.check2 = cook.specArr.length > 0 ? cook.specArr[0].id : ''; |
| 333 | cook.check1Name = cook.practice.length > 0 ? cook.practice[0].name : ''; | 366 | cook.check1Name = cook.practice.length > 0 ? cook.practice[0].name : ''; |
| 334 | - cook.check2Name = cook.spec.length > 0 ? cook.spec[0].specs : ''; | 367 | + cook.check2Name = cook.specArr.length > 0 ? cook.specArr[0].specs : ''; |
| 368 | + cook.price = cook.specArr.length > 0 ? cook.specArr[0].price : ''; | ||
| 369 | + cook.member_price = cook.specArr.length > 0 ? cook.specArr[0].member_price : ''; | ||
| 335 | if (item_clear_num == 0) { | 370 | if (item_clear_num == 0) { |
| 336 | flag = false; | 371 | flag = false; |
| 337 | } | 372 | } |
| @@ -359,11 +394,16 @@ Page({ | @@ -359,11 +394,16 @@ Page({ | ||
| 359 | }) | 394 | }) |
| 360 | sortArr.push(item) | 395 | sortArr.push(item) |
| 361 | }) | 396 | }) |
| 362 | - // 大小图设置边框 | 397 | + |
| 363 | let image_typeArr = []; | 398 | let image_typeArr = []; |
| 399 | + // 大小图设置边框 | ||
| 364 | sortArr.forEach(item => { | 400 | sortArr.forEach(item => { |
| 365 | let num = 0; | 401 | let num = 0; |
| 366 | item.cookbooklist[0].forEach((i, idx) => { | 402 | item.cookbooklist[0].forEach((i, idx) => { |
| 403 | + if (i.image_type == '1') { | ||
| 404 | + i.index = 0 | ||
| 405 | + num = 0 | ||
| 406 | + } | ||
| 367 | if (i.image_type == '2') { | 407 | if (i.image_type == '2') { |
| 368 | num++ | 408 | num++ |
| 369 | i.index = num; | 409 | i.index = num; |
| @@ -379,35 +419,15 @@ Page({ | @@ -379,35 +419,15 @@ Page({ | ||
| 379 | let s = i.index * 1 + 1; | 419 | let s = i.index * 1 + 1; |
| 380 | item.cookbooklist[0].splice(idx + 1, 0, { | 420 | item.cookbooklist[0].splice(idx + 1, 0, { |
| 381 | index: s, | 421 | index: s, |
| 382 | - boderNone: true | 422 | + boderNone: true, |
| 423 | + image_type: '2', | ||
| 383 | }) | 424 | }) |
| 384 | } | 425 | } |
| 385 | } | 426 | } |
| 386 | - } else if (i.image_type == '1') { | ||
| 387 | - i.index = 0 | ||
| 388 | - num = 0 | ||
| 389 | } | 427 | } |
| 390 | }) | 428 | }) |
| 391 | image_typeArr.push(item) | 429 | image_typeArr.push(item) |
| 392 | }) | 430 | }) |
| 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 | - | ||
| 411 | setTimeout(() => { | 431 | setTimeout(() => { |
| 412 | this.setData({ | 432 | this.setData({ |
| 413 | check1, | 433 | check1, |
| @@ -415,20 +435,8 @@ Page({ | @@ -415,20 +435,8 @@ Page({ | ||
| 415 | assortArr | 435 | assortArr |
| 416 | }) | 436 | }) |
| 417 | }, 1); | 437 | }, 1); |
| 418 | - console.log(image_typeArr); | ||
| 419 | return image_typeArr; | 438 | return image_typeArr; |
| 420 | }, | 439 | }, |
| 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 | - }, | ||
| 432 | // 获取所有分类下所有菜品列表 | 440 | // 获取所有分类下所有菜品列表 |
| 433 | getCookList() { | 441 | getCookList() { |
| 434 | let cookbooklist = wx.getStorageSync('cookbooklist'); | 442 | let cookbooklist = wx.getStorageSync('cookbooklist'); |
| @@ -463,31 +471,38 @@ Page({ | @@ -463,31 +471,38 @@ Page({ | ||
| 463 | } | 471 | } |
| 464 | this.GetDzSellerConfFun() | 472 | this.GetDzSellerConfFun() |
| 465 | }, | 473 | }, |
| 474 | + // 获取主题色 | ||
| 466 | GetDzSellerConfFun() { | 475 | GetDzSellerConfFun() { |
| 467 | App.Seller.GetDzSellerConf({ | 476 | App.Seller.GetDzSellerConf({ |
| 468 | sid: this.data.options.sid | 477 | sid: this.data.options.sid |
| 469 | }).then(res => { | 478 | }).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' | 479 | + let themeColor, textColor, navColor; |
| 480 | + if (res.data.cook_style) { | ||
| 481 | + let style = util.determine(res.data.cook_style) | ||
| 482 | + if (style && style.red && style.green && style.blue && style.alpha) { | ||
| 483 | + themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha) | ||
| 484 | + } else { | ||
| 485 | + themeColor = '77,78,80,1'; //未设置 为灰色 | ||
| 477 | } | 486 | } |
| 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" | 487 | + if (themeColor == '251,246,241,1') { |
| 488 | + textColor = "81,81,81,1" | ||
| 489 | + navColor = "81,81,81,1" | ||
| 490 | + } else { | ||
| 491 | + navColor = "255,255,255,1" | ||
| 483 | } | 492 | } |
| 484 | this.setData({ | 493 | this.setData({ |
| 485 | themeColor, | 494 | themeColor, |
| 486 | textColor, | 495 | textColor, |
| 487 | navColor | 496 | navColor |
| 488 | }) | 497 | }) |
| 489 | - console.log(themeColor); | ||
| 490 | } | 498 | } |
| 499 | + }).catch(res => { | ||
| 500 | + themeColor = '77,78,80,1'; | ||
| 501 | + navColor = "255,255,255,1" | ||
| 502 | + this.setData({ | ||
| 503 | + themeColor, | ||
| 504 | + navColor | ||
| 505 | + }) | ||
| 491 | }) | 506 | }) |
| 492 | }, | 507 | }, |
| 493 | /** | 508 | /** |
| @@ -510,7 +525,7 @@ Page({ | @@ -510,7 +525,7 @@ Page({ | ||
| 510 | } | 525 | } |
| 511 | }, | 526 | }, |
| 512 | // 展示做法规格弹窗 | 527 | // 展示做法规格弹窗 |
| 513 | - showModal() { | 528 | + showCheckModal() { |
| 514 | this.checkModal.showModal() | 529 | this.checkModal.showModal() |
| 515 | }, | 530 | }, |
| 516 | // 关闭做法规格弹窗 | 531 | // 关闭做法规格弹窗 |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | <view class="round"></view> | 10 | <view class="round"></view> |
| 11 | <view class="line"></view> | 11 | <view class="line"></view> |
| 12 | </view> | 12 | </view> |
| 13 | - <view class="title">{{item.class_name}}</view> | 13 | + <view class="title" style="color:rgba({{navColor}})">{{item.class_name}}</view> |
| 14 | <view class="style_round flex-vc flex-cc"> | 14 | <view class="style_round flex-vc flex-cc"> |
| 15 | <view class="line"></view> | 15 | <view class="line"></view> |
| 16 | <view class="round"></view> | 16 | <view class="round"></view> |
| @@ -19,23 +19,52 @@ | @@ -19,23 +19,52 @@ | ||
| 19 | </block> | 19 | </block> |
| 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}}"> | ||
| 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}} | 22 | + <view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.index}}" data-nameType="{{item.name_type}}"> |
| 23 | + <block wx:if="{{item.name_type!='3'}}"> | ||
| 24 | + <view class="dishItem {{item.name_type=='2'?'typeB':''}}"> | ||
| 25 | + <view class="dishLeft dishTexts" style="color:rgba({{textColor}})"> | ||
| 26 | + {{item.name}} | ||
| 27 | + </view> | ||
| 28 | + <view class="dishTexts dishRight" style="color:rgba({{textColor}})"> | ||
| 29 | + <text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text> | ||
| 30 | + <text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text> | ||
| 31 | + </view> | ||
| 26 | </view> | 32 | </view> |
| 27 | - <view wx:if="{{item.taste}}" class="dishTexts dishRight" style="color:rgba({{textColor}})"> | ||
| 28 | - 味型:{{item.taste}} | 33 | + <view wx:if="{{item.specArr.length>0}}" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})"> |
| 34 | + <view wx:for="{{item.specArr}}"> | ||
| 35 | + {{item.str}} | ||
| 36 | + {{item.member_str}} | ||
| 37 | + </view> | ||
| 38 | + </view> | ||
| 39 | + <view wx:else class="norms {{item.name_type=='2'?'normsB':''}}"> | ||
| 40 | + {{'¥'+item.price+'/'+item.unit}} | ||
| 41 | + {{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}} | ||
| 42 | + </view> | ||
| 43 | + </block> | ||
| 44 | + <view wx:else class="names"> | ||
| 45 | + <view class="dishItem flex-lr"> | ||
| 46 | + <view class="dishLeft dishTexts" style="color:rgba({{textColor}})"> | ||
| 47 | + {{item.name}} | ||
| 48 | + </view> | ||
| 49 | + <view wx:if="{{item.specArr.length>0}}" style="color:rgba({{textColor}})" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})"> | ||
| 50 | + <view wx:for="{{item.specArr}}"> | ||
| 51 | + {{item.str}} | ||
| 52 | + {{item.member_str}} | ||
| 53 | + </view> | ||
| 54 | + </view> | ||
| 55 | + <view wx:else class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{textColor}})"> | ||
| 56 | + {{'¥'+item.price+'/'+item.unit}} | ||
| 57 | + {{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}} | ||
| 58 | + </view> | ||
| 59 | + </view> | ||
| 60 | + <view class="dishTexts dishRight bottom" style="color:rgba({{textColor}})"> | ||
| 61 | + <text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text> | ||
| 62 | + <text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text> | ||
| 29 | </view> | 63 | </view> |
| 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> | 64 | </view> |
| 36 | <image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" /> | 65 | <image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" /> |
| 37 | - <view class="greens"> | ||
| 38 | - <view class="news" style="color:rgba({{textColor}})">{{item.first_name}}</view> | 66 | + <view class="greens" wx:if="{{item.desc}}"> |
| 67 | + <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view> | ||
| 39 | </view> | 68 | </view> |
| 40 | <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> | 69 | <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> |
| 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}}" /> | 70 | <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 @@ | @@ -47,15 +76,31 @@ | ||
| 47 | </view> | 76 | </view> |
| 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}}" /> | 77 | <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}}" /> |
| 49 | </view> | 78 | </view> |
| 50 | - <view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox"> | 79 | + <view wx:if="{{(item.specArr.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox"> |
| 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}}" /> | 80 | <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}}" /> |
| 52 | </view> | 81 | </view> |
| 53 | </view> | 82 | </view> |
| 54 | - <view wx:else class="twoBox" data-idx="{{item.index}}"> | 83 | + <view wx:else class="twoBox" data-idx="{{item.index}}" data-nameType="{{item.name_type}}"> |
| 55 | <view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}"> | 84 | <view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}"> |
| 56 | <view class="twoTitle" style="color:rgba({{textColor}})">{{item.name}}</view> | 85 | <view class="twoTitle" style="color:rgba({{textColor}})">{{item.name}}</view> |
| 57 | - <view class="twoInfo">{{item.info}}{{item.vip}}</view>{{item.quantum}} | 86 | + <view class="twoInfo dishTexts" wx:if="{{item.taste}}"> |
| 87 | + <text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text> | ||
| 88 | + <text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text> | ||
| 89 | + </view> | ||
| 90 | + <view wx:if="{{item.specArr.length>0}}" class="twoInfo twoSingle" style="color:rgba({{textColor}})"> | ||
| 91 | + <view wx:for="{{item.specArr}}"> | ||
| 92 | + {{item.str}} | ||
| 93 | + {{item.member_str}} | ||
| 94 | + </view> | ||
| 95 | + </view> | ||
| 96 | + <view wx:else class="twoInfo twoSingle"> | ||
| 97 | + {{item.price?'¥'+item.price+'/'+item.unit:''}} | ||
| 98 | + {{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}} | ||
| 99 | + </view> | ||
| 58 | <image src="{{item.image}}" mode="aspectFill" /> | 100 | <image src="{{item.image}}" mode="aspectFill" /> |
| 101 | + <view class="greens" wx:if="{{item.desc}}"> | ||
| 102 | + <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view> | ||
| 103 | + </view> | ||
| 59 | <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> | 104 | <view wx:for="{{item.norms}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> |
| 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}}" /> | 105 | <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}}" /> |
| 61 | <view class="box flex-cc"> | 106 | <view class="box flex-cc"> |
| @@ -105,7 +150,7 @@ | @@ -105,7 +150,7 @@ | ||
| 105 | <view class="checkLine"></view> | 150 | <view class="checkLine"></view> |
| 106 | <view class="textSty">规格</view> | 151 | <view class="textSty">规格</view> |
| 107 | <view class="itemBox"> | 152 | <view class="itemBox"> |
| 108 | - <view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.spec}}" data-item="{{item}}"> | 153 | + <view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.specArr}}" data-item="{{item}}"> |
| 109 | {{item.specs}}</view> | 154 | {{item.specs}}</view> |
| 110 | </view> | 155 | </view> |
| 111 | </scroll-view> | 156 | </scroll-view> |
| @@ -118,8 +163,10 @@ | @@ -118,8 +163,10 @@ | ||
| 118 | <my-modal id="classifyModal" fadeStyle="slideDown" height="100%"> | 163 | <my-modal id="classifyModal" fadeStyle="slideDown" height="100%"> |
| 119 | <view slot="modalContent" class="assortModel"> | 164 | <view slot="modalContent" class="assortModel"> |
| 120 | <scroll-view scroll-y="true" style="height: 70%;"> | 165 | <scroll-view scroll-y="true" style="height: 70%;"> |
| 121 | - <view wx:for="{{assortArr}}" class="assortItem font48r {{toView==('inToView'+item.id)?'underline':''}}" data-item="{{item}}" bindtap="checkItem"> | ||
| 122 | - {{item.class_name}} | 166 | + <view class="boxs"> |
| 167 | + <view wx:for="{{assortArr}}" class="assortItem font48r {{toView==('inToView'+item.id)?'underline':''}}" data-item="{{item}}" bindtap="checkItem"> | ||
| 168 | + {{item.class_name}} | ||
| 169 | + </view> | ||
| 123 | </view> | 170 | </view> |
| 124 | </scroll-view> | 171 | </scroll-view> |
| 125 | <image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode="" /> | 172 | <image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode="" /> |
| @@ -8,9 +8,11 @@ page { | @@ -8,9 +8,11 @@ page { | ||
| 8 | overflow-x: hidden; | 8 | overflow-x: hidden; |
| 9 | box-sizing: border-box; | 9 | box-sizing: border-box; |
| 10 | } | 10 | } |
| 11 | + | ||
| 11 | .dishItem { | 12 | .dishItem { |
| 12 | padding: 0 0 30rpx 0; | 13 | padding: 0 0 30rpx 0; |
| 13 | } | 14 | } |
| 15 | + | ||
| 14 | .wrapIine { | 16 | .wrapIine { |
| 15 | height: 4rpx; | 17 | height: 4rpx; |
| 16 | width: 100%; | 18 | width: 100%; |
| @@ -19,6 +21,7 @@ page { | @@ -19,6 +21,7 @@ page { | ||
| 19 | 21 | ||
| 20 | .heand { | 22 | .heand { |
| 21 | width: 100%; | 23 | width: 100%; |
| 24 | + border-top: 4rpx solid #dbdbdb; | ||
| 22 | } | 25 | } |
| 23 | 26 | ||
| 24 | .heand .style_round { | 27 | .heand .style_round { |
| @@ -42,14 +45,17 @@ page { | @@ -42,14 +45,17 @@ page { | ||
| 42 | flex-wrap: wrap; | 45 | flex-wrap: wrap; |
| 43 | color: #fff; | 46 | color: #fff; |
| 44 | } | 47 | } |
| 45 | -.dishWrap:nth-last-of-type(1){ | 48 | + |
| 49 | +.dishWrap:nth-last-of-type(1) { | ||
| 46 | padding-bottom: 200rpx; | 50 | padding-bottom: 200rpx; |
| 47 | } | 51 | } |
| 48 | -.oneBox{ | 52 | + |
| 53 | +.oneBox { | ||
| 49 | width: 100%; | 54 | width: 100%; |
| 50 | padding-top: 40rpx; | 55 | padding-top: 40rpx; |
| 51 | border-top: 4rpx solid #dbdbdb; | 56 | border-top: 4rpx solid #dbdbdb; |
| 52 | } | 57 | } |
| 58 | + | ||
| 53 | .dishTexts { | 59 | .dishTexts { |
| 54 | padding: 20rpx 40rpx 0 40rpx; | 60 | padding: 20rpx 40rpx 0 40rpx; |
| 55 | color: #000; | 61 | color: #000; |
| @@ -59,7 +65,12 @@ page { | @@ -59,7 +65,12 @@ page { | ||
| 59 | -webkit-text-stroke: 1rpx #fff; | 65 | -webkit-text-stroke: 1rpx #fff; |
| 60 | } | 66 | } |
| 61 | 67 | ||
| 68 | +.dishTexts .texts { | ||
| 69 | + margin-right: 30rpx; | ||
| 70 | +} | ||
| 71 | + | ||
| 62 | .dishRight { | 72 | .dishRight { |
| 73 | + width: 40%; | ||
| 63 | font-family: PingFang SC; | 74 | font-family: PingFang SC; |
| 64 | font-weight: 500; | 75 | font-weight: 500; |
| 65 | font-size: 28rpx; | 76 | font-size: 28rpx; |
| @@ -90,15 +101,20 @@ page { | @@ -90,15 +101,20 @@ page { | ||
| 90 | height: 60rpx; | 101 | height: 60rpx; |
| 91 | padding-bottom: 58rpx; | 102 | padding-bottom: 58rpx; |
| 92 | } | 103 | } |
| 93 | -.oneBox .imgbox{ | 104 | + |
| 105 | +.oneBox .imgbox { | ||
| 94 | margin-right: 80rpx; | 106 | margin-right: 80rpx; |
| 107 | + margin-top: 20rpx; | ||
| 95 | } | 108 | } |
| 96 | -.twoItem .algorithmImg{ | 109 | + |
| 110 | +.twoItem .algorithmImg { | ||
| 97 | padding-top: 20rpx; | 111 | padding-top: 20rpx; |
| 98 | } | 112 | } |
| 99 | -.twoItem .imgbox{ | 113 | + |
| 114 | +.twoItem .imgbox { | ||
| 100 | margin-right: 20rpx; | 115 | margin-right: 20rpx; |
| 101 | } | 116 | } |
| 117 | + | ||
| 102 | .algorithmImg .imgs { | 118 | .algorithmImg .imgs { |
| 103 | width: 60rpx; | 119 | width: 60rpx; |
| 104 | height: 100%; | 120 | height: 100%; |
| @@ -108,7 +124,7 @@ page { | @@ -108,7 +124,7 @@ page { | ||
| 108 | padding: 20rpx 20rpx 58rpx 20rpx; | 124 | padding: 20rpx 20rpx 58rpx 20rpx; |
| 109 | } | 125 | } |
| 110 | 126 | ||
| 111 | -.oneBox .calculate{ | 127 | +.oneBox .calculate { |
| 112 | padding-right: 80rpx; | 128 | padding-right: 80rpx; |
| 113 | } | 129 | } |
| 114 | 130 | ||
| @@ -125,10 +141,12 @@ page { | @@ -125,10 +141,12 @@ page { | ||
| 125 | font-size: 80rpx; | 141 | font-size: 80rpx; |
| 126 | -webkit-text-stroke: 1rpx #fff; | 142 | -webkit-text-stroke: 1rpx #fff; |
| 127 | } | 143 | } |
| 128 | -.practice{ | 144 | + |
| 145 | +.practice { | ||
| 129 | font-family: PingFang SC; | 146 | font-family: PingFang SC; |
| 130 | padding-right: 10rpx; | 147 | padding-right: 10rpx; |
| 131 | } | 148 | } |
| 149 | + | ||
| 132 | .num view { | 150 | .num view { |
| 133 | color: #dbdbdb; | 151 | color: #dbdbdb; |
| 134 | font-family: PingFang SC; | 152 | font-family: PingFang SC; |
| @@ -143,11 +161,12 @@ page { | @@ -143,11 +161,12 @@ page { | ||
| 143 | border-right: 4rpx solid #dbdbdb; | 161 | border-right: 4rpx solid #dbdbdb; |
| 144 | } | 162 | } |
| 145 | 163 | ||
| 146 | -.borderNone{ | 164 | +.borderNone { |
| 147 | border-right: none; | 165 | border-right: none; |
| 148 | } | 166 | } |
| 167 | + | ||
| 149 | .twoTitle { | 168 | .twoTitle { |
| 150 | - padding: 30rpx 0 10rpx 20rpx; | 169 | + padding: 30rpx 0 30rpx 10rpx; |
| 151 | color: #000; | 170 | color: #000; |
| 152 | font-family: PingFang SC; | 171 | font-family: PingFang SC; |
| 153 | font-weight: 500; | 172 | font-weight: 500; |
| @@ -155,12 +174,18 @@ page { | @@ -155,12 +174,18 @@ page { | ||
| 155 | -webkit-text-stroke: 1rpx #fff; | 174 | -webkit-text-stroke: 1rpx #fff; |
| 156 | } | 175 | } |
| 157 | 176 | ||
| 177 | +.twoSingle, | ||
| 178 | +.norms { | ||
| 179 | + display: flex; | ||
| 180 | + flex-direction: column; | ||
| 181 | +} | ||
| 182 | + | ||
| 158 | .twoInfo { | 183 | .twoInfo { |
| 159 | color: #000; | 184 | color: #000; |
| 160 | font-family: PingFang SC; | 185 | font-family: PingFang SC; |
| 161 | font-weight: 500; | 186 | font-weight: 500; |
| 162 | font-size: 24rpx; | 187 | font-size: 24rpx; |
| 163 | - padding: 0 0 30rpx 20rpx; | 188 | + padding: 0 10rpx 20rpx 10rpx; |
| 164 | -webkit-text-stroke: 1rpx #fff; | 189 | -webkit-text-stroke: 1rpx #fff; |
| 165 | } | 190 | } |
| 166 | 191 | ||
| @@ -178,7 +203,7 @@ page { | @@ -178,7 +203,7 @@ page { | ||
| 178 | 203 | ||
| 179 | .twoBox { | 204 | .twoBox { |
| 180 | width: 50%; | 205 | width: 50%; |
| 181 | - border-top:4rpx solid #dbdbdb; | 206 | + border-top: 4rpx solid #dbdbdb; |
| 182 | display: flex; | 207 | display: flex; |
| 183 | flex-direction: row; | 208 | flex-direction: row; |
| 184 | flex-wrap: wrap; | 209 | flex-wrap: wrap; |
| @@ -209,7 +234,7 @@ page { | @@ -209,7 +234,7 @@ page { | ||
| 209 | height: 36rpx; | 234 | height: 36rpx; |
| 210 | } | 235 | } |
| 211 | 236 | ||
| 212 | -.fixedBox .right{ | 237 | +.fixedBox .right { |
| 213 | padding: 0 20rpx; | 238 | padding: 0 20rpx; |
| 214 | } | 239 | } |
| 215 | 240 | ||
| @@ -218,11 +243,11 @@ page { | @@ -218,11 +243,11 @@ page { | ||
| 218 | height: 50rpx; | 243 | height: 50rpx; |
| 219 | } | 244 | } |
| 220 | 245 | ||
| 221 | -.fixedBox .right .rightBox{ | 246 | +.fixedBox .right .rightBox { |
| 222 | position: relative; | 247 | position: relative; |
| 223 | } | 248 | } |
| 224 | 249 | ||
| 225 | -.fixedBox .right .num{ | 250 | +.fixedBox .right .num { |
| 226 | position: absolute; | 251 | position: absolute; |
| 227 | right: -20%; | 252 | right: -20%; |
| 228 | top: 0; | 253 | top: 0; |
| @@ -251,6 +276,32 @@ page { | @@ -251,6 +276,32 @@ page { | ||
| 251 | flex-direction: column; | 276 | flex-direction: column; |
| 252 | } | 277 | } |
| 253 | 278 | ||
| 279 | +.typeB .dishRight { | ||
| 280 | + width: auto; | ||
| 281 | +} | ||
| 282 | + | ||
| 283 | +.names .dishRight { | ||
| 284 | + width: 100%; | ||
| 285 | + box-sizing: border-box; | ||
| 286 | + padding: 0 40rpx 0 40rpx; | ||
| 287 | +} | ||
| 288 | + | ||
| 289 | +.names .dishTexts { | ||
| 290 | + width: auto; | ||
| 291 | + box-sizing: border-box; | ||
| 292 | + padding: 0 40rpx 0 40rpx; | ||
| 293 | +} | ||
| 294 | + | ||
| 295 | +.names .bottom { | ||
| 296 | + padding-bottom: 20rpx; | ||
| 297 | +} | ||
| 298 | + | ||
| 299 | +.names .norms { | ||
| 300 | + padding-bottom: 0; | ||
| 301 | + width: 40%; | ||
| 302 | + text-align: right; | ||
| 303 | +} | ||
| 304 | + | ||
| 254 | .normsB { | 305 | .normsB { |
| 255 | text-align: right; | 306 | text-align: right; |
| 256 | } | 307 | } |
| @@ -299,6 +350,7 @@ page { | @@ -299,6 +350,7 @@ page { | ||
| 299 | color: #E34D59; | 350 | color: #E34D59; |
| 300 | border: 2rpx solid #E34D59; | 351 | border: 2rpx solid #E34D59; |
| 301 | } | 352 | } |
| 353 | + | ||
| 302 | .style_round .line { | 354 | .style_round .line { |
| 303 | width: 100rpx; | 355 | width: 100rpx; |
| 304 | height: 2rpx; | 356 | height: 2rpx; |
| @@ -376,6 +428,13 @@ page { | @@ -376,6 +428,13 @@ page { | ||
| 376 | width: 100rpx; | 428 | width: 100rpx; |
| 377 | height: 100rpx; | 429 | height: 100rpx; |
| 378 | } | 430 | } |
| 379 | -.determine{ | 431 | + |
| 432 | +.determine { | ||
| 380 | color: #E34D59; | 433 | color: #E34D59; |
| 381 | } | 434 | } |
| 435 | +.boxs{ | ||
| 436 | + height: 100%; | ||
| 437 | + display: flex; | ||
| 438 | + justify-content: center; | ||
| 439 | + flex-direction: column; | ||
| 440 | +} |
| @@ -10,6 +10,7 @@ Page({ | @@ -10,6 +10,7 @@ Page({ | ||
| 10 | sellerName: '', | 10 | sellerName: '', |
| 11 | sellerid: '', | 11 | sellerid: '', |
| 12 | probablyPrice: '', | 12 | probablyPrice: '', |
| 13 | + vipProbablyPrice:'', | ||
| 13 | discount: '', | 14 | discount: '', |
| 14 | stringifyUse: '', | 15 | stringifyUse: '', |
| 15 | priceInfo: '', | 16 | priceInfo: '', |
| @@ -49,13 +50,14 @@ Page({ | @@ -49,13 +50,14 @@ Page({ | ||
| 49 | }, | 50 | }, |
| 50 | formatCookList(cookbooklist){ | 51 | formatCookList(cookbooklist){ |
| 51 | let probablyPrice = 0; | 52 | let probablyPrice = 0; |
| 53 | + let vipProbablyPrice = 0; | ||
| 52 | let noData = false; | 54 | let noData = false; |
| 53 | cookbooklist.forEach(items => { | 55 | cookbooklist.forEach(items => { |
| 54 | items.is_show = false | 56 | items.is_show = false |
| 55 | items.normsLen=0 | 57 | items.normsLen=0 |
| 56 | items.cookbooklist[0].forEach(item => { | 58 | items.cookbooklist[0].forEach(item => { |
| 57 | item.arr=[];//arr 点菜的菜品列表 | 59 | item.arr=[];//arr 点菜的菜品列表 |
| 58 | - if (item.norms.length>0) { | 60 | + if (item.norms && item.norms.length>0) { |
| 59 | item.norms.forEach(i => { | 61 | item.norms.forEach(i => { |
| 60 | let obj={ | 62 | let obj={ |
| 61 | name:item.name, | 63 | name:item.name, |
| @@ -66,7 +68,9 @@ Page({ | @@ -66,7 +68,9 @@ Page({ | ||
| 66 | } | 68 | } |
| 67 | item.arr.push(obj) | 69 | item.arr.push(obj) |
| 68 | let price = i.quantum * 1 * (i.price * 1); | 70 | let price = i.quantum * 1 * (i.price * 1); |
| 71 | + let vipPrice = i.quantum * 1 * (i.member_price * 1); | ||
| 69 | probablyPrice += price; | 72 | probablyPrice += price; |
| 73 | + vipProbablyPrice += vipPrice; | ||
| 70 | }) | 74 | }) |
| 71 | noData = true | 75 | noData = true |
| 72 | items.is_show = true;//展示不展示 | 76 | items.is_show = true;//展示不展示 |
| @@ -78,6 +82,7 @@ Page({ | @@ -78,6 +82,7 @@ Page({ | ||
| 78 | this.setData({ | 82 | this.setData({ |
| 79 | cookbooklist, | 83 | cookbooklist, |
| 80 | probablyPrice, | 84 | probablyPrice, |
| 85 | + vipProbablyPrice, | ||
| 81 | noData | 86 | noData |
| 82 | }) | 87 | }) |
| 83 | }, | 88 | }, |
| @@ -92,7 +97,8 @@ Page({ | @@ -92,7 +97,8 @@ Page({ | ||
| 92 | let url=util.http_build_query({ | 97 | let url=util.http_build_query({ |
| 93 | sellerName:this.data.sellerName, | 98 | sellerName:this.data.sellerName, |
| 94 | sellerid:this.data.sellerid, | 99 | sellerid:this.data.sellerid, |
| 95 | - oid:this.data.oid | 100 | + oid:this.data.oid, |
| 101 | + types:'2', | ||
| 96 | },'/pack-cookbook/pages/favourableList') | 102 | },'/pack-cookbook/pages/favourableList') |
| 97 | console.log(url); | 103 | console.log(url); |
| 98 | wx.navigateTo({ | 104 | wx.navigateTo({ |
| @@ -38,8 +38,8 @@ | @@ -38,8 +38,8 @@ | ||
| 38 | </block> | 38 | </block> |
| 39 | </block> | 39 | </block> |
| 40 | <view class="probably flex-ll"> | 40 | <view class="probably flex-ll"> |
| 41 | - <view class="tariff font24r">预计金额:<text class="font32r">{{probablyPrice}}</text>元</view> | ||
| 42 | - <view class="tariff font24r">会员价:<text class="font32r">{{probablyPrice}}</text>元</view> | 41 | + <view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view> |
| 42 | + <view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view> | ||
| 43 | </view> | 43 | </view> |
| 44 | <view class="information font36r">特别优惠</view> | 44 | <view class="information font36r">特别优惠</view> |
| 45 | <view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view> | 45 | <view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view> |
-
Please register or login to post a comment