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

184 lines
3.4 KiB

2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month 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
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months 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
2 months ago
2 months ago
2 months 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
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="cardList">
  3. <view class="content" >
  4. <view class="left">
  5. <image :src="images[0]" mode="aspectFill">
  6. </view>
  7. <view class="right">
  8. <view class="detailed">
  9. <view class="title">{{item.title}}</view>
  10. <view class="date">{{item.createTime}}</view>
  11. <view class="address">{{item.address}}</view>
  12. </view>
  13. <view class="price" v-if="showBottom">
  14. <view class="num-box">{{ item.doNum }}/{{ item.num }}</view>
  15. <view class="btn-box" @click="qiandaoClick">开始签到</view>
  16. <!-- <view class="btn-box jieshu-btn" v-else>已结束</view> -->
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. item: {
  26. type: Object,
  27. default: {}
  28. },
  29. showBottom : {
  30. default : false,
  31. },
  32. },
  33. data() {
  34. return {
  35. };
  36. },
  37. components: {
  38. },
  39. computed: {
  40. images(){
  41. return this.item.image ? this.item
  42. .image.split(','): []
  43. },
  44. },
  45. watch: {
  46. },
  47. created() {
  48. },
  49. mounted() {},
  50. methods: {
  51. qiandaoClick() {
  52. this.$emit('qiandaoClick')
  53. }
  54. }
  55. };
  56. </script>
  57. <style scoped lang="scss">
  58. .cardList {
  59. .content {
  60. display: flex;
  61. padding: 24rpx 35rpx;
  62. background: #1B1713;
  63. border-radius: 20rpx;
  64. margin-bottom: 20rpx;
  65. .left {
  66. width: 228rpx;
  67. height: 228rpx;
  68. border-radius: 20rpx;
  69. overflow: hidden;
  70. flex-shrink: 0;
  71. image {
  72. width: 100%;
  73. height: 100%;
  74. }
  75. }
  76. .right {
  77. display: flex;
  78. flex-direction: column;
  79. justify-content: space-between;
  80. flex: 1;
  81. margin-left: 26rpx;
  82. color: $uni-text-color-grey;
  83. font-size: 24rpx;
  84. width: 320rpx;
  85. .detailed {
  86. .title {
  87. font-size: 32rpx;
  88. color: #fff;
  89. padding-top: 11rpx;
  90. overflow:hidden; //超出的文本隐藏
  91. text-overflow:ellipsis; //溢出用省略号显示
  92. white-space:nowrap; //溢出不换行
  93. }
  94. .date {
  95. padding: 25rpx 0 19rpx;
  96. display: flex;
  97. align-items: center;
  98. &::before {
  99. content: '';
  100. display: block;
  101. background: url('@/static/image/cart/timeIcon.png') no-repeat;
  102. background-size: 100% 100%;
  103. width: 24rpx;
  104. height: 24rpx;
  105. margin-right: 10rpx;
  106. }
  107. }
  108. .address {
  109. display: flex;
  110. align-items: center;
  111. &::before {
  112. content: '';
  113. display: block;
  114. background: url('@/static/image/cart/addressIcon.png') no-repeat;
  115. background-size: 100% 100%;
  116. width: 22rpx;
  117. height: 26rpx;
  118. margin-right: 10rpx;
  119. }
  120. }
  121. }
  122. .price {
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. margin-top: 10rpx;
  127. .num-box {
  128. font-size: 27rpx;
  129. color: #fff;
  130. }
  131. .btn-box {
  132. width: 180rpx;
  133. height: 54rpx;
  134. background: url('@/static/image/member/btn-2.png') no-repeat;
  135. background-size: 100% 100%;
  136. font-weight: 500;
  137. font-size: 23rpx;
  138. color: #FFFFFF;
  139. text-align: center;
  140. line-height: 54rpx;
  141. border-radius: 30rpx;
  142. }
  143. .jieshu-btn {
  144. background: #666666;
  145. }
  146. }
  147. }
  148. }
  149. .button-sp-area {
  150. text-align: right;
  151. padding-top: 20rpx;
  152. .mini-btn {
  153. width: 166rpx;
  154. height: 53rpx;
  155. line-height: 53rpx;
  156. font-size: 24rpx;
  157. border-radius: 50rpx;
  158. margin-left: 20rpx;
  159. background-color: #34312E;
  160. color: #AFAFAF;
  161. }
  162. }
  163. }
  164. .active {
  165. color: $uni-color-primary !important;
  166. }
  167. </style>