From 718b3a2066b578bb469ccb12ce3572e9aa5566db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Wed, 17 Dec 2025 16:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BA=A2=E5=8C=85=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/localLife/detail/index.css | 204 ++++++++++++++++++++++++++-- packages/localLife/detail/index.vue | 109 +++++++++++++-- packages/shop/goods/index.css | 177 +++++++++++++++++++++++- packages/shop/goods/index.vue | 114 ++++++++++++---- packages/user/myRedPacket/index.css | 6 +- packages/user/myRedPacket/index.vue | 14 +- packages/user/redPacket/index.css | 32 +++-- packages/user/redPacket/index.vue | 6 +- 8 files changed, 589 insertions(+), 73 deletions(-) diff --git a/packages/localLife/detail/index.css b/packages/localLife/detail/index.css index 6a8b353a..be45a8b2 100644 --- a/packages/localLife/detail/index.css +++ b/packages/localLife/detail/index.css @@ -82,7 +82,7 @@ page { display: flex; justify-content: space-between; align-items: center; - box-shadow: 3rpx -3rpx 15rpx 0rpx rgba(255,27,27,0.05); + box-shadow: 3rpx -3rpx 15rpx 0rpx rgba(255, 27, 27, 0.05); padding-bottom: 30rpx; } @@ -194,23 +194,23 @@ page { } .Msg_con_img { - display: flex; - flex-wrap: wrap; - width: 100%; - margin-top: 15rpx; - gap: 15rpx; + display: flex; + flex-wrap: wrap; + width: 100%; + margin-top: 15rpx; + gap: 15rpx; } .Msg_con_img image { - width: calc(33% - 11rpx); - height: 225rpx; - flex-shrink: 0; + width: calc(33% - 11rpx); + height: 225rpx; + flex-shrink: 0; } -.Msg_con_video{ - width: calc(33.33% - 11rpx); - height: 225rpx; - flex-shrink: 0; +.Msg_con_video { + width: calc(33.33% - 11rpx); + height: 225rpx; + flex-shrink: 0; } .Msg_iconList_leftIcon { @@ -245,10 +245,184 @@ page { font-size: 26rpx; color: #999999; } -.Msg_iconList_right div{ + +.Msg_iconList_right div { margin-left: 10rpx; } -.mb32{ +.mb32 { margin-bottom: 32rpx; +} + +/* 优惠劵样式 */ +.coupon_container { + display: flex; + align-items: center; + overflow-x: auto; + padding: 20rpx 0; + gap: 20rpx; +} + +.coupon { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; + width: auto; + height: 100rpx; + background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%); + border-radius: 10rpx; + padding: 0 20rpx; + position: relative; + overflow: hidden; + color: #fff; +} + +.coupon_used1 { + background: #ffece7; + border: 1rpx solid #FF5757; + color: #ff3a0d; +} + +.coupon_amount { + font-size: 36rpx; + font-weight: bold; +} + +.coupon_condition { + font-size: 30rpx; + margin-left: 10rpx; +} + +.coupon_status { + width: 60rpx; + height: 40rpx; + line-height: 40rpx; + font-weight: bold; + text-align: center; +} + +.more_coupon { + flex-shrink: 0; + display: flex; + align-items: center; + gap: 8rpx; + color: #FF370B; + font-size: 30rpx; + position: sticky; + right: 0; + left: 750rpx; + z-index: 1000; + background-color: #fff; + height: 122rpx; + padding: 0 20rpx; + border-left: 1rpx solid #cccc; +} + +.more_text { + width: 70rpx; + font-weight: bold; +} + +/* 优惠详情弹窗样式 */ +.coupon_popup { + width: 100%; + height: 100%; + background: white; + border-radius: 20rpx; + overflow: hidden; +} + +.popup_header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx; + border-bottom: 1rpx solid #E6E6E6; +} + +.popup_title { + font-size: 32rpx; + font-weight: bold; + color: #333333; +} + +.popup_close { + font-size: 28rpx; + color: #999999; +} + +.popup_content { + padding: 30rpx; +} + +.coupon_item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 20rpx; + background: white; + border-radius: 10rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + margin-bottom: 20rpx; +} + +.coupon_item_left { + background: #FF5757; + padding: 20rpx; + border-radius: 10rpx; + color: white; + text-align: center; + min-width: 160rpx; +} + +.coupon_item_amount { + font-size: 36rpx; + font-weight: bold; + margin-bottom: 8rpx; +} + +.coupon_item_condition { + font-size: 20rpx; + opacity: 0.9; +} + +.coupon_item_center { + flex: 1; + padding: 0 20rpx; +} + +.coupon_item_name { + font-size: 28rpx; + font-weight: bold; + color: #333333; + margin-bottom: 8rpx; +} + +.coupon_item_expire { + font-size: 22rpx; + color: #999999; +} + +.coupon_item_right { + margin-left: 20rpx; +} + +.coupon_item_button { + width: 120rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + background: #FF370B; + color: white; + border: none; + border-radius: 30rpx; + font-size: 24rpx; + font-weight: bold; + padding: 0; + margin: 0; +} + +.coupon_item_button::after { + border: none; } \ No newline at end of file diff --git a/packages/localLife/detail/index.vue b/packages/localLife/detail/index.vue index f4063487..0060234e 100644 --- a/packages/localLife/detail/index.vue +++ b/packages/localLife/detail/index.vue @@ -14,10 +14,25 @@ + + + + ¥{{ coupon.money }} + 满{{ coupon.full_amount }}元可用 + 无门槛 + {{ coupon.is_received ? '已领' : '领取' }} + + + 更多优惠 + + + + 联系电话 @@ -48,8 +63,8 @@ - + {{ item.user.nick_name }} @@ -73,17 +88,14 @@ - + {{ item.merchant_evaluation_reply_list ? item.merchant_evaluation_reply_list.length : 0 }} - - {{ item.merchant_evaluation_like_list ? item.merchant_evaluation_like_list.length : 0 }} @@ -101,14 +113,11 @@ 导航 - + 电话 - + 点评 @@ -119,6 +128,32 @@ + + + + + + 优惠详情 + 取消 + + + + + ¥{{ item.money }} + 满{{ item.full_amount }}元可用 + 无门槛 + + + {{ item.red_package_name }} + {{ item.end_time }}到期 + + + {{ item.is_received ? '已领' : '领取' }} + + + + + @@ -130,6 +165,7 @@ import { } from "../../../utils"; import { apiArr } from "../../../api/v2local"; +import { apiArr as apiArr2 } from "../../../api/user"; export default { data() { @@ -142,6 +178,9 @@ export default { flag: false, isShow: false, isDisabled: false, + coupons: [], + couponDetails: [], + showCouponPopup: false }; }, onLoad(options) { @@ -164,6 +203,7 @@ export default { this.getCommentList() } this.getMerchantInfo() + this.getCouponList() }, onReachBottom() { if (this.flag) { @@ -172,6 +212,29 @@ export default { }, methods: { + getCouponList() { + const params = { + mch_id: uni.getStorageSync("merchantInfo").id, + } + request(apiArr2.redPackageCenter, "POST", params).then(res => { + this.coupons = res.rows + this.couponDetails = res.rows + }) + }, + // 领取红包 + handleCouponClick(item) { + if (item.is_received) { + return + } + const params = { + user_id: uni.getStorageSync('userId'), + red_package_config_id: item.id, + mch_id: item.belong_role == 1 ? item.merchant_id : '' + } + request(apiArr2.redPackageClaim, 'POST', params).then(res => { + this.getCouponList() + }) + }, handleQuickPayClick() { if (this.isDisabled) { uni.showToast({ @@ -313,6 +376,24 @@ export default { }); }, + // 显示优惠详情弹窗 + showCouponDetail() { + this.showCouponPopup = true; + }, + + // 关闭优惠详情弹窗 + closeCouponPopup() { + this.showCouponPopup = false; + }, + + // 领取优惠劵 + receiveCoupon() { + uni.showToast({ + title: '领取成功', + icon: 'success' + }); + }, + }, }; diff --git a/packages/shop/goods/index.css b/packages/shop/goods/index.css index 42695cc7..93c9f068 100644 --- a/packages/shop/goods/index.css +++ b/packages/shop/goods/index.css @@ -313,10 +313,10 @@ image { display: flex; } -.shadowBox1Item_btn{ +.shadowBox1Item_btn { width: 150rpx; height: 170rpx; - opacity:0; + opacity: 0; position: absolute; left: 100rpx; top: 40rpx; @@ -833,4 +833,177 @@ image { .car_right_buy { width: 220rpx; margin-left: 20rpx; +} + +/* 优惠劵样式 */ +.coupon_container { + display: flex; + align-items: center; + overflow-x: auto; + padding: 20rpx 0 20rpx 20rpx; + gap: 20rpx; +} + +.coupon { + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: space-between; + width: auto; + height: 100rpx; + background: linear-gradient(91deg, #FF7658 0%, #FF370B 100%); + border-radius: 10rpx; + padding: 0 20rpx; + position: relative; + overflow: hidden; + color: #fff; +} + +.coupon_used1 { + background: #ffece7; + border: 1rpx solid #FF5757; + color: #ff3a0d; +} + +.coupon_amount { + font-size: 36rpx; + font-weight: bold; +} + +.coupon_condition { + font-size: 30rpx; + margin-left: 10rpx; +} + +.coupon_status { + width: 60rpx; + height: 40rpx; + line-height: 40rpx; + font-weight: bold; + text-align: center; +} + +.more_coupon { + flex-shrink: 0; + display: flex; + align-items: center; + gap: 8rpx; + color: #FF370B; + font-size: 30rpx; + position: sticky; + right: 0; + left: 750rpx; + z-index: 1000; + background-color: #fff; + height: 122rpx; + padding: 0 10rpx 0 20rpx; + border-left: 1rpx solid #cccc; +} + +.more_text { + width: 70rpx; + font-weight: bold; +} + +/* 优惠详情弹窗样式 */ +.coupon_popup { + width: 100%; + height: 100%; + background: white; + border-radius: 20rpx; + overflow: hidden; +} + +.popup_header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx; + border-bottom: 1rpx solid #E6E6E6; +} + +.popup_title { + font-size: 32rpx; + font-weight: bold; + color: #333333; +} + +.popup_close { + font-size: 28rpx; + color: #999999; +} + +.popup_content { + padding: 30rpx; +} + +.coupon_item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 20rpx; + background: white; + border-radius: 10rpx; + box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + margin-bottom: 20rpx; +} + +.coupon_item_left { + background: #FF5757; + padding: 20rpx; + border-radius: 10rpx; + color: white; + text-align: center; + min-width: 160rpx; +} + +.coupon_item_amount { + font-size: 36rpx; + font-weight: bold; + margin-bottom: 8rpx; +} + +.coupon_item_condition { + font-size: 20rpx; + opacity: 0.9; +} + +.coupon_item_center { + flex: 1; + padding: 0 20rpx; +} + +.coupon_item_name { + font-size: 28rpx; + font-weight: bold; + color: #333333; + margin-bottom: 8rpx; +} + +.coupon_item_expire { + font-size: 22rpx; + color: #999999; +} + +.coupon_item_right { + margin-left: 20rpx; +} + +.coupon_item_button { + width: 120rpx; + height: 60rpx; + line-height: 60rpx; + text-align: center; + background: #FF370B; + color: white; + border: none; + border-radius: 30rpx; + font-size: 24rpx; + font-weight: bold; + padding: 0; + margin: 0; +} + +.coupon_item_button::after { + border: none; } \ No newline at end of file diff --git a/packages/shop/goods/index.vue b/packages/shop/goods/index.vue index 5a000a95..262647d5 100644 --- a/packages/shop/goods/index.vue +++ b/packages/shop/goods/index.vue @@ -40,8 +40,24 @@ - 共{{ info.commodity_goods_info_list ? info.commodity_goods_info_list.length : 0 }}款 + 共{{ info.commodity_goods_info_list ? info.commodity_goods_info_list.length : 0 }}款 + + + + + + + + ¥{{ coupon.money }} + 满{{ coupon.full_amount }}元可用 + 无门槛 + {{ coupon.is_received ? '已领' : '领取' }} + + + + 更多优惠 + @@ -54,7 +70,7 @@ - + @@ -162,15 +178,13 @@ - + 购物车 @@ -207,13 +221,12 @@