entrustList.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. float: left;
  119. background-color: #f7f7f7;
  120. // background-color: #FFFFFF;
  121. overflow-y: auto;
  122. position: relative;
  123. box-sizing: border-box;
  124. padding-bottom: 80px;
  125. .entrust-info {
  126. width: 100%;
  127. height: 115px;
  128. float: left;
  129. margin-bottom: -65px;
  130. background: #52A63A;
  131. border-radius: 0px 0px 20px 20px;
  132. .entrust-info-text {
  133. height: 50px;
  134. float: left;
  135. margin-left: 15px;
  136. font-size: 15px;
  137. font-family: PingFang SC;
  138. color: #FFFFFF;
  139. line-height: 50px;
  140. }
  141. }
  142. .entrust-row {
  143. width: calc(100% - 30px);
  144. float: left;
  145. background: #FFFFFF;
  146. border-radius: 10px;
  147. margin: 0 15px 15px 15px;
  148. padding-bottom: 12px;
  149. .entrust-title {
  150. width: 100%;
  151. height: 45px;
  152. float: left;
  153. border-bottom: 1px solid #EEEEEE;
  154. box-sizing: border-box;
  155. padding: 14px 15px;
  156. margin-bottom: 6px;
  157. .entrust-info-text {
  158. height: 16px;
  159. float: left;
  160. border-left: 2px solid #74BD60;
  161. padding-left: 6px;
  162. font-size: 15px;
  163. font-family: PingFang SC;
  164. line-height: 16px;
  165. color: #333333;
  166. }
  167. }
  168. .entrust-text {
  169. width: 100%;
  170. height: 24px;
  171. float: left;
  172. box-sizing: border-box;
  173. padding-left: 15px;
  174. font-size: 12px;
  175. font-family: PingFang SC;
  176. color: #333333;
  177. line-height: 24px;
  178. .entrust-price {
  179. color: #52A63A;
  180. }
  181. }
  182. }
  183. .entrust-handle {
  184. width: 100%;
  185. height: 80px;
  186. float: left;
  187. position: fixed;
  188. bottom: 0;
  189. box-sizing: border-box;
  190. padding: 20px 15px;
  191. .handle-custom {
  192. background-color: #56a83a;
  193. /deep/button {
  194. background-color: #56a83a;
  195. }
  196. /deep/.u-btn--success--disabled {
  197. background-color: #74bd60 !important;
  198. }
  199. }
  200. }
  201. }
  202. </style>