baiqiu-cms-decoration-dg 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/babel.config.js +5 -0
- package/{baiqiu-cms-decoration-dg.common.js → lib/baiqiu-cms-decoration-dg.common.js} +24 -24
- package/{baiqiu-cms-decoration-dg.common.js.map → lib/baiqiu-cms-decoration-dg.common.js.map} +1 -1
- package/{baiqiu-cms-decoration-dg.css → lib/baiqiu-cms-decoration-dg.css} +1 -1
- package/{baiqiu-cms-decoration-dg.umd.js → lib/baiqiu-cms-decoration-dg.umd.js} +24 -24
- package/{baiqiu-cms-decoration-dg.umd.js.map → lib/baiqiu-cms-decoration-dg.umd.js.map} +1 -1
- package/{baiqiu-cms-decoration-dg.umd.min.js → lib/baiqiu-cms-decoration-dg.umd.min.js} +4 -4
- package/lib/baiqiu-cms-decoration-dg.umd.min.js.map +1 -0
- package/package.json +50 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +594 -0
- package/src/api/com-service.js +26 -0
- package/src/assets/iconfont/demo.css +539 -0
- package/src/assets/iconfont/iconfont.css +158 -0
- package/src/assets/iconfont/iconfont.eot +0 -0
- package/src/assets/iconfont/iconfont.json +254 -0
- package/src/assets/iconfont/iconfont.svg +89 -0
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/iconfont/iconfont.woff +0 -0
- package/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/assets/img/pc-cms-v2/icon.png +0 -0
- package/src/assets/img/pc-cms-v2/next1.png +0 -0
- package/src/assets/img/pc-cms-v2/next2.png +0 -0
- package/src/assets/img/pc-cms-v2/prev1.png +0 -0
- package/src/assets/img/pc-cms-v2/prev2.png +0 -0
- package/src/assets/img/pc-cms-v2/text.png +0 -0
- package/src/components/cms/animate.scss +19 -0
- package/src/components/cms/buttonItem/buttonItem.js +135 -0
- package/src/components/cms/buttonItem/buttonItem.scss +95 -0
- package/src/components/cms/buttonItem/buttonItem.vue +47 -0
- package/src/components/cms/buttonItem/index.js +2 -0
- package/src/components/cms/cms.js +105 -0
- package/src/components/cms/cms.scss +46 -0
- package/src/components/cms/cms.vue +51 -0
- package/src/components/cms/customLayout/customLayout.js +46 -0
- package/src/components/cms/customLayout/customLayout.scss +8 -0
- package/src/components/cms/customLayout/customLayout.vue +15 -0
- package/src/components/cms/customLayout/index.js +2 -0
- package/src/components/cms/hotspot/hotspot.js +200 -0
- package/src/components/cms/hotspot/hotspot.scss +20 -0
- package/src/components/cms/hotspot/hotspot.vue +35 -0
- package/src/components/cms/hotspot/index.js +2 -0
- package/src/components/cms/imgNav/imgNav.js +176 -0
- package/src/components/cms/imgNav/imgNav.scss +113 -0
- package/src/components/cms/imgNav/imgNav.vue +123 -0
- package/src/components/cms/imgNav/index.js +2 -0
- package/src/components/cms/index.js +2 -0
- package/src/components/cms/mixin.js +239 -0
- package/src/components/cms/multipleLayout/index.js +2 -0
- package/src/components/cms/multipleLayout/multipleLayout.js +54 -0
- package/src/components/cms/multipleLayout/multipleLayout.scss +21 -0
- package/src/components/cms/multipleLayout/multipleLayout.vue +25 -0
- package/src/components/cms/productItem/index.js +2 -0
- package/src/components/cms/productItem/productItem.js +290 -0
- package/src/components/cms/productItem/productItem.scss +180 -0
- package/src/components/cms/productItem/productItem.vue +117 -0
- package/src/components/cms/singleLayout/index.js +2 -0
- package/src/components/cms/singleLayout/singleLayout.js +69 -0
- package/src/components/cms/singleLayout/singleLayout.scss +21 -0
- package/src/components/cms/singleLayout/singleLayout.vue +39 -0
- package/src/components/cms/slideLayout/index.js +2 -0
- package/src/components/cms/slideLayout/slideLayout.js +248 -0
- package/src/components/cms/slideLayout/slideLayout.scss +18 -0
- package/src/components/cms/slideLayout/slideLayout.vue +44 -0
- package/src/components/cms/swiperItem/index.js +2 -0
- package/src/components/cms/swiperItem/swiperItem.js +228 -0
- package/src/components/cms/swiperItem/swiperItem.scss +204 -0
- package/src/components/cms/swiperItem/swiperItem.vue +123 -0
- package/src/components/cms/tabLayout/index.js +2 -0
- package/src/components/cms/tabLayout/navItem/index.js +2 -0
- package/src/components/cms/tabLayout/navItem/navItem.js +47 -0
- package/src/components/cms/tabLayout/navItem/navItem.scss +23 -0
- package/src/components/cms/tabLayout/navItem/navItem.vue +13 -0
- package/src/components/cms/tabLayout/tabLayout.js +158 -0
- package/src/components/cms/tabLayout/tabLayout.scss +26 -0
- package/src/components/cms/tabLayout/tabLayout.vue +43 -0
- package/src/components/cms/textItem/index.js +2 -0
- package/src/components/cms/textItem/textItem.js +65 -0
- package/src/components/cms/textItem/textItem.scss +19 -0
- package/src/components/cms/textItem/textItem.vue +26 -0
- package/src/components/cms/utils.js +101 -0
- package/src/components/cms/videoItem/index.js +2 -0
- package/src/components/cms/videoItem/videoItem.js +96 -0
- package/src/components/cms/videoItem/videoItem.scss +27 -0
- package/src/components/cms/videoItem/videoItem.vue +56 -0
- package/src/components/cms/videoPlayer/index.js +2 -0
- package/src/components/cms/videoPlayer/videoPlayer.js +68 -0
- package/src/components/cms/videoPlayer/videoPlayer.scss +37 -0
- package/src/components/cms/videoPlayer/videoPlayer.vue +34 -0
- package/src/index.js +19 -0
- package/src/index.scss +221 -0
- package/src/main.js +8 -0
- package/src/utils/common.js +23 -0
- package/src/utils/http-client.js +101 -0
- package/src/utils/utils.js +63 -0
- package/baiqiu-cms-decoration-dg.umd.min.js.map +0 -1
- /package/{demo.html → lib/demo.html} +0 -0
- /package/{fonts → lib/fonts}/iconfont.529b3ed0.ttf +0 -0
- /package/{fonts → lib/fonts}/iconfont.580c918e.eot +0 -0
- /package/{fonts → lib/fonts}/iconfont.ea5b1aa2.woff +0 -0
- /package/{img → lib/img}/iconfont.654cc65b.svg +0 -0
@@ -0,0 +1,176 @@
|
|
1
|
+
import Swiper from 'swiper/js/swiper.js'
|
2
|
+
import 'swiper/css/swiper.css'
|
3
|
+
import hotspot from "../hotspot";
|
4
|
+
import { cmsMixin } from "../mixin";
|
5
|
+
import { dataSaveDecorationPageComponentEventFn } from '../../../utils/utils';
|
6
|
+
|
7
|
+
export default {
|
8
|
+
name: "imgNav",
|
9
|
+
mixins: [cmsMixin],
|
10
|
+
components: {
|
11
|
+
hotspot
|
12
|
+
},
|
13
|
+
props: {
|
14
|
+
},
|
15
|
+
data() {
|
16
|
+
return {
|
17
|
+
swiper: '',
|
18
|
+
imageList:[],
|
19
|
+
popList:[],
|
20
|
+
positionList:[],
|
21
|
+
positionTotal: [],
|
22
|
+
hasInitSwiper: false
|
23
|
+
}
|
24
|
+
},
|
25
|
+
computed: {
|
26
|
+
indicatorType() {
|
27
|
+
return this.attributeJson.indicatorType
|
28
|
+
},
|
29
|
+
// 图片组件样式
|
30
|
+
picStyle() {
|
31
|
+
let { attributeJson, ratio, animationInObj } = this
|
32
|
+
return {
|
33
|
+
animationDuration: `${animationInObj.duration}s`,
|
34
|
+
padding: `0 ${attributeJson.paddingSpacing * ratio}px`,
|
35
|
+
width: `${Math.ceil(attributeJson.baseStyle.w * ratio)}px`,
|
36
|
+
}
|
37
|
+
},
|
38
|
+
// 单个图片样式
|
39
|
+
picItemStyle() {
|
40
|
+
let { attributeJson, ratio } = this
|
41
|
+
let { oneLineCount } = attributeJson
|
42
|
+
return {
|
43
|
+
width: Math.ceil((attributeJson.baseStyle.w * ratio - attributeJson.paddingSpacing * 2 * ratio) / oneLineCount) + 'px',
|
44
|
+
height: Math.ceil(attributeJson.baseStyle.h * ratio) + 'px',
|
45
|
+
padding: '0 ' + attributeJson.itemSpacing * ratio + 'px',
|
46
|
+
}
|
47
|
+
},
|
48
|
+
list() {
|
49
|
+
return this.attributeJson.list
|
50
|
+
},
|
51
|
+
isSwiper() {
|
52
|
+
return (this.styleType == 3 && this.indicatorType == 2 && this.mode == 'pc') || (this.styleType == 2 && this.indicatorType == 2 && this.mode == 'mobile')
|
53
|
+
},
|
54
|
+
// 是否配置了有效图片
|
55
|
+
hasConfig() {
|
56
|
+
return this.attributeJson.list.some(item => {return item.picList.length!=0})
|
57
|
+
},
|
58
|
+
// 是否有轮播导航
|
59
|
+
hasSwiperButton() {
|
60
|
+
return (this.styleType == 3 && this.indicatorType == 2 && this.mode == 'pc')
|
61
|
+
},
|
62
|
+
// 是否有底部scroll
|
63
|
+
hasScrollBar() {
|
64
|
+
return (this.styleType == 2 && this.indicatorType == 2 && this.mode == 'mobile')
|
65
|
+
}
|
66
|
+
},
|
67
|
+
watch: {
|
68
|
+
isSwiper: {
|
69
|
+
handler(val) {
|
70
|
+
if (val) {
|
71
|
+
this.initSwiper()
|
72
|
+
}
|
73
|
+
},
|
74
|
+
immediate: true,
|
75
|
+
}
|
76
|
+
},
|
77
|
+
mounted() {
|
78
|
+
this.$nextTick(()=>{
|
79
|
+
let positionList = []
|
80
|
+
let positionTotal = []
|
81
|
+
this.list.forEach(item=>{
|
82
|
+
if(item.popList.length != 0) {
|
83
|
+
positionList.push(item.popList.length)
|
84
|
+
} else {
|
85
|
+
positionList.push(1)
|
86
|
+
}
|
87
|
+
})
|
88
|
+
|
89
|
+
positionList.forEach((item, index)=>{
|
90
|
+
let preList = positionList.slice(0, index)
|
91
|
+
let preTotal = preList.reduce((pre, cur)=>{
|
92
|
+
return pre + cur
|
93
|
+
}, 0)
|
94
|
+
positionTotal.push(preTotal)
|
95
|
+
})
|
96
|
+
this.positionList = positionList
|
97
|
+
this.positionTotal = positionTotal
|
98
|
+
})
|
99
|
+
},
|
100
|
+
methods: {
|
101
|
+
// 初始化轮播图
|
102
|
+
initSwiper() {
|
103
|
+
if(!this.hasConfig || !this.isSwiper) return
|
104
|
+
this.$nextTick(() => {
|
105
|
+
if (this.swiper) {
|
106
|
+
this.swiper.destroy(true, true)
|
107
|
+
this.swiper = null
|
108
|
+
}
|
109
|
+
|
110
|
+
let { attributeJson } = this
|
111
|
+
|
112
|
+
this.options = {
|
113
|
+
effect: 'slide',
|
114
|
+
autoplay: false,
|
115
|
+
slidesPerView: this.attributeJson.oneLineCount,
|
116
|
+
spaceBetween: attributeJson.itemSpacing
|
117
|
+
}
|
118
|
+
|
119
|
+
if(this.hasSwiperButton) {
|
120
|
+
this.options.navigation = {
|
121
|
+
nextEl: `.swiper-button-next-${this.sortId}`,
|
122
|
+
prevEl: `.swiper-button-prev-${this.sortId}`,
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
if(this.hasScrollBar) {
|
127
|
+
this.options.scrollbar = {
|
128
|
+
el: `.swiper-scrollbar-${this.sortId}`,
|
129
|
+
draggable: true
|
130
|
+
}
|
131
|
+
this.options.freeMode = true
|
132
|
+
}
|
133
|
+
|
134
|
+
this.swiper = new Swiper(`.swiper-container-${this.sortId}`, this.options)
|
135
|
+
console.log('\x1B[32m%s\x1B[0m', '初始化轮播图', this.swiper)
|
136
|
+
})
|
137
|
+
},
|
138
|
+
// 上报数据
|
139
|
+
reportData(h) {
|
140
|
+
let ref = this.$refs[`img${this.attributeJson.sort}`]
|
141
|
+
if(!ref || ref.style.display == 'none') return
|
142
|
+
if(this.isSwiper && !this.hasInitSwiper && this.enterClass) {
|
143
|
+
this.hasInitSwiper = true
|
144
|
+
this.initSwiper()
|
145
|
+
}
|
146
|
+
let el = ref.getBoundingClientRect()
|
147
|
+
this.list.forEach((item,i) => {
|
148
|
+
if(!item.isReport) {
|
149
|
+
if(item.popList.length!=0) {
|
150
|
+
this.$refs[`hotspot${this.sortId}${i}`][0].reportData(h, this.positionTotal[i])
|
151
|
+
return
|
152
|
+
}
|
153
|
+
if(el.top <= h) {
|
154
|
+
item.isReport = true
|
155
|
+
dataSaveDecorationPageComponentEventFn(
|
156
|
+
{
|
157
|
+
uniqueId: this.recordId + '_'+ this.sortId, // 组件_id
|
158
|
+
uniqueName: this.attributeJson.uniqueName, // 组件_名称
|
159
|
+
componentType: 2,
|
160
|
+
popData: {},
|
161
|
+
materialId: this.recordId+ '_'+ this.sortId + '_' + item.sort, //素材id
|
162
|
+
materialName: item.uniqueName, //素材名称
|
163
|
+
refererPagePath: this.refererPagePath,
|
164
|
+
brand: this.brand,
|
165
|
+
path: this.path,
|
166
|
+
position: this.positionTotal[i] + 1,
|
167
|
+
event: 'bannerShow'
|
168
|
+
},
|
169
|
+
this.envUrl
|
170
|
+
)
|
171
|
+
}
|
172
|
+
}
|
173
|
+
})
|
174
|
+
}
|
175
|
+
},
|
176
|
+
};
|
@@ -0,0 +1,113 @@
|
|
1
|
+
.image-list {
|
2
|
+
position: absolute;
|
3
|
+
border: none;
|
4
|
+
|
5
|
+
.image-include {
|
6
|
+
overflow: hidden;
|
7
|
+
}
|
8
|
+
|
9
|
+
.entrance-con {
|
10
|
+
position: relative;
|
11
|
+
width: 100%;
|
12
|
+
height: 100%;
|
13
|
+
}
|
14
|
+
|
15
|
+
.swiper-container {
|
16
|
+
height: 100%!important;
|
17
|
+
.swiper-slide {
|
18
|
+
transform: translate3d(0, 0, 0);
|
19
|
+
position: relative;
|
20
|
+
overflow: hidden;
|
21
|
+
|
22
|
+
.slide-con {
|
23
|
+
position: relative;
|
24
|
+
img {
|
25
|
+
object-fit: contain;
|
26
|
+
width: 100%;
|
27
|
+
height: 100%;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
.swiper-button-prev {
|
33
|
+
background-image: none;
|
34
|
+
left: 20px;
|
35
|
+
&::after {
|
36
|
+
display: none;
|
37
|
+
}
|
38
|
+
.cms2iconfont {
|
39
|
+
font-size: 28px;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.swiper-button-next {
|
44
|
+
background-image: none;
|
45
|
+
right: 20px;
|
46
|
+
&::after {
|
47
|
+
display: none;
|
48
|
+
}
|
49
|
+
|
50
|
+
.cms2iconfont {
|
51
|
+
font-size: 28px;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.swiper-scrollbar {
|
56
|
+
height: 3px;
|
57
|
+
width: 70%;
|
58
|
+
left: 50%;
|
59
|
+
transform: translateX(-50%);
|
60
|
+
::v-deep .swiper-scrollbar-drag {
|
61
|
+
background-color: #1890FF;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
.image-warp {
|
67
|
+
width: 100%;
|
68
|
+
height: 100%;
|
69
|
+
overflow: hidden;
|
70
|
+
position: relative;
|
71
|
+
display: flex;
|
72
|
+
|
73
|
+
&.image-type3 {
|
74
|
+
overflow-x: scroll;
|
75
|
+
}
|
76
|
+
.image-item {
|
77
|
+
width: 100%;
|
78
|
+
height: 100%;
|
79
|
+
display: flex;
|
80
|
+
justify-content: center;
|
81
|
+
align-items: center;
|
82
|
+
font-size: 0;
|
83
|
+
transition: transform 0.5s;
|
84
|
+
flex-shrink: 0;
|
85
|
+
position: relative;
|
86
|
+
overflow: hidden;
|
87
|
+
img {
|
88
|
+
width: auto;
|
89
|
+
height: auto;
|
90
|
+
width: 100%;
|
91
|
+
height: 100%;
|
92
|
+
}
|
93
|
+
|
94
|
+
.contain {
|
95
|
+
object-fit: contain;
|
96
|
+
}
|
97
|
+
|
98
|
+
&:first-child {
|
99
|
+
padding-left: 0 !important;
|
100
|
+
}
|
101
|
+
|
102
|
+
&:last-child {
|
103
|
+
padding-right: 0 !important;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
.hot-spot {
|
108
|
+
position: absolute;
|
109
|
+
width: 100%;
|
110
|
+
height: 100%;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
:style="{
|
4
|
+
width: Math.ceil(attributeJson.baseStyle.w * ratio) + 'px',
|
5
|
+
height: Math.round(attributeJson.baseStyle.h * ratio) + 'px',
|
6
|
+
left: Math.round(attributeJson.baseStyle.l * ratio) + 'px',
|
7
|
+
top: Math.round(attributeJson.baseStyle.t * ratio) + 'px'
|
8
|
+
}"
|
9
|
+
class="image-list"
|
10
|
+
:key="attributeJson.sort">
|
11
|
+
|
12
|
+
<div v-if="hasConfig" class="image-include" :style="{ height: Math.round(attributeJson.baseStyle.h * ratio) + 'px'}">
|
13
|
+
<div :class="['entrance-con',`entrance-con${sortId}`]">
|
14
|
+
<div :class="['image-warp', `image-warp-${sortId}`, animationInObj.type ? enterClass : '']"
|
15
|
+
v-show="entranceShow"
|
16
|
+
:ref="`img${attributeJson.sort}`"
|
17
|
+
:style="{animationDuration: `${animationInObj.duration}s`}">
|
18
|
+
<!-- 轮播样式 -->
|
19
|
+
<div v-hoverAnimate
|
20
|
+
v-if="isSwiper"
|
21
|
+
:style="[picStyle, (animationHoverObj.type === 3 && hoverStyleShow? hoverStyle : '')]"
|
22
|
+
>
|
23
|
+
<div :class="[`swiper-container swiper-container-${sortId}`]">
|
24
|
+
<div class="swiper-wrapper" :style="{height: `${(baseStyle.h - (hasScrollBar ?30 : 0)) * ratio}px!important`}">
|
25
|
+
<div class="swiper-slide" v-for="(carousel, index) in attributeJson.list"
|
26
|
+
:key="carousel.id"
|
27
|
+
:style="{width: `${baseStyle.w/4 * ratio}px`}">
|
28
|
+
<div class="slide-con" :style="{
|
29
|
+
height: `${(baseStyle.h - (hasScrollBar ?30 : 0)) * ratio}px`}">
|
30
|
+
<!-- 图片 -->
|
31
|
+
<img :src="carousel.picList[0].resourcePath" :alt="carousel.picList[0].resourceName.split('.')[0]">
|
32
|
+
|
33
|
+
<template v-if="carousel.picList.length!=0 && carousel.popList.length!=0">
|
34
|
+
<hotspot
|
35
|
+
:ref="`hotspot${sortId}${index}`"
|
36
|
+
:componentType="2"
|
37
|
+
v-on="$listeners"
|
38
|
+
v-bind="$attrs"
|
39
|
+
:item="carousel"
|
40
|
+
:ratio="ratio"
|
41
|
+
:path="path"
|
42
|
+
:envUrl="envUrl"
|
43
|
+
:sortId="sortId"
|
44
|
+
:recordId="recordId"
|
45
|
+
:laySort="sort"
|
46
|
+
:brand="brand"
|
47
|
+
:uniqueName="attributeJson.uniqueName"
|
48
|
+
:language="language"></hotspot>
|
49
|
+
</template>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div v-if="hasSwiperButton" :class="`swiper-button-prev swiper-button-prev-${sortId}`">
|
56
|
+
<slot name="swiper-button-prev">
|
57
|
+
<div v-if="indicatorType == 2 || indicatorType == 3"><span class="cms2iconfont iconleft"></span></div>
|
58
|
+
</slot>
|
59
|
+
</div>
|
60
|
+
<div v-if="hasSwiperButton" :class="`swiper-button-next swiper-button-next-${sortId}`">
|
61
|
+
<slot name="swiper-button-next">
|
62
|
+
<div v-if="indicatorType == 2 || indicatorType == 3"><span class="cms2iconfont iconright"></span></div>
|
63
|
+
</slot>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<!-- 滑动条 -->
|
67
|
+
<div v-if="hasScrollBar" :class="`swiper-scrollbar swiper-scrollbar-${sortId}`"></div>
|
68
|
+
</div>
|
69
|
+
|
70
|
+
<!-- 边框 -->
|
71
|
+
<div class="hover-con" v-if="animationHoverObj.type === 2" :style="[hoverStyle, {opacity: (hoverStyleShow? 1 : 0)}]"></div>
|
72
|
+
</div>
|
73
|
+
|
74
|
+
<!-- 非轮播样式 -->
|
75
|
+
<div v-else :class="['image-warp', styleType==3 && mode!='pc'?'image-type3':'']" :style="[picStyle, (animationHoverObj.type === 3 && hoverStyleShow) ? hoverStyle : '']">
|
76
|
+
<div
|
77
|
+
v-hoverAnimate
|
78
|
+
v-for="(item, index) in attributeJson.list"
|
79
|
+
:key="index"
|
80
|
+
:style="[picItemStyle]"
|
81
|
+
class="image-item">
|
82
|
+
|
83
|
+
<img :class="{'contain': styleType!=1}" :src="item.picList[0].resourcePath" :alt="item.picList[0].resourceName.split('.')[0]"/>
|
84
|
+
<!-- 边框 -->
|
85
|
+
<div class="hover-con" v-if="animationHoverObj.type === 2" :style="[hoverStyle, {opacity: (hoverStyleShow? 1 : 0)}]"></div>
|
86
|
+
<!-- 换图 -->
|
87
|
+
<img class="hover-image" :src="hoverImage" alt="" v-if="animationHoverObj.type === 5 && hoverImage && hoverStyleShow" />
|
88
|
+
|
89
|
+
|
90
|
+
<div v-if="item.picList.length!=0 && item.popList.length!=0">
|
91
|
+
<hotspot
|
92
|
+
:ref="`hotspot${sortId}${index}`"
|
93
|
+
v-on="$listeners"
|
94
|
+
v-bind="$attrs"
|
95
|
+
:item="item"
|
96
|
+
:ratio="ratio"
|
97
|
+
:path="path"
|
98
|
+
:brand="brand"
|
99
|
+
:envUrl="envUrl"
|
100
|
+
:sortId="sortId"
|
101
|
+
:recordId="recordId"
|
102
|
+
:componentType="2"
|
103
|
+
:uniqueName="attributeJson.uniqueName"
|
104
|
+
:language="language"></hotspot>
|
105
|
+
</div>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</template>
|
114
|
+
|
115
|
+
<script>
|
116
|
+
import imgNavJs from "./imgNav.js";
|
117
|
+
export default imgNavJs;
|
118
|
+
</script>
|
119
|
+
|
120
|
+
<style lang="scss" scoped>
|
121
|
+
@import "imgNav";
|
122
|
+
@import "../animate.scss";
|
123
|
+
</style>
|
@@ -0,0 +1,239 @@
|
|
1
|
+
import '../../assets/iconfont/iconfont.css'
|
2
|
+
import 'swiper/css/swiper.css'
|
3
|
+
import 'animate.css'
|
4
|
+
import '../../index.scss'
|
5
|
+
import 'video.js/dist/video-js.css'
|
6
|
+
|
7
|
+
export const cmsMixin = {
|
8
|
+
inheritAttrs: false,
|
9
|
+
props: {
|
10
|
+
attributeJson: {
|
11
|
+
type: Object,
|
12
|
+
default: function() {}
|
13
|
+
},
|
14
|
+
item: {
|
15
|
+
type: Object,
|
16
|
+
default: () => {}
|
17
|
+
},
|
18
|
+
ratio: {
|
19
|
+
type: Number,
|
20
|
+
default: 1
|
21
|
+
},
|
22
|
+
envUrl: {
|
23
|
+
type: String,
|
24
|
+
default: ''
|
25
|
+
},
|
26
|
+
fontRatio: {
|
27
|
+
type: Number,
|
28
|
+
default: 1
|
29
|
+
},
|
30
|
+
mode: {
|
31
|
+
type: String,
|
32
|
+
default: 'pc'
|
33
|
+
},
|
34
|
+
language: {
|
35
|
+
type: String,
|
36
|
+
default: 'zh-CN'
|
37
|
+
},
|
38
|
+
// 组件sort
|
39
|
+
sortId: {
|
40
|
+
type: Number,
|
41
|
+
default: 0
|
42
|
+
},
|
43
|
+
// 最外层布局sort
|
44
|
+
sort: {
|
45
|
+
type: [String, Number],
|
46
|
+
default: 0
|
47
|
+
},
|
48
|
+
// 最外层布局recordId
|
49
|
+
recordId: {
|
50
|
+
type: [String, Number],
|
51
|
+
default: 0
|
52
|
+
},
|
53
|
+
refererPagePath: {
|
54
|
+
type: String
|
55
|
+
},
|
56
|
+
brand: {
|
57
|
+
type: String
|
58
|
+
},
|
59
|
+
path: {
|
60
|
+
type: String
|
61
|
+
}
|
62
|
+
},
|
63
|
+
data() {
|
64
|
+
return {
|
65
|
+
hoverStyle: {}, // 悬停动画样式
|
66
|
+
hoverStyleShow: false,
|
67
|
+
hoverImage: '',
|
68
|
+
fillStyle: {}, // 填充样式
|
69
|
+
hoverDirection: '',
|
70
|
+
entranceShow: true,
|
71
|
+
enterClass: '',
|
72
|
+
entranceAnimate: {
|
73
|
+
fade: 'animate__animated animate__fadeIn',
|
74
|
+
scale: 'animate__animated animate__zoomIn'
|
75
|
+
}
|
76
|
+
}
|
77
|
+
},
|
78
|
+
computed: {
|
79
|
+
animationInObj: function() {
|
80
|
+
return this.attributeJson.animationInObj
|
81
|
+
},
|
82
|
+
animationHoverObj: function() {
|
83
|
+
return this.attributeJson.animationHoverObj
|
84
|
+
},
|
85
|
+
animateInType: function() {
|
86
|
+
return this.attributeJson.animationInObj.type
|
87
|
+
},
|
88
|
+
animateSort: function() {
|
89
|
+
return this.attributeJson.animationInObj.sort
|
90
|
+
},
|
91
|
+
baseStyle() {
|
92
|
+
return this.attributeJson.baseStyle
|
93
|
+
},
|
94
|
+
styleType() {
|
95
|
+
return this.attributeJson.styleType
|
96
|
+
}
|
97
|
+
},
|
98
|
+
watch: {
|
99
|
+
animationHoverObj: {
|
100
|
+
handler(val) {
|
101
|
+
this.disposeHoverAnimate(val)
|
102
|
+
},
|
103
|
+
immediate: true,
|
104
|
+
deep: true
|
105
|
+
},
|
106
|
+
// 入场动画类别
|
107
|
+
animateSort: {
|
108
|
+
handler() {
|
109
|
+
let type = this.animateInType
|
110
|
+
if (type && type != 'slide') {
|
111
|
+
this.entranceShow = false
|
112
|
+
this.enterClass = ''
|
113
|
+
this.enterClass = this.entranceAnimate[type]
|
114
|
+
}
|
115
|
+
|
116
|
+
if (type == 'slide' && this.animationInObj.direction) {
|
117
|
+
this.entranceShow = false
|
118
|
+
this.enterClass = ''
|
119
|
+
this.enterClass = `animate__animated animate__${this.animationInObj.direction}`
|
120
|
+
}
|
121
|
+
},
|
122
|
+
immediate: true
|
123
|
+
},
|
124
|
+
// recordId: {
|
125
|
+
// handler(val) {
|
126
|
+
// console.log('recordId',val);
|
127
|
+
// },
|
128
|
+
// immediate: true,
|
129
|
+
// deep: true
|
130
|
+
// }
|
131
|
+
},
|
132
|
+
methods: {
|
133
|
+
// 处理悬停动画数据
|
134
|
+
disposeHoverAnimate(val) {
|
135
|
+
let hoverStyle = {}
|
136
|
+
// 显示边框
|
137
|
+
if (val.type === 2) {
|
138
|
+
let borderStyle = val.borderStyle
|
139
|
+
if (borderStyle.type == 1) {
|
140
|
+
// 边框颜色相同
|
141
|
+
hoverStyle = {
|
142
|
+
border: borderStyle.borderColor ? `2px solid ${borderStyle.borderColor}` : 'none'
|
143
|
+
}
|
144
|
+
}
|
145
|
+
if (borderStyle.type == 2) {
|
146
|
+
let { borderTop, borderRight, borderBottom, borderLeft } = borderStyle
|
147
|
+
hoverStyle = {
|
148
|
+
borderTop: borderTop ? `2px solid ${borderTop}` : 'none',
|
149
|
+
borderRight: borderRight ? `2px solid ${borderRight}` : 'none',
|
150
|
+
borderBottom: borderBottom ? `2px solid ${borderBottom}` : 'none',
|
151
|
+
borderLeft: borderLeft ? `2px solid ${borderLeft}` : 'none'
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
// 焦点放大镜
|
156
|
+
if (val.type === 3) {
|
157
|
+
hoverStyle = {
|
158
|
+
transform: 'scale(1.2)',
|
159
|
+
transformOrigin: 'center center'
|
160
|
+
}
|
161
|
+
}
|
162
|
+
// 填充
|
163
|
+
if (val.type === 4) {
|
164
|
+
this.hoverDirection = val.bgStyle.direction
|
165
|
+
}
|
166
|
+
// 换图
|
167
|
+
if (val.type === 5) {
|
168
|
+
let { hoverImgList } = val
|
169
|
+
this.hoverImage = hoverImgList[0] ? hoverImgList[0].resourcePath : ''
|
170
|
+
}
|
171
|
+
|
172
|
+
this.hoverStyle = hoverStyle
|
173
|
+
},
|
174
|
+
onDrag: function(x, y) {
|
175
|
+
let ratio = this.ratio
|
176
|
+
this.attributeJson.baseStyle.l = x / ratio
|
177
|
+
this.attributeJson.baseStyle.t = y / ratio
|
178
|
+
this.$set(this.attributeJson, 'baseStyle', this.attributeJson.baseStyle)
|
179
|
+
},
|
180
|
+
onResize: function(x, y, width, height) {
|
181
|
+
let ratio = this.ratio
|
182
|
+
let baseStyle = this.attributeJson.baseStyle
|
183
|
+
baseStyle = {
|
184
|
+
w: width / ratio,
|
185
|
+
h: height / ratio,
|
186
|
+
l: x / ratio,
|
187
|
+
t: y / ratio,
|
188
|
+
isLocked: baseStyle.isLocked
|
189
|
+
}
|
190
|
+
this.$set(this.attributeJson, 'baseStyle', baseStyle)
|
191
|
+
},
|
192
|
+
getRefLineParams(params) {
|
193
|
+
this.$emit('getRefLineParams', params)
|
194
|
+
}
|
195
|
+
},
|
196
|
+
directives: {
|
197
|
+
// 入场指令
|
198
|
+
// entrance: {
|
199
|
+
// inserted: function(el, binding, vnode) {
|
200
|
+
// if (!vnode.context.animateInType && !binding.value) return
|
201
|
+
// binding.addClass = () => {
|
202
|
+
// const { top } = el.getBoundingClientRect()
|
203
|
+
// const h = document.documentElement.clientHeight || document.body.clientHeight
|
204
|
+
// if (top < h - 50) {
|
205
|
+
// vnode.context.entranceShow = true
|
206
|
+
|
207
|
+
// if (binding.addClass) {
|
208
|
+
// window.removeEventListener('scroll', binding.addClass)
|
209
|
+
// }
|
210
|
+
// }
|
211
|
+
// }
|
212
|
+
// window.addEventListener('scroll', binding.addClass, true)
|
213
|
+
// binding.addClass()
|
214
|
+
// },
|
215
|
+
// unbind: function(el, binding, vnode) {
|
216
|
+
// if (binding.addClass) {
|
217
|
+
// window.removeEventListener('scroll', binding.addClass)
|
218
|
+
// }
|
219
|
+
// }
|
220
|
+
// },
|
221
|
+
// 悬停指令
|
222
|
+
hoverAnimate: {
|
223
|
+
inserted: function(el, binding, vnode) {
|
224
|
+
el.onmouseover = function() {
|
225
|
+
vnode.context.hoverStyleShow = true
|
226
|
+
if (binding.value) {
|
227
|
+
vnode.context[binding.value.key] = binding.value.value
|
228
|
+
}
|
229
|
+
}
|
230
|
+
el.onmouseleave = function() {
|
231
|
+
vnode.context.hoverStyleShow = false
|
232
|
+
if (binding.value) {
|
233
|
+
vnode.context[binding.value.key] = -1
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|