Commit 10020391a9ad7082ddc0916860b1d8a4f8a12fd5
1 parent
aec835ab
秒杀的自动跳转到预热
Showing
2 changed files
with
18 additions
and
5 deletions
pages/activity/seckill_list/seckill_list.js
| @@ -17,9 +17,13 @@ Page({ | @@ -17,9 +17,13 @@ Page({ | ||
| 17 | 17 | ||
| 18 | //------初始化加载---------- | 18 | //------初始化加载---------- |
| 19 | onLoad: function(t) { | 19 | onLoad: function(t) { |
| 20 | - wx.setNavigationBarTitle({ title: "商品秒杀",}) | ||
| 21 | - | 20 | + wx.setNavigationBarTitle({ title: "商品秒杀",}) |
| 22 | var first_leader = t.first_leader; | 21 | var first_leader = t.first_leader; |
| 22 | + var type=t.type; | ||
| 23 | + if(type!=undefined){ | ||
| 24 | + this.setData({type:type}); | ||
| 25 | + } | ||
| 26 | + | ||
| 23 | var th=this; | 27 | var th=this; |
| 24 | 28 | ||
| 25 | console.log("------------"); | 29 | console.log("------------"); |
| @@ -129,8 +133,17 @@ Page({ | @@ -129,8 +133,17 @@ Page({ | ||
| 129 | }); | 133 | }); |
| 130 | 134 | ||
| 131 | if(plist.length<=0){ | 135 | if(plist.length<=0){ |
| 136 | + | ||
| 132 | getApp().showWarning("没有更多数据"); | 137 | getApp().showWarning("没有更多数据"); |
| 133 | th.data.ismore=0; | 138 | th.data.ismore=0; |
| 139 | + if(e.data.currentPage==1 && this.data.type==1){ | ||
| 140 | + setTimeout(function () { | ||
| 141 | + th.data.ismore=1; | ||
| 142 | + th.setData({type:0}); | ||
| 143 | + th.requestSalelist(); | ||
| 144 | + },1000); | ||
| 145 | + } | ||
| 146 | + return false; | ||
| 134 | } | 147 | } |
| 135 | 148 | ||
| 136 | //--循环读取接口--- | 149 | //--循环读取接口--- |
| @@ -147,7 +160,7 @@ Page({ | @@ -147,7 +160,7 @@ Page({ | ||
| 147 | alllist.push(plist[i]); | 160 | alllist.push(plist[i]); |
| 148 | } | 161 | } |
| 149 | e.data.currentPage++; | 162 | e.data.currentPage++; |
| 150 | - console.log("秒杀商品列表", alllist); | 163 | + console.log("秒杀商品列表", alllist); |
| 151 | th.setData({goodlist:alllist,isshow:1}); | 164 | th.setData({goodlist:alllist,isshow:1}); |
| 152 | 165 | ||
| 153 | }, | 166 | }, |
pages/activity/seckill_list/seckill_list.wxml
| @@ -84,11 +84,11 @@ | @@ -84,11 +84,11 @@ | ||
| 84 | <view class="theader" > | 84 | <view class="theader" > |
| 85 | <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> | 85 | <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> |
| 86 | <image class="xc-bottom" | 86 | <image class="xc-bottom" |
| 87 | - src="{{type==1?'{{url}}/miniapp/images/fire-red.png':'{{url}}/miniapp/images/fire-black.png'}}"></image> | 87 | + src="{{url}}{{type==1?'/miniapp/images/fire-red.png':'/miniapp/images/fire-black.png'}}"></image> |
| 88 | 火热进行中</view> | 88 | 火热进行中</view> |
| 89 | <view bindtap='tip' data-ty="0" class=" flex-center timeac right {{type==0?'active':''}}"> | 89 | <view bindtap='tip' data-ty="0" class=" flex-center timeac right {{type==0?'active':''}}"> |
| 90 | <image class="xc-bottom" | 90 | <image class="xc-bottom" |
| 91 | - src="{{type==0?'{{url}}/miniapp/images/clock-rad.png':'{{url}}/miniapp/images/clock-black.png'}}"></image> | 91 | + src="{{url}}{{type==0?'/miniapp/images/clock-rad.png':'/miniapp/images/clock-black.png'}}"></image> |
| 92 | 即将开始</view> | 92 | 即将开始</view> |
| 93 | </view> | 93 | </view> |
| 94 | </view> | 94 | </view> |