entrustList.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <scroll-view class="container" scroll-y="true" @scrolltolower="handleLoadMore()">
  3. <view class="entrust-info">
  4. <view class="entrust-info-text">共{{entrustTotle}}个委托订单</view>
  5. </view>
  6. <view class="entrust-row" v-for="(item, index) in entrustList" :key="index">
  7. <view class="entrust-title">已委托订单</view>
  8. <view class="entrust-text">委托开始时间:{{item.entrustStartTime}}</view>
  9. <view class="entrust-text">委托时长:{{item.entrustDurationTime}}小时</view>
  10. <view class="entrust-text">委托金额:
  11. <text class="entrust-price">¥{{item.payAomount}}</text>
  12. </view>
  13. <view class="entrust-text">备注信息:</view>
  14. </view>
  15. <view class="entrust-handle">
  16. <u-button type="success" shape="circle" :ripple="true" @click="goToAdd()" class="handle-custom">发布委托</u-button>
  17. </view>
  18. <u-top-tips ref="uTips"></u-top-tips>
  19. </scroll-view>
  20. </template>
  21. <script>
  22. const NET = require('@/utils/request')
  23. const API = require('@/config/api')
  24. export default {
  25. data() {
  26. return {
  27. productData: {
  28. productId: '',
  29. productName: '',
  30. tenantCode: '',
  31. areaSize: '',
  32. },
  33. pageIndex: 1,
  34. isOver: false,
  35. entrustList: [],
  36. entrustTotle: 0,
  37. }
  38. },
  39. onLoad(options) {
  40. this.productData = {
  41. productId: options.productId,
  42. productName: options.productName,
  43. tenantCode: options.tenantCode,
  44. areaSize: options.areaSize,
  45. }
  46. },
  47. onShow() {
  48. this.entrustList = []
  49. this.getEntrustList()
  50. },
  51. methods: {
  52. // 懒加载
  53. handleLoadMore() {
  54. if (!this.isOver) {
  55. this.pageIndex++
  56. this.getEntrustList()
  57. }
  58. },
  59. // 获取委托
  60. getEntrustList() {
  61. NET.request(API.getEvaluateList, {
  62. productId: this.productData.productId,
  63. pageIndex: this.pageIndex,
  64. pageSize: 10,
  65. }, 'POST').then(res => {
  66. this.isOver = res.data.list.length != 10
  67. this.plantList = this.plantList.concat(res.data.list)
  68. this.entrustTotle = res.data.total
  69. }).catch(error => {
  70. this.$refs.uTips.show({
  71. title: '获取委托列表失败',
  72. type: 'warning',
  73. })
  74. })
  75. },
  76. // 跳转详情
  77. goToAdd() {
  78. uni.navigateTo({
  79. url: '/pagesMain/entrustForm?productId=' + this.productData.productId + '&tenantCode=' + this.productData.tenantCode +
  80. '&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize
  81. });
  82. },
  83. },
  84. }
  85. </script>
  86. <style lang="less" scoped>
  87. page {
  88. width: 100%;
  89. height: 100%;
  90. }
  91. .container {
  92. width: 100%;
  93. height: 100%;
  94. float: left;
  95. background-color: #f7f7f7;
  96. overflow-y: auto;
  97. position: relative;
  98. box-sizing: border-box;
  99. padding-bottom: 80px;
  100. .entrust-info {
  101. width: 100%;
  102. height: 115px;
  103. float: left;
  104. margin-bottom: -65px;
  105. background: #52A63A;
  106. border-radius: 0px 0px 20px 20px;
  107. .entrust-info-text {
  108. height: 50px;
  109. float: left;
  110. margin-left: 15px;
  111. font-size: 15px;
  112. font-family: PingFang SC;
  113. color: #FFFFFF;
  114. line-height: 50px;
  115. }
  116. }
  117. .entrust-row {
  118. width: calc(100% - 30px);
  119. float: left;
  120. background: #FFFFFF;
  121. border-radius: 10px;
  122. margin: 0 15px 15px 15px;
  123. padding-bottom: 12px;
  124. .entrust-title {
  125. width: 100%;
  126. height: 45px;
  127. float: left;
  128. border-bottom: 1px solid #EEEEEE;
  129. box-sizing: border-box;
  130. padding: 14px 15px;
  131. margin-bottom: 6px;
  132. .entrust-info-text {
  133. height: 16px;
  134. float: left;
  135. border-left: 2px solid #74BD60;
  136. padding-left: 6px;
  137. font-size: 15px;
  138. font-family: PingFang SC;
  139. line-height: 16px;
  140. color: #333333;
  141. }
  142. }
  143. .entrust-text {
  144. width: 100%;
  145. height: 24px;
  146. float: left;
  147. box-sizing: border-box;
  148. padding-left: 15px;
  149. font-size: 12px;
  150. font-family: PingFang SC;
  151. color: #333333;
  152. line-height: 24px;
  153. .entrust-price {
  154. color: #52A63A;
  155. }
  156. }
  157. }
  158. .entrust-handle {
  159. width: 100%;
  160. height: 80px;
  161. float: left;
  162. position: fixed;
  163. bottom: 0;
  164. box-sizing: border-box;
  165. padding: 20px 15px;
  166. .handle-custom {
  167. background-color: #52A63A;
  168. }
  169. }
  170. }
  171. </style>