推广小程序前端代码
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.

208 lines
4.4 KiB

2 months ago
1 month ago
2 months ago
3 weeks ago
2 months ago
3 weeks ago
2 months ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
3 weeks ago
2 months ago
1 month ago
3 weeks ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
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.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}}/{{item.sum}}</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 }) {
  53. uni.navigateTo({
  54. url:`/pages_order/huodong-detail?activityId=${id}`
  55. })
  56. }
  57. }
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. .cardList {
  62. position: relative;
  63. z-index: 9;
  64. .container {
  65. margin-top: 31rpx;
  66. padding: 25rpx 0;
  67. border-radius: 20rpx;
  68. background: #1B1713;
  69. .content_border {
  70. border-bottom: 1px solid #2A2A2A;
  71. }
  72. .content {
  73. display: flex;
  74. padding: 24rpx 35rpx;
  75. .left {
  76. width: 228rpx;
  77. height: 228rpx;
  78. border-radius: 20rpx;
  79. overflow: hidden;
  80. image {
  81. width: 100%;
  82. height: 100%;
  83. }
  84. }
  85. .right {
  86. display: flex;
  87. flex-direction: column;
  88. justify-content: space-between;
  89. flex: 1;
  90. margin-left: 26rpx;
  91. color: $uni-text-color-grey;
  92. font-size: 24rpx;
  93. .detailed {
  94. .title {
  95. font-size: 32rpx;
  96. color: #fff;
  97. padding-top: 11rpx;
  98. width: 380rpx;
  99. // overflow:hidden; //超出的文本隐藏
  100. // text-overflow:ellipsis; //溢出用省略号显示
  101. // white-space:nowrap; //溢出不换行
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. display:-webkit-box; //作为弹性伸缩盒子模型显示。
  105. -webkit-box-orient:vertical; //设置伸缩盒子的子元素排列方式--从上到下垂直排列
  106. -webkit-line-clamp:2; //显示的行
  107. }
  108. .date {
  109. padding: 25rpx 0 19rpx;
  110. display: flex;
  111. align-items: center;
  112. &::before {
  113. content: '';
  114. display: block;
  115. background: url('@/static/image/cart/timeIcon.png') no-repeat;
  116. background-size: 100% 100%;
  117. width: 24rpx;
  118. height: 24rpx;
  119. margin-right: 10rpx;
  120. }
  121. }
  122. .address {
  123. display: flex;
  124. align-items: center;
  125. width: 360rpx;
  126. overflow:hidden; //超出的文本隐藏
  127. text-overflow:ellipsis; //溢出用省略号显示
  128. white-space:nowrap; //溢出不换行
  129. &::before {
  130. content: '';
  131. display: block;
  132. background: url('@/static/image/cart/addressIcon.png') no-repeat;
  133. background-size: 100% 100%;
  134. width: 22rpx;
  135. height: 26rpx;
  136. margin-right: 10rpx;
  137. flex-shrink: 0;
  138. }
  139. }
  140. }
  141. .price {
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. padding-top: 25rpx;
  146. .num-box {
  147. font-size: 27rpx;
  148. color: #fff;
  149. }
  150. .btn-box {
  151. width: 180rpx;
  152. height: 54rpx;
  153. background: url('@/static/image/member/btn-2.png') no-repeat;
  154. background-size: 100% 100%;
  155. font-weight: 500;
  156. font-size: 23rpx;
  157. color: #FFFFFF;
  158. text-align: center;
  159. line-height: 54rpx;
  160. }
  161. .btn-box2 {
  162. background: #34312E;
  163. color: #AFAFAF;
  164. border-radius: 60rpx;
  165. }
  166. }
  167. }
  168. }
  169. .button-sp-area {
  170. text-align: right;
  171. padding-top: 20rpx;
  172. .mini-btn {
  173. width: 166rpx;
  174. height: 53rpx;
  175. line-height: 53rpx;
  176. font-size: 24rpx;
  177. border-radius: 50rpx;
  178. margin-left: 20rpx;
  179. background-color: #34312E;
  180. color: #AFAFAF;
  181. }
  182. }
  183. }
  184. }
  185. .active {
  186. color: $uni-color-primary !important;
  187. }
  188. </style>