建材商城系统20241014
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
3.6 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="page">
  3. <navbar bgColor="#DC2828"/>
  4. <view class="category">
  5. <uv-vtabs
  6. :chain="chain"
  7. :list="category"
  8. :barItemBadgeStyle="{right:'20px',top:'12px'}"
  9. @change="change">
  10. <uv-vtabs-item>
  11. <view class="category-title">
  12. 租赁
  13. </view>
  14. <view class="list">
  15. <view class="item" v-for="(item,index) in list" :key="index"
  16. @click="$utils.navigateTo('/pages_order/product/productDetail?id=123')">
  17. <view class="item-image">
  18. <image
  19. :src="item.image"
  20. mode="aspectFill"></image>
  21. </view>
  22. <view class="item-unit">
  23. <text class="text">{{item.unit}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </uv-vtabs-item>
  28. </uv-vtabs>
  29. </view>
  30. <tabber select="1" />
  31. </view>
  32. </template>
  33. <script>
  34. import tabber from '@/components/base/tabbar.vue'
  35. export default {
  36. components: {
  37. tabber,
  38. },
  39. data() {
  40. return {
  41. category: [
  42. {
  43. name : '桌布'
  44. },
  45. {
  46. name : '桌布'
  47. },
  48. {
  49. name : '桌布'
  50. },
  51. ],
  52. list : [
  53. {
  54. unit : '100*50*60',
  55. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  56. },
  57. {
  58. unit : '100*50*60',
  59. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  60. },
  61. {
  62. unit : '100*50*60',
  63. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  64. },
  65. {
  66. unit : '100*50*60',
  67. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  68. },
  69. {
  70. unit : '100*50*60',
  71. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  72. },
  73. {
  74. unit : '100*50*60',
  75. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  76. },
  77. {
  78. unit : '100*50*60',
  79. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  80. },
  81. {
  82. unit : '100*50*60',
  83. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  84. },
  85. {
  86. unit : '100*50*60',
  87. image : 'https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg',
  88. },
  89. ],
  90. chain: false,
  91. value: 0
  92. }
  93. },
  94. computed: {
  95. list2() {
  96. const _list = this.list[this.value]?.childrens;
  97. return _list ? _list : [];
  98. }
  99. },
  100. onReady() {
  101. },
  102. methods: {
  103. change(index) {
  104. console.log('选项改变:', index)
  105. this.value = index;
  106. }
  107. }
  108. }
  109. </script>
  110. <style scoped lang="scss">
  111. .page{
  112. /deep/ .uv-vtabs{
  113. height: calc(100vh - 360rpx) !important;
  114. }
  115. /deep/ .uv-vtabs__bar{
  116. height: calc(100vh - 360rpx) !important;
  117. }
  118. /deep/ .uv-vtabs__content{
  119. height: calc(100vh - 360rpx) !important;
  120. }
  121. }
  122. .category {
  123. font-size: 30rpx;
  124. color: #333;
  125. .category-title{
  126. position: relative;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. height: 120rpx;
  131. &::before,
  132. &::after {
  133. position: absolute;
  134. top: 50%;
  135. content: '';
  136. width: 10%;
  137. border-top: 2rpx solid black;
  138. }
  139. &::before {
  140. left: 25%;
  141. }
  142. &::after {
  143. right: 25%;
  144. }
  145. }
  146. .list{
  147. display: flex;
  148. flex-wrap: wrap;
  149. margin: 0 auto;
  150. width: 490rpx;
  151. .item {
  152. padding: 10rpx 20rpx;
  153. display: flex;
  154. flex-direction: column;
  155. justify-content: center;
  156. align-items: center;
  157. margin-bottom: 20rpx;
  158. .item-image {
  159. width: 120rpx;
  160. height: 120rpx;
  161. image{
  162. height: 100%;
  163. width: 100%;
  164. border-radius: 50%;
  165. }
  166. }
  167. .item-unit {
  168. font-size: 24rpx;
  169. margin-top: 15rpx;
  170. color: #555;
  171. }
  172. }
  173. .gap {
  174. padding: 0 30rpx;
  175. }
  176. }
  177. }
  178. </style>