entrustList.vue 4.4 KB

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