酒店桌布为微信小程序
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.

179 lines
3.3 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="page">
  3. <navbar/>
  4. <view class="category">
  5. <uv-vtabs
  6. :chain="chain"
  7. :list="category"
  8. height="1000px"
  9. :barItemBadgeStyle="{right:'20px',top:'12px'}"
  10. @change="change">
  11. <uv-vtabs-item>
  12. <view class="category-title">
  13. 租赁
  14. </view>
  15. <view class="list">
  16. <view class="item" v-for="(item,index) in list" :key="index">
  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. .category {
  112. font-size: 30rpx;
  113. color: #333;
  114. min-height: 100vh;
  115. .category-title{
  116. position: relative;
  117. display: flex;
  118. justify-content: center;
  119. align-items: center;
  120. height: 120rpx;
  121. &::before,
  122. &::after {
  123. position: absolute;
  124. top: 50%;
  125. content: '';
  126. width: 10%;
  127. border-top: 2rpx solid black;
  128. }
  129. &::before {
  130. left: 25%;
  131. }
  132. &::after {
  133. right: 25%;
  134. }
  135. }
  136. .list{
  137. display: flex;
  138. flex-wrap: wrap;
  139. margin: 0 auto;
  140. width: 490rpx;
  141. .item {
  142. padding: 10rpx 20rpx;
  143. display: flex;
  144. flex-direction: column;
  145. justify-content: center;
  146. align-items: center;
  147. margin-bottom: 20rpx;
  148. .item-image {
  149. width: 120rpx;
  150. height: 120rpx;
  151. image{
  152. height: 100%;
  153. width: 100%;
  154. border-radius: 50%;
  155. }
  156. }
  157. .item-unit {
  158. font-size: 24rpx;
  159. margin-top: 15rpx;
  160. color: #555;
  161. }
  162. }
  163. .gap {
  164. padding: 0 30rpx;
  165. }
  166. }
  167. }
  168. </style>