瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
4.5 KiB

2 months ago
  1. <template>
  2. <view class="cardList">
  3. <view class="container"
  4. @click="toDetail(item)"
  5. v-for="(item, index) in cardListData" :key="index">
  6. <view class="content" :class="['U','S'].includes(item.state) ? 'content_border' : ''">
  7. <view class="left">
  8. <image :src="item.image && item.image.split(',')[0]" mode="aspectFill">
  9. </view>
  10. <view class="right">
  11. <view class="detailed">
  12. <view class="title">{{item.title}}</view>
  13. <view class="date">{{ $dayjs(item.startTime).format('YYYY-MM-DD') }}</view>
  14. <view class="address">{{item.address}}</view>
  15. </view>
  16. <view class="price">
  17. <view class="num-box">{{item.num || 0}}/{{item.sum || 0}}</view>
  18. <view class="btn-box" v-if="item.state == 0">立即报名</view>
  19. <view class="btn-box btn-box2" v-if="item.state == 1">已结束</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. props: {
  29. cardListData: {
  30. type: Array,
  31. default: []
  32. },
  33. },
  34. data() {
  35. return {
  36. };
  37. },
  38. components: {
  39. },
  40. computed: {},
  41. watch: {
  42. },
  43. created() {
  44. },
  45. mounted() {},
  46. methods: {
  47. skip(val) {
  48. uni.navigateTo({
  49. url: '/pages_order/orderDetails'
  50. })
  51. },
  52. toDetail({ id, ntype }) {
  53. if(ntype == 1){
  54. uni.navigateTo({
  55. url:`/pages_order/lvyou-detail?travelId=${id}`
  56. })
  57. return
  58. }
  59. uni.navigateTo({
  60. url:`/pages_order/huodong-detail?activityId=${id}`
  61. })
  62. }
  63. }
  64. };
  65. </script>
  66. <style scoped lang="scss">
  67. .cardList {
  68. position: relative;
  69. z-index: 9;
  70. .container {
  71. margin-top: 31rpx;
  72. padding: 25rpx 0;
  73. border-radius: 20rpx;
  74. background: #1B1713;
  75. .content_border {
  76. border-bottom: 1px solid #2A2A2A;
  77. }
  78. .content {
  79. display: flex;
  80. padding: 24rpx 35rpx;
  81. .left {
  82. width: 228rpx;
  83. height: 228rpx;
  84. border-radius: 20rpx;
  85. overflow: hidden;
  86. image {
  87. width: 100%;
  88. height: 100%;
  89. }
  90. }
  91. .right {
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: space-between;
  95. flex: 1;
  96. margin-left: 26rpx;
  97. color: $uni-text-color-grey;
  98. font-size: 24rpx;
  99. .detailed {
  100. .title {
  101. font-size: 32rpx;
  102. color: #fff;
  103. padding-top: 11rpx;
  104. width: 380rpx;
  105. // overflow:hidden; //超出的文本隐藏
  106. // text-overflow:ellipsis; //溢出用省略号显示
  107. // white-space:nowrap; //溢出不换行
  108. overflow: hidden;
  109. text-overflow: ellipsis;
  110. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  111. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  112. -webkit-line-clamp:2; //显示的行
  113. }
  114. .date {
  115. padding: 25rpx 0 19rpx;
  116. display: flex;
  117. align-items: center;
  118. &::before {
  119. content: '';
  120. display: block;
  121. background: url('@/static/image/cart/timeIcon.png') no-repeat;
  122. background-size: 100% 100%;
  123. width: 24rpx;
  124. height: 24rpx;
  125. margin-right: 10rpx;
  126. }
  127. }
  128. .address {
  129. display: flex;
  130. align-items: center;
  131. width: 360rpx;
  132. overflow:hidden; //超出的文本隐藏
  133. text-overflow:ellipsis; //溢出用省略号显示
  134. white-space:nowrap; //溢出不换行
  135. &::before {
  136. content: '';
  137. display: block;
  138. background: url('@/static/image/cart/addressIcon.png') no-repeat;
  139. background-size: 100% 100%;
  140. width: 22rpx;
  141. height: 26rpx;
  142. margin-right: 10rpx;
  143. flex-shrink: 0;
  144. }
  145. }
  146. }
  147. .price {
  148. display: flex;
  149. align-items: center;
  150. justify-content: space-between;
  151. padding-top: 25rpx;
  152. .num-box {
  153. font-size: 27rpx;
  154. color: #fff;
  155. }
  156. .btn-box {
  157. width: 180rpx;
  158. height: 54rpx;
  159. background: url('@/static/image/member/btn-2.png') no-repeat;
  160. background-size: 100% 100%;
  161. font-weight: 500;
  162. font-size: 23rpx;
  163. color: #FFFFFF;
  164. text-align: center;
  165. line-height: 54rpx;
  166. }
  167. .btn-box2 {
  168. background: #34312E;
  169. color: #AFAFAF;
  170. border-radius: 60rpx;
  171. }
  172. }
  173. }
  174. }
  175. .button-sp-area {
  176. text-align: right;
  177. padding-top: 20rpx;
  178. .mini-btn {
  179. width: 166rpx;
  180. height: 53rpx;
  181. line-height: 53rpx;
  182. font-size: 24rpx;
  183. border-radius: 50rpx;
  184. margin-left: 20rpx;
  185. background-color: #34312E;
  186. color: #AFAFAF;
  187. }
  188. }
  189. }
  190. }
  191. .active {
  192. color: $uni-color-primary !important;
  193. }
  194. </style>