details.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <view class="wanl-coupon">
  3. <view class="edgeInsetTop"></view>
  4. <view class="details padding-bj">
  5. <view class="text-center wanl-gray" v-if="!couponData.id">{{ $t('coupon.noDetails') }}</view>
  6. <view v-else>
  7. <view class="text-lg text-bold margin-bottom-bj">{{ couponData.name }}</view>
  8. <view class="wanl-gray text-sm margin-bottom-bj">
  9. <text class="cu-tag sm radius margin-right-xs">{{ couponData.type_text }}</text>
  10. {{ couponData.type == 'reduction' ? $t('mall.fullReduction', [Number(couponData.limit), Number(couponData.price)]) : couponData.type == 'discount' ? $t('mall.fullDiscount', [Number(couponData.limit), Number(couponData.discount)]) : $t('mall.freeShippingFull', [Number(couponData.limit)]) }}
  11. </view>
  12. <view class="wanl-gray text-sm" v-if="couponData.pretype == 'fixed'">
  13. {{ $t('coupon.validPeriod') }}:{{ couponData.startdate }} ~ {{ couponData.enddate }}
  14. </view>
  15. <view class="wanl-gray text-sm" v-else-if="couponData.pretype == 'appoint' && couponData.validity != 0">
  16. {{ $t('coupon.validDays', [couponData.validity]) }}
  17. </view>
  18. <view class="wanl-gray text-sm" v-else>
  19. {{ $t('coupon.permanent') }}
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. couponData: {}
  30. }
  31. },
  32. onLoad(option) {
  33. if (option.data) {
  34. this.couponData = JSON.parse(option.data)
  35. }
  36. }
  37. }
  38. </script>
  39. <style>
  40. </style>