Commit 8ec4a7d0b0f121d228514847a9b3b153b5edb4ad

Authored by pengye
1 parent 500c5179

邀请函样式修改、券问题处理

@@ -378,7 +378,7 @@ Page({ @@ -378,7 +378,7 @@ Page({
378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
379 if (coupon && util.getType(coupon) == 'object') { 379 if (coupon && util.getType(coupon) == 'object') {
380 coupon.stringifyUse = JSON.stringify(coupon.use) 380 coupon.stringifyUse = JSON.stringify(coupon.use)
381 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 381 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
382 let cash = coupon.use.cash * 1; 382 let cash = coupon.use.cash * 1;
383 let price = coupon.price * 1; 383 let price = coupon.price * 1;
384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -389,8 +389,8 @@ Page({ @@ -389,8 +389,8 @@ Page({
389 if (coupon && util.getType(coupon) == 'array') { 389 if (coupon && util.getType(coupon) == 'array') {
390 if (coupon.length > 0) { 390 if (coupon.length > 0) {
391 coupon.forEach(item => { 391 coupon.forEach(item => {
392 - item.stringifyUse = JSON.stringify(item.use)  
393 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 392 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  393 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
394 let cash = item.use.cash * 1; 394 let cash = item.use.cash * 1;
395 let price = item.price * 1; 395 let price = item.price * 1;
396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -114,19 +114,19 @@ @@ -114,19 +114,19 @@
114 </view> 114 </view>
115 </view> 115 </view>
116 <!-- 主厨介绍图文分开 --> 116 <!-- 主厨介绍图文分开 -->
117 - <view class="introduce famousChefBox" wx:if="{{chef}}"> 117 + <view class="introduce famousChefBox" wx:if="{{chef && (!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">
118 <view class="imgMask"> 118 <view class="imgMask">
119 - <view class="IntroduceColor" wx:if="{{(!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">  
120 - <view class="chefText font36r">主厨介绍</view> 119 + <view class="IntroduceColor">
  120 + <view class="chefText font36r" wx:if="{{chef.is_introduce || chef.is_images}}">主厨介绍</view>
121 <view class="labelBox" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}"> 121 <view class="labelBox" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}">
122 <text class="texts">{{chef.introduce}} 122 <text class="texts">{{chef.introduce}}
123 </text> 123 </text>
124 </view> 124 </view>
125 </view> 125 </view>
126 - <block wx:if="{{!chef.is_images || chef.is_images!='0'}}"> 126 + <block wx:if="{{(!chef.is_images || chef.is_images!='0') && chef.image}}">
127 <image src="{{chef.image}}" mode="aspectFill" /> 127 <image src="{{chef.image}}" mode="aspectFill" />
128 </block> 128 </block>
129 - <view class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view> 129 + <view wx:if="{{chef.is_introduce || chef.is_images}}" class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view>
130 </view> 130 </view>
131 </view> 131 </view>
132 <!-- 菜品展示 swich为1展示 --> 132 <!-- 菜品展示 swich为1展示 -->
@@ -269,7 +269,7 @@ @@ -269,7 +269,7 @@
269 } 269 }
270 270
271 .preferential { 271 .preferential {
272 - margin: 0 40rpx 20rpx 40rpx; 272 + margin: 0 40rpx;
273 } 273 }
274 274
275 .rubric1 { 275 .rubric1 {
@@ -353,6 +353,7 @@ @@ -353,6 +353,7 @@
353 justify-content: center; 353 justify-content: center;
354 align-items: center; 354 align-items: center;
355 padding-bottom: 180rpx; 355 padding-bottom: 180rpx;
  356 + margin-top: 20rpx;
356 } 357 }
357 358
358 .favouredPolicy { 359 .favouredPolicy {
@@ -379,7 +379,7 @@ Page({ @@ -379,7 +379,7 @@ Page({
379 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 379 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
380 if (coupon && util.getType(coupon) == 'object') { 380 if (coupon && util.getType(coupon) == 'object') {
381 coupon.stringifyUse = JSON.stringify(coupon.use) 381 coupon.stringifyUse = JSON.stringify(coupon.use)
382 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 382 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
383 let cash = coupon.use.cash * 1; 383 let cash = coupon.use.cash * 1;
384 let price = coupon.price * 1; 384 let price = coupon.price * 1;
385 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 385 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -390,8 +390,8 @@ Page({ @@ -390,8 +390,8 @@ Page({
390 if (coupon && util.getType(coupon) == 'array') { 390 if (coupon && util.getType(coupon) == 'array') {
391 if (coupon.length > 0) { 391 if (coupon.length > 0) {
392 coupon.forEach(item => { 392 coupon.forEach(item => {
393 - item.stringifyUse = JSON.stringify(item.use)  
394 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 393 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  394 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
395 let cash = item.use.cash * 1; 395 let cash = item.use.cash * 1;
396 let price = item.price * 1; 396 let price = item.price * 1;
397 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 397 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -122,19 +122,19 @@ @@ -122,19 +122,19 @@
122 </view> 122 </view>
123 </view> 123 </view>
124 <!-- 主厨介绍图文分开 --> 124 <!-- 主厨介绍图文分开 -->
125 - <view class="introduce famousChefBox" wx:if="{{chef}}"> 125 + <view class="introduce famousChefBox" wx:if="{{chef && (!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">
126 <view class="imgMask"> 126 <view class="imgMask">
127 - <view class="IntroduceColor" wx:if="{{(!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">  
128 - <view class="chefText font36r">主厨介绍</view> 127 + <view class="IntroduceColor">
  128 + <view class="chefText font36r" wx:if="{{chef.is_introduce || chef.is_images}}">主厨介绍</view>
129 <view class="labelBox" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}"> 129 <view class="labelBox" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}">
130 <text class="texts">{{chef.introduce}} 130 <text class="texts">{{chef.introduce}}
131 </text> 131 </text>
132 </view> 132 </view>
133 </view> 133 </view>
134 - <block wx:if="{{!chef.is_images || chef.is_images!='0'}}"> 134 + <block wx:if="{{(!chef.is_images || chef.is_images!='0') && chef.image}}">
135 <image src="{{chef.image}}" mode="aspectFill" /> 135 <image src="{{chef.image}}" mode="aspectFill" />
136 </block> 136 </block>
137 - <view class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view> 137 + <view wx:if="{{chef.is_introduce || chef.is_images}}" class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view>
138 </view> 138 </view>
139 </view> 139 </view>
140 <!-- 菜品展示 swich为1展示 --> 140 <!-- 菜品展示 swich为1展示 -->
@@ -310,7 +310,7 @@ @@ -310,7 +310,7 @@
310 } 310 }
311 311
312 .preferential { 312 .preferential {
313 - margin: 16rpx 40rpx 20rpx 40rpx; 313 + margin: 16rpx 40rpx 0 40rpx;
314 } 314 }
315 315
316 .rubric1 { 316 .rubric1 {
@@ -393,6 +393,7 @@ @@ -393,6 +393,7 @@
393 justify-content: center; 393 justify-content: center;
394 align-items: center; 394 align-items: center;
395 padding-bottom: 180rpx; 395 padding-bottom: 180rpx;
  396 + margin-top: 20rpx;
396 } 397 }
397 398
398 .favouredPolicy { 399 .favouredPolicy {
@@ -379,7 +379,7 @@ Page({ @@ -379,7 +379,7 @@ Page({
379 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 379 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
380 if (coupon && util.getType(coupon) == 'object') { 380 if (coupon && util.getType(coupon) == 'object') {
381 coupon.stringifyUse = JSON.stringify(coupon.use) 381 coupon.stringifyUse = JSON.stringify(coupon.use)
382 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 382 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
383 let cash = coupon.use.cash * 1; 383 let cash = coupon.use.cash * 1;
384 let price = coupon.price * 1; 384 let price = coupon.price * 1;
385 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 385 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -390,8 +390,8 @@ Page({ @@ -390,8 +390,8 @@ Page({
390 if (coupon && util.getType(coupon) == 'array') { 390 if (coupon && util.getType(coupon) == 'array') {
391 if (coupon.length > 0) { 391 if (coupon.length > 0) {
392 coupon.forEach(item => { 392 coupon.forEach(item => {
393 - item.stringifyUse = JSON.stringify(item.use)  
394 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 393 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  394 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
395 let cash = item.use.cash * 1; 395 let cash = item.use.cash * 1;
396 let price = item.price * 1; 396 let price = item.price * 1;
397 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 397 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -101,18 +101,18 @@ @@ -101,18 +101,18 @@
101 </view> 101 </view>
102 </block> 102 </block>
103 <!-- 主厨介绍图文分开 --> 103 <!-- 主厨介绍图文分开 -->
104 - <block wx:if="{{chef}}"> 104 + <block wx:if="{{chef && (!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">
105 <view class="imgMask"> 105 <view class="imgMask">
106 - <view class="IntroduceColor noneBor" wx:if="{{(!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">  
107 - <view class="text font36r rubric texts">主厨介绍</view> 106 + <view class="IntroduceColor noneBor">
  107 + <view class="text font36r rubric texts" wx:if="{{chef.is_introduce || chef.is_images}}">主厨介绍</view>
108 <view class="labelBox font24r" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}"> 108 <view class="labelBox font24r" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}">
109 {{chef.introduce}} 109 {{chef.introduce}}
110 </view> 110 </view>
111 </view> 111 </view>
112 - <block wx:if="{{!chef.is_images || chef.is_images!='0'}}"> 112 + <block wx:if="{{(!chef.is_images || chef.is_images!='0') && chef.image}}">
113 <image src="{{chef.image}}" mode="aspectFill" /> 113 <image src="{{chef.image}}" mode="aspectFill" />
114 </block> 114 </block>
115 - <view class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view> 115 + <view wx:if="{{chef.is_introduce || chef.is_images}}" class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view>
116 </view> 116 </view>
117 </block> 117 </block>
118 <block wx:if="{{signboard && signboard.swich=='1'}}"> 118 <block wx:if="{{signboard && signboard.swich=='1'}}">
@@ -265,7 +265,7 @@ @@ -265,7 +265,7 @@
265 } 265 }
266 266
267 .preferential { 267 .preferential {
268 - margin: 0 40rpx 20rpx 40rpx; 268 + margin: 0 40rpx;
269 } 269 }
270 270
271 .preferentialItems { 271 .preferentialItems {
@@ -351,6 +351,7 @@ @@ -351,6 +351,7 @@
351 justify-content: center; 351 justify-content: center;
352 align-items: center; 352 align-items: center;
353 padding-bottom: 180rpx; 353 padding-bottom: 180rpx;
  354 + margin-top: 20rpx;
354 } 355 }
355 356
356 .vips .news { 357 .vips .news {
@@ -378,7 +378,7 @@ Page({ @@ -378,7 +378,7 @@ Page({
378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
379 if (coupon && util.getType(coupon) == 'object') { 379 if (coupon && util.getType(coupon) == 'object') {
380 coupon.stringifyUse = JSON.stringify(coupon.use) 380 coupon.stringifyUse = JSON.stringify(coupon.use)
381 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 381 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
382 let cash = coupon.use.cash * 1; 382 let cash = coupon.use.cash * 1;
383 let price = coupon.price * 1; 383 let price = coupon.price * 1;
384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -389,8 +389,8 @@ Page({ @@ -389,8 +389,8 @@ Page({
389 if (coupon && util.getType(coupon) == 'array') { 389 if (coupon && util.getType(coupon) == 'array') {
390 if (coupon.length > 0) { 390 if (coupon.length > 0) {
391 coupon.forEach(item => { 391 coupon.forEach(item => {
392 - item.stringifyUse = JSON.stringify(item.use)  
393 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 392 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  393 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
394 let cash = item.use.cash * 1; 394 let cash = item.use.cash * 1;
395 let price = item.price * 1; 395 let price = item.price * 1;
396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -96,18 +96,18 @@ @@ -96,18 +96,18 @@
96 </view> 96 </view>
97 </block> 97 </block>
98 <!-- 主厨介绍图文分开 --> 98 <!-- 主厨介绍图文分开 -->
99 - <block wx:if="{{chef}}"> 99 + <block wx:if="{{chef && (!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">
100 <view class="imgMask"> 100 <view class="imgMask">
101 - <view class="IntroduceColor noneBor" wx:if="{{(!chef.is_introduce || chef.is_introduce!='0') || (!chef.is_images || chef.is_images!='0')}}">  
102 - <view class="text font36r rubric texts">主厨介绍</view> 101 + <view class="IntroduceColor noneBor">
  102 + <view class="text font36r rubric texts" wx:if="{{chef.is_introduce || chef.is_images}}">主厨介绍</view>
103 <view class="labelBox font24r" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}"> 103 <view class="labelBox font24r" wx:if="{{!chef.is_introduce || chef.is_introduce!='0'}}">
104 {{chef.introduce}} 104 {{chef.introduce}}
105 </view> 105 </view>
106 </view> 106 </view>
107 - <block wx:if="{{!chef.is_images || chef.is_images!='0'}}"> 107 + <block wx:if="{{(!chef.is_images || chef.is_images!='0') && chef.image}}">
108 <image src="{{chef.image}}" mode="aspectFill" /> 108 <image src="{{chef.image}}" mode="aspectFill" />
109 </block> 109 </block>
110 - <view class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view> 110 + <view wx:if="{{chef.is_introduce || chef.is_images}}" class="{{(!chef.is_images || chef.is_images!='0')?'lines':'lines mtnone'}}"></view>
111 </view> 111 </view>
112 </block> 112 </block>
113 <block wx:if="{{signboard && signboard.swich=='1'}}"> 113 <block wx:if="{{signboard && signboard.swich=='1'}}">
@@ -165,7 +165,7 @@ @@ -165,7 +165,7 @@
165 165
166 .imgMask { 166 .imgMask {
167 position: relative; 167 position: relative;
168 - margin: 0 20rpx; 168 + margin: 16rpx 20rpx 0 20rpx;
169 } 169 }
170 170
171 .lines { 171 .lines {
@@ -454,7 +454,7 @@ @@ -454,7 +454,7 @@
454 } 454 }
455 455
456 .evaluateBox { 456 .evaluateBox {
457 - margin: 16rpx 84rpx 16rpx 40rpx; 457 + margin: 0 84rpx 16rpx 40rpx;
458 display: flex; 458 display: flex;
459 align-items: center; 459 align-items: center;
460 justify-content: space-between; 460 justify-content: space-between;
@@ -324,9 +324,9 @@ Page({ @@ -324,9 +324,9 @@ Page({
324 } 324 }
325 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 325 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
326 if (coupon && util.getType(coupon) == 'object') { 326 if (coupon && util.getType(coupon) == 'object') {
327 - coupon.stringifyUse = JSON.stringify(coupon.use)  
328 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {  
329 - let cash = coupon.use.cash * 1; 327 + coupon.stringifyUse = JSON.stringify(coupon.use)
  328 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
  329 + let cash = coupon.use.cash * 1;
330 let price = coupon.price * 1; 330 let price = coupon.price * 1;
331 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 331 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
332 coupon.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 332 coupon.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
@@ -336,10 +336,10 @@ Page({ @@ -336,10 +336,10 @@ Page({
336 if (coupon && util.getType(coupon) == 'array') { 336 if (coupon && util.getType(coupon) == 'array') {
337 if (coupon.length > 0) { 337 if (coupon.length > 0) {
338 coupon.forEach(item => { 338 coupon.forEach(item => {
339 - item.stringifyUse = JSON.stringify(item.use)  
340 - if ((!item.use.is_cash || item.use.is_cash == '1')) {  
341 - let cash = item.use.cash * 1;  
342 - let price = item.price * 1; 339 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  340 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
  341 + let cash = item.use.cash * 1;
  342 + let price = item.price * 1;
343 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 343 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
344 item.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : ''; 344 item.discount = cash != 0 ? ((price / cash) * 10).toFixed(1) : '';
345 } 345 }
@@ -378,7 +378,7 @@ Page({ @@ -378,7 +378,7 @@ Page({
378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 378 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
379 if (coupon && util.getType(coupon) == 'object') { 379 if (coupon && util.getType(coupon) == 'object') {
380 coupon.stringifyUse = JSON.stringify(coupon.use) 380 coupon.stringifyUse = JSON.stringify(coupon.use)
381 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 381 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
382 let cash = coupon.use.cash * 1; 382 let cash = coupon.use.cash * 1;
383 let price = coupon.price * 1; 383 let price = coupon.price * 1;
384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 384 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -389,8 +389,8 @@ Page({ @@ -389,8 +389,8 @@ Page({
389 if (coupon && util.getType(coupon) == 'array') { 389 if (coupon && util.getType(coupon) == 'array') {
390 if (coupon.length > 0) { 390 if (coupon.length > 0) {
391 coupon.forEach(item => { 391 coupon.forEach(item => {
392 - item.stringifyUse = JSON.stringify(item.use)  
393 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 392 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  393 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
394 let cash = item.use.cash * 1; 394 let cash = item.use.cash * 1;
395 let price = item.price * 1; 395 let price = item.price * 1;
396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 396 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -274,7 +274,7 @@ @@ -274,7 +274,7 @@
274 } 274 }
275 275
276 .preferential { 276 .preferential {
277 - margin: 20rpx 40rpx; 277 + margin: 20rpx 40rpx 0 40rpx;
278 } 278 }
279 279
280 .rubric1 { 280 .rubric1 {
@@ -357,6 +357,7 @@ @@ -357,6 +357,7 @@
357 justify-content: center; 357 justify-content: center;
358 align-items: center; 358 align-items: center;
359 padding-bottom: 180rpx; 359 padding-bottom: 180rpx;
  360 + margin-top: 20rpx;
360 } 361 }
361 362
362 .favouredPolicy { 363 .favouredPolicy {
@@ -377,7 +377,7 @@ Page({ @@ -377,7 +377,7 @@ Page({
377 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示 377 // is_cash 代金券 is_discount折扣券 is_dish菜品券 只有代金券有几折显示
378 if (coupon && util.getType(coupon) == 'object') { 378 if (coupon && util.getType(coupon) == 'object') {
379 coupon.stringifyUse = JSON.stringify(coupon.use) 379 coupon.stringifyUse = JSON.stringify(coupon.use)
380 - if (marketing.is_coupon == '1' && coupon && (!coupon.use.is_cash || coupon.use.is_cash == '1')) { 380 + if (marketing.is_coupon == '1' && coupon && coupon.use && (!coupon.use.is_cash || coupon.use.is_cash == '1')) {
381 let cash = coupon.use.cash * 1; 381 let cash = coupon.use.cash * 1;
382 let price = coupon.price * 1; 382 let price = coupon.price * 1;
383 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 383 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -388,8 +388,8 @@ Page({ @@ -388,8 +388,8 @@ Page({
388 if (coupon && util.getType(coupon) == 'array') { 388 if (coupon && util.getType(coupon) == 'array') {
389 if (coupon.length > 0) { 389 if (coupon.length > 0) {
390 coupon.forEach(item => { 390 coupon.forEach(item => {
391 - item.stringifyUse = JSON.stringify(item.use)  
392 - if ((!item.use.is_cash || item.use.is_cash == '1')) { 391 + item.stringifyUse = item.use?JSON.stringify(item.use):'';
  392 + if ((item.use && (!item.use.is_cash || item.use.is_cash == '1'))) {
393 let cash = item.use.cash * 1; 393 let cash = item.use.cash * 1;
394 let price = item.price * 1; 394 let price = item.price * 1;
395 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1)); 395 console.log('cash', cash + '---' + 'price', price + '---' + 'discount', ((price / cash) * 10).toFixed(1));
@@ -297,7 +297,7 @@ @@ -297,7 +297,7 @@
297 } 297 }
298 298
299 .preferential { 299 .preferential {
300 - margin: 20rpx 40rpx; 300 + margin: 20rpx 40rpx 0 40rpx;
301 } 301 }
302 302
303 .rubric1 { 303 .rubric1 {
@@ -380,6 +380,7 @@ @@ -380,6 +380,7 @@
380 justify-content: center; 380 justify-content: center;
381 align-items: center; 381 align-items: center;
382 padding-bottom: 180rpx; 382 padding-bottom: 180rpx;
  383 + margin-top: 20rpx;
383 } 384 }
384 385
385 .favouredPolicy { 386 .favouredPolicy {