enterpriseSide.vue 20 KB

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