Commit e33f09902f32289b8f00eaedff5d6512ed82bfec

Authored by vking
1 parent 1352d7dc

taocan

1 <!--components/2.0/taocan/card.wxml--> 1 <!--components/2.0/taocan/card.wxml-->
  2 +<navigator url="/pages/taocan/index?sid={{detail.sid}}&pid={{detail.id}}" hover-class="navigator-hover">
2 <view class="view flex margin-bottom-lg card"> 3 <view class="view flex margin-bottom-lg card">
3 <view class="view thumb" style="background-image: url('{{detail.main_url}}?imageView2/2/w/320')"></view> 4 <view class="view thumb" style="background-image: url('{{detail.main_url}}?imageView2/2/w/320')"></view>
4 <view class="view margin-left"> 5 <view class="view margin-left">
@@ -21,7 +22,6 @@ @@ -21,7 +22,6 @@
21 <view class="view margin-left-xs txt-24-h">{{(detail.discount*10)}}折</view> 22 <view class="view margin-left-xs txt-24-h">{{(detail.discount*10)}}折</view>
22 </view> 23 </view>
23 </view> 24 </view>
24 - <navigator url="/pages/taocan/index?sid={{detail.sid}}&pid={{detail.id}}" hover-class="navigator-hover">  
25 - <view class="button bg-blue-blue txt-28-h text-bold flex align-center justify-center">抢购</view>  
26 - </navigator> 25 + <view class="button bg-blue-blue txt-28-h text-bold flex align-center justify-center">抢购</view>
27 </view> 26 </view>
  27 +</navigator>
@@ -28,6 +28,13 @@ Page({ @@ -28,6 +28,13 @@ Page({
28 r.sid=this.data.sid 28 r.sid=this.data.sid
29 packs[r.id]=r 29 packs[r.id]=r
30 }) 30 })
  31 + do{
  32 + packs[Math.random()]={}
  33 + }while(Object.keys(packs).length<3)
  34 + if(!packs[this.activityId]){
  35 + util.toast('套餐已下架','none')
  36 + this.activityId=res.data[0].id
  37 + }
31 this.setData({ 38 this.setData({
32 packs:packs, 39 packs:packs,
33 activityId:this.activityId, 40 activityId:this.activityId,
@@ -95,10 +102,12 @@ Page({ @@ -95,10 +102,12 @@ Page({
95 }else{ 102 }else{
96 current=index>0?(index-1):0 103 current=index>0?(index-1):0
97 } 104 }
98 - return current 105 + return current>0?current:0
99 }, 106 },
100 touchTab(e){ 107 touchTab(e){
101 - this.activityId=util.attr(e,'id') 108 + let activityId=util.attr(e,'id')
  109 + if(!activityId) return;
  110 + this.activityId=activityId
102 let obj={ 111 let obj={
103 activityId:this.activityId, 112 activityId:this.activityId,
104 } 113 }
1 { 1 {
  2 + "navigationBarBackgroundColor": "#ffffff",
  3 + "navigationBarTextStyle": "black",
2 "usingComponents": { 4 "usingComponents": {
3 "nav":"/components/nav/nav" 5 "nav":"/components/nav/nav"
4 } 6 }
@@ -87,7 +87,7 @@ Page({ @@ -87,7 +87,7 @@ Page({
87 ufid: this.options.id, 87 ufid: this.options.id,
88 }).then(async res=>{ 88 }).then(async res=>{
89 let qrcode='' 89 let qrcode=''
90 - if(true || res.data.order_info.status==2){ 90 + if(res.data.order_info.status==2){
91 qrcode=util.http_build_query({ 91 qrcode=util.http_build_query({
92 path:'pages/writeoff/setmeal', 92 path:'pages/writeoff/setmeal',
93 //path:'pages/me/s_index', 93 //path:'pages/me/s_index',