Commit 87fa6b2ccaa7284e5b33c229e78c64cfef126969

Authored by vking
1 parent d9a3d462

taocan

@@ -6,6 +6,7 @@ Component({ @@ -6,6 +6,7 @@ Component({
6 properties: { 6 properties: {
7 order:Object, 7 order:Object,
8 hasTopStatus:Boolean, 8 hasTopStatus:Boolean,
  9 + listOrder:Object,//列表数据
9 foods_info:Object,//订单详情 10 foods_info:Object,//订单详情
10 order_info:Object,//订单详情 11 order_info:Object,//订单详情
11 }, 12 },
@@ -16,7 +17,9 @@ Component({ @@ -16,7 +17,9 @@ Component({
16 data: { 17 data: {
17 18
18 }, 19 },
19 - 20 + attached(){
  21 + this.initListOrder()
  22 + },
20 /** 23 /**
21 * 组件的方法列表 24 * 组件的方法列表
22 */ 25 */
@@ -31,5 +34,28 @@ Component({ @@ -31,5 +34,28 @@ Component({
31 seller_tel:seller_tel, 34 seller_tel:seller_tel,
32 }); 35 });
33 }, 36 },
  37 + initListOrder(){
  38 + let orderStatusStr={
  39 + 1:{status:'未支付',info:''},
  40 + 2:{status:'待使用',info:'感谢您的支持,请您按尽快来店就餐呦'},
  41 + 3:{status:'已使用',info:'感谢您的支持,满意的话记得常来呦'},
  42 + 4:{status:'退款中',info:''},
  43 + 5:{status:'已退款',info:'钱款已原路退还,请在微信账单查看呦'},
  44 + 6:{status:'已过期',info:'您可以随时申请退款呦'},
  45 + 7:{status:'支付失败',info:''},
  46 + }
  47 + let order_info=this.data.listOrder
  48 + order_info.status_tips=orderStatusStr[order_info.status]
  49 + let foods_info={
  50 + name:order_info.name,
  51 + eff_time_end:order_info.eff_time_end,
  52 + main_url:order_info.main_url,
  53 + sale_price:order_info.sale_price,
  54 + }
  55 + this.setData({
  56 + order_info:order_info,
  57 + foods_info:foods_info,
  58 + })
  59 + },
34 } 60 }
35 }) 61 })
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <view class="txt-32-h text-cut" style="margin-bottom: 2rpx;">{{order_info.sellername}}</view> 7 <view class="txt-32-h text-cut" style="margin-bottom: 2rpx;">{{order_info.sellername}}</view>
8 <view class="txt-24-h text-gray text-cut">{{order_info.real_address}}</view> 8 <view class="txt-24-h text-gray text-cut">{{order_info.real_address}}</view>
9 </view> 9 </view>
10 - <view class="view txt-28-h text-blue" wx:if="{{hasTopStatus}}">以哈哈</view> 10 + <view class="view txt-28-h {{order_info.status==2?'text-blue':'bg-white'}}" wx:if="{{hasTopStatus}}">{{order_info.status_tips.status}}</view>
11 <view class="phone view" wx:else=""></view> 11 <view class="phone view" wx:else=""></view>
12 </view> 12 </view>
13 <view class="view flex solid-bottom" style="padding-bottom: 36rpx;padding-top: 36rpx;"> 13 <view class="view flex solid-bottom" style="padding-bottom: 36rpx;padding-top: 36rpx;">
@@ -110,9 +110,6 @@ Page({ @@ -110,9 +110,6 @@ Page({
110 if(this.hasMore){ 110 if(this.hasMore){
111 this.offset+=this.limit 111 this.offset+=this.limit
112 } 112 }
113 - if(tabType>4){  
114 - data=[{},{},{}]  
115 - }  
116 this.setData({ 113 this.setData({
117 [`list[`+tabType+`]`]: this.data.list[tabType].concat(data), 114 [`list[`+tabType+`]`]: this.data.list[tabType].concat(data),
118 hasMore:this.hasMore 115 hasMore:this.hasMore
@@ -124,6 +121,7 @@ Page({ @@ -124,6 +121,7 @@ Page({
124 }, 121 },
125 formatList(list) { 122 formatList(list) {
126 if (list.length<1) return []; 123 if (list.length<1) return [];
  124 + if(this.tabType>4) return list;
127 let dlist = []; 125 let dlist = [];
128 let openid = getApp().openid; 126 let openid = getApp().openid;
129 list.forEach(row => { 127 list.forEach(row => {
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 </block> 26 </block>
27 <block wx:else=""> 27 <block wx:else="">
28 <block wx:if="{{tabType<5}}"> 28 <block wx:if="{{tabType<5}}">
29 - <navigator wx:for="{{list[tabType]}}" wx:key="success.key" 29 + <navigator wx:for="{{list[tabType]}}" wx:key="*this"
30 wx:for-item="detail" wx:for-index="dateIndex" 30 wx:for-item="detail" wx:for-index="dateIndex"
31 url="/pages/customer/{{detail.navigator}}?id={{detail.id}}"> 31 url="/pages/customer/{{detail.navigator}}?id={{detail.id}}">
32 <card 32 <card
@@ -35,13 +35,22 @@ @@ -35,13 +35,22 @@
35 </navigator> 35 </navigator>
36 </block> 36 </block>
37 <view class="view padding-lr" wx:else=""> 37 <view class="view padding-lr" wx:else="">
38 - <navigator wx:for="{{list[tabType]}}" wx:key="success.key" 38 + <navigator wx:for="{{list[tabType]}}" wx:key="*this"
39 wx:for-item="order" wx:for-index="dateIndex" 39 wx:for-item="order" wx:for-index="dateIndex"
40 class="margin-bottom-lg" 40 class="margin-bottom-lg"
41 - url="/pages/taocan/order?id={{order.id}}">  
42 - <subject order="{{order}}" hasTopStatus> 41 + url="/pages/taocan/order?id={{order.order_id}}">
  42 + <subject listOrder="{{order}}" hasTopStatus>
43 <view class="view flex justify-end margin-top"> 43 <view class="view flex justify-end margin-top">
44 - <view class="txt-26-h text-blue subject-button flex justify-center align-center">到店使用</view> 44 + <view wx:if="{{order.status==2}}"
  45 + class="txt-26-h subject-button2 flex justify-center align-center" >到店使用</view>
  46 + <navigator url="/pages/taocan/index?sid={{order.sid}}&pid={{order.food_id}}" catchtap="catchtap">
  47 + <view wx:if="{{order.status==3}}"
  48 + class="txt-26-h subject-button flex justify-center align-center" >再来一单</view>
  49 + </navigator>
  50 + <navigator url="/pages/taocan/index?sid={{}}&pid={{order.order_id}}" catchtap="catchtap">
  51 + <view wx:if="{{order.status==4}}"
  52 + class="txt-26-h subject-button flex justify-center align-center" >查看进度</view>
  53 + </navigator>
45 </view> 54 </view>
46 </subject> 55 </subject>
47 </navigator> 56 </navigator>
@@ -115,5 +115,12 @@ @@ -115,5 +115,12 @@
115 .subject-button{ 115 .subject-button{
116 width: 158rpx; 116 width: 158rpx;
117 height: 52rpx; 117 height: 52rpx;
  118 + border: 2rpx solid #999999;
  119 + color:#666666;
  120 +}
  121 +.subject-button2{
  122 + width: 158rpx;
  123 + height: 52rpx;
118 border: 2rpx solid #42A5FF; 124 border: 2rpx solid #42A5FF;
  125 + color: #42A5FF;
119 } 126 }