vip.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="center">
  3. <view class="list-box-h">
  4. <view v-for="(item, index) in dataList" :key="index" class="guess-item" @click="navToDetailPage(item)">
  5. <image :src="item.image"></image>
  6. <view class="guess-box">
  7. <view class="title clamp2">
  8. {{ item.store_name }}
  9. </view>
  10. <view class="price-box flex">
  11. <view class="yuanprice">{{ item.ot_price }}</view>
  12. <!-- <image src="../../static/img/jiantou.png" mode=""></image>
  13. <view class="jiang">直降{{ (item.vip_price - item.price).toFixed(2) }}元</view> -->
  14. </view>
  15. <view class="price">¥{{ item.price }}</view>
  16. <view class="btn">立即购买</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import { getProducts } from '@/api/product.js'
  24. export default {
  25. data(){
  26. return {
  27. dataList:[],
  28. }
  29. },
  30. onLoad() {
  31. this.loadData();
  32. },
  33. methods:{
  34. loadData(){
  35. getProducts({sid:47,page:1,limit: 1000}).then(({data}) =>{
  36. this.dataList = data;
  37. })
  38. },
  39. //详情页
  40. navToDetailPage(item) {
  41. let id = item.id;
  42. uni.navigateTo({
  43. url: '/pages/product/product?id=' + id
  44. });
  45. }
  46. }
  47. }
  48. </script>
  49. <style lang="scss">
  50. page,
  51. .center {
  52. height: auto;
  53. min-height: 100%;
  54. background-color: #ffffff;
  55. }
  56. .guess-item {
  57. display: flex;
  58. width: 710rpx;
  59. height: 290rpx;
  60. background: #ffffff;
  61. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  62. border-radius: 10rpx;
  63. padding: 15rpx;
  64. padding-bottom: 150rpx;
  65. margin: 20rpx auto 0;
  66. position: relative;
  67. image {
  68. width: 260rpx;
  69. height: 260rpx;
  70. border-radius: 10rpx;
  71. }
  72. .guess-box {
  73. padding: 12rpx 0 0 24rpx;
  74. width: 436rpx;
  75. .title {
  76. font-size: 30rpx;
  77. padding-left: 4rpx;
  78. font-family: PingFang SC;
  79. font-weight: 500;
  80. color: #333333;
  81. width: 368rpx;
  82. line-height: 36rpx;
  83. .tuanF {
  84. display: inline-block;
  85. margin-right: 4rpx;
  86. position: relative;
  87. top: -6rpx;
  88. .tuan {
  89. display: flex;
  90. align-items: center;
  91. padding: 10rpx;
  92. height: 36rpx;
  93. background: #ffebe9;
  94. border-radius: 18rpx;
  95. .tuan-image {
  96. width: 18rpx;
  97. height: 18rpx;
  98. }
  99. .tuan-font {
  100. display: inline;
  101. font-size: 20rpx;
  102. font-family: PingFang SC;
  103. font-weight: 500;
  104. color: #ff1135;
  105. margin-left: 2rpx;
  106. }
  107. }
  108. }
  109. }
  110. .ping-box {
  111. margin-top: 15rpx;
  112. justify-content: flex-start;
  113. .ping {
  114. margin-left: 10rpx;
  115. height: 39rpx;
  116. background: #fdf7eb;
  117. border-radius: 5rpx;
  118. font-size: 22rpx;
  119. font-family: PingFang SC;
  120. font-weight: 500;
  121. color: #ff911f;
  122. display: flex;
  123. align-items: center;
  124. padding: 0 10rpx;
  125. }
  126. }
  127. .price-box {
  128. margin-top: 80rpx;
  129. justify-content: flex-start;
  130. .yuanprice {
  131. font-size: 26rpx;
  132. font-family: PingFang SC;
  133. font-weight: 500;
  134. text-decoration: line-through;
  135. color: #999999;
  136. padding-right: 6rpx;
  137. }
  138. image {
  139. width: 14rpx;
  140. height: 16rpx;
  141. }
  142. .jiang {
  143. padding-left: 2rpx;
  144. font-size: 24rpx;
  145. font-family: PingFang SC;
  146. font-weight: bold;
  147. color: #b59467;
  148. }
  149. }
  150. .price {
  151. font-size: 36rpx;
  152. font-family: PingFang SC;
  153. font-weight: bold;
  154. color: #ff1135;
  155. }
  156. .btn {
  157. width: 137rpx;
  158. height: 56rpx;
  159. background: #16CC9F;
  160. border-radius: 28rpx;
  161. font-size: 28rpx;
  162. font-family: PingFang SC;
  163. font-weight: 500;
  164. color: #FFFFFF;
  165. line-height: 56rpx;
  166. text-align: center;
  167. position: absolute;
  168. bottom: 25rpx;
  169. right: 25rpx;
  170. }
  171. }
  172. }
  173. </style>