diff --git a/app.json b/app.json index 010bb38..409695f 100644 --- a/app.json +++ b/app.json @@ -36,7 +36,7 @@ "pages/refund/refund", "pages/serviceWebView/serviceWebView", "pages/liveLsit/liveLsit", - "pages/coupon/confirmation/confirmation", + "pages/coupon/confirmation/confirmation", "pages/coupon/instructions/instructions" ], "window": { @@ -44,5 +44,5 @@ "navigationBarBackgroundColor": "#fff", "navigationBarTextStyle": "black" } - + } \ No newline at end of file diff --git a/index/index.js b/index/index.js index 8328024..6e0a1d7 100644 --- a/index/index.js +++ b/index/index.js @@ -169,7 +169,8 @@ Page({ this.setData({ index: index, mallTenantId: mallTenantId, - + businePageNum: 1, // 切换广场后将页码切换至1 + noDataFlag: false }); this.getBannerlist(); this.getBusinessList() @@ -208,7 +209,8 @@ Page({ }) }, getCouponChannelList(key) { - if (this.data.noDataFlag) { + const that = this + if (that.data.noDataFlag) { return } tt.showLoading({ @@ -217,14 +219,14 @@ Page({ let param = {} if (key == 0) { param = { - pageNum: this.data.businePageNum, + pageNum: that.data.businePageNum, pageSize: 6, targetAd: 101, mallTenantId: tt.getStorageSync('mallTenantId') || "" } } else { param = { - pageNum: this.data.businePageNum, + pageNum: that.data.businePageNum, pageSize: 6, business: key, targetAd: 101, @@ -237,9 +239,10 @@ Page({ url: config.api.couponChannelList, data: param }).then(res => { + if (res.data.list && res.data.list.length != 0) { + let tempLsit = that.data.businessData - let tempLsit = this.data.businessData let data = res.data.list data.map(item => { if (item.salePriceStr && item.salePriceStr.indexOf('.') != -1) { @@ -250,24 +253,22 @@ Page({ item.sale = item.inventory - item.remainInventory }) - if (this.data.businePageNum > 1) { - this.setData({ + if (that.data.businePageNum > 1) { + that.setData({ businessData: [...tempLsit, ...data] }) } else { - this.setData({ + that.setData({ businessData: data }) } - } else { - this.setData({ - // noDataFlag: true, - businessData: [] + that.setData({ + noDataFlag: true, }) } tt.hideLoading(); - console.log(this.data.businessData, 'businessData'); + console.log(that.data.businessData, 'businessData'); }).catch(err => { tt.hideLoading(); tt.showModal({ @@ -1451,52 +1452,59 @@ Page({ /** * 刷新 */ - onPullDownRefresh: function (e) { + onPullDownRefresh() { tt.showLoading({ title: "加载中..." }); let that = this; + // that.setData({ + // topicObj2: null, //欢乐城首页限时抢购 + // topicObj3: null, //欢乐城首页砍价 + // topicObj4: null, //欢乐城首页拼团 + // topicObj5: null, //欢乐城首页消费卡 + // topicObj6: null, //欢乐城首页积分商城 + // specialLsit: null, //专题 + // }) + // // that.getWeapNote(); that.setData({ - topicObj2: null, //欢乐城首页限时抢购 - topicObj3: null, //欢乐城首页砍价 - topicObj4: null, //欢乐城首页拼团 - topicObj5: null, //欢乐城首页消费卡 - topicObj6: null, //欢乐城首页积分商城 - specialLsit: null, //专题 - }) - // that.getWeapNote(); - that.setData({ - page: 1 + page: 1, + businePageNum: 1, + noDataFlag: false }) - if (that.data.optionsData != null && (that.data.optionsData.couponChannelId || that.data.optionsData.orderId)) { - that.getWeapNote(that.data.optionsData.couponChannelId, that.data.optionsData.orderId); - } else { - that.getWeapNote() - } - if (that.selectComponent("#lists")) { - if (that.data.code == 0 || that.data.code == undefined) { - that.selectComponent("#lists").getList(0, 1, "refresh"); - tt.stopPullDownRefresh(); - } else { - that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); - tt.stopPullDownRefresh(); - }; - that.selectComponent("#hot").getList(); - } + // if (that.data.optionsData != null && (that.data.optionsData.couponChannelId || that.data.optionsData.orderId)) { + // that.getWeapNote(that.data.optionsData.couponChannelId, that.data.optionsData.orderId); + // } else { + // that.getWeapNote() + // } + // if (that.selectComponent("#lists")) { + // if (that.data.code == 0 || that.data.code == undefined) { + // that.selectComponent("#lists").getList(0, 1, "refresh"); + // tt.stopPullDownRefresh(); + // } else { + // that.selectComponent("#lists").getList(that.data.code, 1, "refresh"); + // tt.stopPullDownRefresh(); + // }; + // that.selectComponent("#hot").getList(); + // } - // 砍价下拉刷新 - // that.selectComponent("#bargain").getList(); - // that.selectComponent("#spellGroup").getList(); - // that.selectComponent("#rushtobyCard").getList(); + // // 砍价下拉刷新 + // // that.selectComponent("#bargain").getList(); + // // that.selectComponent("#spellGroup").getList(); + // // that.selectComponent("#rushtobyCard").getList(); - //爆款专区下拉刷新 + // // 爆款专区下拉刷新 - that.getxsList(); - that.topicShow(); - setTimeout(function () { + // that.getxsList(); + // that.topicShow(); + + this.getBannerlist(); + this.getBusinessList() + this.getCouponChannelList(this.data.busineKye) + + setTimeout(() => { tt.hideLoading(); tt.stopPullDownRefresh(); - }, 1000); + }, 1600); }, //加载更多 diff --git a/project.config.json b/project.config.json index e349044..9614853 100644 --- a/project.config.json +++ b/project.config.json @@ -1 +1,52 @@ -{"setting":{"urlCheck":false,"es6":true,"newFeature":false,"postcss":false,"mockUpdate":true,"minified":false,"autoPush":false,"scripts":false,"mockLogin":false,"autoCompile":true,"localPlugins":false,"IDEPreviewHotRestartCache":false},"appid":"ttde7ca8c141425a2301","projectname":"tt富茂C","condition":{"miniprogram":{"current":-1,"list":[{"id":1676969626961,"name":"pages/main/index","pathName":"pages/main/index","query":"type=md&id=758855991052394496&tenantId=1032","scene":"990001","launchFrom":"scan","location":"qr_code"},{"id":1671727084768,"name":"index/index","pathName":"pages/main/index","query":"type=cd&couponChannelId=762472141677453312&tenantId=1032","scene":"990001","launchFrom":"scan","location":"qr_code"},{"id":1676971480642,"name":"pages/liveLsit/liveLsit","pathName":"pages/liveLsit/liveLsit","query":"tenantId=1032","scene":"990001","launchFrom":"scan","location":"qr_code"}]}}} +{ + "setting": { + "urlCheck": false, + "es6": true, + "newFeature": false, + "postcss": false, + "mockUpdate": true, + "minified": false, + "autoPush": false, + "scripts": false, + "mockLogin": false, + "autoCompile": true, + "localPlugins": false, + "IDEPreviewHotRestartCache": false + }, + "appid": "ttde7ca8c141425a2301", + "projectname": "tt富茂C", + "condition": { + "miniprogram": { + "current": -1, + "list": [ + { + "id": 1676969626961, + "name": "pages/main/index", + "pathName": "pages/main/index", + "query": "type=md&id=758855991052394496&tenantId=1032", + "scene": "990001", + "launchFrom": "scan", + "location": "qr_code" + }, + { + "id": 1671727084768, + "name": "index/index", + "pathName": "pages/main/index", + "query": "type=cd&couponChannelId=762472141677453312&tenantId=1032", + "scene": "990001", + "launchFrom": "scan", + "location": "qr_code" + }, + { + "id": 1676971480642, + "name": "pages/liveLsit/liveLsit", + "pathName": "pages/liveLsit/liveLsit", + "query": "tenantId=1032", + "scene": "990001", + "launchFrom": "scan", + "location": "qr_code" + } + ] + } + } +}