index.vue 14 KB

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