goods.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view >
  3. <view class="recommend-info" style="background-image: -webkit-gradient(linear, 0 0, 0 bottom, from(#ffffff), to(#f1f1f1))">
  4. <view class="goods-list">
  5. <view class="list" v-for="(item,index) in goodsList" :key="index">
  6. <view class="pictrue">
  7. <image :src="item.image" mode="heightFix"></image>
  8. </view>
  9. <view class="title-tag">
  10. <view class="tag">
  11. {{item.name}}
  12. </view>
  13. </view>
  14. <view class="price-info">
  15. <view class="user-price">
  16. <text class="min">¥</text>
  17. <text class="max">{{item.cashValue}}/{{item.equalPoints}}积分</text>
  18. </view>
  19. </view>
  20. <view class="bottom">
  21. <button class="cu-btn round text-white theme-bg-color" style="width: 140upx;height: 50upx;" @click="navTap(item.id)">兑换</button>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. props:{
  31. goodsList: {
  32. type: Array,
  33. default: () => {
  34. return []
  35. }
  36. },
  37. activityId: {
  38. type: String,
  39. default: '',
  40. }
  41. },
  42. data() {
  43. return {
  44. }
  45. },
  46. methods: {
  47. navTap(id) {
  48. uni.navigateTo({
  49. url:"/pages/activityList/goods/detail?id=" + id + "&activityId=" + this.activityId
  50. })
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. /* 为你推荐 */
  57. .recommend-info{
  58. padding-top: 30rpx;
  59. width: 100%;
  60. .recommend-title{
  61. display: flex;
  62. align-items: center;
  63. justify-content: center;
  64. width: 100%;
  65. height: 100rpx;
  66. .title{
  67. display: flex;
  68. align-items: center;
  69. image{
  70. width: 416rpx;
  71. height: 40rpx;
  72. }
  73. }
  74. }
  75. .goods-list{
  76. display: flex;
  77. flex-wrap: wrap;
  78. justify-content: space-between;
  79. padding: 0 30rpx;
  80. .list{
  81. width: 49%;
  82. height: 510rpx;
  83. margin-bottom: 20rpx;
  84. background-color: #FFFFFF;
  85. border-radius: 10rpx;
  86. overflow: hidden;
  87. .pictrue{
  88. display: flex;
  89. justify-content: center;
  90. width: 100%;
  91. image{
  92. height: 320rpx;
  93. }
  94. }
  95. .title-tag{
  96. // display: flex;
  97. height: 70rpx;
  98. padding: 20rpx;
  99. .tag{
  100. float: left;
  101. margin-right: 10rpx;
  102. overflow: hidden;
  103. text-overflow: ellipsis;
  104. display: -webkit-box;
  105. -webkit-line-clamp: 2;
  106. -webkit-box-orient: vertical;
  107. white-space: normal;
  108. font-size: 26rpx;
  109. line-height: 40rpx;
  110. text{
  111. font-size: 24rpx;
  112. color: #FFFFFF;
  113. padding: 4rpx 16rpx;
  114. background: #fe3f11;
  115. border-radius: 6rpx;
  116. margin-right: 10rpx;
  117. }
  118. }
  119. }
  120. .price-info{
  121. display: flex;
  122. flex-wrap: wrap;
  123. align-items: center;
  124. justify-content: start;
  125. padding: 0 20rpx;
  126. height: 50rpx;
  127. .user-price{
  128. display: flex;
  129. align-items: center;
  130. text{
  131. color: #ff587f;
  132. }
  133. .min{
  134. font-size: 24rpx;
  135. }
  136. .max{
  137. font-size: 32rpx;
  138. }
  139. }
  140. .vip-price{
  141. padding-left: 20rpx;
  142. display: flex;
  143. align-items: center;
  144. image{
  145. width: 26rpx;
  146. height: 26rpx;
  147. margin-right: 10rpx;
  148. }
  149. text{
  150. text-decoration: line-through;
  151. color: #8c8c8c;
  152. font-size: 24rpx;
  153. }
  154. }
  155. }
  156. .bottom{
  157. margin: 10rpx 0;
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. }
  162. }
  163. }
  164. }
  165. </style>