enterpriseSide.vue 19 KB

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