index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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="getClearFn" >
  33. <view class="img"><image :src="htaba" class="imga"></image></view>
  34. <view>家政服务</view>
  35. </view>
  36. <view class="grid-item-box" @click="getWarrantyFn" >
  37. <view class="img"><image :src="htabb" class="imga"></image></view>
  38. <view>物业报修
  39. <view class="cir">2</view>
  40. </view>
  41. </view>
  42. <view class="grid-item-box" @click="getBusListFn(1)" >
  43. <view class="img"><image :src="htabc" class="imgb"></image></view>
  44. <view>供求资讯</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="getHouseFn" >
  76. <view class="img"><image :src="htabi" class="imgf"></image></view>
  77. <view>我的房屋<text class="co05">(1)</text></view>
  78. </view>
  79. <view class="grid-item-box" @click="getCarFn" >
  80. <view class="img"><image :src="htabj" class="imgg"></image></view>
  81. <view>我的车辆<text class="co05">(1)</text></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. export default {
  163. components:{footers,notice,boxList,popUp},
  164. data(){
  165. return{
  166. footerindex:'home',
  167. isfootflag:true,
  168. nvaHeight:44,
  169. activeColor:'#A7A7A7',
  170. nactiveColor:'#E6E6E6',
  171. backgroundColor: "transparent",
  172. navbg:require("@/static/images/navbg.png"),
  173. adrimg:require("@/static/images/home/adr.png"),
  174. adraimg:require("@/static/images/home/adra.png"),
  175. adrbgimg:require("@/static/images/home/adrbg.png"),
  176. htaba:require("@/static/images/home/htaba.png"),
  177. htabb:require("@/static/images/home/htabb.png"),
  178. htabc:require("@/static/images/home/htabc.png"),
  179. htabd:require("@/static/images/home/htabd.png"),
  180. htabe:require("@/static/images/home/htabe.png"),
  181. htabf:require("@/static/images/home/htabf.png"),
  182. htabg:require("@/static/images/home/htabg.png"),
  183. htabh:require("@/static/images/home/htabh.png"),
  184. htabi:require("@/static/images/home/htabi.png"),
  185. htabj:require("@/static/images/home/htabj.png"),
  186. htabk:require("@/static/images/home/htabk.png"),
  187. htabl:require("@/static/images/home/htabl.png"),
  188. cbga:require("@/static/images/home/cbga.png"),
  189. cbgb:require("@/static/images/home/cbgb.png"),
  190. lista:require("@/static/images/home/lista.png"),
  191. listb:require("@/static/images/home/listb.png"),
  192. listc:require("@/static/images/home/listc.png"),
  193. more:require("@/static/images/home/more.png"),
  194. type:'',//wygj
  195. wtdt:"加载更多",
  196. yhbg:require("@/static/images/home/yhbg.png"),
  197. eye:require("@/static/images/home/eye.png"),
  198. autoplay:false,
  199. autoplayh:false,
  200. incolorh:'#E6E6E6',
  201. activecolorh:'#A7A7A7',
  202. indicatorDotsh: true,
  203. city:'幸福大街',
  204. list:[{tit:'123'},{tit:'123'},{tit:'123'}],
  205. userId:this.$store.state.user.userId,
  206. nickName:this.$store.state.user.nickName,
  207. // avatar:this.$store.state.user.avatar,
  208. tabval:0,
  209. houselist:[],
  210. phoneList:[],
  211. tablist:[{tit:'本地资讯',val:"0"},{tit:'供求资讯',val:"1"},{tit:'热门资讯',val:"2"}],
  212. noticelist:[]
  213. }
  214. },
  215. onPageScroll(e) {
  216. var scrollTop = Number(e.scrollTop);
  217. if (scrollTop > 0) {
  218. this.backgroundColor = '#FFF7E1'
  219. } else {
  220. this.backgroundColor = 'transparent'
  221. }
  222. },
  223. onLoad: function() {
  224. var that=this;
  225. uni.getSystemInfo({
  226. success: (e) => {
  227. this.nvaHeight = Number(e.statusBarHeight)+44;
  228. }
  229. })
  230. // 获取房子
  231. this.getDataFn()
  232. this.gesettingsList()
  233. this.newsList();
  234. // #ifndef H5
  235. self.getLocation(function(res){
  236. if(res==-1){
  237. }else{
  238. that.city=res.city;
  239. }
  240. })
  241. // #endif
  242. },
  243. methods:{
  244. getDataFn(){
  245. var params={
  246. userId:this.userId,
  247. pageSize:5,
  248. pageNum: 1,
  249. }
  250. houseInfoList(params).then(res=>{
  251. if(res.code==200){
  252. this.houselist = JSON.parse(JSON.stringify(res.rows));
  253. }else{
  254. this.$toast(res.msg)
  255. }
  256. })
  257. },
  258. newsList(){
  259. var params={
  260. pageSize:10,
  261. pageNum: 1,
  262. status:1,
  263. }
  264. newsList(params).then(res=>{
  265. if(res.code==200){
  266. this.noticelist = res.rows;
  267. }else{
  268. this.$toast(res.msg)
  269. }
  270. })
  271. },
  272. getBusListFn(){
  273. },
  274. gesettingsList(){
  275. gesettingsList().then(res=>{
  276. if(res.code==200){
  277. this.phoneList=res.rows
  278. }
  279. })
  280. },
  281. getClose(){
  282. this.type=''
  283. },
  284. getNoticeDet(id){
  285. this.$tab.navigateTo(`/news/pages/news/detail?id=`+id)
  286. },
  287. getZhanFn(){
  288. this.zhanflag=!this.zhanflag
  289. },
  290. getClearFn(){//家政服务
  291. this.$tab.navigateTo(`/work/pages/clean/index`)
  292. },
  293. getWarrantyFn(){//物业报修
  294. this.$tab.navigateTo(`/work/pages/service/warranty`)
  295. },
  296. getHouseFn(){//我的房屋
  297. this.$tab.navigateTo(`/mine/pages/house/index`)
  298. },
  299. getCarFn(){//我的车辆
  300. this.$tab.navigateTo(`/mine/pages/car/index`)
  301. },
  302. getMoneyFn(){//物业缴费
  303. this.$tab.navigateTo(`/work/pages/manage/index`)
  304. },
  305. getVisitorFn(){//访客邀请
  306. this.$tab.navigateTo(`/work/pages/visitor/index`)
  307. },
  308. getNewsFn(){//社区资讯
  309. this.$tab.navigateTo(`/news/pages/news/newssq`)
  310. },
  311. getNewsDjFn(){//党建资讯
  312. this.$tab.navigateTo(`/news/pages/news/newsdj`)
  313. },
  314. getComplaintFn(){//投诉建议
  315. this.$tab.navigateTo(`/news/pages/complaint/index`)
  316. },
  317. getKdFn(){//我的快递
  318. this.$tab.navigateTo(`/mine/pages/delivery/index`)
  319. },
  320. getWygjFn(){//物业管家
  321. this.type='wygj'
  322. }
  323. }
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. .home{min-height: 100vh;background: linear-gradient(180deg, #FFF7E1 0%, rgba(255,255,255,0) 100%) no-repeat;background-size: 100% 782rpx;}
  328. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  329. .navbg{width: 100%;height: 782rpx;}
  330. .wymain{z-index: 2;position: relative;padding: 0 24rpx;}
  331. .topl{overflow: hidden;padding-left: 16rpx;
  332. image{width: 18rpx;height: 22rpx;margin-right: 14rpx;flex: 0 0 auto;}
  333. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  334. }
  335. .adrbox{position: relative;padding:8rpx 260rpx 16rpx 36rpx;margin-bottom: 28rpx;
  336. .adr{width: 36rpx;height: 34rpx;margin-right: 14rpx;}
  337. .adrtit{font-size: 17px;color: #272727;font-weight: bold;
  338. text{color: #E99D4F;}
  339. }
  340. .adrtxt{font-size: 16px;color: #272727;font-weight: bold;
  341. 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;}
  342. }
  343. .adrtip{font-weight: 500;font-size: 24rpx;color: #828282;}
  344. .adrbgimg{width: 262rpx;height: 242rpx;position: absolute;right: 0rpx;top: -54rpx;}
  345. }
  346. // tab栏
  347. .grid{
  348. display: flex;align-items: center;flex-wrap: wrap;
  349. .grid-item-box {display: flex;flex-direction: column;align-items: center;width: 25%;box-sizing: border-box;height: 152rpx;
  350. .img{width: 50rpx;height: 50rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 20rpx;
  351. .imga{width: 48rpx;height: 44rpx;}
  352. .imgb{width: 42rpx;height: 42rpx;}
  353. .imgc{width: 44rpx;height: 48rpx;}
  354. .imgd{width: 46rpx;height: 38rpx;}
  355. .imge{width: 40rpx;height: 50rpx;}
  356. .imgf{width: 48rpx;height: 50rpx;}
  357. .imgg{width: 48rpx;height: 40rpx;}
  358. .imgh{width: 44rpx;height: 46rpx;}
  359. }
  360. view{font-weight: bold;font-size: 26rpx;color: #272727;position: relative;
  361. .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;
  362. }
  363. }
  364. .txt{font-size: 20rpx;color: #666666;}
  365. }
  366. }
  367. .cbgs{width: 340rpx;height: 152rpx;position: relative;
  368. image{width: 340rpx;height: 152rpx;position: absolute;left: 0;top: 0;z-index: 0;}
  369. .cbga{z-index: 1;position: relative;padding: 30rpx 0 0 36rpx;
  370. .tit{font-weight: bold;font-size: 28rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #13A97A;margin-bottom: 10rpx;}
  371. .txt{font-size: 40rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #13A97A;}
  372. .tita{font-weight: bold;font-size: 28rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #E89D00;;margin-bottom: 10rpx;}
  373. .txta{font-size: 40rpx;color: #FFFFFF;text-shadow: 0px 4rpx 6rpx #E89D00;}
  374. }
  375. }
  376. .hlist{
  377. .hlista{padding: 8rpx 0;
  378. .limg{width: 32rpx;height: 32rpx;margin-right: 18rpx;}
  379. .tit{font-weight: bold;font-size: 30rpx;color: #272727;}
  380. .more{font-weight: 500;font-size: 24rpx;color: #AAAAAA;
  381. image{width: 18rpx;height: 16rpx;margin-left: 16rpx;}
  382. }
  383. .htabs{flex: 1;overflow: auto;padding: 10rpx 0;
  384. view{font-weight: 500;font-size: 28rpx;color: #666666;position: relative;height: 56rpx;line-height: 56rpx;margin-right: 48rpx;flex: 0 0 auto;
  385. &.act{font-size: 15px;font-weight: bold;color: #272727;
  386. &: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;}
  387. }
  388. }
  389. }
  390. }
  391. }
  392. </style>