entrustList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <scroll-view class="container" :style="{backgroundColor: entrustTotle ? '#f7f7f7' : '#f7f7f7'}" 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">备注信息:{{item.remarks}}</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.pageIndex = 1
  49. this.entrustList = []
  50. this.getEntrustList()
  51. },
  52. onPullDownRefresh() {
  53. this.pageIndex = 1
  54. this.entrustList = []
  55. this.getEntrustList('refresh')
  56. },
  57. methods: {
  58. // 懒加载
  59. handleLoadMore() {
  60. if (!this.isOver) {
  61. this.pageIndex++
  62. this.getEntrustList()
  63. }
  64. },
  65. // 获取委托
  66. getEntrustList(refresh) {
  67. NET.request(API.getEvaluateList, {
  68. productId: this.productData.productId,
  69. pageIndex: this.pageIndex,
  70. pageSize: 10,
  71. }, 'POST').then(res => {
  72. if (refresh == 'refresh') {
  73. uni.stopPullDownRefresh();
  74. }
  75. if (res.isSuccess) {
  76. if (res.data.list.length) {
  77. this.isOver = res.data.list.length != 10
  78. this.entrustList = this.entrustList.concat(res.data.list)
  79. this.entrustTotle = res.data.total
  80. }
  81. // else {
  82. // this.$refs.uTips.show({
  83. // title: '当前无委托订单',
  84. // type: 'warning',
  85. // })
  86. // }
  87. }
  88. }).catch(error => {
  89. this.$refs.uTips.show({
  90. title: '获取委托列表失败',
  91. type: 'warning',
  92. })
  93. })
  94. },
  95. // 跳转详情
  96. goToAdd() {
  97. uni.navigateTo({
  98. url: '/pagesMain/entrustForm?productId=' + this.productData.productId + '&tenantCode=' + this.productData.tenantCode +
  99. '&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize
  100. });
  101. },
  102. },
  103. }
  104. </script>
  105. <style>
  106. page {
  107. background-color: #f7f7f7;
  108. }
  109. </style>
  110. <style lang="less" scoped>
  111. page {
  112. width: 100%;
  113. height: 100%;
  114. }
  115. .container {
  116. width: 100%;
  117. // height: 100%;
  118. height: 100vh;
  119. float: left;
  120. background-color: #f7f7f7;
  121. // background-color: #FFFFFF;
  122. overflow-y: auto;
  123. position: relative;
  124. box-sizing: border-box;
  125. padding-bottom: 80px;
  126. .entrust-info {
  127. width: 100%;
  128. height: 115px;
  129. float: left;
  130. margin-bottom: -65px;
  131. background: #52A63A;
  132. border-radius: 0px 0px 20px 20px;
  133. .entrust-info-text {
  134. height: 50px;
  135. float: left;
  136. margin-left: 15px;
  137. font-size: 15px;
  138. font-family: PingFang SC;
  139. color: #FFFFFF;
  140. line-height: 50px;
  141. }
  142. }
  143. .entrust-row {
  144. width: calc(100% - 30px);
  145. float: left;
  146. background: #FFFFFF;
  147. border-radius: 10px;
  148. margin: 0 15px 15px 15px;
  149. padding-bottom: 12px;
  150. .entrust-title {
  151. width: 100%;
  152. height: 45px;
  153. float: left;
  154. border-bottom: 1px solid #EEEEEE;
  155. box-sizing: border-box;
  156. padding: 14px 15px;
  157. margin-bottom: 6px;
  158. .entrust-info-text {
  159. height: 16px;
  160. float: left;
  161. border-left: 2px solid #74BD60;
  162. padding-left: 6px;
  163. font-size: 15px;
  164. font-family: PingFang SC;
  165. line-height: 16px;
  166. color: #333333;
  167. }
  168. }
  169. .entrust-text {
  170. width: 100%;
  171. height: 24px;
  172. float: left;
  173. box-sizing: border-box;
  174. padding-left: 15px;
  175. font-size: 12px;
  176. font-family: PingFang SC;
  177. color: #333333;
  178. line-height: 24px;
  179. .entrust-price {
  180. color: #52A63A;
  181. }
  182. }
  183. }
  184. .entrust-handle {
  185. width: 100%;
  186. height: 80px;
  187. float: left;
  188. position: fixed;
  189. bottom: 0;
  190. box-sizing: border-box;
  191. padding: 20px 15px;
  192. .handle-custom {
  193. background-color: #56a83a;
  194. /deep/button {
  195. background-color: #56a83a;
  196. }
  197. /deep/.u-btn--success--disabled {
  198. background-color: #74bd60 !important;
  199. }
  200. }
  201. }
  202. }
  203. </style>