artDetail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class="center">
  3. <view class="hotgoods">
  4. <view class="hotgoods-item" v-for="item in list" :key="item.id"
  5. @click="navto('/pages/product/product?id=' + item.id + '&isfg=1')" style="height: 520rpx;">
  6. <view class="image-wrapper">
  7. <image class="image" :src="item.image" mode="scaleToFill"></image>
  8. </view>
  9. <view class="flex"
  10. style="flex-direction: column;justify-content: space-between;align-items: flex-start;height: 170rpx;">
  11. <view class="title clamp2">{{item.store_name}}</view>
  12. <view class="hot-price">
  13. <view class="price">
  14. <text class="font-size-sm"></text>
  15. ¥{{ item.price * 1 }}
  16. </view>
  17. <view class="yuanPrice" v-if="item.ot_price*1 > item.price*1">¥{{ item.ot_price*1 }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <uni-load-more :status="loadingType"></uni-load-more>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. loadIndexs,
  28. groom1
  29. } from '@/api/index.js';
  30. export default {
  31. data() {
  32. return {
  33. id: '',
  34. list: [],
  35. page: 1,
  36. limit: 10,
  37. loadingType: 'more'
  38. };
  39. },
  40. onLoad() {
  41. this.loadData();
  42. },
  43. methods: {
  44. loadData() {
  45. this.loadingType = 'loading'
  46. groom1().then(res => {
  47. this.list = res.data.list
  48. this.loadingType = 'noMore'
  49. })
  50. },
  51. navto(url, type = 0) {
  52. if (type == 1) {
  53. if (!this.hasLogin) {
  54. // 保存地址
  55. saveUrl();
  56. // 登录拦截
  57. interceptor();
  58. } else {
  59. uni.navigateTo({
  60. url,
  61. fail() {
  62. uni.switchTab({
  63. url
  64. })
  65. }
  66. })
  67. }
  68. } else {
  69. uni.navigateTo({
  70. url,
  71. fail() {
  72. uni.switchTab({
  73. url
  74. })
  75. }
  76. })
  77. }
  78. },
  79. }
  80. };
  81. </script>
  82. <style lang="scss">
  83. .hotgoods {
  84. margin-top: 38rpx;
  85. width: 100%;
  86. display: flex;
  87. flex-wrap: wrap;
  88. padding: 0 20rpx 30rpx;
  89. justify-content: space-between;
  90. .hotgoods-item {
  91. width: 345rpx;
  92. background-color: #ffffff;
  93. border-radius: 12rpx;
  94. box-shadow: 0 0 15rpx rgba(0, 0, 0, 0.2);
  95. margin-bottom: 15rpx;
  96. .image-wrapper {
  97. width: 345rpx;
  98. height: 345rpx;
  99. border-radius: 3px;
  100. overflow: hidden;
  101. position: relative;
  102. .image-bg {
  103. position: absolute;
  104. top: 0;
  105. left: 0;
  106. right: 0;
  107. bottom: 0;
  108. width: 100%;
  109. height: 100%;
  110. opacity: 1;
  111. border-radius: 12rpx 12rpx 0 0;
  112. z-index: 2;
  113. }
  114. .image {
  115. width: 100%;
  116. height: 100%;
  117. opacity: 1;
  118. border-radius: 12rpx 12rpx 0 0;
  119. }
  120. }
  121. .title {
  122. margin-top: 24rpx;
  123. padding: 0 20rpx;
  124. font-size: 32rpx;
  125. font-weight: 500;
  126. color: #333333;
  127. }
  128. .hot-price {
  129. display: flex;
  130. justify-content: flex-start;
  131. align-items: center;
  132. // padding: 14rpx 0 30rpx;
  133. .hotPrice-box {
  134. padding: 2rpx 6rpx;
  135. background: linear-gradient(90deg, #c79a4c, #f9df7f);
  136. border-radius: 5rpx;
  137. text-align: center;
  138. line-height: 28rpx;
  139. font-size: 20rpx;
  140. font-family: Source Han Sans CN;
  141. font-weight: 400;
  142. color: #ffffff;
  143. }
  144. .price {
  145. margin-left: 10rpx;
  146. font-size: 40rpx;
  147. color: #ff0000;
  148. font-weight: 500;
  149. .jf {
  150. font-size: 20rpx;
  151. }
  152. }
  153. .yuanPrice {
  154. margin-left: 10rpx;
  155. font-size: 20rpx;
  156. font-family: PingFang SC;
  157. font-weight: 500;
  158. text-decoration: line-through;
  159. color: #999999;
  160. }
  161. .cart-icon {
  162. image {
  163. width: 44rpx;
  164. height: 44rpx;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. </style>