contractList.vue 5.4 KB

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