Commit 6da893f481060858fe50a398c5f27c2d9f06d9d2

Authored by yvan.ni
1 parent 5b4a39f2

拼团列表的优化

pages/activity/pind_list/pind_list.js
@@ -18,7 +18,8 @@ Page({ @@ -18,7 +18,8 @@ Page({
18 iurl: os.imghost, 18 iurl: os.imghost,
19 ad_data: null, 19 ad_data: null,
20 max_sw_height: 200, 20 max_sw_height: 200,
21 - is_retail_price:0 21 + is_retail_price:0,
  22 + isget:0
22 }, 23 },
23 24
24 //------初始化加载---------- 25 //------初始化加载----------
@@ -164,12 +165,9 @@ Page({ @@ -164,12 +165,9 @@ Page({
164 getApp().showWarning("没有更多数据"); 165 getApp().showWarning("没有更多数据");
165 th.data.ismore = 0; 166 th.data.ismore = 0;
166 167
167 -  
168 -  
169 //没有数据切换 168 //没有数据切换
170 if (e.data.currentPage == 1 && this.data.type == 1) { 169 if (e.data.currentPage == 1 && this.data.type == 1) {
171 170
172 -  
173 e.data.currentPage=1; 171 e.data.currentPage=1;
174 i = "/api/weshop/teamlist/pageteam/0?page=" + e.data.currentPage; 172 i = "/api/weshop/teamlist/pageteam/0?page=" + e.data.currentPage;
175 await getApp().request.promiseGet(i, { 173 await getApp().request.promiseGet(i, {
@@ -181,40 +179,50 @@ Page({ @@ -181,40 +179,50 @@ Page({
181 user_id:getApp().globalData.user_id, 179 user_id:getApp().globalData.user_id,
182 } 180 }
183 }).then(res => { 181 }).then(res => {
184 - plist = res.data.data.pageData; 182 +
  183 + if(ut.ajax_ok(res)){
  184 + plist = res.data.data.pageData;
  185 + th.setData({ type: 0 });
  186 + }
185 }); 187 });
186 188
187 - if(plist){  
188 - setTimeout(function () {  
189 - th.data.ismore = 1;  
190 - th.setData({  
191 - type: 0  
192 - });  
193 - th.requestSalelist();  
194 - }, 1000);  
195 - } 189 +
  190 +
  191 +
  192 + // if(plist){
  193 + // setTimeout(function () {
  194 + // th.data.ismore = 1;
  195 + // th.setData({
  196 + // type: 0
  197 + // });
  198 + // th.requestSalelist();
  199 + // }, 1000);
  200 + // }
196 201
197 } 202 }
198 203
199 } 204 }
200 - //--循环读取接口---  
201 - for (var i = 0; i < plist.length; i++) {  
202 - var prom_id = plist[i].id;  
203 - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +  
204 - os.stoid + "/6/" + prom_id, {}).then(res => {  
205 - if (res.data.code == 0) {  
206 - plist[i].status = 1;  
207 - if (res.data.data <= 0) plist[i].status = 3;  
208 - }  
209 - });  
210 - alllist.push(plist[i]); 205 +
  206 + if(plist) {
  207 + //--循环读取接口---
  208 + for (var i = 0; i < plist.length; i++) {
  209 + var prom_id = plist[i].id;
  210 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  211 + os.stoid + "/6/" + prom_id, {}).then(res => {
  212 + if (res.data.code == 0) {
  213 + plist[i].status = 1;
  214 + if (res.data.data <= 0) plist[i].status = 3;
  215 + }
  216 + });
  217 + alllist.push(plist[i]);
  218 + }
  219 + e.data.currentPage++;
211 } 220 }
212 - e.data.currentPage++;  
213 221
214 th.setData({ 222 th.setData({
215 goodlist: alllist, 223 goodlist: alllist,
216 isshow: 1, 224 isshow: 1,
217 - ismore:0, 225 + is_get:1,
218 }); 226 });
219 }, 227 },
220 228
pages/activity/pind_list/pind_list.wxml
@@ -104,7 +104,7 @@ @@ -104,7 +104,7 @@
104 104
105 </view> 105 </view>
106 106
107 -<view class="no-more" wx:if="{{goodlist.length==0 && !ismore}}">没有相关内容</view> 107 +<view class="no-more" wx:if="{{goodlist.length==0 && isget}}">没有相关内容</view>
108 </view> 108 </view>
109 109
110 110