Commit 7eb92c21f290bd3b0862264c627d45768ced5da6

Authored by yiren
1 parent b6c96dca

我的卡券入口

@@ -43,14 +43,14 @@ @@ -43,14 +43,14 @@
43 <view class="notice" wx:if="{{shownotice==true}}"></view> 43 <view class="notice" wx:if="{{shownotice==true}}"></view>
44 </view> 44 </view>
45 </block> 45 </block>
46 - <block wx:if="{{'pages/me/coupon'!=url}}">  
47 - <view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon"> 46 + <block wx:if="{{'pages/me/coupon_news'!=url}}">
  47 + <view class="menu-item white-font font30r smooth flex-vc {{menuhidden ? '' : 'menu-item-card-active'}}" bindtap="topage" data-path="/pages/me/coupon_news">
48 <view>卡包</view> 48 <view>卡包</view>
49 <view>({{user.customer_activity}})</view> 49 <view>({{user.customer_activity}})</view>
50 </view> 50 </view>
51 </block> 51 </block>
52 <block wx:else> 52 <block wx:else>
53 - <view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon"> 53 + <view class="menu-item gray-font font30r smooth flex-cc {{menuhidden ? '' : 'menu-item-card-active'}}" data-path="/pages/me/coupon_news">
54 <view>卡包</view> 54 <view>卡包</view>
55 <view>({{user.customer_activity}})</view> 55 <view>({{user.customer_activity}})</view>
56 </view> 56 </view>
@@ -9,6 +9,7 @@ Page({ @@ -9,6 +9,7 @@ Page({
9 probablyPrice: '', 9 probablyPrice: '',
10 sellerid: '', 10 sellerid: '',
11 notes: '', 11 notes: '',
  12 + noData: false,
12 }, 13 },
13 /** 14 /**
14 * 生命周期函数--监听页面加载 15 * 生命周期函数--监听页面加载
@@ -16,6 +17,7 @@ Page({ @@ -16,6 +17,7 @@ Page({
16 onLoad(options) { 17 onLoad(options) {
17 console.log('options', options); 18 console.log('options', options);
18 let obj = JSON.parse(options.obj); 19 let obj = JSON.parse(options.obj);
  20 + let noData = false;
19 let cookbooklist = JSON.parse(options.cookbooklist); 21 let cookbooklist = JSON.parse(options.cookbooklist);
20 let probablyPrice = 0; 22 let probablyPrice = 0;
21 cookbooklist.forEach(items => { 23 cookbooklist.forEach(items => {
@@ -24,6 +26,7 @@ Page({ @@ -24,6 +26,7 @@ Page({
24 let price = item.quantum * 1 * (item.price * 1); 26 let price = item.quantum * 1 * (item.price * 1);
25 probablyPrice += price; 27 probablyPrice += price;
26 if (item.quantum > 0) { 28 if (item.quantum > 0) {
  29 + noData = true
27 items.is_show = true 30 items.is_show = true
28 } 31 }
29 }) 32 })
@@ -32,19 +35,22 @@ Page({ @@ -32,19 +35,22 @@ Page({
32 cookbooklist, 35 cookbooklist,
33 sellerName: obj.sellerName, 36 sellerName: obj.sellerName,
34 sellerid: obj.sellerid, 37 sellerid: obj.sellerid,
35 - probablyPrice 38 + probablyPrice,
  39 + noData
36 }) 40 })
37 }, 41 },
38 // 确认下单 42 // 确认下单
39 determineFun() { 43 determineFun() {
40 - let obj = {  
41 - sellerName: this.data.sellerName,  
42 - sellerid: this.data.sellerid,  
43 - notes: this.data.notes 44 + if (this.data.noData) {
  45 + let obj = {
  46 + sellerName: this.data.sellerName,
  47 + sellerid: this.data.sellerid,
  48 + notes: this.data.notes
  49 + }
  50 + wx.navigateTo({
  51 + url: `/pack-cookbook/pages/success_new?cookbooklist=${JSON.stringify(this.data.cookbooklist)}&obj=${JSON.stringify(obj)}`,
  52 + })
44 } 53 }
45 - wx.navigateTo({  
46 - url: `/pack-cookbook/pages/success_new?cookbooklist=${JSON.stringify(this.data.cookbooklist)}&obj=${JSON.stringify(obj)}`,  
47 - })  
48 }, 54 },
49 // 加 55 // 加
50 addDdish() { 56 addDdish() {
@@ -37,9 +37,9 @@ @@ -37,9 +37,9 @@
37 </block> 37 </block>
38 </block> 38 </block>
39 </view> 39 </view>
40 - <view class="probably">预计金额:{{probablyPrice}}元</view> 40 + <view wx:if="{{noData}}" class="probably">预计金额:{{probablyPrice}}元</view>
41 </scroll-view> 41 </scroll-view>
42 <view class="btns flex-cc"> 42 <view class="btns flex-cc">
43 <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button> 43 <button class="font32r continue flex-cc" bindtap="continueOrdering">继续点菜</button>
44 - <button class="font32r determine flex-cc" bindtap="determineFun">确认下单</button> 44 + <button class="font32r flex-cc {{noData?'determine':'determine1'}}" bindtap="determineFun">确认下单</button>
45 </view> 45 </view>
@@ -111,5 +111,9 @@ page { @@ -111,5 +111,9 @@ page {
111 111
112 .determine { 112 .determine {
113 background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%); 113 background: linear-gradient(104.24deg, #4c8dad -57.47%, #0143a3 55.72%, #42a5ff 148.72%);
  114 +}
114 115
  116 +.determine1 {
  117 + background: #DBDBDB;
  118 + color:#BFC4D4;
115 } 119 }