商城类、订单类uniapp模板,多角色
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.

180 lines
3.4 KiB

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