index.wpy 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159
  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 { isWithinLocation } from '@/service/location'
  994. import config from '@/config'
  995. let spaceInfoStatusTimer = null
  996. const switchPanelHeight = 125 // 145是下面块的高
  997. const roomPicTop = 185 // 135是建筑图片的高度 单位都是px
  998. var moveY
  999. let timerTwoMin = null
  1000. let initListSen = [
  1001. {
  1002. id: 0,
  1003. code: 'DISCUSSING',
  1004. name: '讨论',
  1005. headImg: 'discuss.svg',
  1006. img: 'discuss.png',
  1007. checked: true,
  1008. textObj: [
  1009. {
  1010. text: '已为您切换至适宜讨论的环境',
  1011. status: 'ok'
  1012. }
  1013. ]
  1014. },
  1015. {
  1016. id: 1,
  1017. code: 'PROJECTING',
  1018. name: '投影',
  1019. headImg: 'shadow2.svg',
  1020. img: 'shadow2.png',
  1021. checked: false,
  1022. textObj: [
  1023. {
  1024. text: '已为您切换至适宜演示的环境',
  1025. status: 'ok'
  1026. }
  1027. ]
  1028. },
  1029. {
  1030. id: 2,
  1031. code: 'ADJOURNMENT',
  1032. name: '散会',
  1033. headImg: 'beover.svg',
  1034. img: 'beover.png',
  1035. checked: false,
  1036. textObj: [
  1037. {
  1038. text: '会议室内设备已切换至节能模式',
  1039. status: 'ok'
  1040. }
  1041. ]
  1042. }
  1043. ]
  1044. wepy.page({
  1045. store,
  1046. data: {
  1047. sceneShow: false,
  1048. isShowPermanent: false,
  1049. isUserControlFromMap: true,
  1050. userControlSpace: {}, // 用户控制空间
  1051. cardWidth: 0, // 动态获取卡片的宽度
  1052. floorFeatItem: {}, // 地暖弹窗数据
  1053. airHandItem: {},
  1054. airPopHight: 0,
  1055. airHandData: {
  1056. maxValue: 0,
  1057. minValue: 0
  1058. }, // 地暖数据
  1059. floorHeatData: {
  1060. maxValue: 0,
  1061. minValue: 0,
  1062. len: false
  1063. }, // 地暖数据
  1064. floorfeatVisible: false, // 地暖弹窗
  1065. airHandVisible: false, // 空调手动弹窗
  1066. curtainVisible: false, // 窗帘弹窗
  1067. crutainType: {
  1068. btnArr: [],
  1069. data: [],
  1070. curtainName: '窗帘'
  1071. },
  1072. vanPopupIndex: '',
  1073. colourConfig: {}, // 色温设置
  1074. colourVisible: false, // 色温弹窗
  1075. equipmentsConfig: [], // 设备配置
  1076. countDownTwoMin: 120, // 倒计时两分钟
  1077. workDayTime: {}, // 开放办公区 时间
  1078. closeStatus: false, // 点击了关闭确认按钮
  1079. closeShowNum: 0,
  1080. closeAllShow: false,
  1081. airKey: 1,
  1082. lampKey: 1,
  1083. nowScrollY: 0,
  1084. canscroll: true,
  1085. scrollTop: 0,
  1086. realScrollTop: 0,
  1087. transY: 0,
  1088. opacityV: 1,
  1089. transYCopy: 0,
  1090. windowHeightpx: 0,
  1091. startY: 0,
  1092. movesign: false,
  1093. scale: 1,
  1094. moveToBottom: false,
  1095. floorInfo: [],
  1096. h5StaticPath: config.h5StaticPath + '/page-officehome/',
  1097. h5StaticLogo: config.h5StaticPath,
  1098. lampHide: false, // 灯列表收起
  1099. topbgimg: null, // 头部背景
  1100. navFixed: false, // 滑动置顶
  1101. showWorkOff: false, // 开放办公室的 提前关闭是否展示
  1102. officeData: null,
  1103. headScene: '', // 头部文案
  1104. headImg: '', // 头部背景图片
  1105. options: { roomType: null, spaceId: '' }, // 本地数据
  1106. popList: [],
  1107. // 上班=ATWORK 讨论=DISCUSSING 投影=PROJECTING 散会=ADJOURNMENT 下班=OFFWORK
  1108. meetingRoomSence: [
  1109. { code: 'DISCUSSING', name: '讨论' },
  1110. { code: 'PROJECTING', name: '演示' },
  1111. { code: 'ADJOURNMENT', name: '散会' }
  1112. ],
  1113. roomHasScene: false, // 是否有加班
  1114. listSen: [],
  1115. envlist: [],
  1116. navList: [
  1117. {
  1118. top: 0,
  1119. id: 0,
  1120. code: 'air',
  1121. name: '空调',
  1122. noShow: false
  1123. },
  1124. {
  1125. top: 0,
  1126. id: 1,
  1127. code: 'heat',
  1128. name: '地暖',
  1129. noShow: false
  1130. },
  1131. {
  1132. top: 0,
  1133. id: 2,
  1134. code: 'lamp',
  1135. name: '光照',
  1136. noShow: false
  1137. },
  1138. {
  1139. top: 0,
  1140. id: 3,
  1141. code: 'curtain',
  1142. name: '窗帘',
  1143. noShow: false
  1144. },
  1145. {
  1146. top: 0,
  1147. id: 4,
  1148. code: 'socket',
  1149. name: '插座',
  1150. noShow: false
  1151. },
  1152. {
  1153. top: 0,
  1154. id: 5,
  1155. code: 'noise',
  1156. name: '声压',
  1157. noShow: false
  1158. }
  1159. ],
  1160. topBarHeight: 72,
  1161. roomPicTop: roomPicTop,
  1162. stopScrollCheck: false, // 点击导航
  1163. navId: 0,
  1164. visible: false,
  1165. // 空间设备
  1166. spaceEqFlagObj: {
  1167. hasAir: true, // 有无空调
  1168. hasBlowing: false, // 空调有无 变风量系统
  1169. hasLamp: false, // 有无灯具
  1170. hasSocket: false, // 有无插座
  1171. hasCurtain: false // 有无 窗帘
  1172. },
  1173. // 空调-弹窗
  1174. airSetText: {
  1175. notice: '',
  1176. designTemperature: 0,
  1177. remark: []
  1178. },
  1179. viewOne: '', // 导航条第一个
  1180. airVisible: false, // 弹窗
  1181. routeParams: {},
  1182. isACATVA: false,
  1183. isACATFC: false,
  1184. eightTime: 0,
  1185. sixTime: 0,
  1186. nowTime: new Date().valueOf(),
  1187. isWorkOff: false, // 我要离开 点击否
  1188. bookEquipList: '', // 预约显示的设备
  1189. controlMode: 1
  1190. },
  1191. computed: {
  1192. ...mapState({
  1193. userInfo: state => state.user.userInfo,
  1194. projectId: state => state.user.userInfo.projectId,
  1195. handPopHight: state => state.officehome.handPopHight
  1196. }),
  1197. ...mapActions(['setIsApprovalProject']),
  1198. hasMeetingScene() {
  1199. // 是否展示会议室场景
  1200. let meetingScene =
  1201. this.roomHasScene &&
  1202. this.projectId !== 'Pj1101050038' &&
  1203. this.options.roomType === '会议室' &&
  1204. this.spaceEqFlagObj.hasLamp
  1205. return meetingScene
  1206. },
  1207. isSpaceCanControl() {
  1208. let flag = true
  1209. if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2 || !this.isUserControlFromMap) {
  1210. flag = false
  1211. }
  1212. console.log(flag, '----flag')
  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. this.getCardWidth()
  1237. this.getWeatherInfo()// 天气预报
  1238. var nowTimeStr = moment().format('YYYY-MM-DD')
  1239. var eightTime = moment(nowTimeStr + ' 20:00:00').valueOf()
  1240. var sixTime = moment(nowTimeStr + ' 05:00:00').valueOf()
  1241. this.sixTime = sixTime
  1242. this.eightTime = eightTime
  1243. this.routeParams = routeParams
  1244. },
  1245. onShow() {
  1246. this.fromOtherPages()
  1247. this.spaceInfoStatusTimer()
  1248. },
  1249. onReady() {
  1250. // var scale = 750 / wx.getSystemInfoSync().windowWidth ; // 这是px转rpx 750/ wx.getSystemInfoSync().windowWidth=rpx/px 任何手机都是750rpx
  1251. var windowHeightpx = wx.getSystemInfoSync().screenHeight
  1252. // 设置初始值 topBarHeight*scale+roomPicTop
  1253. this.transYCopy =
  1254. windowHeightpx - switchPanelHeight - this.topBarHeight - this.roomPicTop // topBarHeight上顶端的bar
  1255. this.windowHeightpx = windowHeightpx
  1256. if (this.routeParams.showmap == 'true') {
  1257. this.transY = this.transYCopy
  1258. // console.log('onready');
  1259. }
  1260. },
  1261. onHide() {
  1262. // this.spaceEqFlagObj = {
  1263. // hasAir: true,
  1264. // hasLamp: false
  1265. // }
  1266. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1267. this.homePageHasHidden = false
  1268. },
  1269. onUnload() {
  1270. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1271. },
  1272. methods: {
  1273. // 关闭设置常驻的弹框
  1274. closePermanentPanel(val) {
  1275. this.isShowPermanent = val
  1276. },
  1277. // 从找一找和首页 进入本页面
  1278. async fromOtherPages() {
  1279. // homeSetSpace 设置常驻, homeShowEnv 环境调节, FindIt 找一找
  1280. // openLamp 开灯, airAddOne 空调调高一度, airReduceOne 空调下降一度 , closeLampAir 关闭灯和空调
  1281. if (this.routeParams.from === 'FindIt') {
  1282. this.getCurrentSpace('FindIt')
  1283. this.isUserControlFromMap = this.routeParams.isUserControl
  1284. this.options.spaceId = this.routeParams.spaceId
  1285. this.moveToBottom = true // 来自找一找, 页面在底部
  1286. this.getData() // 获取数据
  1287. } else {
  1288. // 从首页进入
  1289. await this.getCurrentSpace('home')
  1290. if (this.options.spaceId) {
  1291. await this.getData()
  1292. }
  1293. let setAirtemp = this.$refs.airHandCard.airTemp
  1294. switch (this.routeParams.from) {
  1295. case 'homeShowEnv':
  1296. if (this.userControlSpace.isControlSpace === 1 || this.userControlSpace.isControlSpace === 2) {
  1297. this.moveToBottom = true
  1298. this.toRoom()
  1299. }
  1300. break
  1301. case 'homeSetSpace':
  1302. this.isShowPermanent = true
  1303. this.moveToBottom = true
  1304. this.toRoom()
  1305. break
  1306. case 'openLamp':
  1307. this.selectCrad('', 'lamp')
  1308. this.$refs.lampAdjust.eqChange(true, 'allLamp')
  1309. break
  1310. case 'airAddOne':
  1311. this.selectCrad('', 'air')
  1312. this.$refs.airHandCard.changeZongAir('temp', setAirtemp + 1)
  1313. break
  1314. case 'airReduceOne':
  1315. this.selectCrad('', 'air')
  1316. this.$refs.airHandCard.changeZongAir('temp', setAirtemp - 1)
  1317. break
  1318. case 'closeLampAir':
  1319. this.selectCrad('', 'air')
  1320. this.$refs.lampAdjust.eqChange(false, 'allLamp')
  1321. this.$refs.airHandCard.airData.isOpen = false
  1322. this.$refs.airHandCard.changeZongAir('sw')
  1323. break
  1324. default:
  1325. break
  1326. }
  1327. }
  1328. },
  1329. getCurrentSpace(from) {
  1330. return checkUserControl().then(res => {
  1331. // isControlSpace 1-租户下无可控;2-租户有可控;3-用户有可控 4-当前空间为常驻空间
  1332. this.userControlSpace = res
  1333. // 从首页进入 才给空间重新赋值
  1334. if (from === 'home') {
  1335. this.options.spaceId = res.spaceId || ''
  1336. }
  1337. })
  1338. },
  1339. setCanScroll(val) {
  1340. this.canscroll = val
  1341. },
  1342. // 空调弹框
  1343. openAirHandPop(val, tempObj) {
  1344. this.airHandItem = val
  1345. let hight = 0
  1346. if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
  1347. hight = 45
  1348. }
  1349. if ((val.boundPoint.gearSetBound || val.boundPoint.modeSetBound) && val.boundPoint.tempSetBound) {
  1350. hight = 55
  1351. }
  1352. if (val.boundPoint.gearSetBound && val.boundPoint.modeSetBound && val.boundPoint.tempSetBound) {
  1353. hight = 70
  1354. }
  1355. this.airPopHight = hight
  1356. this.airHandData = tempObj
  1357. this.airHandVisible = true
  1358. },
  1359. changeAirHandOrder(pobj, deviceObjCopy) {
  1360. this.$refs.airHandCard.changeOneAir(pobj.id, pobj.code, pobj.value, deviceObjCopy)
  1361. this.airHandItem = deviceObjCopy
  1362. },
  1363. // 地暖弹框
  1364. openFloorFeatPop(val) {
  1365. this.floorfeatVisible = true
  1366. this.floorFeatItem = val
  1367. },
  1368. // 地暖 数据
  1369. getFloorHeatData(val) {
  1370. this.floorHeatData = val
  1371. this.floorHeatData.len = !!val.len
  1372. this.navList.map(item => {
  1373. if (item.code === 'heat') {
  1374. item.noShow = !val.len
  1375. }
  1376. })
  1377. },
  1378. // 窗帘-弹窗
  1379. showCurtainPop(val) {
  1380. this.crutainType = JSON.parse(JSON.stringify(val))
  1381. this.curtainVisible = true
  1382. },
  1383. // 色温弹框
  1384. openColourPop(val) {
  1385. this.colourVisible = true
  1386. this.colourConfig = val
  1387. },
  1388. // 空间下设备是否受加班可控
  1389. checkEquipmentConfigStatus() {
  1390. return queryEquipmentRunConfig(this.options.spaceId).then(res => {
  1391. const resArr = res.data
  1392. this.equipmentsConfig = resArr
  1393. })
  1394. },
  1395. // 手动 弹窗 展示的设备类型
  1396. dialogShowEquipType(val) {
  1397. this.bookEquipList = val
  1398. },
  1399. showCurtain(len) {
  1400. this.spaceEqFlagObj.hasCurtain = !!len
  1401. this.navList.map((item, idx) => {
  1402. if (item.code === 'curtain') {
  1403. item.noShow = !len
  1404. }
  1405. })
  1406. },
  1407. // 插座
  1408. showSocket(len) {
  1409. this.spaceEqFlagObj.hasSocket = !!len
  1410. this.navList.map((item, idx) => {
  1411. if (item.code === 'socket') {
  1412. item.noShow = !len
  1413. }
  1414. })
  1415. },
  1416. getWorkDayTime() {
  1417. // 获取个人空间使用时间
  1418. return queryCustomAndScence({ spaceId: this.options.spaceId }).then(
  1419. res => {
  1420. this.workDayTime = res
  1421. }
  1422. )
  1423. },
  1424. vibrateShort() {
  1425. if (wx.canIUse('vibrateShort')) {
  1426. wx.vibrateShort()
  1427. } else {
  1428. wx.vibrateLong()
  1429. }
  1430. },
  1431. showAllClose() {
  1432. this.closeAllShow = true
  1433. this.closeShowNum = 0
  1434. this.closeStatus = false
  1435. },
  1436. // 关闭全部关闭弹窗
  1437. hideCloseAll() {
  1438. this.closeAllShow = false
  1439. // this.closeShowNum=0 ;
  1440. // this.closeStatus=false ;
  1441. },
  1442. // 确认关闭所有设备
  1443. sureCloseAll() {
  1444. this.vibrateShort()
  1445. this.$refs.allclose.controlEquipStatistics()
  1446. this.closeShowNum = 1
  1447. this.closeStatus = true
  1448. var interval = setInterval(() => {
  1449. this.closeShowNum++
  1450. if (this.closeShowNum == 5) {
  1451. clearInterval(interval)
  1452. }
  1453. }, 1800)
  1454. },
  1455. // 空调 - airTemp
  1456. airShowVisible(val) {
  1457. this.airVisible = true
  1458. this.airSetText = {
  1459. notice: '',
  1460. remark: '',
  1461. designTemperature: ''
  1462. }
  1463. this.airSetText.designTemperature = val.designTemperature // 目标温度
  1464. this.airSetText.toWhere = val.toWhere
  1465. },
  1466. airTemp(val) {
  1467. this.airSetText.notice = val.notice
  1468. if (val.remark && val.remark !== []) {
  1469. const remark = val.remark.split('*')
  1470. this.airSetText.remark = remark
  1471. }
  1472. },
  1473. getWeatherInfo() {
  1474. getWeather().then(res => {
  1475. const outWeather = res.content ? res.content : {}
  1476. var text = outWeather.text || ''
  1477. this.getnowTime(text) // 头部背景
  1478. })
  1479. },
  1480. getnowTime(text) { // 头部背景图片
  1481. let now = moment().hours()
  1482. if (text.indexOf('霾') > -1) {
  1483. this.topbgimg = `${this.h5StaticPath}office_smog.jpg`
  1484. } else {
  1485. if (now >= 6 && now < 19) {
  1486. // 白天
  1487. this.topbgimg = `${this.h5StaticPath}office_bright.jpg`
  1488. } else {
  1489. // 夜晚
  1490. this.topbgimg = `${this.h5StaticPath}office_night.jpg`
  1491. }
  1492. }
  1493. },
  1494. async getData() {
  1495. // 获取数据
  1496. await this.getSpaceInfo() // 空间指数信息
  1497. await this.querySpaceSceneConfig() // 获取空间场景
  1498. await this.getWorkDayTime() // 工作组时间
  1499. this.getEquipments() // 空间下的设备
  1500. this.checkEquipmentConfigStatus()
  1501. },
  1502. getEquipments() {
  1503. // 获取空间下设备
  1504. const params = {
  1505. spaceId: this.options.spaceId
  1506. // category: // 设备类。可不填,查询所有。
  1507. }
  1508. getEquipmentListHttp(params).then(res => {
  1509. // equipmentCategory 有 空调 ACATFC、ACATFU、ACATVA、ACATVI;有灯 灯 SELTLT
  1510. // ACATVA 变风量系统
  1511. this.navList.map(item => {
  1512. if (item.code === 'air' || item.code === 'lamp') {
  1513. item.noShow = true
  1514. }
  1515. })
  1516. this.spaceEqFlagObj.hasAir = false
  1517. this.spaceEqFlagObj.hasLamp = false;
  1518. (res.data || []).forEach(item => {
  1519. if (item.equipmentCategory === 'ACATVA') {
  1520. this.isACATVA = true // 如果是嘉铭的ACATVA 则不显示开关
  1521. }
  1522. if (item.equipmentCategory === 'ACATFC') {
  1523. this.isACATFC = true // 如果是嘉铭的ACATVA 则不显示开关
  1524. }
  1525. if (
  1526. item.equipmentCategory === 'ACATFC' ||
  1527. item.equipmentCategory === 'ACATVA' ||
  1528. item.equipmentCategory === 'ACATVI'
  1529. ) {
  1530. this.spaceEqFlagObj.hasAir = true
  1531. this.navList.map(item => {
  1532. if (item.code === 'air') {
  1533. item.noShow = false
  1534. }
  1535. })
  1536. this.airKey++
  1537. } else if (item.equipmentCategory === 'SELTLT') {
  1538. this.spaceEqFlagObj.hasLamp = true
  1539. this.navList.map(item => {
  1540. if (item.code === 'lamp') {
  1541. item.noShow = false
  1542. }
  1543. })
  1544. this.lampKey++
  1545. }
  1546. })
  1547. })
  1548. },
  1549. switchoverScene(code) {
  1550. // 改变场景(上班.讨论.投影.散会.下班)
  1551. const params = {
  1552. spaceId: this.options.spaceId,
  1553. type: code,
  1554. pubname: config.brsgServer.pubname
  1555. }
  1556. return switchoverSceneHttp(params)
  1557. },
  1558. spaceInfoStatusTimer() {
  1559. spaceInfoStatusTimer = clearInterval(spaceInfoStatusTimer)
  1560. spaceInfoStatusTimer = setInterval(() => {
  1561. this.getSpaceInfo() // 空间信息
  1562. }, 20 * 1000) // 2秒描刷接口
  1563. },
  1564. // 地图数据切换空间
  1565. mapChangeSpaceInfo(obj) {
  1566. // isUserControl-Boolean 用户空间是否可以控
  1567. const mapItem = JSON.parse(JSON.stringify(obj))
  1568. this.options.spaceId = mapItem.spaceId
  1569. this.isUserControlFromMap = mapItem.isUserControl
  1570. this.getData()
  1571. },
  1572. getSpaceInfo() {
  1573. // 空间信息
  1574. if (!this.options.spaceId) return
  1575. const params = {
  1576. criteria: {
  1577. spaceId: this.options.spaceId
  1578. // userId: 391
  1579. },
  1580. pubname: config.brsgServer.pubname,
  1581. openid: this.userInfo.userId
  1582. }
  1583. return getSpaceAdjustList(params).then(res => {
  1584. this.officeData = (res && res.content && res.content[0]) || {}
  1585. this.checkSpaceType(this.officeData.roomFuncType)
  1586. if (res && res.content) {
  1587. res.content.forEach(item => {
  1588. this.controlMode = item.controlMode || 1
  1589. var envlist = [
  1590. {
  1591. id: 1,
  1592. name: 'CO₂',
  1593. num: '--',
  1594. level: '--',
  1595. funcid: 'CO2',
  1596. code: 'co2'
  1597. },
  1598. {
  1599. id: 2,
  1600. name: 'PM2.5',
  1601. num: '--',
  1602. level: '--',
  1603. funcid: 'PM2d5',
  1604. code: 'pm25'
  1605. },
  1606. {
  1607. id: 3,
  1608. name: '甲醛',
  1609. num: '--',
  1610. level: '--',
  1611. funcid: 'HCHO',
  1612. code: 'jiaquan'
  1613. }
  1614. // { id: 4, name: '湿度', num: '--', level: '--', funcid: 'Tdb,RH', code: 'shidu' }
  1615. // { id: 3, name: 'TVOC', num: 0.4, level: '健康' }
  1616. ]
  1617. if (item.co2 || item.co2 == 0) {
  1618. envlist[0].level = this.checkLevel(item.co2, 'co2').levelTxt
  1619. envlist[0].num = item.co2
  1620. } else {
  1621. envlist[0].level = '--'
  1622. envlist[0].num = '--'
  1623. }
  1624. if (item.pm25 || item.pm25 === 0) {
  1625. envlist[1].level = this.checkLevel(item.pm25, 'pm25').levelTxt
  1626. envlist[1].num = item.pm25
  1627. } else {
  1628. envlist[1].level = '--'
  1629. envlist[1].num = '--'
  1630. }
  1631. if (item.hcho || item.hcho == 0) {
  1632. envlist[2].level = this.checkLevel(item.hcho, 'hcho').levelTxt
  1633. envlist[2].num = item.hcho.toFixed(2)
  1634. } else {
  1635. envlist[2].level = '--'
  1636. envlist[2].num = '--'
  1637. }
  1638. var temperNum = this.officeData.temperature
  1639. ? this.officeData.temperature
  1640. : '--'
  1641. var temperText = this.officeData.temperature
  1642. ? this.checkLevel(this.officeData.temperature, 'temper')
  1643. .levelTxt
  1644. : '--'
  1645. var tempObj = {
  1646. id: 0,
  1647. name: '温度',
  1648. num: temperNum,
  1649. level: temperText,
  1650. funcid: 'Tdb,RH',
  1651. code: 'wendu'
  1652. }
  1653. envlist.unshift(tempObj)
  1654. this.envlist = envlist
  1655. })
  1656. } else {
  1657. this.envlist = []
  1658. }
  1659. return 'success'
  1660. })
  1661. },
  1662. getMeetingScene() {
  1663. // 获取当前会议室的场景 OFFWORK
  1664. const params = {
  1665. spaceId: this.options.spaceId
  1666. }
  1667. getMeetingSceneHttp(params).then(res2 => {
  1668. var rescont = res2.content || ''
  1669. if (rescont === 'OFFWORK') {
  1670. rescont = 'ADJOURNMENT'
  1671. }
  1672. var filterArr = this.listSen.filter(function (item) {
  1673. return item.code === rescont
  1674. })
  1675. // 根据code 获取场景的名字
  1676. this.headScene = (filterArr[0] && filterArr[0].name) || '散会'
  1677. this.vanPopupIndex = rescont
  1678. })
  1679. },
  1680. querySpaceSceneConfig() {
  1681. // 获取空间场景
  1682. const params = {
  1683. spaceId: this.options.spaceId
  1684. }
  1685. this.roomHasScene = false
  1686. return querySpaceSceneConfigHttp(params).then(res => {
  1687. if (!res.data) return
  1688. let sceneArr = res.data
  1689. this.roomHasScene = true // 空间有场景
  1690. if (this.options.roomType !== '会议室') return
  1691. let copyListSen = JSON.parse(JSON.stringify(initListSen))
  1692. this.listSen = JSON.parse(JSON.stringify(initListSen))
  1693. copyListSen.forEach(item => {
  1694. let flag = false
  1695. let deleteIdx = null
  1696. sceneArr.forEach((j, idx) => {
  1697. deleteIdx = idx
  1698. if (item.code === j.sceneType) {
  1699. flag = true
  1700. }
  1701. })
  1702. if (!flag) {
  1703. this.listSen.splice(deleteIdx, 1)
  1704. }
  1705. })
  1706. this.popList = this.listSen
  1707. })
  1708. },
  1709. checkSpaceType(roomFuncType) {
  1710. // 空间类型处理
  1711. // const roomFuncType = this.officeData.roomFuncType ; // 空间类型
  1712. if (
  1713. roomFuncType === '311' ||
  1714. roomFuncType === '310' ||
  1715. roomFuncType === '312'
  1716. ) {
  1717. this.options.roomType = '个人'
  1718. this.headImg = 'office_person_2.png'
  1719. this.headScene = '工作'
  1720. } else if (
  1721. roomFuncType === '320' ||
  1722. roomFuncType === '321' ||
  1723. roomFuncType === '322' ||
  1724. roomFuncType === '323'
  1725. ) {
  1726. this.getMeetingScene()
  1727. this.options.roomType = '会议室'
  1728. this.headImg = 'office_normal_2.png'
  1729. } else if (
  1730. roomFuncType === '313' ||
  1731. roomFuncType === '314' ||
  1732. roomFuncType === '315'
  1733. ) {
  1734. this.options.roomType = '开放'
  1735. this.headImg = 'office_publi_2.png'
  1736. } else {
  1737. this.options.roomType = '其它'
  1738. this.headImg = 'office_publi_2.png'
  1739. }
  1740. },
  1741. checkLevel(value, name, seasonType) {
  1742. let tdbParam = {
  1743. Cooling: {
  1744. range: [22, 26],
  1745. text: ['偏冷', '舒适', '偏热']
  1746. },
  1747. Warm: {
  1748. range: [18, 24],
  1749. text: ['偏冷', '舒适', '偏热']
  1750. },
  1751. Transition: {
  1752. range: [18, 26],
  1753. text: ['偏冷', '舒适', '偏热']
  1754. }
  1755. }
  1756. let objList = {
  1757. humidity: {
  1758. range: [30, 70],
  1759. text: ['干燥', '健康', '潮湿']
  1760. },
  1761. co2: {
  1762. range: [800, 1000, 1500],
  1763. text: ['健康', '达标', '略高', '超标']
  1764. },
  1765. pm25: {
  1766. range: [35, 75, 115, 150, 250],
  1767. text: ['健康', '良', '轻度污染', '中度污染', '重度污染', '严重污染']
  1768. },
  1769. hcho: {
  1770. range: [0.1],
  1771. text: ['健康', '超标']
  1772. },
  1773. temper: {
  1774. range: [20, 24],
  1775. text: ['偏冷', '舒适', '偏热']
  1776. }
  1777. }
  1778. seasonType = seasonType || 'Transition'
  1779. objList.temper = tdbParam[seasonType]
  1780. let sortArr = [value, ...objList[name].range].sort((a, b) => { return a - b })
  1781. let level = sortArr.findIndex(item => item === value)
  1782. let levelTxt = objList[name].text[level]
  1783. return { level, levelTxt }
  1784. },
  1785. getCardWidth() {
  1786. // 获取每一个卡片的top height
  1787. var _this = this
  1788. const query = wx.createSelectorQuery()
  1789. query.select('#inToView4').boundingClientRect()
  1790. return new Promise(function (resolve, reject) {
  1791. query.exec(function (res) {
  1792. const mlr = 20 * 2 // 左右marign
  1793. _this.cardWidth = res[0].width - mlr
  1794. resolve()
  1795. })
  1796. })
  1797. },
  1798. getCardPosition() {
  1799. // 获取每一个卡片的top height
  1800. var _this = this
  1801. const query = wx.createSelectorQuery()
  1802. var halfWindowHeightpx = this.windowHeightpx / 2
  1803. query.select('#roomDetail').boundingClientRect()
  1804. query.select('#inToView02').boundingClientRect()
  1805. query.select('#inToView5').boundingClientRect()
  1806. query.select('#inToView1').boundingClientRect()
  1807. query.select('#inToView2').boundingClientRect()
  1808. query.select('#inToView3').boundingClientRect()
  1809. query.select('#inToView4').boundingClientRect()
  1810. return new Promise(function (resolve, reject) {
  1811. query.exec(function (res) {
  1812. _this.navList[0].top =
  1813. res[0].height +
  1814. _this.roomPicTop +
  1815. _this.topBarHeight -
  1816. halfWindowHeightpx // 这个是 与顶部的距离 减去 halfWindowHeightpx 以中间线为基准
  1817. _this.navList[0].height = _this.navList[0].noShow
  1818. ? 0
  1819. : (res[1] && res[1].height) || 0
  1820. for (let i = 1; i < res.length; i++) {
  1821. _this.dealNav(i, _this, res)
  1822. }
  1823. resolve()
  1824. })
  1825. })
  1826. },
  1827. dealNav(idx, _this, res) {
  1828. if (!_this.navList[idx]) return
  1829. const pre = idx - 1
  1830. const preTop = _this.navList[pre].top || 0
  1831. const next = idx + 1
  1832. _this.navList[idx].top =
  1833. preTop + 15 + ((res[idx] && res[idx].height) || 0)
  1834. _this.navList[idx].height = _this.navList[idx].noShow
  1835. ? 0
  1836. : (res[next] && res[next].height) || 0
  1837. },
  1838. // 导航条
  1839. async selectCrad(e, code) {
  1840. const targetObj = this.navList.find(function (item) {
  1841. return item.code === code
  1842. })
  1843. let id = code ? targetObj.id : e.currentTarget.id
  1844. if (id === this.navId) return
  1845. this.navId = id
  1846. this.lampHide = !this.lampHide // 当点击了导航 灯的列表要收起
  1847. await this.getCardPosition()
  1848. var targetNav = this.navList.find(function (item) {
  1849. return item.id == id
  1850. })
  1851. this.scrollTop = targetNav.top // 实现点击导航 滚动
  1852. },
  1853. async scrollEvent(event) {
  1854. // 空间不可控不能滑动
  1855. if (!this.isSpaceCanControl) return
  1856. // 滚动 选中导航条相应的
  1857. await this.getCardPosition()
  1858. var scrollTop = (event.detail || event.$wx.detail || {}).scrollTop || 0
  1859. this.realScrollTop = scrollTop
  1860. // console.log('scrollEvent-scrollTop', this.realScrollTop) ;
  1861. if (scrollTop < this.navList[0].top + this.navList[0].height) {
  1862. this.navId = 0
  1863. }
  1864. for (let i = 0; i < 8; i++) {
  1865. this.determine(scrollTop, i)
  1866. }
  1867. },
  1868. determine(scrollTop, idx) {
  1869. if (!this.navList[idx]) return
  1870. const next = idx + 1
  1871. const nextTop = this.navList[next] ? this.navList[next].top : 0
  1872. const nextHeight = this.navList[next] ? this.navList[next].height : 0
  1873. if (
  1874. scrollTop > this.navList[idx].top + this.navList[idx].height &&
  1875. scrollTop < nextTop + nextHeight
  1876. ) {
  1877. this.navId = next
  1878. }
  1879. },
  1880. scrollToUpper(event) {
  1881. // 到达顶部
  1882. // console.log('scrollToUpper-scrollTop');
  1883. // this.realScrollTop = 0 ;
  1884. },
  1885. // 进入 detail 页
  1886. handleDetail(data) {
  1887. wx.navigateTo({
  1888. url: `./detail?spaceId=${this.officeData.id}&funcid=${data.funcid}`
  1889. })
  1890. },
  1891. // 进入地图页
  1892. toRoom() {
  1893. this.scrollTop = null
  1894. this.scrollTop = 0
  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>