goods.vue 4.0 KB

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