Commit 69aa9f54f0213449942540013e7d982c264f7b11

Authored by wangfan
1 parent 3c9ae71d

快速预定

@@ -47,7 +47,11 @@ @@ -47,7 +47,11 @@
47 share="{{detail}}" 47 share="{{detail}}"
48 share-act="invitation" 48 share-act="invitation"
49 class="share-but-view"> 49 class="share-but-view">
50 - <view class="share-but Regular">提前点餐</view> 50 + <view class="share-but Regular flex-cc" wx:if="{{!detail.orderid}}">
  51 + <view>查看菜品</view>
  52 + <image class="order-cook" src="http://qn.colorcun.com/custom/lite-yd-cook/image/order-cook.png"></image>
  53 + </view>
  54 + <view class="share-but Regular" wx:else="">提前点餐</view>
51 </userinfo> 55 </userinfo>
52 </view> 56 </view>
53 <view style="height: 40rpx;"></view> 57 <view style="height: 40rpx;"></view>
@@ -120,4 +120,9 @@ @@ -120,4 +120,9 @@
120 .more{ 120 .more{
121 width: 14rpx; 121 width: 14rpx;
122 height: 26rpx; 122 height: 26rpx;
  123 +}
  124 +.order-cook{
  125 + width: 44rpx;
  126 + height: 30rpx;
  127 + margin-left: 10rpx;
123 } 128 }
@@ -39,15 +39,12 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0, @@ -39,15 +39,12 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
39 } 39 }
40 if(!fouce && cachetime!=0){//优先使用缓存 40 if(!fouce && cachetime!=0){//优先使用缓存
41 let getCache= cache(cache_key); 41 let getCache= cache(cache_key);
  42 + //console.log('getCache.'+getCache,cache_key);
42 if(getCache!=-99999){ 43 if(getCache!=-99999){
43 return new Promise((success,fail)=>{ 44 return new Promise((success,fail)=>{
44 - if(true){  
45 - getCache.isCache=true;  
46 - console.log(cache_key+'\nuse cache',getCache);  
47 - success(getCache);  
48 - }else{  
49 - fail();  
50 - } 45 + getCache.isCache=true;
  46 + console.log(cache_key+'\nuse cache',getCache);
  47 + success(getCache);
51 }) 48 })
52 } 49 }
53 } 50 }
@@ -78,7 +75,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0, @@ -78,7 +75,7 @@ function rpc(host='',act,data={},fouce=false,header={},silence=true,cachetime=0,
78 console.log('request.api==>',host+cache_key+'\nrequest.success',res.data); 75 console.log('request.api==>',host+cache_key+'\nrequest.success',res.data);
79 // return; 76 // return;
80 if(res.data){ 77 if(res.data){
81 - if(cachetime!=0 && res.data.ret==200 && res.data.data){ 78 + if(cachetime!=0 && res.data.ret==200){
82 cache(cache_key,res.data,cachetime);//.then().catch(); 79 cache(cache_key,res.data,cachetime);//.then().catch();
83 } 80 }
84 if(res.data.ret!==200){ 81 if(res.data.ret!==200){
@@ -166,7 +163,7 @@ function cache(key,val=-99999,timeout=-1){ @@ -166,7 +163,7 @@ function cache(key,val=-99999,timeout=-1){
166 } 163 }
167 let res=wx.getStorageSync(key); 164 let res=wx.getStorageSync(key);
168 let time=Date.parse(new Date())/1000; 165 let time=Date.parse(new Date())/1000;
169 - if(res && (res.timeout==-1 || res.timeout>time) && res.data.data){ 166 + if(res && (res.timeout==-1 || res.timeout>time) && res.data){
170 return res.data; 167 return res.data;
171 }else{ 168 }else{
172 return -99999 169 return -99999