shish 6 месяцев назад
Родитель
Сommit
110cde2581

+ 46 - 47
hdApp/src/admin/billing/components/hb-select.vue

@@ -3,7 +3,7 @@
 		<!-- Trigger Row -->
         <view class="cell-content" @click="openPopup" v-if="hasAvailableHb">
             <view class="right-content">
-                <text v-if="selectedHb" class="selected-text">-¥{{ selectedHb.amount }}</text>
+                <text v-if="selectedHb" class="selected-text">-¥{{ selectedHb.amount?parseFloat(selectedHb.amount):0 }}</text>
                 <view v-else class="available-tag">
                     <text>有红包可用</text>
                 </view>
@@ -22,16 +22,15 @@
 					<view class="hb-list">
 						<view class="hb-card" v-for="item in availableHbList" :key="item.id" @click="selectHb(item)">
 							<view class="card-left">
-								<view class="amount"><text class="symbol">¥</text>{{ item.amount }}</view>
+								<view class="amount"><text class="symbol">¥</text>{{ item.amount?parseFloat(item.amount):0 }}</view>
 								<view class="type">{{ item.name }}</view>
 							</view>
 							<view class="card-middle">
 								<view class="name">{{ item.name }}</view>
-								<view class="condition">
-									{{ Number(item.minConsume) > 0 ? `满${item.minConsume}可用` : '无门槛' }}
-								</view>
-								<view class="date" v-if="item.endTime == 4102416000">永久可用</view>
-								<view class="date" v-else>{{ formatTime(item.beginTime) }}-{{ formatTime(item.endTime) }}到期</view>
+								<view class="condition" v-if="Number(item.minConsume) > 0"> 满{{item.minConsume?parseFloat(item.minConsume):0}}可用 </view>
+								<view class="condition" v-else> 无门槛 </view>
+								<view class="date" v-if="item.endTime == 4102416000">永久有效</view>
+								<view class="date" v-else>{{ formatTime(item.endTime) }} 到期</view>
 							</view>
 							<view class="card-right">
 								<view class="radio-circle" :class="{ checked: currentSelectedId == item.id }">
@@ -43,7 +42,7 @@
 						<!-- Option to not use red packet -->
 						<view class="hb-card" @click="selectHb(null)">
 							<view class="card-left" style="border:none;">
-								<text style="font-size: 28rpx; color: #333; font-weight: bold;">不使用红包</text>
+								<text style="font-size: 28upx; color: #333; font-weight: bold;">不使用红包</text>
 							</view>
 							<view class="card-middle"></view>
 							<view class="card-right">
