enterpriseSide.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <div class="enterpriseSide">
  3. <div style="padding: 0 24rpx; background: white">
  4. <div class="searchTop">
  5. <image :src="locationIcon" class="locationIcon"></image>
  6. <picker @change="bindPickerChange" :value="index" :range="array" range-key="groupName">
  7. <input v-model="selectGroup.groupName" class="searchArea" disabled />
  8. </picker>
  9. <image :src="dhIcon" class="dhIcon" @tap="toMap"></image>
  10. <image :src="vector" class="vector"></image>
  11. </div>
  12. <div class="parkBgBox">
  13. <swiper :indicator-dots="false" circular style="height: 320rpx;position: relative" @change="changeImg" autoplay>
  14. <swiper-item v-for="item in envList">
  15. <img :src="item.imgUrl" class="swiperImg"/>
  16. <div class="parkNameBox">{{apiGroupName}}</div>
  17. </swiper-item>
  18. </swiper>
  19. </div>
  20. <div class="map2">
  21. <div
  22. class="mapdom2"
  23. style="float: left"
  24. v-for="(item, index) in mapList"
  25. :key="index"
  26. @click="jumpPage(item.path, item.isMustCompany)"
  27. >
  28. <img class="mapIcon2" :src="item.url" />
  29. <div class="maptxt">{{ item.label }}</div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="noticeBody">
  34. <image :src="tongzhi" class="tongzhiImg"></image>
  35. <div class="columLine"></div>
  36. <div class="noticeBox">
  37. <div class="noticeItem" v-for="item in noticeList" @click="toNotice(item)">
  38. <div class="noticeTag">{{item.type=='1'?'园区':'物业'}}</div>
  39. <div class="noticeInfo">{{item.title}}</div>
  40. <div class="noticeTime">{{item.time}}</div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="parkDynamic">
  45. <div class="parkDynamicTitle">
  46. <div class="columLineBlue"></div>
  47. <div class="titleName">园区动态</div>
  48. </div>
  49. <div class="parkDynamicTab">
  50. <div
  51. v-for="(item, index) in tabList"
  52. :key="index"
  53. class="tabItem"
  54. :class="selectTab === item.name ? 'selectTabItem' : ''"
  55. @click="clickTab(item)"
  56. >
  57. {{ item.name }}
  58. </div>
  59. </div>
  60. <activity v-show="selectTab === '活动'" :faMsg="faMsg"></activity>
  61. <dynamic v-show="selectTab === '动态'"></dynamic>
  62. </div>
  63. <div class="serviceEvaluation">
  64. <div class="parkDynamicTitle">
  65. <div class="columLineBlue"></div>
  66. <div class="titleName">服务评价</div>
  67. </div>
  68. <div class="wyInfo">
  69. <div class="wyName">
  70. <image :src="wyhead" class="wyhead"></image>
  71. <span>XXXX物业</span>
  72. </div>
  73. <span style="color: #666666; font-size: 28rpx">好评率:100%</span>
  74. </div>
  75. <div class="evaluationBox" @tap="toServiceEva">
  76. <div class="evaluationBoxName">点击笑脸给出您对园区服务的评价</div>
  77. <van-rate
  78. :value="value"
  79. :size="32"
  80. color="#ffd21e"
  81. :void-icon="voidMyIcon"
  82. :icon="myIcon"
  83. gutter="32rpx"
  84. void-color="#eee"
  85. bind:change="onChange"
  86. />
  87. </div>
  88. </div>
  89. <div class="contactInfo">
  90. <div class="infoBox">
  91. <span class="infoTitle">客服电话(24小时)</span>
  92. <span class="phoneNumber">{{phone}}</span>
  93. </div>
  94. <image :src="phoneCall" class="phoneCall" @tap="call"></image>
  95. </div>
  96. </div>
  97. </template>
  98. <script>
  99. import vanRate from "../../../wxcomponents/weapp/dist/rate/index";
  100. import dynamic from "./dynamic.vue";
  101. import Activity from "./activity.vue";
  102. import { getUserPower, getUserLocalStorageInfo, newNotice,getUserMainHouseKeeper, activityList, ParkInfoControllerListAll, getByGroupId} from "@/js_sdk/http";
  103. export default {
  104. components: {
  105. Activity,
  106. vanRate,
  107. dynamic,
  108. },
  109. name: "enterpriseSide",
  110. data() {
  111. return {
  112. apiGroupName:'',
  113. phone:'0510-680**808',
  114. selectGroup:{},
  115. noticeList:[],
  116. faMsg:'home',
  117. locationIcon:
  118. "https://www.idea-sf.com/gardenProduct/image/locationIcon.png",
  119. dhIcon: "https://www.idea-sf.com/gardenProduct/image/dhIcon.png",
  120. vector: "https://www.idea-sf.com/gardenProduct/image/Vector.png",
  121. tongzhi: "https://www.idea-sf.com/gardenProduct/image/tongzhi.png",
  122. wyhead: "https://www.idea-sf.com/gardenProduct/image/wyHead.png",
  123. myIcon: "https://www.idea-sf.com/gardenProduct/image/icon.png",
  124. voidMyIcon: "https://www.idea-sf.com/gardenProduct/image/voidIcon.png",
  125. phoneCall: "https://www.idea-sf.com/gardenProduct/image/phoneCall.png",
  126. value: "5",
  127. searchArea: "当前园区名称",
  128. index: 0,
  129. array: [],
  130. // parkBg: "https://www.idea-sf.com/gardenProduct/image/parkBg.png",
  131. envList:[
  132. // {url:"https://www.idea-sf.com/gardenProduct/image/parkBg.png"},
  133. // {url:"https://www.idea-sf.com/gardenProduct/image/parkBg.png"}
  134. ],
  135. tabList: [
  136. { name: "活动" },
  137. { name: "周边" },
  138. { name: "房源" },
  139. { name: "动态" },
  140. ],
  141. selectTab: "活动",
  142. pages:{
  143. pageSize:10000,
  144. pageNum:1,
  145. statusStr:'1,2'
  146. },
  147. mapList: [
  148. {
  149. label: "待办提醒",
  150. url: "https://www.idea-sf.com/gardenProduct/image/dbtxIcon.png",
  151. // path: "/pages/subPackages/companyHouse/companyHouse",
  152. },
  153. {
  154. label: "企业账单",
  155. url: "https://www.idea-sf.com/gardenProduct/image/qyzdIcon.png",
  156. path: "/pages/subPackages/enterPriseBill/index",
  157. isMustCompany: true,
  158. },
  159. {
  160. label: "经发填报",
  161. url: "https://www.idea-sf.com/gardenProduct/image/jftbIcon.png",
  162. path: "/pages/subPackages/economicDevelopmentReport/economic",
  163. isMustCompany: true,
  164. },
  165. {
  166. label: "园区周边",
  167. url: "https://www.idea-sf.com/gardenProduct/image/yqzb.png",
  168. path: "/pages/subPackages/peripheralService/index",
  169. },
  170. {
  171. label: "报事报修",
  172. url: "https://www.idea-sf.com/gardenProduct/image/bsbxIcon.png",
  173. path: "/pages/subPackages/reportRepair/index",
  174. isMustCompany: true,
  175. },
  176. {
  177. label: "活动报名",
  178. url: "https://www.idea-sf.com/gardenProduct/image/hdbmIcon.png",
  179. path: "/pages/subPackages/parkActivity/index",
  180. isMustCompany: true,
  181. },
  182. {
  183. label: "入驻申请",
  184. url: "https://www.idea-sf.com/gardenProduct/image/rzsqIcon.png",
  185. path: "/pages/subPackages/companyHouse/companyHouse",
  186. },
  187. {
  188. label: "退租申请",
  189. url: "https://www.idea-sf.com/gardenProduct/image/tzsqIcon.png",
  190. path: "/pages/subPackages/companyHouse/companyHouse",
  191. isMustCompany: true,
  192. },
  193. {
  194. label: "关于园区",
  195. url: "https://www.idea-sf.com/gardenProduct/image/gyyqIcon.png",
  196. path: "/pages/subPackages/aboutThePark/index",
  197. },
  198. {
  199. label: "产业政策",
  200. url: "https://www.idea-sf.com/gardenProduct/image/cyzcIcon.png",
  201. path: "/pages/subPackages/industrialPolicy/index",
  202. },
  203. {
  204. label: "资源预约",
  205. url: "https://www.idea-sf.com/gardenProduct/image/zyyyIcon.png",
  206. path: "/pages/subPackages/resourceReservation_manage/index",
  207. isMustCompany: true,
  208. },
  209. ],
  210. };
  211. },
  212. mounted() {
  213. this.getNotice()
  214. this.getActiveList()
  215. this.getParkList()
  216. // this.getInfoByGroupId()
  217. // this.getHouseKeeper()
  218. },
  219. methods: {
  220. refreshPage(){
  221. this.getNotice()
  222. this.getActiveList()
  223. this.getParkList()
  224. },
  225. changeImg(index){
  226. // this.current = index.detail.current+1
  227. },
  228. call(){
  229. uni.makePhoneCall({
  230. phoneNumber: this.phone, // 电话号码
  231. success: function () {
  232. console.log('拨打电话成功');
  233. },
  234. fail: function () {
  235. console.log('拨打电话失败');
  236. }
  237. });
  238. },
  239. getParkList(){
  240. ParkInfoControllerListAll().then(res=>{
  241. this.array = res
  242. if (uni.getStorageSync('selectGroup')){
  243. this.selectGroup = JSON.parse(uni.getStorageSync('selectGroup'))
  244. }else{
  245. this.selectGroup = res[0]
  246. wx.setStorageSync("selectGroup", JSON.stringify(res[0]));
  247. }
  248. this.getInfoByGroupId()
  249. })
  250. },
  251. getInfoByGroupId() {
  252. const data = {
  253. groupId : JSON.parse(uni.getStorageSync('selectGroup')).groupId
  254. }
  255. getByGroupId(data).then((res)=>{
  256. this.briefImg = JSON.parse(res.briefImg)
  257. console.log('this.briefImg',this.briefImg)
  258. this.apiGroupName= res.groupName
  259. this.briefImg.forEach(item=>{
  260. console.log('item', item)
  261. this.envList.push({imgUrl:item.url})
  262. })
  263. })
  264. console.log('this.envList', this.envList)
  265. },
  266. getActiveList(){
  267. activityList(this.pages).then(res=>{
  268. if (res.data.total > 0){
  269. res.data.rows.forEach(item=>{
  270. this.envList.push({...item,imgUrl:JSON.parse(item.annex)[0].url})
  271. })
  272. }
  273. console.log('this.envList',this.envList)
  274. })
  275. },
  276. //获取管家
  277. getHouseKeeper(){
  278. let reqData = {
  279. userId : getUserLocalStorageInfo().userId
  280. }
  281. getUserMainHouseKeeper(reqData).then((res) => {
  282. if (res.key == '200') {
  283. // console.log('res.data:开始')
  284. // console.log(res.data)
  285. // console.log('res.data:结束')
  286. if (res.data != null) {
  287. this.houseKeeper = res.data
  288. }
  289. }
  290. });
  291. },
  292. toMap(){
  293. uni.openLocation({
  294. latitude: this.selectGroup.latitude,
  295. longitude: this.selectGroup.longitude,
  296. success: function () {
  297. console.log('success');
  298. }
  299. });
  300. // uni.getLocation({
  301. // type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  302. // success: function (res) {
  303. // const latitude = res.latitude;
  304. // const longitude = res.longitude;
  305. //
  306. // }
  307. // });
  308. },
  309. getNotice(){
  310. this.noticeList=[]
  311. newNotice().then(res=>{
  312. if (res.code=='409'){
  313. uni.clearStorageSync();
  314. uni.reLaunch({
  315. url: "/pages/login/login",
  316. });
  317. }
  318. if (res.data){
  319. const newNotice = res.data
  320. newNotice.forEach(e=>{
  321. e.time = this.showtime(e.releaseTime)
  322. })
  323. this.noticeList.push(...res.data)
  324. }
  325. })
  326. },
  327. showtime(time) {
  328. const date =
  329. typeof time === 'number'
  330. ? new Date(time)
  331. : new Date((time || '').replace(/-/g, '/'))
  332. const diff = (new Date().getTime() - date.getTime()) / 1000
  333. const dayDiff = Math.floor(diff / 86400)
  334. const isValidDate =
  335. Object.prototype.toString.call(date) === '[object Date]' &&
  336. !isNaN(date.getTime())
  337. if (!isValidDate) {
  338. window.console.error('不是有效日期格式')
  339. }
  340. const formatDate = function(date) {
  341. const today = new Date(date)
  342. const year = today.getFullYear()
  343. const month = ('0' + (today.getMonth() + 1)).slice(-2)
  344. const day = ('0' + today.getDate()).slice(-2)
  345. const hour = today.getHours()
  346. const minute = today.getMinutes()
  347. const second = today.getSeconds()
  348. return `${year}-${month}-${day} ${hour}:${minute}:${second}`
  349. }
  350. if (isNaN(dayDiff) || dayDiff < 0) {
  351. return formatDate(date)
  352. }
  353. return (
  354. (dayDiff === 0 &&
  355. ((diff < 60 && '刚刚') ||
  356. (diff < 120 && '1分钟前') ||
  357. (diff < 3600 && Math.floor(diff / 60) + '分钟前') ||
  358. (diff < 7200 && '1小时前') ||
  359. (diff < 86400 && Math.floor(diff / 3600) + '小时前'))) ||
  360. (dayDiff === 1 && '昨天') ||
  361. (dayDiff < 7 && dayDiff + '天前') ||
  362. (dayDiff < 31 && Math.ceil(dayDiff / 7) + '周前') ||
  363. (dayDiff >= 31 && Math.ceil((dayDiff - 30) / 31) + '月前')
  364. )
  365. },
  366. toServiceEva(){
  367. uni.navigateTo({
  368. url:"/pages/subPackages/serviceEvaluation/index",
  369. })
  370. },
  371. toNotice(item) {
  372. // 跳转传参
  373. uni.navigateTo({
  374. url:"/pages/subPackages/propertyNotice/index?type=" + item.type,
  375. })
  376. },
  377. bindPickerChange(e) {
  378. this.selectGroup = this.array[e.detail.value];
  379. wx.setStorageSync("selectGroup", JSON.stringify(this.array[e.detail.value]));
  380. },
  381. jumpPage(path, isMustCompany) {
  382. console.log(path);
  383. if (!path){
  384. uni.showModal({
  385. title: "待开发,敬请期待",
  386. })
  387. return
  388. }
  389. if (isMustCompany && getUserLocalStorageInfo().userType == 3) {
  390. uni.showModal({
  391. title: "提示",
  392. cancelText: "暂不",
  393. confirmText: "去切换",
  394. content: "您还不是企业用户,请切换登录身份后再进行相关操作。",
  395. success: function (res) {
  396. if (res.confirm) {
  397. uni.navigateTo({
  398. url: "/pages/login2/login",
  399. success: function (e) {
  400. // uni.$emit('userType', 'OK')
  401. },
  402. });
  403. } else if (res.cancel) {
  404. console.log("用户点击取消");
  405. }
  406. },
  407. });
  408. } else {
  409. uni.navigateTo({
  410. url: path,
  411. fail: (fail) => {
  412. console.log(fail);
  413. },
  414. });
  415. }
  416. },
  417. clickTab(item) {
  418. if (item.name==='周边'){
  419. uni.navigateTo({
  420. url:'/pages/subPackages/peripheralService/index'
  421. })
  422. }else if(item.name==='房源'){
  423. uni.navigateTo({
  424. url:'/pages/subPackages/housingResources/index'
  425. })
  426. }else{
  427. this.selectTab = item.name;
  428. }
  429. },
  430. },
  431. };
  432. </script>
  433. <style lang="scss">
  434. .enterpriseSide {
  435. background: #f5f7fa;
  436. .searchTop {
  437. //margin: 24rpx;
  438. background: white;
  439. position: relative;
  440. display: flex;
  441. align-items: center;
  442. .searchArea {
  443. position: relative;
  444. width: 532rpx;
  445. height: 64rpx;
  446. background: #f5f7fa;
  447. border-radius: 32rpx;
  448. padding-left: 68rpx;
  449. font-size: 28rpx;
  450. }
  451. .locationIcon {
  452. position: absolute;
  453. width: 28rpx;
  454. height: 28rpx;
  455. left: 24rpx;
  456. z-index: 10;
  457. }
  458. .dhIcon {
  459. width: 48rpx;
  460. height: 48rpx;
  461. margin-left: 16rpx;
  462. }
  463. .vector {
  464. position: absolute;
  465. width: 16rpx;
  466. height: 8rpx;
  467. left: 552rpx;
  468. }
  469. }
  470. .parkBgBox {
  471. position: relative;
  472. background-repeat: no-repeat;
  473. background-size: 100%;
  474. width: 702rpx;
  475. height: 320rpx;
  476. margin-top: 24rpx;
  477. .parkNameBox {
  478. position: absolute;
  479. box-sizing: border-box;
  480. width: 100%;
  481. height: 64rpx;
  482. background: rgba(3, 19, 41, 0.6);
  483. display: flex;
  484. align-items: center;
  485. padding-left: 24rpx;
  486. bottom: 0;
  487. color: white;
  488. font-size: 28rpx;
  489. border-radius: 0 0 16rpx 16rpx;
  490. z-index: 1000;
  491. }
  492. }
  493. .map2 {
  494. box-sizing: border-box;
  495. //position: absolute;
  496. z-index: 2;
  497. width: 100%;
  498. //height: 770rpx;
  499. //border-radius: 48rpx 48rpx 0rpx 0rpx;
  500. background: white;
  501. //margin-top: 402rpx;
  502. padding: 36rpx 0 0 0;
  503. overflow-y: auto;
  504. display: grid;
  505. grid-template-columns: repeat(5, 1fr);
  506. }
  507. .mapIcon2 {
  508. width: 92rpx;
  509. height: 92rpx;
  510. display: block;
  511. margin: auto;
  512. }
  513. .mapdom2 {
  514. height: 184rpx;
  515. }
  516. .noticeBody {
  517. padding: 24rpx 28rpx;
  518. background: white;
  519. display: flex;
  520. align-items: center;
  521. margin: 24rpx 0;
  522. .tongzhiImg {
  523. width: 86rpx;
  524. height: 96rpx;
  525. }
  526. .columLine {
  527. width: 2rpx;
  528. height: 80rpx;
  529. background: #e7eaf0;
  530. margin: 0 16rpx;
  531. }
  532. .noticeBox {
  533. display: flex;
  534. flex-direction: column;
  535. .noticeItem {
  536. display: flex;
  537. align-items: center;
  538. margin: 8rpx 0;
  539. .noticeTag {
  540. width: 56rpx;
  541. height: 30rpx;
  542. background: #ffffff;
  543. border-radius: 4rpx 4rpx 4rpx 4rpx;
  544. border: 2rpx solid #0365f9;
  545. color: #0365f9;
  546. font-size: 22rpx;
  547. text-align: center;
  548. display: flex;
  549. align-items: center;
  550. justify-content: center;
  551. }
  552. .noticeInfo {
  553. width: 326rpx;
  554. font-size: 24rpx;
  555. color: #18172a;
  556. overflow: hidden;
  557. white-space: nowrap;
  558. text-overflow: ellipsis;
  559. margin: 0 24rpx;
  560. }
  561. .noticeTime {
  562. color: #666666;
  563. font-size: 24rpx;
  564. }
  565. }
  566. }
  567. }
  568. .parkDynamic {
  569. width: 100%;
  570. background: white;
  571. padding: 24rpx;
  572. box-sizing: border-box;
  573. .parkDynamicTab {
  574. display: flex;
  575. padding: 26px 0;
  576. .tabItem {
  577. color: #666666;
  578. font-size: 28rpx;
  579. margin: 0 32rpx;
  580. }
  581. .selectTabItem {
  582. color: #18172a;
  583. border-bottom: 6rpx solid #034df7;
  584. }
  585. }
  586. }
  587. .serviceEvaluation {
  588. width: 100%;
  589. background: white;
  590. padding: 24rpx;
  591. box-sizing: border-box;
  592. margin-top: 24rpx;
  593. .wyInfo {
  594. display: flex;
  595. align-items: center;
  596. justify-content: space-between;
  597. .wyName {
  598. display: flex;
  599. align-items: center;
  600. font-size: 36rpx;
  601. color: rgba(24, 23, 42, 1);
  602. margin: 38rpx 8rpx 24rpx 8rpx;
  603. .wyhead {
  604. width: 88rpx;
  605. height: 88rpx;
  606. margin-right: 24rpx;
  607. }
  608. }
  609. }
  610. .evaluationBox {
  611. width: 702rpx;
  612. height: 196rpx;
  613. //margin: 24rpx;
  614. padding: 42rpx 0 42rpx 48rpx;
  615. background: #f5f7fa;
  616. border-radius: 8rpx;
  617. box-sizing: border-box;
  618. .evaluationBoxName {
  619. font-size: 28rpx;
  620. color: #18172a;
  621. margin-bottom: 32rpx;
  622. }
  623. }
  624. }
  625. .contactInfo {
  626. display: flex;
  627. justify-content: space-between;
  628. align-items: center;
  629. padding: 30rpx 48rpx;
  630. box-sizing: border-box;
  631. background: white;
  632. margin: 4rpx 0 74rpx 0;
  633. .infoBox {
  634. display: flex;
  635. flex-direction: column;
  636. .infoTitle {
  637. color: #666666;
  638. font-size: 28rpx;
  639. margin-bottom: 16rpx;
  640. }
  641. .phoneNumber {
  642. color: #18172a;
  643. font-size: 40rpx;
  644. font-weight: 600;
  645. }
  646. }
  647. .phoneCall {
  648. width: 88rpx;
  649. height: 88rpx;
  650. }
  651. }
  652. .columLineBlue {
  653. width: 10rpx;
  654. height: 32rpx;
  655. background: linear-gradient(180deg, #509fff 0%, #034df7 100%);
  656. border-radius: 1px 1px 1px 1px;
  657. margin-right: 16rpx;
  658. }
  659. .titleName {
  660. color: #18172a;
  661. font-size: 36rpx;
  662. font-weight: 500;
  663. }
  664. .parkDynamicTitle {
  665. display: flex;
  666. align-items: center;
  667. }
  668. .swiperImg{
  669. width: 702rpx;
  670. height: 320rpx;
  671. }
  672. }
  673. </style>