diff --git a/src/pages/collection/info/info.vue b/src/pages/collection/info/info.vue index 5292915..916785a 100644 --- a/src/pages/collection/info/info.vue +++ b/src/pages/collection/info/info.vue @@ -1,7 +1,7 @@ @@ -92,50 +95,65 @@ export default { page: 1 } }, + onReachBottom(){ + let { curStadium, optionsQuery, curScene, curDate, curType, page } = this; + let _query = { + brand_id: optionsQuery.brand_id, + stadium_id: optionsQuery.stadium_id == 0 ? -1 : curStadium.id, + time_str: curDate, + scene: curScene.scene, + type: curType == 1 ? '退款' : '全部', + page: ++page + } + + this.getRecordLs(_query); + }, onLoad(options){ this.optionsQuery = options || {}; this.initPage(options); }, methods: { + typeChange(idx){ + this.curType = idx; + this.$nextTick(_=>this.refreshList()); + }, async initPage(options){ - let _stadiumLs = await this.getStoreList(options.stadium_id); + let _stadiumLs = []; + if(!!options.stadium_id)_stadiumLs = await this.getStoreList(options.stadium_id); let _sceneLs = await this.getSceneList(); - let _date = this.curDate = util.formatDate({}); - let _sid = options.stadium_id - this.getRecordLs({ - brand_id: options.brand_id, - stadium_id: _sid, - time_str: _date, - scene: _sceneLs[0].scene, - }) + this.curDate = util.formatDate({}); + this.$nextTick(_=>this.refreshList()); }, refreshList(){ let { curStadium, optionsQuery, curScene, curDate, curType } = this; - + this.page = 1; + this.recordLs = []; + + let _query = { + brand_id: optionsQuery.brand_id, + stadium_id: optionsQuery.stadium_id == 0 ? -1 : curStadium.id, + time_str: curDate, + scene: curScene.scene, + type: curType == 1 ? '退款' : '全部' + } + + this.getRecordLs(_query); }, dateChange(e){ this.curDate = e.detail.value; - + this.$nextTick(_=>this.refreshList()); + }, sceneChange(e){ let { sceneList } = this; this.curScene = sceneList[e.detail.value]; + this.$nextTick(_=>this.refreshList()); }, async storeChange(e){ - try{ - util.showLoad(); - // let { curDate, stadiumList } = this; - // await this.getRecordList({ - // stadium_id: stadiumList[e.detail.value].id || '', - // date: `${curDate.year}-${curDate.month}` - // }); - this.curStadium = stadiumList[e.detail.value] || {}; - util.hideLoad(); - }catch(err){ - util.hideLoad(); - console.warn('dateChange err',err) - } + let { stadiumList } = this; + this.curStadium = stadiumList[e.detail.value] || {}; + this.$nextTick(_=>this.refreshList()); }, getRecordLs({ brand_id, @@ -147,6 +165,7 @@ export default { page = 1, }){ let { optionsQuery } = this; + util.showLoad(); return servers.get({ url: API.consumeCountDetailLs, data: { @@ -162,6 +181,7 @@ export default { }) .then(res=>{ + util.hideLoad(); let _list = res.list || []; this.totalInfo = res || {}; if(page == 1)return this.recordLs = _list; @@ -226,10 +246,13 @@ export default { background-color: #fff; } .collection-info{ + padding-bottom: 0upx; + padding-bottom: calc( 0upx + constant(safe-area-inset-bottom)); /* 兼容 iOS < 11.2 */ + padding-bottom: calc( 0upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */ .ci-header{ - padding: 0 24upx; + padding: 26upx 24upx 0; .ch-stadium{ - padding: 26upx 0; + padding-bottom: 26upx; @include centerFlex(space-between); .cs-txt{ @@ -389,7 +412,9 @@ export default { padding: 0 30upx; .cl-item{ padding: 30upx 0; - border-bottom: 2upx solid #D8D8D8; + &:not(:last-child){ + border-bottom: 2upx solid #D8D8D8; + } .ci-name{ margin-bottom: 8upx; @include centerFlex(space-between); @@ -402,6 +427,9 @@ export default { text-align: right; font-weight: 500; color: #F6843E; + &.black{ + color: #1A1A1A; + } } } }