enterpriseSide.vue 16 KB

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