From 691c1ed82e18388f0a0771e5ff17aa3712c112be Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Wed, 2 Apr 2025 10:21:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=98=A5=E6=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 12 ++ subPackages/activity/commonRule.vue | 47 +++++ subPackages/activity/springTour.vue | 288 ++++++++++++++++++++++++++++ 3 files changed, 347 insertions(+) create mode 100644 subPackages/activity/commonRule.vue create mode 100644 subPackages/activity/springTour.vue diff --git a/pages.json b/pages.json index 3168caa..13a6576 100644 --- a/pages.json +++ b/pages.json @@ -299,6 +299,18 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "activity/springTour", + "style": { + "navigationBarTitleText": "花开盐都 春游水乡" + } + }, + { + "path": "activity/commonRule", + "style": { + "navigationBarTitleText": "活动规则" + } } ] }], diff --git a/subPackages/activity/commonRule.vue b/subPackages/activity/commonRule.vue new file mode 100644 index 0000000..9275424 --- /dev/null +++ b/subPackages/activity/commonRule.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/subPackages/activity/springTour.vue b/subPackages/activity/springTour.vue new file mode 100644 index 0000000..d276c9d --- /dev/null +++ b/subPackages/activity/springTour.vue @@ -0,0 +1,288 @@ + + + + + From de4b49f5dc49db5313fb33283646ccc8fe3876a9 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Thu, 3 Apr 2025 09:19:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=98=A5=E6=B8=B8=E4=B8=93=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/activity/springTour.vue | 14 ++++++++ subPackages/order/detail.vue | 54 ++++++++++++++++++++++++----- subPackages/ticketBooking/order.vue | 4 +-- 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/subPackages/activity/springTour.vue b/subPackages/activity/springTour.vue index d276c9d..0d1eed6 100644 --- a/subPackages/activity/springTour.vue +++ b/subPackages/activity/springTour.vue @@ -56,9 +56,23 @@ } }, onReady() { + this.getCouponId() this.getList() }, methods: { + // 获取优惠券id + getCouponId () { + this.Post({id: 256},'/api/multimedia/detail').then(res=>{ + if (res.code == 1 && res.data) { + let ids = res.data.ext_link.split(',') + for(let i=0;i - 还剩{{remainNum}}张未核销 + - + {{item.specifications_name}} - 核销码:{{item.third_order_id||item.child_id}} - + + 核销码:{{item.code}} @@ -432,7 +432,8 @@ isQrcode: false, remainNum: 0, maskShow: false, - postInfo: [] + postInfo: [], + qrCodeImgs: [], } }, onLoad(option) { @@ -478,29 +479,66 @@ .includes(this.info.status)) { this.isQrcode = true for (let i = 0; i < this.info.order_child.length; i++) { - // 有third_order_id 优先用third_order_id + let orderChildItem = this.info.order_child[i] + // 有third_order_id 优先用third_order_id 此getCodeImg生成的不用 用setQRCodeImgs this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i); - + this.setQRCodeImgs(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, + {specifications_name:orderChildItem.specifications_name, status:orderChildItem.status}) // 未核销数量 if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1 } } else if (!['WAIT_PAYMENT', 'CLOSED'].includes(this.info.status)) { for (let i = 0; i < this.info.order_child.length; i++) { + let orderChildItem = this.info.order_child[i] if (this.info.order_child[i].is_display_order_qrcode) { this.isQrcode = true + //此getCodeImg生成的不用 this.getCodeImg(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, i); - + this.setQRCodeImgs(this.info.order_child[i].third_order_id||this.info.order_child[i].child_id, + {specifications_name:orderChildItem.specifications_name, status:orderChildItem.status}) // 未核销数量 if (this.info.order_child[i].status == 'SUCCESS') this.remainNum += 1 } } } + + for (let i = 0;i { console.log(this.info.order_child) }, 1000) }) }, + // 二维码数组分割 + setQRCodeImgs(codeStr, otherParam) { + if (codeStr) { + let arrCode = codeStr.split(',').map(v=> {return {code: v, qrcodeimg: '', ...otherParam}}) + this.qrCodeImgs = this.qrCodeImgs.concat(arrCode) + } + }, + // 新生成二维码 + getCodeImgNew(item,index) { + console.log(item) + new QRCode('qrcodeT'+index, { + text: item.code, + width: 150, + height: 150, + padding: 2, + colorDark: 'rgb(0,0,0)', + colorLight: 'rgb(255,255,255)', + correctLevel: QRCode.CorrectLevel.M, // 二维码可辨识度 + callback: res => { + console.log('callback') + this.$set(item, 'qrcodeimg', res.path); + item.qrcodeimg = res.path + this.$forceUpdate(); + } + }); + }, + + // 生成二维码 getCodeImg(code, index) { new QRCode('qrcodeT' + index, { diff --git a/subPackages/ticketBooking/order.vue b/subPackages/ticketBooking/order.vue index 264ba7e..9eb2f06 100644 --- a/subPackages/ticketBooking/order.vue +++ b/subPackages/ticketBooking/order.vue @@ -52,8 +52,8 @@ - 仅需填写{{pInfo.specifications[0].buyNum}}位出行人 - 出行人信息 + + 请填写出行人信息 From 88bd4347d72af8f3543c2a724242b988b6448ce9 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Mon, 14 Apr 2025 09:35:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=93=E9=A2=98=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/activity/springTour.vue | 216 +++++++++++++++++----------- 1 file changed, 129 insertions(+), 87 deletions(-) diff --git a/subPackages/activity/springTour.vue b/subPackages/activity/springTour.vue index 0d1eed6..fcd9ab2 100644 --- a/subPackages/activity/springTour.vue +++ b/subPackages/activity/springTour.vue @@ -1,22 +1,16 @@ @@ -44,22 +49,37 @@ data() { return { couponList: [ - {id: 1, price:5, title: '满15减5'}, - {id: 2, price:10, title: '满30减10'}, - {id: 3, price:15, title: '满50减15'}, - {id: 4, price:20, title: '满60减20'}, + {id: 1, price:5, title: '满15减5',img: 'https://tongli.sz-trip.com/uploads/20250411/c94ac0d977b4767d2809134fdace5a62.png'}, + {id: 2, price:10, title: '满30减10',img: 'https://tongli.sz-trip.com/uploads/20250411/15a8af6400b71c5b7e2f8da78ead6f04.png'}, + {id: 3, price:15, title: '满50减15',img: 'https://tongli.sz-trip.com/uploads/20250411/529b589eec9ac511f13fadbdd8188f2c.png'}, + {id: 4, price:20, title: '满60减20',img: 'https://tongli.sz-trip.com/uploads/20250411/883734155ee9cbbbcee590194f6143be.png'}, ], list:[], finished: false, isReceive: true, + goTop: false } }, onReady() { this.getCouponId() this.getList() }, + onPageScroll(e){ + // 监听页面滚动 + if(e.scrollTop>200){ + this.goTop=true; + }else{ + this.goTop=false; + } + }, methods: { + Totop(){ + uni.pageScrollTo({ + scrollTop: 0,//滚动到页面的目标位置 + duration: 300 + }); + }, // 获取优惠券id getCouponId () { this.Post({id: 256},'/api/multimedia/detail').then(res=>{ @@ -140,43 +160,61 @@ } .bg { - background: #A2EEC0; + background: #AFEBB7; min-height: 100vh; - padding-bottom: 26rpx; + padding-bottom: 120rpx; + position: relative; } .topImg { width: 750rpx; - height: 440rpx; + height: 893.33rpx; + } + .rule{ + width: 58rpx; + height: 170rpx; + background: rgba(255,122,69,0.86); + border-radius: 7rpx 0rpx 0rpx 7rpx; + border: 2px solid #FF503B; + font-weight: 500; + font-size: 27rpx; + color: #FFFFFF; + text-align: center; + position: absolute; + top: 529rpx; + right: 0; + padding: 8rpx 14rpx 0; + line-height: 28rpx; } .box { margin-top: 50rpx; - // border-radius: 20rpx 20rpx 0rpx 0rpx; padding: 0 26rpx; - display: flex; - flex-wrap: wrap; - justify-content: space-between; } .item { margin-bottom: 22rpx; - width: 335rpx; - height: 448rpx; - background: #FFFFFF; - box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(153,153,153,0.38); - border-radius: 13rpx; + width: 100%; + height: 272.67rpx; + position: relative; } .item-img { - width: 100%; - height: 266.67rpx; - border-radius: 13rpx 13rpx 0rpx 0rpx; + width: 307rpx; + height: 100%; + background: #FA6216; + border-radius: 20rpx; } .content { - height: 145rpx; - padding: 0 13rpx 13.33rpx; + height: 100%; + width: 459rpx; + background: #FFFFFF; + border-radius: 20rpx; + position: absolute; + top: 0; + right: 0; + padding: 24rpx; display: flex; flex-direction: column; justify-content: space-between; @@ -184,10 +222,9 @@ .title { font-family: PingFang SC; - font-size: 29rpx; - color: #000000; - width: 291rpx; font-weight: 500; + font-size: 31rpx; + color: #00132F; } .bottom { @@ -195,31 +232,50 @@ justify-content: space-between; align-items: center; } - + .oldPrice{ + font-weight: 400; + font-size: 24rpx; + color: #66676A; + line-height: 15rpx; + text-decoration-line: line-through; + display: block; + } .price { font-size: 33.33rpx; font-family: PingFangSC; font-weight: bold; - color: #F40F0B; + color: #F75008; } .price::before { content: '¥'; font-size: 24rpx; } - .price::after { - content: '起'; - font-size: 20rpx; - color: #666; - font-weight: 400; + .tag-content { + display: flex; + width: 100%; + overflow: hidden; + margin-top: 20rpx; + .tag-item{ + border-radius: 20rpx; + border: 1px solid #FFA416; + font-weight: 500; + font-size: 24rpx; + color: #FFA416; + line-height: 23rpx; + padding:10rpx 20rpx; + flex-shrink: 0; + margin-right: 13rpx; + } } + .buy { - width: 151rpx; - height: 48rpx; - background: linear-gradient(180deg, #FB6493, #E2235B); - border-radius: 24rpx; + width: 107rpx; + height: 53rpx; + background: linear-gradient(90deg, #FF413B, #FFAB2E); + border-radius: 27rpx; text-align: center; - line-height: 48rpx; + line-height: 53rpx; font-family: PingFang SC; font-weight: bold; font-size: 27rpx; @@ -227,48 +283,34 @@ } .coupon-header{ - width: 589.33rpx; - height: 75.33rpx; + width: 450rpx; + height: 100rpx; display: block; margin: 0 auto; position: relative; - margin-top: 35rpx; z-index: 2; } .coupon-box{ width: 697rpx; - height: 413rpx; - background: #FFFDEB; + height: 597rpx; + background: #FFFFFF; border-radius: 20rpx; margin: -50rpx auto 0; display: flex; flex-wrap: wrap; justify-content: space-between; - padding: 92rpx 17rpx 0; + padding: 62rpx 32rpx 0; position: relative; z-index: 1; - .rule{ - width: 83rpx; - height: 40rpx; - background: #27967B; - border-radius: 20rpx 0rpx 0rpx 20rpx; - font-weight: 500; - font-size: 25rpx; - color: #FFFFFF; - position: absolute; - top: 13rpx; - right: 0; - text-align: center; - line-height: 40rpx; - } + .coupon-item{ - width: 327.33rpx; - height: 120.67rpx; + width: 306.67rpx; + height: 233.33rpx; display: flex; - background-image: url("https://tongli.sz-trip.com/uploads/20250401/df0ba64e58d91457c062be571ea51b3e.png"); background-size: 100% 100%; + margin-bottom: 24rpx; } .coupon-price{ font-weight: 600; @@ -287,16 +329,16 @@ flex: 1; } .coupon-btn{ - width: 133rpx; - height: 40rpx; - background: linear-gradient(180deg, #FB6493, #E2235B); - border-radius: 20rpx; - font-weight: bold; - font-size: 24rpx; - color: #FFFFFF; - text-align: center; - line-height: 40rpx; + width: 205.33rpx; + height: 48.67rpx; + margin: 161rpx auto 0; } } - + .goTopImg{ + width: 102rpx; + height: 102rpx; + position: fixed; + right: 28rpx; + bottom: 48rpx; + } From 26fd010413610e7f9e8630df2e32d2731159c4e6 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Thu, 24 Apr 2025 14:46:09 +0800 Subject: [PATCH 4/4] fix --- subPackages/ticketBooking/detail.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/subPackages/ticketBooking/detail.vue b/subPackages/ticketBooking/detail.vue index 30d7ca0..5fc20de 100644 --- a/subPackages/ticketBooking/detail.vue +++ b/subPackages/ticketBooking/detail.vue @@ -290,8 +290,18 @@ }, '/api/goods/getPriceCalendarListBySpecifications').then(res => { this.allSeldDate = res.data || [] this.seldDateIndex = this.allSeldDate.findIndex(item => item.store != 0) - this.getTimeStock(this.allSeldDate[this.seldDateIndex].date) - this.openPop() + + if (this.seldDateIndex>=0) { + this.getTimeStock(this.allSeldDate[this.seldDateIndex].date) + this.openPop() + } else { + uni.showToast({ + title:"库存不足", + icon:"none" + }) + } + + }) }, // 获取规格分时库存