entrustList.vue 4.9 KB

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