From 87f2ee8c3d4c839e55f527c3aa72fc5ad75076cb Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Wed, 10 Dec 2025 19:33:29 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api/order/pointGoods.js | 36 +-
components/coupon-icon/index.vue | 142 +++++
pages/order/coupon.vue | 2 +-
scoreShop/detail/index.vue | 643 +++++++++++++---------
scoreShop/index/components/goods-list.vue | 381 ++++++++-----
scoreShop/index/index.vue | 73 ++-
scoreShop/order/components/order-list.vue | 194 ++++---
scoreShop/order/index.vue | 301 ++++++----
scoreShop/success/index.vue | 29 +-
src/auto-imports.d.ts | 1 +
utils/uniapp.js | 54 +-
vite.config.js | 1 +
12 files changed, 1268 insertions(+), 589 deletions(-)
create mode 100644 components/coupon-icon/index.vue
diff --git a/common/api/order/pointGoods.js b/common/api/order/pointGoods.js
index 6adf16f..d480e46 100644
--- a/common/api/order/pointGoods.js
+++ b/common/api/order/pointGoods.js
@@ -13,7 +13,6 @@ platformType = 'alipay'
payType='aliPay'
// #endif
-//订单列表
export const pointGoodsPage = (data) => {
return request({
url: url + '/user/pointGoods/page',
@@ -22,3 +21,38 @@ export const pointGoodsPage = (data) => {
})
}
+
+export const exchange = (data) => {
+ return request({
+ url: url + '/user/pointGoods/exchange',
+ method: 'post',
+ data: {...data,payType}
+ })
+}
+
+
+export const applyRefund = (data) => {
+ return request({
+ url: url + '/user/pointGoods/applyRefund',
+ method: 'post',
+ data: data
+ })
+}
+
+
+export const cancelRefund = (data) => {
+ return request({
+ url: url + '/user/pointGoods/cancelRefund',
+ method: 'post',
+ data: data
+ })
+}
+
+
+export const recordPage = (data) => {
+ return request({
+ url: url + '/user/pointGoods/record/page',
+ method: 'get',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/components/coupon-icon/index.vue b/components/coupon-icon/index.vue
new file mode 100644
index 0000000..d87ca7f
--- /dev/null
+++ b/components/coupon-icon/index.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+ ¥
+ {{ props.item.discountAmount }}
+
+
+ 满{{ props.item.fullAmount }}可用
+
+
+
+
+ {{ props.item.discountNum }}件
+ 商品兑换
+
+
+ 满{{ props.item.fullAmount }}可用
+
+
+
+
+ {{ props.item.discountRate/10 }}折
+
+
+ 满{{ props.item.fullAmount }}可用
+
+
+
+
+ 第二件
+ 半价券
+
+
+
+
+ 买一送
+ 一券
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/coupon.vue b/pages/order/coupon.vue
index 2dbba3c..4697720 100644
--- a/pages/order/coupon.vue
+++ b/pages/order/coupon.vue
@@ -204,7 +204,7 @@ import {
getCouponShops,
} from "@/common/api/member.js";
import { findCoupon } from "@/common/api/market/coupon.js";
-import couponIcon from "@/pages/user/components/coupon-icon.vue";
+import couponIcon from "@/components/coupon-icon/index";
// import * as UTILS from '@/utils/goods-utils.js';
import yskUtils from "ysk-utils";
const UTILS = yskUtils.couponUtils;
diff --git a/scoreShop/detail/index.vue b/scoreShop/detail/index.vue
index 922ff91..3d680a4 100644
--- a/scoreShop/detail/index.vue
+++ b/scoreShop/detail/index.vue
@@ -1,267 +1,406 @@
-
-
- 这里是优惠券名称啊啊啊啊
- 15元代金券(满200可用)
-
-
-
-
- 800
- 积分
- +
- 9.99
- 元
-
- 限购2份
-
- 剩余:99999
-
- 这里是商品名称啊啊啊啊啊
-
-
-
- 领取方式
- 系统发放
-
-
- 特别说明
- 优惠券为虚拟发放,一旦兑换不支持退款,请悉知
-
-
-
+
+
+
+ {{item.couponInfo.title}}
+ {{returnCouponTypeName}}
+
+
+
+
-
-
- 商品详情
-
-
+
+
+
+
+ {{item.requiredPoints}}
+ 积分
+
+ +
+ {{item.extraPrice}}
+ 元
+
-
-
- 立即兑换
-
+
+ 限购{{item.limitQuota}}份
+
+ 剩余:{{item.quantity}}
+
+ {{item.goodsName}}
+
+
+
+ 领取方式
+ 系统发放
+ 店内自取
+
+
+ 特别说明
+ 优惠券为虚拟发放,一旦兑换不支持退款,请悉知
+
+
+
-
-
-
- 您将消耗{800}积分,兑换商品{这里是商品名称},是否确认兑换
-
-
- 优惠券为虚拟发放,一旦兑换不支持退款,请悉知
-
-
-
+
+
+ 商品详情
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+ .top {
+ margin: 14rpx 18rpx;
+ background-size: cover;
+ height: $topHeight;
+ box-sizing: border-box;
+ padding-left: 70rpx;
+ padding-top: 95rpx;
+
+ .name {
+ color: #000000;
+ font-size: 36rpx;
+ font-weight: 700;
+ }
+
+ .info {
+ color: #333333;
+ font-size: 48rpx;
+ font-weight: 700;
+ margin-top: 62rpx;
+ }
+ }
+
+ .sku {
+ display: flex;
+ justify-content: space-between;
+ padding: 20rpx 36rpx;
+ align-items: center;
+ background: linear-gradient(90deg, #ff4a63 0%, #fd1f48 100%);
+
+ .price {
+ color: #fff;
+ font-weight: 700;
+ font-size: 36rpx;
+ }
+
+ .text {
+ color: #fff;
+ font-size: 28rpx;
+ }
+ }
+
+ .goods-name {
+ padding: 20rpx 28rpx;
+ background: #fff;
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #333;
+ }
+
+ .desc {
+ padding: 32rpx 28rpx;
+ background-color: #fff;
+ }
+
+ .goods-detail {
+ padding: 32rpx;
+
+ .title {
+ position: relative;
+ padding: 0 22rpx;
+
+ &::before {
+ content: "";
+ display: block;
+ position: absolute;
+ right: 100%;
+ width: 70rpx;
+ height: 2rpx;
+ top: 50%;
+ transform: translateY(-50%);
+ background: linear-gradient(90deg, #f7f8f9 0%, #c9cbcc 100%);
+ }
+
+ &::after {
+ left: 100%;
+ content: "";
+ position: absolute;
+ top: 50%;
+ transform: translateY(-50%);
+ display: block;
+ width: 70rpx;
+ height: 2rpx;
+ background: linear-gradient(90deg, #c9cbcc 0%, #f7f8f9 100%);
+ }
+ }
+ }
+
+ .fixed-bottom {
+ position: fixed;
+ background-color: #fff;
+ left: 0;
+ right: 0;
+ padding-bottom: calc(env(safe-area-inset-bottom) + 2rpx);
+ padding-top: 32rpx;
+ background-color: #fff;
+ bottom: 0;
+ z-index: 10;
+
+
+ .btn {
+ padding: 16rpx 62rpx;
+ border-radius: 16rpx;
+ font-size: 32rpx;
+ font-weight: 700;
+ color: #9c571f;
+ background: linear-gradient(180deg, #f7cc84 0%, #f9dda9 100%);
+
+ &.gray {
+ background: #9999992b;
+ color: #999999;
+ }
+ }
+ }
+
+ .waring {
+ background-color: rgba(255, 204, 0, 0.09);
+ padding: 32rpx 24rpx;
+ color: #ff8d28;
+ }
+
+ .popup-content {
+ font-size: 28rpx;
+ min-height: 300px;
+
+ .popup-content-top {
+ padding: 32rpx 28rpx;
+ border-bottom: 1px solid #ededed;
+ }
+
+ .goods-info {
+ padding: 44rpx 28rpx;
+ border-bottom: 1px solid #ededed;
+
+ .cover {
+ width: 184rpx;
+ height: 184rpx;
+ border-radius: 16rpx;
+ background: #d9d9d9;
+ }
+ }
+
+ .bottom {
+ padding: 20rpx 28rpx 20rpx 20rpx;
+ border-bottom: 1px solid #ededed;
+ }
+
+ .btn {
+ display: flex;
+ padding: 22rpx 214rpx;
+ align-items: flex-start;
+ gap: 20rpx;
+ border-radius: 66rpx;
+ background: #e8ad7b;
+ font-size: 32rpx;
+ color: #fff;
+ font-size: 700;
+ }
+ }
+
\ No newline at end of file
diff --git a/scoreShop/index/components/goods-list.vue b/scoreShop/index/components/goods-list.vue
index c70a764..d85b8c7 100644
--- a/scoreShop/index/components/goods-list.vue
+++ b/scoreShop/index/components/goods-list.vue
@@ -1,155 +1,242 @@
-
-
-
-
-
-
-
- 这里是商品名称
- 8000积分
-
-
- 兑换
- 限购2份
-
-
-
-
-
-
-
-
- 这里是商品名称
- 8000积分
-
- 限购2份
- 兑换
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{item.goodsName}}
+
+ {{item.requiredPoints}}积分
+ +{{item.extraPrice}}元
+
+
+
+ 兑换
+ 已兑完
+ 限购{{item.limitQuota}}份
+
+
+
+
+
+
+
+
+
+
+
+ {{item.goodsName}}
+
+ {{item.requiredPoints}}积分
+ +{{item.extraPrice}}元
+
+
+ 限购{{item.limitQuota}}份
+ 兑换
+ 已兑完
+
+
+
+
+
+
+ .goodslist {
+ padding: 28rpx;
+
+ &.list {
+ .item {
+ background-color: #fff;
+ padding: 32rpx 24rpx;
+ border-radius: 16rpx;
+ display: flex;
+ margin-bottom: 18rpx;
+
+
+ .img {
+ width: 112rpx;
+ height: 112rpx;
+ border-radius: 16rpx;
+ background: #d9d9d9;
+
+ &.coupon {
+ // background-color: transparent;
+ }
+ }
+
+ .info {
+ flex: 1;
+ padding-left: 16rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .name {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 700;
+ }
+
+ .price {
+ font-size: 28rpx;
+ margin-top: 14rpx;
+ color: #666;
+ }
+
+ .btn {
+ padding: 14rpx 48rpx;
+ border-radius: 16rpx;
+ background: linear-gradient(180deg, #f7cc84 0%, #f9dda9 100%);
+ color: #9c571f;
+ font-size: 28rpx;
+ font-weight: 700;
+ white-space: nowrap;
+ &.end {
+ color: #999999;
+ background: rgba(153, 153, 153, 0.3);
+ }
+ }
+
+ .limit {
+ color: #666;
+ font-size: 24rpx;
+ margin-top: 8rpx;
+ white-space: nowrap;
+ }
+ }
+ }
+ }
+
+ &.block {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
+ row-gap: 30rpx;
+ column-gap: 52rpx;
+
+ .item {
+ padding: 32rpx 28rpx;
+ border-radius: 16rpx;
+ background-color: #fff;
+
+
+ .img {
+ width: 266rpx;
+ height: 266rpx;
+ border-radius: 16rpx;
+ background: #d9d9d9;
+
+ &.coupon {
+ // background-color: transparent;
+ }
+ }
+
+ .info {
+ margin-top: 28rpx;
+
+ .name {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 700;
+ }
+
+ .price {
+ font-size: 28rpx;
+ margin-top: 16rpx;
+ font-weight: 700;
+ color: #9C571F;
+ }
+
+ .btn {
+ padding: 14rpx 48rpx;
+ border-radius: 16rpx;
+ background: linear-gradient(180deg, #f7cc84 0%, #f9dda9 100%);
+ color: #9c571f;
+ font-size: 28rpx;
+ font-weight: 700;
+ white-space: nowrap;
+
+ &.end {
+ color: #999999;
+ background: rgba(153, 153, 153, 0.3);
+ }
+ }
+
+ .limit {
+ color: #666;
+ font-size: 24rpx;
+ white-space: nowrap;
+ }
+ }
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/scoreShop/index/index.vue b/scoreShop/index/index.vue
index ddc5930..9d94857 100644
--- a/scoreShop/index/index.vue
+++ b/scoreShop/index/index.vue
@@ -7,13 +7,16 @@
- {{pointsUser?pointsUser.pointBalance:''}}
-
-
+
+ {{pointsUser?pointsUser.pointBalance:0}}
+
+
+
+
- 积分订单
+ 积分订单
积分明细
@@ -26,13 +29,17 @@
优惠券
- 其他商品
+ 其它商品
-
+
+
+
+
+
@@ -42,6 +49,13 @@
import {
onLoad
} from "@dcloudio/uni-app";
+ import {
+ reactive,
+ watch
+ } from "vue";
+ import {
+ onReachBottom
+ } from "@dcloudio/uni-app";
const imgs = {
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/3716211a58d84fda9ee596a1882c0704.png", //背景图
huizhang: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/5d07600cc494490aa3adacfe51d8845d.png", //徽章
@@ -61,6 +75,17 @@
});
}
+ // function exchange(item) {
+ // pointGoodsApi.exchange({
+ // pointsGoodsId: item.id,
+ // shopId: item.shopId,
+ // number: 1,
+ // price: item.extraPrice
+ // }).then(res => {
+ // refresh()
+ // })
+ // }
+
function toDetail() {
uni.navigateTo({
url: '/pages/user/member/billDetails?type=2&shopId=' + query.shopId + '&id=' + (pointsUser.value.id ||
@@ -78,22 +103,52 @@
page: 1,
size: 10,
shopId: '',
+ goodsCategory: ''
});
const isEnd = ref(false);
const pointsUser = ref(null)
+ const list = ref([])
function getList() {
- pointGoodsApi.pointGoodsPage(query).then(res => {
+ const goodsCategory = tabActive.value === 1 ? '其它商品' : '优惠券'
+ pointGoodsApi.pointGoodsPage({
+ ...query,
+ goodsCategory,
+ }).then(res => {
pointsUser.value = res.pointsUser
+ uni.setStorageSync('pointsUser', res.pointsUser)
+ const newList = res.pointsGoods.records
+ if (query.page == 1) {
+ list.value = newList
+ } else {
+ list.value.push(...newList)
+ }
+ if (query.page >= res.pointsGoods.totalPage * 1) {
+ isEnd.value = true
+ }
})
}
onLoad((opt) => {
- query.shopId = opt.id || ''
+ query.shopId = opt.shopId || ''
})
- onShow(() => {
+ watch(() => tabActive.value, (newval, oldval) => {
+ refresh()
+ })
+
+ function refresh() {
query.page = 1;
isEnd.value = false;
getList();
+ }
+ onReachBottom(() => {
+ if (isEnd.value) {
+ return
+ }
+ query.page++
+ getList();
+ })
+ onShow(() => {
+ refresh()
});
+ .list {
+ padding: 28rpx;
+
+ .item {
+ padding: 14rpx 46rpx;
+ border-radius: 24rpx;
+ background: #fff;
+ margin-bottom: 48rpx;
+ .img{
+ width: 132rpx;
+ height: 132rpx;
+ }
+ .status {
+ padding: 8rpx 18rpx;
+ border-radius: 8rpx;
+ border: 2rpx solid transparent;
+
+ &.success {
+ background: rgba(123, 209, 54, 0.12);
+ border-color: #7bd136;
+ color: #7bd136;
+ }
+
+ &.gray {
+ background: #9999991f;
+ border-color: #999;
+ color: #999;
+ }
+
+ &.error {
+ background: #ff1c1c2e;
+ border-color: #ff1c1c;
+ color: #ff1c1c;
+ }
+ }
+
+ .btns {
+ display: flex;
+ gap: 34rpx;
+
+ .btn {
+ padding: 8rpx 14rpx;
+ border-radius: 10rpx;
+ border: 2rpx solid transparent;
+
+ &.look {
+ border-color: #ededed;
+ color: #333;
+ }
+
+ &.black {
+ border-color: #343030;
+ background: #343030;
+ color: #fff;
+ }
+ }
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/scoreShop/order/index.vue b/scoreShop/order/index.vue
index 33b9216..54737df 100644
--- a/scoreShop/order/index.vue
+++ b/scoreShop/order/index.vue
@@ -1,105 +1,220 @@
-
-
-
- {{ item.name }}
-
-
+
+
+
+ {{ item.name }}
+
+
-
+
-
-
-
-
-
-
- {{ qrcode }}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ {{ qrcode }}
+
+
+
+
+
+
+
+ .top {
+ background-color: #fff;
+ padding: 32rpx 28rpx;
+ display: flex;
+ justify-content: space-between;
+ }
+
+ .tab-item {
+ color: #999;
+ transition: all 0.3s ease-in-out;
+
+ &.active {
+ color: #000;
+ font-size: 32rpx;
+ font-weight: 700;
+ }
+ }
+
+ .copy {
+ width: 28rpx;
+ height: 28rpx;
+ }
+
+ .safe-bottom {
+ padding-bottom: calc(env(safe-area-inset-bottom) + 2rpx);
+ }
+
\ No newline at end of file
diff --git a/scoreShop/success/index.vue b/scoreShop/success/index.vue
index 361b7bc..471c780 100644
--- a/scoreShop/success/index.vue
+++ b/scoreShop/success/index.vue
@@ -10,29 +10,30 @@
兑换成功
- 这里是商品名称
- 需前往店铺自行兑换领取
+ {{item.pointsGoodsName}}
+ 需前往店铺自行兑换领取
+ 优惠券直接到账您的账户中
兑换商品:
- 这里是商品名称
+ {{item.pointsGoodsName}}
兑换数量:
- 1份
+ {{item.number}}份
消耗积分:
- 800
+ {{item.spendPoints}}
下单时间:
- 2025-12-3 17:19:32
+ {{item.checkoutTime}}
订单号:
- :DH202511300001
+ :{{item.orderNo}}
@@ -44,6 +45,8 @@