Commit be41af7a104dd67f28705e816b00ab5455cf1845

Authored by pengye
1 parent c84d6698

付款页券列表、提示显示不完整

@@ -19,6 +19,7 @@ Page({ @@ -19,6 +19,7 @@ Page({
19 }, 19 },
20 sid: '', //扫码进入带的参数商家id 20 sid: '', //扫码进入带的参数商家id
21 couponModal: '', 21 couponModal: '',
  22 + myToast:'',
22 /** 23 /**
23 * 生命周期函数--监听页面加载 24 * 生命周期函数--监听页面加载
24 */ 25 */
@@ -88,10 +89,10 @@ Page({ @@ -88,10 +89,10 @@ Page({
88 } 89 }
89 date.setHours(0, 0, 0, 0); 90 date.setHours(0, 0, 0, 0);
90 let newTimestamp = Math.floor(date.getTime() / 1000); 91 let newTimestamp = Math.floor(date.getTime() / 1000);
91 - cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD HH:II') 92 + cdateText = util.unixtoTime(newTimestamp, 'YYYY-MM-DD')
92 detail.cdateText = cdateText; 93 detail.cdateText = cdateText;
93 if (detail.aexpiration == '0' || detail.aexpiration == '') { 94 if (detail.aexpiration == '0' || detail.aexpiration == '') {
94 - edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD HH:II') 95 + edateText = util.unixtoTime(detail.etime, 'YYYY-MM-DD')
95 detail.deadlineDate = detail.etime 96 detail.deadlineDate = detail.etime
96 } else { 97 } else {
97 let time = new Date(detail.cdate * 1000); 98 let time = new Date(detail.cdate * 1000);
@@ -99,7 +100,7 @@ Page({ @@ -99,7 +100,7 @@ Page({
99 time.setHours(23, 59, 0, 0); 100 time.setHours(23, 59, 0, 0);
100 let deadlineDate = Math.floor(time.getTime() / 1000); 101 let deadlineDate = Math.floor(time.getTime() / 1000);
101 detail.deadlineDate = deadlineDate 102 detail.deadlineDate = deadlineDate
102 - edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD HH:II') 103 + edateText = util.unixtoTime(deadlineDate, 'YYYY-MM-DD')
103 } 104 }
104 detail.endDateStr = cdateText + '至' + edateText 105 detail.endDateStr = cdateText + '至' + edateText
105 }) 106 })
@@ -231,7 +232,7 @@ Page({ @@ -231,7 +232,7 @@ Page({
231 }) 232 })
232 }, 233 },
233 // 付款 234 // 付款
234 - confirmPayment() { 235 + confirmPayment: util.throttle(function () {
235 let that = this; 236 let that = this;
236 let actualPrice = this.data.actualPrice 237 let actualPrice = this.data.actualPrice
237 if (actualPrice <= 0) { 238 if (actualPrice <= 0) {
@@ -270,30 +271,19 @@ Page({ @@ -270,30 +271,19 @@ Page({
270 }) 271 })
271 that.getCoupon() 272 that.getCoupon()
272 console.log('支付成功', ress); 273 console.log('支付成功', ress);
273 - return wx.showToast({  
274 - title: '支付成功',  
275 - duration: 1000,  
276 - icon: 'none',  
277 - }) 274 + return that.myToast.showToast('支付成功', 2000)
278 } 275 }
279 console.log('支付失败', ress); 276 console.log('支付失败', ress);
280 - wx.showToast({  
281 - title: '支付失败,请重新下单',  
282 - duration: 1000,  
283 - }) 277 + return that.myToast.showToast('支付失败,请重新下单', 2000)
284 }, 278 },
285 fail(ress) { 279 fail(ress) {
286 console.log('支付失败', ress); 280 console.log('支付失败', ress);
287 - wx.showToast({  
288 - title: '支付失败,请重新下单',  
289 - duration: 1000,  
290 - icon: 'none',  
291 - }) 281 + return that.myToast.showToast('支付失败,请重新下单', 2000)
292 }, 282 },
293 }) 283 })
294 } 284 }
295 }) 285 })
296 - }, 286 + },3000),
297 // 核销所勾选的券 287 // 核销所勾选的券
298 writeOff() { 288 writeOff() {
299 console.log('勾选的券', this.data.finalList); 289 console.log('勾选的券', this.data.finalList);
@@ -715,7 +705,7 @@ Page({ @@ -715,7 +705,7 @@ Page({
715 * 生命周期函数--监听页面初次渲染完成 705 * 生命周期函数--监听页面初次渲染完成
716 */ 706 */
717 onReady() { 707 onReady() {
718 - 708 + this.myToast = this.selectComponent("#myToast")
719 }, 709 },
720 710
721 /** 711 /**
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 "navigationBarTextStyle": "black", 3 "navigationBarTextStyle": "black",
4 "usingComponents": { 4 "usingComponents": {
5 "nav": "/components/nav/nav", 5 "nav": "/components/nav/nav",
6 - "my-modal": "/components/modal/modal" 6 + "my-modal": "/components/modal/modal",
  7 + "toast": "/components/toast/index"
7 } 8 }
8 } 9 }
@@ -23,13 +23,14 @@ @@ -23,13 +23,14 @@
23 </view> 23 </view>
24 <view class="payBtn font32r" bindtap="confirmPayment">付款</view> 24 <view class="payBtn font32r" bindtap="confirmPayment">付款</view>
25 </view> 25 </view>
  26 +<toast id="myToast"></toast>
26 <my-modal id="couponModal" fadeStyle="slideUp" height="{{couponArr.length > '3' ? '80%' : '60%'}}"> 27 <my-modal id="couponModal" fadeStyle="slideUp" height="{{couponArr.length > '3' ? '80%' : '60%'}}">
27 <view slot="modalName" class="titleModal"> 28 <view slot="modalName" class="titleModal">
28 <view class="couponTotal">所有优惠券</view> 29 <view class="couponTotal">所有优惠券</view>
29 <view bindtap="checkCertificate" class="btn font32r">确认选择</view> 30 <view bindtap="checkCertificate" class="btn font32r">确认选择</view>
30 </view> 31 </view>
31 <view slot="modalContent"> 32 <view slot="modalContent">
32 - <view class="couponBox"> 33 + <scroll-view class="couponBox" scroll-y="true">
33 <checkbox-group bindchange="checkboxChange"> 34 <checkbox-group bindchange="checkboxChange">
34 <view wx:for="{{couponArr}}" class="couponItems {{item.showCpupon == '0' ? 'couponNo' : ''}}"> 35 <view wx:for="{{couponArr}}" class="couponItems {{item.showCpupon == '0' ? 'couponNo' : ''}}">
35 <view class="itemLeft"> 36 <view class="itemLeft">
@@ -57,6 +58,6 @@ @@ -57,6 +58,6 @@
57 <checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" /> 58 <checkbox disabled="{{item.showCpupon == '0'}}" value="{{item.activity_id}}" checked="{{item.checked}}" />
58 </view> 59 </view>
59 </checkbox-group> 60 </checkbox-group>
60 - </view> 61 + </scroll-view>
61 </view> 62 </view>
62 </my-modal> 63 </my-modal>
@@ -236,7 +236,7 @@ checkbox::before { @@ -236,7 +236,7 @@ checkbox::before {
236 } 236 }
237 237
238 .mymodal .mymodal-content { 238 .mymodal .mymodal-content {
239 - height: 90% !important; 239 + height: 80% !important;
240 } 240 }
241 241
242 .couponNo { 242 .couponNo {