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

126 lines
2.5 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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="item.goodsPic" mode="aspectFill"/>
  8. </view>
  9. <view class="center">
  10. <view>{{ item.goodsName }}</view>
  11. <view>规格:{{ item.sku }}</view>
  12. <view>下单时间:{{item.startTime}}</view>
  13. </view>
  14. <view class="right">×{{item.num}}</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. queryParams: {
  36. pageNo: 1,
  37. pageSize: 10,
  38. },
  39. }
  40. },
  41. methods: {
  42. // 选择了商品
  43. selectSp(e) {
  44. this.$emit('selectSp', e)
  45. },
  46. //获取租赁列表
  47. getList() {
  48. return new Promise((success, fail) => {
  49. this.$api('getLeasePage', this.queryParams, res => {
  50. if (res.code == 200) {
  51. this.commodityList = res.result.records || [];
  52. this.total = res.result.total || 0;
  53. success(res.result)
  54. }
  55. })
  56. })
  57. },
  58. // 加载更多
  59. more(){
  60. if(this.queryParams.pageSize > this.total){
  61. return
  62. }
  63. this.queryParams.pageSize += 10
  64. this.getList()
  65. },
  66. }
  67. }
  68. </script>
  69. <style scoped lang="scss">
  70. .itme1 {
  71. display: flex;
  72. width: 100vw;
  73. background-color: #ffffff;
  74. .left {
  75. padding: 20rpx;
  76. width: 150rpx;
  77. height: 150rpx;
  78. border-radius: 20rpx;
  79. background-color: #ffffff;
  80. flex-shrink: 0;
  81. image{
  82. width: 100%;
  83. height: 100%;
  84. border-radius: 20rpx;
  85. }
  86. }
  87. .center {
  88. display: flex;
  89. flex-direction: column;
  90. justify-content: center;
  91. gap: 20rpx;
  92. width: 60%;
  93. padding: 0rpx 0 0 20rpx;
  94. background-color: #ffffff;
  95. // 给第一个 view 设置样式
  96. >view:first-of-type {
  97. font-size: 34rpx;
  98. color: #333;
  99. }
  100. // 给第二个 view 设置样式
  101. >view:nth-of-type(2) {
  102. font-size: 26rpx;
  103. color: #666666;
  104. }
  105. // 给第二个 view 设置样式
  106. >view:nth-of-type(3) {
  107. font-size: 26rpx;
  108. color: #666666;
  109. }
  110. }
  111. .right {
  112. display: flex;
  113. justify-content: center;
  114. align-items: center;
  115. width: 10%;
  116. color: #666666;
  117. background-color: #ffffff;
  118. }
  119. }
  120. </style>