discountDetail.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="content">
  3. <view style="background: #BE573F; height: 56rpx; width: 100%;"></view>
  4. <view class="whiteBg">
  5. <!-- firstView -->
  6. <view class="firstView">
  7. <view class="money">{{detailData.ActName}}</view>
  8. <view class="condition" v-if="detailData.WhereMoney != 0">满{{detailData.WhereMoney}}元可用</view>
  9. <view class="condition" v-else>满任意金额可用</view>
  10. </view>
  11. <view class="point leftP"></view>
  12. <view class="point rightP"></view>
  13. <!-- secondView -->
  14. <view class="secondView">
  15. <view v-if="detailData.EndOffsetDays===null||detailData.EndOffsetDays==='null'||detailData.EndOffsetDays===''">
  16. <view class="same" >有效期:{{detailData.StartTime.slice(0,detailData.StartTime.length-8)}}至 {{detailData.EndTime.slice(0,detailData.EndTime.length-8)}}</view>
  17. </view>
  18. <view v-else>
  19. <view class="same" v-if="detailData.EndOffsetDays>-1">有效期:自领取后,{{detailData.EndOffsetDays}}天有效</view>
  20. <view class="same" v-if="detailData.EndOffsetDays==-1||detailData.EndOffsetDays==null||detailData.EndOffsetDays=='null'">有效期:{{detailData.StartTime.slice(0,detailData.StartTime.length-8)}}至 {{detailData.EndTime.slice(0,detailData.EndTime.length-8)}}</view>
  21. </view>
  22. <!-- <view class="same">可用次数:{{detailData.avaQty}}</view> -->
  23. </view>
  24. <!-- thirdView -->
  25. <view class="thirdView">
  26. <view class="thirdTitle">适用门店</view>
  27. <view class="store">
  28. <!-- <view class="grayPoint"></view> -->
  29. <view class="same">{{detailData.shopNames}}</view>
  30. </view>
  31. </view>
  32. <!-- 列表 -->
  33. <view class="itemContent">
  34. <view class="thirdTitle">使用说明</view>
  35. <rich-text :nodes="couContent" style="color: #666666; font-size: 26rpx;"></rich-text>
  36. <!-- <view v-for="(item,index) in itemData" :key="index">
  37. <view class="store">
  38. <view class="grayPoint"></view>
  39. <view class="same">{{item}}</view>
  40. </view>
  41. </view> -->
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. detailData:{},
  51. couponId:'',
  52. couContent:'',
  53. }
  54. },
  55. onLoad(opt) {
  56. this.couponId = opt.couponId,
  57. this.getDetailData()
  58. },
  59. methods: {
  60. getDetailData() {
  61. uni.showLoading({
  62. title: '加载中'
  63. })
  64. let url = 'worldKeepCar/keepCarMy/queryTCouponDetail',
  65. params = {
  66. ID: this.couponId,
  67. }
  68. this.$http(url, params, 'GET').then(res => {
  69. uni.hideLoading();
  70. var data = res.data
  71. if(res.data.CouContent){
  72. this.couContent=res.data.CouContent.replace(/\<p/gi, '<p style="display: inline-block"');
  73. }
  74. // 处理 undefined和null转为空白字符串
  75. for (const key in data) {
  76. data[key] = this.$praseStrEmpty(data[key])
  77. }
  78. this.detailData = data
  79. })
  80. },
  81. }
  82. }
  83. </script>
  84. <style scoped>
  85. .content {
  86. background: #BE573F;
  87. min-height: 100vh;
  88. }
  89. .whiteBg {
  90. margin: 0rpx 24rpx;
  91. background-color: #FFFFFF;
  92. border-radius: 10rpx;
  93. min-height: 60vh;
  94. }
  95. .firstView {
  96. border-bottom: 1rpx #EEEEEE dashed;
  97. text-align: center;
  98. padding: 50rpx 20rpx;
  99. padding-bottom: 30rpx;
  100. }
  101. .money {
  102. font-size: 44rpx;
  103. color: #333333;
  104. font-weight: bold;
  105. margin-bottom: 10rpx;
  106. }
  107. .condition {
  108. font-size: 28rpx;
  109. color: #999999;
  110. }
  111. .point {
  112. width: 30rpx;
  113. height: 30rpx;
  114. background-color: #BE573F;
  115. border-radius: 15rpx;
  116. }
  117. .leftP {
  118. float: left;
  119. margin-left: -15rpx;
  120. margin-top: -15rpx;
  121. }
  122. .rightP {
  123. float: right;
  124. margin-right: -15rpx;
  125. margin-top: -15rpx;
  126. }
  127. .secondView {
  128. padding: 30rpx 40rpx;
  129. }
  130. .same {
  131. font-size: 28rpx;
  132. color: #666666;
  133. }
  134. .thirdView {
  135. padding: 30rpx 40rpx;
  136. border: 1rpx #EEEEEE solid;
  137. }
  138. .thirdTitle {
  139. font-size: 32rpx;
  140. color: #333333;
  141. margin-bottom: 20rpx;
  142. }
  143. .store {
  144. display: flex;
  145. align-items: center;
  146. margin-bottom: 20rpx;
  147. }
  148. .grayPoint {
  149. width: 12rpx;
  150. height: 12rpx;
  151. border-radius: 6rpx;
  152. background-color: #DDDDDD;
  153. margin-right: 15rpx;
  154. }
  155. .itemContent{
  156. padding: 30rpx 40rpx;
  157. }
  158. </style>