enterpriseSide.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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} 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. },
  197. methods: {
  198. toMap(){
  199. uni.chooseLocation({
  200. success: function (res) {
  201. console.log('选择的位置:', res.name);
  202. console.log('纬度:' + res.latitude + ',经度:' + res.longitude);
  203. // 其他业务逻辑
  204. },
  205. fail: function (error) {
  206. console.error('Choose location failed: ' + JSON.stringify(error));
  207. },
  208. complete: function () {
  209. console.log('chooseLocation operation is complete');
  210. }
  211. });
  212. },
  213. getNotice(){
  214. newNotice().then(res=>{
  215. const newNotice = res.data
  216. newNotice.forEach(e=>{
  217. e.time = this.showtime(e.releaseTime)
  218. })
  219. this.noticeList.push(...res.data)
  220. })
  221. },
  222. showtime(time) {
  223. const date =
  224. typeof time === 'number'
  225. ? new Date(time)
  226. : new Date((time || '').replace(/-/g, '/'))
  227. const diff = (new Date().getTime() - date.getTime()) / 1000
  228. const dayDiff = Math.floor(diff / 86400)
  229. const isValidDate =
  230. Object.prototype.toString.call(date) === '[object Date]' &&
  231. !isNaN(date.getTime())
  232. if (!isValidDate) {
  233. window.console.error('不是有效日期格式')
  234. }
  235. const formatDate = function(date) {
  236. const today = new Date(date)
  237. const year = today.getFullYear()
  238. const month = ('0' + (today.getMonth() + 1)).slice(-2)
  239. const day = ('0' + today.getDate()).slice(-2)
  240. const hour = today.getHours()
  241. const minute = today.getMinutes()
  242. const second = today.getSeconds()
  243. return `${year}-${month}-${day} ${hour}:${minute}:${second}`
  244. }
  245. if (isNaN(dayDiff) || dayDiff < 0) {
  246. return formatDate(date)
  247. }
  248. return (
  249. (dayDiff === 0 &&
  250. ((diff < 60 && '刚刚') ||
  251. (diff < 120 && '1分钟前') ||
  252. (diff < 3600 && Math.floor(diff / 60) + '分钟前') ||
  253. (diff < 7200 && '1小时前') ||
  254. (diff < 86400 && Math.floor(diff / 3600) + '小时前'))) ||
  255. (dayDiff === 1 && '昨天') ||
  256. (dayDiff < 7 && dayDiff + '天前') ||
  257. (dayDiff < 31 && Math.ceil(dayDiff / 7) + '周前') ||
  258. (dayDiff >= 31 && Math.ceil((dayDiff - 30) / 31) + '月前')
  259. )
  260. },
  261. toServiceEva(){
  262. uni.navigateTo({
  263. url:"/pages/subPackages/serviceEvaluation/index",
  264. })
  265. },
  266. toNotice(item) {
  267. // 跳转传参
  268. uni.navigateTo({
  269. url:"/pages/subPackages/propertyNotice/index?type=" + item.type,
  270. })
  271. },
  272. bindPickerChange(e) {
  273. console.log(e);
  274. this.searchArea = this.array[e.detail.value];
  275. },
  276. jumpPage(path, isMustCompany) {
  277. console.log(path);
  278. if (isMustCompany && getUserLocalStorageInfo().userType == 3) {
  279. uni.showModal({
  280. title: "提示",
  281. cancelText: "暂不",
  282. confirmText: "去切换",
  283. content: "您还不是企业用户,请切换登录身份后再进行相关操作。",
  284. success: function (res) {
  285. if (res.confirm) {
  286. uni.navigateTo({
  287. url: "/pages/login2/login",
  288. success: function (e) {
  289. // uni.$emit('userType', 'OK')
  290. },
  291. });
  292. } else if (res.cancel) {
  293. console.log("用户点击取消");
  294. }
  295. },
  296. });
  297. } else {
  298. uni.navigateTo({
  299. url: path,
  300. fail: (fail) => {
  301. console.log(fail);
  302. },
  303. });
  304. }
  305. },
  306. clickTab(item) {
  307. // this.selectTab = item.name;
  308. if (item.name==='周边'){
  309. uni.navigateTo({
  310. url:'/pages/subPackages/peripheralService/index'
  311. })
  312. }else if(item.name==='房源'){
  313. uni.navigateTo({
  314. url:'/pages/subPackages/housingResources/index'
  315. })
  316. }
  317. },
  318. },
  319. };
  320. </script>
  321. <style lang="scss">
  322. .enterpriseSide {
  323. background: #f5f7fa;
  324. .searchTop {
  325. //margin: 24rpx;
  326. background: white;
  327. position: relative;
  328. display: flex;
  329. align-items: center;
  330. .searchArea {
  331. position: relative;
  332. width: 532rpx;
  333. height: 64rpx;
  334. background: #f5f7fa;
  335. border-radius: 32rpx;
  336. padding-left: 68rpx;
  337. font-size: 28rpx;
  338. }
  339. .locationIcon {
  340. position: absolute;
  341. width: 28rpx;
  342. height: 28rpx;
  343. left: 24rpx;
  344. z-index: 10;
  345. }
  346. .dhIcon {
  347. width: 48rpx;
  348. height: 48rpx;
  349. margin-left: 16rpx;
  350. }
  351. .vector {
  352. position: absolute;
  353. width: 16rpx;
  354. height: 8rpx;
  355. left: 552rpx;
  356. }
  357. }
  358. .parkBgBox {
  359. position: relative;
  360. background-repeat: no-repeat;
  361. background-size: 100%;
  362. width: 702rpx;
  363. height: 320rpx;
  364. margin-top: 24rpx;
  365. .parkNameBox {
  366. position: absolute;
  367. box-sizing: border-box;
  368. width: 100%;
  369. height: 64rpx;
  370. background: rgba(3, 19, 41, 0.6);
  371. display: flex;
  372. align-items: center;
  373. padding-left: 24rpx;
  374. bottom: 0;
  375. color: white;
  376. font-size: 28rpx;
  377. border-radius: 0 0 16rpx 16rpx;
  378. }
  379. }
  380. .map2 {
  381. box-sizing: border-box;
  382. //position: absolute;
  383. z-index: 2;
  384. width: 100%;
  385. //height: 770rpx;
  386. //border-radius: 48rpx 48rpx 0rpx 0rpx;
  387. background: white;
  388. //margin-top: 402rpx;
  389. padding: 36rpx 0 0 0;
  390. overflow-y: auto;
  391. display: grid;
  392. grid-template-columns: repeat(5, 1fr);
  393. }
  394. .mapIcon2 {
  395. width: 92rpx;
  396. height: 92rpx;
  397. display: block;
  398. margin: auto;
  399. }
  400. .mapdom2 {
  401. height: 184rpx;
  402. }
  403. .noticeBody {
  404. padding: 24rpx 28rpx;
  405. background: white;
  406. display: flex;
  407. align-items: center;
  408. margin: 24rpx 0;
  409. .tongzhiImg {
  410. width: 86rpx;
  411. height: 96rpx;
  412. }
  413. .columLine {
  414. width: 2rpx;
  415. height: 80rpx;
  416. background: #e7eaf0;
  417. margin: 0 16rpx;
  418. }
  419. .noticeBox {
  420. display: flex;
  421. flex-direction: column;
  422. .noticeItem {
  423. display: flex;
  424. align-items: center;
  425. margin: 8rpx 0;
  426. .noticeTag {
  427. width: 56rpx;
  428. height: 30rpx;
  429. background: #ffffff;
  430. border-radius: 4rpx 4rpx 4rpx 4rpx;
  431. border: 2rpx solid #0365f9;
  432. color: #0365f9;
  433. font-size: 22rpx;
  434. text-align: center;
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. }
  439. .noticeInfo {
  440. width: 326rpx;
  441. font-size: 24rpx;
  442. color: #18172a;
  443. overflow: hidden;
  444. white-space: nowrap;
  445. text-overflow: ellipsis;
  446. margin: 0 24rpx;
  447. }
  448. .noticeTime {
  449. color: #666666;
  450. font-size: 24rpx;
  451. }
  452. }
  453. }
  454. }
  455. .parkDynamic {
  456. width: 100%;
  457. background: white;
  458. padding: 24rpx;
  459. box-sizing: border-box;
  460. .parkDynamicTab {
  461. display: flex;
  462. padding: 26px 0;
  463. .tabItem {
  464. color: #666666;
  465. font-size: 28rpx;
  466. margin: 0 32rpx;
  467. }
  468. .selectTabItem {
  469. color: #18172a;
  470. border-bottom: 6rpx solid #034df7;
  471. }
  472. }
  473. }
  474. .serviceEvaluation {
  475. width: 100%;
  476. background: white;
  477. padding: 24rpx;
  478. box-sizing: border-box;
  479. margin-top: 24rpx;
  480. .wyInfo {
  481. display: flex;
  482. align-items: center;
  483. justify-content: space-between;
  484. .wyName {
  485. display: flex;
  486. align-items: center;
  487. font-size: 36rpx;
  488. color: rgba(24, 23, 42, 1);
  489. margin: 38rpx 8rpx 24rpx 8rpx;
  490. .wyhead {
  491. width: 88rpx;
  492. height: 88rpx;
  493. margin-right: 24rpx;
  494. }
  495. }
  496. }
  497. .evaluationBox {
  498. width: 702rpx;
  499. height: 196rpx;
  500. //margin: 24rpx;
  501. padding: 42rpx 0 42rpx 48rpx;
  502. background: #f5f7fa;
  503. border-radius: 8rpx;
  504. box-sizing: border-box;
  505. .evaluationBoxName {
  506. font-size: 28rpx;
  507. color: #18172a;
  508. margin-bottom: 32rpx;
  509. }
  510. }
  511. }
  512. .contactInfo {
  513. display: flex;
  514. justify-content: space-between;
  515. align-items: center;
  516. padding: 30rpx 48rpx;
  517. box-sizing: border-box;
  518. background: white;
  519. margin: 4rpx 0 74rpx 0;
  520. .infoBox {
  521. display: flex;
  522. flex-direction: column;
  523. .infoTitle {
  524. color: #666666;
  525. font-size: 28rpx;
  526. margin-bottom: 16rpx;
  527. }
  528. .phoneNumber {
  529. color: #18172a;
  530. font-size: 40rpx;
  531. font-weight: 600;
  532. }
  533. }
  534. .phoneCall {
  535. width: 88rpx;
  536. height: 88rpx;
  537. }
  538. }
  539. .columLineBlue {
  540. width: 10rpx;
  541. height: 32rpx;
  542. background: linear-gradient(180deg, #509fff 0%, #034df7 100%);
  543. border-radius: 1px 1px 1px 1px;
  544. margin-right: 16rpx;
  545. }
  546. .titleName {
  547. color: #18172a;
  548. font-size: 36rpx;
  549. font-weight: 500;
  550. }
  551. .parkDynamicTitle {
  552. display: flex;
  553. align-items: center;
  554. }
  555. }
  556. </style>