detail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view class="app-container">
  3. <div v-if="detail">
  4. <view class="title">兑换码</view>
  5. <view class="num">{{code}}</view>
  6. <view class="row">
  7. <view class="label">活动名称</view>
  8. <view class="value">{{detail.name}}</view>
  9. </view>
  10. <view class="row">
  11. <view class="label">奖品</view>
  12. <view class="value">{{detail.couponName}}</view>
  13. </view>
  14. <view class="row">
  15. <view class="label">活动有效期</view>
  16. <view class="value">{{detail.startTime | dateToYYmmdd}} 至 {{detail.endTime | dateToYYmmdd}}</view>
  17. </view>
  18. <view class="row">
  19. <view class="label">使用有效期</view>
  20. <view class="value">{{detail.useStartTime | dateToYYmmdd}} 至 {{detail.useEndTime | dateToYYmmdd}}</view>
  21. </view>
  22. <view class="row" v-if="detail.couponType == 'SATISFY'">
  23. <view class="label">使用条件</view>
  24. <view class="value">购物订单满 {{detail.orderLimitAmount}}元</view>
  25. </view>
  26. <view class="row">
  27. <view class="label">是否兑换</view>
  28. <view class="value">{{detail.status ? '是':'否'}}</view>
  29. </view>
  30. <view class="row">
  31. <view class="label">兑换时间</view>
  32. <view class="value">{{detail.userExchangeTime || '-'}}</view>
  33. </view>
  34. <view class="row">
  35. <view class="label">是否使用</view>
  36. <view class="value">{{detail.use ? '是':'否'}}</view>
  37. </view>
  38. <view class="row">
  39. <view class="label">使用时间</view>
  40. <view class="value">{{detail.useTime || '-'}}</view>
  41. </view>
  42. <view class="row">
  43. <view class="label">使用说明</view>
  44. <view class="value">{{detail.useRemark || '-'}}</view>
  45. </view>
  46. <view class="row">
  47. <view class="label">活动说明</view>
  48. <view class="value">{{detail.remark || '-'}}</view>
  49. </view>
  50. </div>
  51. <view class="btn-container" v-if="type == 1">
  52. <view class="btn" @tap="backPage">继续兑换</view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. type: null,
  61. code: null,
  62. detail: null,
  63. }
  64. },
  65. onLoad({type, code}) {
  66. this.type = type;
  67. this.code = code;
  68. this.getDetail();
  69. },
  70. methods: {
  71. getDetail() {
  72. this.$axios({
  73. url: '/promotion/luck/draw/detail',
  74. method: 'post',
  75. params: {
  76. code: this.code
  77. }
  78. }).then(res => {
  79. this.detail = res.data;
  80. })
  81. },
  82. backPage() {
  83. uni.navigateBack({
  84. delta: 1
  85. });
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .app-container {
  92. display: flex;
  93. flex-direction: column;
  94. padding: 30rpx 30rpx 140rpx;
  95. box-sizing: border-box;
  96. .title {
  97. font-size: 32rpx;
  98. color: #999999;
  99. }
  100. .num {
  101. border: 1px solid #eaeaea;
  102. height: 80rpx;
  103. line-height: 80rpx;
  104. padding: 0 30rpx;
  105. text-align: center;
  106. font-size: 36rpx;
  107. margin-top: 12rpx;
  108. font-weight: 600;
  109. }
  110. .row {
  111. display: flex;
  112. justify-content: space-between;
  113. margin-top: 25rpx;
  114. .label {
  115. color: #999999;
  116. flex-shrink: 0;
  117. width: 160rpx;
  118. }
  119. .value {
  120. color: #333333;
  121. }
  122. }
  123. }
  124. .btn-container {
  125. position: fixed;
  126. bottom: 0;
  127. left: 0;
  128. width: 100%;
  129. background: #ffffff;
  130. padding: 20rpx;
  131. box-sizing: border-box;
  132. z-index: 99;
  133. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .3), 0 2px 5px 0 rgba(0, 0, 0, .3);
  134. .btn {
  135. height: 80rpx;
  136. width: 100%;
  137. text-align: center;
  138. line-height: 80rpx;
  139. border-radius: 80rpx;
  140. background: #FF3F42;
  141. font-size: 30rpx;
  142. color: #ffffff;
  143. }
  144. }
  145. </style>