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

189 lines
3.8 KiB

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