enterpriseSide.vue 15 KB

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