|
|
@@ -22,33 +22,51 @@
|
|
|
<!-- </view>-->
|
|
|
</view>
|
|
|
|
|
|
- <view class="h-center-content flex-col justify-around">
|
|
|
+ <view class="flex-col">
|
|
|
<view class="h-value">
|
|
|
<text>{{ item.title }}</text>
|
|
|
</view>
|
|
|
- <view class="title">
|
|
|
- 适用项目:{{ item.serviceProjectName || '' }}
|
|
|
- </view>
|
|
|
- <view class="title">
|
|
|
- 适用门店:{{ item.useStoreDesc || '' }}
|
|
|
- </view>
|
|
|
- <view class="title">
|
|
|
- 有效天数:{{ item.effectiveDays }}
|
|
|
- </view>
|
|
|
- <view class="title flex-row" @click.stop="showRemark(item)">
|
|
|
- <text>使用规则</text>
|
|
|
- <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
|
|
|
- <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
|
|
|
- <view class="h-right-content flex-col justify-center ">
|
|
|
- <view class="btn" @click="payRights(item)">
|
|
|
- <text>购买</text>
|
|
|
+ <view class="flex-row">
|
|
|
+ <view class="h-center-content flex-col justify-around">
|
|
|
+
|
|
|
+ <view class="title">
|
|
|
+ 适用项目:{{ item.serviceProjectName || '' }}
|
|
|
+ </view>
|
|
|
+ <view class="title">
|
|
|
+ 适用门店:{{ item.useStoreDesc || '' }}
|
|
|
+ </view>
|
|
|
+ <view class="title">
|
|
|
+ 有效天数:{{ item.effectiveDays }}
|
|
|
+ </view>
|
|
|
+ <view class="title flex-row" @click.stop="showRemark(item)">
|
|
|
+ <text>使用规则</text>
|
|
|
+ <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>
|
|
|
+ <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="h-right-content flex-col justify-center ">
|
|
|
+ <view class="btn" @click="payRights(item)">
|
|
|
+ <text>购买</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
<view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
|
|
|
+ <view v-if="item.unavailableWeeklyTimes || item.unavailableTimeRanges">
|
|
|
+ 不可用日期:
|
|
|
+ <view v-if="item.unavailableWeeklyTimes">{{ parseWeeklyTimes(item.unavailableWeeklyTimes) }}</view>
|
|
|
+ <view v-if="item.unavailableTimeRanges">{{ parseTimeRanges(item.unavailableTimeRanges) }}</view>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.delayEffectiveDays > 0">
|
|
|
+ 生效时间:
|
|
|
+ <text>购买后{{item.delayEffectiveDays}}天生效</text>
|
|
|
+ </view>
|
|
|
<view v-if="item.description !=null">
|
|
|
使用说明:
|
|
|
<text>{{ item.description }}</text>
|
|
|
@@ -151,6 +169,44 @@ export default {
|
|
|
showRemarkId: '',
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ // 解析 unavailableWeeklyTimes,将 "3,4,5" 转换为 ["星期二", "星期三", "星期四"]
|
|
|
+ parseWeeklyTimes() {
|
|
|
+ return function(times) {
|
|
|
+ if (!times) return '';
|
|
|
+ const arr = times.split(',');
|
|
|
+ const weekMap = {
|
|
|
+ '1': '星期日',
|
|
|
+ '2': '星期一',
|
|
|
+ '3': '星期二',
|
|
|
+ '4': '星期三',
|
|
|
+ '5': '星期四',
|
|
|
+ '6': '星期五',
|
|
|
+ '7': '星期六'
|
|
|
+ };
|
|
|
+ return arr.map(item => weekMap[item]).join('、');
|
|
|
+ };
|
|
|
+ },
|
|
|
+ // 解析 unavailableTimeRanges,将 JSON 字符串转换为可读格式
|
|
|
+ parseTimeRanges() {
|
|
|
+ return function(ranges) {
|
|
|
+ if (!ranges) return '';
|
|
|
+ try {
|
|
|
+ const arr = JSON.parse(ranges);
|
|
|
+ return arr.map(item => {
|
|
|
+ const begin = item.beginTime.split(' ')[0];
|
|
|
+ const end = item.endTime.split(' ')[0];
|
|
|
+ return `${begin} - ${end}`;
|
|
|
+ }).join(';');
|
|
|
+ } catch (e) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ //unavailableTimeRanges: "[{"beginTime":"2026-02-04 00:00:00","endTime":"2026-02-08 23:59:59"}]"
|
|
|
+ // unavailableWeeklyTimes: "3,4,5"
|
|
|
onLoad(option) {
|
|
|
let sysInfo = uni.getSystemInfoSync()
|
|
|
this.windowHeight = sysInfo.windowHeight - 50 + 'px'//除标题栏栏外的屏幕可用高度
|