@@ -163,7 +162,7 @@ export default {
 }
 .tui-title {
     width: auto !important; /* Override tui-list-cell default if needed */
-    font-size: 32rpx;
+    font-size: 32upx;
     color: #333;
 }
 .right-content {
@@ -173,70 +172,70 @@ export default {
 .available-tag {
 	background-color: #F82547;
 	color: #fff;
-	font-size: 24rpx;
-	padding: 6rpx 20rpx;
-	border-radius: 30rpx;
+	font-size: 30upx;
+	padding: 10upx 20upx;
+	border-radius: 30upx;
 }
 .selected-text {
 	color: #ff2842;
-	font-size: 32rpx;
+	font-size: 32upx;
 	font-weight: bold;
 }
 
 /* Popup Styles */
 .hb-popup-content {
 	background-color: #f5f5f5;
-	border-radius: 20rpx 20rpx 0 0;
+	border-radius: 20upx 20upx 0 0;
 	padding-bottom: env(safe-area-inset-bottom);
 	display: flex;
 	flex-direction: column;
     height: 70vh; /* Fixed height for popup */
 }
 .popup-header {
-	height: 100rpx;
+	height: 100upx;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 	position: relative;
 	background-color: #fff;
-	font-size: 34rpx;
+	font-size: 34upx;
 	font-weight: bold;
-	border-radius: 20rpx 20rpx 0 0;
+	border-radius: 20upx 20upx 0 0;
 }
 .close-btn {
 	position: absolute;
-	right: 30rpx;
-	font-size: 48rpx;
+	right: 30upx;
+	font-size: 48upx;
 	color: #999;
-	padding: 10rpx;
+	padding: 10upx;
     line-height: 1;
 }
 .popup-scroll {
 	flex: 1;
     height: 0; /* Important for flex child scroll */
-	padding: 20rpx;
+	padding: 20upx;
 	box-sizing: border-box;
 }
 .hb-list {
-    padding: 20rpx;
+    padding: 20upx;
 }
 .hb-card {
 	background-color: #fff6f0; /* Light orange bg */
-	border-radius: 12rpx;
-	margin-bottom: 20rpx;
+	border-radius: 12upx;
+	margin-bottom: 20upx;
 	display: flex;
 	align-items: center;
-	padding: 30rpx 20rpx;
+	padding: 30upx 20upx;
     position: relative;
     border: 1px solid transparent;
 }
 /* Selected border effect if needed, but image shows radio check */
 
 .card-left {
-	width: 160rpx;
+	width: 160upx;
 	text-align: center;
 	border-right: 1px dashed #eecbc0;
-	margin-right: 20rpx;
+	margin-right: 20upx;
 	display: flex;
 	flex-direction: column;
 	justify-content: center;
@@ -244,47 +243,47 @@ export default {
 }
 .amount {
 	color: #ff2842;
-	font-size: 56rpx;
+	font-size: 50upx;
 	font-weight: bold;
 }
 .symbol {
-	font-size: 28rpx;
-    margin-right: 4rpx;
+	font-size: 28upx;
+    margin-right: 4upx;
 }
 .type {
-	font-size: 24rpx;
+	font-size: 24upx;
 	color: #666;
-	margin-top: 4rpx;
+	margin-top: 4upx;
 }
 .card-middle {
 	flex: 1;
 }
 .name {
-	font-size: 30rpx;
+	font-size: 30upx;
 	font-weight: bold;
 	color: #333;
-	margin-bottom: 12rpx;
+	margin-bottom: 12upx;
 }
 .condition {
-	font-size: 24rpx;
+	font-size: 24upx;
 	color: #666;
-	margin-bottom: 8rpx;
+	margin-bottom: 8upx;
 }
 .date {
-	font-size: 22rpx;
+	font-size: 22upx;
 	color: #999;
 }
 .card-right {
-	width: 80rpx;
+	width: 80upx;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 }
 .radio-circle {
-    width: 40rpx;
-    height: 40rpx;
+    width: 40upx;
+    height: 40upx;
     border-radius: 50%;
-    border: 2rpx solid #ccc;
+    border: 2upx solid #ccc;
     display: flex;
     justify-content: center;
     align-items: center;
@@ -297,19 +296,19 @@ export default {
 }
 .icon-check {
     color: #fff;
-    font-size: 24rpx;
+    font-size: 24upx;
 }
 
 .popup-footer {
-	padding: 20rpx 30rpx;
+	padding: 20upx 30upx;
 	background-color: #fff;
 }
 .confirm-btn {
 	background-color: #ff6600;
 	color: #fff;
-	border-radius: 40rpx;
-	font-size: 32rpx;
-	height: 80rpx;
-	line-height: 80rpx;
+	border-radius: 40upx;
+	font-size: 32upx;
+	height: 80upx;
+	line-height: 80upx;
 }
 </style>

+ 2 - 39
hdApp/src/admin/hb/list.vue

@@ -35,7 +35,7 @@
               <text class="name">{{ item.customName }}</text>
               <text class="amount">¥ {{ item.amount?parseFloat(item.amount):0 }}</text>
             </view>
-            <view class="status" :class="item.statusClass">{{ item.statusText }}</view>
+            <view class="status" :class="item.statusClass">{{ item.status==0?'待使用':item.status==1?'已使用':item.status==-1?'已失效':'未知'}}</view>
           </view>
           <view class="card-body">
             <view class="row">开始时间:{{ formatDateTime(item.beginTime) }}</view>
@@ -84,44 +84,7 @@ export default {
       searchText: '',
       showSearch: false,
       searchList: [],
-      customId: 0,
-      // list: [],
-      // Mock data source
-      mockData: [
-        {
-          id: 1,
-          customName: '小明',
-          amount: 30,
-          statusText: '待使用',
-          startTime: '12-22 11:50',
-          endTime: '12-29 11:50',
-          duration: 7,
-          source: '新人领取',
-          createTime: '12-22 11:30'
-        },
-        {
-          id: 2,
-          customName: '山村小石头',
-          amount: 30,
-          statusText: '已使用',
-          startTime: '12-22 11:50',
-          endTime: '12-29 11:50',
-          duration: 7,
-          source: '充值赠送',
-          createTime: '12-22 11:30'
-        },
-        {
-          id: 3,
-          customName: '李四',
-          amount: 50,
-          statusText: '已失效',
-          startTime: '11-22 11:50',
-          endTime: '11-29 11:50',
-          duration: 7,
-          source: '活动领取',
-          createTime: '11-22 11:30'
-        }
-      ]
+      customId: 0
     }
   },
   onShow() {

+ 2 - 2
hdApp/src/admin/order/detail.vue

@@ -494,7 +494,7 @@ export default {
   },
   computed: {
     canBackHb() {
-      // 只有订单全部退款(actPrice=0)才能操作退回红包
+      // 订单全部退款(actPrice=0)才能操作退回红包
       const hasActPrice = this.orderInfo && this.orderInfo.actPrice !== undefined && this.orderInfo.actPrice !== null && this.orderInfo.actPrice !== ''
       if (!hasActPrice) return false
       const actPrice = parseFloat(this.orderInfo.actPrice)
@@ -854,7 +854,7 @@ export default {
       }
 
       if (!this.canBackHb) {
-        this.$msg('只有订单全部退款才能退回红包')
+        this.$msg('订单全部退款才能退回红包')
         return
       }
 

+ 45 - 46
mallApp/src/components/hb/hb-select.vue

@@ -3,7 +3,7 @@
 		<!-- Trigger Row -->
         <view class="cell-content" @click="openPopup" v-if="hasAvailableHb">
             <view class="right-content">
-                <text v-if="selectedHb" class="selected-text">-¥{{ selectedHb.amount }}</text>
+                <text v-if="selectedHb" class="selected-text">-¥{{ selectedHb.amount?parseFloat(selectedHb.amount):0 }}</text>
                 <view v-else class="available-tag">
                     <text>有红包可用</text>
                 </view>
@@ -22,15 +22,14 @@
 					<view class="hb-list">
 						<view class="hb-card" v-for="item in availableHbList" :key="item.id" @click="selectHb(item)">
 							<view class="card-left">
-								<view class="amount"><text class="symbol">¥</text>{{ item.amount }}</view>
+								<view class="amount"><text class="symbol">¥</text>{{ item.amount?parseFloat(item.amount):0 }}</view>
 								<view class="type">{{ item.name }}</view>
 							</view>
 							<view class="card-middle">
 								<view class="name">{{ item.name }}</view>
-								<view class="condition">
-									{{ Number(item.minConsume) > 0 ? `满${item.minConsume}可用` : '无门槛' }}
-								</view>
-								<view class="date" v-if="item.endTime == 4102416000">永久可用</view>
+								<view class="condition" v-if="Number(item.minConsume) > 0"> 满{{ item.minConsume?parseFloat(item.minConsume):0 }}可用 </view>
+								<view class="condition" v-else>无门槛</view>
+								<view class="date" v-if="item.endTime == 4102416000">永久有效</view>
 								<view class="date" v-else>{{ formatTime(item.endTime) }} 到期</view>
 							</view>
 							<view class="card-right">
@@ -43,7 +42,7 @@
 						<!-- Option to not use red packet -->
 						<view class="hb-card" @click="selectHb(null)">
 							<view class="card-left" style="border:none;">
-								<text style="font-size: 28rpx; color: #333; font-weight: bold;">不使用红包</text>
+								<text style="font-size: 28upx; color: #333; font-weight: bold;">不使用红包</text>
 							</view>
 							<view class="card-middle"></view>
 							<view class="card-right">
@@ -163,7 +162,7 @@ export default {
 }
 .tui-title {
     width: auto !important; /* Override tui-list-cell default if needed */
-    font-size: 32rpx;
+    font-size: 32upx;
     color: #333;
 }
 .right-content {
@@ -173,70 +172,70 @@ export default {
 .available-tag {
 	background-color: #F82547;
 	color: #fff;
-	font-size: 24rpx;
-	padding: 6rpx 20rpx;
-	border-radius: 30rpx;
+	font-size: 30upx;
+	padding: 10upx 20upx;
+	border-radius: 30upx;
 }
 .selected-text {
 	color: #ff2842;
-	font-size: 32rpx;
+	font-size: 32upx;
 	font-weight: bold;
 }
 
 /* Popup Styles */
 .hb-popup-content {
 	background-color: #f5f5f5;
-	border-radius: 20rpx 20rpx 0 0;
+	border-radius: 20upx 20upx 0 0;
 	padding-bottom: env(safe-area-inset-bottom);
 	display: flex;
 	flex-direction: column;
     height: 70vh; /* Fixed height for popup */
 }
 .popup-header {
-	height: 100rpx;
+	height: 100upx;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 	position: relative;
 	background-color: #fff;
-	font-size: 34rpx;
+	font-size: 34upx;
 	font-weight: bold;
-	border-radius: 20rpx 20rpx 0 0;
+	border-radius: 20upx 20upx 0 0;
 }
 .close-btn {
 	position: absolute;
-	right: 30rpx;
-	font-size: 48rpx;
+	right: 30upx;
+	font-size: 48upx;
 	color: #999;
-	padding: 10rpx;
+	padding: 10upx;
     line-height: 1;
 }
 .popup-scroll {
 	flex: 1;
     height: 0; /* Important for flex child scroll */
-	padding: 20rpx;
+	padding: 20upx;
 	box-sizing: border-box;
 }
 .hb-list {
-    padding: 20rpx;
+    padding: 20upx;
 }
 .hb-card {
 	background-color: #fff6f0; /* Light orange bg */
-	border-radius: 12rpx;
-	margin-bottom: 20rpx;
+	border-radius: 12upx;
+	margin-bottom: 20upx;
 	display: flex;
 	align-items: center;
-	padding: 30rpx 20rpx;
+	padding: 30upx 20upx;
     position: relative;
     border: 1px solid transparent;
 }
 /* Selected border effect if needed, but image shows radio check */
 
 .card-left {
-	width: 160rpx;
+	width: 160upx;
 	text-align: center;
 	border-right: 1px dashed #eecbc0;
-	margin-right: 20rpx;
+	margin-right: 20upx;
 	display: flex;
 	flex-direction: column;
 	justify-content: center;
@@ -244,47 +243,47 @@ export default {
 }
 .amount {
 	color: #ff2842;
-	font-size: 56rpx;
+	font-size: 50upx;
 	font-weight: bold;
 }
 .symbol {
-	font-size: 28rpx;
-    margin-right: 4rpx;
+	font-size: 28upx;
+    margin-right: 4upx;
 }
 .type {
-	font-size: 24rpx;
+	font-size: 24upx;
 	color: #666;
-	margin-top: 4rpx;
+	margin-top: 4upx;
 }
 .card-middle {
 	flex: 1;
 }
 .name {
-	font-size: 30rpx;
+	font-size: 30upx;
 	font-weight: bold;
 	color: #333;
-	margin-bottom: 12rpx;
+	margin-bottom: 12upx;
 }
 .condition {
-	font-size: 24rpx;
+	font-size: 24upx;
 	color: #666;
-	margin-bottom: 8rpx;
+	margin-bottom: 8upx;
 }
 .date {
-	font-size: 22rpx;
+	font-size: 22upx;
 	color: #999;
 }
 .card-right {
-	width: 80rpx;
+	width: 80upx;
 	display: flex;
 	justify-content: center;
 	align-items: center;
 }
 .radio-circle {
-    width: 40rpx;
-    height: 40rpx;
+    width: 40upx;
+    height: 40upx;
     border-radius: 50%;
-    border: 2rpx solid #ccc;
+    border: 2upx solid #ccc;
     display: flex;
     justify-content: center;
     align-items: center;
@@ -297,19 +296,19 @@ export default {
 }
 .icon-check {
     color: #fff;
-    font-size: 24rpx;
+    font-size: 24upx;
 }
 
 .popup-footer {
-	padding: 20rpx 30rpx;
+	padding: 20upx 30upx;
 	background-color: #fff;
 }
 .confirm-btn {
 	background-color: #ff6600;
 	color: #fff;
-	border-radius: 40rpx;
-	font-size: 32rpx;
-	height: 80rpx;
-	line-height: 80rpx;
+	border-radius: 40upx;
+	font-size: 32upx;
+	height: 80upx;
+	line-height: 80upx;
 }
 </style>