|
|
@@ -1,5 +1,5 @@
|
|
|
<!--
|
|
|
- 自动发红包规则列表,供门店管理员查看四类自动红包的配置状态和摘要。
|
|
|
+ 自动发红包规则列表,供门店管理员查看四类自动红包的配置状态。
|
|
|
固定展示全部业务类型,即使接口尚未生成规则也可直接进入配置。
|
|
|
-->
|
|
|
<template>
|
|
|
@@ -12,20 +12,6 @@
|
|
|
</view>
|
|
|
<text class="status" :class="item.statusClass">{{ item.statusName }}</text>
|
|
|
</view>
|
|
|
- <view class="summary-row">
|
|
|
- <view class="summary-item">
|
|
|
- <text class="summary-value">¥{{ ruleValue(item, 'hbAmount', '0.00') }}</text>
|
|
|
- <text class="summary-label">红包金额</text>
|
|
|
- </view>
|
|
|
- <view class="summary-item">
|
|
|
- <text class="summary-value">¥{{ ruleValue(item, 'miniCost', '0.00') }}</text>
|
|
|
- <text class="summary-label">最低消费</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="scope-row">
|
|
|
- <text class="scope-label">适用范围</text>
|
|
|
- <text class="scope-value">{{ item.scopeText || formatScope(item) }}</text>
|
|
|
- </view>
|
|
|
<button class="config-btn" @click="goEdit(item.type)">去配置</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -105,28 +91,6 @@ export default {
|
|
|
if (Number(status) === 0) return 'disabled'
|
|
|
return 'unconfigured'
|
|
|
},
|
|
|
- /**
|
|
|
- * 从卡片或第一条红包规则读取摘要字段。
|
|
|
- */
|
|
|
- ruleValue(item, field, fallback) {
|
|
|
- if (item[field] !== undefined && item[field] !== '') return item[field]
|
|
|
- let rules = item.rules || []
|
|
|
- if (typeof rules === 'string') {
|
|
|
- try {
|
|
|
- rules = JSON.parse(rules)
|
|
|
- } catch (error) {
|
|
|
- rules = []
|
|
|
- }
|
|
|
- }
|
|
|
- return rules[0] && rules[0][field] !== undefined ? rules[0][field] : fallback
|
|
|
- },
|
|
|
- /**
|
|
|
- * 接口未返回摘要时,根据范围类型生成兜底文本。
|
|
|
- */
|
|
|
- formatScope(item) {
|
|
|
- const names = { 1: '全部商品适用', 2: '指定花束分类', 3: '指定花束商品' }
|
|
|
- return names[Number(item.scopeType) || 1]
|
|
|
- },
|
|
|
/**
|
|
|
* 进入指定类型的自动红包配置页。
|
|
|
*/
|
|
|
@@ -183,44 +147,8 @@ export default {
|
|
|
background: #f2f3f5;
|
|
|
color: #86909c;
|
|
|
}
|
|
|
-.summary-row {
|
|
|
- display: flex;
|
|
|
- margin-top: 28upx;
|
|
|
- padding: 24upx 0;
|
|
|
- border-top: 1upx solid #f4f4f4;
|
|
|
- border-bottom: 1upx solid #f4f4f4;
|
|
|
-}
|
|
|
-.summary-item {
|
|
|
- display: flex;
|
|
|
- flex: 1;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
-}
|
|
|
-.summary-value {
|
|
|
- color: #f53f3f;
|
|
|
- font-size: 34upx;
|
|
|
- font-weight: bold;
|
|
|
-}
|
|
|
-.summary-label {
|
|
|
- margin-top: 8upx;
|
|
|
- color: #999;
|
|
|
- font-size: 23upx;
|
|
|
-}
|
|
|
-.scope-row {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 22upx 0;
|
|
|
-}
|
|
|
-.scope-label {
|
|
|
- color: #666;
|
|
|
- font-size: 26upx;
|
|
|
-}
|
|
|
-.scope-value {
|
|
|
- color: #333;
|
|
|
- font-size: 26upx;
|
|
|
-}
|
|
|
.config-btn {
|
|
|
+ margin-top: 28upx;
|
|
|
height: 72upx;
|
|
|
line-height: 72upx;
|
|
|
border-radius: 36upx;
|