Commit b20afeee0fc5b96657c5fb9e0451ef72af6c59e0

Authored by yiren
1 parent 3b36561a

提前点餐

@@ -13,6 +13,7 @@ Page({ @@ -13,6 +13,7 @@ Page({
13 oid:'', 13 oid:'',
14 sid:'', 14 sid:'',
15 types:'1',//1是邀请函过来的 15 types:'1',//1是邀请函过来的
  16 + rid:'',
16 }, 17 },
17 use:{}, 18 use:{},
18 detail:{}, 19 detail:{},
@@ -33,7 +34,8 @@ Page({ @@ -33,7 +34,8 @@ Page({
33 name:options.name, 34 name:options.name,
34 sid:options.sid, 35 sid:options.sid,
35 oid:options.oid, 36 oid:options.oid,
36 - types:options.types 37 + types:options.types,
  38 + rid:options.rid?options.rid:'',
37 } 39 }
38 }) 40 })
39 console.log('onLoad',{...this.data.opt}); 41 console.log('onLoad',{...this.data.opt});
@@ -143,7 +145,7 @@ Page({ @@ -143,7 +145,7 @@ Page({
143 return 145 return
144 } 146 }
145 wx.navigateTo({ 147 wx.navigateTo({
146 - url: `./confirmPayment?type=1&detail=${JSON.stringify(detail)}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.totalize}&types=${this.data.opt.types}`, 148 + url: `./confirmPayment?sid=${this.data.opt.sid}&sellerName=${this.data.opt.name}&oid=${this.data.opt.oid}&rid=${this.data.opt.rid?this.data.opt.rid:''}&type=1&detail=${JSON.stringify(detail)}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.totalize}&types=${this.data.opt.types}`,
147 }) 149 })
148 }else{ 150 }else{
149 wx.showToast({ 151 wx.showToast({
1 // pack-activity/pack/confirmPayment.js 1 // pack-activity/pack/confirmPayment.js
2 -import util, { unixtoTime } from '../../utils/util'; 2 +import util, {
  3 + unixtoTime
  4 +} from '../../utils/util';
3 import App from '../../utils/api'; 5 import App from '../../utils/api';
4 Page({ 6 Page({
5 7
@@ -7,156 +9,126 @@ Page({ @@ -7,156 +9,126 @@ Page({
7 * 页面的初始数据 9 * 页面的初始数据
8 */ 10 */
9 data: { 11 data: {
10 - opt:{  
11 - detail:{},  
12 - combine_out_trade_no:'',  
13 - totalize:'',  
14 - types:'', 12 + opt: {
  13 + detail: {},
  14 + combine_out_trade_no: '',
  15 + totalize: '',
  16 + types: '',
15 }, 17 },
16 type: '', 18 type: '',
17 time: 300, 19 time: 300,
18 countdown: '', 20 countdown: '',
19 - name:"", 21 + name: "",
20 date: "", 22 date: "",
21 - phone:"",  
22 - calendarData:'',  
23 - sex:"先生",  
24 - indexs:0,  
25 - sexList:[  
26 - {  
27 - sex:'先生',  
28 - value:'1', 23 + phone: "",
  24 + calendarData: '',
  25 + sex: "先生",
  26 + indexs: 0,
  27 + sexList: [{
  28 + sex: '先生',
  29 + value: '1',
29 }, 30 },
30 { 31 {
31 - sex:'女士',  
32 - value:'2', 32 + sex: '女士',
  33 + value: '2',
33 }, 34 },
34 { 35 {
35 - sex:'公司',  
36 - value:'3', 36 + sex: '公司',
  37 + value: '3',
37 } 38 }
38 ] 39 ]
39 }, 40 },
40 - modal:'', 41 + modal: '',
41 /** 42 /**
42 * 生命周期函数--监听页面加载 43 * 生命周期函数--监听页面加载
43 */ 44 */
44 onLoad(options) { 45 onLoad(options) {
45 this.setData({ 46 this.setData({
46 - opt:{  
47 - detail:options.detail?JSON.parse(options.detail):'',  
48 - combine_out_trade_no:options.combine_out_trade_no,  
49 - totalize:options.totalize?options.totalize:'',  
50 - sellerid:options.sellerid?options.sellerid:'',  
51 - types:options.types, 47 + opt: {
  48 + detail: options.detail ? JSON.parse(options.detail) : '',
  49 + combine_out_trade_no: options.combine_out_trade_no,
  50 + totalize: options.totalize ? options.totalize : '',
  51 + sid: options.sid ? options.sid : '',
  52 + types: options.types,
  53 + oid: options.oid ? options.oid : '',
  54 + rid: options.rid ? options.rid : '',
  55 + sellerName: options.sellerName ? options.sellerName : '',
52 }, 56 },
53 - type:options.type, 57 + type: options.type,
54 }) 58 })
55 console.log('onLoad',{...this.data.opt}); 59 console.log('onLoad',{...this.data.opt});
56 - let obj=wx.getStorageSync('info') 60 + let obj = wx.getStorageSync('info')
57 console.log('objobjobjobj',{...obj}) 61 console.log('objobjobjobj',{...obj})
58 - if(obj){ 62 + if (obj) {
59 this.setData({ 63 this.setData({
60 - name:obj.name,  
61 - date:obj.date,  
62 - phone:obj.phone,  
63 - indexs:obj.sex*1-1,  
64 - calendarData:obj.calendarData, 64 + name: obj.name,
  65 + date: obj.date,
  66 + phone: obj.phone,
  67 + indexs: obj.sex * 1 - 1,
  68 + calendarData: obj.calendarData,
65 }) 69 })
66 } 70 }
67 this.countdown() 71 this.countdown()
68 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件 72 this.modal = this.selectComponent("#payModal"); //通过给组件所起的id调用组件
69 }, 73 },
70 - // 购买完成券之后关注公众号  
71 - wananchi() { 74 + // 购买完成券之后关注公众号
  75 + wananchi() {
72 this.closeModal() 76 this.closeModal()
73 - wx.navigateTo({  
74 - url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`  
75 - })  
76 - }, 77 + wx.navigateTo({
  78 + url: `/pages/me/wananchi?type=1&oid=${this.data.opt.detail.oid}`
  79 + })
  80 + },
77 showModal() { 81 showModal() {
78 this.modal.showModal() //调用组件中打开模态框方法 82 this.modal.showModal() //调用组件中打开模态框方法
79 }, 83 },
80 - confirmPayment(){ 84 + confirmPayment() {
81 App.PayOnline.CombineTransactionsByNewRecharge({ 85 App.PayOnline.CombineTransactionsByNewRecharge({
82 - combine_out_trade_no:this.data.opt.combine_out_trade_no  
83 - }).then(res=>{ 86 + combine_out_trade_no: this.data.opt.combine_out_trade_no
  87 + }).then(res => {
84 console.log(res.data); 88 console.log(res.data);
85 - let that=this;  
86 - if(res.ret!='200'){ 89 + let that = this;
  90 + if (res.ret != '200') {
87 wx.showToast({ 91 wx.showToast({
88 title: res.msg, 92 title: res.msg,
89 duration: 1000, 93 duration: 1000,
90 - icon:'none', 94 + icon: 'none',
91 success: function () { 95 success: function () {
92 - console.log('支付失败',that.data.opt.types);  
93 - let url='';  
94 - if(that.data.opt.types=='1'){  
95 - url='/pages/customer/detail_owner_invitation_new?id='+that.data.opt.detail.oid;  
96 - }  
97 - if(that.data.opt.types=='2'){  
98 - url='/pack-cookbook/pages/success_new';  
99 - }  
100 - if(that.data.opt.types=='3'){  
101 - url='/pages/reserve/index';  
102 - }  
103 - setTimeout(function () {  
104 - wx.reLaunch({  
105 - url  
106 - })  
107 - }, 1000); 96 + console.log('支付失败', that.data.opt.types);
  97 + that.callbackFun()
108 } 98 }
109 }) 99 })
110 } 100 }
111 - if(res.ret=='200'){ 101 + if (res.ret == '200') {
112 console.log(res.ret); 102 console.log(res.ret);
113 wx.requestPayment({ 103 wx.requestPayment({
114 - timeStamp: res.data.timeStamp+'', 104 + timeStamp: res.data.timeStamp + '',
115 nonceStr: res.data.nonceStr, 105 nonceStr: res.data.nonceStr,
116 package: res.data.package, 106 package: res.data.package,
117 signType: res.data.signType, 107 signType: res.data.signType,
118 paySign: res.data.paySign, 108 paySign: res.data.paySign,
119 - success (ress) { 109 + success(ress) {
120 if (ress.errMsg == 'requestPayment:ok') { 110 if (ress.errMsg == 'requestPayment:ok') {
121 - console.log('支付成功',ress); 111 + console.log('支付成功', ress);
122 return that.showModal() 112 return that.showModal()
123 } 113 }
124 - console.log('支付失败',ress); 114 + console.log('支付失败', ress);
125 wx.showToast({ 115 wx.showToast({
126 title: '支付失败,请重新下单', 116 title: '支付失败,请重新下单',
127 duration: 1000, 117 duration: 1000,
128 success: function () { 118 success: function () {
129 - setTimeout(function () {  
130 - wx.reLaunch({  
131 - url: `/pages/customer/detail_owner_invitation_new?id=${that.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1`  
132 - })  
133 - }, 1000); 119 + that.callbackFun()
134 } 120 }
135 }) 121 })
136 }, 122 },
137 - fail (ress) {  
138 - console.log('支付失败',ress); 123 + fail(ress) {
  124 + console.log('支付失败', ress);
139 wx.showToast({ 125 wx.showToast({
140 title: '支付失败,请重新下单', 126 title: '支付失败,请重新下单',
141 duration: 1000, 127 duration: 1000,
142 - icon:'none', 128 + icon: 'none',
143 success: function () { 129 success: function () {
144 - console.log('支付失败',that.data.opt.types);  
145 - let url='';  
146 - if(that.data.opt.types=='1'){  
147 - url='/pages/customer/detail_owner_invitation_new?id='+that.data.opt.detail.oid;  
148 - }  
149 - if(that.data.opt.types=='2'){  
150 - url='/pack-cookbook/pages/success_new';  
151 - }  
152 - if(that.data.opt.types=='3'){  
153 - url='/pages/reserve/index';  
154 - }  
155 - setTimeout(function () {  
156 - wx.reLaunch({  
157 - url  
158 - })  
159 - }, 1000); 130 + console.log('支付失败', that.data.opt.types);
  131 + that.callbackFun()
160 } 132 }
161 }) 133 })
162 }, 134 },
@@ -164,32 +136,58 @@ Page({ @@ -164,32 +136,58 @@ Page({
164 } 136 }
165 }) 137 })
166 }, 138 },
  139 + // 支付失败回调 types 1邀请函 2提前点餐 3商家端app分享
  140 + callbackFun() {
  141 + let url = '';
  142 + let that = this;
  143 + if (that.data.opt.types == '1') {
  144 + url = '/pages/customer/detail_owner_invitation_new?id=' + that.data.opt.detail.oid;
  145 + }
  146 + if (that.data.opt.types == '2') {
  147 + let cookbookObj = {
  148 + sid: that.data.opt.sid,
  149 + sellerName: that.data.opt.sellerName,
  150 + oid: that.data.opt.oid,
  151 + hasSuccess: '1',
  152 + rid: that.data.opt.rid?that.data.opt.rid:''
  153 + }
  154 + url = `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`;
  155 + }
  156 + if (that.data.opt.types == '3') {
  157 + url = '/pages/reserve/index';
  158 + }
  159 + setTimeout(function () {
  160 + wx.reLaunch({
  161 + url
  162 + })
  163 + }, 1000);
  164 + },
167 // 充值后跳转 165 // 充值后跳转
168 - recharge(){  
169 - console.log('充值完成跳转',this.data.opt.detail.oid);  
170 - this.closeModal() 166 + recharge() {
  167 + console.log('充值完成跳转', this.data.opt.detail.oid);
  168 + this.closeModal()
171 wx.reLaunch({ 169 wx.reLaunch({
172 url: `/pages/customer/detail_owner_invitation_new?id=${this.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1` 170 url: `/pages/customer/detail_owner_invitation_new?id=${this.data.opt.detail.oid}&hasInvitation=1&hasSellerShare=1&tplid=1`
173 }) 171 })
174 }, 172 },
175 // 绑定名称 173 // 绑定名称
176 - bindKeyNameInput(event){ 174 + bindKeyNameInput(event) {
177 const value = event.detail.value.replace(/\s+/g, ""); 175 const value = event.detail.value.replace(/\s+/g, "");
178 this.setData({ 176 this.setData({
179 - name: value  
180 - }) 177 + name: value
  178 + })
181 console.log(value); 179 console.log(value);
182 }, 180 },
183 // 绑定电话 181 // 绑定电话
184 - bindKeyPhoneInput(event){ 182 + bindKeyPhoneInput(event) {
185 const value = event.detail.value.replace(/\s+/g, ""); 183 const value = event.detail.value.replace(/\s+/g, "");
186 this.setData({ 184 this.setData({
187 - phone: value  
188 - }) 185 + phone: value
  186 + })
189 console.log(value); 187 console.log(value);
190 }, 188 },
191 // 购买代金券后跳转 189 // 购买代金券后跳转
192 - certificate(){ 190 + certificate() {
193 console.log({...this.data.opt.detail}); 191 console.log({...this.data.opt.detail});
194 wx.reLaunch({ 192 wx.reLaunch({
195 url: '/pages/me/coupon_news' 193 url: '/pages/me/coupon_news'
@@ -200,11 +198,11 @@ Page({ @@ -200,11 +198,11 @@ Page({
200 }, 198 },
201 // 点击确认支付 199 // 点击确认支付
202 formSubmit() { 200 formSubmit() {
203 - if(this.data.time==0){ 201 + if (this.data.time == 0) {
204 return util.toast('当前订单已过期,请重新进入优惠券购买页面下单', 'none'); 202 return util.toast('当前订单已过期,请重新进入优惠券购买页面下单', 'none');
205 } 203 }
206 - if(this.data.type=='2'){  
207 - let data=this.data 204 + if (this.data.type == '2') {
  205 + let data = this.data
208 if (!data.name) { 206 if (!data.name) {
209 util.toast('未填写姓名', 'none') 207 util.toast('未填写姓名', 'none')
210 return; 208 return;
@@ -217,38 +215,38 @@ Page({ @@ -217,38 +215,38 @@ Page({
217 util.toast('手机号码错误', 'none') 215 util.toast('手机号码错误', 'none')
218 return; 216 return;
219 } 217 }
220 - let recharge_money=this.data.opt.detail.recharge_money*1;  
221 - if(recharge_money==0){ 218 + let recharge_money = this.data.opt.detail.recharge_money * 1;
  219 + if (recharge_money == 0) {
222 setTimeout(() => { 220 setTimeout(() => {
223 - util.toast('您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!','none',3000); 221 + util.toast('您的会员充值已经在办理中,到店消费时请和收银核实,谢谢!', 'none', 3000);
224 wx.navigateBack(1) 222 wx.navigateBack(1)
225 }, 3500); 223 }, 3500);
226 - return 224 + return
227 } 225 }
228 this.addInfo() 226 this.addInfo()
229 - }else{ 227 + } else {
230 this.confirmPayment() 228 this.confirmPayment()
231 } 229 }
232 }, 230 },
233 - addInfo(){  
234 - let params={  
235 - sellerid:this.data.opt.sellerid,  
236 - rname:this.data.name,  
237 - sex:this.data.indexs*1+1,//1男 2女 3公司  
238 - phone:this.data.phone,  
239 - c_day:this.data.calendarData 231 + addInfo() {
  232 + let params = {
  233 + sellerid: this.data.opt.sid,
  234 + rname: this.data.name,
  235 + sex: this.data.indexs * 1 + 1, //1男 2女 3公司
  236 + phone: this.data.phone,
  237 + c_day: this.data.calendarData
240 } 238 }
241 console.log({...params}); 239 console.log({...params});
242 - App.GuestManage.InsGuest(params).then(res=>{ 240 + App.GuestManage.InsGuest(params).then(res => {
243 console.log(res); 241 console.log(res);
244 - if(res.ret=='200'){ 242 + if (res.ret == '200') {
245 this.confirmPayment() 243 this.confirmPayment()
246 - let obj={  
247 - name:this.data.name,  
248 - phone:this.data.phone,  
249 - sex:this.data.indexs*1+1,  
250 - calendarData:this.data.calendarData,  
251 - date:this.data.date, 244 + let obj = {
  245 + name: this.data.name,
  246 + phone: this.data.phone,
  247 + sex: this.data.indexs * 1 + 1,
  248 + calendarData: this.data.calendarData,
  249 + date: this.data.date,
252 } 250 }
253 wx.setStorageSync('info', obj) 251 wx.setStorageSync('info', obj)
254 } 252 }
@@ -257,14 +255,14 @@ Page({ @@ -257,14 +255,14 @@ Page({
257 // 选择日期 255 // 选择日期
258 bind_ChangeDate(event) { 256 bind_ChangeDate(event) {
259 let date = event.detail.value 257 let date = event.detail.value
260 - var calendarData = new Date(date)*1; 258 + var calendarData = new Date(date) * 1;
261 this.setData({ 259 this.setData({
262 date, 260 date,
263 calendarData 261 calendarData
264 }) 262 })
265 }, 263 },
266 // 选择性别 264 // 选择性别
267 - bind_Changesex(event){ 265 + bind_Changesex(event) {
268 console.log('event.detail',{...event.detail}); 266 console.log('event.detail',{...event.detail});
269 let indexs = event.detail.value; 267 let indexs = event.detail.value;
270 this.setData({ 268 this.setData({
@@ -287,14 +285,14 @@ Page({ @@ -287,14 +285,14 @@ Page({
287 }, 285 },
288 // 倒计时 286 // 倒计时
289 countdown() { 287 countdown() {
290 - var minute = Math.floor(this.data.time*1 / 60); 288 + var minute = Math.floor(this.data.time * 1 / 60);
291 var second = this.data.time % 60; 289 var second = this.data.time % 60;
292 second < 10 ? second = '0' + second : ''; 290 second < 10 ? second = '0' + second : '';
293 this.setData({ 291 this.setData({
294 countdown: minute + ':' + second, 292 countdown: minute + ':' + second,
295 time: this.data.time - 1 293 time: this.data.time - 1
296 }) 294 })
297 - if(this.data.time==0){ 295 + if (this.data.time == 0) {
298 this.setData({ 296 this.setData({
299 countdown: '0:00' 297 countdown: '0:00'
300 }) 298 })
@@ -303,21 +301,21 @@ Page({ @@ -303,21 +301,21 @@ Page({
303 setTimeout(this.countdown, 1000); 301 setTimeout(this.countdown, 1000);
304 }, 302 },
305 // 返回 303 // 返回
306 - navEvent(){ 304 + navEvent() {
307 // 1 邀请函 2 提前点餐 3商家端分享 305 // 1 邀请函 2 提前点餐 3商家端分享
308 - if(this.data.opt.types=='1'){ 306 + if (this.data.opt.types == '1') {
309 return wx.reLaunch({ 307 return wx.reLaunch({
310 - url: '/pages/customer/detail_owner_invitation_new?id='+this.data.opt.detail.oid, 308 + url: '/pages/customer/detail_owner_invitation_new?id=' + this.data.opt.detail.oid,
311 }) 309 })
312 } 310 }
313 - if(this.data.opt.types=='2'){ 311 + if (this.data.opt.types == '2') {
314 return wx.reLaunch({ 312 return wx.reLaunch({
315 - url: '/pack-cookbook/pages/success_new', 313 + url: '/pack-cookbook/pages/success_new',
316 }) 314 })
317 } 315 }
318 - if(this.data.opt.types=='3'){ 316 + if (this.data.opt.types == '3') {
319 return wx.reLaunch({ 317 return wx.reLaunch({
320 - url: '/pages/reserve/index', 318 + url: '/pages/reserve/index',
321 }) 319 })
322 } 320 }
323 }, 321 },
@@ -13,6 +13,7 @@ Page({ @@ -13,6 +13,7 @@ Page({
13 sid:'', 13 sid:'',
14 oid:'', 14 oid:'',
15 types:'', 15 types:'',
  16 + rid:'',
16 }, 17 },
17 exp_date:{}, 18 exp_date:{},
18 detail:{}, 19 detail:{},
@@ -23,6 +24,7 @@ Page({ @@ -23,6 +24,7 @@ Page({
23 * 生命周期函数--监听页面加载 24 * 生命周期函数--监听页面加载
24 */ 25 */
25 onLoad(options) { 26 onLoad(options) {
  27 + console.log('options',{...options});
26 this.setData({ 28 this.setData({
27 opt:{ 29 opt:{
28 id:options.id, 30 id:options.id,
@@ -30,6 +32,7 @@ Page({ @@ -30,6 +32,7 @@ Page({
30 sid:options.sid, 32 sid:options.sid,
31 oid:options.oid, 33 oid:options.oid,
32 types:options.types, 34 types:options.types,
  35 + rid:options.rid?options.rid:''
33 } 36 }
34 }) 37 })
35 console.log('onLoad',{...this.data.opt}); 38 console.log('onLoad',{...this.data.opt});
@@ -91,8 +94,19 @@ Page({ @@ -91,8 +94,19 @@ Page({
91 type:'2', 94 type:'2',
92 }).then(res=>{ 95 }).then(res=>{
93 if(res.ret=='200'){ 96 if(res.ret=='200'){
  97 + let url = util.http_build_query({
  98 + type:'2',
  99 + types: this.data.opt.types,
  100 + detail: JSON.stringify(detail),
  101 + sid: this.data.opt.sid,
  102 + combine_out_trade_no:res.data.combine_out_trade_no,
  103 + totalize:this.data.detail.recharge_money,
  104 + sellerName: this.data.opt.name,
  105 + oid: this.data.opt.oid,
  106 + rid:this.data.opt.rid?this.data.opt.rid:''
  107 + }, './confirmPayment')
94 wx.navigateTo({ 108 wx.navigateTo({
95 - url: `./confirmPayment?type=2&detail=${JSON.stringify(detail)}&sellerid=${this.data.opt.sid}&combine_out_trade_no=${res.data.combine_out_trade_no}&totalize=${this.data.detail.recharge_money}&types=${this.data.opt.types}`, 109 + url
96 }) 110 })
97 }else{ 111 }else{
98 wx.showToast({ 112 wx.showToast({
1 // pack-cookbook/pages/cart_new.js 1 // pack-cookbook/pages/cart_new.js
2 import App from '../../utils/api'; 2 import App from '../../utils/api';
3 import util from '../../utils/util'; 3 import util from '../../utils/util';
  4 +import RS from '../../utils/reserveStatus'
  5 +import TP from '../../utils/tpls';
4 Page({ 6 Page({
5 /** 7 /**
6 * 页面的初始数据 8 * 页面的初始数据
@@ -22,17 +24,37 @@ Page({ @@ -22,17 +24,37 @@ Page({
22 vipProbablyPrice: '', 24 vipProbablyPrice: '',
23 notes: '', 25 notes: '',
24 noData: false, 26 noData: false,
  27 + tpls:[],
  28 + current: 0,
  29 + seller:{},
  30 + options:{},
  31 + themeColor:'',
  32 + textColor:'',
  33 + navColor:'',
25 }, 34 },
26 /** 35 /**
27 * 生命周期函数--监听页面加载 36 * 生命周期函数--监听页面加载
28 */ 37 */
29 onLoad(options) { 38 onLoad(options) {
30 let obj = JSON.parse(options.cookbookObj); 39 let obj = JSON.parse(options.cookbookObj);
31 - console.log('options', {...obj}); 40 + let textColor;
  41 + if(obj.themeColor=='251,246,241,1'){
  42 + textColor='81,81,81,1'
  43 + }else{
  44 + textColor='251,246,241,1'
  45 + }
32 this.setData({ 46 this.setData({
33 options: obj, 47 options: obj,
  48 + tpls:[TP.tpls(1)],
  49 + navColor:obj.navColor,
  50 + themeColor:obj.themeColor,
  51 + textColor,
34 }) 52 })
  53 + console.log('options', {
  54 + ...obj
  55 + });
35 this.getCheckCookList(obj) 56 this.getCheckCookList(obj)
  57 + this.getDetail()
36 }, 58 },
37 // 获取点菜列表 59 // 获取点菜列表
38 getCheckCookList(options) { 60 getCheckCookList(options) {
@@ -49,6 +71,46 @@ Page({ @@ -49,6 +71,46 @@ Page({
49 }) 71 })
50 }) 72 })
51 }, 73 },
  74 + getDetail() {
  75 + App.Reserve.Detail({
  76 + openid: getApp().openid,
  77 + rid: this.data.options.rid
  78 + }).then(res => {
  79 + let tables = [], //桌子信息
  80 + regions = [], //区域名称
  81 + tableNum = 0;
  82 + res.data.tables.forEach(t => {
  83 + tables.push(t.name);
  84 + tableNum += t.table_pnum * 1
  85 + if (regions.indexOf('t.rname') == -1) {
  86 + regions.push(t.rname);
  87 + }
  88 + })
  89 + let reserev = RS.reserve(res.data)
  90 + let dateSmart;
  91 + if (res.data.type == 1) {
  92 + dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[0])
  93 + if (res.data.is_set_ddate == 1) {
  94 + dateSmart += ' ' + util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[1])
  95 + } else {
  96 + dateSmart += ' ' + reserev.soltName
  97 + }
  98 + } else {
  99 + dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStr)
  100 + }
  101 + this.setData({
  102 + seller: {
  103 + soltName: reserev.soltName,
  104 + date: dateSmart,
  105 + room: tables.join('、'),
  106 + region: regions.join('、'),
  107 + tableNum,
  108 + }
  109 + })
  110 + }).catch(res => {
  111 + console.log(res, '详情请求失败');
  112 + })
  113 + },
52 // 过滤数据 114 // 过滤数据
53 formatCookList(list) { 115 formatCookList(list) {
54 // 获取所有的规格 116 // 获取所有的规格
@@ -208,9 +270,10 @@ Page({ @@ -208,9 +270,10 @@ Page({
208 getCookNormsList(cookbooklist) { 270 getCookNormsList(cookbooklist) {
209 let probablyPrice = 0; 271 let probablyPrice = 0;
210 let vipProbablyPrice = 0; 272 let vipProbablyPrice = 0;
  273 + let num=0;
211 cookbooklist.forEach(i => { 274 cookbooklist.forEach(i => {
212 i.normsLen = 0 275 i.normsLen = 0
213 - i.cookbooklist[0].forEach(j=>{ 276 + i.cookbooklist[0].forEach(j => {
214 if (j.order_xx && j.order_xx.length > 0) { 277 if (j.order_xx && j.order_xx.length > 0) {
215 let arr = j.order_xx; 278 let arr = j.order_xx;
216 let result = arr.reduce((obj, item) => { 279 let result = arr.reduce((obj, item) => {
@@ -245,11 +308,12 @@ Page({ @@ -245,11 +308,12 @@ Page({
245 j.norms = [] 308 j.norms = []
246 } 309 }
247 }) 310 })
  311 + num+=i.normsLen
248 }) 312 })
249 console.log(cookbooklist); 313 console.log(cookbooklist);
250 this.setData({ 314 this.setData({
251 cookbooklist, 315 cookbooklist,
252 - noData: true, 316 + noData:(num*1)>0?false:true,
253 probablyPrice, 317 probablyPrice,
254 vipProbablyPrice 318 vipProbablyPrice
255 }) 319 })
@@ -261,12 +325,20 @@ Page({ @@ -261,12 +325,20 @@ Page({
261 }, 325 },
262 // 确认下单 326 // 确认下单
263 determineFun() { 327 determineFun() {
264 - if (this.data.noData) { 328 + if (!this.data.noData) {
265 let cookbookObj = { 329 let cookbookObj = {
266 ...this.data.options 330 ...this.data.options
267 } 331 }
268 - wx.navigateTo({  
269 - url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`, 332 + cookbookObj.hasSuccess = 1
  333 + cookbookObj.notes=this.data.notes
  334 + App.Advance.PlaceOrder({
  335 + orderid: this.data.options.oid,
  336 + rid: this.data.options.rid,
  337 + identity: this.data.options.identity,
  338 + }).then(res => {
  339 + wx.navigateTo({
  340 + url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
  341 + })
270 }) 342 })
271 } 343 }
272 }, 344 },
1 <!--pack-cookbook/pages/cart_new.wxml--> 1 <!--pack-cookbook/pages/cart_new.wxml-->
2 -<nav backgroundColor="#4d4e50" color="#fff">{{options.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">{{options.sellerDate}} {{options.soltName}}</view>  
7 - </view>  
8 - <view class="info flex-lr">  
9 - <view class="texts font28r">桌位台号:</view>  
10 - <view class="texts_right font28r">{{options.region}}</view>  
11 - </view>  
12 - <view class="info flex-lr">  
13 - <view class="texts font28r">就餐人数:</view>  
14 - <view class="texts font28r">{{options.tableNum}}</view>  
15 - </view>  
16 - <view class="info flex-lr">  
17 - <view class="texts font28r">备注信息:</view>  
18 - <input type="text" model:value="{{notes}}" placeholder="点击录入口味,偏好等要求" placeholder-style="color:#fff" />  
19 - </view>  
20 - <view class="line"></view>  
21 - <view class="checkMenu" wx:if="{{cookbooklist.length>0}}">  
22 - <block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">  
23 - <view wx:if="{{item.is_show}}" class="title flex-lr">  
24 - <view class="leftTitle">{{item.class_name}}</view>  
25 - <view class="rightTitle">{{item.normsLen}}道</view>  
26 - </view>  
27 - <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">  
28 - <block wx:if="{{item.norms.length>0}}">  
29 - <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">  
30 - <view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>  
31 - <view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>  
32 - <view class="count flex-cc">  
33 - <image bindtap="countFun" data-type="2" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" />  
34 - {{item.count}}  
35 - <image bindtap="countFun" data-type="1" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" /> 2 +<view style="background: rgba({{themeColor}});">
  3 + <nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提交订单'}}</nav>
  4 + <scroll-view class="main" style="background: rgba({{themeColor}});">
  5 + <view class="info" style="color: rgba({{textColor}});">
  6 + <view class="texts font28r">就餐时间:</view>
  7 + <view class="texts_right font28r">{{seller.date}}</view>
  8 + </view>
  9 + <view class="info" style="color: rgba({{textColor}});">
  10 + <view class="texts font28r">桌位台号:</view>
  11 + <view class="texts_right font28r">{{seller.room}} {{seller.region}}</view>
  12 + </view>
  13 + <view class="info" style="color: rgba({{textColor}});">
  14 + <view class="texts font28r">就餐人数:</view>
  15 + <view class="texts font28r">{{seller.tableNum}}</view>
  16 + </view>
  17 + <view class="info" style="color: rgba({{textColor}});">
  18 + <view class="texts font28r">备注信息:</view>
  19 + <input type="text" model:value="{{notes}}" style="color:rgba({{textColor}})" placeholder="点击录入口味,偏好等要求" placeholder-style="color:rgba({{textColor}})" />
  20 + </view>
  21 + <view class="line"></view>
  22 + <view class="checkMenu" wx:if="{{cookbooklist.length>0}}">
  23 + <block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
  24 + <view wx:if="{{item.is_show}}" class="title flex-lr">
  25 + <view class="leftTitle">{{item.class_name}}</view>
  26 + <view class="rightTitle">{{item.normsLen}}道</view>
  27 + </view>
  28 + <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
  29 + <block wx:if="{{item.norms.length>0}}">
  30 + <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
  31 + <view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
  32 + <view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
  33 + <view class="count flex-cc">
  34 + <image bindtap="countFun" data-type="2" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG809.png" class="img1" mode="" />
  35 + {{item.count}}
  36 + <image bindtap="countFun" data-type="1" data-item="{{item}}" src="https://qn.colorcun.com/WechatIMG810.png" class="img2" mode="" />
  37 + </view>
36 </view> 38 </view>
37 - </view> 39 + </block>
38 </block> 40 </block>
39 </block> 41 </block>
40 - </block>  
41 - </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> 42 + </view>
  43 + <view wx:if="{{!noData}}" class="probably flex-ll" style="color: rgba({{textColor}});">
  44 + <view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
  45 + <view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
  46 + </view>
  47 + </scroll-view>
  48 + <view class="btns flex-cc">
  49 + <button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">继续点菜</button>
  50 + <button class="font32r flex-cc {{noData?'determine1':'determine'}}" bindtap="determineFun">确认下单</button>
45 </view> 51 </view>
46 -</scroll-view>  
47 -<view class="btns flex-cc">  
48 - <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button>  
49 - <button class="font32r flex-cc {{noData?'determine':'determine1'}}" bindtap="determineFun">确认下单</button>  
50 </view> 52 </view>
1 /* pack-cookbook/pages/cart_new.wxss */ 1 /* pack-cookbook/pages/cart_new.wxss */
2 -page {  
3 - background: #4d4e50;  
4 -}  
5 -  
6 .main { 2 .main {
7 padding: 0 20rpx 148rpx 20rpx; 3 padding: 0 20rpx 148rpx 20rpx;
8 font-family: PingFang SC; 4 font-family: PingFang SC;
@@ -12,20 +8,21 @@ page { @@ -12,20 +8,21 @@ page {
12 8
13 .info { 9 .info {
14 margin-bottom: 16rpx; 10 margin-bottom: 16rpx;
  11 + display: flex;
  12 + justify-content: space-between;
15 } 13 }
16 14
17 .texts { 15 .texts {
18 - color: #ffffff;  
19 font-weight: 500; 16 font-weight: 500;
20 } 17 }
21 18
22 .texts_right { 19 .texts_right {
23 - color: #999999;  
24 font-weight: 500; 20 font-weight: 500;
  21 + width: 50%;
  22 + text-align: right;
25 } 23 }
26 24
27 .info input { 25 .info input {
28 - color: #fff;  
29 text-align: right; 26 text-align: right;
30 flex: 1; 27 flex: 1;
31 margin-left: 20rpx; 28 margin-left: 20rpx;
@@ -90,7 +87,7 @@ page { @@ -90,7 +87,7 @@ page {
90 } 87 }
91 88
92 .probably { 89 .probably {
93 - color: #999; 90 + color: #fff;
94 margin-top: 36rpx; 91 margin-top: 36rpx;
95 } 92 }
96 93
@@ -128,7 +125,6 @@ page { @@ -128,7 +125,6 @@ page {
128 color: #BFC4D4; 125 color: #BFC4D4;
129 } 126 }
130 .probably { 127 .probably {
131 - border-top: 2rpx solid #DBDBDB;  
132 font-family: PingFang SC; 128 font-family: PingFang SC;
133 padding: 30rpx 40rpx 52rpx 40rpx; 129 padding: 30rpx 40rpx 52rpx 40rpx;
134 } 130 }
@@ -14,6 +14,7 @@ Page({ @@ -14,6 +14,7 @@ Page({
14 priceInfo: '', 14 priceInfo: '',
15 scoreInfo: '', 15 scoreInfo: '',
16 certificate: '', 16 certificate: '',
  17 + rid:'',
17 list: [] 18 list: []
18 }, 19 },
19 /** 20 /**
@@ -24,7 +25,8 @@ Page({ @@ -24,7 +25,8 @@ Page({
24 sellerName: options.sellerName, 25 sellerName: options.sellerName,
25 sellerid: options.sellerid, 26 sellerid: options.sellerid,
26 oid: options.oid, 27 oid: options.oid,
27 - types:options.types 28 + types:options.types,
  29 + rid:options.rid?options.rid:'',
28 }) 30 })
29 console.log('options',{...options}); 31 console.log('options',{...options});
30 this.getList() 32 this.getList()
@@ -64,6 +66,7 @@ Page({ @@ -64,6 +66,7 @@ Page({
64 name: this.data.sellerName, 66 name: this.data.sellerName,
65 types: this.data.types, 67 types: this.data.types,
66 oid: this.data.oid, 68 oid: this.data.oid,
  69 + rid:this.data.rid?this.data.rid:'',
67 id 70 id
68 }, '/pack-activity/pack/vipRecharge') 71 }, '/pack-activity/pack/vipRecharge')
69 wx.navigateTo({ 72 wx.navigateTo({
@@ -44,12 +44,16 @@ Page({ @@ -44,12 +44,16 @@ Page({
44 * 生命周期函数--监听页面加载 44 * 生命周期函数--监听页面加载
45 */ 45 */
46 onLoad: function (options) { 46 onLoad: function (options) {
47 - console.log('options', {  
48 - ...options  
49 - });  
50 this.setData({ 47 this.setData({
51 - options: options, 48 + options:{
  49 + rid:options.rid,
  50 + oid:options.oid,
  51 + sellerName:options.sellerName,
  52 + sid:options.sid,
  53 + identity:options.identity
  54 + },
52 }) 55 })
  56 + console.log('optionsoptions',{...options});
53 this.getCookList() 57 this.getCookList()
54 mta.Page.init({ 58 mta.Page.init({
55 "appID": "500667280", 59 "appID": "500667280",
@@ -67,7 +71,8 @@ Page({ @@ -67,7 +71,8 @@ Page({
67 let cookbookObj = { 71 let cookbookObj = {
68 ...this.data.options 72 ...this.data.options
69 } 73 }
70 - wx.setStorageSync('cookbookObj', JSON.stringify(cookbookObj)); 74 + cookbookObj.themeColor=this.data.themeColor;
  75 + cookbookObj.navColor=this.data.navColor;
71 wx.navigateTo({ 76 wx.navigateTo({
72 url: `/pack-cookbook/pages/cart_new?cookbookObj=${JSON.stringify(cookbookObj)}`, 77 url: `/pack-cookbook/pages/cart_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
73 }) 78 })
@@ -232,6 +237,8 @@ Page({ @@ -232,6 +237,8 @@ Page({
232 let cookbookObj = { 237 let cookbookObj = {
233 ...this.data.options 238 ...this.data.options
234 } 239 }
  240 + cookbookObj.sellerName=res.data.seller.sellername;
  241 + cookbookObj.oid=res.data.id;
235 wx.redirectTo({ 242 wx.redirectTo({
236 url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`, 243 url: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
237 }) 244 })
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 "navigationBarTextStyle": "white", 4 "navigationBarTextStyle": "white",
5 "usingComponents": { 5 "usingComponents": {
6 "nav":"/components/nav/nav", 6 "nav":"/components/nav/nav",
7 - "my-modal": "/components/modal/modal" 7 + "my-modal": "/components/modal/modal",
  8 + "userinfo":"/components/userinfo/userinfo"
8 } 9 }
9 } 10 }
@@ -67,17 +67,17 @@ @@ -67,17 +67,17 @@
67 <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view> 67 <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
68 </view> 68 </view>
69 <view wx:for="{{item.norms}}" wx:key="{{item.id}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate"> 69 <view wx:for="{{item.norms}}" wx:key="{{item.id}}" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
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}}"/> 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}}" />
71 <view class="box flex-cc"> 71 <view class="box flex-cc">
72 <view class="num flex-cc"> 72 <view class="num flex-cc">
73 {{item.count}}<view wx:if="{{item.name}}" style="color:rgba({{textColor}})">{{item.name}}</view> 73 {{item.count}}<view wx:if="{{item.name}}" style="color:rgba({{textColor}})">{{item.name}}</view>
74 </view> 74 </view>
75 - <view class="practice" wx:if="{{item.specs}}" style="color:rgba({{textColor}})">{{item.specs}}</view> 75 + <view class="practice" wx:if="{{item.specs}}" style="color:rgba({{textColor}})">{{item.specs}}</view>
76 </view> 76 </view>
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-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-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
78 </view> 78 </view>
79 <view wx:if="{{(item.specArr.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">
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-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-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
81 </view> 81 </view>
82 </view> 82 </view>
83 <view wx:else class="twoBox" data-idx="{{item.image_type}}" data-nameType="{{item.name_type}}"> 83 <view wx:else class="twoBox" data-idx="{{item.image_type}}" data-nameType="{{item.name_type}}">
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 {{item.price?'¥'+item.price+'/'+item.unit:''}} 97 {{item.price?'¥'+item.price+'/'+item.unit:''}}
98 {{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}} 98 {{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
99 </view> 99 </view>
100 - <image src="{{item.image}}" mode="aspectFill" /> 100 + <image wx:if="{{item.image}}" src="{{item.image}}" mode="aspectFill" />
101 <view class="greens" wx:if="{{item.desc}}"> 101 <view class="greens" wx:if="{{item.desc}}">
102 <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view> 102 <view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
103 </view> 103 </view>
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 菜品分类 127 菜品分类
128 </view> 128 </view>
129 </view> 129 </view>
130 - <view class="right flex-cmc" bindtap="gotoShoppingCart"> 130 + <userinfo class="right flex-cmc" style="color:rgba({{textColor}})" binduserinfo="gotoShoppingCart">
131 <view class="rightBox"> 131 <view class="rightBox">
132 <image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG701.png':'https://qn.colorcun.com/s2.png'}}" mode="" /> 132 <image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG701.png':'https://qn.colorcun.com/s2.png'}}" mode="" />
133 <view class="num" wx:if="{{orderItemCount}}">{{orderItemCount}}</view> 133 <view class="num" wx:if="{{orderItemCount}}">{{orderItemCount}}</view>
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
135 <view class="fixedName" style="color:rgba({{textColor}})"> 135 <view class="fixedName" style="color:rgba({{textColor}})">
136 已选菜品 136 已选菜品
137 </view> 137 </view>
138 - </view> 138 + </userinfo>
139 </view> 139 </view>
140 <my-modal id="checkModal" height="410px" fadeStyle="center"> 140 <my-modal id="checkModal" height="410px" fadeStyle="center">
141 <view slot="modalContent" class="normsModel"> 141 <view slot="modalContent" class="normsModel">
@@ -160,7 +160,7 @@ @@ -160,7 +160,7 @@
160 </view> 160 </view>
161 </view> 161 </view>
162 </my-modal> 162 </my-modal>
163 -<my-modal id="classifyModal" fadeStyle="slideDown" height="100%"> 163 +<my-modal id="classifyModal" fadeStyle="slideDown" height="100%" opacity="0">
164 <view slot="modalContent" class="assortModel"> 164 <view slot="modalContent" class="assortModel">
165 <scroll-view scroll-y="true" style="height: 70%;"> 165 <scroll-view scroll-y="true" style="height: 70%;">
166 <view class="boxs"> 166 <view class="boxs">
@@ -244,11 +244,14 @@ page { @@ -244,11 +244,14 @@ page {
244 244
245 .fixedBox .right .rightBox { 245 .fixedBox .right .rightBox {
246 position: relative; 246 position: relative;
  247 + display: flex;
  248 + align-items: center;
  249 + justify-content: center;
247 } 250 }
248 251
249 .fixedBox .right .num { 252 .fixedBox .right .num {
250 position: absolute; 253 position: absolute;
251 - right: -20%; 254 + right: 0;
252 top: 0; 255 top: 0;
253 width: 30rpx; 256 width: 30rpx;
254 height: 30rpx; 257 height: 30rpx;
@@ -435,7 +438,8 @@ page { @@ -435,7 +438,8 @@ page {
435 height: 100%; 438 height: 100%;
436 display: flex; 439 display: flex;
437 justify-content: center; 440 justify-content: center;
438 - flex-direction: column; 441 + flex-direction: column;
  442 + padding-top: 30%;
439 } 443 }
440 .twoItem .num view{ 444 .twoItem .num view{
441 font-size:24rpx; 445 font-size:24rpx;
1 // pack-cookbook/pages/success_new.js 1 // pack-cookbook/pages/success_new.js
2 import App from '../../utils/api'; 2 import App from '../../utils/api';
3 import util from '../../utils/util'; 3 import util from '../../utils/util';
  4 +import RS from '../../utils/reserveStatus'
  5 +import TP from '../../utils/tpls';
4 Page({ 6 Page({
5 /** 7 /**
6 * 页面的初始数据 8 * 页面的初始数据
@@ -19,25 +21,28 @@ Page({ @@ -19,25 +21,28 @@ Page({
19 marketing: {}, 21 marketing: {},
20 recharge_data: {}, 22 recharge_data: {},
21 coupon_data: {}, 23 coupon_data: {},
22 - dataStr: Date.now() * 1 / 1000,  
23 rid: '', 24 rid: '',
24 oid: '', 25 oid: '',
25 - sellerDate: '',  
26 - region: '',  
27 - tableNum: '',  
28 - soltName: '', 26 + tpls: [],
  27 + current: 0,
  28 + seller: {},
  29 + options: {},
  30 + dataStr: Date.now() * 1 / 1000,
29 }, 31 },
30 /** 32 /**
31 * 生命周期函数--监听页面加载 33 * 生命周期函数--监听页面加载
32 */ 34 */
33 onLoad(options) { 35 onLoad(options) {
34 let obj = util.determine(options.cookbookObj); 36 let obj = util.determine(options.cookbookObj);
35 - console.log('options', {...obj});  
36 this.setData({ 37 this.setData({
37 options: obj, 38 options: obj,
  39 + tpls: [TP.tpls(1)],
38 }) 40 })
39 - this.getCheckCookList(obj);  
40 - this.getSellerTemplateConfFun() 41 + console.log('options', {
  42 + ...obj
  43 + });
  44 + this.getCheckCookList()
  45 + this.getDetail()
41 }, 46 },
42 // 过滤数据 47 // 过滤数据
43 formatCookList(list) { 48 formatCookList(list) {
@@ -85,9 +90,6 @@ Page({ @@ -85,9 +90,6 @@ Page({
85 let assortArr = []; 90 let assortArr = [];
86 let check1 = ''; 91 let check1 = '';
87 let check2 = ''; 92 let check2 = '';
88 - let that = this;  
89 - let complete = false  
90 - let complete1 = false  
91 if (sortArr.length > 0) { 93 if (sortArr.length > 0) {
92 has10CaiOpen = list[0].status == 1; 94 has10CaiOpen = list[0].status == 1;
93 sortArr.forEach(function (cate, i) { 95 sortArr.forEach(function (cate, i) {
@@ -133,9 +135,6 @@ Page({ @@ -133,9 +135,6 @@ Page({
133 } 135 }
134 cook.item_clear_num = item_clear_num; 136 cook.item_clear_num = item_clear_num;
135 cook.index = n; //分类下菜品的下标 137 cook.index = n; //分类下菜品的下标
136 - if (!cook.order_xx || cook.order_xx.length == 0) {  
137 - cook.norms = []; //做法规格  
138 - }  
139 cook.type = '1'; 138 cook.type = '1';
140 let cook_style = cook.cook_style ? util.determine(cook.cook_style) : { 139 let cook_style = cook.cook_style ? util.determine(cook.cook_style) : {
141 image_type: '1', 140 image_type: '1',
@@ -164,124 +163,214 @@ Page({ @@ -164,124 +163,214 @@ Page({
164 } 163 }
165 }) 164 })
166 } 165 }
167 - this.setData({  
168 - check1,  
169 - check2,  
170 - assortArr  
171 - })  
172 - return flist;  
173 -  
174 - },  
175 - // 获取点菜列表  
176 - getCheckCookList(obj) {  
177 - let param = {  
178 - sellerid: obj.sid,  
179 - identity: obj.identity,  
180 - orderid: obj.oid,  
181 - status: '0,1',  
182 - };  
183 - let probablyPrice = 0;  
184 - let vipProbablyPrice = 0;  
185 - App.Cookbook.GetCookbookByClass(param).then(json => {  
186 - let cookbooklist = this.formatCookList(json.data[0].list)  
187 - let newArr = JSON.parse(JSON.stringify(cookbooklist))  
188 - let num = 0  
189 - for (let i = 0; i < newArr.length; i++) {  
190 - if (newArr[i].cookbooklist.length == 0) {  
191 - continue;  
192 - }  
193 - for (let j = 0; j < newArr[i].cookbooklist[0].length; j++) {  
194 - let cook_style = newArr[i].cookbooklist[0][j].cook_style  
195 - if (cook_style.image_type == 2) { 166 + let cookbooklist = JSON.parse(JSON.stringify(flist))
  167 + let newArr = JSON.parse(JSON.stringify(cookbooklist))
  168 + let num = 0
  169 + newArr.forEach((i, u) => {
  170 + if (i.cookbooklist.length != 0) {
  171 + i.cookbooklist[0].forEach(j => {
  172 + let cook_style = j.cook_style ? j.cook_style : j.image_type
  173 + if (cook_style && cook_style.image_type == 2) {
196 num++ 174 num++
197 } else { 175 } else {
198 if (num % 2 != 0) { 176 if (num % 2 != 0) {
199 - let k = cookbooklist[i].cookbooklist[0].findIndex((item) => {  
200 - return newArr[i].cookbooklist[0][j].id == item.id 177 + let k = cookbooklist[u].cookbooklist[0].findIndex((item) => {
  178 + return j.id == item.id
201 }) 179 })
202 if (k != -1) { 180 if (k != -1) {
203 let temp = { 181 let temp = {
204 boderNone: true, 182 boderNone: true,
205 image_type: '2', 183 image_type: '2',
206 } 184 }
207 - cookbooklist[i].cookbooklist[0].splice(k, 0, temp) 185 + cookbooklist[u].cookbooklist[0].splice(k, 0, temp)
208 } 186 }
209 } 187 }
210 num = 0 188 num = 0
211 } 189 }
212 - } 190 + })
213 } 191 }
214 - cookbooklist.forEach(item => {  
215 - item.normsLen = 0  
216 - item.cookbooklist[0].forEach((cooks, idx) => {  
217 - if (cooks.order_xx && cooks.order_xx.length > 0) {  
218 - let arr = cooks.order_xx  
219 - let result = arr.reduce((obj, item) => {  
220 - let find = obj.find(i => (i.practiceid === item.practiceid && i.specid === item.specid));  
221 - let _d = {  
222 - ...item,  
223 - count: 1  
224 - };  
225 - find ? find.count++ : obj.push(_d);  
226 - return obj;  
227 - }, []);  
228 - cooks.norms = result  
229 - cooks.norms.forEach(n => {  
230 - let obj = cooks.specArr.filter(i => {  
231 - return i.id == n.specid  
232 - })  
233 - n.price = (obj[0] && obj[0].price) ? obj[0].price : cooks.price;  
234 - n.member_price = (obj[0] && obj[0].member_price) ? obj[0].member_price : cooks.member_price;  
235 - n.id = cooks.id;  
236 - n.check2 = cooks.check2;  
237 - n.cookName = cooks.name;  
238 - n.check1 = cooks.check1;  
239 - let price = n.count * 1 * (n.price * 1);  
240 - let vipPrice = n.count * 1 * (n.member_price * 1);  
241 - probablyPrice += price;  
242 - vipProbablyPrice += vipPrice; 192 + })
  193 + this.getCookNormsList(cookbooklist)
  194 + flist = cookbooklist;
  195 + this.setData({
  196 + check1,
  197 + check2,
  198 + assortArr
  199 + })
  200 + return flist;
  201 + },
  202 + // 加减处理已点菜的数据
  203 + getCookNormsList(cookbooklist) {
  204 + let probablyPrice = 0;
  205 + let vipProbablyPrice = 0;
  206 + cookbooklist.forEach(i => {
  207 + i.normsLen = 0
  208 + i.cookbooklist[0].forEach(j => {
  209 + if (j.order_xx && j.order_xx.length > 0) {
  210 + let arr = j.order_xx;
  211 + let result = arr.reduce((obj, item) => {
  212 + let find = obj.find(i => (i.practiceid === item.practiceid && i.specid === item.specid));
  213 + let _d = {
  214 + ...item,
  215 + count: 1
  216 + };
  217 + find ? find.count++ : obj.push(_d);
  218 + return obj;
  219 + }, []);
  220 + result = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'practiceid'))
  221 + j.norms = result.sort((obj1, obj2) => util.objCompare(obj1, obj2, 'specid'))
  222 + j.norms.forEach(n => {
  223 + n.id = j.id;
  224 + n.check2 = j.check2;
  225 + n.cookName = j.name;
  226 + n.check1 = j.check1;
  227 + let list = j.specArr.filter(i => {
  228 + return i.id == n.specid
243 }) 229 })
244 - item.is_show = true  
245 - item.normsLen += cooks.norms.length  
246 - } else {  
247 - cooks.norms = []  
248 - }  
249 - }) 230 + n.price = (list[0] && list[0].price) ? list[0].price : j.price;
  231 + n.member_price = (list[0] && list[0].member_price) ? list[0].member_price : j.member_price;
  232 + let price = n.count * 1 * (n.price * 1);
  233 + let vipPrice = n.count * 1 * (n.member_price * 1);
  234 + probablyPrice += price;
  235 + vipProbablyPrice += vipPrice;
  236 + })
  237 + i.normsLen += j.norms.length
  238 + i.is_show = true
  239 + } else {
  240 + j.norms = []
  241 + }
  242 + })
  243 + })
  244 + console.log(cookbooklist);
  245 + this.setData({
  246 + noData: true,
  247 + probablyPrice,
  248 + vipProbablyPrice
  249 + })
  250 + return cookbooklist
  251 + },
  252 + // 获取点菜列表
  253 + getCheckCookList() {
  254 + let param = {
  255 + sellerid: this.data.options.sid,
  256 + identity: '1',
  257 + orderid: this.data.options.oid,
  258 + status: '0,1',
  259 + };
  260 + App.Cookbook.GetCookbookByClass(param).then(json => {
  261 + let cookbooklist = this.formatCookList(json.data[0].list)
  262 + this.setData({
  263 + cookbooklist
250 }) 264 })
  265 + })
  266 + this.GetDzSellerConfFun()
  267 + },
  268 + // 获取主题色
  269 + GetDzSellerConfFun() {
  270 + App.Seller.GetDzSellerConf({
  271 + sid: this.data.options.sid
  272 + }).then(res => {
  273 + let themeColor, textColor, navColor;
  274 + if (res.data.cook_style) {
  275 + let style = util.determine(res.data.cook_style)
  276 + if (style && style.red && style.green && style.blue && style.alpha) {
  277 + themeColor = style.red + ',' + style.green + ',' + style.blue + ',' + Math.floor(style.alpha)
  278 + } else {
  279 + themeColor = '77,78,80,1'; //未设置 为灰色
  280 + }
  281 + if (themeColor == '251,246,241,1') {
  282 + textColor = '81,81,81,1'
  283 + navColor = "81,81,81,1"
  284 + } else {
  285 + navColor = "255,255,255,1"
  286 + textColor = '251,246,241,1'
  287 + }
  288 + this.setData({
  289 + themeColor,
  290 + textColor,
  291 + navColor
  292 + })
  293 + }
  294 + }).catch(res => {
  295 + themeColor = '77,78,80,1';
  296 + navColor = "255,255,255,1"
251 this.setData({ 297 this.setData({
252 - cookbooklist,  
253 - noData: true,  
254 - probablyPrice,  
255 - vipProbablyPrice 298 + themeColor,
  299 + navColor
256 }) 300 })
257 }) 301 })
258 }, 302 },
259 // 菜品更换 303 // 菜品更换
260 continueOrdering() { 304 continueOrdering() {
261 - console.log({...this.data.options});  
262 - wx.reLaunch({  
263 - url: `/pack-cookbook/pages/index_new?rid=${this.data.options.rid}&sid=${this.data.options.sid}&oid=${this.data.options.oid}&sellerName=${this.data.options.sellerName}&identity=1`, 305 + wx.showToast({
  306 + title: '您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。',
  307 + icon: 'none',
  308 + duration: 3000
264 }) 309 })
265 }, 310 },
266 // 点击了解更多会员优惠政策 311 // 点击了解更多会员优惠政策
267 gotoFavourableList() { 312 gotoFavourableList() {
268 let url = util.http_build_query({ 313 let url = util.http_build_query({
269 - sellerName: this.data.sellerName,  
270 - sellerid: this.data.sid,  
271 - oid: this.data.oid, 314 + sellerName: this.data.options.sellerName,
  315 + sellerid: this.data.options.sid,
  316 + oid: this.data.options.oid,
  317 + rid: this.data.options.rid,
272 types: '2', 318 types: '2',
273 }, '/pack-cookbook/pages/favourableList') 319 }, '/pack-cookbook/pages/favourableList')
274 wx.navigateTo({ 320 wx.navigateTo({
275 url 321 url
276 }) 322 })
277 }, 323 },
  324 + getDetail() {
  325 + App.Reserve.Detail({
  326 + openid: getApp().openid,
  327 + rid: this.data.options.rid
  328 + }).then(res => {
  329 + let tables = [], //桌子信息
  330 + regions = [], //区域名称
  331 + tableNum = 0;
  332 + res.data.tables.forEach(t => {
  333 + tables.push(t.name);
  334 + tableNum += t.table_pnum * 1
  335 + if (regions.indexOf('t.rname') == -1) {
  336 + regions.push(t.rname);
  337 + }
  338 + })
  339 + let reserev = RS.reserve(res.data)
  340 + let dateSmart;
  341 + if (res.data.type == 1) {
  342 + dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[0])
  343 + if (res.data.is_set_ddate == 1) {
  344 + dateSmart += ' ' + util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStrSmart[1])
  345 + } else {
  346 + dateSmart += ' ' + reserev.soltName
  347 + }
  348 + } else {
  349 + dateSmart = util.unixtoTime(reserev.ddate, this.data.tpls[this.data.current].timeStr)
  350 + }
  351 + this.setData({
  352 + seller: {
  353 + soltName: reserev.soltName,
  354 + date: dateSmart,
  355 + room: tables.join('、'),
  356 + region: regions.join('、'),
  357 + tableNum,
  358 + }
  359 + })
  360 + setTimeout(() => {
  361 + this.getSellerTemplateConfFun(reserev.sid);
  362 + }, 0);
  363 + }).catch(res => {
  364 + console.log(res, '详情请求失败');
  365 + })
  366 + },
278 getSellerTemplateConfFun() { 367 getSellerTemplateConfFun() {
279 App.Seller.GetSellerTemplateConf({ 368 App.Seller.GetSellerTemplateConf({
280 - sid: this.data.sid 369 + sid: this.data.options.sid
281 }).then(res => { 370 }).then(res => {
282 let data = res.data 371 let data = res.data
283 let marketing, coupon_data, priceInfo, scoreInfo, recharge_list, stringifyUse; 372 let marketing, coupon_data, priceInfo, scoreInfo, recharge_list, stringifyUse;
284 - marketing = data.marketing ? JSON.parse(data.marketing) : ''; 373 + marketing = util.determine(data.marketing);
285 console.log('marketing', marketing); 374 console.log('marketing', marketing);
286 if (marketing.coupon_data) { 375 if (marketing.coupon_data) {
287 coupon_data = marketing.coupon_data; 376 coupon_data = marketing.coupon_data;
@@ -327,16 +416,14 @@ Page({ @@ -327,16 +416,14 @@ Page({
327 * 用户点击右上角分享 416 * 用户点击右上角分享
328 */ 417 */
329 onShareAppMessage() { 418 onShareAppMessage() {
330 - let options = {  
331 - sid: this.data.sid,  
332 - rid: this.data.rid,  
333 - oid: this.data.oid,  
334 - identity: '1',  
335 - hasOnlyShow: '1' 419 + let cookbookObj = {
  420 + ...this.data.options,
  421 + hasOnlyShow: 1
336 }; 422 };
  423 + delete cookbookObj.hasSuccess
337 return { 424 return {
338 title: '菜品已点好,快来看看都点了什么~', 425 title: '菜品已点好,快来看看都点了什么~',
339 - path: util.http_build_query(options, '/pack-cookbook/pages/success_new'), 426 + path: `/pack-cookbook/pages/success_new?cookbookObj=${JSON.stringify(cookbookObj)}`,
340 imageUrl: 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg', 427 imageUrl: 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
341 } 428 }
342 }, 429 },
1 <!--pack-cookbook/pages/success_new.wxml--> 1 <!--pack-cookbook/pages/success_new.wxml-->
2 -<nav backgroundColor="#4d4e50" color="#fff">{{options.sellerName||'提交订单'}}</nav>  
3 -<scroll-view class="main">  
4 - <view class="box">  
5 - <view class="info flex-lr">  
6 - <view class="texts font28r">就餐时间:</view>  
7 - <view class="texts_right font28r">{{options.sellerDate}} {{soltName}}</view>  
8 - </view>  
9 - <view class="info flex-lr">  
10 - <view class="texts font28r">桌位台号:</view>  
11 - <view class="texts_right font28r">{{options.region}}</view>  
12 - </view>  
13 - <view class="info flex-lr">  
14 - <view class="texts font28r">就餐人数:</view>  
15 - <view class="texts font28r">{{options.tableNum}}</view>  
16 - </view>  
17 - <view class="info flex-lr">  
18 - <view class="texts font28r">备注信息:</view>  
19 - <view class="texts font28r">{{options.notes}}</view>  
20 - </view>  
21 - <image class="imgs" src="https://qn.colorcun.com/001.png" mode="" />  
22 - </view>  
23 - <view class="line"></view>  
24 - <view class="checkMenu">  
25 - <block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">  
26 - <view wx:if="{{item.is_show}}" class="title flex-lr">  
27 - <view class="leftTitle">{{item.class_name}}</view>  
28 - <view class="rightTitle">{{item.normsLen}}道</view> 2 +<view style="background: rgba({{themeColor}});">
  3 + <nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName}}</nav>
  4 + <scroll-view class="main" style="background: rgba({{themeColor}});">
  5 + <view class="box">
  6 + <view class="info" style="color: rgba({{textColor}});">
  7 + <view class="texts font28r">就餐时间:</view>
  8 + <view class="texts_right font28r">{{seller.date}}</view>
29 </view> 9 </view>
30 - <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">  
31 - <block wx:if="{{item.norms.length>0}}">  
32 - <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">  
33 - <view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>  
34 - <view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>  
35 - {{item.count}}  
36 - </view>  
37 - </block>  
38 - </block>  
39 - </block>  
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">{{vipProbablyPrice}}</text>元</view> 10 + <view class="info" style="color: rgba({{textColor}});">
  11 + <view class="texts font28r">桌位台号:</view>
  12 + <view class="texts_right font28r">{{seller.room}} {{seller.region}}</view>
  13 + </view>
  14 + <view class="info" style="color: rgba({{textColor}});">
  15 + <view class="texts font28r">就餐人数:</view>
  16 + <view class="texts font28r">{{seller.tableNum}}</view>
  17 + </view>
  18 + <view class="info" style="color: rgba({{textColor}});">
  19 + <view class="texts font28r">备注信息:</view>
  20 + <view class="texts font28r">{{options.notes}}</view>
  21 + </view>
  22 + <image class="imgs" src="https://qn.colorcun.com/001.png" mode="" />
43 </view> 23 </view>
44 - <view class="information font36r">特别优惠</view>  
45 - <view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>  
46 - <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">  
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> 24 + <view class="line"></view>
  25 + <view class="checkMenu">
  26 + <block wx:for="{{cookbooklist}}" wx:key="{{item.id}}" wx:for-index="indexs">
  27 + <view wx:if="{{item.is_show}}" class="title flex-lr">
  28 + <view class="leftTitle">{{item.class_name}}</view>
  29 + <view class="rightTitle">{{item.normsLen}}道</view>
64 </view> 30 </view>
65 - <navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{seller.name}}&use={{stringifyUse}}&sid={{seller.sid}}&oid={{detail.id}}&types=2" hover-class="navigator-hover">  
66 - <view class="font24r orderingFood">  
67 - 去抢购  
68 - </view>  
69 - </navigator> 31 + <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="index">
  32 + <block wx:if="{{item.norms.length>0}}">
  33 + <view wx:for="{{item.norms}}" wx:for-index="idx" class="content flex-lr">
  34 + <view class="single">{{item.cookName}}<text wx:if="{{item.name}}">({{item.name}})</text></view>
  35 + <view class="price">{{item.price}}元{{item.specs?'/'+item.specs:''}}</view>
  36 + {{item.count}}
  37 + </view>
  38 + </block>
  39 + </block>
  40 + </block>
  41 + <view class="probably flex-ll">
  42 + <view class="tariff font24r">菜单价:<text class="font32r">{{probablyPrice}}</text>元</view>
  43 + <view class="tariff font24r">会员价:<text class="font32r">{{vipProbablyPrice}}</text>元</view>
70 </view> 44 </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+'元赠送优惠券':''}}。 45 + <view class="information font36r">特别优惠</view>
  46 + <view class="poop font24r">根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以节约大笔开销!</view>
  47 + <view class="preferential" wx:if="{{marketing && (marketing.is_coupon=='1' || marketing.is_recharge=='1')}}">
  48 + <view class="preferentialItems" wx:if="{{marketing && marketing.is_coupon=='1' && dataStr<(coupon_data.etime*1)}}">
  49 + <view class="left">
  50 + <view class="top">
  51 + <text>{{coupon_data.aname}}</text>
  52 + <text class="price" wx:if="{{coupon_data.price}}">¥{{coupon_data.price}}</text>
  53 + <!-- is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 -->
  54 + <text wx:if="{{discount!='0.00' && (coupon_data.use.is_cash=='1' || coupon_data.use.is_cash)}}" class="discount">{{discount}}折</text>
  55 + </view>
  56 + <view wx:if="{{coupon_data.exp_date.is_week=='1' || coupon_data.exp_date.is_week===true}}" class="bottom">
  57 + {{coupon_data.exp_date.week_show?coupon_data.exp_date.week_show+'可用':''}}{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
  58 + </view>
  59 + <view wx:if="{{coupon_data.exp_date.is_none=='1' || coupon_data.exp_date.is_none===true}}" class="bottom">
  60 + 无限制{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
  61 + </view>
  62 + <view wx:if="{{coupon_data.exp_date.is_birthday=='1' || coupon_data.exp_date.is_birthday===true}}" class="bottom">
  63 + 会员生日当天可用{{coupon_data.desc?','+coupon_data.desc+'。':'。'}}
  64 + </view>
85 </view> 65 </view>
  66 + <navigator url="/pack-activity/pack/buyCoupon?id={{coupon_data.id}}&name={{options.sellerName}}&use={{stringifyUse}}&rid={{options.rid}}&sid={{options.sid}}&oid={{options.oid}}&types=2" hover-class="navigator-hover">
  67 + <view class="font24r orderingFood">
  68 + 去抢购
  69 + </view>
  70 + </navigator>
86 </view> 71 </view>
87 - <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{seller.name}}&sid={{seller.sid}}&oid={{detail.id}}&types=2" hover-class="navigator-hover">  
88 - <view class="font24r orderingFood">  
89 - 去充值 72 + <!-- 当前日期要大于限制结束日期 -->
  73 + <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)))}}">
  74 + <view class="left">
  75 + <view class="top">
  76 + <text>{{recharge_data.rname}}</text>
  77 + </view>
  78 + <view class="bottom" wx:if="{{priceInfo}}">
  79 + {{priceInfo}}{{(recharge_data.recharge_list.is_coupons=='0' && recharge_data.recharge_list.is_score=='0')?'。':';'}}
  80 + </view>
  81 + <view class="bottom" wx:if="{{scoreInfo}}">
  82 + {{scoreInfo}}{{recharge_data.recharge_list.is_coupons=='0'?'。':';'}}
  83 + </view>
  84 + <view class="bottom" wx:if="{{recharge_data.recharge_list.is_coupons=='1'}}">
  85 + {{recharge_data.recharge_list.is_coupons=='1'?'会员充值满'+marketing.recharge_data.recharge_money+'元赠送优惠券':''}}。
  86 + </view>
90 </view> 87 </view>
91 - </navigator> 88 + <navigator url="/pack-activity/pack/vipRecharge?id={{recharge_data.id}}&name={{options.sellerName}}&sid={{options.sid}}&oid={{options.oid}}&rid={{options.rid}}&types=2" hover-class="navigator-hover">
  89 + <view class="font24r orderingFood">
  90 + 去充值
  91 + </view>
  92 + </navigator>
  93 + </view>
92 </view> 94 </view>
93 - </view>  
94 - <view class="favouredPolicy">  
95 - <view class="font24r policy" bindtap="gotoFavourableList">  
96 - 点击了解更多会员优惠政策 95 + <view class="favouredPolicy">
  96 + <view class="font24r policy" bindtap="gotoFavourableList">
  97 + 点击了解更多会员优惠政策
  98 + </view>
97 </view> 99 </view>
98 </view> 100 </view>
  101 + </scroll-view>
  102 + <view class="btns flex-cc">
  103 + <button class="font32r continue flex-cc" style="background: rgba({{themeColor}});color: rgba({{textColor}});" bindtap="continueOrdering">菜品更换</button>
  104 + <button class="font32r determine flex-cc" open-type="share">分享菜单</button>
99 </view> 105 </view>
100 -</scroll-view>  
101 -<view class="btns flex-cc">  
102 - <button class="font32r continue flex-cc" bindtap="continueOrdering">菜品更换</button>  
103 - <button class="font32r determine flex-cc" open-type="share">分享菜单</button>  
104 </view> 106 </view>
1 /* pack-cookbook/pages/success_new.wxss */ 1 /* pack-cookbook/pages/success_new.wxss */
2 -page {  
3 - background: #4d4e50;  
4 -}  
5 -  
6 .main { 2 .main {
7 padding: 0 20rpx 148rpx 20rpx; 3 padding: 0 20rpx 148rpx 20rpx;
8 font-family: PingFang SC; 4 font-family: PingFang SC;
@@ -12,16 +8,18 @@ page { @@ -12,16 +8,18 @@ page {
12 8
13 .info { 9 .info {
14 margin-bottom: 16rpx; 10 margin-bottom: 16rpx;
  11 + display: flex;
  12 + justify-content: space-between;
15 } 13 }
16 14
17 .texts { 15 .texts {
18 - color: #ffffff;  
19 font-weight: 500; 16 font-weight: 500;
20 } 17 }
21 18
22 .texts_right { 19 .texts_right {
23 - color: #999999;  
24 font-weight: 500; 20 font-weight: 500;
  21 + width: 50%;
  22 + text-align: right;
25 } 23 }
26 24
27 .info input { 25 .info input {
@@ -83,8 +81,7 @@ page { @@ -83,8 +81,7 @@ page {
83 } 81 }
84 82
85 .probably { 83 .probably {
86 - border-top: 2rpx solid #DBDBDB;  
87 - color: #515151; 84 + color: #000;
88 font-family: PingFang SC; 85 font-family: PingFang SC;
89 padding: 30rpx 40rpx 52rpx 40rpx; 86 padding: 30rpx 40rpx 52rpx 40rpx;
90 } 87 }
@@ -104,7 +101,7 @@ page { @@ -104,7 +101,7 @@ page {
104 .btns button { 101 .btns button {
105 width: 50%; 102 width: 50%;
106 box-sizing: border-box; 103 box-sizing: border-box;
107 - color: #fff; 104 + color: #BFC4D4;
108 height: 100%; 105 height: 100%;
109 border-radius: 0; 106 border-radius: 0;
110 } 107 }
@@ -192,9 +192,12 @@ Page({ @@ -192,9 +192,12 @@ Page({
192 }, 192 },
193 getstaffinfo(uid){ 193 getstaffinfo(uid){
194 console.log('sellerid',this.data.detail.seller.id); 194 console.log('sellerid',this.data.detail.seller.id);
195 - App.Activity.GetCustomerActivityBaseinfo({sellerid:this.data.detail.seller.id,uid}).then((json)=>{  
196 - if(json.ret==200){  
197 - console.log('staffinfostaffinfostaffinfo',json.data) 195 + App.Activity.GetCustomerActivityBaseinfo({
  196 + sellerid:this.data.detail.seller.id,
  197 + uid
  198 + }).then((json)=>{
  199 + if(json.ret==200) {
  200 + console.log('staffinfostaffinfostaffinfo', json.data)
198 this.setData({ 201 this.setData({
199 staffinfo:json.data 202 staffinfo:json.data
200 }) 203 })
@@ -207,7 +210,9 @@ Page({ @@ -207,7 +210,9 @@ Page({
207 url: util.http_build_query({ 210 url: util.http_build_query({
208 rid: this.id, 211 rid: this.id,
209 oid: this.data.detail.order.id, 212 oid: this.data.detail.order.id,
210 - identity: 1 213 + sellerName: this.data.seller.name,
  214 + sid: this.data.seller.sid,
  215 + identity: '1',
211 }, '/pack-cookbook/pages/success_new') 216 }, '/pack-cookbook/pages/success_new')
212 }); 217 });
213 } else { 218 } else {
@@ -218,18 +223,13 @@ Page({ @@ -218,18 +223,13 @@ Page({
218 if (res.ret != 200) { 223 if (res.ret != 200) {
219 return util.toast(res.msg, 'none') 224 return util.toast(res.msg, 'none')
220 } 225 }
221 - console.log(this.id,res.data.id,res.data.sellerid);  
222 wx.navigateTo({ 226 wx.navigateTo({
223 url: util.http_build_query({ 227 url: util.http_build_query({
224 rid: this.id, 228 rid: this.id,
225 oid: res.data.id, 229 oid: res.data.id,
226 - identity: 1,  
227 sid: res.data.sellerid, 230 sid: res.data.sellerid,
228 - sellerName:this.data.seller.name,  
229 - sellerDate:this.data.seller.date,  
230 - soltName:this.data.seller.soltName,  
231 - region:this.data.seller.region+this.data.seller.room,  
232 - tableNum:this.data.detail.actual_pum?this.data.detail.actual_pum:this.data.tableNum 231 + sellerName: this.data.seller.name,
  232 + identity: '1',
233 }, '/pack-cookbook/pages/index_new') 233 }, '/pack-cookbook/pages/index_new')
234 }); 234 });
235 }) 235 })