index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <div class="wrapper">
  3. <div class="layout" v-if="!isMobile">
  4. <div class="list-con">
  5. <div class="l-h">
  6. <img :src="`${$cdn}images/icon-story.png`" alt="" />
  7. <p>{{params.name}}</p>
  8. </div>
  9. <div class="l-type">
  10. <div class="area">
  11. <span class="txt-bold">区域</span>
  12. <ul>
  13. <li
  14. :class="{ active: item.id === a_active }"
  15. v-for="(item, i) in area"
  16. @click="a_active = item.id"
  17. :key="i"
  18. >
  19. {{ item.name }}
  20. </li>
  21. </ul>
  22. </div>
  23. </div>
  24. <div class="l-con">
  25. <template v-if="list.length>0">
  26. <Card @handleItem="handleItem" v-for="(item, i) in list" :item="item" :key="i" />
  27. </template>
  28. <template v-else>
  29. <div class="no-result">
  30. <img :src="`${$cdn}images/search-icon.png`" alt />
  31. <span>暂时没有内容呢~</span>
  32. </div>
  33. </template>
  34. </div>
  35. <div v-if="total" class="paging" :class="{ pagingshow: total }">
  36. <Paging
  37. @clickHandle="pageChange"
  38. :current="currentPage"
  39. :total="total"
  40. :equable="pageSize"
  41. />
  42. </div>
  43. </div>
  44. <!-- <div class="qihuan" @click="$router.push({path:'/story'})">
  45. <img :src="`${$cdn}images/qh-icon.png`" alt />
  46. <p>切换模式</p>
  47. </div> -->
  48. </div>
  49. <div class="mobileLayout" v-if="isMobile">
  50. <img class="back-icon" @click="$router.push({path:'/'})" :src="`${$cdn}images/back-icon.png`" alt="">
  51. <div class="list-con">
  52. <div class="l-h">
  53. <img :src="`${$cdn}images/icon-story.png`" alt="" />
  54. <p>{{params.name}}</p>
  55. </div>
  56. <div class="l-type">
  57. <div class="select-block">
  58. <span class="txt-bold" id="label-block" @click="blockVisible = !blockVisible">楼体 <svg viewBox='0 0 140 140' width='12' height='12' xmlns='http://www.w3.org/2000/svg'><g><path d='m121.3,34.6c-1.6-1.6-4.2-1.6-5.8,0l-51,51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8,0-1.6,1.6-1.6,4.2 0,5.8l53.9,53.9c0.8,0.8 1.8,1.2 2.9,1.2 1,0 2.1-0.4 2.9-1.2l53.9-53.9c1.7-1.6 1.7-4.2 0.1-5.8z' fill='black'/></g></svg></span>
  59. <div class="select-box" id="select-block" v-if="blockVisible">
  60. <ul>
  61. <li
  62. :class="{ active: item.id === b_active }"
  63. v-for="(item, i) in blocks"
  64. @click="b_active = item.id; blockVisible = false"
  65. :key="i"
  66. >
  67. {{ item.name }}
  68. </li>
  69. </ul>
  70. </div>
  71. </div>
  72. <div class="area">
  73. <span class="txt-bold" id="label-area" @click="areaVisible = !areaVisible">区域 <svg viewBox='0 0 140 140' width='12' height='12' xmlns='http://www.w3.org/2000/svg'><g><path d='m121.3,34.6c-1.6-1.6-4.2-1.6-5.8,0l-51,51.1-51.1-51.1c-1.6-1.6-4.2-1.6-5.8,0-1.6,1.6-1.6,4.2 0,5.8l53.9,53.9c0.8,0.8 1.8,1.2 2.9,1.2 1,0 2.1-0.4 2.9-1.2l53.9-53.9c1.7-1.6 1.7-4.2 0.1-5.8z' fill='black'/></g></svg></span>
  74. <div class="select-box" id="select-area" v-if="areaVisible">
  75. <ul>
  76. <li
  77. :class="{ active: item.id === a_active }"
  78. v-for="(item, i) in area"
  79. @click="a_active = item.id; areaVisible = false"
  80. :key="i"
  81. >
  82. {{ item.name }}
  83. </li>
  84. </ul>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="l-con">
  89. <template v-if="list.length>0">
  90. <Card @handleItem="handleItem" v-for="(item, i) in list" :item="item" :key="i" />
  91. </template>
  92. <template v-else>
  93. <div class="no-result">
  94. <img :src="`${$cdn}images/search-icon.png`" alt />
  95. <span>暂时没有内容呢~</span>
  96. </div>
  97. </template>
  98. </div>
  99. <!-- <div v-if="total" class="paging" :class="{ pagingshow: total }">
  100. <Paging
  101. @clickHandle="pageChange"
  102. :current="currentPage"
  103. :total="total"
  104. :equable="pageSize"
  105. />
  106. </div> -->
  107. </div>
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import browser from "@/utils/browser.js";
  113. import Paging from "@/components/paging";
  114. import Card from "@/components/card";
  115. let blocks = [
  116. {
  117. name: "东楼",
  118. id: 1
  119. },
  120. {
  121. name: "西楼",
  122. id: 2
  123. }
  124. ];
  125. let area = [
  126. {
  127. name: "全部",
  128. id: '',
  129. },
  130. {
  131. name: "室内",
  132. id: 'in',
  133. },
  134. {
  135. name: "室外",
  136. id: 'out',
  137. }
  138. ];
  139. export default {
  140. components: {
  141. Paging,
  142. Card
  143. },
  144. computed:{
  145. params(){
  146. return this.$route.params.id
  147. }
  148. },
  149. data() {
  150. return {
  151. isMobile: browser.mobile,
  152. area,
  153. blocks,
  154. list:[],
  155. a_active: '',
  156. b_active: 1,
  157. l_active: '',
  158. t_active: '',
  159. total: 100,
  160. pageSize: 8,
  161. currentPage: 1,
  162. type:'roam',
  163. block: null,
  164. blockVisible: false,
  165. areaVisible: false
  166. };
  167. },
  168. methods: {
  169. pageChange(num) {
  170. this.currentPage = num
  171. },
  172. handleItem(item){
  173. this.$showBroadcast({
  174. link: {
  175. type: 'roam',
  176. item
  177. },
  178. })
  179. },
  180. async getList(){
  181. let res = await this.$http({
  182. method:'post',
  183. data:{
  184. block: this.isMobile ? this.b_active : this.params.id,
  185. pageNum: this.currentPage,
  186. pageSize: this.pageSize,
  187. searchKey: "",
  188. typeId: '',
  189. zone: this.a_active
  190. },
  191. url:`/api/web/roam/list`
  192. })
  193. this.list = res.data.list
  194. this.total = res.data.total
  195. },
  196. refresh(){
  197. this.currentPage===1?(this.getList()):(this.currentPage = 1)
  198. }
  199. },
  200. watch:{
  201. a_active(){
  202. this.refresh()
  203. },
  204. b_active(){
  205. this.refresh()
  206. },
  207. l_active(){
  208. this.refresh()
  209. },
  210. t_active(){
  211. this.refresh()
  212. },
  213. currentPage(){
  214. this.getList()
  215. }
  216. },
  217. mounted(){
  218. this.getList()
  219. if(this.isMobile) {
  220. this.pageSize = this.total;
  221. }
  222. }
  223. };
  224. </script>
  225. <style lang="less" scoped>
  226. @import '../../assets/css/globalVars.less';
  227. .wrapper {
  228. position: fixed;
  229. top: 0;
  230. left: 0;
  231. width: 100%;
  232. height: 100%;
  233. }
  234. .layout {
  235. width: calc(100% - 200px);
  236. position: relative;
  237. .list-con {
  238. width: 100%;
  239. padding-top: 80px;
  240. text-align: center;
  241. .l-h {
  242. color: @theme;
  243. font-family: "SY-bold";
  244. font-weight: bolder;
  245. font-size: 0;
  246. img {
  247. width: 110px;
  248. }
  249. p {
  250. font-size: 32px;
  251. }
  252. }
  253. .l-type {
  254. text-align: center;
  255. width: 76%;
  256. margin: 20px auto 0;
  257. display: flex;
  258. justify-content: space-between;
  259. .area,
  260. .louti,
  261. .types {
  262. margin-bottom: 20px;
  263. display: flex;
  264. align-items: baseline;
  265. ul {
  266. display: inline-block;
  267. font-size: 0;
  268. li {
  269. display: inline-block;
  270. padding: 2px 6px;
  271. margin: 0 6px;
  272. cursor: pointer;
  273. text-align: center;
  274. color: #382e2c;
  275. font-size: 16px;
  276. }
  277. .active {
  278. background: @theme;
  279. color: #c9a27b;
  280. }
  281. }
  282. }
  283. }
  284. .l-con {
  285. width: 76%;
  286. margin: 40px auto 0;
  287. box-sizing: border-box;
  288. text-align: left;
  289. font-size: 0;
  290. }
  291. .paging {
  292. // border-left: #e5e5e5 1px solid;
  293. height: 100%;
  294. margin-bottom: 40px;
  295. transition: all 0.4s ease;
  296. & /deep/ .p-layout {
  297. text-align: center;
  298. margin-top: 10px;
  299. }
  300. & /deep/ .p-layout a:not(:last-child) {
  301. margin: 10px 14px;
  302. display: inline-block;
  303. font-weight: 500;
  304. cursor: pointer;
  305. user-select: none;
  306. position: relative;
  307. transition: color 0.3s;
  308. color: @theme;
  309. font-size: 16px;
  310. }
  311. & /deep/ .p-layout a:last-child {
  312. position: relative;
  313. top: -5px;
  314. display: -ms-inline-flexbox;
  315. display: inline-flex;
  316. -ms-flex-align: center;
  317. align-items: center;
  318. height: 22px;
  319. padding: 0 9px;
  320. }
  321. & /deep/ .p-layout a:last-child::before,
  322. & /deep/ .p-layout a:last-child::after {
  323. content: "";
  324. display: inline-block;
  325. will-change: transform;
  326. transition: transform 0.3s;
  327. }
  328. & /deep/ .p-layout a:not(:last-child).active::after,
  329. & /deep/ .p-layout a:not(:last-child).active,
  330. & /deep/ .p-layout a:not(:last-child):hover,
  331. & /deep/ .p-layout a:not(:last-child):hover::after {
  332. color: @sub-theme;
  333. transform: scaleX(1);
  334. text-align: center;
  335. }
  336. & /deep/ .p-layout a:not(:last-child).active{
  337. position: relative;
  338. width: 29px;
  339. font-size: 14px;
  340. &::after{
  341. position: absolute;
  342. bottom: -2px;
  343. right: 0;
  344. content: '';
  345. width: 100%;
  346. height: 40px;
  347. background: url('@{cdn}page-active.png') no-repeat center center;
  348. z-index: -1;
  349. }
  350. }
  351. }
  352. }
  353. .qihuan{
  354. position: fixed;
  355. right: 250px;
  356. }
  357. }
  358. .mobileLayout {
  359. width: 100%;
  360. position: relative;
  361. .back-icon {
  362. position: fixed;
  363. top: 40px;
  364. left: 20px;
  365. }
  366. .list-con {
  367. width: 100%;
  368. padding-top: 5vh;
  369. text-align: center;
  370. .l-h {
  371. color: @theme;
  372. font-family: "SY-bold";
  373. font-weight: bolder;
  374. font-size: 0;
  375. img {
  376. width: 110px;
  377. }
  378. p {
  379. font-size: 32px;
  380. }
  381. }
  382. .l-type { // tags to select floors
  383. text-align: center;
  384. width: 90%;
  385. margin: 20px auto 0;
  386. display: flex;
  387. justify-content: space-between;
  388. .area,
  389. .louti,
  390. .select-block,
  391. .types {
  392. margin-bottom: 20px;
  393. display: flex;
  394. align-items: baseline;
  395. .select-box {
  396. position: fixed;
  397. background-color: #f5ede2;
  398. border-radius: 8px;
  399. z-index: 10;
  400. ul {
  401. display: block;
  402. font-size: 0;
  403. li {
  404. display: block;
  405. padding: 2px 6px;
  406. // margin: 0 6px;
  407. cursor: pointer;
  408. text-align: left;
  409. color: #382e2c;
  410. font-size: 16px;
  411. }
  412. .active {
  413. background: @theme;
  414. color: #c9a27b;
  415. }
  416. }
  417. }
  418. #label-block {
  419. position: fixed;
  420. top: 18vh;
  421. left: 5vw;
  422. }
  423. #select-block {
  424. top: 21vh;
  425. left: 5vw;
  426. }
  427. #label-area {
  428. position: fixed;
  429. top: 18vh;
  430. left: 25vw;
  431. }
  432. #select-area {
  433. top: 21vh;
  434. left: 25vw;
  435. }
  436. }
  437. }
  438. .l-con {
  439. position: fixed;
  440. top: 25vh;
  441. left: 5vw;
  442. width: 93vw;
  443. height: 65vh;
  444. padding: 0;
  445. box-sizing: border-box;
  446. text-align: left;
  447. font-size: 0;
  448. overflow-y: scroll;
  449. .no-result {
  450. margin-top: 150px;
  451. }
  452. }
  453. .paging {
  454. // border-left: #e5e5e5 1px solid;
  455. height: 100%;
  456. margin-bottom: 40px;
  457. transition: all 0.4s ease;
  458. & /deep/ .p-layout {
  459. text-align: center;
  460. margin-top: 10px;
  461. }
  462. & /deep/ .p-layout a:not(:last-child) {
  463. margin: 10px 14px;
  464. display: inline-block;
  465. font-weight: 500;
  466. cursor: pointer;
  467. user-select: none;
  468. position: relative;
  469. transition: color 0.3s;
  470. color: @theme;
  471. font-size: 16px;
  472. }
  473. & /deep/ .p-layout a:last-child {
  474. position: relative;
  475. top: -5px;
  476. display: -ms-inline-flexbox;
  477. display: inline-flex;
  478. -ms-flex-align: center;
  479. align-items: center;
  480. height: 22px;
  481. padding: 0 9px;
  482. }
  483. & /deep/ .p-layout a:last-child::before,
  484. & /deep/ .p-layout a:last-child::after {
  485. content: "";
  486. display: inline-block;
  487. will-change: transform;
  488. transition: transform 0.3s;
  489. }
  490. & /deep/ .p-layout a:not(:last-child).active::after,
  491. & /deep/ .p-layout a:not(:last-child).active,
  492. & /deep/ .p-layout a:not(:last-child):hover,
  493. & /deep/ .p-layout a:not(:last-child):hover::after {
  494. color: @sub-theme;
  495. transform: scaleX(1);
  496. text-align: center;
  497. }
  498. & /deep/ .p-layout a:not(:last-child).active{
  499. position: relative;
  500. width: 29px;
  501. font-size: 14px;
  502. &::after{
  503. position: absolute;
  504. bottom: -2px;
  505. right: 0;
  506. content: '';
  507. width: 100%;
  508. height: 40px;
  509. background: url('@{cdn}page-active.png') no-repeat center center;
  510. z-index: -1;
  511. }
  512. }
  513. }
  514. }
  515. .qihuan{
  516. position: fixed;
  517. right: 250px;
  518. }
  519. }
  520. </style>