From 1d773081ea54630597df17193ff4376d4b3306c0 Mon Sep 17 00:00:00 2001
From: wangxiaowei <1121133807@qq.com>
Date: Wed, 14 Jan 2026 18:12:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E8=84=B8=E8=AF=86?=
=?UTF-8?q?=E5=88=AB=E6=8B=8D=E7=85=A7=E5=9B=BE=E7=89=87=E8=B4=A8=E9=87=8F?=
=?UTF-8?q?=E5=92=8C=E6=B7=BB=E5=8A=A0=E5=9C=BA=E9=A6=86=E7=81=AF=E7=AE=A1?=
=?UTF-8?q?=E8=B4=B9=E7=94=A8=E6=94=AF=E4=BB=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bundle/face/face-info.vue | 4 +
pages/order/cg-my-order.vue | 95 ++-
pages/order/cg-order-detail.vue | 690 +++++++++++++++++-
.../face-bio-assay/face-bio-assay.vue | 2 +-
4 files changed, 765 insertions(+), 26 deletions(-)
diff --git a/bundle/face/face-info.vue b/bundle/face/face-info.vue
index 9820524..45e0bc4 100644
--- a/bundle/face/face-info.vue
+++ b/bundle/face/face-info.vue
@@ -62,6 +62,10 @@
data: (e) => {
// self.imgSrc = path
self.uploadFile(e.path, e.order_id)
+ // const image = new Image();
+ // image.src = e.path;
+ // console.log("🚀 ~ image:", image)
+
// uni.redirectTo({
// url: '/pages/order/cg-my-order'
// });
diff --git a/pages/order/cg-my-order.vue b/pages/order/cg-my-order.vue
index ba6ceb9..101de84 100644
--- a/pages/order/cg-my-order.vue
+++ b/pages/order/cg-my-order.vue
@@ -138,9 +138,14 @@
+
+
+
-
-
+
+
@@ -604,6 +609,92 @@
url: `/pages/order/invoice?order_id=${order_id}`
});
},
+
+ // 购买灯光
+ onBuyLight(order_id, room_id, ground_id, order_status) {
+ console.log("🚀 ~ order_status:", order_status)
+ if (order_status == 1) {
+ uni.showModal({
+ title: '提示',
+ content: '您已支付过灯光费用,是否再次支付?',
+ success: function() {
+ this.payLight(order_id, room_id, ground_id, order_status);
+ }
+ });
+ } else {
+ this.payLight(order_id, room_id, ground_id, order_status);
+ }
+ },
+
+ payLight(order_id, room_id, ground_id, order_status) {
+ let self = this;
+
+ uni.showModal({
+ title: '提示',
+ content: '您确定要购买灯光费用吗?',
+ success: function(o) {
+ if (o.confirm) {
+ uni.showLoading({
+ title: '正在处理'
+ });
+ self._post(
+ 'order.GroundOrder/addLightStoreOrder', {
+ order_id,
+ room_id,
+ ground_id,
+ content: ''
+ },
+ function(res) {
+ uni.hideLoading();
+
+ uni.showLoading({
+ title: '支付中'
+ });
+ const payId = res.data.id;
+
+ self._post(
+ 'user.groundOrder/lightPay', {
+ order_id: payId,
+ },
+ function(pay) {
+ console.log("🚀 ~ pay:", pay)
+ uni.requestPayment({
+ provider: 'wxpay',
+ timeStamp: pay.data.payment.timeStamp,
+ nonceStr: pay.data.payment.nonceStr,
+ package: 'prepay_id=' + pay.data.payment.prepay_id,
+ signType: 'MD5',
+ paySign: pay.data.payment.paySign,
+ success: res => {
+ self.result = 'success'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ });
+ }, 100);
+ },
+ fail: res => {
+ console.log("🚀 ~ pay error res:", res)
+ self.result = 'fail'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付失败',
+ icon: 'none'
+ });
+ }, 100);
+ },
+ });
+ }
+ );
+ }
+ );
+ }
+ }
+ });
+ }
}
};
diff --git a/pages/order/cg-order-detail.vue b/pages/order/cg-order-detail.vue
index 7594186..5d4c95c 100644
--- a/pages/order/cg-order-detail.vue
+++ b/pages/order/cg-order-detail.vue
@@ -55,8 +55,6 @@
您的订单已取消。期待下次有机会再为您服务!
-
-
@@ -108,12 +106,61 @@
+
+
-
+
+
+
+
+ 购买灯光
+
+
+ {{ index }}
+
+
+ {{ item2.start_time }}-{{ item2.end_time }}
+
+
+
+
+
+
+
+ 微信支付
+
+
+
+
+
+
+ 平台余额
+
+
+
+
+ {{ cardType() }}
+
+
+
+
+
+
+ 确定并支付
+
+
适用场馆
@@ -290,6 +337,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 会员卡选择
+
+
+
+
+
+ 白银会员卡
+
+
+ ¥{{ userBalance.balance1 }}
+
+
+
+
+
+
+ 黄金会员卡
+
+
+ ¥{{ userBalance.balance2 }}
+
+
+
+
+
+
+ 铂金会员卡
+
+
+ ¥{{ userBalance.balance3 }}
+
+
+
+
+
+
+ 钻石会员卡
+
+
+ ¥{{ userBalance.balance4 }}
+
+
+
+
+
+
+ 至尊会员卡
+
+
+ ¥{{ userBalance.balance5 }}
+
+
+
+ 确定
+
+
+
@@ -331,12 +471,24 @@
billPopup: false,
venue: {}, // 场馆
cancelOrderPopup: false,
- cancelReservePopup: false
+ cancelReservePopup: false,
+ openLightPopup: false,
+ selectedTimes: [], // 记录选中的时间项,格式:[{group: 0, idx: 1}, ...]
+ content: [], // 保存格式化后的多选结果
+ payType: 'wxpay', // 支付方式 wxpay\balance
+ balancePopup: false,
+ balance: {},
+ userBalance: {},
+ currentType: '', // 选择的会员卡类型
+ userAccount: 0,
+ userDiscount: 0
+
};
},
onLoad(e) {
this.order_id = e.order_id;
this.ballType = e.ballType || 1;
+ this.getRecharge()
},
onShow() {
/*获取订单详情*/
@@ -563,6 +715,327 @@
return '至尊会员卡'
}
},
+
+ /**
+ * 购买灯光前置条件
+ */
+ buyLight() {
+ let self = this
+ if (self.detail.light_order == 1) {
+ uni.showModal({
+ title: '提示',
+ content: '您已支付过灯光费用,是否再次支付?',
+ success: function(res) {
+ console.log("🚀 ~ res:", res)
+ if (res.confirm) {
+ self.payLight()
+ }
+ }
+ });
+ } else {
+ self.payLight()
+ }
+ },
+
+ // 选择支付方式
+ payTypeFunc(n) {
+ this.payType = n;
+ if (n == 'balance') {
+ this.balancePopup = true;
+ } else {
+ // 切换到微信支付时还原价格
+ this.userAccount = 0;
+ this.userDiscount = 0;
+ this.currentType = '';
+ this.balancePopup = false;
+ }
+ },
+
+ // 关闭余额支付弹窗
+ closeBalancePopup() {
+ this.payType = 'wxpay';
+ this.balancePopup = false;
+ },
+
+ getRecharge() {
+ let self = this;
+ uni.showLoading({
+ title: '加载中'
+ });
+ // 获取充值
+ self._post(
+ 'ground.ground/groundSetting',
+ {
+ app_id: self.getAppId(),
+ },
+ function(res) {
+ self.balance = res.data.lists.balance;
+ }
+ )
+
+ // 获取充值
+ self._post('user.index/detail', {
+ source: self.getPlatform()
+ }, function(res) {
+ console.log("🚀 ~ res:", res)
+ self.userBalance = res.data.userInfo;
+ self.loadding = false;
+ uni.hideLoading();
+ });
+ },
+
+ // 确认选择充值卡
+ confirmCard() {
+ if (this.currentType == '') {
+ uni.showToast({
+ title: '请选择会员卡类型',
+ icon: 'none'
+ });
+ return;
+ }
+
+ if (this.userBalance['balance' + this.currentType] <= 0) {
+ uni.showToast({
+ title: '余额不足,请选择其他会员卡',
+ icon: 'none'
+ });
+ return;
+ }
+
+
+ this.userAccount = this.userBalance['balance' + this.currentType];
+ this.userDiscount = this.balance['discount' + this.currentType];
+
+ // this.payType = this.currentType;
+ // this.countPrice();
+ this.balancePopup = false;
+ },
+
+ cardType() {
+ if (this.currentType == 1) {
+ return '白银会员卡'
+ } else if (this.currentType == 2) {
+ return '黄金会员卡'
+ } else if (this.currentType == 3) {
+ return '铂金会员卡'
+ } else if (this.currentType == 4) {
+ return '钻石会员卡'
+ } else if (this.currentType == 5) {
+ return '至尊会员卡'
+ }
+ },
+
+ isSelected(groupIdx, idx) {
+ return this.selectedTimes.some(sel => sel.group === groupIdx && sel.idx === idx);
+ },
+
+ toggleSelect(groupIdx, idx, roomId) {
+ const found = this.selectedTimes.findIndex(sel => sel.group === groupIdx && sel.idx === idx);
+ if (found > -1) {
+ this.selectedTimes.splice(found, 1);
+ } else {
+ this.selectedTimes.push({ group: groupIdx, idx, roomId });
+ }
+ },
+
+ /**
+ * 获取选中的内容并提交
+ */
+ getSelectedContent() {
+ let self = this
+
+ // 按照 roomId 分组 selectedTimes,生成指定格式
+ const result = [];
+ const trade = self.detail.trade || [];
+ const roomMap = {};
+ self.selectedTimes.forEach(sel => {
+ if (!roomMap[sel.roomId]) roomMap[sel.roomId] = [];
+ // 获取时间段
+ const item = trade[sel.group] && trade[sel.group][sel.idx];
+ if (item) {
+ roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
+ }
+ });
+ Object.keys(roomMap).forEach(roomId => {
+ result.push({ room_id: roomId, arr: roomMap[roomId].join(',') });
+ });
+ self.content = result;
+
+ if (self.detail.light_order == 1) {
+ uni.showModal({
+ title: '提示',
+ content: '您已支付过灯光费用,是否再次支付?',
+ success: function(res) {
+ console.log("🚀 ~ res:", res)
+ if (res.confirm) {
+ self.payLight()
+ }
+ }
+ });
+ } else {
+ uni.showModal({
+ title: '提示',
+ content: '您确定要购买灯光费用吗?',
+ success: function(o) {
+ if (o.confirm) {
+ self.payLight()
+ }
+ }
+ });
+ }
+ },
+
+ payLight() {
+ let self = this
+
+ if (self.content.length == 0) {
+ uni.showToast({
+ title: '请选择时间',
+ icon: 'none'
+ });
+ return
+ }
+
+ if (self.payType == '') {
+ uni.showToast({
+ title: '请选择支付方式',
+ icon: 'none'
+ });
+ return;
+ }
+
+ if (self.payType == 'balance' && self.currentType == '') {
+ uni.showToast({
+ title: '请选择会员卡类型',
+ icon: 'none'
+ });
+ return;
+ }
+
+ uni.showLoading({
+ title: '正在处理'
+ });
+ self._post(
+ 'order.GroundOrder/addLightStoreOrder', {
+ order_id: self.order_id,
+ room_id: '',
+ ground_id: self.detail.ground_id,
+ content: JSON.stringify(self.content)
+ },
+ function(res) {
+ uni.hideLoading();
+
+ uni.showLoading({
+ title: '支付中'
+ });
+ const payId = res.data.id;
+
+ if (self.payType == 'wxpay') {
+ self._post(
+ 'user.groundOrder/lightPay', {
+ order_id: payId,
+ },
+ function(pay) {
+ console.log("🚀 ~ pay:", pay)
+ uni.requestPayment({
+ provider: 'wxpay',
+ timeStamp: pay.data.payment.timeStamp,
+ nonceStr: pay.data.payment.nonceStr,
+ package: 'prepay_id=' + pay.data.payment.prepay_id,
+ signType: 'MD5',
+ paySign: pay.data.payment.paySign,
+ success: res => {
+ self.openLightPopup = false;
+ self.selectedTimes = []
+ self.content = []
+
+ self.result = 'success'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ });
+ }, 200);
+
+ setTimeout(() => {
+ self.getData();
+ self.getRecharge();
+ }, 1500);
+ },
+ fail: res => {
+ self.openLightPopup = false;
+ self.selectedTimes = []
+ self.content = []
+
+ self.result = 'fail'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付失败',
+ icon: 'none'
+ });
+ }, 200);
+
+ setTimeout(() => {
+ self.getData();
+ self.getRecharge();
+ }, 1500);
+ },
+ });
+ }
+ );
+ } else if (self.payType == 'balance') {
+ self._post(
+ 'ground.ground/yueLightPay', {
+ order_id: payId,
+ pay_type: self.currentType
+ },
+ function(pay) {
+ if (pay.code == 1) {
+ self.openLightPopup = false;
+ self.selectedTimes = []
+ self.content = []
+
+ self.result = 'success'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付成功',
+ icon: 'none'
+ });
+ }, 200);
+
+ setTimeout(() => {
+ self.getData();
+ self.getRecharge();
+ }, 1500);
+
+ } else {
+ self.openLightPopup = false;
+
+ console.log("🚀 ~ pay error res:", res)
+ self.result = 'fail'
+ uni.hideLoading();
+ setTimeout(() => {
+ uni.showToast({
+ title: '支付失败',
+ icon: 'none'
+ });
+ }, 200);
+
+ setTimeout(() => {
+ self.getData();
+ self.getRecharge();
+ }, 1500);
+ }
+ }
+ )
+ }
+ }
+ );
+
+ },
}
};
@@ -1002,6 +1475,19 @@ page {
text-align: center;
}
+
+.date-time-btn-normal {
+ width: 100%;
+ height: 60rpx;
+ line-height: 60rpx;
+ background-color: #BBBFC7;
+ color: #fff;
+ font-size: 26rpx;
+ border-radius: 10rpx;
+ text-align: center;
+}
+
+
.notice-popup {
padding: 20rpx 0;
width: 100%;
@@ -1036,32 +1522,190 @@ page {
margin-bottom: 10rpx;
}
-.btn {
+ .btn {
+ font-size: 32rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-top: 44rpx;
+
+ .btn1 {
+ width: 240rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ background: #F6F7F8;
+ border-radius: 8rpx;
+ margin-right: 30rpx;
+ }
+
+ .btn2 {
+ width: 240rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ background: #365A9A;
+ color: #FFFFFF;
+ border-radius: 8rpx;
+ }
+ }
+}
+
+.light-popup {
+ padding: 20rpx 0;
+ width: 100%;
+
+ .title {
+ font-size: 32rpx;
+ color: #303133;
+ line-height: 50rpx;
+ text-align: center;
+ }
+
+ .desc {
+ font-size: 24rpx;
+ color: #303133;
+ line-height: 52rpx;
+ text-align: left;
+ }
+
+ .btn {
+ font-size: 32rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-top: 44rpx;
+
+ .btn1 {
+ width: 240rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ background: #F6F7F8;
+ border-radius: 8rpx;
+ margin-right: 30rpx;
+ }
+
+ .btn2 {
+ width: 240rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ background: #365A9A;
+ color: #FFFFFF;
+ border-radius: 8rpx;
+ }
+ }
+}
+
+.open-light {
+ border-radius: 16rpx;
font-size: 32rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 44rpx;
+}
- .btn1 {
- width: 240rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- background: #F6F7F8;
- border-radius: 8rpx;
- margin-right: 30rpx;
+
+.buy-checkout {
+ border-radius: 16rpx;
+ background-color: #FFFFFF;
+
+ .item {
+ border-bottom: none;
+ border-radius: 2rpx;
+ padding: 30rpx 0;
+ }
+}
+
+.buy-checkout .item.active .iconfont.icon-xuanze {
+ color: #365A9A;
+}
+
+.card {
+ margin-top: 28rpx;
+ padding-bottom: 64rpx;
+
+ .card-item {
+ width: 690rpx;
+ height: 104rpx;
+ background: #FFFFFF;
+ border-radius: 16rpx;
+ border: 2rpx solid #F4F4F4;
+ margin: 0 30rpx 20rpx;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 30rpx;
+ box-sizing: border-box;
+
+ .card-title {
+ font-size: 30rpx;
+ color: #121212;
+ margin-right: 24rpx;
+ }
+
+ .discount {
+ width: 44rpx;
+ height: 44rpx;
+ line-height: 44rpx;
+ text-align: center;
+ border-radius: 100%;
+ background: #FF5951;
+ color: #fff;
+ font-size: 30rpx;
+ margin-right: 20rpx;
+ }
+
+ .sale {
+ font-size: 28rpx;
+ }
+
+ .card-balance {
+ font-size: 30rpx;
+ color: #303133;
+ line-height: 42rpx;
+ margin-right: 28rpx;
+ }
}
- .btn2 {
- width: 240rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
+ .active {
+ border: 2rpx solid #FF5951;
+ background: #FFF4F4;
+
+ .card-checkout {
+ .iconfont{
+ color: #365A9A;
+ }
+ }
+ }
+
+ .card-btn {
+ width: 630rpx;
+ height: 90rpx;
background: #365A9A;
- color: #FFFFFF;
border-radius: 8rpx;
+ font-weight: bold;
+ font-size: 30rpx;
+ color: #FFFFFF;
+ line-height: 90rpx;
+ text-align: center;
+ margin: 42rpx auto 0;
}
}
+
+.pt44 {
+ padding-top: 44rpx;;
}
+
+.pay-light-btn {
+ width: 300rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ text-align: center;
+ border-radius: 8rpx;
+ color: #303133;
+ margin: 0 auto;
+ border: 2rpx solid #C2C9D5;
+ font-size: 28rpx;
+}
+
+
diff --git a/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue b/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue
index aeb30ae..d28026a 100644
--- a/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue
+++ b/uni_modules/face-bio-assay/components/face-bio-assay/face-bio-assay.vue
@@ -1,6 +1,6 @@
-