entrustList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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">备注信息:{{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 lang="less" scoped>
  106. page {
  107. width: 100%;
  108. height: 100%;
  109. }
  110. .container {
  111. width: 100%;
  112. height: 100%;
  113. float: left;
  114. background-color: #f7f7f7;
  115. // background-color: #FFFFFF;
  116. overflow-y: auto;
  117. position: relative;
  118. box-sizing: border-box;
  119. padding-bottom: 80px;
  120. .entrust-info {
  121. width: 100%;
  122. height: 115px;
  123. float: left;
  124. margin-bottom: -65px;
  125. background: #52A63A;
  126. border-radius: 0px 0px 20px 20px;
  127. .entrust-info-text {
  128. height: 50px;
  129. float: left;
  130. margin-left: 15px;
  131. font-size: 15px;
  132. font-family: PingFang SC;
  133. color: #FFFFFF;
  134. line-height: 50px;
  135. }
  136. }
  137. .entrust-row {
  138. width: calc(100% - 30px);
  139. float: left;
  140. background: #FFFFFF;
  141. border-radius: 10px;
  142. margin: 0 15px 15px 15px;
  143. padding-bottom: 12px;
  144. .entrust-title {
  145. width: 100%;
  146. height: 45px;
  147. float: left;
  148. border-bottom: 1px solid #EEEEEE;
  149. box-sizing: border-box;
  150. padding: 14px 15px;
  151. margin-bottom: 6px;
  152. .entrust-info-text {
  153. height: 16px;
  154. float: left;
  155. border-left: 2px solid #74BD60;
  156. padding-left: 6px;
  157. font-size: 15px;
  158. font-family: PingFang SC;
  159. line-height: 16px;
  160. color: #333333;
  161. }
  162. }
  163. .entrust-text {
  164. width: 100%;
  165. height: 24px;
  166. float: left;
  167. box-sizing: border-box;
  168. padding-left: 15px;
  169. font-size: 12px;
  170. font-family: PingFang SC;
  171. color: #333333;
  172. line-height: 24px;
  173. .entrust-price {
  174. color: #52A63A;
  175. }
  176. }
  177. }
  178. .entrust-handle {
  179. width: 100%;
  180. height: 80px;
  181. float: left;
  182. position: fixed;
  183. bottom: 0;
  184. box-sizing: border-box;
  185. padding: 20px 15px;
  186. .handle-custom {
  187. background-color: #52A63A;
  188. }
  189. }
  190. }
  191. </style>