index.wpy 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158
  1. <style lang="less">
  2. page {
  3. height: 100%;
  4. background-color: #f7f8fa;
  5. }
  6. .map-wrap {
  7. position: absolute;
  8. top: 0;
  9. left: 0;
  10. width: 100%;
  11. bottom: 0;
  12. z-index: 1;
  13. }
  14. .pageBottom {
  15. display: flex;
  16. align-items: flex-end;
  17. height: 1000rpx;
  18. .log-text {
  19. display: block;
  20. margin: 0 auto;
  21. width: 176rpx;
  22. height: 40rpx;
  23. padding: 98rpx 0 80rpx;
  24. }
  25. }
  26. /deep/ .van-transition {
  27. background: red;
  28. }
  29. .navFixed {
  30. position: fixed;
  31. top: 104rpx;
  32. left: 0;
  33. right: 0;
  34. background: #ffffff;
  35. }
  36. .bg-img {
  37. width: 100%;
  38. position: absolute;
  39. top: 0;
  40. left: 0;
  41. background: #f7f8fa;
  42. }
  43. .roomImgWrap {
  44. position: absolute;
  45. left: 0;
  46. right: 0;
  47. top: -185px;
  48. border-top-left-radius: 40rpx;
  49. border-top-right-radius: 40rpx;
  50. width: 662rpx;
  51. height: 185px;
  52. margin: 0 auto;
  53. background: #fff;
  54. padding: 5px 5px 0;
  55. box-sizing: border-box;
  56. overflow: hidden;
  57. .room-img {
  58. border-top-left-radius: 40rpx;
  59. border-top-right-radius: 40rpx;
  60. width: 100%;
  61. height: 100%;
  62. }
  63. }
  64. .opacityTrans {
  65. opacity: 0;
  66. }
  67. .office-header {
  68. position: absolute;
  69. z-index: 1;
  70. background-color: rgba(255, 255, 255, 0.596637);
  71. width: 42px;
  72. height: 32px;
  73. border-radius: 32px;
  74. margin-left: 10px;
  75. }
  76. .my-class:after {
  77. content: '.';
  78. display: block;
  79. height: 0;
  80. clear: both;
  81. visibility: hidden;
  82. }
  83. .g-fl {
  84. display: flex;
  85. justify-content: center;
  86. align-items: center;
  87. }
  88. .g-fl-c {
  89. flex-direction: column;
  90. }
  91. .overflow-wrap {
  92. width: 100%;
  93. height: 100%;
  94. scroll-view {
  95. position: relative;
  96. width: 100%;
  97. height: 100%;
  98. z-index: 2;
  99. }
  100. }
  101. .overflowclass {
  102. height: 100%;
  103. overflow: hidden;
  104. }
  105. .move-wrap {
  106. width: 100%;
  107. background: #f7f8fa;
  108. position: relative;
  109. top: 0;
  110. left: 0;
  111. z-index: 2;
  112. }
  113. .maproom-detail {
  114. width: 750rpx;
  115. margin-left: -45rpx;
  116. height: 125px;
  117. position: relative;
  118. background: #fff;
  119. border-bottom: 10rpx solid #ffffff;
  120. box-shadow: 0rpx 0rpx 4rpx rgba(0, 0, 0, 0.07),
  121. 0px 8rpx 20rpx rgba(0, 0, 0, 0.15);
  122. box-sizing: border-box;
  123. border-top-left-radius: 50rpx;
  124. border-top-right-radius: 50rpx;
  125. .office-room-info {
  126. position: relative;
  127. }
  128. .room-envlist {
  129. justify-content: space-around;
  130. .env-name {
  131. font-family: Montserrat;
  132. font-weight: 600;
  133. font-size: 24rpx;
  134. line-height: 30rpx;
  135. color: #c4c4c4;
  136. }
  137. .env-num {
  138. font-family: Montserrat;
  139. font-size: 48rpx;
  140. line-height: 58rpx;
  141. text-align: center;
  142. color: #1b144e;
  143. }
  144. .env-level {
  145. font-family: PingFang SC;
  146. font-size: 20rpx;
  147. line-height: 28rpx;
  148. color: #bab8c7;
  149. }
  150. }
  151. .upToSpace {
  152. display: flex;
  153. align-items: center;
  154. justify-content: center;
  155. padding-top: 24rpx;
  156. .imgSt {
  157. width: 24rpx;
  158. height: 24rpx;
  159. }
  160. .text {
  161. color: #8b949e;
  162. font-family: PingFang SC;
  163. font-size: 24rpx;
  164. font-style: normal;
  165. font-weight: 400;
  166. line-height: 40rpx;
  167. }
  168. }
  169. }
  170. .office-container {
  171. width: 662rpx;
  172. margin: 0 auto;
  173. }
  174. .room-detail {
  175. position: relative;
  176. width: 100%;
  177. background: #ffffff;
  178. margin-bottom: 15px;
  179. box-sizing: border-box;
  180. box-shadow: 0rpx 0rpx 4rpx rgba(0, 0, 0, 0.07),
  181. 0px 8rpx 20rpx rgba(0, 0, 0, 0.05);
  182. border-bottom-left-radius: 50rpx;
  183. border-bottom-right-radius: 50rpx;
  184. .sceneBox {
  185. height: 92px;
  186. box-sizing: border-box;
  187. border-top: 1px solid rgba(196, 196, 196, 0.4);
  188. display: flex;
  189. justify-content: space-around;
  190. align-items: center;
  191. padding: 0 40rpx;
  192. .eachScene {
  193. width: 180rpx;
  194. height: 116rpx;
  195. background: rgba(159, 183, 205, 0.15);
  196. border-radius: 16px;
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. flex-shrink: 0;
  201. &.selScene {
  202. background: rgba(61, 203, 204, 0.3);
  203. }
  204. &.firstScene {
  205. width: auto;
  206. margin-right: 18rpx;
  207. flex-grow: 1;
  208. }
  209. image {
  210. width: 40rpx;
  211. height: 40rpx;
  212. margin-right: 18rpx;
  213. }
  214. }
  215. }
  216. .office-room-info {
  217. position: relative;
  218. // background: #fff;
  219. }
  220. .room-envlist {
  221. justify-content: space-around;
  222. padding-bottom: 32rpx;
  223. .env-name {
  224. font-family: Montserrat;
  225. font-weight: 600;
  226. font-size: 24rpx;
  227. line-height: 30rpx;
  228. color: #c4c4c4;
  229. }
  230. .env-num {
  231. font-family: Montserrat;
  232. font-size: 48rpx;
  233. line-height: 58rpx;
  234. text-align: center;
  235. color: #1b144e;
  236. }
  237. .env-level {
  238. font-family: PingFang SC;
  239. font-size: 20rpx;
  240. line-height: 28rpx;
  241. color: #bab8c7;
  242. }
  243. }
  244. }
  245. .nav-shadow {
  246. // box-shadow: 0px 8px 10px rgba(0, 0, 0, 0.1) ;
  247. box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(0, 0, 0, 0.1);
  248. }
  249. .navBox {
  250. position: fixed;
  251. bottom: 30px;
  252. left: 20rpx;
  253. right: 20rpx;
  254. z-index: 2;
  255. height: 96rpx;
  256. box-sizing: border-box;
  257. padding: 0 40rpx 0 20rpx;
  258. border-radius: 96rpx;
  259. font-size: 28rpx;
  260. background: #ffffff;
  261. box-shadow: 0px 0px 2rpx rgba(0, 0, 0, 0.15),
  262. 0px 8rpx 6rpx rgba(0, 0, 0, 0.07);
  263. display: flex;
  264. justify-content: space-between;
  265. align-items: center;
  266. .eq-nav {
  267. flex: 1;
  268. box-sizing: border-box;
  269. padding-right: 76rpx;
  270. display: flex;
  271. justify-content: space-around;
  272. .nav-item {
  273. width: 58rpx;
  274. .nav-text {
  275. position: relative;
  276. font-family: PingFang SC;
  277. font-size: 28rpx;
  278. font-weight: 400;
  279. line-height: 44rpx;
  280. color: #626c78;
  281. }
  282. }
  283. .nav-item-active {
  284. .nav-text {
  285. font-weight: 600;
  286. color: #1b2129;
  287. }
  288. .nav-text::after {
  289. content: '';
  290. position: absolute;
  291. bottom: 0px;
  292. left: 50%;
  293. transform: translateX(-50%);
  294. display: inline-block;
  295. width: 20rpx;
  296. height: 4rpx;
  297. border-radius: 4px;
  298. background: #3dcbcc;
  299. }
  300. }
  301. }
  302. .map-nav {
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. width: 208rpx;
  307. height: 64rpx;
  308. border-radius: 32rpx;
  309. gap: 8rpx;
  310. background: #ebeef5;
  311. image {
  312. width: 40rpx;
  313. height: 40rpx;
  314. }
  315. }
  316. }
  317. .top-nav {
  318. position: fixed;
  319. top: 72px;
  320. z-index: 4;
  321. background: #f7f8fa;
  322. padding: 6rpx 45rpx 0;
  323. padding-bottom: 10rpx;
  324. box-sizing: border-box;
  325. }
  326. .popup-box {
  327. padding: 40rpx 46rpx;
  328. }
  329. .scene-popup {
  330. width: 520rpx;
  331. height: 860rpx;
  332. background: linear-gradient(0deg, #fff 720rpx, #f3f3f3 140rpx);
  333. &.air-popup {
  334. width: 560rpx;
  335. height: 720rpx;
  336. background: linear-gradient(
  337. 0deg,
  338. #fff 580rpx,
  339. rgba(243, 243, 243, 1) 140rpx
  340. );
  341. }
  342. .scene-popup-head {
  343. padding-top: 30rpx;
  344. display: flex;
  345. flex-direction: column;
  346. justify-content: center;
  347. align-items: center;
  348. font-size: 38rpx;
  349. .head-imgbg {
  350. display: flex;
  351. justify-content: center;
  352. align-items: center;
  353. width: 140rpx;
  354. height: 140rpx;
  355. background: #f0da21;
  356. border-radius: 50%;
  357. margin-bottom: 30rpx;
  358. &.grey {
  359. background: rgba(196, 196, 196, 1);
  360. }
  361. &.blue {
  362. background: rgba(94, 139, 207, 1);
  363. }
  364. &.red {
  365. background: rgba(229, 87, 79, 1);
  366. }
  367. .air-head-imgbox {
  368. width: 72rpx;
  369. height: 72rpx;
  370. image {
  371. width: 100%;
  372. height: 100%;
  373. }
  374. }
  375. .head-imgbox {
  376. width: 40rpx;
  377. height: 40rpx;
  378. image {
  379. width: 100%;
  380. height: 100%;
  381. }
  382. }
  383. }
  384. }
  385. }
  386. .allclose-popup {
  387. height: auto;
  388. padding-bottom: 60rpx;
  389. .scene-popup-head {
  390. // height: 340rpx ;
  391. box-sizing: border-box;
  392. background: linear-gradient(180deg, #f3f3f3 60px, #fff 60px);
  393. padding-bottom: 80rpx;
  394. }
  395. .head-imgbg {
  396. // margin-bottom: 40rpx ;
  397. }
  398. .head-title {
  399. padding: 0 50rpx;
  400. text-align: center;
  401. }
  402. .close-popup-body {
  403. padding-left: 72rpx;
  404. height: 80px;
  405. box-sizing: border-box;
  406. padding-right: 20rpx;
  407. .close-item {
  408. font-style: normal;
  409. font-size: 28rpx;
  410. color: #c4c4c4;
  411. margin-bottom: 18rpx;
  412. display: flex;
  413. .close-pic {
  414. width: 20px;
  415. text-align: center;
  416. }
  417. .passIcon {
  418. color: #07c160;
  419. vertical-align: middle;
  420. }
  421. .pointer {
  422. display: inline-block;
  423. width: 8px;
  424. height: 8px;
  425. border-radius: 8px;
  426. background: #f0da21;
  427. }
  428. }
  429. .allclose-btns {
  430. padding-top: 20rpx;
  431. }
  432. }
  433. }
  434. .btns {
  435. display: flex;
  436. position: absolute;
  437. bottom: 40rpx;
  438. left: 50%;
  439. transform: translateX(-50%);
  440. .btn {
  441. width: 240rpx;
  442. height: 80rpx;
  443. line-height: 80rpx;
  444. text-align: center;
  445. font-size: 28rpx;
  446. font-weight: 500;
  447. color: #c4c4c4;
  448. }
  449. .btn_com {
  450. border: 1px solid #c4c4c4;
  451. border-radius: 60rpx;
  452. }
  453. }
  454. .popup-btns {
  455. display: flex;
  456. width: 100%;
  457. justify-content: center;
  458. .btnspan {
  459. width: 170rpx;
  460. height: 80rpx;
  461. line-height: 80rpx;
  462. text-align: center;
  463. font-size: 28rpx;
  464. font-weight: 500;
  465. color: #c4c4c4;
  466. box-sizing: border-box;
  467. }
  468. .btn_com {
  469. border: 1px solid #c4c4c4;
  470. border-radius: 60rpx;
  471. }
  472. .surespan {
  473. margin-left: 26rpx;
  474. background: #f0da21;
  475. box-shadow: 0 8rpx 12rpx rgba(0, 0, 0, 0.07);
  476. color: #000000;
  477. border-radius: 60rpx;
  478. }
  479. }
  480. </style>
  481. <template>
  482. <div
  483. class="overflow-wrap"
  484. style="position: {{airHandVisible ? 'fixed':'static'}};"
  485. >
  486. <page-top-bar-custom
  487. @component-page-top-bar-custom-ready="setTopBarHeight"
  488. :bgColor="[navFixed? '#f7f8fa' : 'transparent']"
  489. >
  490. <div
  491. class="office-header"
  492. @click="goPre"
  493. >
  494. <van-icon
  495. style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);"
  496. name="arrow-left"
  497. />
  498. </div>
  499. </page-top-bar-custom>
  500. <scroll-view
  501. id="scroll-view"
  502. scroll-y="{{canscroll}}"
  503. enhanced
  504. scroll-anchoring
  505. show-scrollbar="{{false}}"
  506. bounces="{{false}}"
  507. scroll-top="{{scrollTop}}"
  508. bindscroll="scrollEvent"
  509. scroll-with-animation="true"
  510. bindscrolltoupper="scrollToUpper"
  511. >
  512. <div
  513. class="map-wrap"
  514. v-show="transY"
  515. >
  516. <!-- <map-home v-if="userInfo&& userInfo.userId" -->
  517. <map-home @mapChangeSpaceInfo="mapChangeSpaceInfo"
  518. :space="userControlSpace"
  519. ></map-home>
  520. </div>
  521. <div
  522. class="move-wrap"
  523. style="transform: translateY({{transY}}px);top:{{topBarHeight+roomPicTop}}px;"
  524. bindtouchstart="touchstart"
  525. bindtouchmove="touchmove"
  526. bindtouchend="touchend"
  527. >
  528. <div
  529. style="opacity:{{opacityV}}"
  530. v-show="!moveToBottom"
  531. >
  532. <image
  533. class="bg-img"
  534. style="top:{{-topBarHeight-roomPicTop}}px;height:{{topBarHeight+roomPicTop}}px"
  535. :src="topbgimg"
  536. />
  537. </div>
  538. <div
  539. style="opacity:{{opacityV}}"
  540. v-show="!moveToBottom"
  541. class="roomImgWrap"
  542. >
  543. <image
  544. class="room-img"
  545. :src="h5StaticPath+headImg"
  546. mode="widthFix"
  547. />
  548. </div>
  549. <div class="office-container">
  550. <!-- 空间基本情况 -->
  551. <div
  552. class="maproom-detail"
  553. v-show="moveToBottom"
  554. >
  555. <div class="upToSpace"
  556. v-if="isSpaceCanControl">
  557. <image
  558. class="imgSt"
  559. src="{{h5StaticPath}}icon-double-arrow.svg"
  560. />
  561. <span class="text">上滑进入空间</span>
  562. </div>
  563. <space-basic
  564. :isSpaceCanControl="isSpaceCanControl"
  565. :IsShowPerson="false"
  566. :officeData="officeData"
  567. :options="options"
  568. :userInfo="userInfo"
  569. :userControlSpace="userControlSpace"
  570. ></space-basic>
  571. </div>
  572. <!-- 空间基本情况 -->
  573. <div
  574. id="roomDetail"
  575. class="room-detail"
  576. v-show="!moveToBottom"
  577. >
  578. <space-basic
  579. :IsShowPerson="true"
  580. :officeData="officeData"
  581. :options="options"
  582. :userInfo="userInfo"
  583. :userControlSpace="userControlSpace"
  584. ></space-basic>
  585. <!-- 空间信息 -->
  586. <div class="office-room-info">
  587. <div class="room-envlist g-fl">
  588. <div
  589. class="g-fl g-fl-c"
  590. v-for="(item,idx) in envlist"
  591. :key="idx"
  592. @tap.stop="handleDetail(item)"
  593. >
  594. <span class="env-name">{{item.name}}</span>
  595. <span class="env-num">{{item.num }}</span>
  596. <span class="env-level">{{item.level ? item.level :'--'}}</span>
  597. </div>
  598. </div>
  599. </div>
  600. <div
  601. class="sceneBox"
  602. v-if="popList.length>0 && options.roomType =='会议室'"
  603. >
  604. <div
  605. v-for="(item,idx) in popList"
  606. class="eachScene"
  607. :class="{'selScene':vanPopupIndex==item.code,'firstScene':idx==0&&popList.length==2}"
  608. :key="idx"
  609. @click="handleScene(item,idx)"
  610. >
  611. <image :src="h5StaticPath+item.headImg" />
  612. <span>{{item.name}}</span>
  613. </div>
  614. </div>
  615. <div v-if="roomHasScene && options.roomType =='开放'">
  616. <work-scene-hand
  617. @component-open-workTimePop="handlePopup"
  618. @component-get-workTimeData="getWorkDayTime"
  619. @component-open-sceneShowpop="handleWorkOff"
  620. @component-EquipType-workTimePop="dialogShowEquipType"
  621. :workDayTime="workDayTime"
  622. ></work-scene-hand>
  623. </div>
  624. </div>
  625. <all-close
  626. @showAllClose="showAllClose"
  627. :projectId="projectId"
  628. :floorInfo="floorInfo"
  629. v-if="(nowTime>eightTime||nowTime<sixTime)&&projectId=='Pj1101080259'"
  630. ref="allclose"
  631. ></all-close>
  632. <air-hand-card
  633. ref="airHandCard"
  634. v-if="spaceEqFlagObj.hasAir"
  635. id="inToView02"
  636. :cardWidth="cardWidth"
  637. :airVisible="airVisible"
  638. :roomHasScene="roomHasScene"
  639. :hasAir="spaceEqFlagObj.hasAir"
  640. :equipConfig="equipmentsConfig"
  641. :objectId="options.spaceId"
  642. :roomType="options.roomType"
  643. :projectId="projectId"
  644. :temperature="officeData.temperature"
  645. :isACATVA="isACATVA"
  646. :isACATFC="isACATFC"
  647. @showDetail="handleDetail"
  648. @airShowVisible="airShowVisible"
  649. @component-open-workTimePop="handlePopup"
  650. @component-EquipType-workTimePop="dialogShowEquipType"
  651. @airTemp="airTemp"
  652. @setCanScroll="setCanScroll"
  653. @component-open-airHand-pop="openAirHandPop"
  654. v-bind:key="airKey"
  655. ></air-hand-card>
  656. <!-- 地暖 -->
  657. <div v-show="floorHeatData.len">
  658. <Floor-Heating
  659. id="inToView5"
  660. :cardWidth="cardWidth"
  661. @component-open-floorFeat-pop="openFloorFeatPop"
  662. @component-floorHeat-data="getFloorHeatData"
  663. :spaceId="options.spaceId"
  664. ></Floor-Heating>
  665. </div>
  666. <!-- 光照调节卡片 -->
  667. <lamp-adjust
  668. v-if="spaceEqFlagObj.hasLamp"
  669. id="inToView1"
  670. ref="lampAdjust"
  671. :roomHasScene="roomHasScene"
  672. :lampHide="lampHide"
  673. :spaceId="options.spaceId"
  674. :roomType="options.roomType"
  675. :controlMode="controlMode"
  676. :equipConfig="equipmentsConfig"
  677. @component-open-colourPop="openColourPop"
  678. @component-open-workTimePop="handlePopup"
  679. @component-EquipType-workTimePop="dialogShowEquipType"
  680. v-bind:key="lampKey"
  681. ></lamp-adjust>
  682. <!-- 窗帘卡片 -->
  683. <div v-show="spaceEqFlagObj.hasCurtain">
  684. <curtain-card
  685. id="inToView2"
  686. :projectId="projectId"
  687. :spaceId="options.spaceId"
  688. :curtainVisible="curtainVisible"
  689. @comments-curtain-len="showCurtain"
  690. @commponents-curtain-showPop="showCurtainPop"
  691. >
  692. </curtain-card>
  693. </div>
  694. <!-- 智能插座卡片 -->
  695. <div v-show="spaceEqFlagObj.hasSocket">
  696. <socket-card
  697. id="inToView3"
  698. :roomHasScene="roomHasScene"
  699. :roomType="options.roomType"
  700. :controlMode="controlMode"
  701. :projectId="projectId"
  702. :spaceId="options.spaceId"
  703. @component-showSocket="showSocket"
  704. @component-open-workTimePop="handlePopup"
  705. @component-EquipType-workTimePop="dialogShowEquipType"
  706. >
  707. </socket-card>
  708. </div>
  709. <!-- 声压卡片 -->
  710. <voice-adjust id="inToView4"></voice-adjust>
  711. <!-- 页面到底标志 -->
  712. <div
  713. class="pageBottom"
  714. :style="{height:windowHeightpx / 2+'px'}"
  715. >
  716. <!-- <image
  717. class="log-text"
  718. src="{{h5StaticLogo}}/page-home/tenatslink.svg"
  719. /> -->
  720. </div>
  721. </div>
  722. </div>
  723. </scroll-view>
  724. <!-- 窗帘 -->
  725. <van-popup
  726. overlay-style="background: rgba(0, 0, 0, 0.4)"
  727. custom-style="height: 55%"
  728. round
  729. :show="curtainVisible"
  730. position="bottom"
  731. @close="curtainVisible = false"
  732. >
  733. <div style="display:flex;justify-content: center;">
  734. <Curtain-Pop
  735. :curtainVisible="curtainVisible"
  736. :typeobj="crutainType"
  737. >
  738. </Curtain-Pop>
  739. </div>
  740. </van-popup>
  741. <!-- 地暖 -->
  742. <van-popup
  743. overlay-style="background: rgba(0, 0, 0, 0.4)"
  744. custom-style="height: 55%"
  745. round
  746. :show="floorfeatVisible"
  747. position="bottom"
  748. @close="floorfeatVisible = false"
  749. >
  750. <div style="display:flex;justify-content: center;">
  751. <Floor-Pop
  752. :floorfeatVisible="floorfeatVisible"
  753. :floorFeatItem="floorFeatItem"
  754. :maxValue="floorHeatData.maxValue"
  755. :minValue="floorHeatData.minValue"
  756. ></Floor-Pop>
  757. </div>
  758. </van-popup>
  759. <!-- 空调 -->
  760. <van-popup
  761. overlay-style="background: rgba(0, 0, 0, 0.4)"
  762. :custom-style="'height:'+airPopHight+'%'"
  763. round
  764. :show="airHandVisible"
  765. position="bottom"
  766. @close="airHandVisible = false"
  767. >
  768. <div style="display:flex;justify-content: center;">
  769. <airHand-Pop
  770. :airHandItem="airHandItem"
  771. :maxValue="airHandData.maxValue"
  772. :minValue="airHandData.minValue"
  773. :roomType="options.roomType"
  774. @change-airHand-order="changeAirHandOrder"
  775. ></airHand-Pop>
  776. </div>
  777. </van-popup>
  778. <!-- 灯控色温 -->
  779. <van-popup
  780. overlay-style="background: rgba(0, 0, 0, 0.4)"
  781. custom-style="height: 55%"
  782. round
  783. :show="colourVisible"
  784. position="bottom"
  785. @close="colourVisible = false"
  786. >
  787. <div style="display:flex;justify-content: center;">
  788. <lamp-colour
  789. v-if="colourVisible"
  790. :colourObj="colourConfig"
  791. ></lamp-colour>
  792. </div>
  793. </van-popup>
  794. <!-- 空调反馈 文案 -->
  795. <van-popup
  796. overlay-style="background: rgba(0, 0, 0, 0.4)"
  797. round
  798. :show="airVisible"
  799. :close-on-click-overlay="false"
  800. @close="airVisible = false"
  801. >
  802. <air-feedback
  803. @component-open-sceneShowpop="airVisible = false;"
  804. :airSetText="airSetText"
  805. :officeData="officeData"
  806. />
  807. </van-popup>
  808. <!-- 浮层场景 popUp 手动 -->
  809. <van-popup
  810. :custom-style="'height:'+handPopHight+'%'"
  811. overlay-style="background: rgba(0, 0, 0, 0.4)"
  812. position="bottom"
  813. round
  814. :show="visible"
  815. @close="handlePopup(false)"
  816. >
  817. <div
  818. class="popup-box"
  819. v-if="options.roomType =='开放' && visible"
  820. >
  821. <work-overtime-hand
  822. @component-close-visible="handlePopup"
  823. @component-get-workTime="getWorkDayTime"
  824. @component-set-countDown="handlecountDown"
  825. :equipConfig="equipmentsConfig"
  826. :visible="visible"
  827. :localName="officeData.localName"
  828. :bookEquipList="bookEquipList"
  829. :workDayTime="workDayTime"
  830. :objectId="options.spaceId"
  831. :countDownTwoMin="countDownTwoMin"
  832. >
  833. </work-overtime-hand>
  834. </div>
  835. </van-popup>
  836. <!--场景 - 详情 -->
  837. <van-popup
  838. overlay-style="background: rgba(0, 0, 0, 0.4)"
  839. round
  840. :show="sceneShow"
  841. @close="hideScene"
  842. >
  843. <!-- 我要离开 -开放办公区 -->
  844. <work-off
  845. style="width:560rpx"
  846. v-if="options.roomType =='开放' && isWorkOff"
  847. :sceneShow="sceneShow"
  848. @component-open-sceneShowpop="handleWorkOff"
  849. >
  850. </work-off>
  851. <!--场景 - 详情 -->
  852. <div
  853. v-if="options.roomType !='开放'"
  854. class="meet-popup"
  855. >
  856. <pop-scene
  857. :sceneDetail="sceneDetail"
  858. @close-scene-show="hideScene"
  859. >
  860. </pop-scene>
  861. </div>
  862. </van-popup>
  863. <van-popup
  864. overlay-style="background: rgba(0, 0, 0, 0.4);"
  865. round
  866. :show="closeAllShow"
  867. @close="hideCloseAll"
  868. >
  869. <div class="scene-popup allclose-popup">
  870. <div class="scene-popup-head">
  871. <div class="head-imgbg">
  872. <div class="head-imgbox">
  873. <image src="{{h5StaticPath}}scene_visitor.svg" />
  874. </div>
  875. </div>
  876. <div v-show="!closeStatus">请确认办公室已经无人</div>
  877. <div
  878. class="head-title"
  879. v-show="closeStatus&&closeShowNum<5"
  880. >您工作辛苦了,感谢为低碳事业做出的贡献</div>
  881. <div v-show="closeShowNum==5">请确认所有门窗已关闭</div>
  882. </div>
  883. <div
  884. class="close-popup-body"
  885. v-show="closeStatus&&closeShowNum<5"
  886. >
  887. <div class="close-item">
  888. <div class="close-pic">
  889. <van-icon
  890. name="passed"
  891. class="passIcon"
  892. v-if="closeShowNum!==1"
  893. />
  894. <span
  895. class="pointer"
  896. v-if="closeShowNum==1"
  897. ></span>
  898. </div>
  899. <span>小飒正关闭办公室内设备 </span>
  900. </div>
  901. <div
  902. class="close-item"
  903. v-show="closeShowNum==3||closeShowNum==4"
  904. >
  905. <div class="close-pic">
  906. <van-icon
  907. name="passed"
  908. class="passIcon"
  909. v-if="closeShowNum==4"
  910. />
  911. <span
  912. class="pointer"
  913. v-if="closeShowNum==3"
  914. ></span>
  915. </div>
  916. <span>暂时保留方便您离开的灯光</span>
  917. </div>
  918. </div>
  919. <div class="popup-btns allclose-btns">
  920. <span
  921. class="btnspan btn_com"
  922. v-show="!closeStatus"
  923. @click="hideCloseAll"
  924. >取消</span>
  925. <span
  926. class="btnspan surespan"
  927. v-show="!closeStatus"
  928. @click="sureCloseAll"
  929. >确认</span>
  930. <span
  931. class="btnspan btn_com"
  932. v-show="closeStatus&&closeShowNum==5"
  933. @click="hideCloseAll"
  934. >隐藏</span>
  935. </div>
  936. </div>
  937. </van-popup>
  938. <div
  939. id="navId"
  940. class="navBox"
  941. v-show="!moveToBottom"
  942. >
  943. <div class="eq-nav">
  944. <div
  945. v-for="(item,index) in navList"
  946. :id="item.id"
  947. @click.stop="selectCrad"
  948. :key="index"
  949. class="nav-item"
  950. :class="{'nav-item-active':navId==index}"
  951. v-if="!item.noShow"
  952. >
  953. <div class="nav-text">
  954. <span>{{item.name}}</span>
  955. </div>
  956. </div>
  957. </div>
  958. <div
  959. class="map-nav"
  960. @tap="toRoom"
  961. >
  962. <image
  963. src="{{h5StaticPath}}n_icon_nav_map.svg"
  964. mode="widthFix"
  965. />
  966. <div>进入地图</div>
  967. </div>
  968. </div>
  969. <set-permanent
  970. v-show="userControlSpace.isControlSpace === 3 && this.routeParams.from==='homeSetSpace'"
  971. :show="isShowPermanent"
  972. @component-permanent-panel-close="closePermanentPanel(false)"
  973. >
  974. </set-permanent>
  975. </div>
  976. </template>
  977. <script>
  978. import wepy from '@wepy/core'
  979. import store from '@/store'
  980. import { mapState, mapActions } from '@wepy/x'
  981. import { checkUserControl } from '@/service/user.js'
  982. import moment from 'moment'
  983. import {
  984. getSpaceAdjustList,
  985. getWeather,
  986. getEquipmentListHttp,
  987. getMeetingSceneHttp,
  988. switchoverSceneHttp,
  989. querySpaceSceneConfigHttp,
  990. queryCustomAndScence,
  991. queryEquipmentRunConfig
  992. } from '../../api/officehome.js'
  993. import { checkHasUserInfo } from '@/service/user'
  994. import { isWithinLocation } from '@/service/location'
  995. import config from '@/config'
  996. let spaceInfoStatusTimer = null
  997. const switchPanelHeight = 125 // 145是下面块的高
  998. const roomPicTop = 185 // 135是建筑图片的高度 单位都是px
  999. var moveY
  1000. let timerTwoMin = null
  1001. let initListSen = [
  1002. {
  1003. id: 0,
  1004. code: 'DISCUSSING',
  1005. name: '讨论',
  1006. headImg: 'discuss.svg',
  1007. img: 'discuss.png',
  1008. checked: true,
  1009. textObj: [
  1010. {
  1011. text: '已为您切换至适宜讨论的环境',
  1012. status: 'ok'
  1013. }
  1014. ]
  1015. },
  1016. {
  1017. id: 1,
  1018. code: 'PROJECTING',
  1019. name: '投影',
  1020. headImg: 'shadow2.svg',
  1021. img: 'shadow2.png',
  1022. checked: false,
  1023. textObj: [
  1024. {
  1025. text: '已为您切换至适宜演示的环境',
  1026. status: 'ok'
  1027. }
  1028. ]
  1029. },
  1030. {
  1031. id: 2,
  1032. code: 'ADJOURNMENT',
  1033. name: '散会',
  1034. headImg: 'beover.svg',
  1035. img: 'beover.png',
  1036. checked: false,
  1037. textObj: [
  1038. {
  1039. text: '会议室内设备已切换至节能模式',
  1040. status: 'ok'
  1041. }
  1042. ]
  1043. }
  1044. ]
  1045. wepy.page({
  1046. store,
  1047. data: {
  1048. sceneShow: false,
  1049. isShowPermanent: false,
  1050. isUserControlFromMap: true,
  1051. userControlSpace: {}, // 用户控制空间
  1052. cardWidth: 0, // 动态获取卡片的宽度
  1053. floorFeatItem: {}, // 地暖弹窗数据
  1054. airHandItem: {},
  1055. airPopHight: 0,
  1056. airHandData: {
  1057. maxValue: 0,
  1058. minValue: 0
  1059. }, // 地暖数据
  1060. floorHeatData: {
  1061. maxValue: 0,
  1062. minValue: 0,
  1063. len: false
  1064. }, // 地暖数据
  1065. floorfeatVisible: false, // 地暖弹窗
  1066. airHandVisible: false, // 空调手动弹窗
  1067. curtainVisible: false, // 窗帘弹窗
  1068. crutainType: {
  1069. btnArr: [],
  1070. data: [],
  1071. curtainName: '窗帘'
  1072. },
  1073. vanPopupIndex: '',
  1074. colourConfig: {}, // 色温设置
  1075. colourVisible: false, // 色温弹窗
  1076. equipmentsConfig: [], // 设备配置
  1077. countDownTwoMin: 120, // 倒计时两分钟
  1078. workDayTime: {}, // 开放办公区 时间
  1079. closeStatus: false, // 点击了关闭确认按钮
  1080. closeShowNum: 0,
  1081. closeAllShow: false,
  1082. airKey: 1,
  1083. lampKey: 1,
  1084. nowScrollY: 0,
  1085. canscroll: true,
  1086. scrollTop: 0,
  1087. realScrollTop: 0,
  1088. transY: 0,
  1089. opacityV: 1,
  1090. transYCopy: 0,
  1091. windowHeightpx: 0,
  1092. startY: 0,
  1093. movesign: false,
  1094. scale: 1,
  1095. moveToBottom: false,
  1096. floorInfo: [],
  1097. h5StaticPath: config.h5StaticPath + '/page-officehome/',
  1098. h5StaticLogo: config.h5StaticPath,
  1099. lampHide: false, // 灯列表收起
  1100. topbgimg: null, // 头部背景
  1101. navFixed: false, // 滑动置顶
  1102. showWorkOff: false, // 开放办公室的 提前关闭是否展示
  1103. officeData: null,
  1104. headScene: '', // 头部文案
  1105. headImg: '', // 头部背景图片
  1106. options: { roomType: null, spaceId: '' }, // 本地数据
  1107. popList: [],
  1108. // 上班=ATWORK 讨论=DISCUSSING 投影=PROJECTING 散会=ADJOURNMENT 下班=OFFWORK
  1109. meetingRoomSence: [
  1110. { code: 'DISCUSSING', name: '讨论' },
  1111. { code: 'PROJECTING', name: '演示' },
  1112. { code: 'ADJOURNMENT', name: '散会' }
  1113. ],
  1114. roomHasScene: false, // 是否有加班
  1115. listSen: [],
  1116. envlist: [],
  1117. navList: [
  1118. {
  1119. top: 0,
  1120. id: 0,
  1121. code: 'air',
  1122. name: '空调',
  1123. noShow: false
  1124. },
  1125. {
  1126. top: 0,
  1127. id: 1,
  1128. code: 'heat',
  1129. name: '地暖',
  1130. noShow: false
  1131. },
  1132. {
  1133. top: 0,
  1134. id: 2,
  1135. code: 'lamp',
  1136. name: '光照',
  1137. noShow: false
  1138. },
  1139. {
  1140. top: 0,
  1141. id: 3,
  1142. code: 'curtain',
  1143. name: '窗帘',
  1144. noShow: false
  1145. },
  1146. {
  1147. top: 0,
  1148. id: 4,
  1149. code: 'socket',
  1150. name: '插座',
  1151. noShow: false
  1152. },
  1153. {
  1154. top: 0,
  1155. id: 5,
  1156. code: 'noise',
  1157. name: '声压',
  1158. noShow: false
  1159. }
  1160. ],
  1161. topBarHeight: 72,
  1162. roomPicTop: roomPicTop,
  1163. stopScrollCheck: false, // 点击导航
  1164. navId: 0,
  1165. visible: false,
  1166. // 空间设备
  1167. spaceEqFlagObj: {
  1168. hasAir: true, // 有无空调
  1169. hasBlowing: false, // 空调有无 变风量系统
  1170. hasLamp: false, // 有无灯具
  1171. hasSocket: false, // 有无插座
  1172. hasCurtain: false // 有无 窗帘
  1173. },
  1174. // 空调-弹窗
  1175. airSetText: {
  1176. notice: '',
  1177. designTemperature: 0,
  1178. remark: []
  1179. },
  1180. viewOne: '', // 导航条第一个
  1181. airVisible: false, // 弹窗
  1182. routeParams: {},
  1183. isACATVA: false,
  1184. isACATFC: false,
  1185. eightTime: 0,
  1186. sixTime: 0,
  1187. nowTime: new Date().valueOf(),
  1188. isWorkOff: false, // 我要离开 点击否
  1189. bookEquipList: '', // 预约显示的设备
  1190. controlMode: 1
  1191. },
  1192. computed: {
  1193. ...mapState({
  1194. userInfo: state => state.user.userInfo,
  1195. projectId: state => state.user.userInfo.projectId,
  1196. handPopHight: state => state.officehome.handPopHight
  1197. }),
  1198. ...mapActions(['setIsApprovalProject']),
  1199. hasMeetingScene() {
  1200. // 是否展示会议室场景
  1201. let meetingScene =
  1202. this.roomHasScene &&
  1203. this.projectId !== 'Pj1101050038' &&
  1204. this.options.roomType === '会议室' &&
  1205. this.spaceEqFlagObj.hasLamp
  1206. return meetingScene
  1207. },
  1208. isSpaceCanControl() {
  1209. let flag = true
  1210. if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2 || !this.isUserControlFromMap) {
  1211. flag = false
  1212. }
  1213. return flag
  1214. }
  1215. },
  1216. watch: {
  1217. transY: function (newVal, oldVal) {
  1218. // console.log('transY');
  1219. // 如果在顶部 则可以滑动
  1220. if (newVal < 0) return
  1221. this.opacityV = 1 - (newVal / 80 > 1 ? 1 : newVal / 80)
  1222. if (newVal == this.transYCopy) {
  1223. this.moveToBottom = true
  1224. } else {
  1225. this.moveToBottom = false
  1226. }
  1227. if (newVal == 0) {
  1228. this.canscroll = true
  1229. } else {
  1230. this.canscroll = false
  1231. }
  1232. }
  1233. },
  1234. // 加载字体
  1235. onLoad(routeParams) {
  1236. checkHasUserInfo()
  1237. this.getCardWidth()
  1238. this.getWeatherInfo()// 天气预报
  1239. var nowTimeStr = moment().format('YYYY-MM-DD')
  1240. var eightTime = moment(nowTimeStr + ' 20:00:00').valueOf()
  1241. var sixTime = moment(nowTimeStr + ' 05:00:00').valueOf()
  1242. this.sixTime = sixTime
  1243. this.eightTime = eightTime
  1244. this.routeParams = routeParams
  1245. },
  1246. onShow() {
  1247. this.fromOtherPages()
  1248. this.spaceInfoStatusTimer()
  1249. },
  1250. onReady() {
  1251. // var scale = 750 / wx.getSystemInfoSync().windowWidth ; // 这是px转rpx 750/ wx.getSystemInfoSync().windowWidth=rpx/px 任何手机都是750rpx
  1252. var windowHeightpx = wx.getSystemInfoSync().screenHeight
  1253. // 设置初始值 topBarHeight*scale+roomPicTop
  1254. this.transYCopy =
  1255. windowHeightpx - switchPanelHeight - this.topBarHeight - this.roomPicTop // topBarHeight上顶端的bar
  1256. this.windowHeightpx = windowHeightpx
  1257. if (this.routeParams.showmap == 'true') {
  1258. this.transY = this.transYCopy
  1259. // console.log('onready');
  1260. }
  1261. },
  1262. onHide() {
  1263. // this.spaceEqFlagObj = {
  1264. // hasAir: true,
  1265. // hasLamp: false
  1266. // }
  1267. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1268. this.homePageHasHidden = false
  1269. },
  1270. onUnload() {
  1271. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1272. },
  1273. methods: {
  1274. // 关闭设置常驻的弹框
  1275. closePermanentPanel(val) {
  1276. this.isShowPermanent = val
  1277. },
  1278. // 从找一找和首页 进入本页面
  1279. async fromOtherPages() {
  1280. // homeSetSpace 设置常驻, homeShowEnv 环境调节, FindIt 找一找
  1281. // openLamp 开灯, airAddOne 空调调高一度, airReduceOne 空调下降一度 , closeLampAir 关闭灯和空调
  1282. if (this.routeParams.from === 'FindIt') {
  1283. this.getCurrentSpace('FindIt')
  1284. this.isUserControlFromMap = this.routeParams.isUserControl
  1285. this.options.spaceId = this.routeParams.spaceId
  1286. this.moveToBottom = true // 来自找一找, 页面在底部
  1287. this.getData() // 获取数据
  1288. } else {
  1289. // 从首页进入
  1290. await this.getCurrentSpace('home')
  1291. if (this.options.spaceId !== '') {
  1292. await this.getData()
  1293. }
  1294. let setAirtemp = this.$refs.airHandCard.airTemp
  1295. switch (this.routeParams.from) {
  1296. case 'homeShowEnv':
  1297. if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2) {
  1298. this.moveToBottom = true
  1299. this.toRoom()
  1300. }
  1301. break
  1302. case 'homeSetSpace':
  1303. this.isShowPermanent = true
  1304. this.moveToBottom = true
  1305. this.toRoom()
  1306. break
  1307. case 'openLamp':
  1308. this.selectCrad('', 'lamp')
  1309. this.$refs.lampAdjust.eqChange(true, 'allLamp')
  1310. break
  1311. case 'airAddOne':
  1312. this.selectCrad('', 'air')
  1313. this.$refs.airHandCard.changeZongAir('temp', setAirtemp + 1)
  1314. break
  1315. case 'airReduceOne':
  1316. this.selectCrad('', 'air')
  1317. this.$refs.airHandCard.changeZongAir('temp', setAirtemp - 1)
  1318. break
  1319. case 'closeLampAir':
  1320. this.selectCrad('', 'air')
  1321. this.$refs.lampAdjust.eqChange(false, 'allLamp')
  1322. this.$refs.airHandCard.airData.isOpen = false
  1323. this.$refs.airHandCard.changeZongAir('sw')
  1324. break
  1325. default:
  1326. break
  1327. }
  1328. }
  1329. },
  1330. getCurrentSpace(from) {
  1331. return checkUserControl().then(res => {
  1332. // isControlSpace 1-租户下无可控;2-租户有可控;3-用户有可控 4-当前空间为常驻空间
  1333. this.userControlSpace = res
  1334. // 从首页进入 才给空间重新赋值
  1335. if (from === 'home') {
  1336. this.options.spaceId = res.spaceId || ''
  1337. }
  1338. })
  1339. },
  1340. setCanScroll(val) {
  1341. this.canscroll = val
  1342. },
  1343. // 空调弹框
  1344. openAirHandPop(val, tempObj) {
  1345. this.airHandItem = val
  1346. let hight = 0
  1347. if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
  1348. hight = 45
  1349. }
  1350. if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
  1351. hight = 55
  1352. }
  1353. if (val.boundPoint.gearSetBound && val.boundPoint.modeSetBound && val.boundPoint.tempSetBound) {
  1354. hight = 70
  1355. }
  1356. this.airPopHight = hight
  1357. this.airHandData = tempObj
  1358. this.airHandVisible = true
  1359. },
  1360. changeAirHandOrder(pobj, deviceObjCopy) {
  1361. this.$refs.airHandCard.changeOneAir(pobj.id, pobj.code, pobj.value, deviceObjCopy)
  1362. this.airHandItem = deviceObjCopy
  1363. },
  1364. // 地暖弹框
  1365. openFloorFeatPop(val) {
  1366. this.floorfeatVisible = true
  1367. this.floorFeatItem = val
  1368. },
  1369. // 地暖 数据
  1370. getFloorHeatData(val) {
  1371. this.floorHeatData = val
  1372. this.floorHeatData.len = !!val.len
  1373. this.navList.map(item => {
  1374. if (item.code === 'heat') {
  1375. item.noShow = !val.len
  1376. }
  1377. })
  1378. },
  1379. // 窗帘-弹窗
  1380. showCurtainPop(val) {
  1381. this.crutainType = JSON.parse(JSON.stringify(val))
  1382. this.curtainVisible = true
  1383. },
  1384. // 色温弹框
  1385. openColourPop(val) {
  1386. this.colourVisible = true
  1387. this.colourConfig = val
  1388. },
  1389. // 空间下设备是否受加班可控
  1390. checkEquipmentConfigStatus() {
  1391. return queryEquipmentRunConfig(this.options.spaceId).then(res => {
  1392. const resArr = res.data
  1393. this.equipmentsConfig = resArr
  1394. })
  1395. },
  1396. // 手动 弹窗 展示的设备类型
  1397. dialogShowEquipType(val) {
  1398. this.bookEquipList = val
  1399. },
  1400. showCurtain(len) {
  1401. this.spaceEqFlagObj.hasCurtain = !!len
  1402. this.navList.map((item, idx) => {
  1403. if (item.code === 'curtain') {
  1404. item.noShow = !len
  1405. }
  1406. })
  1407. },
  1408. // 插座
  1409. showSocket(len) {
  1410. this.spaceEqFlagObj.hasSocket = !!len
  1411. this.navList.map((item, idx) => {
  1412. if (item.code === 'socket') {
  1413. item.noShow = !len
  1414. }
  1415. })
  1416. },
  1417. getWorkDayTime() {
  1418. // 获取个人空间使用时间
  1419. return queryCustomAndScence({ spaceId: this.options.spaceId }).then(
  1420. res => {
  1421. this.workDayTime = res
  1422. }
  1423. )
  1424. },
  1425. vibrateShort() {
  1426. if (wx.canIUse('vibrateShort')) {
  1427. wx.vibrateShort()
  1428. } else {
  1429. wx.vibrateLong()
  1430. }
  1431. },
  1432. showAllClose() {
  1433. this.closeAllShow = true
  1434. this.closeShowNum = 0
  1435. this.closeStatus = false
  1436. },
  1437. // 关闭全部关闭弹窗
  1438. hideCloseAll() {
  1439. this.closeAllShow = false
  1440. // this.closeShowNum=0 ;
  1441. // this.closeStatus=false ;
  1442. },
  1443. // 确认关闭所有设备
  1444. sureCloseAll() {
  1445. this.vibrateShort()
  1446. this.$refs.allclose.controlEquipStatistics()
  1447. this.closeShowNum = 1
  1448. this.closeStatus = true
  1449. var interval = setInterval(() => {
  1450. this.closeShowNum++
  1451. if (this.closeShowNum == 5) {
  1452. clearInterval(interval)
  1453. }
  1454. }, 1800)
  1455. },
  1456. // 空调 - airTemp
  1457. airShowVisible(val) {
  1458. this.airVisible = true
  1459. this.airSetText = {
  1460. notice: '',
  1461. remark: '',
  1462. designTemperature: ''
  1463. }
  1464. this.airSetText.designTemperature = val.designTemperature // 目标温度
  1465. this.airSetText.toWhere = val.toWhere
  1466. },
  1467. airTemp(val) {
  1468. this.airSetText.notice = val.notice
  1469. if (val.remark && val.remark !== []) {
  1470. const remark = val.remark.split('*')
  1471. this.airSetText.remark = remark
  1472. }
  1473. },
  1474. getWeatherInfo() {
  1475. getWeather().then(res => {
  1476. const outWeather = res.content ? res.content : {}
  1477. var text = outWeather.text || ''
  1478. this.getnowTime(text) // 头部背景
  1479. })
  1480. },
  1481. getnowTime(text) { // 头部背景图片
  1482. let now = moment().hours()
  1483. if (text.indexOf('霾') > -1) {
  1484. this.topbgimg = `${this.h5StaticPath}office_smog.jpg`
  1485. } else {
  1486. if (now >= 6 && now < 19) {
  1487. // 白天
  1488. this.topbgimg = `${this.h5StaticPath}office_bright.jpg`
  1489. } else {
  1490. // 夜晚
  1491. this.topbgimg = `${this.h5StaticPath}office_night.jpg`
  1492. }
  1493. }
  1494. },
  1495. async getData() {
  1496. // 获取数据
  1497. await this.getSpaceInfo() // 空间指数信息
  1498. await this.querySpaceSceneConfig() // 获取空间场景
  1499. await this.getWorkDayTime() // 工作组时间
  1500. this.getEquipments() // 空间下的设备
  1501. this.checkEquipmentConfigStatus()
  1502. },
  1503. getEquipments() {
  1504. // 获取空间下设备
  1505. const params = {
  1506. spaceId: this.options.spaceId
  1507. // category: // 设备类。可不填,查询所有。
  1508. }
  1509. getEquipmentListHttp(params).then(res => {
  1510. // equipmentCategory 有 空调 ACATFC、ACATFU、ACATVA、ACATVI;有灯 灯 SELTLT
  1511. // ACATVA 变风量系统
  1512. this.navList.map(item => {
  1513. if (item.code === 'air' || item.code === 'lamp') {
  1514. item.noShow = true
  1515. }
  1516. })
  1517. this.spaceEqFlagObj.hasAir = false
  1518. this.spaceEqFlagObj.hasLamp = false;
  1519. (res.data || []).forEach(item => {
  1520. if (item.equipmentCategory === 'ACATVA') {
  1521. this.isACATVA = true // 如果是嘉铭的ACATVA 则不显示开关
  1522. }
  1523. if (item.equipmentCategory === 'ACATFC') {
  1524. this.isACATFC = true // 如果是嘉铭的ACATVA 则不显示开关
  1525. }
  1526. if (
  1527. item.equipmentCategory === 'ACATFC' ||
  1528. item.equipmentCategory === 'ACATVA' ||
  1529. item.equipmentCategory === 'ACATVI'
  1530. ) {
  1531. this.spaceEqFlagObj.hasAir = true
  1532. this.navList.map(item => {
  1533. if (item.code === 'air') {
  1534. item.noShow = false
  1535. }
  1536. })
  1537. this.airKey++
  1538. } else if (item.equipmentCategory === 'SELTLT') {
  1539. this.spaceEqFlagObj.hasLamp = true
  1540. this.navList.map(item => {
  1541. if (item.code === 'lamp') {
  1542. item.noShow = false
  1543. }
  1544. })
  1545. this.lampKey++
  1546. }
  1547. })
  1548. })
  1549. },
  1550. switchoverScene(code) {
  1551. // 改变场景(上班.讨论.投影.散会.下班)
  1552. const params = {
  1553. spaceId: this.options.spaceId,
  1554. type: code,
  1555. pubname: config.brsgServer.pubname
  1556. }
  1557. return switchoverSceneHttp(params)
  1558. },
  1559. spaceInfoStatusTimer() {
  1560. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1561. spaceInfoStatusTimer = setInterval(() => {
  1562. this.getSpaceInfo() // 空间信息
  1563. }, 20 * 1000) // 2秒描刷接口
  1564. },
  1565. // 地图数据切换空间
  1566. mapChangeSpaceInfo(obj) {
  1567. // isUserControl-Boolean 用户空间是否可以控
  1568. const mapItem = JSON.parse(JSON.stringify(obj))
  1569. this.options.spaceId = mapItem.spaceId
  1570. this.isUserControlFromMap = mapItem.isUserControl
  1571. this.getData()
  1572. },
  1573. getSpaceInfo() {
  1574. // 空间信息
  1575. const params = {
  1576. criteria: {
  1577. spaceId: this.options.spaceId
  1578. },
  1579. pubname: config.brsgServer.pubname,
  1580. openid: this.userInfo.userId
  1581. }
  1582. return getSpaceAdjustList(params).then(res => {
  1583. this.officeData = (res && res.content && res.content[0]) || {}
  1584. this.checkSpaceType(this.officeData.roomFuncType)
  1585. if (res && res.content) {
  1586. res.content.forEach(item => {
  1587. this.controlMode = item.controlMode || 1
  1588. var envlist = [
  1589. {
  1590. id: 1,
  1591. name: 'CO₂',
  1592. num: '--',
  1593. level: '--',
  1594. funcid: 'CO2',
  1595. code: 'co2'
  1596. },
  1597. {
  1598. id: 2,
  1599. name: 'PM2.5',
  1600. num: '--',
  1601. level: '--',
  1602. funcid: 'PM2d5',
  1603. code: 'pm25'
  1604. },
  1605. {
  1606. id: 3,
  1607. name: '甲醛',
  1608. num: '--',
  1609. level: '--',
  1610. funcid: 'HCHO',
  1611. code: 'jiaquan'
  1612. }
  1613. // { id: 4, name: '湿度', num: '--', level: '--', funcid: 'Tdb,RH', code: 'shidu' }
  1614. // { id: 3, name: 'TVOC', num: 0.4, level: '健康' }
  1615. ]
  1616. if (item.co2 || item.co2 == 0) {
  1617. envlist[0].level = this.checkLevel(item.co2, 'co2').levelTxt
  1618. envlist[0].num = item.co2
  1619. } else {
  1620. envlist[0].level = '--'
  1621. envlist[0].num = '--'
  1622. }
  1623. if (item.pm25 || item.pm25 === 0) {
  1624. envlist[1].level = this.checkLevel(item.pm25, 'pm25').levelTxt
  1625. envlist[1].num = item.pm25
  1626. } else {
  1627. envlist[1].level = '--'
  1628. envlist[1].num = '--'
  1629. }
  1630. if (item.hcho || item.hcho == 0) {
  1631. envlist[2].level = this.checkLevel(item.hcho, 'hcho').levelTxt
  1632. envlist[2].num = item.hcho.toFixed(2)
  1633. } else {
  1634. envlist[2].level = '--'
  1635. envlist[2].num = '--'
  1636. }
  1637. var temperNum = this.officeData.temperature
  1638. ? this.officeData.temperature
  1639. : '--'
  1640. var temperText = this.officeData.temperature
  1641. ? this.checkLevel(this.officeData.temperature, 'temper')
  1642. .levelTxt
  1643. : '--'
  1644. var tempObj = {
  1645. id: 0,
  1646. name: '温度',
  1647. num: temperNum,
  1648. level: temperText,
  1649. funcid: 'Tdb,RH',
  1650. code: 'wendu'
  1651. }
  1652. envlist.unshift(tempObj)
  1653. this.envlist = envlist
  1654. })
  1655. } else {
  1656. this.envlist = []
  1657. }
  1658. return 'success'
  1659. })
  1660. },
  1661. getMeetingScene() {
  1662. // 获取当前会议室的场景 OFFWORK
  1663. const params = {
  1664. spaceId: this.options.spaceId
  1665. }
  1666. getMeetingSceneHttp(params).then(res2 => {
  1667. var rescont = res2.content || ''
  1668. if (rescont === 'OFFWORK') {
  1669. rescont = 'ADJOURNMENT'
  1670. }
  1671. var filterArr = this.listSen.filter(function (item) {
  1672. return item.code === rescont
  1673. })
  1674. // 根据code 获取场景的名字
  1675. this.headScene = (filterArr[0] && filterArr[0].name) || '散会'
  1676. this.vanPopupIndex = rescont
  1677. })
  1678. },
  1679. querySpaceSceneConfig() {
  1680. // 获取空间场景
  1681. const params = {
  1682. spaceId: this.options.spaceId
  1683. }
  1684. this.roomHasScene = false
  1685. return querySpaceSceneConfigHttp(params).then(res => {
  1686. if (!res.data) return
  1687. let sceneArr = res.data
  1688. this.roomHasScene = true // 空间有场景
  1689. if (this.options.roomType !== '会议室') return
  1690. let copyListSen = JSON.parse(JSON.stringify(initListSen))
  1691. this.listSen = JSON.parse(JSON.stringify(initListSen))
  1692. copyListSen.forEach(item => {
  1693. let flag = false
  1694. let deleteIdx = null
  1695. sceneArr.forEach((j, idx) => {
  1696. deleteIdx = idx
  1697. if (item.code === j.sceneType) {
  1698. flag = true
  1699. }
  1700. })
  1701. if (!flag) {
  1702. this.listSen.splice(deleteIdx, 1)
  1703. }
  1704. })
  1705. this.popList = this.listSen
  1706. })
  1707. },
  1708. checkSpaceType(roomFuncType) {
  1709. // 空间类型处理
  1710. // const roomFuncType = this.officeData.roomFuncType ; // 空间类型
  1711. if (
  1712. roomFuncType === '311' ||
  1713. roomFuncType === '310' ||
  1714. roomFuncType === '312'
  1715. ) {
  1716. this.options.roomType = '个人'
  1717. this.headImg = 'office_person_2.png'
  1718. this.headScene = '工作'
  1719. } else if (
  1720. roomFuncType === '320' ||
  1721. roomFuncType === '321' ||
  1722. roomFuncType === '322' ||
  1723. roomFuncType === '323'
  1724. ) {
  1725. this.getMeetingScene()
  1726. this.options.roomType = '会议室'
  1727. this.headImg = 'office_normal_2.png'
  1728. } else if (
  1729. roomFuncType === '313' ||
  1730. roomFuncType === '314' ||
  1731. roomFuncType === '315'
  1732. ) {
  1733. this.options.roomType = '开放'
  1734. this.headImg = 'office_publi_2.png'
  1735. } else {
  1736. this.options.roomType = '其它'
  1737. this.headImg = 'office_publi_2.png'
  1738. }
  1739. },
  1740. checkLevel(value, name, seasonType) {
  1741. let tdbParam = {
  1742. Cooling: {
  1743. range: [22, 26],
  1744. text: ['偏冷', '舒适', '偏热']
  1745. },
  1746. Warm: {
  1747. range: [18, 24],
  1748. text: ['偏冷', '舒适', '偏热']
  1749. },
  1750. Transition: {
  1751. range: [18, 26],
  1752. text: ['偏冷', '舒适', '偏热']
  1753. }
  1754. }
  1755. let objList = {
  1756. humidity: {
  1757. range: [30, 70],
  1758. text: ['干燥', '健康', '潮湿']
  1759. },
  1760. co2: {
  1761. range: [800, 1000, 1500],
  1762. text: ['健康', '达标', '略高', '超标']
  1763. },
  1764. pm25: {
  1765. range: [35, 75, 115, 150, 250],
  1766. text: ['健康', '良', '轻度污染', '中度污染', '重度污染', '严重污染']
  1767. },
  1768. hcho: {
  1769. range: [0.1],
  1770. text: ['健康', '超标']
  1771. },
  1772. temper: {
  1773. range: [20, 24],
  1774. text: ['偏冷', '舒适', '偏热']
  1775. }
  1776. }
  1777. seasonType = seasonType || 'Transition'
  1778. objList.temper = tdbParam[seasonType]
  1779. let sortArr = [value, ...objList[name].range].sort((a, b) => { return a - b })
  1780. let level = sortArr.findIndex(item => item === value)
  1781. let levelTxt = objList[name].text[level]
  1782. return { level, levelTxt }
  1783. },
  1784. getCardWidth() {
  1785. // 获取每一个卡片的top height
  1786. var _this = this
  1787. const query = wx.createSelectorQuery()
  1788. query.select('#inToView4').boundingClientRect()
  1789. return new Promise(function (resolve, reject) {
  1790. query.exec(function (res) {
  1791. const mlr = 20 * 2 // 左右marign
  1792. _this.cardWidth = res[0].width - mlr
  1793. resolve()
  1794. })
  1795. })
  1796. },
  1797. getCardPosition() {
  1798. // 获取每一个卡片的top height
  1799. var _this = this
  1800. const query = wx.createSelectorQuery()
  1801. var halfWindowHeightpx = this.windowHeightpx / 2
  1802. query.select('#roomDetail').boundingClientRect()
  1803. query.select('#inToView02').boundingClientRect()
  1804. query.select('#inToView5').boundingClientRect()
  1805. query.select('#inToView1').boundingClientRect()
  1806. query.select('#inToView2').boundingClientRect()
  1807. query.select('#inToView3').boundingClientRect()
  1808. query.select('#inToView4').boundingClientRect()
  1809. return new Promise(function (resolve, reject) {
  1810. query.exec(function (res) {
  1811. _this.navList[0].top =
  1812. res[0].height +
  1813. _this.roomPicTop +
  1814. _this.topBarHeight -
  1815. halfWindowHeightpx // 这个是 与顶部的距离 减去 halfWindowHeightpx 以中间线为基准
  1816. _this.navList[0].height = _this.navList[0].noShow
  1817. ? 0
  1818. : (res[1] && res[1].height) || 0
  1819. for (let i = 1; i < res.length; i++) {
  1820. _this.dealNav(i, _this, res)
  1821. }
  1822. resolve()
  1823. })
  1824. })
  1825. },
  1826. dealNav(idx, _this, res) {
  1827. if (!_this.navList[idx]) return
  1828. const pre = idx - 1
  1829. const preTop = _this.navList[pre].top || 0
  1830. const next = idx + 1
  1831. _this.navList[idx].top =
  1832. preTop + 15 + ((res[idx] && res[idx].height) || 0)
  1833. _this.navList[idx].height = _this.navList[idx].noShow
  1834. ? 0
  1835. : (res[next] && res[next].height) || 0
  1836. },
  1837. // 导航条
  1838. async selectCrad(e, code) {
  1839. const targetObj = this.navList.find(function (item) {
  1840. return item.code === code
  1841. })
  1842. let id = code ? targetObj.id : e.currentTarget.id
  1843. if (id === this.navId) return
  1844. this.navId = id
  1845. this.lampHide = !this.lampHide // 当点击了导航 灯的列表要收起
  1846. await this.getCardPosition()
  1847. var targetNav = this.navList.find(function (item) {
  1848. return item.id == id
  1849. })
  1850. this.scrollTop = targetNav.top // 实现点击导航 滚动
  1851. },
  1852. async scrollEvent(event) {
  1853. // 空间不可控不能滑动
  1854. if (!this.isSpaceCanControl) return
  1855. // 滚动 选中导航条相应的
  1856. await this.getCardPosition()
  1857. var scrollTop = (event.detail || event.$wx.detail || {}).scrollTop || 0
  1858. this.realScrollTop = scrollTop
  1859. // console.log('scrollEvent-scrollTop', this.realScrollTop) ;
  1860. if (scrollTop < this.navList[0].top + this.navList[0].height) {
  1861. this.navId = 0
  1862. }
  1863. for (let i = 0; i < 8; i++) {
  1864. this.determine(scrollTop, i)
  1865. }
  1866. },
  1867. determine(scrollTop, idx) {
  1868. if (!this.navList[idx]) return
  1869. const next = idx + 1
  1870. const nextTop = this.navList[next] ? this.navList[next].top : 0
  1871. const nextHeight = this.navList[next] ? this.navList[next].height : 0
  1872. if (
  1873. scrollTop > this.navList[idx].top + this.navList[idx].height &&
  1874. scrollTop < nextTop + nextHeight
  1875. ) {
  1876. this.navId = next
  1877. }
  1878. },
  1879. scrollToUpper(event) {
  1880. // 到达顶部
  1881. // console.log('scrollToUpper-scrollTop');
  1882. // this.realScrollTop = 0 ;
  1883. },
  1884. // 进入 detail 页
  1885. handleDetail(data) {
  1886. wx.navigateTo({
  1887. url: `./detail?spaceId=${this.officeData.id}&funcid=${data.funcid}`
  1888. })
  1889. },
  1890. // 进入地图页
  1891. toRoom() {
  1892. this.scrollTop = null
  1893. this.scrollTop = 0
  1894. console.log('----滑下来----')
  1895. this.transY = this.transYCopy
  1896. },
  1897. handleWorkOff(val) {
  1898. // 我要离开 弹窗展示
  1899. if (val === 'showWorkOff') {
  1900. this.isWorkOff = true
  1901. this.sceneShow = true
  1902. return
  1903. }
  1904. if (val === 'hideWorkOff') {
  1905. this.isWorkOff = false
  1906. this.sceneShow = false
  1907. }
  1908. },
  1909. handlecountDown() {
  1910. this.countDownTwoMin = 0
  1911. clearInterval(timerTwoMin)
  1912. timerTwoMin = null
  1913. if (this.visible) {
  1914. this.countDownTwoMin = 60 * 2
  1915. this.getWorkDayTime() // 获取工作时间
  1916. timerTwoMin = setInterval(() => {
  1917. if (this.countDownTwoMin === 1) {
  1918. this.visible = false
  1919. this.getWorkDayTime() // 获取工作时间
  1920. } else {
  1921. this.countDownTwoMin = this.countDownTwoMin - 1
  1922. }
  1923. }, 1000 * 20)
  1924. } else {
  1925. clearInterval(timerTwoMin)
  1926. timerTwoMin = null
  1927. this.getWorkDayTime() // 获取工作时间
  1928. }
  1929. },
  1930. // 调出浮层
  1931. handlePopup(val) {
  1932. if (!this.roomHasScene) return // 没有加班 不可配置
  1933. this.visible = val
  1934. if (this.options.roomType == '开放') {
  1935. this.handlecountDown() // 倒计时两分钟
  1936. }
  1937. },
  1938. hideScene() {
  1939. this.sceneShow = false
  1940. },
  1941. // 调出场景-浮层 切换场景
  1942. handleScene(mitem, idx) {
  1943. // isWithinLocation()
  1944. // .then(() => {
  1945. var name = mitem.name
  1946. this.visible = false // 关闭 切换场景
  1947. if (!this.visible) {
  1948. this.sceneShow = !this.sceneShow // 场景详细信息
  1949. }
  1950. this.popList.forEach((item, idx) => {
  1951. if (name === item.name) {
  1952. this.sceneDetail = JSON.parse(JSON.stringify(item))
  1953. this.sceneDetail.textObj = []
  1954. // 场景切换的对话框动效
  1955. item.textObj.forEach((element, idx) => {
  1956. setTimeout(() => {
  1957. this.sceneDetail.textObj.push(element)
  1958. }, 150 * (idx + 1))
  1959. })
  1960. }
  1961. })
  1962. // 放在这个位置 是为了 切换场景时直接改变场景 不等待后台
  1963. this.headScene = this.sceneDetail.name
  1964. this.vanPopupIndex = this.sceneDetail.code
  1965. this.switchoverScene(this.sceneDetail.code).then(res => {
  1966. if (res.result === 'success') {
  1967. // this.headScene = this.sceneDetail.name
  1968. // this.vanPopupIndex = this.sceneDetail.code
  1969. }
  1970. })
  1971. // })
  1972. // .catch(() => { })
  1973. console.log('handleScene this.popList', this.popList)
  1974. },
  1975. // 返回 上一页
  1976. goPre() {
  1977. wx.navigateBack()
  1978. },
  1979. setTopBarHeight(height) {
  1980. this.topBarHeight = height
  1981. },
  1982. touchstart: function (e) {
  1983. var pageY = e.touches[0].pageY
  1984. var _this = this
  1985. this.startY = pageY
  1986. const query = wx.createSelectorQuery()
  1987. // query.selectViewport().scrollOffset() ;//这是page
  1988. // query.select('#scroll-view').boundingClientRect();
  1989. query.select('#scroll-view').scrollOffset()
  1990. query.exec(res => {
  1991. _this.nowScrollY = res[0].scrollTop
  1992. if (
  1993. (_this.nowScrollY == 0 && _this.transY == 0) ||
  1994. (_this.nowScrollY == 0 && _this.transY == _this.transYCopy)
  1995. ) {
  1996. // 当最顶端 最低端时 才可以滑动
  1997. _this.movesign = true
  1998. } else {
  1999. _this.movesign = false
  2000. }
  2001. // console.log('touchstart', this.nowScrollY, this.realScrollTop, this.transY) ;
  2002. })
  2003. },
  2004. touchmove: function (e) {
  2005. if (!this.movesign) return
  2006. var _this = this
  2007. // console.log('touchmove', this.nowScrollY, this.realScrollTop, this.transY) ;
  2008. var touch = e.touches[0]
  2009. var pageY = Number(touch.pageY) // 页面触点Y坐标
  2010. moveY = pageY - this.startY
  2011. this.startY = pageY
  2012. if (this.nowScrollY > 0 || this.realScrollTop > 0) {
  2013. // 如果是transY为0的情况 发生屏幕滚动 不改变transY的值
  2014. this.transY = 0
  2015. return
  2016. }
  2017. var transY = this.transY + moveY
  2018. if (transY < 0) {
  2019. // transY只能是正的
  2020. transY = 0
  2021. }
  2022. if (transY > this.transYCopy) {
  2023. transY = this.transYCopy
  2024. }
  2025. this.transY = transY
  2026. },
  2027. touchend: function (e) {
  2028. // 挪动到一定区域 则可以自己到固定位置
  2029. var _this = this
  2030. const query = wx.createSelectorQuery()
  2031. query.select('#scroll-view').scrollOffset()
  2032. query.exec(res => {
  2033. // console.log('touchend', res) ;
  2034. _this.realScrollTop = res[0].scrollTop
  2035. _this.nowScrollY = res[0].scrollTop
  2036. // console.log('touchend', this.nowScrollY, this.realScrollTop, this.transY) ;
  2037. if (this.realScrollTop > 0) {
  2038. // 如果是transY为0的情况 手指上移动 也不改变transY的值
  2039. this.transY = 0
  2040. return
  2041. }
  2042. if (this.transY < 0) {
  2043. this.transY = 0
  2044. }
  2045. if (this.transY >= this.transYCopy) {
  2046. this.transY = this.transYCopy
  2047. }
  2048. if (moveY > 0) {
  2049. // 手指下滑
  2050. if (this.transY <= 60) {
  2051. this.transY = 0
  2052. } else {
  2053. this.transY = this.transYCopy
  2054. }
  2055. // console.log('下滑下滑下滑下滑xia', this.nowScrollY, this.transY) ;
  2056. } else {
  2057. if (this.transY >= this.transYCopy - 60) {
  2058. this.transY = this.transYCopy
  2059. } else {
  2060. this.transY = 0
  2061. }
  2062. // console.log('上滑上滑上滑', moveY) ;
  2063. }
  2064. this.movesign = false
  2065. })
  2066. }
  2067. }
  2068. })
  2069. </script>
  2070. <config>
  2071. {
  2072. "navigationStyle": "custom",
  2073. backgroundColor: '#f7f8fa',
  2074. usingComponents: {
  2075. "Curtain-Pop":'./Curtain/curtainPop.wpy',
  2076. "Floor-Pop":'./FloorHeating/floorPop.wpy',
  2077. "airHand-Pop":'./airHand/airHandPop.wpy',
  2078. "Floor-Heating":'./FloorHeating/floorHeating',
  2079. "curtain-card":"./Curtain/curtain-card",
  2080. 'page-top-bar-custom': '~@/components/common/page-top-bar-custom',
  2081. "work-overtime-hand":"./workOvertime-hand",
  2082. "space-basic":"./Header/space-basic",
  2083. "pop-scene":"./Meeting/pop-meet-scene.wpy",
  2084. "work-off":"./components/work-off",
  2085. "work-scene-hand":"./components/work-scene-hand",
  2086. "set-permanent":"./components/set-permanent",
  2087. "air-hand-card":"./airHand/air-hand-card",
  2088. "air-feedback":"./components/air-feedback",
  2089. "lamp-adjust":"./components/lamp-adjust",
  2090. "lamp-colour":"./components/lamp-colour",
  2091. "socket-card":"./components/socket-card",
  2092. "all-close":"./components/all-close",
  2093. "voice-adjust":"./components/voice-adjust",
  2094. "map-home":"../intelligentControl/home2",
  2095. "van-icon": "module:@vant/weapp/dist/icon",
  2096. "van-popup": "module:@vant/weapp/dist/popup"
  2097. },
  2098. componentPlaceholder: {
  2099. 'page-top-bar-custom': 'view'
  2100. }
  2101. }
  2102. </config>