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

178 lines
3.3 KiB

6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
4 months ago
6 months ago
6 months ago
4 months ago
5 months ago
5 months ago
6 months ago
5 months ago
4 months ago
5 months ago
4 months ago
5 months ago
4 months ago
6 months ago
5 months ago
4 months ago
5 months ago
6 months ago
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. :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 productList" :key="index"
  16. @click="$utils.navigateTo('/pages_order/product/productDetail?id=' + item.id)">
  17. <view class="item-image">
  18. <image
  19. :src="item.pic"
  20. mode="aspectFill"></image>
  21. </view>
  22. <view class="item-unit">
  23. <text class="text">{{item.name}}</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. import { mapState } from 'vuex'
  36. export default {
  37. components: {
  38. tabber,
  39. },
  40. data() {
  41. return {
  42. // category: [],
  43. queryParams: {
  44. pageNo: 1,
  45. pageSize: 10,
  46. },
  47. list : {
  48. records : [],
  49. total : 0,
  50. },
  51. chain: false,
  52. categoryIndex: 0
  53. }
  54. },
  55. computed: {
  56. productList(){
  57. return this.category.length ? this.category[this.categoryIndex].hotelGoodsList || [] : []
  58. },
  59. ...mapState(['category']),
  60. },
  61. onShow() {
  62. // this.categoryList()
  63. },
  64. //滚动到屏幕底部
  65. // onReachBottom() {
  66. // if(this.queryParams.pageSize < this.list.total){
  67. // this.queryParams.pageSize += 10
  68. // this.getGoodsPage()
  69. // }
  70. // },
  71. onReady() {
  72. },
  73. methods: {
  74. categoryList(){
  75. this.$api('categoryList', res => {
  76. if(res.code == 200){
  77. this.category = res.result
  78. this.getGoodsPage()
  79. }
  80. })
  81. },
  82. // getGoodsPage(){
  83. // this.$api('goodsPage', {
  84. // ...this.queryParams,
  85. // categoryId : this.category[this.categoryIndex].id
  86. // }, res => {
  87. // if(res.code == 200){
  88. // this.list = res.result
  89. // }
  90. // })
  91. // },
  92. change(index) {
  93. this.categoryIndex = index;
  94. // this.queryParams.pageSize = 10
  95. // this.getGoodsPage()
  96. },
  97. }
  98. }
  99. </script>
  100. <style scoped lang="scss">
  101. .page{
  102. /deep/ .uv-vtabs{
  103. height: calc(100vh - 360rpx) !important;
  104. }
  105. /deep/ .uv-vtabs__bar{
  106. height: calc(100vh - 360rpx) !important;
  107. }
  108. /deep/ .uv-vtabs__content{
  109. height: calc(100vh - 360rpx) !important;
  110. }
  111. }
  112. .category {
  113. font-size: 30rpx;
  114. color: #333;
  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>