entrustList.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. if (res.isSuccess) {
  67. if (res.data.list.length) {
  68. this.isOver = res.data.list.length != 10
  69. this.plantList = this.plantList.concat(res.data.list)
  70. this.entrustTotle = res.data.total
  71. } else {
  72. this.$refs.uTips.show({
  73. title: '当前无委托订单',
  74. type: 'warning',
  75. })
  76. }
  77. }
  78. }).catch(error => {
  79. this.$refs.uTips.show({
  80. title: '获取委托列表失败',
  81. type: 'warning',
  82. })
  83. })
  84. },
  85. // 跳转详情
  86. goToAdd() {
  87. uni.navigateTo({
  88. url: '/pagesMain/entrustForm?productId=' + this.productData.productId + '&tenantCode=' + this.productData.tenantCode +
  89. '&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize
  90. });
  91. },
  92. },
  93. }
  94. </script>
  95. <style lang="less" scoped>
  96. page {
  97. width: 100%;
  98. height: 100%;
  99. }
  100. .container {
  101. width: 100%;
  102. height: 100%;
  103. float: left;
  104. background-color: #f7f7f7;
  105. overflow-y: auto;
  106. position: relative;
  107. box-sizing: border-box;
  108. padding-bottom: 80px;
  109. .entrust-info {
  110. width: 100%;
  111. height: 115px;
  112. float: left;
  113. margin-bottom: -65px;
  114. background: #52A63A;
  115. border-radius: 0px 0px 20px 20px;
  116. .entrust-info-text {
  117. height: 50px;
  118. float: left;
  119. margin-left: 15px;
  120. font-size: 15px;
  121. font-family: PingFang SC;
  122. color: #FFFFFF;
  123. line-height: 50px;
  124. }
  125. }
  126. .entrust-row {
  127. width: calc(100% - 30px);
  128. float: left;
  129. background: #FFFFFF;
  130. border-radius: 10px;
  131. margin: 0 15px 15px 15px;
  132. padding-bottom: 12px;
  133. .entrust-title {
  134. width: 100%;
  135. height: 45px;
  136. float: left;
  137. border-bottom: 1px solid #EEEEEE;
  138. box-sizing: border-box;
  139. padding: 14px 15px;
  140. margin-bottom: 6px;
  141. .entrust-info-text {
  142. height: 16px;
  143. float: left;
  144. border-left: 2px solid #74BD60;
  145. padding-left: 6px;
  146. font-size: 15px;
  147. font-family: PingFang SC;
  148. line-height: 16px;
  149. color: #333333;
  150. }
  151. }
  152. .entrust-text {
  153. width: 100%;
  154. height: 24px;
  155. float: left;
  156. box-sizing: border-box;
  157. padding-left: 15px;
  158. font-size: 12px;
  159. font-family: PingFang SC;
  160. color: #333333;
  161. line-height: 24px;
  162. .entrust-price {
  163. color: #52A63A;
  164. }
  165. }
  166. }
  167. .entrust-handle {
  168. width: 100%;
  169. height: 80px;
  170. float: left;
  171. position: fixed;
  172. bottom: 0;
  173. box-sizing: border-box;
  174. padding: 20px 15px;
  175. .handle-custom {
  176. background-color: #52A63A;
  177. }
  178. }
  179. }
  180. </style>