index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view class="home" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" leftWidth='400rpx' :background-color="backgroundColor" :border="false" statusBar='true' fixed="true">
  5. <block slot="left">
  6. <view class="topl flexc">
  7. <image :src="adrimg" ></image>
  8. <view class="over">{{city}}</view>
  9. </view>
  10. </block>
  11. </uni-nav-bar>
  12. </view>
  13. <!-- 主体 -->
  14. <!-- <image :src="navbg" class="navbg"></image> -->
  15. <view class="wymain">
  16. <view class="adrbox">
  17. <view class="flexc mb14">
  18. <image :src="adraimg" class="adr"></image>
  19. <view class="adrtit">智慧<text>社区</text></view>
  20. </view>
  21. <view class="adrtxt flexc mb4">
  22. <view class="over">嗨~{{nickName}}!</view><text>业主</text>
  23. </view>
  24. <view class="adrtip" v-if="houselist&&houselist.length">{{houselist[0].communityName}}{{houselist[0].detailedAddress}}</view>
  25. <image :src="adrbgimg" class="adrbgimg"></image>
  26. </view>
  27. <!-- 轮播图 -->
  28. <swiper class="swiper mb12" circular :indicator-color="incolorh" :indicator-active-color="activecolorh" :indicator-dots="indicatorDotsh" :autoplay="autoplayh">
  29. <!-- v-if="checkPermi(['system:application:list'])" -->
  30. <swiper-item>
  31. <view class="grid">
  32. <view class="grid-item-box" @click="getHouseFn" >
  33. <view class="img"><image :src="htabi" class="imgf"></image></view>
  34. <view>我的房屋<text class="co05">(
  35. <block v-if="count.houseCount>98">99+</block>
  36. <block v-else>{{count.houseCount||0}}</block>
  37. )</text></view>
  38. </view>
  39. <view class="grid-item-box" @click="getCarFn" >
  40. <view class="img"><image :src="htabj" class="imgg"></image></view>
  41. <view>我的车辆<text class="co05">(
  42. <block v-if="count.carCount>98">99+</block>
  43. <block v-else>{{count.carCount||0}}</block>
  44. )</text></view>
  45. </view>
  46. <view class="grid-item-box" @click="getWarrantyFn" >
  47. <view class="img"><image :src="htabb" class="imga"></image></view>
  48. <view>物业报修
  49. <view class="cir">
  50. <block v-if="count.propertyRepair>98">99+</block>
  51. <block v-else>{{count.propertyRepair||0}}</block>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="grid-item-box" @click="getNewsFn" >
  56. <view class="img"><image :src="htabd" class="imgb"></image></view>
  57. <view>社区资讯<view class="cir">
  58. <block v-if="count.commentInteractionUserCount>98">99+</block>
  59. <block v-else>{{count.commentInteractionUserCount||0}}</block>
  60. </view></view>
  61. <!-- <view class="flexcw">
  62. <view class="txt">点赞<text class="co05 mr2">(5)</text></view>
  63. <view class="txt">评论<text class="co05">(12)</text></view>
  64. </view> -->
  65. <view class="txt">点赞<text class="co05 mr2">(
  66. <block v-if="count.likeCount>98">99+</block>
  67. <block v-else>{{count.likeCount||0}}</block>
  68. )</text>评论<text class="co05">(
  69. <block v-if="count.contentCount>98">99+</block>
  70. <block v-else>{{count.contentCount||0}}</block>
  71. )</text></view>
  72. </view>
  73. <view class="grid-item-box" @click="getNewsDjFn" >
  74. <view class="img"><image :src="htabe" class="imgc"></image></view>
  75. <view>党建资讯</view>
  76. </view>
  77. <view class="grid-item-box" @click="getComplaintFn" >
  78. <view class="img"><image :src="htabf" class="imgd"></image></view>
  79. <view>投诉建议<view class="cir">
  80. <block v-if="count.complaintSuggestion>98">99+</block>
  81. <block v-else>{{count.complaintSuggestion||0}}</block>
  82. </view></view>
  83. </view>
  84. <view class="grid-item-box" @click="getVisitorFn" >
  85. <view class="img"><image :src="htabg" class="imge"></image></view>
  86. <view>访客邀请</view>
  87. </view>
  88. <view class="grid-item-box" @click="getWygjFn" >
  89. <view class="img"><image :src="htabh" class="imga"></image></view>
  90. <view>联系管家</view>
  91. </view>
  92. </view>
  93. </swiper-item>
  94. <swiper-item>
  95. <view class="grid">
  96. <view class="grid-item-box" @click="getClearFn" >
  97. <view class="img"><image :src="htaba" class="imga"></image></view>
  98. <view>家政服务</view>
  99. </view>
  100. <view class="grid-item-box" @click="getBusListFn(1)" >
  101. <view class="img"><image :src="htabc" class="imgb"></image></view>
  102. <view>供求资讯</view>
  103. </view>
  104. <view class="grid-item-box" @click="getMoneyFn" >
  105. <view class="img"><image :src="htabk" class="imgh"></image></view>
  106. <view>物业缴费</view>
  107. </view>
  108. <view class="grid-item-box" @click="getBusListFn(1)" >
  109. <view class="img"><image :src="htabl" class="imga"></image></view>
  110. <view>敬请期待</view>
  111. </view>
  112. </view>
  113. </swiper-item>
  114. </swiper>
  115. <!-- 消息 -->
  116. <view class="mb12">
  117. <notice :noticelist='noticelist' :activeColor="activeColor" :nactiveColor="nactiveColor" @getNoticeDet="getNoticeDet"></notice>
  118. </view>
  119. <view class="mb18 flexc">
  120. <view class="cbgs mr12">
  121. <image :src="cbga"></image>
  122. <view class="cbga">
  123. <view class="tit">空闲充电桩</view>
  124. <view class="txt">37</view>
  125. </view>
  126. </view>
  127. <view class="cbgs">
  128. <image :src="cbgb"></image>
  129. <view class="cbga">
  130. <view class="tita">剩余停车位</view>
  131. <view class="txta">37</view>
  132. </view>
  133. </view>
  134. </view>
  135. <!-- 我的快递 -->
  136. <view class="hlist">
  137. <view class="hlista flexc mb6">
  138. <image :src="lista" class="limg flex0"></image>
  139. <view class="tit flex1">我的快递</view>
  140. <view class="more flex0 flexc" @click="getKdFn">更多<image :src="more"></image></view>
  141. </view>
  142. <box-list :datainfo="list" type="delivery"></box-list>
  143. </view>
  144. </view>
  145. <!-- 今日优惠 -->
  146. <view class="hlist plr12">
  147. <view class="hlista flexc mb10 ">
  148. <image :src="listb" class="limg flex0"></image>
  149. <view class="tit flex1">今日优惠</view>
  150. <view class="more flex0 flexc">更多<image :src="more"></image></view>
  151. </view>
  152. </view>
  153. <view class="mb4">
  154. <box-list type='coupon' :datainfo="list"></box-list>
  155. </view>
  156. <view class="wymain">
  157. <!-- 本地资讯 -->
  158. <view class="hlist">
  159. <view class="hlista flexc" style="padding-bottom: 0;">
  160. <image :src="listc" class="limg flex0"></image>
  161. <view class="htabs flexc">
  162. <view :class="tabval==ite.val?'act':''" v-for="(ite,idx) in tablist" :key="idx">{{ite.tit}}</view>
  163. </view>
  164. <view class="more flex0 flexc">更多<image :src="more"></image></view>
  165. </view>
  166. <box-list :datainfo="list" :wtdt="wtdt" type="news"></box-list>
  167. </view>
  168. </view>
  169. <loading></loading>
  170. <pop-up :type="type" @getClose="getClose" :phoneList="phoneList"></pop-up>
  171. <footers v-if="isfootflag" :footerindex="footerindex"></footers>
  172. </view>
  173. </template>
  174. <script>
  175. import footers from '@/components/footer/footer.vue'
  176. import notice from '@/components/swiper/notice.vue'
  177. import boxList from "@/components/box/list.vue"
  178. import popUp from "@/components/box/popup.vue"
  179. import {houseInfoList} from "@/api/work/work.js"
  180. import {gesettingsList,getCount} from "@/api/work/index.js"
  181. import {newsList} from "@/api/work/manage.js"
  182. import self from '@/utils/location.js';
  183. import store from "@/store"
  184. export default {
  185. components:{footers,notice,boxList,popUp},
  186. data(){
  187. return{
  188. footerindex:'home',
  189. isfootflag:true,
  190. nvaHeight:44,
  191. activeColor:'#A7A7A7',
  192. nactiveColor:'#E6E6E6',
  193. backgroundColor: "transparent",
  194. navbg:require("@/static/images/navbg.png"),
  195. adrimg:require("@/static/images/home/adr.png"),
  196. adraimg:require("@/static/images/home/adra.png"),
  197. adrbgimg:require("@/static/images/home/adrbg.png"),
  198. htaba:require("@/static/images/home/htaba.png"),
  199. htabb:require("@/static/images/home/htabb.png"),
  200. htabc:require("@/static/images/home/htabc.png"),
  201. htabd:require("@/static/images/home/htabd.png"),
  202. htabe:require("@/static/images/home/htabe.png"),
  203. htabf:require("@/static/images/home/htabf.png"),
  204. htabg:require("@/static/images/home/htabg.png"),
  205. htabh:require("@/static/images/home/htabh.png"),
  206. htabi:require("@/static/images/home/htabi.png"),
  207. htabj:require("@/static/images/home/htabj.png"),
  208. htabk:require("@/static/images/home/htabk.png"),
  209. htabl:require("@/static/images/home/htabl.png"),
  210. cbga:require("@/static/images/home/cbga.png"),
  211. cbgb:require("@/static/images/home/cbgb.png"),
  212. lista:require("@/static/images/home/lista.png"),
  213. listb:require("@/static/images/home/listb.png"),
  214. listc:require("@/static/images/home/listc.png"),
  215. more:require("@/static/images/home/more.png"),
  216. type:'',//wygj
  217. wtdt:"加载更多",
  218. yhbg:require("@/static/images/home/yhbg.png"),
  219. eye:require("@/static/images/home/eye.png"),
  220. autoplay:false,
  221. autoplayh:false,
  222. incolorh:'#E6E6E6',
  223. activecolorh:'#A7A7A7',
  224. indicatorDotsh: true,
  225. city:'合肥市',
  226. list:[{tit:'123'},{tit:'123'},{tit:'123'}],
  227. userId:this.$store.state.user.userId,
  228. nickName:this.$store.state.user.nickName,
  229. phonenumber:this.$store.state.user.phonenumber,
  230. // avatar:this.$store.state.user.avatar,
  231. tabval:0,
  232. houselist:[],
  233. phoneList:[],
  234. tablist:[{tit:'本地资讯',val:"0"},{tit:'供求资讯',val:"1"},{tit:'热门资讯',val:"2"}],
  235. count:'',//统计
  236. noticelist:[]
  237. }
  238. },
  239. onPageScroll(e) {
  240. var scrollTop = Number(e.scrollTop);
  241. if (scrollTop > 0) {
  242. this.backgroundColor = '#FFF7E1'
  243. } else {
  244. this.backgroundColor = 'transparent'
  245. }
  246. },
  247. onLoad: function() {
  248. var that=this;
  249. uni.getSystemInfo({
  250. success: (e) => {
  251. this.nvaHeight = Number(e.statusBarHeight)+44;
  252. }
  253. })
  254. // 获取房子
  255. this.getDataFn()
  256. this.gesettingsList()
  257. this.getCount()
  258. this.newsList();
  259. // #ifndef H5
  260. self.getLocation(function(res){
  261. if(res==-1){
  262. }else{
  263. that.city=res.city;
  264. }
  265. })
  266. // #endif
  267. },
  268. methods:{
  269. getDataFn(){
  270. var params={
  271. userId:this.userId,
  272. pageSize:5,
  273. pageNum: 1,
  274. }
  275. houseInfoList(params).then(res=>{
  276. if(res.code==200){
  277. this.houselist = JSON.parse(JSON.stringify(res.rows));
  278. if(res.rows&&res.rows.length){
  279. var info=res.rows[0];
  280. var obj={
  281. houseId:info.houseId,
  282. communityName:info.communityName,
  283. detailedAddress:info.detailedAddress,
  284. }
  285. store.commit('SET_HOUSE', obj)
  286. }
  287. }else{
  288. this.$toast(res.msg)
  289. }
  290. })
  291. },
  292. newsList(){
  293. var params={
  294. pageSize:10,
  295. pageNum: 1,
  296. status:1,
  297. }
  298. newsList(params).then(res=>{
  299. if(res.code==200){
  300. this.noticelist = res.rows;
  301. }else{
  302. this.$toast(res.msg)
  303. }
  304. })
  305. },
  306. getBusListFn(){
  307. },
  308. getCount(){
  309. var params={
  310. userId:this.userId,
  311. residentPhone:this.phonenumber
  312. }
  313. getCount(params).then(res => {
  314. if(res.code==200){
  315. this.count=res.data;
  316. }
  317. })
  318. },
  319. gesettingsList(){
  320. gesettingsList().then(res=>{
  321. if(res.code==200){
  322. this.phoneList=res.rows
  323. }
  324. })
  325. },
  326. getClose(){
  327. this.type=''
  328. },
  329. getNoticeDet(id){
  330. this.$tab.navigateTo(`/news/pages/news/detail?id=`+id)
  331. },
  332. getZhanFn(){
  333. this.zhanflag=!this.zhanflag
  334. },
  335. getClearFn(){//家政服务
  336. this.$tab.navigateTo(`/work/pages/clean/index`)
  337. },
  338. getWarrantyFn(){//物业报修
  339. this.$tab.navigateTo(`/work/pages/service/warranty`)
  340. },
  341. getHouseFn(){//我的房屋
  342. this.$tab.navigateTo(`/mine/pages/house/index`)
  343. },
  344. getCarFn(){//我的车辆
  345. this.$tab.navigateTo(`/mine/pages/car/index`)
  346. },
  347. getMoneyFn(){//物业缴费
  348. this.$tab.navigateTo(`/work/pages/manage/index`)
  349. },
  350. getVisitorFn(){//访客邀请
  351. this.$tab.navigateTo(`/work/pages/visitor/index`)
  352. },
  353. getNewsFn(){//社区资讯
  354. this.$tab.navigateTo(`/news/pages/news/newssq`)
  355. },
  356. getNewsDjFn(){//党建资讯
  357. this.$tab.navigateTo(`/news/pages/news/newsdj`)
  358. },
  359. getComplaintFn(){//投诉建议
  360. this.$tab.navigateTo(`/news/pages/complaint/index`)
  361. },
  362. getKdFn(){//我的快递
  363. this.$tab.navigateTo(`/mine/pages/delivery/index`)
  364. },
  365. getWygjFn(){//物业管家
  366. this.type='wygj'
  367. }
  368. }
  369. }
  370. </script>
  371. <style lang="scss" scoped>
  372. .home{min-height: 100vh;background: linear-gradient(180deg, #FFF7E1 0%, rgba(255,255,255,0) 100%) no-repeat;background-size: 100% 782rpx;}
  373. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  374. .navbg{width: 100%;height: 782rpx;}
  375. .wymain{z-index: 2;position: relative;padding: 0 24rpx;}
  376. .topl{overflow: hidden;padding-left: 16rpx;
  377. image{width: 18rpx;height: 22rpx;margin-right: 14rpx;flex: 0 0 auto;}
  378. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  379. }
  380. .adrbox{position: relative;padding:8rpx 260rpx 16rpx 36rpx;margin-bottom: 28rpx;
  381. .adr{width: 36rpx;height: 34rpx;margin-right: 14rpx;}
  382. .adrtit{font-size: 17px;color: #272727;font-weight: bold;
  383. text{color: #E99D4F;}
  384. }
  385. .adrtxt{font-size: 16px;color: #272727;font-weight: bold;
  386. text{font-size: 10px;color: #E99D4F;display: inline-flex;background: rgba(233, 157, 79, 0.3);margin-left: 22rpx;min-width: 66rpx;height: 30rpx;padding: 0 14rpx;box-sizing: border-box;flex: 0 0 auto;border-radius: 8px;align-items: center;justify-content: center;}
  387. }
  388. .adrtip{font-weight: 500;font-size: 24rpx;color: #828282;}
  389. .adrbgimg{width: 262rpx;height: 242rpx;position: absolute;right: 0rpx;top: -54rpx;}
  390. }
  391. // tab栏
  392. .grid{
  393. display: flex;align-items: center;flex-wrap: wrap;
  394. .grid-item-box {display: flex;flex-direction: column;align-items: center;width: 25%;box-sizing: border-box;height: 152rpx;
  395. .img{width: 50rpx;height: 50rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 20rpx;
  396. .imga{width: 48rpx;height: 44rpx;}
  397. .imgb{width: 42rpx;height: 42rpx;}
  398. .imgc{width: 44rpx;height: 48rpx;}
  399. .imgd{width: 46rpx;height: 38rpx;}
  400. .imge{width: 40rpx;height: 50rpx;}
  401. .imgf{width: 48rpx;height: 50rpx;}
  402. .imgg{width: 48rpx;height: 40rpx;}
  403. .imgh{width: 44rpx;height: 46rpx;}
  404. }
  405. view{font-weight: bold;font-size: 26rpx;color: #272727;position: relative;
  406. .cir{width: 20rpx;height: 20rpx;background: #D32C26;border-radius: 10rpx;font-weight: bold;font-size: 16rpx;color: #FCF9F1;position: absolute;display: flex;align-items: center;justify-content: center;padding: 0 2rpx;box-sizing: border-box;right: -10rpx;top: -10rpx;
  407. }
  408. }
  409. .txt{font-size: 20rpx;color: #666666;}
  410. }
  411. }
  412. .cbgs{width: 340rpx;height: 152rpx;position: relative;
  413. image{width: 340rpx;height: 152rpx;position: absolute;left: 0;top: 0;z-index: 0;}
  414. .cbga{z-index: 1;position: relative;padding: 30rpx 0 0 36rpx;
  415. .tit{font-weight: bold;font-size: 28rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #13A97A;margin-bottom: 10rpx;}
  416. .txt{font-size: 40rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #13A97A;}
  417. .tita{font-weight: bold;font-size: 28rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #E89D00;;margin-bottom: 10rpx;}
  418. .txta{font-size: 40rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #E89D00;}
  419. }
  420. }
  421. .hlist{
  422. .hlista{padding: 8rpx 0;
  423. .limg{width: 32rpx;height: 32rpx;margin-right: 18rpx;}
  424. .tit{font-weight: bold;font-size: 30rpx;color: #272727;}
  425. .more{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
  426. image{width: 18rpx;height: 16rpx;margin-left: 16rpx;}
  427. }
  428. .htabs{flex: 1;overflow: auto;padding: 10rpx 0;
  429. view{font-weight: 500;font-size: 28rpx;color: #666666;position: relative;height: 56rpx;line-height: 56rpx;margin-right: 48rpx;flex: 0 0 auto;
  430. &.act{font-size: 15px;font-weight: bold;color: #272727;
  431. &:after{width: 36rpx;height: 10rpx;background: linear-gradient(150deg, rgba(177,240,216,0.97), rgba(3,218,138,0.97));border-radius: 6rpx;content: '';position: absolute;bottom: -10rpx;left: 50%;margin-left: -18rpx;}
  432. }
  433. }
  434. }
  435. }
  436. }
  437. </style>