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

163 lines
3.3 KiB

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