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

143 lines
2.9 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <scroll-view scroll-y="true" :style="{height: height}" @scrolltolower="more">
  3. <view v-if="commodityList.length">
  4. <view v-for="(item, index) in commodityList" :key="index" class="address-item">
  5. <view class="itme1" @click="selectSp(item)">
  6. <view class="left">
  7. <image src="https://img95.699pic.com/photo/50058/1378.jpg_wh860.jpg" mode="aspectFill"/>
  8. </view>
  9. <view class="center">
  10. <view>{{ item.title }}</view>
  11. <view>{{ item.smallTitle }}</view>
  12. <view>起租时间2024.03.02</view>
  13. </view>
  14. <view class="right">×{{item.total}}</view>
  15. </view>
  16. <uv-line></uv-line>
  17. </view>
  18. </view>
  19. <view style="padding: 100rpx 0;" v-else>
  20. <uv-empty mode="history" textSize="28rpx" iconSize="100rpx" />
  21. </view>
  22. </scroll-view>
  23. </template>
  24. <script>
  25. export default {
  26. props: {
  27. height: {
  28. default: 'calc(90vh - 180rpx)'
  29. }
  30. },
  31. data() {
  32. return {
  33. total: 0,
  34. commodityList: [
  35. {
  36. title: '商品名称',
  37. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  38. total: 1,
  39. },
  40. {
  41. title: '商品名称1',
  42. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  43. total: 1,
  44. },
  45. {
  46. title: '商品名称2',
  47. smallTitle: '产品规格:120*4*75【桌子尺寸】',
  48. total: 1,
  49. }
  50. ],
  51. queryParams: {
  52. pageNo: 1,
  53. pageSize: 10,
  54. },
  55. }
  56. },
  57. methods: {
  58. // 选择了商品
  59. selectSp(e) {
  60. this.$emit('selectSp', e)
  61. },
  62. //获取租赁列表
  63. getList() {
  64. return new Promise((success, fail) => {
  65. this.$api('getLeasePage', this.queryParams, res => {
  66. if (res.code == 200) {
  67. this.commodityList = res.result.records || [];
  68. this.total = res.result.total || 0;
  69. success(res.result)
  70. }
  71. })
  72. })
  73. },
  74. // 加载更多
  75. more(){
  76. if(this.queryParams.pageSize > this.total){
  77. return
  78. }
  79. this.queryParams.pageSize += 10
  80. this.getList()
  81. },
  82. }
  83. }
  84. </script>
  85. <style scoped lang="scss">
  86. .itme1 {
  87. display: flex;
  88. width: 100vw;
  89. background-color: #ffffff;
  90. .left {
  91. padding: 20rpx;
  92. width: 150rpx;
  93. height: 150rpx;
  94. border-radius: 20rpx;
  95. background-color: #ffffff;
  96. flex-shrink: 0;
  97. image{
  98. width: 100%;
  99. height: 100%;
  100. border-radius: 20rpx;
  101. }
  102. }
  103. .center {
  104. display: flex;
  105. flex-direction: column;
  106. justify-content: center;
  107. gap: 20rpx;
  108. width: 60%;
  109. padding: 0rpx 0 0 20rpx;
  110. background-color: #ffffff;
  111. // 给第一个 view 设置样式
  112. >view:first-of-type {
  113. font-size: 34rpx;
  114. color: #333;
  115. }
  116. // 给第二个 view 设置样式
  117. >view:nth-of-type(2) {
  118. font-size: 26rpx;
  119. color: #666666;
  120. }
  121. // 给第二个 view 设置样式
  122. >view:nth-of-type(3) {
  123. font-size: 26rpx;
  124. color: #666666;
  125. }
  126. }
  127. .right {
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. width: 10%;
  132. color: #666666;
  133. background-color: #ffffff;
  134. }
  135. }
  136. </style>