Showing
12 changed files
with
1091 additions
and
440 deletions
| 1 | // pack-cookbook/pages/cart_new.js | 1 | // pack-cookbook/pages/cart_new.js |
| 2 | Page({ | 2 | Page({ |
| 3 | - | ||
| 4 | /** | 3 | /** |
| 5 | * 页面的初始数据 | 4 | * 页面的初始数据 |
| 6 | */ | 5 | */ |
| 7 | data: { | 6 | data: { |
| 8 | - options:{}, | 7 | + checkList: [], |
| 8 | + sellerName: '', | ||
| 9 | + probablyPrice: '', | ||
| 10 | + sellerid: '', | ||
| 9 | }, | 11 | }, |
| 10 | - | ||
| 11 | /** | 12 | /** |
| 12 | * 生命周期函数--监听页面加载 | 13 | * 生命周期函数--监听页面加载 |
| 13 | */ | 14 | */ |
| 14 | onLoad(options) { | 15 | onLoad(options) { |
| 15 | console.log(options); | 16 | console.log(options); |
| 16 | this.setData({ | 17 | this.setData({ |
| 17 | - options: options, | 18 | + checkList: JSON.parse(options.arr), |
| 19 | + sellerName: options.sellerName, | ||
| 20 | + sellerid: options.sellerid | ||
| 21 | + }) | ||
| 22 | + console.log(this.data.checkList); | ||
| 23 | + let probablyPrice = 0; | ||
| 24 | + this.data.checkList.forEach(items => { | ||
| 25 | + items.arr.forEach(item => { | ||
| 26 | + let price = item.quantum * 1 * (item.price * 1) | ||
| 27 | + probablyPrice += price | ||
| 28 | + }) | ||
| 29 | + }) | ||
| 30 | + this.setData({ | ||
| 31 | + probablyPrice | ||
| 32 | + }) | ||
| 33 | + }, | ||
| 34 | + determineFun() { | ||
| 35 | + console.log('sellerid', this.data.sellerid); | ||
| 36 | + wx.navigateTo({ | ||
| 37 | + url: `/pack-cookbook/pages/success_new?arr=${JSON.stringify(this.data.checkList)}&sellerName=${this.data.sellerName}&sellerid=${this.data.sellerid}`, | ||
| 18 | }) | 38 | }) |
| 19 | }, | 39 | }, |
| 20 | - | ||
| 21 | /** | 40 | /** |
| 22 | * 生命周期函数--监听页面初次渲染完成 | 41 | * 生命周期函数--监听页面初次渲染完成 |
| 23 | */ | 42 | */ |
| 1 | <!--pack-cookbook/pages/cart_new.wxml--> | 1 | <!--pack-cookbook/pages/cart_new.wxml--> |
| 2 | -<nav backgroundColor="#4d4e50" color="#fff">{{options.sellerName||'提交订单'}}</nav> | 2 | +<nav backgroundColor="#4d4e50" color="#fff">{{sellerName||'提交订单'}}</nav> |
| 3 | +<scroll-view class="main"> | ||
| 4 | + <view class="info flex-lr"> | ||
| 5 | + <view class="texts font28r">就餐时间:</view> | ||
| 6 | + <view class="texts_right font28r">2023年4月18日 午餐</view> | ||
| 7 | + </view> | ||
| 8 | + <view class="info flex-lr"> | ||
| 9 | + <view class="texts font28r">桌位台号:</view> | ||
| 10 | + <view class="texts_right font28r">二楼包间 南京</view> | ||
| 11 | + </view> | ||
| 12 | + <view class="info flex-lr"> | ||
| 13 | + <view class="texts font28r">就餐人数:</view> | ||
| 14 | + <view class="texts font28r">8</view> | ||
| 15 | + </view> | ||
| 16 | + <view class="info flex-lr"> | ||
| 17 | + <view class="texts font28r">备注信息:</view> | ||
| 18 | + <input type="text" placeholder="点击录入口味,偏好等要求" placeholder-style="color:#fff" /> | ||
| 19 | + </view> | ||
| 20 | + <view class="line"></view> | ||
| 21 | + <view class="checkMenu"> | ||
| 22 | + <block wx:for="{{checkList}}" wx:key="{{item.id}}" wx:for-index="indexs"> | ||
| 23 | + <view class="title flex-lr"> | ||
| 24 | + <view class="leftTitle">{{item.class_name}}</view> | ||
| 25 | + <view class="rightTitle">{{item.arr.length}}道</view> | ||
| 26 | + </view> | ||
| 27 | + <view class="content flex-lr" wx:for="{{item.arr}}" wx:key="{{item.id}}" wx:for-index="index"> | ||
| 28 | + <view class="single">{{item.name}}<text>({{item.practice}})</text></view> | ||
| 29 | + <view class="price">{{item.price}}元/{{item.unit}}</view> | ||
| 30 | + <view class="count"> | ||
| 31 | + <image src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" /> | ||
| 32 | + {{item.quantum}} | ||
| 33 | + <image src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" /> | ||
| 34 | + </view> | ||
| 35 | + </view> | ||
| 36 | + </block> | ||
| 37 | + </view> | ||
| 38 | + <view class="probably">预计金额:{{probablyPrice}}元</view> | ||
| 39 | +</scroll-view> | ||
| 40 | +<view class="btns flex-cc"> | ||
| 41 | + <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button> | ||
| 42 | + <button class="font32r determine flex-cc" bindtap="determineFun">确认下单</button> | ||
| 43 | +</view> |
| 1 | -/* pack-cookbook/pages/cart_new.wxss */ | ||
| 1 | +/* pack-cookbook/pages/cart_new.wxss */ | ||
| 2 | +page { | ||
| 3 | + background: #4d4e50; | ||
| 4 | +} | ||
| 5 | + | ||
| 6 | +.main { | ||
| 7 | + padding: 0 20rpx 148rpx 20rpx; | ||
| 8 | + font-family: PingFang SC; | ||
| 9 | + width: 100%; | ||
| 10 | + box-sizing: border-box; | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +.info { | ||
| 14 | + margin-bottom: 16rpx; | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +.texts { | ||
| 18 | + color: #ffffff; | ||
| 19 | + font-weight: 500; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +.texts_right { | ||
| 23 | + color: #999999; | ||
| 24 | + font-weight: 500; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +.info input { | ||
| 28 | + color: #fff; | ||
| 29 | + text-align: right; | ||
| 30 | + flex: 1; | ||
| 31 | + margin-left: 20rpx; | ||
| 32 | + font-size: 28rpx; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +.line { | ||
| 36 | + margin-bottom: 8rpx; | ||
| 37 | + height: 2rpx; | ||
| 38 | + background: #999999; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +.checkMenu { | ||
| 42 | + border-radius: 10rpx; | ||
| 43 | + background: #ffffff; | ||
| 44 | + padding: 0 40rpx; | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +.title { | ||
| 48 | + padding: 36rpx 0 4rpx 0; | ||
| 49 | + border-bottom: 2rpx solid #DBDBDB; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +.leftTitle { | ||
| 53 | + color: #515151; | ||
| 54 | + font-family: PingFang SC; | ||
| 55 | + font-weight: 600; | ||
| 56 | + font-size: 32rpx; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +.rightTitle { | ||
| 60 | + color: #515151; | ||
| 61 | + font-family: PingFang SC; | ||
| 62 | + font-size: 28rpx; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +.content { | ||
| 66 | + padding: 20rpx 0; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +.count text { | ||
| 70 | + font-weight: bold; | ||
| 71 | + color: #515151; | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | +.img1 { | ||
| 75 | + width: 28rpx; | ||
| 76 | + height: 24rpx; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +.img2 { | ||
| 80 | + width: 24rpx; | ||
| 81 | + height: 24rpx; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.probably { | ||
| 85 | + color: #999; | ||
| 86 | + margin-top: 36rpx; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +.btns { | ||
| 90 | + width: 100%; | ||
| 91 | + position: fixed; | ||
| 92 | + bottom: 0; | ||
| 93 | + height: 128rpx; | ||
| 94 | + z-index: 10; | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +.btns button { | ||
| 98 | + width: 50%; | ||
| 99 | + box-sizing: border-box; | ||
| 100 | + color: #fff; | ||
| 101 | + height: 100%; | ||
| 102 | + border-radius: 0; | ||
| 103 | +} | ||
| 104 | + | ||
| 105 | +.continue { | ||
| 106 | + background: #4d4e50; | ||
| 107 | + border: 2rpx solid #094ba4; | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | +.determine { | ||
| 111 | + background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); | ||
| 112 | + | ||
| 113 | +} |
| @@ -4,358 +4,385 @@ import util from '../../utils/util'; | @@ -4,358 +4,385 @@ import util from '../../utils/util'; | ||
| 4 | import App from '../../utils/api'; | 4 | import App from '../../utils/api'; |
| 5 | Page({ | 5 | Page({ |
| 6 | 6 | ||
| 7 | - /** | ||
| 8 | - * 页面的初始数据 | ||
| 9 | - */ | ||
| 10 | - data: { | ||
| 11 | - type:'A',//样式A,B,C | ||
| 12 | - scrollTop: 0, | ||
| 13 | - options:{}, | ||
| 14 | - check1:'',//做法 | ||
| 15 | - check2:'',//规格 | ||
| 16 | - isloading: true, | ||
| 17 | - toView: "", | ||
| 18 | - countPirce:'', | ||
| 19 | - countTotal:'', | ||
| 20 | - hasEnter: false, | ||
| 21 | - totalWidth: getApp().system.windowWidth, | ||
| 22 | - singleWidth: parseInt((getApp().system.windowWidth * 0.92 - 16) / 2), | ||
| 23 | - totalHeight: getApp().system.windowHeight, | ||
| 24 | - kindHeight: getApp().system.windowHeight - 68, | ||
| 25 | - hasListModel: true, | ||
| 26 | - cookbooklist: [], | ||
| 27 | - showSkeleton: true, | ||
| 28 | - order: {}, | ||
| 29 | - orderItemCount:0, | ||
| 30 | - checkObj:'', | ||
| 31 | - quantum:'', | ||
| 32 | - normsList:[ | ||
| 33 | - { | ||
| 34 | - text:'做饭', | ||
| 35 | - }, | ||
| 36 | - { | ||
| 37 | - text:'规格', | ||
| 38 | - } | ||
| 39 | - ], | ||
| 40 | - assortArr:[ | ||
| 41 | - {name:'淮扬热菜'}, | ||
| 42 | - {name:'精品凉菜'}, | ||
| 43 | - {name:'广式烧腊'}, | ||
| 44 | - {name:'海鲜'}, | ||
| 45 | - {name:'汤羹'}, | ||
| 46 | - {name:'四季时蔬'}, | ||
| 47 | - {name:'酒水'}, | ||
| 48 | - ], | ||
| 49 | - }, | ||
| 50 | - checkModal:'', | ||
| 51 | - classifyModal:'', | ||
| 52 | - /** | ||
| 53 | - * 生命周期函数--监听页面加载 | ||
| 54 | - */ | ||
| 55 | - onLoad: function (options) { | ||
| 56 | - console.log('options',options); | ||
| 57 | - this.setData({ | ||
| 58 | - options: options, | ||
| 59 | - }) | ||
| 60 | - this.getCookList(); | ||
| 61 | - this.initOrder(); | ||
| 62 | - mta.Page.init({ | ||
| 63 | - "appID": "500667280", | ||
| 64 | - "eventID": "500667287", | ||
| 65 | - "statPullDownFresh": true, | ||
| 66 | - "statShareApp": true, | ||
| 67 | - "statReachBottom": true, | ||
| 68 | - "lauchOpts": options, //渠道分析 | ||
| 69 | - }); | ||
| 70 | - this.checkModal = this.selectComponent("#checkModal"); | ||
| 71 | - this.classifyModal = this.selectComponent("#classifyModal"); | ||
| 72 | - }, | 7 | + /** |
| 8 | + * 页面的初始数据 | ||
| 9 | + */ | ||
| 10 | + data: { | ||
| 11 | + type: 'A', //样式A,B,C | ||
| 12 | + scrollTop: 0, | ||
| 13 | + options: {}, | ||
| 14 | + check1: '', //做法 | ||
| 15 | + check2: '', //规格 | ||
| 16 | + isloading: true, | ||
| 17 | + toView: "", | ||
| 18 | + countPirce: '', | ||
| 19 | + countTotal: '', | ||
| 20 | + hasEnter: false, | ||
| 21 | + totalWidth: getApp().system.windowWidth, | ||
| 22 | + singleWidth: parseInt((getApp().system.windowWidth * 0.92 - 16) / 2), | ||
| 23 | + totalHeight: getApp().system.windowHeight, | ||
| 24 | + kindHeight: getApp().system.windowHeight - 68, | ||
| 25 | + hasListModel: true, | ||
| 26 | + cookbooklist: [], | ||
| 27 | + checkItem: {}, | ||
| 28 | + showSkeleton: true, | ||
| 29 | + order: {}, | ||
| 30 | + orderItemCount: 0, | ||
| 31 | + checkObj: '', | ||
| 32 | + quantum: '', | ||
| 33 | + normsList: [{ | ||
| 34 | + text: '做饭', | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | + text: '规格', | ||
| 38 | + } | ||
| 39 | + ], | ||
| 40 | + assortArr: [], | ||
| 41 | + }, | ||
| 42 | + checkModal: '', | ||
| 43 | + classifyModal: '', | ||
| 44 | + /** | ||
| 45 | + * 生命周期函数--监听页面加载 | ||
| 46 | + */ | ||
| 47 | + onLoad: function (options) { | ||
| 48 | + console.log('options', options); | ||
| 49 | + this.setData({ | ||
| 50 | + options: options, | ||
| 51 | + }) | ||
| 52 | + this.getCookList(); | ||
| 53 | + this.initOrder(); | ||
| 54 | + mta.Page.init({ | ||
| 55 | + "appID": "500667280", | ||
| 56 | + "eventID": "500667287", | ||
| 57 | + "statPullDownFresh": true, | ||
| 58 | + "statShareApp": true, | ||
| 59 | + "statReachBottom": true, | ||
| 60 | + "lauchOpts": options, //渠道分析 | ||
| 61 | + }); | ||
| 62 | + this.checkModal = this.selectComponent("#checkModal"); | ||
| 63 | + this.classifyModal = this.selectComponent("#classifyModal"); | ||
| 64 | + }, | ||
| 73 | 65 | ||
| 74 | - /** | ||
| 75 | - * 生命周期函数--监听页面初次渲染完成 | ||
| 76 | - */ | ||
| 77 | - onReady() { | 66 | + /** |
| 67 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 68 | + */ | ||
| 69 | + onReady() { | ||
| 78 | 70 | ||
| 79 | - }, | ||
| 80 | - // 选择做法 | ||
| 81 | - checkSingle1(e){ | ||
| 82 | - const check1= e.currentTarget.dataset['item']; | ||
| 83 | - console.log('check1',check1); | ||
| 84 | - this.setData({ | ||
| 85 | - check1 | ||
| 86 | - }) | ||
| 87 | - }, | ||
| 88 | - // 已选菜单页面跳转 | ||
| 89 | - gotoShoppingCart(){ | ||
| 90 | - let arr=[] | ||
| 91 | - this.data.cookbooklist.forEach(item=>{ | ||
| 92 | - if(item.quantum!='0'){ | ||
| 93 | - arr.push(item) | 71 | + }, |
| 72 | + // 选择做法 | ||
| 73 | + checkSingle1(e) { | ||
| 74 | + const check1 = e.currentTarget.dataset['item']; | ||
| 75 | + this.setData({ | ||
| 76 | + check1 | ||
| 77 | + }) | ||
| 78 | + }, | ||
| 79 | + // 已选菜单页面跳转 | ||
| 80 | + gotoShoppingCart() { | ||
| 81 | + let arr = []; | ||
| 82 | + this.data.cookbooklist.forEach(item => { | ||
| 83 | + let obj = { | ||
| 84 | + class_name: item.class_name, | ||
| 85 | + id: item.id, | ||
| 86 | + status: item.status, | ||
| 87 | + class_type: item.class_type, | ||
| 88 | + arr: [], | ||
| 89 | + } | ||
| 90 | + item.cookbooklist[0].forEach(i => { | ||
| 91 | + if (i.quantum != '0') { | ||
| 92 | + obj.arr.push(i) | ||
| 94 | } | 93 | } |
| 95 | }) | 94 | }) |
| 96 | - console.log(arr); | ||
| 97 | - // wx.navigateTo({ | ||
| 98 | - // url: util.http_build_query({ | ||
| 99 | - // sellerName:this.data.options.sellerName, | ||
| 100 | - // arr:[] | ||
| 101 | - // }, '/pack-cookbook/pages/cart_new') | ||
| 102 | - // }) | ||
| 103 | - }, | ||
| 104 | - // 选择规格 | ||
| 105 | - checkSingle2(e){ | ||
| 106 | - const check2= e.currentTarget.dataset['item']; | ||
| 107 | - this.setData({ | ||
| 108 | - check2 | ||
| 109 | - }) | ||
| 110 | - }, | ||
| 111 | - // 展示做法规格弹窗 | ||
| 112 | - showModal() { | ||
| 113 | - this.checkModal.showModal() | ||
| 114 | - }, | ||
| 115 | - // 关闭做法规格弹窗 | ||
| 116 | - closeModal() { | ||
| 117 | - this.checkModal.closeModal() | ||
| 118 | - }, | ||
| 119 | - // 展示菜品分类弹框 | ||
| 120 | - showClassifyModal() { | ||
| 121 | - this.classifyModal.showModal() | ||
| 122 | - }, | ||
| 123 | - // 关闭菜品分类弹框 | ||
| 124 | - closeClassifyModal() { | ||
| 125 | - this.classifyModal.closeModal() | ||
| 126 | - }, | ||
| 127 | - // 选择菜品分类 | ||
| 128 | - checkItem(e){ | ||
| 129 | - const item= e.currentTarget.dataset['item']; | ||
| 130 | - console.log(item); | ||
| 131 | - }, | ||
| 132 | - // 选择做法和规格后点击确定 | ||
| 133 | - determineFun(){ | ||
| 134 | - let index =this.data.checkObj.index; | ||
| 135 | - let indexs =this.data.checkObj.indexs; | ||
| 136 | - let quantum =this.data.quantum; | ||
| 137 | - let check1 = this.data.check1; | ||
| 138 | - console.log(this.data.cookbooklist[indexs].cookbooklist[0][index].arr1[check1]); | ||
| 139 | - let checkObj=`cookbooklist[${indexs}].cookbooklist[0][${index}].quantum`; | ||
| 140 | - let arr1=`cookbooklist[${indexs}].cookbooklist[0][${index}].arr1[${check1}]`; | ||
| 141 | - let practice=`cookbooklist[${indexs}].cookbooklist[0][${index}].practice`; | ||
| 142 | - this.setData({ | ||
| 143 | - [checkObj]:quantum, | ||
| 144 | - [practice]:check1 | ||
| 145 | - }) | ||
| 146 | - console.log(this.data.check1); | ||
| 147 | - console.log(this.data.cookbooklist[indexs].cookbooklist[0][index]); | ||
| 148 | - this.closeModal() | ||
| 149 | - }, | ||
| 150 | - // 点击加号 | ||
| 151 | - addition(e){ | ||
| 152 | - const item= e.currentTarget.dataset['item']; | ||
| 153 | - const index= e.currentTarget.dataset['key'];//菜下标 | ||
| 154 | - const indexs= e.currentTarget.dataset['indexs'];//分类下标 | ||
| 155 | - let quantum = item.quantum * 1 + 1; | ||
| 156 | - console.log('index',index); | ||
| 157 | - console.log('indexs',indexs); | ||
| 158 | - console.log('indexs',indexs); | ||
| 159 | - let checkObj={ | 95 | + arr.push(obj) |
| 96 | + }) | ||
| 97 | + console.log(arr); | ||
| 98 | + let sellerName = this.data.options.sellerName | ||
| 99 | + wx.navigateTo({ | ||
| 100 | + url: `/pack-cookbook/pages/cart_new?arr=${JSON.stringify(arr)}&sellerName=${sellerName}&sellerid=${this.data.options.sid}`, | ||
| 101 | + }) | ||
| 102 | + }, | ||
| 103 | + // 选择规格 | ||
| 104 | + checkSingle2(e) { | ||
| 105 | + const check2 = e.currentTarget.dataset['item']; | ||
| 106 | + this.setData({ | ||
| 107 | + check2 | ||
| 108 | + }) | ||
| 109 | + }, | ||
| 110 | + // 展示做法规格弹窗 | ||
| 111 | + showModal() { | ||
| 112 | + console.log(this.data.checkItem); | ||
| 113 | + this.checkModal.showModal() | ||
| 114 | + }, | ||
| 115 | + // 关闭做法规格弹窗 | ||
| 116 | + closeModal() { | ||
| 117 | + this.checkModal.closeModal() | ||
| 118 | + }, | ||
| 119 | + // 展示菜品分类弹框 | ||
| 120 | + showClassifyModal() { | ||
| 121 | + this.classifyModal.showModal() | ||
| 122 | + }, | ||
| 123 | + // 关闭菜品分类弹框 | ||
| 124 | + closeClassifyModal() { | ||
| 125 | + this.classifyModal.closeModal() | ||
| 126 | + }, | ||
| 127 | + // 选择菜品分类 | ||
| 128 | + checkItem(e) { | ||
| 129 | + const item = e.currentTarget.dataset['item']; | ||
| 130 | + console.log(item); | ||
| 131 | + }, | ||
| 132 | + // 选择做法和规格后点击确定 | ||
| 133 | + determineFun() { | ||
| 134 | + let index = this.data.checkObj.index; | ||
| 135 | + let indexs = this.data.checkObj.indexs; | ||
| 136 | + let quantum = this.data.quantum; | ||
| 137 | + let check1 = this.data.check1; | ||
| 138 | + let check2 = this.data.check2; | ||
| 139 | + let checkObj = `cookbooklist[${indexs}].cookbooklist[0][${index}].quantum`; | ||
| 140 | + let practice = `cookbooklist[${indexs}].cookbooklist[0][${index}].practice`; | ||
| 141 | + let unit = `cookbooklist[${indexs}].cookbooklist[0][${index}].unit`; | ||
| 142 | + this.setData({ | ||
| 143 | + [checkObj]: quantum, | ||
| 144 | + [practice]: check1, | ||
| 145 | + [unit]: check2, | ||
| 146 | + }) | ||
| 147 | + console.log('cookbooklist', this.data.cookbooklist); | ||
| 148 | + this.closeModal() | ||
| 149 | + }, | ||
| 150 | + // 点击加号 | ||
| 151 | + addition(e) { | ||
| 152 | + const item = e.currentTarget.dataset['item']; | ||
| 153 | + const index = e.currentTarget.dataset['key']; //菜下标 | ||
| 154 | + const indexs = e.currentTarget.dataset['indexs']; //分类下标 | ||
| 155 | + let quantum = item.quantum * 1 + 1; | ||
| 156 | + this.setData({ | ||
| 157 | + checkObj: { | ||
| 158 | + indexs, | ||
| 159 | + index, | ||
| 160 | + }, | ||
| 161 | + quantum, | ||
| 162 | + checkItem: item | ||
| 163 | + }) | ||
| 164 | + console.log('index', index); | ||
| 165 | + console.log('indexs', indexs); | ||
| 166 | + console.log('checkItem', this.data.checkItem); | ||
| 167 | + this.showModal() | ||
| 168 | + }, | ||
| 169 | + // 点击减号 | ||
| 170 | + subtraction(e) { | ||
| 171 | + const item = e.currentTarget.dataset['item']; | ||
| 172 | + const index = e.currentTarget.dataset['key']; //菜下标 | ||
| 173 | + const indexs = e.currentTarget.dataset['indexs']; //分类下标 | ||
| 174 | + let quantum = item.quantum * 1 - 1; | ||
| 175 | + console.log('index', index); | ||
| 176 | + console.log('indexs', indexs); | ||
| 177 | + let quantumObj = `cookbooklist[${indexs}].cookbooklist[0][${index}].quantum`; | ||
| 178 | + let practice = `cookbooklist[${indexs}].cookbooklist[0][${index}].practice`; | ||
| 179 | + let unit = `cookbooklist[${indexs}].cookbooklist[0][${index}].unit`; | ||
| 180 | + this.setData({ | ||
| 181 | + checkObj: { | ||
| 160 | indexs, | 182 | indexs, |
| 161 | index | 183 | index |
| 162 | - }; | ||
| 163 | - console.log(checkObj,quantum); | ||
| 164 | - this.showModal() | 184 | + }, |
| 185 | + quantum, | ||
| 186 | + [quantumObj]: quantum, | ||
| 187 | + [practice]: this.data.check1, | ||
| 188 | + [unit]: this.data.check2, | ||
| 189 | + }) | ||
| 190 | + }, | ||
| 191 | + // 扫桌码点餐 | ||
| 192 | + initOrder() { | ||
| 193 | + App.Advance.CreateOrder({ | ||
| 194 | + rid: this.data.options.rid, | ||
| 195 | + identity: this.data.options.identity, | ||
| 196 | + status: '0,1', | ||
| 197 | + openid: getApp().openid, | ||
| 198 | + }).then(res => { | ||
| 199 | + let orderItemCount = 0; | ||
| 200 | + res.data.cookbooklist.forEach(cb => { | ||
| 201 | + if (this.data.options.identity == 1 && cb.status > 0) { | ||
| 202 | + wx.redirectTo({ | ||
| 203 | + url: util.http_build_query({ | ||
| 204 | + rid: this.data.options.rid, | ||
| 205 | + oid: res.data.id, | ||
| 206 | + identity: 1, | ||
| 207 | + sellerid: this.data.options.sid, | ||
| 208 | + }, '/pack-cookbook/pages/success') | ||
| 209 | + }); | ||
| 210 | + return false; | ||
| 211 | + } | ||
| 212 | + orderItemCount += parseInt(cb.num) | ||
| 213 | + }) | ||
| 165 | this.setData({ | 214 | this.setData({ |
| 166 | - checkObj, | ||
| 167 | - quantum, | 215 | + [`options.oid`]: res.data.id, |
| 216 | + order: res.data, | ||
| 217 | + orderItemCount: orderItemCount, | ||
| 168 | }) | 218 | }) |
| 169 | - }, | ||
| 170 | - // 点击减号 | ||
| 171 | - subtraction(e){ | ||
| 172 | - const item= e.currentTarget.dataset['item']; | ||
| 173 | - const index= e.currentTarget.dataset['key'];//菜下标 | ||
| 174 | - const indexs= e.currentTarget.dataset['indexs'];//分类下标 | ||
| 175 | - let quantum = item.quantum * 1 - 1; | ||
| 176 | - let checkObj=`cookbooklist[${indexs}].cookbooklist[${index}]`; | ||
| 177 | - this.setData({ | ||
| 178 | - checkObj, | ||
| 179 | - quantum, | ||
| 180 | - }) | ||
| 181 | - }, | ||
| 182 | - // 扫桌码点餐 | ||
| 183 | - initOrder() { | ||
| 184 | - App.Advance.CreateOrder({ | ||
| 185 | - rid: this.data.options.rid, | ||
| 186 | - identity: this.data.options.identity, | ||
| 187 | - status: '0,1', | ||
| 188 | - openid: getApp().openid, | ||
| 189 | - }).then(res => { | ||
| 190 | - let orderItemCount = 0; | ||
| 191 | - res.data.cookbooklist.forEach(cb => { | ||
| 192 | - if (this.data.options.identity == 1 && cb.status > 0) { | ||
| 193 | - wx.redirectTo({ | ||
| 194 | - url: util.http_build_query({ | ||
| 195 | - rid: this.data.options.rid, | ||
| 196 | - oid: res.data.id, | ||
| 197 | - identity: 1 | ||
| 198 | - }, '/pack-cookbook/pages/success') | ||
| 199 | - }); | ||
| 200 | - return false; | ||
| 201 | - } | ||
| 202 | - orderItemCount += parseInt(cb.num) | ||
| 203 | - }) | ||
| 204 | - this.setData({ | ||
| 205 | - [`options.oid`]: res.data.id, | ||
| 206 | - order: res.data, | ||
| 207 | - orderItemCount: orderItemCount, | ||
| 208 | - }) | ||
| 209 | - }) | ||
| 210 | - }, | ||
| 211 | - formatCookList(list){ | ||
| 212 | - //原栏目下显示 | ||
| 213 | - let hasShowClass = false; | ||
| 214 | - //菜单中展示沽清的菜品 | ||
| 215 | - let hasClearCookbook = false; | ||
| 216 | - //十道必选菜 | ||
| 217 | - let has10CaiOpen = false; | ||
| 218 | - let flist = []; | ||
| 219 | - let check1=''; | ||
| 220 | - let check2=''; | ||
| 221 | - if (list.length > 0) { | ||
| 222 | - has10CaiOpen = list[0].status == 1; | ||
| 223 | - list.forEach(function (cate, i) { | ||
| 224 | - if (cate.status == 1 && cate.cookbooklist[0].length > 0) { | ||
| 225 | - let cooks = []; | ||
| 226 | - //let cooks_order=[]; | ||
| 227 | - cate.cookbooklist[0].forEach(function (cook, n) { | ||
| 228 | - if (cook.status == 1) { | ||
| 229 | - let flag = true; | ||
| 230 | - if (has10CaiOpen) { | ||
| 231 | - if (cate.class_type == 2 && !hasShowClass && flist.length > 0 && flist[0].class_type == 1) { | ||
| 232 | - for (let fi = 0; fi < flist[0].cookbooklist[0].length; fi++) { | ||
| 233 | - if (flist[0].cookbooklist[0][fi].id == cook.id) { | ||
| 234 | - flag = false; | ||
| 235 | - break; | ||
| 236 | - } | 219 | + }) |
| 220 | + }, | ||
| 221 | + formatCookList(list) { | ||
| 222 | + //原栏目下显示 | ||
| 223 | + let hasShowClass = false; | ||
| 224 | + //菜单中展示沽清的菜品 | ||
| 225 | + let hasClearCookbook = false; | ||
| 226 | + //十道必选菜 | ||
| 227 | + let has10CaiOpen = false; | ||
| 228 | + let flist = []; | ||
| 229 | + let assortArr = []; | ||
| 230 | + let check1 = ''; | ||
| 231 | + let check2 = ''; | ||
| 232 | + if (list.length > 0) { | ||
| 233 | + has10CaiOpen = list[0].status == 1; | ||
| 234 | + list.forEach(function (cate, i) { | ||
| 235 | + let obj = { | ||
| 236 | + class_name: cate.class_name, | ||
| 237 | + class_type: cate.class_type, | ||
| 238 | + id: cate.id, | ||
| 239 | + order: cate.order, | ||
| 240 | + status: cate.status, | ||
| 241 | + } | ||
| 242 | + assortArr.push(obj) | ||
| 243 | + if (cate.status == 1 && cate.cookbooklist[0].length > 0) { | ||
| 244 | + let cooks = []; | ||
| 245 | + //let cooks_order=[]; | ||
| 246 | + cate.cookbooklist[0].forEach(function (cook, n) { | ||
| 247 | + if (cook.status == 1) { | ||
| 248 | + let flag = true; | ||
| 249 | + if (has10CaiOpen) { | ||
| 250 | + if (cate.class_type == 2 && !hasShowClass && flist.length > 0 && flist[0].class_type == 1) { | ||
| 251 | + for (let fi = 0; fi < flist[0].cookbooklist[0].length; fi++) { | ||
| 252 | + if (flist[0].cookbooklist[0][fi].id == cook.id) { | ||
| 253 | + flag = false; | ||
| 254 | + break; | ||
| 237 | } | 255 | } |
| 238 | } | 256 | } |
| 239 | } | 257 | } |
| 240 | - cook.item_clear_num = cook.clear_num; | ||
| 241 | - if (!hasClearCookbook) {//不显示卖光了 | ||
| 242 | - let item_clear_num = cook.clear_num; | ||
| 243 | - if (cook.spec) { | ||
| 244 | - let clear_num = null; | ||
| 245 | - cook.spec.forEach(spec => { | ||
| 246 | - if (spec.clear_num == 0) { | ||
| 247 | - clear_num = 0; | ||
| 248 | - } else { | ||
| 249 | - clear_num = null; | ||
| 250 | - } | ||
| 251 | - }) | ||
| 252 | - if (clear_num == 0) { | ||
| 253 | - item_clear_num = 0; | 258 | + } |
| 259 | + cook.item_clear_num = cook.clear_num; | ||
| 260 | + if (!hasClearCookbook) { //不显示卖光了 | ||
| 261 | + let item_clear_num = cook.clear_num; | ||
| 262 | + if (cook.spec) { | ||
| 263 | + let clear_num = null; | ||
| 264 | + cook.spec.forEach(spec => { | ||
| 265 | + if (spec.clear_num == 0) { | ||
| 266 | + clear_num = 0; | ||
| 267 | + } else { | ||
| 268 | + clear_num = null; | ||
| 254 | } | 269 | } |
| 255 | - } | ||
| 256 | - cook.item_clear_num = item_clear_num; | ||
| 257 | - cook.quantum=0; | ||
| 258 | - cook.index=n; | ||
| 259 | - cook.practice=''; | ||
| 260 | - cook.arr1=['香辣','清蒸','爆炒','清汤']; | ||
| 261 | - cook.arr2=['小份','中份','份','例','两只']; | ||
| 262 | - check1=cook.arr1[0]; | ||
| 263 | - check2=cook.arr2[0]; | ||
| 264 | - if (item_clear_num == 0) { | ||
| 265 | - flag = false; | 270 | + }) |
| 271 | + if (clear_num == 0) { | ||
| 272 | + item_clear_num = 0; | ||
| 266 | } | 273 | } |
| 267 | } | 274 | } |
| 268 | - | ||
| 269 | - if (flag) { | ||
| 270 | - cooks.push(cook); | ||
| 271 | - //cooks_order.push(cook.order_o); | 275 | + cook.item_clear_num = item_clear_num; |
| 276 | + cook.quantum = 0; //选择的数量 | ||
| 277 | + cook.index = n; //分类下菜品的下标 | ||
| 278 | + cook.practice = ''; //做法 | ||
| 279 | + cook.unit = ''; //规格 | ||
| 280 | + // let type;//模拟种类 1为一行显示1个 2为一行显示2个 | ||
| 281 | + // if(n=='0' || n=='3'){ | ||
| 282 | + // type='1' | ||
| 283 | + // }else{ | ||
| 284 | + // type='2' | ||
| 285 | + // } | ||
| 286 | + cook.type = '1'; | ||
| 287 | + cook.arr1 = ['香辣', '清蒸', '爆炒', '清汤']; | ||
| 288 | + cook.arr2 = ['小份', '中份', '份', '例', '两只']; | ||
| 289 | + check1 = cook.arr1[0]; | ||
| 290 | + check2 = cook.arr2[0]; | ||
| 291 | + if (item_clear_num == 0) { | ||
| 292 | + flag = false; | ||
| 272 | } | 293 | } |
| 273 | - | ||
| 274 | } | 294 | } |
| 275 | - }) | ||
| 276 | - if (cooks.length > 0) { | ||
| 277 | - //cooks 排序... | ||
| 278 | 295 | ||
| 279 | - cate.cookbooklist[0] = cooks; | ||
| 280 | - flist.push(cate) | 296 | + if (flag) { |
| 297 | + cooks.push(cook); | ||
| 298 | + //cooks_order.push(cook.order_o); | ||
| 299 | + } | ||
| 300 | + | ||
| 281 | } | 301 | } |
| 302 | + }) | ||
| 303 | + if (cooks.length > 0) { | ||
| 304 | + //cooks 排序... | ||
| 305 | + | ||
| 306 | + cate.cookbooklist[0] = cooks; | ||
| 307 | + flist.push(cate) | ||
| 282 | } | 308 | } |
| 283 | - }) | ||
| 284 | - } | 309 | + } |
| 310 | + }) | ||
| 311 | + } | ||
| 312 | + setTimeout(() => { | ||
| 313 | + this.setData({ | ||
| 314 | + check1, | ||
| 315 | + check2, | ||
| 316 | + assortArr | ||
| 317 | + }) | ||
| 318 | + }, 1); | ||
| 319 | + console.log('flist', flist); | ||
| 320 | + return flist; | ||
| 321 | + }, | ||
| 322 | + // 获取所有分类下所有菜品列表 | ||
| 323 | + getCookList(orderid) { | ||
| 324 | + let param = { | ||
| 325 | + sellerid: this.data.options.sid, | ||
| 326 | + identity: this.data.options.identity, | ||
| 327 | + orderid: this.data.options.oid, | ||
| 328 | + status: '0,1', | ||
| 329 | + }; | ||
| 330 | + App.Advance.GetCookbookByClass(param).then(json => { | ||
| 331 | + //菜单分类添加修饰 | ||
| 332 | + let cookbooklist = this.formatCookList(json.data[0].list); | ||
| 285 | setTimeout(() => { | 333 | setTimeout(() => { |
| 286 | this.setData({ | 334 | this.setData({ |
| 287 | - check1, | ||
| 288 | - check2 | 335 | + cookbooklist: cookbooklist, |
| 336 | + countPirce: json.data[0].countPirce ? json.data[0].countPirce : 0, | ||
| 337 | + countTotal: json.data[0].countTotal ? json.data[0].countTotal : 0, | ||
| 338 | + isloading: false, | ||
| 339 | + showSkeleton: false, | ||
| 289 | }) | 340 | }) |
| 290 | - }, 1); | ||
| 291 | - return flist; | ||
| 292 | - }, | ||
| 293 | - // 获取所有分类下所有菜品列表 | ||
| 294 | - getCookList(orderid) { | ||
| 295 | - let param = { | ||
| 296 | - sellerid: this.data.options.sid, | ||
| 297 | - identity: this.data.options.identity, | ||
| 298 | - orderid : this.data.options.oid, | ||
| 299 | - status:'0,1', | ||
| 300 | - }; | ||
| 301 | - App.Advance.GetCookbookByClass(param).then(json => { | ||
| 302 | - //菜单分类添加修饰 | ||
| 303 | - let cookbooklist = this.formatCookList(json.data[0].list); | ||
| 304 | - console.log({...cookbooklist[1].cookbooklist[0][0]}); | ||
| 305 | - setTimeout(() => { | ||
| 306 | - this.setData({ | ||
| 307 | - cookbooklist: cookbooklist, | ||
| 308 | - countPirce: json.data[0].countPirce ? json.data[0].countPirce : 0, | ||
| 309 | - countTotal: json.data[0].countTotal ? json.data[0].countTotal : 0, | ||
| 310 | - isloading: false, | ||
| 311 | - showSkeleton: false, | ||
| 312 | - }) | ||
| 313 | - }, 0) | ||
| 314 | - | ||
| 315 | - }).catch(res => { | ||
| 316 | - console.log('getCookList-catch', res); | ||
| 317 | - this.selectComponent("#network").show('网络不给力,请检查网络后重试'); | ||
| 318 | - }); | ||
| 319 | - }, | ||
| 320 | - /** | ||
| 321 | - * 生命周期函数--监听页面显示 | ||
| 322 | - */ | ||
| 323 | - onShow() { | 341 | + }, 0) |
| 324 | 342 | ||
| 325 | - }, | 343 | + }).catch(res => { |
| 344 | + this.selectComponent("#network").show('网络不给力,请检查网络后重试'); | ||
| 345 | + }); | ||
| 346 | + }, | ||
| 347 | + /** | ||
| 348 | + * 生命周期函数--监听页面显示 | ||
| 349 | + */ | ||
| 350 | + onShow() { | ||
| 326 | 351 | ||
| 327 | - /** | ||
| 328 | - * 生命周期函数--监听页面隐藏 | ||
| 329 | - */ | ||
| 330 | - onHide() { | 352 | + }, |
| 331 | 353 | ||
| 332 | - }, | 354 | + /** |
| 355 | + * 生命周期函数--监听页面隐藏 | ||
| 356 | + */ | ||
| 357 | + onHide() { | ||
| 333 | 358 | ||
| 334 | - /** | ||
| 335 | - * 生命周期函数--监听页面卸载 | ||
| 336 | - */ | ||
| 337 | - onUnload() { | 359 | + }, |
| 338 | 360 | ||
| 339 | - }, | 361 | + /** |
| 362 | + * 生命周期函数--监听页面卸载 | ||
| 363 | + */ | ||
| 364 | + onUnload() { | ||
| 340 | 365 | ||
| 341 | - /** | ||
| 342 | - * 页面相关事件处理函数--监听用户下拉动作 | ||
| 343 | - */ | ||
| 344 | - onPullDownRefresh() { | 366 | + }, |
| 345 | 367 | ||
| 346 | - }, | 368 | + /** |
| 369 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 370 | + */ | ||
| 371 | + onPullDownRefresh() { | ||
| 347 | 372 | ||
| 348 | - /** | ||
| 349 | - * 页面上拉触底事件的处理函数 | ||
| 350 | - */ | ||
| 351 | - onReachBottom() { | 373 | + }, |
| 352 | 374 | ||
| 353 | - }, | 375 | + /** |
| 376 | + * 页面上拉触底事件的处理函数 | ||
| 377 | + */ | ||
| 378 | + onReachBottom() { | ||
| 354 | 379 | ||
| 355 | - /** | ||
| 356 | - * 用户点击右上角分享 | ||
| 357 | - */ | ||
| 358 | - onShareAppMessage() { | 380 | + }, |
| 359 | 381 | ||
| 360 | - } | 382 | + /** |
| 383 | + * 用户点击右上角分享 | ||
| 384 | + */ | ||
| 385 | + onShareAppMessage() { | ||
| 386 | + | ||
| 387 | + } | ||
| 361 | }) | 388 | }) |
| @@ -18,143 +18,107 @@ | @@ -18,143 +18,107 @@ | ||
| 18 | </view> | 18 | </view> |
| 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 | - <view class="dishWrap"> | 21 | + <view wx:if="{{item.type=='1'}}" class="dishWrap"> |
| 22 | <view class="dishItem flex-lr"> | 22 | <view class="dishItem flex-lr"> |
| 23 | - <view class="dishLeft dishTexts"> | ||
| 24 | - {{item.name}} | ||
| 25 | - </view> | ||
| 26 | - <view class="dishTexts dishRight"> | ||
| 27 | - {{item.first_name}} | ||
| 28 | - </view> | ||
| 29 | - </view> | ||
| 30 | - <view class="norms"> | ||
| 31 | - {{item.first_name}} | 23 | + <view class="dishLeft dishTexts">{{item.name}}</view> |
| 24 | + <view class="dishTexts dishRight">{{item.first_name}}</view> | ||
| 32 | </view> | 25 | </view> |
| 26 | + <view class="norms">{{item.first_name}}</view> | ||
| 33 | <block wx:if="{{type=='B'}}"> | 27 | <block wx:if="{{type=='B'}}"> |
| 34 | <view class="dishItem typeB"> | 28 | <view class="dishItem typeB"> |
| 35 | - <view class="dishLeft dishTexts"> | ||
| 36 | - {{item.title}} | ||
| 37 | - </view> | ||
| 38 | - <view class="dishTexts dishRight"> | ||
| 39 | - {{item.first_name}} | ||
| 40 | - </view> | ||
| 41 | - </view> | ||
| 42 | - <view class="norms normsB"> | ||
| 43 | - {{item.first_name}} | 29 | + <view class="dishLeft dishTexts">{{item.title}}</view> |
| 30 | + <view class="dishTexts dishRight">{{item.first_name}}</view> | ||
| 44 | </view> | 31 | </view> |
| 32 | + <view class="norms normsB">{{item.first_name}}</view> | ||
| 45 | </block> | 33 | </block> |
| 46 | <block wx:if="{{type=='C'}}"> | 34 | <block wx:if="{{type=='C'}}"> |
| 47 | <view class="dishItem"> | 35 | <view class="dishItem"> |
| 48 | - <view class="dishLeft dishTexts"> | ||
| 49 | - {{item.title}} | ||
| 50 | - </view> | ||
| 51 | - <view class="dishTexts dishRight"> | ||
| 52 | - {{item.first_name}} | ||
| 53 | - </view> | ||
| 54 | - </view> | ||
| 55 | - <view class="norms"> | ||
| 56 | - {{item.first_name}} | 36 | + <view class="dishLeft dishTexts">{{item.title}}</view> |
| 37 | + <view class="dishTexts dishRight">{{item.first_name}}</view> | ||
| 57 | </view> | 38 | </view> |
| 39 | + <view class="norms">{{item.first_name}}</view> | ||
| 58 | </block> | 40 | </block> |
| 59 | - <image src="{{item.image}}" class="dishImg" mode="widthFix" /> | 41 | + <image src="{{item.image}}" class="dishImg" mode="aspectFill" /> |
| 60 | <view class="greens"> | 42 | <view class="greens"> |
| 61 | - <view class="news"> | ||
| 62 | - {{item.first_name}} | ||
| 63 | - </view> | ||
| 64 | - </view> | ||
| 65 | - <view wx:if="{{item.quantum==0}}" class="algorithmImg flex-rr"> | ||
| 66 | - <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> | 43 | + <view class="news">{{item.first_name}}</view> |
| 67 | </view> | 44 | </view> |
| 68 | - <view wx:else class="algorithmImg flex-lr calculate"> | 45 | + <view wx:if="{{item.quantum!=0}}" class="algorithmImg flex-lr calculate"> |
| 69 | <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> | 46 | <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> |
| 70 | <view class="box flex-cc"> | 47 | <view class="box flex-cc"> |
| 71 | <view class="num flex-cc"> | 48 | <view class="num flex-cc"> |
| 72 | - {{item.quantum}}<view>份</view> | ||
| 73 | - </view> | ||
| 74 | - <view class="practice"> | ||
| 75 | - {{item.practice}} | 49 | + {{item.quantum}}<view>{{item.unit}}</view> |
| 76 | </view> | 50 | </view> |
| 51 | + <view class="practice">{{item.practice}}</view> | ||
| 77 | </view> | 52 | </view> |
| 78 | - <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{indexs}}" data-indexs="{{indexs}}" /> | 53 | + <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> |
| 54 | + </view> | ||
| 55 | + <view class="algorithmImg flex-rr"> | ||
| 56 | + <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> | ||
| 79 | </view> | 57 | </view> |
| 80 | <view class="wrapIine"></view> | 58 | <view class="wrapIine"></view> |
| 81 | - <view class="twoBox flex-rs"> | ||
| 82 | - <!-- <view class="twoItem"> | ||
| 83 | - <view class="twoTitle"> | ||
| 84 | - {{item.title}} | ||
| 85 | - </view> | ||
| 86 | - <view class="twoInfo"> | ||
| 87 | - {{item.info}}{{item.vip}} | ||
| 88 | - </view> | ||
| 89 | - {{item.quantum}} | 59 | + </view> |
| 60 | + <view wx:else class="twoBox flex-rs"> | ||
| 61 | + <view class="twoItem"> | ||
| 62 | + <view class="twoTitle">{{item.name}}</view> | ||
| 63 | + <view class="twoInfo">{{item.info}}{{item.vip}}</view>{{item.quantum}} | ||
| 90 | <image src="{{item.image}}" mode="aspectFill" /> | 64 | <image src="{{item.image}}" mode="aspectFill" /> |
| 91 | <view wx:if="{{item.quantum==0}}" class="algorithmImg flex-rr oneImg"> | 65 | <view wx:if="{{item.quantum==0}}" class="algorithmImg flex-rr oneImg"> |
| 92 | - <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}"/> | 66 | + <image src="https://qn.colorcun.com/WechatIMG696.png" class="imgs" mode="aspectFill" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> |
| 93 | </view> | 67 | </view> |
| 94 | <view wx:else class="algorithmImg flex-lr twoImgs"> | 68 | <view wx:else class="algorithmImg flex-lr twoImgs"> |
| 95 | - <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}"/> | 69 | + <image src="https://qn.colorcun.com/WechatIMG697.png" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> |
| 96 | <view class="box flex-cc"> | 70 | <view class="box flex-cc"> |
| 97 | - <view class="num flex-cc"> | ||
| 98 | - {{item.quantum}} | ||
| 99 | - </view> | 71 | + <view class="num flex-cc">{{item.quantum}}</view> |
| 100 | </view> | 72 | </view> |
| 101 | - <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{index}}"/> | 73 | + <image src="https://qn.colorcun.com/WechatIMG696.png" mode="aspectFill" class="imgs" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" /> |
| 102 | </view> | 74 | </view> |
| 103 | - </view> --> | ||
| 104 | </view> | 75 | </view> |
| 105 | </view> | 76 | </view> |
| 106 | </block> | 77 | </block> |
| 107 | </view> | 78 | </view> |
| 108 | - <view class="fixedBox flex-lr"> | ||
| 109 | - <view class="left flex-cmc" bindtap="showClassifyModal"> | ||
| 110 | - <image src="https://qn.colorcun.com/WechatIMG700.png" mode="" /> | ||
| 111 | - <view class="fixedName"> | ||
| 112 | - 菜品分类 | ||
| 113 | - </view> | 79 | +</block> |
| 80 | +<view class="fixedBox flex-lr"> | ||
| 81 | + <view class="left flex-cmc" bindtap="showClassifyModal"> | ||
| 82 | + <image src="https://qn.colorcun.com/WechatIMG700.png" mode="" /> | ||
| 83 | + <view class="fixedName"> | ||
| 84 | + 菜品分类 | ||
| 114 | </view> | 85 | </view> |
| 115 | - <view class="right flex-cmc" bindtap="gotoShoppingCart"> | ||
| 116 | - <image src="https://qn.colorcun.com/WechatIMG701.png" mode="" /> | ||
| 117 | - <view class="fixedName"> | ||
| 118 | - 已选菜品 | ||
| 119 | - </view> | 86 | + </view> |
| 87 | + <view class="right flex-cmc" bindtap="gotoShoppingCart"> | ||
| 88 | + <image src="https://qn.colorcun.com/WechatIMG701.png" mode="" /> | ||
| 89 | + <view class="fixedName"> | ||
| 90 | + 已选菜品 | ||
| 120 | </view> | 91 | </view> |
| 121 | </view> | 92 | </view> |
| 122 | -</block> | 93 | +</view> |
| 123 | <my-modal id="checkModal" height="410px" fadeStyle="center"> | 94 | <my-modal id="checkModal" height="410px" fadeStyle="center"> |
| 124 | - <block wx:for="{{cookbooklist}}" wx:key="cookbooklist-key" wx:for-index="indexs"> | ||
| 125 | - <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index"> | ||
| 126 | - <view slot="modalContent" class="normsModel"> | ||
| 127 | - <scroll-view scroll-y style="height: 78%;overflow: auto;"> | ||
| 128 | - <view class="textSty"> | ||
| 129 | - 做法 | ||
| 130 | - </view> | ||
| 131 | - <view class="itemBox"> | ||
| 132 | - <view class="single {{check1==item?'active':''}}" bindtap="checkSingle1" wx:for="{{item.arr1}}" data-item="{{item}}"> | ||
| 133 | - {{item}}</view> | ||
| 134 | - </view> | ||
| 135 | - <view class="checkLine"></view> | ||
| 136 | - <view class="textSty"> | ||
| 137 | - 规格 | ||
| 138 | - </view> | ||
| 139 | - <view class="itemBox"> | ||
| 140 | - <view class="single {{check2==item?'active':''}}" bindtap="checkSingle2" wx:for="{{item.arr2}}" data-item="{{item}}">{{item}}</view> | ||
| 141 | - </view> | ||
| 142 | - </scroll-view> | ||
| 143 | - <view class="btns"> | ||
| 144 | - <button class="font32r cancellation btn" bindtap="closeModal">取消</button> | ||
| 145 | - <button class="font32r determine btn" bindtap="determineFun">确定</button> | ||
| 146 | - </view> | 95 | + <view slot="modalContent" class="normsModel"> |
| 96 | + <scroll-view scroll-y style="height: 78%;overflow: auto;"> | ||
| 97 | + <view class="textSty">做法</view> | ||
| 98 | + <view class="itemBox"> | ||
| 99 | + <block wx:for="{{checkItem.arr1}}"> | ||
| 100 | + <view class="single {{check1==item?'active':''}}" data-item="{{item}}" bindtap="checkSingle1"> | ||
| 101 | + {{item}}</view> | ||
| 102 | + </block> | ||
| 147 | </view> | 103 | </view> |
| 148 | - </block> | ||
| 149 | - </block> | 104 | + <view class="checkLine"></view> |
| 105 | + <view class="textSty">规格</view> | ||
| 106 | + <view class="itemBox"> | ||
| 107 | + <view class="single {{check2==item?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.arr2}}" data-item="{{item}}"> | ||
| 108 | + {{item}}</view> | ||
| 109 | + </view> | ||
| 110 | + </scroll-view> | ||
| 111 | + <view class="btns"> | ||
| 112 | + <button class="font32r cancellation btn" bindtap="closeModal">取消</button> | ||
| 113 | + <button class="font32r determine btn" bindtap="determineFun">确定</button> | ||
| 114 | + </view> | ||
| 115 | + </view> | ||
| 150 | </my-modal> | 116 | </my-modal> |
| 151 | <my-modal id="classifyModal" fadeStyle="slideDown" height="100%"> | 117 | <my-modal id="classifyModal" fadeStyle="slideDown" height="100%"> |
| 152 | <view slot="modalContent" class="assortModel"> | 118 | <view slot="modalContent" class="assortModel"> |
| 153 | - <view class="assortItem items font48r"> | ||
| 154 | - 10道必点菜 | ||
| 155 | - </view> | 119 | + <!-- underline --> |
| 156 | <view wx:for="{{assortArr}}" class="assortItem font48r" data-item="{{item}}" bindtap="checkItem"> | 120 | <view wx:for="{{assortArr}}" class="assortItem font48r" data-item="{{item}}" bindtap="checkItem"> |
| 157 | - {{item.name}} | 121 | + {{item.class_name}} |
| 158 | </view> | 122 | </view> |
| 159 | <image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode="" /> | 123 | <image class="assortImg" bindtap="closeClassifyModal" src="https://qn.colorcun.com/WechatIMG807.png" mode="" /> |
| 160 | </view> | 124 | </view> |
| 1 | /* pack-cookbook/pages/index_new.wxss */ | 1 | /* pack-cookbook/pages/index_new.wxss */ |
| 2 | page { | 2 | page { |
| 3 | background-color: #4d4e50; | 3 | background-color: #4d4e50; |
| 4 | + width: 100%; | ||
| 5 | + height: 100vh; | ||
| 6 | + display: block; | ||
| 7 | + overflow-y: auto; | ||
| 8 | + /* 重点 */ | ||
| 9 | + overflow-x: hidden; | ||
| 10 | + box-sizing: border-box; | ||
| 4 | } | 11 | } |
| 5 | 12 | ||
| 6 | .wrapIine { | 13 | .wrapIine { |
| @@ -65,6 +72,7 @@ page { | @@ -65,6 +72,7 @@ page { | ||
| 65 | 72 | ||
| 66 | .dishImg { | 73 | .dishImg { |
| 67 | width: 100%; | 74 | width: 100%; |
| 75 | + height: calc(100vw * 0.67) !important; | ||
| 68 | } | 76 | } |
| 69 | 77 | ||
| 70 | .greens { | 78 | .greens { |
| @@ -294,6 +302,7 @@ page { | @@ -294,6 +302,7 @@ page { | ||
| 294 | flex-direction: column; | 302 | flex-direction: column; |
| 295 | align-items: center; | 303 | align-items: center; |
| 296 | padding-top: 20%; | 304 | padding-top: 20%; |
| 305 | + position: relative; | ||
| 297 | background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); | 306 | background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); |
| 298 | } | 307 | } |
| 299 | 308 | ||
| @@ -304,11 +313,13 @@ page { | @@ -304,11 +313,13 @@ page { | ||
| 304 | padding: 30rpx 0; | 313 | padding: 30rpx 0; |
| 305 | } | 314 | } |
| 306 | 315 | ||
| 307 | -.items { | 316 | +.underline { |
| 308 | text-decoration: underline; | 317 | text-decoration: underline; |
| 309 | } | 318 | } |
| 310 | 319 | ||
| 311 | .assortImg { | 320 | .assortImg { |
| 321 | + position: absolute !important; | ||
| 322 | + bottom: 30%; | ||
| 312 | margin-top: 30rpx; | 323 | margin-top: 30rpx; |
| 313 | width: 100rpx; | 324 | width: 100rpx; |
| 314 | height: 100rpx; | 325 | height: 100rpx; |
| 1 | +// pack-cookbook/pages/success_new.js | ||
| 2 | +import App from '../../utils/api'; | ||
| 3 | +Page({ | ||
| 4 | + /** | ||
| 5 | + * 页面的初始数据 | ||
| 6 | + */ | ||
| 7 | + data: { | ||
| 8 | + checkList: [], | ||
| 9 | + sellerName: '', | ||
| 10 | + sellerid: '', | ||
| 11 | + probablyPrice: '', | ||
| 12 | + marketing: {}, | ||
| 13 | + }, | ||
| 14 | + /** | ||
| 15 | + * 生命周期函数--监听页面加载 | ||
| 16 | + */ | ||
| 17 | + onLoad(options) { | ||
| 18 | + console.log('options', options); | ||
| 19 | + this.setData({ | ||
| 20 | + checkList: JSON.parse(options.arr), | ||
| 21 | + sellerName: options.sellerName, | ||
| 22 | + sellerid: options.sellerid, | ||
| 23 | + | ||
| 24 | + }) | ||
| 25 | + console.log(this.data.checkList); | ||
| 26 | + let probablyPrice = 0; | ||
| 27 | + this.data.checkList.forEach(items => { | ||
| 28 | + items.arr.forEach(item => { | ||
| 29 | + let price = item.quantum * 1 * (item.price * 1) | ||
| 30 | + probablyPrice += price | ||
| 31 | + }) | ||
| 32 | + }) | ||
| 33 | + this.setData({ | ||
| 34 | + probablyPrice | ||
| 35 | + }) | ||
| 36 | + this.getSellerTemplateConfFun() | ||
| 37 | + }, | ||
| 38 | + determineFun() { | ||
| 39 | + wx.navigateTo({ | ||
| 40 | + url: `/pack-cookbook/pages/success_new?arr=${JSON.stringify(this.data.checkList)}&sellerName=${this.data.sellerName}`, | ||
| 41 | + }) | ||
| 42 | + }, | ||
| 43 | + getSellerTemplateConfFun(sid) { | ||
| 44 | + console.log(sid, 'sidsidsidsid'); | ||
| 45 | + App.Seller.GetSellerTemplateConf({ | ||
| 46 | + sid: this.data.sellerid | ||
| 47 | + }).then(res => { | ||
| 48 | + let data = res.data | ||
| 49 | + console.log('data', data); | ||
| 50 | + let marketing, coupon_data, priceInfo, scoreInfo, recharge_list, stringifyUse; | ||
| 51 | + marketing = data.marketing ? JSON.parse(data.marketing) : ''; | ||
| 52 | + console.log('marketing', marketing); | ||
| 53 | + if (marketing.coupon_data) { | ||
| 54 | + coupon_data = marketing.coupon_data; | ||
| 55 | + stringifyUse = JSON.stringify(marketing.coupon_data.use) | ||
| 56 | + } | ||
| 57 | + console.log('coupon_data', coupon_data); | ||
| 58 | + console.log('stringifyUse', stringifyUse); | ||
| 59 | + if (marketing.is_recharge == '1' && marketing.recharge_data) { | ||
| 60 | + let recharge_data = marketing.recharge_data | ||
| 61 | + recharge_list = marketing.recharge_data.recharge_list | ||
| 62 | + if (recharge_list.is_price == '1') priceInfo = '会员充值满' + recharge_data.recharge_money + '元赠送' + recharge_list.price + '元余额'; | ||
| 63 | + if (recharge_list.is_score == '1') scoreInfo = '会员充值满' + recharge_data.recharge_money + '元赠送' + recharge_list.score + '积分'; | ||
| 64 | + console.log('scoreInfo', scoreInfo); | ||
| 65 | + console.log('priceInfo', priceInfo); | ||
| 66 | + this.setData({ | ||
| 67 | + recharge_data: marketing.recharge_data | ||
| 68 | + }) | ||
| 69 | + console.log('recharge_data', recharge_data); | ||
| 70 | + } | ||
| 71 | + this.setData({ | ||
| 72 | + coupon_data, | ||
| 73 | + stringifyUse | ||
| 74 | + }) | ||
| 75 | + // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 | ||
| 76 | + if (marketing.is_coupon == '1' && coupon_data && (!coupon_data.use.is_cash || coupon_data.use.is_cash == '1')) { | ||
| 77 | + let cash = coupon_data.use.cash; | ||
| 78 | + let price = coupon_data.price * 1; | ||
| 79 | + let discount = ((price / cash) * 10).toFixed(2); | ||
| 80 | + console.log('cash', cash); | ||
| 81 | + console.log('price', price); | ||
| 82 | + console.log('discount', discount); | ||
| 83 | + this.setData({ | ||
| 84 | + discount | ||
| 85 | + }) | ||
| 86 | + } | ||
| 87 | + this.setData({ | ||
| 88 | + marketing, | ||
| 89 | + priceInfo, | ||
| 90 | + scoreInfo | ||
| 91 | + }) | ||
| 92 | + }).catch(res => { | ||
| 93 | + console.log('GetSellerTemplateConf请求失败'); | ||
| 94 | + }) | ||
| 95 | + }, | ||
| 96 | + /** | ||
| 97 | + * 生命周期函数--监听页面初次渲染完成 | ||
| 98 | + */ | ||
| 99 | + onReady() { | ||
| 100 | + | ||
| 101 | + }, | ||
| 102 | + | ||
| 103 | + /** | ||
| 104 | + * 生命周期函数--监听页面显示 | ||
| 105 | + */ | ||
| 106 | + onShow() { | ||
| 107 | + | ||
| 108 | + }, | ||
| 109 | + | ||
| 110 | + /** | ||
| 111 | + * 生命周期函数--监听页面隐藏 | ||
| 112 | + */ | ||
| 113 | + onHide() { | ||
| 114 | + | ||
| 115 | + }, | ||
| 116 | + | ||
| 117 | + /** | ||
| 118 | + * 生命周期函数--监听页面卸载 | ||
| 119 | + */ | ||
| 120 | + onUnload() { | ||
| 121 | + | ||
| 122 | + }, | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 页面相关事件处理函数--监听用户下拉动作 | ||
| 126 | + */ | ||
| 127 | + onPullDownRefresh() { | ||
| 128 | + | ||
| 129 | + }, | ||
| 130 | + | ||
| 131 | + /** | ||
| 132 | + * 页面上拉触底事件的处理函数 | ||
| 133 | + */ | ||
| 134 | + onReachBottom() { | ||
| 135 | + | ||
| 136 | + }, | ||
| 137 | + | ||
| 138 | + /** | ||
| 139 | + * 用户点击右上角分享 | ||
| 140 | + */ | ||
| 141 | + onShareAppMessage() { | ||
| 142 | + | ||
| 143 | + } | ||
| 144 | +}) |
| 1 | +<!--pack-cookbook/pages/success_new.wxml--> | ||
| 2 | +<nav backgroundColor="#4d4e50" color="#fff">{{sellerName||'提交订单'}}</nav> | ||
| 3 | +<scroll-view class="main"> | ||
| 4 | + <view class="info flex-lr"> | ||
| 5 | + <view class="texts font28r">就餐时间:</view> | ||
| 6 | + <view class="texts_right font28r">2023年4月18日 午餐</view> | ||
| 7 | + </view> | ||
| 8 | + <view class="info flex-lr"> | ||
| 9 | + <view class="texts font28r">桌位台号:</view> | ||
| 10 | + <view class="texts_right font28r">二楼包间 南京</view> | ||
| 11 | + </view> | ||
| 12 | + <view class="info flex-lr"> | ||
| 13 | + <view class="texts font28r">就餐人数:</view> | ||
| 14 | + <view class="texts font28r">8</view> | ||
| 15 | + </view> | ||
| 16 | + <view class="info flex-lr"> | ||
| 17 | + <view class="texts font28r">备注信息:</view> | ||
| 18 | + <input type="text" placeholder="点击录入口味,偏好等要求" placeholder-style="color:#fff" /> | ||
| 19 | + </view> | ||
| 20 | + <view class="line"></view> | ||
| 21 | + <view class="checkMenu"> | ||
| 22 | + <block wx:for="{{checkList}}" wx:key="{{item.id}}" wx:for-index="indexs"> | ||
| 23 | + <view class="title flex-lr"> | ||
| 24 | + <view class="leftTitle">{{item.class_name}}</view> | ||
| 25 | + <view class="rightTitle">{{item.arr.length}}道</view> | ||
| 26 | + </view> | ||
| 27 | + <view class="content flex-lr" wx:for="{{item.arr}}" wx:key="{{item.id}}" wx:for-index="index"> | ||
| 28 | + <view class="single">{{item.name}}<text>({{item.practice}})</text></view> | ||
| 29 | + <view class="price">{{item.price}}元/{{item.unit}}</view> | ||
| 30 | + <view class="count"> | ||
| 31 | + <image src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" /> | ||
| 32 | + {{item.quantum}} | ||
| 33 | + <image src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" /> | ||
| 34 | + </view> | ||
| 35 | + </view> | ||
| 36 | + </block> | ||
| 37 | + <view class="probably flex-ll"> | ||
| 38 | + <view class="tariff font24r">预计金额:<text class="font32r">{{probablyPrice}}</text>元</view> | ||
| 39 | + <view class="tariff font24r">会员价:<text class="font32r">{{probablyPrice}}</text>元</view> | ||
| 40 | + </view> | ||
| 41 | + <view class="information font36r">特别优惠</view> | ||
| 42 | + <view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view> | ||
| 43 | + <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}"> | ||
| 44 | + <view class="rubric rubric1"> | ||
| 45 | + 特别优惠 | ||
| 46 | + </view> | ||
| 47 | + <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}"> | ||
| 48 | + <view class="left"> | ||
| 49 | + <view class="top"> | ||
| 50 | + <text>{{coupon_data.aname}}</text> | ||
| 51 | + <text class="price" wx:if="{{coupon_data.price}}">¥{{coupon_data.price}}</text> | ||
| 52 | + <!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 --> | ||
| 53 | + <text wx:if="{{discount!='0.00' && (coupon_data.use.is_cash=='1' || coupon_data.use.is_cash)}}" class="discount">{{discount}}折</text> | ||
| 54 | + </view> | ||
| 55 | + <view wx:if="{{coupon_data.exp_date.is_week=='1' || coupon_data.exp_date.is_week===true}}" class="bottom"> | ||
| 56 | + {{coupon_data.exp_date.week_show?coupon_data.exp_date.week_show+'可用':''}}{{coupon_data.desc?','+coupon_data.desc+'。':'。'}} | ||
| 57 | + </view> | ||
| 58 | + <view wx:if="{{coupon_data.exp_date.is_none=='1' || coupon_data.exp_date.is_none===true}}" class="bottom"> | ||
| 59 | + 无限制{{coupon_data.desc?','+coupon_data.desc+'。':'。'}} | ||
| 60 | + </view> | ||
| 61 | + <view wx:if="{{coupon_data.exp_date.is_birthday=='1' || coupon_data.exp_date.is_birthday===true}}" class="bottom"> | ||
| 62 | + 会员生日当天可用{{coupon_data.desc?','+coupon_data.desc+'。':'。'}} | ||
| 63 | + </view> | ||
| 64 | + </view> | ||
| 65 | + <navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{seller.name}}&use={{stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}" hover-class="navigator-hover"> | ||
| 66 | + <view class="font24r orderingFood"> | ||
| 67 | + 去抢购 | ||
| 68 | + </view> | ||
| 69 | + </navigator> | ||
| 70 | + </view> | ||
| 71 | + <!-- 当前日期要大于限制结束日期 --> | ||
| 72 | + <view class="preferentialItems" wx:if="{{marketing && marketing.is_recharge=='1' && recharge_data && (is_fix!='1' || (is_fix=='1' && dataStr<(recharge_data.exp_date.fix_edate*1)))}}"> | ||
| 73 | + <view class="left"> | ||
| 74 | + <view class="top"> | ||
| 75 | + <text>{{recharge_data.rname}}</text> | ||
| 76 | + </view> | ||
| 77 | + <view class="bottom" wx:if="{{priceInfo}}"> | ||
| 78 | + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}} | ||
| 79 | + </view> | ||
| 80 | + <view class="bottom" wx:if="{{scoreInfo}}"> | ||
| 81 | + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}} | ||
| 82 | + </view> | ||
| 83 | + <view class="bottom" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}"> | ||
| 84 | + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。 | ||
| 85 | + </view> | ||
| 86 | + </view> | ||
| 87 | + <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}" hover-class="navigator-hover"> | ||
| 88 | + <view class="font24r orderingFood"> | ||
| 89 | + 去充值 | ||
| 90 | + </view> | ||
| 91 | + </navigator> | ||
| 92 | + </view> | ||
| 93 | + </view> | ||
| 94 | + </view> | ||
| 95 | +</scroll-view> | ||
| 96 | +<view class="btns flex-cc"> | ||
| 97 | + <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button> | ||
| 98 | + <button class="font32r determine flex-cc" bindtap="determineFun">确认下单</button> | ||
| 99 | +</view> |
| 1 | +/* pack-cookbook/pages/success_new.wxss */ | ||
| 2 | +page { | ||
| 3 | + background: #4d4e50; | ||
| 4 | +} | ||
| 5 | + | ||
| 6 | +.main { | ||
| 7 | + padding: 0 20rpx 148rpx 20rpx; | ||
| 8 | + font-family: PingFang SC; | ||
| 9 | + width: 100%; | ||
| 10 | + box-sizing: border-box; | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +.info { | ||
| 14 | + margin-bottom: 16rpx; | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +.texts { | ||
| 18 | + color: #ffffff; | ||
| 19 | + font-weight: 500; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +.texts_right { | ||
| 23 | + color: #999999; | ||
| 24 | + font-weight: 500; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +.info input { | ||
| 28 | + color: #fff; | ||
| 29 | + text-align: right; | ||
| 30 | + flex: 1; | ||
| 31 | + margin-left: 20rpx; | ||
| 32 | + font-size: 28rpx; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +.line { | ||
| 36 | + margin-bottom: 8rpx; | ||
| 37 | + height: 2rpx; | ||
| 38 | + background: #999999; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +.checkMenu { | ||
| 42 | + border-radius: 10rpx; | ||
| 43 | + background: #ffffff; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +.title { | ||
| 47 | + padding: 36rpx 0 4rpx 0; | ||
| 48 | + margin: 0 40rpx; | ||
| 49 | + border-bottom: 2rpx solid #DBDBDB; | ||
| 50 | +} | ||
| 51 | + | ||
| 52 | +.leftTitle { | ||
| 53 | + color: #515151; | ||
| 54 | + font-family: PingFang SC; | ||
| 55 | + font-weight: 600; | ||
| 56 | + font-size: 32rpx; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +.rightTitle { | ||
| 60 | + color: #515151; | ||
| 61 | + font-family: PingFang SC; | ||
| 62 | + font-size: 28rpx; | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +.content { | ||
| 66 | + padding: 20rpx 40rpx; | ||
| 67 | +} | ||
| 68 | + | ||
| 69 | +.count text { | ||
| 70 | + font-weight: bold; | ||
| 71 | + color: #515151; | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | +.img1 { | ||
| 75 | + width: 28rpx; | ||
| 76 | + height: 24rpx; | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +.img2 { | ||
| 80 | + width: 24rpx; | ||
| 81 | + height: 24rpx; | ||
| 82 | +} | ||
| 83 | + | ||
| 84 | +.probably { | ||
| 85 | + border-top: 2rpx solid #DBDBDB; | ||
| 86 | + color: #515151; | ||
| 87 | + font-family: PingFang SC; | ||
| 88 | + padding: 30rpx 40rpx 52rpx 40rpx; | ||
| 89 | +} | ||
| 90 | + | ||
| 91 | +.tariff { | ||
| 92 | + width: 50%; | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +.btns { | ||
| 96 | + width: 100%; | ||
| 97 | + position: fixed; | ||
| 98 | + bottom: 0; | ||
| 99 | + height: 128rpx; | ||
| 100 | + z-index: 10; | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +.btns button { | ||
| 104 | + width: 50%; | ||
| 105 | + box-sizing: border-box; | ||
| 106 | + color: #fff; | ||
| 107 | + height: 100%; | ||
| 108 | + border-radius: 0; | ||
| 109 | +} | ||
| 110 | + | ||
| 111 | +.information { | ||
| 112 | + color: #515151; | ||
| 113 | + font-weight: 500; | ||
| 114 | + margin: 0 40rpx; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +.continue { | ||
| 118 | + background: #4d4e50; | ||
| 119 | + border: 2rpx solid #094ba4; | ||
| 120 | +} | ||
| 121 | + | ||
| 122 | +.poop { | ||
| 123 | + margin: 20rpx 40rpx; | ||
| 124 | +} | ||
| 125 | + | ||
| 126 | +.determine { | ||
| 127 | + background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); | ||
| 128 | + | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + | ||
| 136 | +.orderingFood { | ||
| 137 | + padding: 4rpx 20rpx; | ||
| 138 | + color: #fff; | ||
| 139 | + border-radius: 22rpx; | ||
| 140 | + text-align: center; | ||
| 141 | + background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); | ||
| 142 | + margin: 20rpx 0; | ||
| 143 | + line-height: 50rpx; | ||
| 144 | + height: 50rpx; | ||
| 145 | +} | ||
| 146 | + | ||
| 147 | +.preferential { | ||
| 148 | + margin: 16rpx 40rpx; | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +.preferentialItems { | ||
| 152 | + border: 2rpx solid #DBDBDB; | ||
| 153 | + border-radius: 16rpx; | ||
| 154 | + padding: 16rpx 16rpx 16rpx 24rpx; | ||
| 155 | + margin-bottom: 20rpx; | ||
| 156 | + display: flex; | ||
| 157 | + justify-content: space-between; | ||
| 158 | +} | ||
| 159 | + | ||
| 160 | +.rubric1 { | ||
| 161 | + margin: 30rpx 0; | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | +.left { | ||
| 165 | + flex: 1; | ||
| 166 | + margin-right: 20rpx; | ||
| 167 | +} | ||
| 168 | + | ||
| 169 | +.top { | ||
| 170 | + display: flex; | ||
| 171 | + width: 100%; | ||
| 172 | + align-items: center; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +.bottom { | ||
| 176 | + margin-top: 20rpx; | ||
| 177 | + color: #515151; | ||
| 178 | + font-family: PingFang SC; | ||
| 179 | + font-weight: 500; | ||
| 180 | + font-size: 20rpx; | ||
| 181 | + display: -webkit-box; | ||
| 182 | + word-break: break-all; | ||
| 183 | + word-wrap: break-word; | ||
| 184 | + overflow: hidden; | ||
| 185 | + text-align: left; | ||
| 186 | +} | ||
| 187 | + | ||
| 188 | +.top text:nth-of-type(1) { | ||
| 189 | + font-size: 30rpx; | ||
| 190 | + font-weight: 600; | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | +.top .discount { | ||
| 194 | + padding: 0 10rpx; | ||
| 195 | + color: #E34D59; | ||
| 196 | + border: 2rpx solid #E34D59; | ||
| 197 | + border-radius: 6rpx; | ||
| 198 | + margin: 0 10rpx 0 20rpx; | ||
| 199 | + font-family: PingFang SC; | ||
| 200 | + font-size: 14rpx; | ||
| 201 | + height: 30rpx; | ||
| 202 | + line-height: 30rpx; | ||
| 203 | +} | ||
| 204 | + | ||
| 205 | +.top .price { | ||
| 206 | + color: #E34D59; | ||
| 207 | +} |
| @@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
| 11 | .blueTitleImg { | 11 | .blueTitleImg { |
| 12 | background: #0143A3; | 12 | background: #0143A3; |
| 13 | } | 13 | } |
| 14 | + | ||
| 14 | .greenTitleImg { | 15 | .greenTitleImg { |
| 15 | background: #438E93; | 16 | background: #438E93; |
| 16 | } | 17 | } |
| @@ -160,9 +161,11 @@ | @@ -160,9 +161,11 @@ | ||
| 160 | height: 110rpx; | 161 | height: 110rpx; |
| 161 | justify-content: space-between; | 162 | justify-content: space-between; |
| 162 | } | 163 | } |
| 163 | -.handlePhone{ | 164 | + |
| 165 | +.handlePhone { | ||
| 164 | height: 100rpx; | 166 | height: 100rpx; |
| 165 | } | 167 | } |
| 168 | + | ||
| 166 | .brownFont { | 169 | .brownFont { |
| 167 | padding: 4rpx 16rpx; | 170 | padding: 4rpx 16rpx; |
| 168 | color: #0143A3; | 171 | color: #0143A3; |
| @@ -178,9 +181,11 @@ | @@ -178,9 +181,11 @@ | ||
| 178 | .handle text { | 181 | .handle text { |
| 179 | margin-bottom: 20rpx; | 182 | margin-bottom: 20rpx; |
| 180 | } | 183 | } |
| 181 | -.handle text:nth-of-type(2){ | 184 | + |
| 185 | +.handle text:nth-of-type(2) { | ||
| 182 | margin-bottom: 0; | 186 | margin-bottom: 0; |
| 183 | } | 187 | } |
| 188 | + | ||
| 184 | .positioning { | 189 | .positioning { |
| 185 | margin: 16rpx 26rpx; | 190 | margin: 16rpx 26rpx; |
| 186 | display: flex; | 191 | display: flex; |
| @@ -238,10 +243,12 @@ | @@ -238,10 +243,12 @@ | ||
| 238 | .imgMask { | 243 | .imgMask { |
| 239 | position: relative; | 244 | position: relative; |
| 240 | } | 245 | } |
| 241 | -.imgMask image{ | ||
| 242 | - height: calc(100vw * 353/430) !important; | 246 | + |
| 247 | +.imgMask image { | ||
| 248 | + height: calc(100vw * 0.82) !important; | ||
| 243 | margin-bottom: 18rpx; | 249 | margin-bottom: 18rpx; |
| 244 | } | 250 | } |
| 251 | + | ||
| 245 | .introduce .chief { | 252 | .introduce .chief { |
| 246 | top: 0; | 253 | top: 0; |
| 247 | left: 0; | 254 | left: 0; |
| @@ -287,9 +294,11 @@ | @@ -287,9 +294,11 @@ | ||
| 287 | -webkit-line-clamp: 10; | 294 | -webkit-line-clamp: 10; |
| 288 | padding-left: 20rpx; | 295 | padding-left: 20rpx; |
| 289 | } | 296 | } |
| 297 | + | ||
| 290 | .labelBox2 .label { | 298 | .labelBox2 .label { |
| 291 | height: 400rpx; | 299 | height: 400rpx; |
| 292 | } | 300 | } |
| 301 | + | ||
| 293 | .labelBox .styleLabel { | 302 | .labelBox .styleLabel { |
| 294 | color: #999999; | 303 | color: #999999; |
| 295 | } | 304 | } |
| @@ -305,9 +314,11 @@ | @@ -305,9 +314,11 @@ | ||
| 305 | .labelBox1 .line { | 314 | .labelBox1 .line { |
| 306 | margin: 0 0 0 16rpx; | 315 | margin: 0 0 0 16rpx; |
| 307 | } | 316 | } |
| 308 | -.labelBox .line1{ | 317 | + |
| 318 | +.labelBox .line1 { | ||
| 309 | margin: 0 0 0 16rpx; | 319 | margin: 0 0 0 16rpx; |
| 310 | } | 320 | } |
| 321 | + | ||
| 311 | .IntroductionItems image { | 322 | .IntroductionItems image { |
| 312 | width: 100%; | 323 | width: 100%; |
| 313 | display: block; | 324 | display: block; |
| @@ -343,9 +354,11 @@ | @@ -343,9 +354,11 @@ | ||
| 343 | text-align: right; | 354 | text-align: right; |
| 344 | box-sizing: border-box; | 355 | box-sizing: border-box; |
| 345 | } | 356 | } |
| 346 | -.famousChefBox .styleSeparate2 image{ | 357 | + |
| 358 | +.famousChefBox .styleSeparate2 image { | ||
| 347 | width: 100%; | 359 | width: 100%; |
| 348 | } | 360 | } |
| 361 | + | ||
| 349 | .vegetableBox .IntroduceColor { | 362 | .vegetableBox .IntroduceColor { |
| 350 | top: 0; | 363 | top: 0; |
| 351 | right: 0; | 364 | right: 0; |
| @@ -591,23 +604,28 @@ | @@ -591,23 +604,28 @@ | ||
| 591 | background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); | 604 | background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); |
| 592 | color: #fff; | 605 | color: #fff; |
| 593 | } | 606 | } |
| 594 | -.sharewidth .shareItem{ | 607 | + |
| 608 | +.sharewidth .shareItem { | ||
| 595 | width: 100% !important; | 609 | width: 100% !important; |
| 596 | } | 610 | } |
| 597 | -.between .shareItem{ | 611 | + |
| 612 | +.between .shareItem { | ||
| 598 | width: 65% !important; | 613 | width: 65% !important; |
| 599 | } | 614 | } |
| 615 | + | ||
| 600 | .book-item-font { | 616 | .book-item-font { |
| 601 | width: 40% !important; | 617 | width: 40% !important; |
| 602 | } | 618 | } |
| 603 | -.menu-item{ | 619 | + |
| 620 | +.menu-item { | ||
| 604 | width: 100%; | 621 | width: 100%; |
| 605 | height: 100%; | 622 | height: 100%; |
| 606 | display: flex; | 623 | display: flex; |
| 607 | - justify-content: center; | ||
| 608 | - align-items: center; | 624 | + justify-content: center; |
| 625 | + align-items: center; | ||
| 609 | } | 626 | } |
| 610 | -.cook{ | 627 | + |
| 628 | +.cook { | ||
| 611 | height: 100% !important; | 629 | height: 100% !important; |
| 612 | background: linear-gradient(104.24deg, rgba(76, 141, 173, 1) -57.47%, rgba(1, 67, 163, 1) 55.72%, rgba(66, 165, 255, 1) 148.72%); | 630 | background: linear-gradient(104.24deg, rgba(76, 141, 173, 1) -57.47%, rgba(1, 67, 163, 1) 55.72%, rgba(66, 165, 255, 1) 148.72%); |
| 613 | color: #fff !important; | 631 | color: #fff !important; |
-
Please register or login to post a comment