entrustList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <scroll-view class="container" :style="{backgroundColor: entrustTotle ? '#f7f7f7' : '#f7f7f7'}" scroll-y="true" @scrolltolower="handleLoadMore()">
  3. <view class="entrust-info" :style="{height: entrustTotle ? '115px' : '60px'}">
  4. <view class="entrust-info-text">共{{entrustTotle}}个委托订单</view>
  5. </view>
  6. <view v-if="!entrustTotle" class="no-cart">
  7. <image class="no-cart-img" src="../static/images/noCart.png" mode="aspectFill"></image>
  8. <text class="no-cart-text">暂无订单</text>
  9. </view>
  10. <view v-if="entrustTotle" class="entrust-row" v-for="(item, index) in entrustList" :key="index">
  11. <view class="entrust-title">已委托订单</view>
  12. <view class="entrust-text">委托开始时间:{{item.entrustStartTime}}</view>
  13. <view class="entrust-text">委托时长:{{item.entrustDurationTime}}小时</view>
  14. <view class="entrust-text">委托金额:
  15. <text class="entrust-price">¥{{item.payAomount}}</text>
  16. </view>
  17. <view class="entrust-text">备注信息:{{item.remarks}}</view>
  18. </view>
  19. <view class="entrust-handle">
  20. <u-button type="success" shape="circle" :ripple="true" @click="goToAdd()" class="handle-custom">发布委托</u-button>
  21. </view>
  22. <u-top-tips ref="uTips"></u-top-tips>
  23. </scroll-view>
  24. </template>
  25. <script>
  26. const NET = require('@/utils/request')
  27. const API = require('@/config/api')
  28. export default {
  29. data() {
  30. return {
  31. productData: {
  32. productId: '',
  33. productName: '',
  34. tenantCode: '',
  35. areaSize: '',
  36. },
  37. pageIndex: 1,
  38. isOver: false,
  39. entrustList: [],
  40. entrustTotle: 0,
  41. orderId: ''
  42. }
  43. },
  44. onLoad(options) {
  45. this.productData = {
  46. productId: options.productId,
  47. productName: options.productName,
  48. tenantCode: options.tenantCode,
  49. areaSize: options.areaSize,
  50. }
  51. this.orderId = options.orderId
  52. },
  53. onShow() {
  54. this.pageIndex = 1
  55. this.entrustList = []
  56. this.getEntrustList()
  57. },
  58. onPullDownRefresh() {
  59. this.pageIndex = 1
  60. this.entrustList = []
  61. this.getEntrustList('refresh')
  62. },
  63. methods: {
  64. // 懒加载
  65. handleLoadMore() {
  66. if (!this.isOver) {
  67. this.pageIndex++
  68. this.getEntrustList()
  69. }
  70. },
  71. // 获取委托
  72. getEntrustList(refresh) {
  73. NET.request(API.getEvaluateList, {
  74. productId: this.productData.productId,
  75. pageIndex: this.pageIndex,
  76. pageSize: 10,
  77. }, 'POST').then(res => {
  78. if (refresh == 'refresh') {
  79. uni.stopPullDownRefresh();
  80. }
  81. if (res.isSuccess) {
  82. if (res.data.list.length) {
  83. this.isOver = res.data.list.length != 10
  84. this.entrustList = this.entrustList.concat(res.data.list)
  85. this.entrustTotle = res.data.total
  86. }
  87. // else {
  88. // this.$refs.uTips.show({
  89. // title: '当前无委托订单',
  90. // type: 'warning',
  91. // })
  92. // }
  93. }
  94. }).catch(error => {
  95. this.$refs.uTips.show({
  96. title: '获取委托列表失败',
  97. type: 'warning',
  98. })
  99. })
  100. },
  101. // 跳转详情
  102. goToAdd() {
  103. uni.navigateTo({
  104. url: '/pagesMain/entrustForm?productId=' + this.productData.productId + '&tenantCode=' + this.productData.tenantCode +
  105. '&productName=' + this.productData.productName + '&areaSize=' + this.productData.areaSize + '&orderId=' + this.orderId
  106. });
  107. },
  108. },
  109. }
  110. </script>
  111. <style>
  112. page {
  113. background-color: #f7f7f7;
  114. }
  115. </style>
  116. <style lang="less" scoped>
  117. page {
  118. width: 100%;
  119. height: 100%;
  120. }
  121. .container {
  122. width: 100%;
  123. // height: 100%;
  124. height: 100vh;
  125. float: left;
  126. background-color: #f7f7f7;
  127. // background-color: #FFFFFF;
  128. overflow-y: auto;
  129. position: relative;
  130. box-sizing: border-box;
  131. padding-bottom: 80px;
  132. .entrust-info {
  133. width: 100%;
  134. height: 115px;
  135. float: left;
  136. margin-bottom: -65px;
  137. background: #52A63A;
  138. border-radius: 0px 0px 20px 20px;
  139. .entrust-info-text {
  140. height: 50px;
  141. float: left;
  142. margin-left: 15px;
  143. font-size: 15px;
  144. font-family: PingFang SC;
  145. color: #FFFFFF;
  146. line-height: 50px;
  147. }
  148. }
  149. .no-cart {
  150. display: flex;
  151. flex-direction: column;
  152. justify-content: center;
  153. align-items: center;
  154. top: 25%;
  155. left:30%;
  156. position: absolute;
  157. .no-cart-img {
  158. width: 155px;
  159. height: 200px;
  160. margin-bottom: 20px;
  161. }
  162. .no-cart-text {
  163. font-size: 16px;
  164. font-family: PingFang SC;
  165. color: #999999;
  166. }
  167. .button1 {
  168. /deep/button {
  169. background-color: #ffffff !important;
  170. border: 1px solid #74bd60 !important;
  171. color: #74bd60 !important;
  172. }
  173. width: 40%;
  174. height: 34px;
  175. }
  176. }
  177. .entrust-row {
  178. width: calc(100% - 30px);
  179. float: left;
  180. background: #FFFFFF;
  181. border-radius: 10px;
  182. margin: 0 15px 15px 15px;
  183. padding-bottom: 12px;
  184. .entrust-title {
  185. width: 100%;
  186. height: 45px;
  187. float: left;
  188. border-bottom: 1px solid #EEEEEE;
  189. box-sizing: border-box;
  190. padding: 14px 15px;
  191. margin-bottom: 6px;
  192. .entrust-info-text {
  193. height: 16px;
  194. float: left;
  195. border-left: 2px solid #74BD60;
  196. padding-left: 6px;
  197. font-size: 15px;
  198. font-family: PingFang SC;
  199. line-height: 16px;
  200. color: #333333;
  201. }
  202. }
  203. .entrust-text {
  204. width: 100%;
  205. height: 24px;
  206. float: left;
  207. box-sizing: border-box;
  208. padding-left: 15px;
  209. font-size: 12px;
  210. font-family: PingFang SC;
  211. color: #333333;
  212. line-height: 24px;
  213. .entrust-price {
  214. color: #52A63A;
  215. }
  216. }
  217. }
  218. .entrust-handle {
  219. width: 100%;
  220. height: 80px;
  221. float: left;
  222. position: fixed;
  223. bottom: 0;
  224. box-sizing: border-box;
  225. padding: 20px 15px;
  226. .handle-custom {
  227. background-color: #56a83a;
  228. /deep/button {
  229. background-color: #56a83a;
  230. }
  231. /deep/.u-btn--success--disabled {
  232. background-color: #74bd60 !important;
  233. }
  234. }
  235. }
  236. }
  237. </style>