123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685 |
- <template>
- <div class="wrapper">
- <div class="mobileLayout" v-if="isMobile">
- <img class="back-icon" @click="$router.push({path:'/'})" :src="`${$cdn}images/back-icon.png`" alt="">
- <div class="list-con">
- <div class="l-h">
- <img :src="`${$cdn}images/icon-story.png`" alt="" />
- <p>部件赏析</p>
- </div>
- <div class="l-type">
- <div class="louti">
- <span class="txt-bold" id="label-louti" @click="loutiVisible = !loutiVisible">楼体 <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>
- <div class="select-box" id="select-louti" v-if="loutiVisible">
- <ul>
- <li
- :class="{ active: item.id === l_active }"
- v-for="(item, i) in louti"
- @click="l_active = item.id; loutiVisible = false"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- <div class="area">
- <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>
- <div class="select-box" id="select-area" v-if="areaVisible">
- <ul>
- <li
- :class="{ active: item.id === a_active }"
- v-for="(item, i) in area"
- @click="a_active = item.id; areaVisible = false"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- <div class="types">
- <span class="txt-bold" id="label-types" @click="typesVisible = !typesVisible">类型 <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>
- <div class="select-box" id="select-types" v-if="typesVisible">
- <ul>
- <li
- :class="{ active: item.id == t_active }"
- @click="t_active = item.id; typesVisible = false"
- v-for="(item, i) in types"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="l-con">
- <template v-if="list.length>0">
- <Card @handleItem="handleItem(item)" v-for="(item, i) in list" :item="item" :key="i" />
- </template>
- <template v-else>
- <div class="no-result">
- <img :src="`${$cdn}images/search-icon.png`" alt />
- <span>暂时没有内容呢~</span>
- </div>
- </template>
- </div>
-
- </div>
-
- </div>
- <div class="layout" v-if="!isMobile">
- <div class="list-con">
- <div class="l-h">
- <img :src="`${$cdn}images/icon-story.png`" alt="" />
- <p>部件赏析</p>
- </div>
- <div class="l-type">
- <div class="louti">
- <span class="txt-bold">楼体:</span>
- <ul>
- <li
- :class="{ active: item.id === l_active }"
- v-for="(item, i) in louti"
- @click="l_active = item.id"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- <div class="area">
- <span class="txt-bold">区域:</span>
- <ul>
- <li
- :class="{ active: item.id === a_active }"
- v-for="(item, i) in area"
- @click="a_active = item.id"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- <div class="types">
- <span class="txt-bold">类型:</span>
- <ul>
- <li
- :class="{ active: item.id == t_active }"
- @click="t_active = item.id"
- v-for="(item, i) in types"
- :key="i"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- <div class="l-con">
- <template v-if="list.length>0">
- <Card @handleItem="handleItem(item)" v-for="(item, i) in list" :item="item" :key="i" />
- </template>
- <template v-else>
- <div class="no-result">
- <img :src="`${$cdn}images/search-icon.png`" alt />
- <span>暂时没有内容呢~</span>
- </div>
- </template>
- </div>
- <div class="paging" v-if="total" :class="{ pagingshow: total }">
- <Paging
- @clickHandle="pageChange"
- :current="currentPage"
- :total="total"
- :equable="pageSize"
- />
- </div>
- </div>
- <div class="qihuan" @click="$router.push({path:'/story'})">
- <img :src="`${$cdn}images/qh-icon.png`" alt />
- <p>海报模式</p>
- </div>
- </div>
- </div>
- </template>
- <script>
- import browser from "@/utils/browser.js";
- import Paging from "@/components/paging";
- import Card from "@/components/card";
- let area = [
- {
- name: "全部",
- id: '',
- },
- {
- name: "室内",
- id: 'in',
- },
- {
- name: "室外",
- id: 'out',
- }
- ];
- let louti = [
- {
- name: "全部",
- id: '',
- },
- {
- name: "东楼",
- id: 1,
- },
- {
- name: "西楼",
- id: 2,
- },
- {
- name: "钟楼",
- id: 3,
- }
- ];
- let list = [
- {
- name: "全部",
- id: "",
- },
- {
- name: "墙饰面",
- id: "",
- },
- {
- name: "廊道构件",
- id: "",
- },
- {
- name: "栏柱构件",
- id: "",
- },
- {
- name: "雕饰构件",
- id: "",
- },
- {
- name: "墙面构件",
- id: "",
- },
- {
- name: "楼梯构件",
- id: "",
- },
- {
- name: "楼梯构件",
- id: "",
- },
- ];
- export default {
- components: {
- Paging,
- Card
- },
- data() {
- return {
- isMobile: browser.mobile,
- area,
- types:[],
- list,
- louti,
- a_active: '',
- l_active: '',
- t_active: this.$route.query.id ||'',
- total: 100,
- pageSize: 8,
- currentPage: 1,
- type:'part',
- loutiVisible: false,
- areaVisible: false,
- typesVisible: false
- };
- },
- methods: {
- handleItem(){
- this.$router.push({
- name:'Parts',
- query:{
- block: this.l_active,
- typeId: this.t_active,
- zone: this.a_active
- }
- })
- },
- pageChange(num) {
- this.currentPage = num
- },
- async getType(){
- let res = await this.$http({
- type:'get',
- url:`/api/web/nav/${this.type}`
- })
- res.data.unshift({
- id:'',
- name:'全部'
- })
- this.types = res.data
- },
- async getList(){
- let res = await this.$http({
- method:'post',
- data:{
- block: this.l_active,
- pageNum: this.currentPage,
- pageSize: this.isMobile ? 100 : this.pageSize,
- searchKey: "",
- typeId: this.t_active,
- zone: this.a_active
- },
- url:`/api/web/part/list`
- })
- this.list = res.data.list
- this.total = res.data.total
- console.log(this.pageSize);
- },
- refresh(){
- this.currentPage===1?(this.getList()):(this.currentPage = 1)
- }
- },
- watch:{
- a_active(){
- this.refresh()
- },
- l_active(){
- this.refresh()
- },
- t_active(){
- this.refresh()
- },
- currentPage(){
- this.getList()
- }
- },
- mounted(){
- this.getType()
- this.getList()
- }
- };
- </script>
- <style lang="less" scoped>
- @import '../../assets/css/globalVars.less';
- .wrapper {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- }
- .mobileLayout {
- width: 100%;
- position: relative;
- .back-icon {
- position: fixed;
- top: 40px;
- left: 20px;
- }
- .list-con {
- width: 100%;
- padding-top: 5vh;
- text-align: center;
- .l-h {
- color: @theme;
- font-family: "SY-bold";
- font-weight: bolder;
- font-size: 0;
- img {
- width: 110px;
- }
- p {
- font-size: 32px;
- }
- }
- .l-type {
- text-align: left;
- width: 50%;
- margin: 20px 5vw 0;
- display: flex;
- justify-content: space-between;
- .area,
- .louti,
- .types {
- margin-bottom: 20px;
- display: flex;
- align-items: baseline;
- .select-box {
- position: fixed;
- background-color: #f5ede2;
- border-radius: 8px;
- z-index: 10;
- ul {
- display: block;
- font-size: 0;
- li {
- display: block;
- padding: 2px 6px;
- // margin: 0 6px;
- cursor: pointer;
- text-align: left;
- color: #382e2c;
- font-size: 16px;
- }
- .active {
- background: @theme;
- color: #c9a27b;
- }
- }
- }
- #label-louti {
- position: fixed;
- top: 18vh;
- left: 5vw;
- }
- #label-area {
- position: fixed;
- top: 18vh;
- left: 25vw;
- }
- #label-types {
- position: fixed;
- top: 18vh;
- left: 45vw;
- }
- #select-louti {
- top: 21vh;
- left: 5vw;
- }
- #select-area {
- top: 21vh;
- left: 25vw;
- }
- #select-types {
- top: 21vh;
- left: 45vw;
- }
- }
- }
- .l-con {
- position: fixed;
- top: 25vh;
- left: 5vw;
- width: 93vw;
- height: 55vh;
- padding: 0;
- box-sizing: border-box;
- text-align: left;
- font-size: 0;
- overflow-y: scroll;
- }
- .paging {
- // border-left: #e5e5e5 1px solid;
- height: 100%;
- margin-bottom: 40px;
- transition: all 0.4s ease;
- & /deep/ .p-layout {
- text-align: center;
- margin-top: 10px;
- }
- & /deep/ .p-layout a:not(:last-child) {
- margin: 10px 14px;
- display: inline-block;
- font-weight: 500;
- cursor: pointer;
- user-select: none;
- position: relative;
- transition: color 0.3s;
- color: @theme;
- font-size: 16px;
- }
- & /deep/ .p-layout a:last-child {
- position: relative;
- top: -5px;
- display: -ms-inline-flexbox;
- display: inline-flex;
- -ms-flex-align: center;
- align-items: center;
- height: 22px;
- padding: 0 9px;
- }
- & /deep/ .p-layout a:last-child::before,
- & /deep/ .p-layout a:last-child::after {
- content: "";
- display: inline-block;
- will-change: transform;
- transition: transform 0.3s;
- }
- & /deep/ .p-layout a:not(:last-child).active::after,
- & /deep/ .p-layout a:not(:last-child).active,
- & /deep/ .p-layout a:not(:last-child):hover,
- & /deep/ .p-layout a:not(:last-child):hover::after {
- color: @sub-theme;
- transform: scaleX(1);
- text-align: center;
- }
- & /deep/ .p-layout a:not(:last-child).active{
- position: relative;
- width: 29px;
- font-size: 14px;
- &::after{
- position: absolute;
- bottom: -2px;
- right: 0;
- content: '';
- width: 100%;
- height: 40px;
- background: url('@{cdn}page-active.png') no-repeat center center;
- z-index: -1;
- }
- }
- }
- }
- .qihuan{
- position: fixed;
- right: 250px;
- }
- }
- .layout {
- width: calc(100% - 200px);
- position: relative;
- .list-con {
- width: 100%;
- padding-top: 80px;
- text-align: center;
- .l-h {
- color: @theme;
- font-family: "SY-bold";
- font-weight: bolder;
- font-size: 0;
- img {
- width: 110px;
- }
- p {
- font-size: 32px;
- }
- }
- .l-type {
- text-align: center;
- width: 76%;
- margin: 20px auto 0;
- display: flex;
- justify-content: space-between;
- .area,
- .louti,
- .types {
- margin-bottom: 20px;
- display: flex;
- align-items: baseline;
- ul {
- display: inline-block;
- font-size: 0;
- li {
- display: inline-block;
- padding: 2px 6px;
- margin: 0 6px;
- cursor: pointer;
- text-align: center;
- color: #382e2c;
- font-size: 16px;
- }
- .active {
- background: @theme;
- color: #c9a27b;
- }
- }
- }
- }
- .l-con {
- width: 76%;
- margin: 40px auto 0;
- box-sizing: border-box;
- text-align: left;
- font-size: 0;
- min-height: 58vh;
- }
- .paging {
- // border-left: #e5e5e5 1px solid;
- height: 100%;
- margin-bottom: 40px;
- transition: all 0.4s ease;
- & /deep/ .p-layout {
- text-align: center;
- margin-top: 10px;
- }
- & /deep/ .p-layout a:not(:last-child) {
- margin: 10px 14px;
- display: inline-block;
- font-weight: 500;
- cursor: pointer;
- user-select: none;
- position: relative;
- transition: color 0.3s;
- color: @theme;
- font-size: 16px;
- }
- & /deep/ .p-layout a:last-child {
- position: relative;
- top: -5px;
- display: -ms-inline-flexbox;
- display: inline-flex;
- -ms-flex-align: center;
- align-items: center;
- height: 22px;
- padding: 0 9px;
- }
- & /deep/ .p-layout a:last-child::before,
- & /deep/ .p-layout a:last-child::after {
- content: "";
- display: inline-block;
- will-change: transform;
- transition: transform 0.3s;
- }
- & /deep/ .p-layout a:not(:last-child).active::after,
- & /deep/ .p-layout a:not(:last-child).active,
- & /deep/ .p-layout a:not(:last-child):hover,
- & /deep/ .p-layout a:not(:last-child):hover::after {
- color: @sub-theme;
- transform: scaleX(1);
- text-align: center;
- }
- & /deep/ .p-layout a:not(:last-child).active{
- position: relative;
- width: 29px;
- font-size: 14px;
- &::after{
- position: absolute;
- bottom: -2px;
- right: 0;
- content: '';
- width: 100%;
- height: 40px;
- background: url('@{cdn}page-active.png') no-repeat center center;
- z-index: -1;
- }
- }
- }
- }
- .qihuan{
- position: fixed;
- right: 250px;
- }
- }
- @media screen and (min-width: 500px) and (max-width: 1400px) {
- .layout{
- .list-con{
- .l-type {
- text-align: center;
- width: 90%;
- display: block;
- margin: 10px auto 0;
- .area,
- .louti,
- .types {
- margin-bottom: 5px;
- display: flex;
- align-items: baseline;
- ul {
- display: inline-block;
- font-size: 0;
- li {
- display: inline-block;
- padding: 2px 6px;
- margin: 0 6px;
- cursor: pointer;
- text-align: center;
- color: #382e2c;
- font-size: 16px;
- }
- .active {
- background: @theme;
- color: #c9a27b;
- }
- }
- }
- }
- .l-con{
- width: 90%;
- margin: 30px auto 0;
- }
- }
- }
- }
- @media screen and (max-width: 500px) {
- .item {
- width: 42.4vw;
- margin-right: 5vw;
- margin-bottom: 5vw;
- &:nth-of-type(2n) {
- margin-right: 0;
- }
- // &:nth-of-type(4n){
- // margin-right: @margin;
- // }
- }
- }
- </style>
|