From 6da893f481060858fe50a398c5f27c2d9f06d9d2 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Mon, 12 Jun 2023 22:28:06 +0800 Subject: [PATCH] 拼团列表的优化 --- pages/activity/pind_list/pind_list.js | 62 +++++++++++++++++++++++++++++++++++--------------------------- pages/activity/pind_list/pind_list.wxml | 2 +- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index 4f816d4..ede6461 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -18,7 +18,8 @@ Page({ iurl: os.imghost, ad_data: null, max_sw_height: 200, - is_retail_price:0 + is_retail_price:0, + isget:0 }, //------初始化加载---------- @@ -164,12 +165,9 @@ Page({ getApp().showWarning("没有更多数据"); th.data.ismore = 0; - - //没有数据切换 if (e.data.currentPage == 1 && this.data.type == 1) { - e.data.currentPage=1; i = "/api/weshop/teamlist/pageteam/0?page=" + e.data.currentPage; await getApp().request.promiseGet(i, { @@ -181,40 +179,50 @@ Page({ user_id:getApp().globalData.user_id, } }).then(res => { - plist = res.data.data.pageData; + + if(ut.ajax_ok(res)){ + plist = res.data.data.pageData; + th.setData({ type: 0 }); + } }); - if(plist){ - setTimeout(function () { - th.data.ismore = 1; - th.setData({ - type: 0 - }); - th.requestSalelist(); - }, 1000); - } + + + + // if(plist){ + // setTimeout(function () { + // th.data.ismore = 1; + // th.setData({ + // type: 0 + // }); + // th.requestSalelist(); + // }, 1000); + // } } } - //--循环读取接口--- - for (var i = 0; i < plist.length; i++) { - var prom_id = plist[i].id; - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + - os.stoid + "/6/" + prom_id, {}).then(res => { - if (res.data.code == 0) { - plist[i].status = 1; - if (res.data.data <= 0) plist[i].status = 3; - } - }); - alllist.push(plist[i]); + + if(plist) { + //--循环读取接口--- + for (var i = 0; i < plist.length; i++) { + var prom_id = plist[i].id; + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + + os.stoid + "/6/" + prom_id, {}).then(res => { + if (res.data.code == 0) { + plist[i].status = 1; + if (res.data.data <= 0) plist[i].status = 3; + } + }); + alllist.push(plist[i]); + } + e.data.currentPage++; } - e.data.currentPage++; th.setData({ goodlist: alllist, isshow: 1, - ismore:0, + is_get:1, }); }, diff --git a/pages/activity/pind_list/pind_list.wxml b/pages/activity/pind_list/pind_list.wxml index 949c5d3..4060f18 100644 --- a/pages/activity/pind_list/pind_list.wxml +++ b/pages/activity/pind_list/pind_list.wxml @@ -104,7 +104,7 @@ -没有相关内容 +没有相关内容 -- libgit2 0.21.4