From bb2830730df1b10f92030bd24bb16db3df296860 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Thu, 11 Dec 2025 11:34:06 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api/order/pointGoods.js | 8 +
scoreShop/detail/index.vue | 92 ++++-
scoreShop/index/components/goods-list.vue | 6 +-
scoreShop/order/components/order-list.vue | 17 +-
scoreShop/order/detail.vue | 417 ++++++++++++++--------
scoreShop/order/index.vue | 2 +-
6 files changed, 372 insertions(+), 170 deletions(-)
diff --git a/common/api/order/pointGoods.js b/common/api/order/pointGoods.js
index d480e46..f5d9a5e 100644
--- a/common/api/order/pointGoods.js
+++ b/common/api/order/pointGoods.js
@@ -55,4 +55,12 @@ export const recordPage = (data) => {
method: 'get',
data: data
})
+}
+
+export const recordOne = (data) => {
+ return request({
+ url: url + '/user/pointGoods/record/one',
+ method: 'get',
+ data: data
+ })
}
\ No newline at end of file
diff --git a/scoreShop/detail/index.vue b/scoreShop/detail/index.vue
index 3d680a4..5c95d37 100644
--- a/scoreShop/detail/index.vue
+++ b/scoreShop/detail/index.vue
@@ -46,14 +46,17 @@
商品详情
-
+
- 立即兑换
+
+ {{returnBtmText}}
+
@@ -76,27 +79,27 @@
-
+
- 这里是商品名称
- 8000积分+9.99元
+ {{item.goodsName}}
+ {{item.requiredPoints}}积分+{{item.extraPrice}}元
X1
-
+
优惠券为虚拟发放,一旦兑换不支持退款,请悉知
- 合计 8000积分 + ¥9.99
+ 合计 {{item.requiredPoints}}积分 + ¥{{item.extraPrice}}
- 确认兑换
+ 确认兑换
@@ -113,6 +116,9 @@
} from '@/utils/uniapp.js'
import modal from "@/scoreShop/components/modal.vue";
import * as pointGoodsApi from "@/common/api/order/pointGoods.js";
+ import {
+ pay
+ } from '@/utils/pay.js'
const imgs = {
bg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/9fd6a3ad2b384f6cb4e88ed6b77bd334.png",
};
@@ -125,6 +131,10 @@
});
function exchangeClick() {
+ if (item.extraPrice > 0) {
+ popupData.show = true
+ return
+ }
modalData.show = true;
}
@@ -132,7 +142,45 @@
// modalData.show = false;
exchange()
}
+ async function payExchange() {
+ uni.showLoading({
+ title: '兑换中……'
+ })
+ const openId = await getOpenId()
+ uni.hideLoading()
+ if (openId) {
+ pointGoodsApi.exchange({
+ pointsGoodsId: item.id,
+ shopId: item.shopId,
+ number: 1,
+ price: item.extraPrice,
+ openId
+ }).then(orderRes => {
+ popupData.show = false;
+ pay(orderRes.payInfo).then(res => {
+ console.log(res)
+ if (res) {
+ uni.setStorageSync('exchange_goods_success', orderRes.goodsRecord)
+ uni.redirectTo({
+ url: '/scoreShop/success/index'
+ })
+ } else {
+ uni.showToast({
+ title: '兑换失败',
+ icon: 'none'
+ })
+ }
+ })
+
+ })
+ } else {
+ uni.showToast({
+ title: '鉴权失败,兑换失败',
+ icon: 'none'
+ })
+ }
+ }
async function exchange() {
uni.showLoading({
title: '兑换中……'
@@ -148,12 +196,12 @@
openId
}).then(res => {
modalData.show = false;
- if(res){
- uni.setStorageSync('exchange_goods_success',res)
+ if (res) {
+ uni.setStorageSync('exchange_goods_success', res)
uni.redirectTo({
- url:'/scoreShop/success/index'
+ url: '/scoreShop/success/index'
})
- }else{
+ } else {
uni.showToast({
title: '兑换失败',
icon: 'none'
@@ -219,11 +267,27 @@
if (item.quantity <= 0) {
return false
}
- if(item.limitQuota&&item.boughtCount>=item.limitQuota){
+ if (item.limitQuota && item.boughtCount >= item.limitQuota) {
return false
}
return true
})
+
+ const returnBtmText = computed(() => {
+ if (isCanExchange.value) {
+ return '立即兑换'
+ }
+ if (pointsUser.pointBalance < item.requiredPoints) {
+ const num = item.requiredPoints - pointsUser.pointBalance
+ return `积分不足,还差${num}积分`
+ }
+ if (item.quantity <= 0) {
+ return `库存不足`
+ }
+ if (item.limitQuota && item.boughtCount >= item.limitQuota) {
+ return `单人兑换已达上限`
+ }
+ })
onLoad((opt) => {
const exchange_goods = uni.getStorageSync('exchange_goods')
if (exchange_goods.goodsDescription) {
@@ -342,7 +406,7 @@
background-color: #fff;
bottom: 0;
z-index: 10;
-
+
.btn {
padding: 16rpx 62rpx;
diff --git a/scoreShop/index/components/goods-list.vue b/scoreShop/index/components/goods-list.vue
index d85b8c7..660a54e 100644
--- a/scoreShop/index/components/goods-list.vue
+++ b/scoreShop/index/components/goods-list.vue
@@ -25,7 +25,7 @@
-
+
@@ -37,7 +37,7 @@
限购{{item.limitQuota}}份
- 兑换
+ 兑换
已兑完
@@ -65,7 +65,7 @@
});
function toDetail(item) {
- if (!canExchange(item)) {
+ if (item.quantity<=0) {
return
}
uni.setStorageSync('exchange_goods', item)
diff --git a/scoreShop/order/components/order-list.vue b/scoreShop/order/components/order-list.vue
index 94cefbc..15b28fc 100644
--- a/scoreShop/order/components/order-list.vue
+++ b/scoreShop/order/components/order-list.vue
@@ -1,6 +1,6 @@
-
+
{{item.createTime}}
{{item.status}}
@@ -16,9 +16,9 @@
- 查看券码
- 申请退款
- 取消退款
+ 查看券码
+ 申请退款
+ 取消退款
@@ -39,12 +39,19 @@
emits("lookCode", item);
};
- function tuikuan(item) {
+ function refund(item) {
emits("refund", item);
}
function cancelRefund(item) {
emits("cancelRefund", item);
}
+
+ function toDetail(item){
+ uni.setStorageSync('points_order_detail',item)
+ uni.navigateTo({
+ url:'/scoreShop/order/detail'
+ })
+ }
function returnStatusClass(item) {
if (item.status == '已完成' || item.status == '已退款') {
diff --git a/scoreShop/order/detail.vue b/scoreShop/order/detail.vue
index a9ca390..aac4b50 100644
--- a/scoreShop/order/detail.vue
+++ b/scoreShop/order/detail.vue
@@ -1,156 +1,279 @@
-
-
-
-
-
- 这里是商品名称
-
- 8000积分
- 已完成
-
- X1
-
-
-
-
-
-
-
-
- {{ qrcode }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{item.pointsGoodsName}}
+
+ {{item.spendPoints}}积分
+ {{item.status}}
+
+ X{{item.number}}
+
+
+
+
+
+
+
+
+ {{ qrcode }}
+
+
+
+
+
+
-
- 领取方式
- 需前往店铺自行兑换领取
-
-
+
+ 领取方式
+ 需前往店铺自行兑换领取
+ 系统发放
+
+
-
-
- 兑换商品:
- 这里是商品名称
-
-
- 兑换数量:
- 1份
-
-
- 消耗积分:
- 800
-
-
- 支付金额:
- 9.99元
-
-
- 下单时间:
- 2025-12-3 17:19:32
-
-
- 核销时间:
- 2025-12-04 01:13:14
-
-
- 订单号:
- DH202511300001
-
-
+
+
+ 兑换商品:
+ {{item.pointsGoodsName}}
+
+
+ 兑换数量:
+ {{item.number}}份
+
+
+ 消耗积分:
+ {{item.spendPoints}}
+
+
+ 支付金额:
+ {{item.extraPaymentAmount}}元
+
+
+ 下单时间:
+ {{item.createTime}}
+
+
+ 核销时间:
+ {{item.checkoutTime||''}}
+
+
+ 订单号:
+ {{item.orderNo}}
+
+
-
- 申请退款
- 取消退款
-
-
+
+ 申请退款
+ 取消退款
+
+
+ .min-page {
+ padding: 28rpx;
+ }
+
+ .top {
+ padding: 32rpx 24rpx;
+ background: #fff;
+
+ .color1 {
+ color: #9c571f;
+ }
+
+ .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;
+ }
+ }
+ }
+
+ .copy {
+ width: 28rpx;
+ height: 28rpx;
+ }
+
+ .bottom {
+ background: #fff;
+ border-radius: 32rpx;
+ padding: 16rpx 28rpx;
+ margin-top: 48rpx;
+
+ .item {
+ padding: 16rpx 0;
+ }
+ }
+
+ .btns {
+ margin-top: 66rpx;
+ display: flex;
+ justify-content: center;
+ gap: 48rpx;
+
+ .btn {
+ border: 2rpx solid transparent;
+ border-radius: 100rpx;
+ background: #fff;
+ padding: 14rpx 76rpx;
+ font-size: 32rpx;
+
+ &.success {
+ background-color: #e8ad7b;
+ border-color: #e8ad7b;
+ color: #fff;
+ }
+
+ &.cancel {
+ border-color: #e8ad7b;
+ color: #e8ad7b;
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/scoreShop/order/index.vue b/scoreShop/order/index.vue
index 54737df..1598c57 100644
--- a/scoreShop/order/index.vue
+++ b/scoreShop/order/index.vue
@@ -171,7 +171,7 @@
function getList() {
const status = tabs.list.find(v => v.value == tabs.sel)
pointGoodsApi.recordPage({
- ...query,
+ ...query,status:tabs.sel?status.name:''
}).then(res => {
const newList = res.records
if (query.page == 1) {
From 9a0164eff680820ff1eb8c355a0a43f458cbb147 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Thu, 11 Dec 2025 15:51:14 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E7=A7=AF=E5=88=86=E5=95=86=E5=9F=8E?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/api/market/index.js | 7 +
components/coupon/coupon-icon.vue | 174 ++--
pages/index/index.vue | 2 +-
pages/index/indexs.vue | 942 ++++++++++++++--------
pages/product/index.vue | 2 +-
scoreShop/detail/index.vue | 34 +-
scoreShop/index/components/goods-list.vue | 25 +-
scoreShop/order/components/order-list.vue | 10 +-
scoreShop/order/detail.vue | 48 +-
scoreShop/order/index.vue | 2 +-
scoreShop/success/index.vue | 6 +-
11 files changed, 773 insertions(+), 479 deletions(-)
diff --git a/common/api/market/index.js b/common/api/market/index.js
index 0f3ed65..4f69fdb 100644
--- a/common/api/market/index.js
+++ b/common/api/market/index.js
@@ -9,3 +9,10 @@ export const consumeDiscount = (data) => {
data: data
})
}
+export const homeData = (data) => {
+ return request({
+ url: prveUrl + '/user/home/data',
+ method: 'get',
+ data: data
+ })
+}
diff --git a/components/coupon/coupon-icon.vue b/components/coupon/coupon-icon.vue
index d8f31bd..5a252e2 100644
--- a/components/coupon/coupon-icon.vue
+++ b/components/coupon/coupon-icon.vue
@@ -3,8 +3,8 @@
- ¥
- {{ props.item.discountAmount }}
+ ¥
+ {{ props.item.discountAmount }}
满{{ props.item.fullAmount }}可用
@@ -12,8 +12,8 @@
- {{ props.item.discountNum }}件
- 商品兑换
+ {{ props.item.discountNum }}件
+ 商品兑换
满{{ props.item.fullAmount }}可用
@@ -21,7 +21,7 @@
- {{ props.item.discountRate/10 }}折
+ {{ props.item.discountRate/10 }}折
满{{ props.item.fullAmount }}可用
@@ -29,100 +29,112 @@
- 第二件
- 半价券
+ 第二件
+ 半价券
- 买一送
- 一券
+ 买一送
+ 一券
+
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index f0f3aea..379cecf 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -334,7 +334,7 @@ onShow(async () => {
proxy.$isResolve();
const shopId = uni.cache.get('shopId');
if (shopId) {
- indexsRef.value.getVipConfig();
+ indexsRef.value.updateData();
}
} catch (error) {}
await proxy.$onLaunched;
diff --git a/pages/index/indexs.vue b/pages/index/indexs.vue
index 89998c0..6e790d1 100644
--- a/pages/index/indexs.vue
+++ b/pages/index/indexs.vue
@@ -1,385 +1,623 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点餐
- 在线点不排队
-
-
-
-
-
-
- 会员
- 入会享权益
-
-
-
-
-
-
- 充值
- 充值享更多优惠
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+ HI,欢迎回来
+ 会员身份
+
+
+
+ 优惠券:{{allConfig.couponNum}}
+ 积分:{{allConfig.pointNum}}
+
+
+
+
+
+
+
+
+
+
+
+ 积分乐园
+ 好物兑换 畅花积分
+
+
+
+
+
+
+
+
+
+
+
+ .contentboxitemright_item:nth-child(2) {
+ margin-top: 30rpx;
+ }
+
+ .contentboxitemright_item {
+ image {
+ width: 96rpx;
+ height: 96rpx;
+ }
+
+ .contentboxitemright_itembox {
+ width: 170rpx;
+
+ text:nth-child(1) {
+ font-family: Source Han Sans CN, Source Han Sans CN;
+ font-weight: 400;
+ font-size: 32rpx;
+ color: #333333;
+ }
+
+ text:nth-child(2) {
+ margin-top: 2rpx;
+ font-family: Source Han Sans CN, Source Han Sans CN;
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #999999;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ .popup-content {
+ width: 90vw;
+ background-color: #fff;
+ border-radius: 8px;
+
+ .header-wrap {
+ height: 64px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1px solid #ececec;
+ padding: 0 28upx;
+
+ .t {
+ font-size: 32upx;
+ color: #333;
+ }
+
+ .close {
+ $size: 60upx;
+ width: $size;
+ height: $size;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+
+ .btn-content {
+ height: 86px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 60upx;
+
+ .btn {
+ width: 248upx;
+ }
+ }
+ }
+
+ .menus {
+ display: flex;
+ padding: 32rpx 40rpx;
+ margin-top: 150rpx;
+ gap: 20rpx;
+
+ .menu-item {
+ background-color: #fff;
+ border-radius: 16rpx;
+ text-align: center;
+ padding: 32rpx 28rpx;
+ box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
+ flex: 1;
+ }
+ }
+
+ .userInfo {
+ display: flex;
+ padding: 22rpx 24rpx;
+ margin: 0 4rpx;
+ align-items: center;
+ align-self: stretch;
+ border-radius: 24rpx;
+ background: #FFF;
+ transform: translateY(-36rpx);
+
+ .vip {
+ background: #FA720A;
+ font-size: 24rpx;
+ color: #ffffff;
+ padding: 6rpx 10rpx;
+ margin-left: 10rpx;
+ border-radius: 20rpx 20rpx 20rpx 0;
+ }
+
+ .code {
+ width: 33px;
+ height: 33px;
+ }
+ }
+
+
+
+ .new-menus-box {
+ margin: 0 16rpx 34rpx 16rpx;
+
+ .new-menus {
+ display: flex;
+ background-color: #fff;
+ border-radius: 16rpx;
+ align-items: center;
+
+ .icon {
+ width: 79px;
+ height: 79px;
+ }
+
+ &.layout2 {
+ padding: 29px 0;
+
+ .diner,
+ .takeout {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ }
+
+ .line {
+ width: 2rpx;
+ height: 156rpx;
+ background: #EDEDED;
+ }
+
+ .takeout {}
+ }
+
+ &.layout1 {
+ padding: 36rpx 40rpx;
+ justify-content: space-between;
+ display: flex;
+ align-items: center;
+
+ .big_img {
+ width: 330rpx;
+ height: 330rpx;
+ }
+
+ .title {
+ font-size: 48rpx;
+ }
+
+ .desc {
+ margin-top: 20rpx;
+ font-size: 32rpx;
+ color: #999;
+ }
+ }
+ }
+ }
+
+ .groupBuying {
+ padding: 16rpx 38rpx;
+ border-top: 2rpx solid #EDEDED;
+ background-color: #fff;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .img {
+ width: 40px;
+ height: 40px;
+ }
+ }
+
+ .title {
+ color: #333333;
+ font-size: 36rpx;
+ font-weight: 700;
+ }
+
+ .desc {
+ margin-top: 16rpx;
+ font-size: 28rpx;
+ color: #999;
+ }
+
+ .points {
+ margin-top: 34rpx;
+ background-color: #fff;
+ padding: 16rpx 68rpx;
+ border-radius: 16rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+
+ .img {
+ width: 98px;
+ height: 98px;
+ }
+ }
+
+ .bottom_menus {
+ display: flex;
+ gap: 14rpx;
+ margin-top: 34rpx;
+
+ .item {
+ flex: 1;
+ display: flex;
+ padding: 20rpx;
+ flex-direction: column;
+ align-items: center;
+ border-radius: 18rpx;
+ background: #FFF;
+
+ .img {
+ width: 39px;
+ height: 39px;
+ }
+
+ .title {
+ font-size: 32rpx;
+ }
+
+ .desc {
+ margin-top: 8rpx;
+ color: #999;
+ font-size: 24rpx;
+ white-space: nowrap;
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/pages/product/index.vue b/pages/product/index.vue
index 708b376..6275b8e 100644
--- a/pages/product/index.vue
+++ b/pages/product/index.vue
@@ -2260,7 +2260,7 @@ async function getDiscountActivity() {
const res = await discountActivityApi.config({
shopId: uni.cache.get('shopId')
});
- if (res) {
+ if (res&&typeof res=='object') {
fullAmountActivity.value = res;
}
}
diff --git a/scoreShop/detail/index.vue b/scoreShop/detail/index.vue
index 5c95d37..69fda93 100644
--- a/scoreShop/detail/index.vue
+++ b/scoreShop/detail/index.vue
@@ -7,8 +7,9 @@
-
-
+
+
+
@@ -75,11 +76,16 @@