ticket-item.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view class="ticket-item">
  3. <view class="ticket-item-content">
  4. <view class="ticket-tag zw-one-row" v-if="cardVal.categoryName">{{cardVal.categoryName}}</view>
  5. <view class="ticket-item-num">
  6. <text class="money"><text>¥</text>{{cardVal.couponAmount || 0}}</text>
  7. </view>
  8. <view class="ticket-item-info">
  9. <view class="info-item info-title">{{cardVal.cardTypeName}}</view>
  10. <view class="info-item info-val">使用地址:<text>{{cardVal.csmNameList}}</text> </view>
  11. <view class="info-item info-val">使用时间:<text>{{ cardVal.activeTime}} - {{cardVal.expireTime}}</text>
  12. </view>
  13. <view class="info-btn" v-if="cardVal.status === 'ACTIVED'" @click.stop="onUse(cardVal)">使用</view>
  14. <view class="info-btn info-invalid" v-if="cardVal.status === 'USED'">已使用</view>
  15. <view class="info-btn info-invalid" v-if="cardVal.status === 'EXPIRED'">已过期</view>
  16. </view>
  17. </view>
  18. <!-- <view class="ticket-explain">
  19. <view :class="['explain-text' , explainAll ? '' : 'zw-one-row common-text']">
  20. <rich-text :nodes="cardVal.useNotice"></rich-text>
  21. </view>
  22. <view class="iconfont-icon" @click.stop="explainAll = !explainAll">
  23. <text :class="['iconfont_yige' , explainAll ? 'show-explain' : 'hide-explain']">&#xe65f;</text>
  24. </view>
  25. </view> -->
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. props: {
  31. cardVal: {
  32. type: Object,
  33. default: null,
  34. require: true
  35. }
  36. },
  37. data() {
  38. return {
  39. explainAll: false
  40. }
  41. },
  42. methods: {
  43. onUse(card) {
  44. const data = {
  45. appletOriginalId: card.ymtcAppId,
  46. address: card.linkUrl
  47. };
  48. this.$openWXminiprogram(data, 0)
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .ticket-item {
  55. width: 100%;
  56. overflow: hidden;
  57. background: linear-gradient(0deg, #faedd5, #fef6eb 48%, #faedd5);
  58. border: 2rpx solid #fdd3ab;
  59. border-radius: 20rpx;
  60. padding: 0 24rpx;
  61. position: relative;
  62. .ticket-tag {
  63. position: absolute;
  64. left: 2rpx;
  65. top: 2rpx;
  66. min-width: 129rpx;
  67. max-width: calc(100% - 4rpx);
  68. height: 44rpx;
  69. padding: 5rpx 29rpx;
  70. background: #fa6037;
  71. border-radius: 18rpx 0px 18rpx 0px;
  72. text-align: center;
  73. line-height: 33rpx;
  74. font-size: 24rpx;
  75. font-family: PingFang SC, PingFang SC-Regular;
  76. font-weight: 400;
  77. color: #ffffff;
  78. }
  79. }
  80. .ticket-item-content {
  81. padding: 55rpx 0 22rpx;
  82. display: flex;
  83. align-items: stretch;
  84. justify-content: space-between;
  85. border-bottom: 1rpx dashed #ffcc9b;
  86. .ticket-item-num {
  87. width: 180rpx;
  88. display: flex;
  89. flex-direction: row;
  90. align-items: center;
  91. font-family: PingFang SC, PingFang SC-Bold;
  92. font-weight: 700;
  93. color: #e2403e;
  94. font-size: 44rpx;
  95. .money {
  96. display: flex;
  97. flex-direction: row;
  98. align-items: baseline;
  99. align-content: center;
  100. text {
  101. font-size: 32rpx;
  102. line-height: 38rpx;
  103. }
  104. }
  105. }
  106. .ticket-item-info {
  107. border-left: 1rpx dashed #ffcc9b;
  108. width: calc(100% - 180rpx);
  109. padding-left: 38rpx;
  110. .info-item {
  111. margin-bottom: 10rpx;
  112. }
  113. .info-title {
  114. font-size: 28rpx;
  115. font-weight: 500;
  116. color: #333333;
  117. line-height: 38rpx;
  118. }
  119. .info-val {
  120. font-size: 24rpx;
  121. font-family: PingFang SC, PingFang SC-Regular;
  122. font-weight: 400;
  123. color: #1a1a1a;
  124. line-height: 28rpx;
  125. text {
  126. color: #808080;
  127. }
  128. }
  129. .info-btn {
  130. margin-top: 20rpx;
  131. width: 141rpx;
  132. height: 56rpx;
  133. background: linear-gradient(180deg, #feb16c, #fa6137);
  134. border: 1rpx solid #fa6037;
  135. border-radius: 29rpx;
  136. font-size: 24rpx;
  137. line-height: 54rpx;
  138. font-family: PingFang SC, PingFang SC-Regular;
  139. font-weight: 400;
  140. text-align: center;
  141. color: #ffffff;
  142. }
  143. .info-invalid {
  144. background: #D1D1D1 !important;
  145. border-color: #D1D1D1;
  146. color: #333333;
  147. }
  148. }
  149. }
  150. .ticket-explain {
  151. width: 100%;
  152. min-height: 70rpx;
  153. padding: 20rpx 0;
  154. display: flex;
  155. flex-direction: row;
  156. justify-content: space-between;
  157. align-items: flex-start;
  158. .explain-text {
  159. width: calc(100% - 50rpx);
  160. font-size: 24rpx;
  161. font-family: PingFang SC, PingFang SC-Medium;
  162. font-weight: 500;
  163. color: #666666;
  164. line-height: 40rpx;
  165. }
  166. .common-text {
  167. /deep/ div {
  168. white-space: nowrap;
  169. overflow: hidden;
  170. text-overflow: ellipsis;
  171. display: -webkit-box;
  172. -webkit-line-clamp: 1;
  173. // -webkit-box-orient: vertical;
  174. }
  175. }
  176. .iconfont-icon {
  177. width: 50rpx;
  178. text-align: right;
  179. .iconfont_yige {
  180. display: inline-block;
  181. font-size: 30rpx;
  182. color: #666666;
  183. line-height: 40rpx;
  184. transition: transform .5s;
  185. }
  186. .hide-explain {
  187. transform: rotate(90deg);
  188. }
  189. .show-explain {
  190. transform: rotate(-90deg);
  191. }
  192. }
  193. }
  194. </style>