entrustList.vue 5.8 KB

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