condition.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <view class="page" :style="{'height':h+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="房情表"></c-nav-bar>
  4. <view class="table">
  5. <view class="t_th">
  6. <view class="tt_year b_rb" @tap="show=true">
  7. <text>{{year}}年</text>
  8. <u-icon name="arrow-down" size="24" color="#999999"></u-icon>
  9. </view>
  10. <view class="tt_title b_rb">数量</view>
  11. <view class="tt_title b_rb">可售</view>
  12. <view class="tt_title b_rb">占用</view>
  13. <view class="tt_title b_rb">不可售</view>
  14. </view>
  15. <view class="t_item" v-for="(item,index) in list" :key="index">
  16. <view class="ti_date b_rb" @tap="toDetails(item)">
  17. <view :class="item.color">
  18. <text>{{item.yr}}</text>
  19. <text>{{item.week}}</text>
  20. </view>
  21. <u-icon name="arrow-right" size="24" color="#999999"></u-icon>
  22. </view>
  23. <view class="ti_num b_rb">{{item.num}}</view>
  24. <view class="ti_num b_rb">{{item.ksNum}}</view>
  25. <view class="ti_num b_rb">{{item.zyNum}}</view>
  26. <view class="ti_num b_rb">{{item.bksNum}}</view>
  27. </view>
  28. </view>
  29. <u-calendar :show="show" :monthNum="24" mode="single" @confirm="confirm"></u-calendar>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. year:new Date().getFullYear(),
  37. weekCfg:{0:'周日',1:'周一',2:'周二',3:'周三',4:'周四',5:'周五',6:'周六'},
  38. show:false,
  39. startDate:new Date().Format('yyyy-MM-dd'),
  40. list:[],
  41. resData:[]
  42. }
  43. },
  44. onLoad() {
  45. this.getList();
  46. },
  47. methods: {
  48. getList(){
  49. this.resData = [];
  50. for(let i=0;i<7;i++){
  51. this.resData.push({
  52. date:new Date(new Date().setDate(new Date(this.startDate).getDate()+i)).Format('yyyy-MM-dd'),
  53. num:10,
  54. ksNum:10,
  55. zyNum:10,
  56. bksNum:10
  57. })
  58. }
  59. this.list = this.resData;
  60. let n = new Date().Format('yyyy-MM-dd');
  61. this.list.forEach(l=>{
  62. let w = new Date(l.date).getDay();
  63. l.yr = new Date(l.date).Format('MM-dd');
  64. l.week = n==l.date?'今天':this.weekCfg[w];
  65. l.color = n==l.date?'c_today':([6,0].includes(w)?'c_week':'c_normal');
  66. })
  67. },
  68. confirm(e){
  69. this.show = false;
  70. this.year = new Date(e[0]).Format('yyyy');
  71. this.startDate = e[0];
  72. this.getList();
  73. },
  74. toDetails(item){
  75. uni.navigateTo({
  76. url:'/pages/home/details?item='+encodeURIComponent(JSON.stringify(item))
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style scoped lang="less">
  83. .page{
  84. background: #F9FAFC;
  85. .table{
  86. width: 100%;
  87. border-top: 1rpx solid #D1D1D1;
  88. border-left: 1rpx solid #D1D1D1;
  89. margin-top: 20rpx;
  90. .t_th{
  91. display: flex;
  92. align-items: center;
  93. justify-content: space-around;
  94. &>view{
  95. width: 25%;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. padding: 20rpx 0;
  100. box-sizing: border-box;
  101. &.tt_year{
  102. text{
  103. font-size: 24rpx;
  104. font-family: PingFang SC, PingFang SC;
  105. font-weight: 400;
  106. color: #1F2425;
  107. margin-right: 10rpx;
  108. }
  109. }
  110. &.tt_title{
  111. background: #FAFAFA;
  112. font-size: 24rpx;
  113. font-family: PingFang SC, PingFang SC;
  114. font-weight: 400;
  115. color: #1F2425;
  116. }
  117. }
  118. }
  119. .t_item{
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-around;
  123. &>view{
  124. width: 25%;
  125. height: 106rpx;
  126. }
  127. .ti_date{
  128. display: flex;
  129. align-items: center;
  130. justify-content: center;
  131. background: #FAFAFA;
  132. box-sizing: border-box;
  133. &>view{
  134. display: flex;
  135. flex-direction: column;
  136. align-items: center;
  137. margin-right: 20rpx;
  138. text{
  139. font-size: 24rpx;
  140. font-family: PingFang SC, PingFang SC;
  141. font-weight: 400;
  142. color: #245BED;
  143. }
  144. }
  145. }
  146. .ti_num{
  147. box-sizing: border-box;
  148. background: #ffffff;
  149. display: flex;
  150. align-items: center;
  151. justify-content: center;
  152. font-size: 24rpx;
  153. font-family: PingFang SC, PingFang SC;
  154. font-weight: 400;
  155. color: #1F2425;
  156. }
  157. }
  158. }
  159. .b_rb{
  160. border-right: 1rpx solid #D1D1D1;
  161. border-bottom: 1rpx solid #D1D1D1;
  162. }
  163. .c_today{
  164. text{
  165. color: #245BED !important;
  166. }
  167. }
  168. .c_week{
  169. text{
  170. color: #FF0000 !important;
  171. }
  172. }
  173. .c_normal{
  174. text{
  175. color: #1F2425 !important;
  176. }
  177. }
  178. }
  179. ::v-deep .u-transition{
  180. .u-calendar-month__days__day{
  181. height: 104rpx !important;
  182. }
  183. .u-calendar__confirm .u-button{
  184. width: calc(100% - 24rpx) !important;
  185. height: 88rpx !important;
  186. background: #0DBFFD !important;
  187. border-radius: 44rpx !important;
  188. }
  189. .u-calendar__confirm .u-button text{
  190. font-size: 32rpx !important;
  191. font-family: PingFangSC-Regular, PingFang SC;
  192. font-weight: 400;
  193. color: #FFFFFF !important;
  194. }
  195. .u-calendar scroll-view{
  196. height: 600rpx !important;
  197. }
  198. .u-icon__icon{
  199. font-size: 14px !important;
  200. line-height: 14px !important;
  201. }
  202. }
  203. </style>