From a0b601b68572a9aa2498da1db93d8f0e6de1b956 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Tue, 11 Feb 2025 15:03:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.scss | 3 + components/active/active-item.vue | 2 +- components/travel/travelList.vue | 2 +- pages/index/index.vue | 120 +++++++++++++-------- pages_order/huodong-detail.vue | 13 ++- pages_order/lvyou-detail.vue | 10 +- pages_order/payOrder.vue | 2 +- .../components/uv-datetime-picker/props.js | 2 +- 8 files changed, 102 insertions(+), 52 deletions(-) diff --git a/common.scss b/common.scss index 23e22a8..44a1cfb 100644 --- a/common.scss +++ b/common.scss @@ -63,6 +63,7 @@ height: 228rpx; border-radius: 20rpx; overflow: hidden; + flex-shrink: 0; image { width: 100%; height: 100%; @@ -145,6 +146,8 @@ font-size: 28rpx; color: #fff; text-align: right; + margin-right: 50rpx; + margin-top: 10rpx; text { color: $uni-text-color-grey; font-size: 25rpx; diff --git a/components/active/active-item.vue b/components/active/active-item.vue index 1b7f873..2268454 100644 --- a/components/active/active-item.vue +++ b/components/active/active-item.vue @@ -5,7 +5,7 @@ v-for="(item, index) in cardListData" :key="index"> - + diff --git a/components/travel/travelList.vue b/components/travel/travelList.vue index 5b825d7..ae7c00c 100644 --- a/components/travel/travelList.vue +++ b/components/travel/travelList.vue @@ -4,7 +4,7 @@ v-for="(item, index) in cardListData" :key="index" @click="toDetail(item)"> - + diff --git a/pages/index/index.vue b/pages/index/index.vue index 4b70f8d..3b435d3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -64,7 +64,7 @@ - + > --> + + + + + - - @@ -158,10 +162,10 @@ return { status:"loading", params:{ - title:'', - state:0, - pageNo:1, - pageSize:10 + title : '', + state : 0, + pageNo : 1, + pageSize : 10 }, totalPage:0, bgColor:'transparent', @@ -233,40 +237,59 @@ this.getActivityPageList() }, async getActivityPageList() { - this.$api('activityPageList', { - ...this.params, - cityId : this.selectArea.id - }, res=>{ - uni.stopPullDownRefresh() - if(res.code == 200) { - this.totalPage = res.result.pages - this.cardListData = [...this.cardListData,...res.result.records] - if(this.params.pageNo >= this.totalPage) { - this.status = "nomore" - }else { - this.status = "loadmore" - } - } + // this.$api('activityPageList', { + // ...this.params, + // cityId : this.selectArea.id + // }, res=>{ + // uni.stopPullDownRefresh() + // if(res.code == 200) { + // this.totalPage = res.result.pages + // this.cardListData = [...this.cardListData,...res.result.records] + // if(this.params.pageNo >= this.totalPage) { + // this.status = "nomore" + // }else { + // this.status = "loadmore" + // } + // } + // }) + // this.$api('travelPageList', { + // ...this.params, + // // pageNo: this.params.pageNo, + // // pageSize: this.params.pageSize, + // // title: this.params.title, + // // state: this.params.state, + // }, res=>{ + // uni.stopPullDownRefresh() + // if(res.code == 200) { + // this.totalPage = res.result.pages + // this.travelList = [...this.travelList,...res.result.records] + // } + // }) + + let list1 = await this.getApi('activityPageList') + let list2 = await this.getApi('travelPageList') + + console.log(list1, list2); + + list1.forEach(n => { + n.ntype = 0 }) - this.$api('travelPageList', { - ...this.params, - // pageNo: this.params.pageNo, - // pageSize: this.params.pageSize, - // title: this.params.title, - // state: this.params.state, - }, res=>{ - uni.stopPullDownRefresh() - if(res.code == 200) { - this.totalPage = res.result.pages - this.travelList = [...this.travelList,...res.result.records] - } + + list2.forEach(n => { + n.ntype = 1 }) - // let list1 = await this.getApi('activityPageList') - // let list2 = await this.getApi('travelPageList') + if(this.params.pageNo >= this.totalPage) { + this.status = "nomore" + }else { + this.status = "loadmore" + } - // console.log(list1, list2); + this.cardListData = [...this.cardListData, ...list1, ...list2] + this.cardListData.sort((a, b) => { + return new Date(b.startTime).getTime() - new Date(a.startTime).getTime() + }) }, getApi(api){ return new Promise((success, error) => { @@ -275,6 +298,9 @@ cityId : this.selectArea.id }, res => { if(res.code == 200) { + if(this.totalPage < res.result.pages){ + this.totalPage = res.result.pages + } success(res.result.records) } }) @@ -453,6 +479,9 @@ background: url('@/static/image/home/hd-bg.png') no-repeat; background-size: 100% 100%; position: relative; + display: flex; + align-items: center; + justify-content: space-between; .left-box { height: 100%; display: flex; @@ -476,9 +505,9 @@ } } .hdqd-img { - position: absolute; - right: 22rpx; - top: 25rpx; + // position: absolute; + // right: 22rpx; + // top: 25rpx; width: 123rpx; height: 100rpx; } @@ -492,6 +521,9 @@ background-size: 100% 100%; position: relative; margin-top: 18rpx; + display: flex; + align-items: center; + justify-content: space-between; .left-box { height: 100%; display: flex; @@ -515,9 +547,9 @@ } } .hdqd-img { - position: absolute; - right: 22rpx; - top: 25rpx; + // position: absolute; + // right: 22rpx; + // top: 25rpx; width: 123rpx; height: 100rpx; } diff --git a/pages_order/huodong-detail.vue b/pages_order/huodong-detail.vue index 10b4683..b1f3c36 100644 --- a/pages_order/huodong-detail.vue +++ b/pages_order/huodong-detail.vue @@ -5,7 +5,14 @@ - + + + + {{activityDetails.title}} 开始时间:{{activityDetails.startTime}} @@ -49,7 +56,7 @@ 注意事项 - {{ activityDetails.precautions}} + @@ -163,7 +170,7 @@ computed:{ imageArr() { return this.activityDetails.image - && this.activityDetails.image.split(',')[0] + && this.activityDetails.image.split(',') } }, onShareAppMessage(res) { diff --git a/pages_order/lvyou-detail.vue b/pages_order/lvyou-detail.vue index f770ad5..691356b 100644 --- a/pages_order/lvyou-detail.vue +++ b/pages_order/lvyou-detail.vue @@ -5,7 +5,15 @@ - + + + + {{travelDetails.travel.title}} 开始时间:{{travelDetails.travel.startTime}} diff --git a/pages_order/payOrder.vue b/pages_order/payOrder.vue index 1b781c1..b16e23d 100644 --- a/pages_order/payOrder.vue +++ b/pages_order/payOrder.vue @@ -35,7 +35,7 @@