enterpriseSide.vue 17 KB

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