contractList.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view>
  3. <u-navbar title="租户余额管理" title-color="#101010"></u-navbar>
  4. <view class="head-head">
  5. <u-search placeholder="请输入关键字" :show-action="false" v-model="keyword"></u-search>
  6. </view>
  7. <view class="head-head-placeholder ">
  8. </view>
  9. <view class="main">
  10. <view class="tenant" v-for="(tenant,i) in tenantList"
  11. v-show="keyword==''||(tenant.name&&tenant.name.indexOf(keyword)!=-1)"
  12. :key="i" >
  13. <view class="tenant-name">
  14. {{tenant.name}}
  15. </view>
  16. <view class="balance">
  17. <view class="title">
  18. <view class="icon">
  19. <image class="img" src="@/assets/img/wallet@3x.png" mode=""></image>
  20. </view>
  21. <view class="text">
  22. 账户余额
  23. <span class="state" v-if="tenant.balance<0">已欠费</span>
  24. </view>
  25. </view>
  26. <view class="balance-number">
  27. <view class="number" :class="{
  28. number2:tenant.balance<0
  29. }" >
  30. {{tenant.balance}}元
  31. </view>
  32. </view>
  33. </view>
  34. <view>
  35. <view class="deadline" v-for="(obj,i) in tenant.tenantContractList" :key="i">
  36. <view class="deadline-item" v-for="(item,i) in obj.contractItemList" :key="i" v-if="item.paymentMethod==1" >
  37. <view class="item-icon">
  38. <image class="img" v-if="item.name.indexOf('水')>-1" src="@/assets/img/deadline2.png" mode=""></image>
  39. <image class="img" v-else-if="item.name.indexOf('房')>-1||item.name.indexOf('租')>-1" src="@/assets/img/deadline1.png" mode=""></image>
  40. <image class="img" v-else-if="item.name.indexOf('保洁')>-1" src="@/assets/img/deadline4.png" mode=""></image>
  41. <image class="img" v-else-if="item.name.indexOf('物业')>-1" src="@/assets/img/deadline3.png" mode=""></image>
  42. <image class="img" v-else src="@/assets/img/deadline3.png" mode=""></image>
  43. </view>
  44. <view class="date-box" :class="{
  45. stateBl:stateBl(item.prepaidEndTime)
  46. }">
  47. <view class="classify">
  48. {{item.name}}
  49. </view>
  50. <view class="classify">
  51. <span class="state" v-if="item.prepaidEndTime&&stateBl(item.prepaidEndTime)">已到期</span>
  52. <span class="state" v-if="!item.prepaidEndTime">未交费</span>
  53. </view>
  54. <view class="date" v-if="item.prepaidEndTime">
  55. 已缴费至 <text class="state">{{item.prepaidEndTime}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="remark" >
  60. <view class="item" v-if="obj.address">
  61. 租住地址:{{obj.address}}
  62. </view>
  63. <view class="item">
  64. 租赁期:{{thisparseUnixTime(obj.contractStartTime)}} 至 {{thisparseUnixTime(obj.contractEndTime)}}
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <u-divider :isnone="tenantList.length==0" nonetext="无记录"
  72. border-color="#CFD2D5">已经到底了</u-divider>
  73. </view>
  74. </template>
  75. <script>
  76. import * as API from '@/apis/pagejs/tenantList.js'
  77. import {
  78. newDate,parseUnixTime
  79. } from '@/apis/utils'
  80. export default {
  81. data() {
  82. return {
  83. tenantList:[],
  84. getTenantListReady:false,
  85. keyword:""
  86. }
  87. },
  88. onReady() {
  89. // this.current=1
  90. this.getTenantList()
  91. },
  92. methods: {
  93. thisparseUnixTime(time){
  94. return parseUnixTime(newDate(time),'{y}年{m}月{d}日')
  95. },
  96. stateBl(time){
  97. var get=newDate(time)
  98. var time=new Date()
  99. return get<time;
  100. },
  101. getTenantList(){
  102. uni.showLoading({
  103. title: "加载中",
  104. mask: true,
  105. })
  106. API.tenantContractList().then((response) => {
  107. uni.hideLoading();
  108. this.getTenantListReady=true
  109. this.tenantList=response.data.tenantInfoList;
  110. }).catch(error => {
  111. uni.showToast({
  112. title: error,
  113. icon: "none"
  114. })
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped>
  121. .main{
  122. margin-top: 24rpx;
  123. .tenant{
  124. background-color: #fff;
  125. color: rgba(51,51,51,1);
  126. font-size: 32rpx;
  127. margin: 24rpx;
  128. border-radius: 8px;
  129. .tenant-name{
  130. font-size: 40rpx;
  131. font-weight: bold;
  132. padding: 24rpx;
  133. }
  134. }
  135. }
  136. .balance{
  137. padding: 24rpx 24rpx;
  138. border-bottom: 1px solid #F4F4F4;
  139. display: flex;
  140. justify-content: space-between;
  141. }
  142. .title {
  143. display: flex;
  144. .icon {
  145. width: 40rpx;
  146. height: 40rpx;
  147. .img {
  148. width: 100%;
  149. height: 100%;
  150. }
  151. }
  152. .text {
  153. margin-left: 16rpx;
  154. color: rgba(51, 51, 51, 1);
  155. font-size: 32rpx;
  156. font-weight: bold;
  157. .state {
  158. white-space: pre;
  159. margin-left: 16rpx;
  160. color: rgba(238, 49, 56, 1);
  161. }
  162. }
  163. }
  164. .balance-number {
  165. // display: flex;
  166. // align-items: center;
  167. // justify-content: space-between;
  168. // margin-top: 16rpx;
  169. // margin-left: 56rpx;
  170. .number2 {
  171. color: rgba(238, 49, 56, 1);
  172. }
  173. .number {
  174. //font-size: 56rpx;
  175. font-weight: bold;
  176. }
  177. .recharge {
  178. width: 144rpx;
  179. height: 56rpx;
  180. line-height: 56rpx;
  181. border-radius: 50px;
  182. background: linear-gradient(85.19deg, rgba(255, 61, 0, 1) 4.89%, rgba(255, 123, 0, 1) 95.37%);
  183. color: rgba(255, 255, 255, 1);
  184. text-align: center;
  185. }
  186. }
  187. // 期限
  188. .deadline {
  189. display: flex;
  190. flex-wrap: wrap;
  191. .remark{
  192. font-size: 24rpx;
  193. padding: 24rpx ;
  194. }
  195. .deadline-item:first-of-type{
  196. //border-top: 1px solid #F4F4F4;
  197. }
  198. .deadline-item:last-of-type{
  199. // border-left: 1px solid #F4F4F4;
  200. }
  201. .deadline-item {
  202. border-bottom: 1px solid #F4F4F4;
  203. border-right: 1px solid #F4F4F4;
  204. width: 50%;
  205. display: flex;
  206. padding: 24rpx ;
  207. .item-icon {
  208. width: 40rpx;
  209. height: 40rpx;
  210. margin-right: 12rpx;
  211. .img {
  212. width: 100%;
  213. height: 100%;
  214. vertical-align: middle;
  215. }
  216. }
  217. .stateBl{
  218. .state {
  219. // white-space: pre;
  220. color: rgba(238, 49, 56, 1);
  221. }
  222. }
  223. .date-box {
  224. .state {
  225. white-space: pre;
  226. //color: rgba(238, 49, 56, 1);
  227. }
  228. text{
  229. margin-left: 8rpx;
  230. }
  231. .classify {
  232. color: rgba(51, 51, 51, 1);
  233. font-size: 32rpx;
  234. font-weight: bold;
  235. }
  236. .date{
  237. color: rgba(51,51,51,1);
  238. font-size: 24rpx;
  239. margin-top: 4rpx;
  240. }
  241. }
  242. }
  243. }
  244. .head-head{
  245. background: #fff;
  246. padding:24rpx;
  247. position: fixed;
  248. left: 0;
  249. right: 0;
  250. top: 80rpx;
  251. z-index: 991;
  252. }
  253. .head-head-placeholder{
  254. height: 112rpx;
  255. }
  256. </style>