From 3035612b80da300a61c88671ad80c5b64f45c635 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Fri, 15 May 2026 17:33:36 +0800 Subject: [PATCH] 1 --- package2/seckill/seckillGroup.vue | 61 ++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/package2/seckill/seckillGroup.vue b/package2/seckill/seckillGroup.vue index 068e2d2..b6d0dc5 100644 --- a/package2/seckill/seckillGroup.vue +++ b/package2/seckill/seckillGroup.vue @@ -37,11 +37,17 @@ - + 搜索 + + 随机推荐 + 价格升序 + 价格降序 + + @@ -54,7 +60,7 @@ - 已售{{item.sold}} + 已售999+ {{coupon}} @@ -79,8 +85,8 @@ - - 秒杀没有下次一定,只有现在立刻! + + 你有2元优惠券待使用 · 剩02:32:17 @@ -136,7 +142,8 @@ pages: 1, loadStatus: 'more', currentItem: null, - parsedSpecs: [] + parsedSpecs: [], + sortType: '' } }, computed: { @@ -206,6 +213,10 @@ pageNum: this.pageNum, pageSize: this.pageSize } + if (this.sortType) { + data.sort = 'seckillPrice' + data.order = this.sortType + } this.tui.request("/app/seckillGroup/product/page", "POST", data, false, false).then((res) => { this.loadStatus = 'nomore' if (res.code == 200) { @@ -241,10 +252,10 @@ sold: soldStock > 10000 ? (soldStock / 10000).toFixed(1).replace('.0', '') + '万+' : soldStock + '+', progress: totalStock > 0 ? Math.min(100, Math.round(soldStock * 100 / totalStock)) : 0, coupons: ['秒杀价', '限时开抢', '库存' + (item.availableStock || 0)], - price: seckillPrice.toFixed(1).replace('.0', ''), - save: save.toFixed(1).replace('.0', ''), + price: seckillPrice.toFixed(2), + save: save.toFixed(2), seckillPrice: seckillPrice, - originalPrice: originalPrice, + originalPrice: originalPrice.toFixed(2), availableStock: item.availableStock || 0, shopId: item.shopId, shopName: item.shopName, @@ -285,6 +296,12 @@ this.resetProductList() this.getSeckillList() }, + setSort(type) { + if (this.sortType === type) return + this.sortType = type + this.resetProductList() + this.getSeckillList() + }, grabItem(item) { if (!item || !item.productId) { this.tui.toast('商品信息异常') @@ -364,7 +381,7 @@ originalPrice: originalPrice.toFixed(2) } }), - price: seckillPrice, + price: originalPrice, seckillPrice: seckillPrice, originalPrice: originalPrice, lunchBox: 0, @@ -634,6 +651,32 @@ width: 22rpx; } + .sort-strip { + width: 95%; + margin: 0 auto 12rpx; + display: flex; + align-items: center; + } + + .sort-item { + height: 46rpx; + padding: 0 20rpx; + margin-right: 12rpx; + border-radius: 999rpx; + background: rgba(255, 255, 255, 0.72); + color: #8a6b55; + font-size: 22rpx; + font-weight: 800; + line-height: 46rpx; + box-shadow: 0 8rpx 18rpx rgba(203, 99, 37, 0.08); + } + + .sort-item.active { + background: #fff0e9; + color: #ff4b25; + box-shadow: 0 10rpx 20rpx rgba(255, 92, 38, 0.15); + } + .goods-list { width: 95%; margin: 0 auto;