index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <div class="home">
  3. <Nav>
  4. <template #title>
  5. <p>中国·龙江</p>
  6. <span>全球最大的家具材料产业集群</span>
  7. </template>
  8. </Nav>
  9. <main>
  10. <div class="swiper">
  11. <view class="uni-margin-wrap">
  12. <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="1500" :duration="500"
  13. indicator-color="#a0a0a0" indicator-active-color="#fff">
  14. <swiper-item>
  15. <view class="swiper-item uni-bg-red">
  16. <img src="../../../static/new-images/home/swiper.png" alt="">
  17. </view>
  18. </swiper-item>
  19. <swiper-item>
  20. <img src="../../../static/new-images/home/swiper.png" alt="">
  21. </swiper-item>
  22. <swiper-item>
  23. <img src="../../../static/new-images/home/swiper.png" alt="">
  24. </swiper-item>
  25. </swiper>
  26. </view>
  27. </div>
  28. <div class="find-container">
  29. <div class="find-top">
  30. <div class="find-item">
  31. <img src="../../../static/new-images/home/icon_1.png" alt="">
  32. <p>找布匹</p>
  33. </div>
  34. <div class="find-item">
  35. <img src="../../../static/new-images/home/icon_2.png" alt="">
  36. <p>找皮革</p>
  37. </div>
  38. <div class="find-item">
  39. <img src="../../../static/new-images/home/icon_3.png" alt="">
  40. <p>找配件</p>
  41. </div>
  42. <div class="find-item">
  43. <img src="../../../static/new-images/home/icon_4.png" alt="">
  44. <p>半成品</p>
  45. </div>
  46. </div>
  47. <div class="find-bottom">
  48. <div class="find-item">
  49. <img src="../../../static/new-images/home/icon_5.png" alt="">
  50. <p>找店铺</p>
  51. </div>
  52. <div class="find-item">
  53. <img src="../../../static/new-images/home/icon_6.png" alt="">
  54. <p>发快递</p>
  55. </div>
  56. <div class="find-item">
  57. <img src="../../../static/new-images/home/icon_7.png" alt="">
  58. <p>看报价</p>
  59. </div>
  60. <div class="find-item">
  61. <img src="../../../static/new-images/home/icon_8.png" alt="">
  62. <p>找更多</p>
  63. </div>
  64. </div>
  65. <div class="find-bottom"></div>
  66. </div>
  67. <div class="seek-advice">
  68. <p>
  69. <i>最近浏览</i>
  70. </p>
  71. <div class="over">
  72. <tui-roll-news :list="list" :interval="2500">
  73. </tui-roll-news>
  74. <!-- 人的一生要想活得幸福,走得更为长远,有一项能力必不可少,那就是感恩能力。卡耐基曾说过,感恩是极有教养的产物,你不可能从一般人身上得到,因为忘记或不会感谢乃是人的天性。 -->
  75. </div>
  76. <!-- <span>更多</span> -->
  77. </div>
  78. <div class="market">
  79. <div class="market-top">
  80. <div class="material">
  81. <p>材料</p>
  82. <span>行情</span>
  83. </div>
  84. <div class="percentage">
  85. <div class="item-box">
  86. <span>皮革</span>
  87. <div class="item">
  88. <span>0.03%</span>
  89. <p><tui-icon name="arrowup" size="12" color="#fff"></tui-icon></p>
  90. </div>
  91. </div>
  92. <p>5.6/m</p>
  93. </div>
  94. <div class="deal">
  95. <span>皮革成交额</span>
  96. <p>55889.6元</p>
  97. </div>
  98. </div>
  99. <div class="market-bottom">
  100. <div class="find-left">
  101. <div class="title">
  102. <span>找</span>
  103. <p>材料</p>
  104. <div class="img-box">
  105. 快速响应
  106. </div>
  107. </div>
  108. <div class="text">具材料网这里有符合 您所有的材料需求</div>
  109. <p>立即发布</p>
  110. </div>
  111. <div class="find-right">
  112. <div class="title">材料解答</div>
  113. <p>这里有家具材料材料专家为您解答材料问题</p>
  114. <span>发表问题</span>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="hotSales">
  119. <div class="title">
  120. <i>热销材料</i>
  121. </div>
  122. <div class="commodity-list">
  123. <div class="commodity-item" v-for="(item, index) in productList" :key="index" @click="goDetail(item)">
  124. <div class="img-box">
  125. <tui-lazyload-img width="100%" height="100%" radius="20rpx" :src="item.image || ''"
  126. mode="aspectFill"></tui-lazyload-img>
  127. </div>
  128. <div class="text-title">
  129. <div class="text-left">
  130. <p>工厂价</p>
  131. <span>直销</span>
  132. </div>
  133. <p>品牌</p>
  134. <p>{{ item.shopName }}</p>
  135. </div>
  136. <div class="detail-text">{{ item.productName }}</div>
  137. <div class="identifying">
  138. <span>七天无理由</span>
  139. <span>官方正品</span>
  140. </div>
  141. <div class="price">
  142. <p><span>¥</span>{{ item.originalPrice }}</p>
  143. <span>优惠价¥{{ item.price }}</span>
  144. </div>
  145. </div>
  146. </div>
  147. </div>
  148. </main>
  149. </div>
  150. </template>
  151. <script>
  152. import Nav from "../components/Nav.vue"
  153. import { getHotSalesGoods } from "../../../config/server/index";
  154. export default {
  155. components: {
  156. Nav
  157. },
  158. created() {
  159. this.getSelect()
  160. },
  161. data() {
  162. return {
  163. // 滚动的数据
  164. //list 数据
  165. list: [{
  166. id: 1,
  167. title: '151*****121用户正在浏览'
  168. }, {
  169. id: 2,
  170. title: '191*****057用户刚刚查看了此页面'
  171. }, {
  172. id: 3,
  173. title: '137*****526用户刚刚搜索了布匹'
  174. }],
  175. hotSearch: {
  176. page: 1,
  177. pageSize: 10,
  178. },
  179. productList: [],
  180. productListTotal: null
  181. }
  182. },
  183. methods: {
  184. async getSelect() {
  185. // this.hotSearch.page++
  186. let res = await getHotSalesGoods(this.hotSearch);
  187. this.productListTotal = res.data.total
  188. this.productList.push(...res.data.list)
  189. },
  190. // 去到详情
  191. goDetail(item) {
  192. console.log(item);
  193. uni.navigateTo({
  194. url: `/another-tf/another-serve/goodsDetails/index?shopId=${item.shopId}&productId=${item.productId}&skuId=${item.skuId}`,
  195. });
  196. },
  197. },
  198. // 触底加载
  199. onReachBottom() {
  200. if (this.productList.length >= this.productListTotal) return
  201. this.hotSearch.page++
  202. this.getSelect()
  203. }
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. @import './index.scss';
  208. </style>