|
|
@@ -17,47 +17,57 @@
|
|
|
width="38"
|
|
|
height="38"
|
|
|
:radius="38"
|
|
|
- :src="require('../../assets/img_default_photo.png')"
|
|
|
+ :src="companyInfo.logo || require('../../assets/img_default_photo.png')"
|
|
|
></van-image>
|
|
|
- <div class="text1">探索者!</div>
|
|
|
+ <div class="text1 text3">{{ companyInfo.name }}</div>
|
|
|
</div>
|
|
|
- <div class="welcom" v-else>
|
|
|
+ <div class="welcom" v-else-if="theme === 'theme1' || theme === 'theme2'">
|
|
|
<div class="left">
|
|
|
<div class="text1">WELCOME</div>
|
|
|
- <div class="text2">探索者!</div>
|
|
|
+ <div class="text2 text3">{{ companyInfo.name }}</div>
|
|
|
</div>
|
|
|
<van-image
|
|
|
width="38"
|
|
|
height="38"
|
|
|
:radius="38"
|
|
|
- :src="require('../../assets/img_default_photo.png')"
|
|
|
+ :src="companyInfo.logo || require('../../assets/img_default_photo.png')"
|
|
|
></van-image>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="mySwiper" :class="[`swiper-${theme}`]" ref="mySwiper">
|
|
|
- <div class="swiper-wrapper">
|
|
|
- <div class="swiper-slide" v-for="item in banners" :key="item.id">
|
|
|
- <product-small :info="item"></product-small>
|
|
|
+ <template v-if="theme === 'theme1' || theme === 'theme2' || theme === 'theme3'">
|
|
|
+ <div class="mySwiper" :class="[`swiper-${theme}`]" ref="mySwiper">
|
|
|
+ <div class="swiper-wrapper">
|
|
|
+ <div class="swiper-slide" v-for="item in banners" :key="item.id">
|
|
|
+ <product-small :info="item"></product-small>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <!-- 如果需要分页器 -->
|
|
|
+ <div class="swiper-pagination"></div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="large-logo" v-else>
|
|
|
+ <van-image
|
|
|
+ width="100%"
|
|
|
+ height="100%"
|
|
|
+ radius="12"
|
|
|
+ fit="cover"
|
|
|
+ :src="companyInfo.logo || require('../../assets/img_default_photo.png')"
|
|
|
+ ></van-image>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="home-title">
|
|
|
+ <span>新闻公告</span>
|
|
|
+
|
|
|
+ <div class="title-more">
|
|
|
+ <span>更多</span>
|
|
|
+ <van-icon name="icon-icon_inter" class-prefix="font_family" />
|
|
|
</div>
|
|
|
- <!-- 如果需要分页器 -->
|
|
|
- <div class="swiper-pagination"></div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- <swiper
|
|
|
- pagination
|
|
|
- @slideChange="changeMySwiper"
|
|
|
- :space-between="theme === 'theme2' || theme === 'theme3' ? 8 : 16"
|
|
|
- class="mySwiper"
|
|
|
- :autoplay="{ delay: 5000, disableOnInteraction: false }"
|
|
|
- v-if="banners.length > 0"
|
|
|
- slidesPerView="auto"
|
|
|
- centeredSlides
|
|
|
- >
|
|
|
- <swiper-slide v-for="item in banners" :key="item.id">
|
|
|
- <product-small :info="item"></product-small>
|
|
|
- </swiper-slide>
|
|
|
- </swiper> -->
|
|
|
+ <div class="newsList">
|
|
|
+ <news-large v-for="(item, index) in news" :theme="theme" :key="index" :info="item.obj"></news-large>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="home-title">数字艺术品</div>
|
|
|
|
|
|
<!-- <div class="tabs" v-if="!empty">
|
|
|
<div class="tab" :class="{ active: active === 0 }" @click="active = 0">数字藏品</div>
|
|
|
@@ -66,8 +76,9 @@
|
|
|
<div class="listSwiper">
|
|
|
<product-large
|
|
|
v-for="(item, index) in products"
|
|
|
+ :theme="theme"
|
|
|
:key="index"
|
|
|
- :info="products[index].obj"
|
|
|
+ :info="item.obj"
|
|
|
:type="item.type"
|
|
|
></product-large>
|
|
|
</div>
|
|
|
@@ -80,15 +91,11 @@ import Swiper from 'swiper/swiper-bundle';
|
|
|
import 'swiper/swiper.min.css';
|
|
|
import 'swiper/swiper-bundle.min.css';
|
|
|
|
|
|
-// import SwiperCore, { Pagination, Autoplay } from 'swiper';
|
|
|
-
|
|
|
-// // install Swiper modules
|
|
|
-// SwiperCore.use([Pagination, Autoplay]);
|
|
|
-
|
|
|
+import product from '../../mixins/product';
|
|
|
import ProductLarge from './productLarge.vue';
|
|
|
+import NewsLarge from './NewsLarge.vue';
|
|
|
import ProductSmall from './productSmall.vue';
|
|
|
import { mapState } from 'vuex';
|
|
|
-import { Image as VanImage } from 'vant';
|
|
|
|
|
|
export default {
|
|
|
name: 'home',
|
|
|
@@ -96,12 +103,19 @@ export default {
|
|
|
theme: {
|
|
|
type: String,
|
|
|
default: 'theme2'
|
|
|
+ },
|
|
|
+ companyInfo: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
+ mixins: [product],
|
|
|
components: {
|
|
|
ProductLarge,
|
|
|
ProductSmall,
|
|
|
- VanImage
|
|
|
+ NewsLarge
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['userInfo']),
|
|
|
@@ -146,13 +160,35 @@ export default {
|
|
|
riskShow: false,
|
|
|
activeIndex: 0,
|
|
|
isLoading: false,
|
|
|
- mySwiper: null
|
|
|
+ mySwiper: null,
|
|
|
+ companyInfo: {}
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
theme() {
|
|
|
this.$nextTick(() => {
|
|
|
- this.mySwiper.destroy();
|
|
|
+ if (this.mySwiper) {
|
|
|
+ this.mySwiper.destroy();
|
|
|
+ }
|
|
|
+ if (this.$refs.mySwiper) {
|
|
|
+ this.mySwiper = new Swiper(this.$refs.mySwiper, {
|
|
|
+ pagination: {
|
|
|
+ el: '.swiper-pagination'
|
|
|
+ },
|
|
|
+ autoplay: { delay: 5000, disableOnInteraction: false },
|
|
|
+ spaceBetween: this.theme === 'theme2' || this.theme === 'theme3' ? 8 : 16,
|
|
|
+ slidesPerView: 'auto',
|
|
|
+ centeredSlides: true
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getInit();
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.mySwiper) {
|
|
|
this.mySwiper = new Swiper(this.$refs.mySwiper, {
|
|
|
pagination: {
|
|
|
el: '.swiper-pagination'
|
|
|
@@ -162,23 +198,11 @@ export default {
|
|
|
slidesPerView: 'auto',
|
|
|
centeredSlides: true
|
|
|
});
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getInit();
|
|
|
- console.log(new Swiper());
|
|
|
- this.$nextTick(() => {
|
|
|
- this.mySwiper = new Swiper(this.$refs.mySwiper, {
|
|
|
- pagination: {
|
|
|
- el: '.swiper-pagination'
|
|
|
- },
|
|
|
- autoplay: { delay: 5000, disableOnInteraction: false },
|
|
|
- spaceBetween: this.theme === 'theme2' || this.theme === 'theme3' ? 8 : 16,
|
|
|
- slidesPerView: 'auto',
|
|
|
- centeredSlides: true
|
|
|
- });
|
|
|
+ }
|
|
|
});
|
|
|
+ // this.$http.get('sysConfig/get/home_bg').then(res => {
|
|
|
+ // this.bgImg = res.value || '';
|
|
|
+ // });
|
|
|
},
|
|
|
methods: {
|
|
|
changeSwiper() {
|
|
|
@@ -199,9 +223,11 @@ export default {
|
|
|
this.products = res.filter(item => {
|
|
|
return item.type === 'collection';
|
|
|
});
|
|
|
- this.news = res.filter(item => {
|
|
|
- return item.type === 'news';
|
|
|
- });
|
|
|
+ this.news = res
|
|
|
+ .filter(item => {
|
|
|
+ return item.type === 'news';
|
|
|
+ })
|
|
|
+ .slice(0, 3);
|
|
|
})
|
|
|
]).then(() => {
|
|
|
this.$toast.clear();
|
|
|
@@ -328,7 +354,7 @@ export default {
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
.darkBg {
|
|
|
- background-color: #181818;
|
|
|
+ background-color: var(--bg);
|
|
|
}
|
|
|
.theme2-bg {
|
|
|
width: 221px;
|
|
|
@@ -340,7 +366,7 @@ export default {
|
|
|
}
|
|
|
.theme3-bg {
|
|
|
width: 100%;
|
|
|
- position: absolute;
|
|
|
+ position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
height: auto;
|
|
|
@@ -349,39 +375,21 @@ export default {
|
|
|
.top {
|
|
|
display: flex;
|
|
|
padding: 9px 16px;
|
|
|
- background-color: @bg;
|
|
|
+ background-color: var(--bg);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
.logo {
|
|
|
width: 74px;
|
|
|
height: 26px;
|
|
|
}
|
|
|
-
|
|
|
- .search {
|
|
|
- flex-grow: 1;
|
|
|
- background-color: #fff;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-left: 10px;
|
|
|
- padding: 4px 20px;
|
|
|
- border-radius: 21px;
|
|
|
- img {
|
|
|
- width: 16px;
|
|
|
- height: 16px;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
- font-size: 14px;
|
|
|
- color: @text3;
|
|
|
- line-height: 24px;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.home {
|
|
|
width: 100%;
|
|
|
- // background-color: #fff;
|
|
|
+ // background-color: @bg3;
|
|
|
position: relative;
|
|
|
z-index: 1;
|
|
|
- background-color: #272b2e;
|
|
|
+ background-color: var(--bg2);
|
|
|
padding-top: var(--safe-top);
|
|
|
overflow-y: auto;
|
|
|
max-height: 720px;
|
|
|
@@ -396,7 +404,6 @@ export default {
|
|
|
padding: 16px 0;
|
|
|
// margin: 0 16px;
|
|
|
box-sizing: border-box;
|
|
|
- position: relative;
|
|
|
// padding-bottom: 35px;
|
|
|
|
|
|
.swiper-slide {
|
|
|
@@ -409,7 +416,7 @@ export default {
|
|
|
bottom: 30px;
|
|
|
}
|
|
|
|
|
|
- /deep/.swiper-pagination-bullet {
|
|
|
+ .swiper-pagination-bullet {
|
|
|
width: 5px;
|
|
|
height: 5px;
|
|
|
border-radius: 5px;
|
|
|
@@ -417,7 +424,8 @@ export default {
|
|
|
margin: 0 4px;
|
|
|
opacity: 1;
|
|
|
}
|
|
|
- /deep/.swiper-pagination-bullet-active {
|
|
|
+
|
|
|
+ .swiper-pagination-bullet-active {
|
|
|
background: var(--prim);
|
|
|
}
|
|
|
}
|
|
|
@@ -441,6 +449,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.swiper-theme4,
|
|
|
+.swiper-theme5 {
|
|
|
+ padding: 20px 0 16px;
|
|
|
+ .swiper-slide {
|
|
|
+ height: 160px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.large-logo {
|
|
|
+ padding: 20px 16px 16px;
|
|
|
+ height: 160px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
// .swiper-slide {
|
|
|
// width: 255px;
|
|
|
// }
|
|
|
@@ -623,4 +645,29 @@ export default {
|
|
|
border-radius: 8px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.home-title {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: var(--text1);
|
|
|
+ line-height: 24px;
|
|
|
+ padding: 10px 16px 8px;
|
|
|
+ .flex();
|
|
|
+
|
|
|
+ span {
|
|
|
+ flex-grow: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title-more {
|
|
|
+ .flex();
|
|
|
+ font-size: 12px;
|
|
|
+ color: #939599;
|
|
|
+ .font_family {
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.newsList {
|
|
|
+ padding-bottom: 8px;
|
|
|
+}
|
|
|
</style>
|