| | |
| | | <view class="info-label">券码信息:</view> |
| | | <view class="coupon-card"> |
| | | <view class="coupon-name">{{ couponInfo.name }}</view> |
| | | <view class="coupon-desc">{{ couponInfo.desc }}</view> |
| | | <view class="coupon-desc">每日骑行限制时间:{{ couponInfo.limitTimeText }}</view> |
| | | <view class="coupon-divider"></view> |
| | | <view class="coupon-date">有效期:{{ couponInfo.period }}</view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | const VERIFY_PACKAGE_INFO_KEY = 'verifyPackageInfo' |
| | | |
| | | const defaultCouponInfo = { |
| | | name: '通用骑行3天体验卡', |
| | | desc: '每天免费骑行120分钟', |
| | | period: '2026-05-01 至 2026-05-03' |
| | | name: '', |
| | | limitTimeText: '--', |
| | | period: '--' |
| | | } |
| | | |
| | | export default { |
| | |
| | | } |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | | onLoad() { |
| | | const packageInfo = uni.getStorageSync(VERIFY_PACKAGE_INFO_KEY) |
| | | uni.removeStorageSync(VERIFY_PACKAGE_INFO_KEY) |
| | | |
| | | if (!packageInfo) { |
| | | return |
| | | } |
| | | |
| | | this.couponInfo = { |
| | | name: options.name || defaultCouponInfo.name, |
| | | desc: options.desc || defaultCouponInfo.desc, |
| | | period: options.period || defaultCouponInfo.period |
| | | name: packageInfo.name, |
| | | limitTimeText: `${packageInfo.limitTime ? packageInfo.limitTime + '分钟' : '不限制'}`, |
| | | period: this.formatPeriod(packageInfo.useStartDate, packageInfo.useEndDate) |
| | | } |
| | | }, |
| | | methods: { |
| | | formatPeriod(useStartDate, useEndDate) { |
| | | if (useStartDate && useEndDate) { |
| | | return `${useStartDate} 至 ${useEndDate}` |
| | | } |
| | | |
| | | return useStartDate || useEndDate || defaultCouponInfo.period |
| | | }, |
| | | goHome() { |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }) |
| | | }, |
| | | goScanRide() { |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }) |
| | | uni.$emit('sweep') |
| | | uni.navigateBack({ delta: 2 }); |
| | | } |
| | | } |
| | | } |
| | |
| | | font-weight: 600; |
| | | line-height: 56rpx; |
| | | color: #222222; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .coupon-desc { |