poolDev.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="home">
  3. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay">
  4. <swiper-item v-for="(item,index) in banner" :key="index">
  5. <image class="swiper-item" :src="item" mode=""></image>
  6. </swiper-item>
  7. </swiper>
  8. <view class="home-goods">
  9. <view v-for="(item,index) in dataList" :key="index" class="data-list" @click="goDoods(item)">
  10. <image class="thumb" :src="item.thumb" mode=""></image>
  11. <view class="name">{{item.name}}</view>
  12. <view class="money">¥{{item.money}}</view>
  13. </view>
  14. </view>
  15. <view class="no_data" v-if="dataList.length<=0 && !nodata">暂无数据~</view>
  16. <view class="no_data" v-if="nodata">暂无更多~</view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import {
  21. ref,
  22. reactive,
  23. onMounted,
  24. unref,
  25. computed,
  26. watch
  27. } from 'vue';
  28. import {
  29. onLoad,
  30. onReady,
  31. onShow,
  32. onReachBottom
  33. } from '@dcloudio/uni-app';
  34. import home1 from '/static/images/home/home1.png';
  35. const banner = ref([
  36. 'https://img13.360buyimg.com/pcpubliccms/jfs/t1/311461/32/1002/135580/68257980F8aaf636f/ae851f75de6f780b.jpg.avif',
  37. 'https://img10.360buyimg.com/pcpubliccms/s1440x1440_jfs/t1/101458/36/44450/126805/64effce2Fddbe98e2/8156dc6f322774fe.jpg.avif'
  38. ])
  39. const indicatorDots = ref(true)
  40. const autoplay = ref(true)
  41. const dataList = ref([{
  42. thumb: 'https://img13.360buyimg.com/pcpubliccms/jfs/t1/311461/32/1002/135580/68257980F8aaf636f/ae851f75de6f780b.jpg.avif',
  43. name: '英雄(HERO)【新年礼物】钢笔 382商务办公学生日常书写铱金签字墨水礼盒装 黑色明尖',
  44. money: '59.00',
  45. id: 0
  46. },
  47. {
  48. thumb: 'https://img10.360buyimg.com/pcpubliccms/s1440x1440_jfs/t1/235865/8/9679/129991/658bb2a5F0800a0c3/b844166dee370361.jpg.avif',
  49. name: '法拉蒙笔记本本子A5加厚记事本商务羊巴皮面复古笔记本文具工作日记本会议记录本办公文具可',
  50. money: '8.50',
  51. id: 1
  52. },
  53. {
  54. thumb: 'https://img10.360buyimg.com/pcpubliccms/s1440x1440_jfs/t1/101458/36/44450/126805/64effce2Fddbe98e2/8156dc6f322774fe.jpg.avif',
  55. name: 'ujia 国潮笔记本子礼盒套装故宫国风文创记事本伴手礼教师节礼物送老师企业可定制 两件套礼盒',
  56. money: '80.00',
  57. id: 2
  58. },
  59. {
  60. thumb: 'https://img10.360buyimg.com/pcpubliccms/s1440x1440_jfs/t1/253778/26/26667/91830/67c12cffFba1bcd79/2d2111f16c6d867c.jpg.avif',
  61. name: '晨光(M&G)文具 故宫金榜题名学生文具礼盒套装15件套 中性笔钢笔涂卡铅笔考试送礼HAGP1694马年礼礼盒',
  62. money: '99.00',
  63. id: 3
  64. }
  65. ])
  66. const nodata = ref(false)
  67. const httpobj = ref({
  68. page: 1,
  69. limit: 10
  70. })
  71. onLoad((res) => {});
  72. const goDoods = (row) => {
  73. uni.navigateTo({
  74. url: '/pages/goodsInfo/goodsInfo?id=' + row.id,
  75. });
  76. }
  77. </script>
  78. <style scoped>
  79. .home .swiper {
  80. width: 750rpx;
  81. height: 400rpx;
  82. }
  83. .home .swiper-item {
  84. width: 750rpx;
  85. height: 400rpx;
  86. }
  87. .home .home-goods {
  88. width: 750rpx;
  89. margin-top: 25rpx;
  90. padding: 0 30rpx;
  91. display: flex;
  92. flex-wrap: wrap;
  93. gap: 30rpx 20rpx;
  94. }
  95. .home .data-list {
  96. width: 335rpx;
  97. background-color: #ffffff;
  98. border-radius: 20rpx;
  99. overflow: hidden;
  100. padding-bottom: 20rpx;
  101. }
  102. .home .thumb {
  103. width: 335rpx;
  104. height: 336rpx;
  105. }
  106. .home .name {
  107. font-size: 28rpx;
  108. color: #1D2129;
  109. padding: 10rpx 15rpx;
  110. }
  111. .home .money {
  112. font-weight: bold;
  113. font-size: 30rpx;
  114. color: #B38E58;
  115. padding: 0rpx 15rpx;
  116. }
  117. </style>