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,47 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
:style="{
|
4
|
+
width: Math.round(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="button-wrap"
|
10
|
+
>
|
11
|
+
<div class="entrance-con">
|
12
|
+
<div
|
13
|
+
:ref="`button${attributeJson.sort}`"
|
14
|
+
:class="['button-cl', `button-cl-${sortId}`, animationInObj.type ? enterClass : '']" v-show="entranceShow"
|
15
|
+
@click="pageClick"
|
16
|
+
:style="{ animationDuration: `${animationInObj.duration}s` }">
|
17
|
+
<div
|
18
|
+
class="button-content"
|
19
|
+
:class="[{ flexCenterBetween: iconImage }, animationHoverObj.type === 4 ? hoverDirection : '']"
|
20
|
+
@mouseover.stop="textMouseOver"
|
21
|
+
@mouseleave="textMouseLeave"
|
22
|
+
:style="[buttonStyle, { '--width': hoverStyleShow ? '100%' : '0', '--height': hoverStyleShow ? '100%' : '0', '--bgColor': animationHoverObj.bgStyle.backgroundColor }]"
|
23
|
+
v-hoverAnimate
|
24
|
+
>
|
25
|
+
<img v-if="iconStyle.type === 1 && iconStyle.position === 1 && iconImage" :src="iconImage" alt="" />
|
26
|
+
<div class="label" :style="hoverButtonStyle">{{ attributeJson.label || '按钮' }}</div>
|
27
|
+
<img v-if="iconStyle.type === 1 && iconStyle.position === 2 && iconImage" :src="iconImage" alt="" />
|
28
|
+
|
29
|
+
<!-- 换图 -->
|
30
|
+
<img class="hover-image" :src="hoverImage" alt="" v-if="animationHoverObj.type === 5 && hoverImage && hoverStyleShow" />
|
31
|
+
</div>
|
32
|
+
<!-- 边框 -->
|
33
|
+
<div class="hover-con" v-if="animationHoverObj.type === 2" :style="[hoverStyle, { opacity: hoverStyleShow ? 1 : 0, borderRadius: attributeJson.borderStyle.borderRadius + 'px' }]"></div>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</template>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
import buttonItemJs from './buttonItem.js'
|
41
|
+
export default buttonItemJs
|
42
|
+
</script>
|
43
|
+
|
44
|
+
<style lang="scss" scoped>
|
45
|
+
@import 'buttonItem';
|
46
|
+
@import '../animate.scss';
|
47
|
+
</style>
|
@@ -0,0 +1,105 @@
|
|
1
|
+
// import draggable from 'vuedraggable'
|
2
|
+
import singleLayout from './singleLayout/'
|
3
|
+
import multipleLayout from './multipleLayout/'
|
4
|
+
import customLayout from './customLayout/'
|
5
|
+
import tabLayout from "./tabLayout/";
|
6
|
+
import slideLayout from './slideLayout/';
|
7
|
+
|
8
|
+
export default {
|
9
|
+
name: 'cms',
|
10
|
+
inheritAttrs: false,
|
11
|
+
components: {
|
12
|
+
// draggable,
|
13
|
+
singleLayout, //单列布局
|
14
|
+
multipleLayout, //多列布局
|
15
|
+
customLayout, // 自定义
|
16
|
+
tabLayout, // 导航
|
17
|
+
slideLayout, // 滑动容器
|
18
|
+
},
|
19
|
+
props: {
|
20
|
+
cmsList: {
|
21
|
+
type: Array,
|
22
|
+
default: () => []
|
23
|
+
},
|
24
|
+
canDrag: {
|
25
|
+
type: Boolean,
|
26
|
+
default: true
|
27
|
+
},
|
28
|
+
mode: {
|
29
|
+
type: String,
|
30
|
+
default: 'pc'
|
31
|
+
},
|
32
|
+
ratio: {
|
33
|
+
type: Number,
|
34
|
+
default: 1
|
35
|
+
},
|
36
|
+
envUrl: {
|
37
|
+
type: String,
|
38
|
+
default: ''
|
39
|
+
},
|
40
|
+
path: {
|
41
|
+
type: String
|
42
|
+
}
|
43
|
+
},
|
44
|
+
watch: {
|
45
|
+
// cmsList: {
|
46
|
+
// handler(val) {
|
47
|
+
// console.log(val)
|
48
|
+
// },
|
49
|
+
// immediate: true
|
50
|
+
// }
|
51
|
+
},
|
52
|
+
data() {
|
53
|
+
return {
|
54
|
+
chooseSort: '', //选中的元素标识
|
55
|
+
activeIndex: -1, // 鼠标悬浮的元素位置
|
56
|
+
layOutObj: {
|
57
|
+
1:'singleLayout',
|
58
|
+
2:'multipleLayout',
|
59
|
+
3:'customLayout',
|
60
|
+
4:'tabLayout',
|
61
|
+
5:'slideLayout'
|
62
|
+
}
|
63
|
+
}
|
64
|
+
},
|
65
|
+
computed: {
|
66
|
+
},
|
67
|
+
mounted() {
|
68
|
+
this.$nextTick(()=>{
|
69
|
+
var commom = require('../../utils/common')
|
70
|
+
commom.scroll(this)
|
71
|
+
commom.entrance(this)
|
72
|
+
});
|
73
|
+
},
|
74
|
+
methods: {
|
75
|
+
chooseLayout(layoutType, sort) {
|
76
|
+
this.chooseSort = sort
|
77
|
+
this.$emit('updateLayOut', { layoutType, sort})
|
78
|
+
},
|
79
|
+
updateSort(sort) {
|
80
|
+
this.chooseSort = sort
|
81
|
+
},
|
82
|
+
// 删除布局组件
|
83
|
+
deleteModule(index, sort) {
|
84
|
+
// 若删除的为当前选中布局, 特殊处理
|
85
|
+
if(sort === this.chooseSort) {
|
86
|
+
this.$emit('deleteModule', index)
|
87
|
+
} else {
|
88
|
+
this.cmsList.splice(index, 1)
|
89
|
+
this.$emit('saveVersionId')
|
90
|
+
}
|
91
|
+
},
|
92
|
+
// 控制组件展示或隐藏
|
93
|
+
showOrHide(index) {
|
94
|
+
let item = this.cmsList[index]
|
95
|
+
this.$set(item, 'displayType', item.displayType ? 0 : 1)
|
96
|
+
this.$emit('componentChange', item.sort)
|
97
|
+
},
|
98
|
+
judgeSlot(index) {
|
99
|
+
if(this.cmsList[index].attributeJson.componentList) {
|
100
|
+
console.log(this.cmsList[index].attributeJson.componentList)
|
101
|
+
return this.cmsList[index].attributeJson.componentList.some(ele=> {return ele.type == 106})
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
.lay-wrap {
|
2
|
+
width: 100%;
|
3
|
+
|
4
|
+
.vdr {
|
5
|
+
border: none;
|
6
|
+
touch-action: auto;
|
7
|
+
}
|
8
|
+
|
9
|
+
.lay-item {
|
10
|
+
border: none;
|
11
|
+
position: relative;
|
12
|
+
width: 100%;
|
13
|
+
display: flex;
|
14
|
+
justify-content: center;
|
15
|
+
background-color: #fff;
|
16
|
+
|
17
|
+
.btn-wrap {
|
18
|
+
width: 136px;
|
19
|
+
height: 40px;
|
20
|
+
background-color: #1890FF;
|
21
|
+
color: #fff;
|
22
|
+
display: flex;
|
23
|
+
align-items: center;
|
24
|
+
justify-content: center;
|
25
|
+
position: absolute;
|
26
|
+
right: -1px;
|
27
|
+
border-radius: 8px 0px 0px;
|
28
|
+
bottom: 0;
|
29
|
+
|
30
|
+
.icon {
|
31
|
+
font-size: 16px;
|
32
|
+
cursor: pointer;
|
33
|
+
}
|
34
|
+
|
35
|
+
.iconrank {
|
36
|
+
font-size: 19px;
|
37
|
+
margin-right: 16px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.iconvisibility, .iconyincang {
|
41
|
+
margin-right: 18px;
|
42
|
+
font-size: 20px;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<template>
|
2
|
+
<div ref="cms">
|
3
|
+
<div
|
4
|
+
:class="['lay-wrap', { mobile: mode == 'mobile' }]"
|
5
|
+
>
|
6
|
+
<div
|
7
|
+
class="lay-item"
|
8
|
+
v-for="(item) in cmsList"
|
9
|
+
:key="item.sort"
|
10
|
+
>
|
11
|
+
<div
|
12
|
+
class="layout-set"
|
13
|
+
:style="{
|
14
|
+
width: item.attributeJson.layoutStyle && item.attributeJson.layoutStyle.widthStyle.type === 2 ? item.attributeJson.layoutStyle.widthStyle.width + '%' : '100%',
|
15
|
+
height: item.attributeJson.layoutStyle ? Math.round(item.attributeJson.layoutStyle.height * ratio) + 'px' : 'auto'
|
16
|
+
}"
|
17
|
+
>
|
18
|
+
<component
|
19
|
+
ref="layModule"
|
20
|
+
:is="layOutObj[item.layoutType]"
|
21
|
+
v-bind="$attrs"
|
22
|
+
v-on="$listeners"
|
23
|
+
:layOutData="item.attributeJson"
|
24
|
+
:sort="item.attributeJson.sort"
|
25
|
+
:ratio="ratio"
|
26
|
+
:mode="mode"
|
27
|
+
:recordId="item.originalId"
|
28
|
+
:envUrl="envUrl"
|
29
|
+
:path="path"
|
30
|
+
>
|
31
|
+
<template v-if="item.layoutType == 3" slot="customComponent" slot-scope="scope">
|
32
|
+
<slot name="customComponent" :attributeJson="scope.attributeJson"></slot>
|
33
|
+
</template>
|
34
|
+
<template v-slot:dgCustomComponent="scope">
|
35
|
+
<slot name="dgCustomComponent" :data="scope.attributeJson"></slot>
|
36
|
+
</template>
|
37
|
+
</component>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</template>
|
43
|
+
|
44
|
+
<script>
|
45
|
+
import cmsJs from "./cms.js";
|
46
|
+
export default cmsJs;
|
47
|
+
</script>
|
48
|
+
|
49
|
+
<style lang="scss" scoped>
|
50
|
+
@import "cms";
|
51
|
+
</style>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { dataSaveDecorationPageComponentEventFn } from '../../../utils/utils';
|
2
|
+
export default {
|
3
|
+
name: 'customLayout',
|
4
|
+
props: {
|
5
|
+
layOutData: {
|
6
|
+
type: Object,
|
7
|
+
default: () => {}
|
8
|
+
},
|
9
|
+
envUrl: {
|
10
|
+
type: String,
|
11
|
+
default: ''
|
12
|
+
},
|
13
|
+
path: {
|
14
|
+
type: String
|
15
|
+
}
|
16
|
+
},
|
17
|
+
inheritAttrs: false,
|
18
|
+
methods:{
|
19
|
+
// 上报数据
|
20
|
+
reportData(h) {
|
21
|
+
if(this.isReport) return
|
22
|
+
let ref = this.$refs[`custom${this.layOutData.sort}`]
|
23
|
+
if(!ref) return
|
24
|
+
let el = ref.getBoundingClientRect()
|
25
|
+
if(el.top <= h && el.top >= 0) {
|
26
|
+
this.isReport = true
|
27
|
+
dataSaveDecorationPageComponentEventFn(
|
28
|
+
{
|
29
|
+
uniqueId: this.layOutData.sort, // 组件_id
|
30
|
+
uniqueName: this.uniqueName, // 组件_名称
|
31
|
+
componentType: 7,
|
32
|
+
popData: {},
|
33
|
+
materialId: this.layOutData.sort, //素材id
|
34
|
+
materialName: this.uniqueName, //素材名称
|
35
|
+
refererPagePath: this.refererPagePath,
|
36
|
+
brand: this.brand,
|
37
|
+
path: this.path,
|
38
|
+
position: 1,
|
39
|
+
event: 'bannerShow'
|
40
|
+
},
|
41
|
+
this.envUrl
|
42
|
+
)
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="custom-layout" :ref="`custom${layOutData.sort}`">
|
3
|
+
<div class="add-con"></div>
|
4
|
+
<slot name="customComponent" :attributeJson="layOutData"></slot>
|
5
|
+
</div>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import customLayoutJs from './customLayout.js'
|
10
|
+
export default customLayoutJs
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<style lang="scss" scoped>
|
14
|
+
@import "customLayout";
|
15
|
+
</style>
|
@@ -0,0 +1,200 @@
|
|
1
|
+
import { ComService } from "../../../api/com-service";
|
2
|
+
import { dataSaveDecorationPageComponentEventFn } from '../../../utils/utils'
|
3
|
+
export default {
|
4
|
+
name: 'hotspot',
|
5
|
+
props: {
|
6
|
+
item: {
|
7
|
+
type: Object,
|
8
|
+
default: () => {}
|
9
|
+
},
|
10
|
+
width: {
|
11
|
+
type: Number,
|
12
|
+
default: 0
|
13
|
+
},
|
14
|
+
height: {
|
15
|
+
type: Number,
|
16
|
+
default: 0
|
17
|
+
},
|
18
|
+
ratio: {
|
19
|
+
type: Number,
|
20
|
+
default: 1
|
21
|
+
},
|
22
|
+
envUrl: {
|
23
|
+
type: String,
|
24
|
+
default:''
|
25
|
+
},
|
26
|
+
// 组件sort
|
27
|
+
sortId: {
|
28
|
+
type: Number,
|
29
|
+
default: 0
|
30
|
+
},
|
31
|
+
// 最外层布局recordId
|
32
|
+
recordId: {
|
33
|
+
type: Number,
|
34
|
+
default: 0
|
35
|
+
},
|
36
|
+
brand: {
|
37
|
+
type: String
|
38
|
+
},
|
39
|
+
componentType: {
|
40
|
+
type: Number
|
41
|
+
},
|
42
|
+
refererPagePath: {
|
43
|
+
type: String
|
44
|
+
},
|
45
|
+
path: {
|
46
|
+
type: String,
|
47
|
+
},
|
48
|
+
pathType: {
|
49
|
+
type: Number
|
50
|
+
},
|
51
|
+
uniqueName: {
|
52
|
+
type: String
|
53
|
+
},
|
54
|
+
language: {
|
55
|
+
type: String,
|
56
|
+
default: 'zh-CN'
|
57
|
+
},
|
58
|
+
// 适用于轮播图的热区坑位上报,因为轮播图loop前后复制的原因,会造成复制的元素拿不到preTotal
|
59
|
+
prePosition: {
|
60
|
+
type: Number
|
61
|
+
}
|
62
|
+
},
|
63
|
+
data() {
|
64
|
+
return {
|
65
|
+
hotList: [],
|
66
|
+
proportion: 1,
|
67
|
+
hoverIndex: 1,
|
68
|
+
needReport: true, // 是否需要上报
|
69
|
+
preTotal: 0,
|
70
|
+
service: new ComService(),
|
71
|
+
}
|
72
|
+
},
|
73
|
+
watch: {
|
74
|
+
'item.width': {
|
75
|
+
handler(val) {
|
76
|
+
this.proportion = val / 750
|
77
|
+
},
|
78
|
+
deep: true,
|
79
|
+
immediate: true
|
80
|
+
},
|
81
|
+
itemCodeList: {
|
82
|
+
handler(val) {
|
83
|
+
this.getProductList(val)
|
84
|
+
},
|
85
|
+
immediate: true,
|
86
|
+
deep: true
|
87
|
+
}
|
88
|
+
},
|
89
|
+
computed: {
|
90
|
+
itemCodeList() {
|
91
|
+
let pop = this.item.popList.filter(item => {
|
92
|
+
return item.jumpLinkType == 1 && item.product.imageType == 1
|
93
|
+
})
|
94
|
+
return pop.map(item=> {
|
95
|
+
return item.productCode
|
96
|
+
})
|
97
|
+
}
|
98
|
+
},
|
99
|
+
mounted() {
|
100
|
+
this.hotList = JSON.parse(JSON.stringify(this.item.popList))
|
101
|
+
},
|
102
|
+
methods: {
|
103
|
+
// 点击热区
|
104
|
+
pageClick(val,index) {
|
105
|
+
if(val.jumpLinkType) {
|
106
|
+
try {
|
107
|
+
dataSaveDecorationPageComponentEventFn(
|
108
|
+
{
|
109
|
+
uniqueId: this.recordId + '_' + this.sortId, // 组件_id
|
110
|
+
uniqueName: this.uniqueName, // 组件_名称
|
111
|
+
componentMethodType: 1,
|
112
|
+
popData: {
|
113
|
+
...val,
|
114
|
+
uniqueId: this.recordId + '_' + this.sortId + '_' + val.uniqueId.split('_')[2],
|
115
|
+
brand: this.pathType === 1 ? 'defaultPath' : this.brand
|
116
|
+
},
|
117
|
+
materialId: this.item.sort ? this.recordId + '_' + this.item.sort : this.recordId + '_' + this.sortId, //素材id
|
118
|
+
materialName: this.item.uniqueName ? this.item.uniqueName : this.uniqueName, //素材名称
|
119
|
+
refererPagePath: this.refererPagePath,
|
120
|
+
componentType: this.componentType,
|
121
|
+
path: this.path,
|
122
|
+
brand: this.brand,
|
123
|
+
position: this.prePosition? this.prePosition + index + 1 : this.preTotal*1 + index + 1,
|
124
|
+
event: 'bannerClick'
|
125
|
+
},
|
126
|
+
this.envUrl
|
127
|
+
)
|
128
|
+
} catch(err) {
|
129
|
+
console.log(err)
|
130
|
+
}
|
131
|
+
}
|
132
|
+
this.$emit('jumpLink', val)
|
133
|
+
},
|
134
|
+
// 获取商品列表
|
135
|
+
getProductList(itemCodeList) {
|
136
|
+
if(itemCodeList.length == 0) return
|
137
|
+
let params = {
|
138
|
+
itemCodeList: itemCodeList,
|
139
|
+
pageNum: 1,
|
140
|
+
pageSize: itemCodeList.length
|
141
|
+
}
|
142
|
+
let productImage = {}
|
143
|
+
this.service.getProductInfo(this.envUrl, params, this.language).then(res => {
|
144
|
+
if (res && res.list) {
|
145
|
+
this.productList = res.list;
|
146
|
+
res.list.forEach(item => {
|
147
|
+
productImage[item.code] = item.mainPicUrl
|
148
|
+
})
|
149
|
+
this.productImage = productImage
|
150
|
+
}
|
151
|
+
})
|
152
|
+
},
|
153
|
+
reportData(h, preTotal = 0) {
|
154
|
+
this.preTotal = preTotal
|
155
|
+
let arr = this.hotList || []
|
156
|
+
if(!this.needReport) return
|
157
|
+
|
158
|
+
this.needReport = arr.some(item=>{
|
159
|
+
return !item.isReport
|
160
|
+
})
|
161
|
+
arr.forEach((ele, i) => {
|
162
|
+
// 若已上报不重复上报
|
163
|
+
if (!ele.isReport) {
|
164
|
+
let hotEl = this.$refs[`${this.sortId}${i}`][0].getBoundingClientRect()
|
165
|
+
if (hotEl.top <= h && hotEl.top >= -100) {
|
166
|
+
arr[i].isReport = true
|
167
|
+
let obj = arr[i]
|
168
|
+
dataSaveDecorationPageComponentEventFn(
|
169
|
+
{
|
170
|
+
uniqueId: this.recordId + '_' + this.sortId, // 组件_id
|
171
|
+
uniqueName: this.uniqueName, // 组件_名称
|
172
|
+
componentMethodType: 0,
|
173
|
+
popData: {
|
174
|
+
...obj,
|
175
|
+
uniqueId: this.recordId + '_' + this.sortId + '_' + obj.uniqueId.split('_')[2],
|
176
|
+
brand: this.pathType === 1 ? 'defaultPath' : this.brand
|
177
|
+
},
|
178
|
+
materialId: this.item.sort ? this.recordId + '_' +this.item.sort : this.recordId + '_' + this.sortId, //素材id
|
179
|
+
materialName: this.item.uniqueName ? this.item.uniqueName : this.uniqueName, //素材名称
|
180
|
+
refererPagePath: this.refererPagePath,
|
181
|
+
path: this.path,
|
182
|
+
componentType: this.componentType,
|
183
|
+
brand: this.brand,
|
184
|
+
position: preTotal + i + 1,
|
185
|
+
event: 'bannerShow'
|
186
|
+
},
|
187
|
+
this.envUrl
|
188
|
+
)
|
189
|
+
}
|
190
|
+
}
|
191
|
+
})
|
192
|
+
},
|
193
|
+
mouseover(index) {
|
194
|
+
this.hoverIndex = index
|
195
|
+
},
|
196
|
+
mouseLeave() {
|
197
|
+
this.hoverIndex = -1
|
198
|
+
}
|
199
|
+
},
|
200
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
.pop-wrap {
|
2
|
+
position: absolute;
|
3
|
+
.pop-item {
|
4
|
+
position: absolute;
|
5
|
+
cursor: pointer;
|
6
|
+
|
7
|
+
.product-hover {
|
8
|
+
font-size: 0;
|
9
|
+
display: flex;
|
10
|
+
align-items: center;
|
11
|
+
position: relative;
|
12
|
+
height: 100%;
|
13
|
+
|
14
|
+
.product-image {
|
15
|
+
font-size: 0;
|
16
|
+
padding-left: 10px;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="pop-wrap" :style="{left: item.left, top: item.top, width: item.realWidth * ratio+'px' || '100%', height: item.realHeight * ratio+'px' || '100%'}">
|
3
|
+
<div
|
4
|
+
:ref="`${sortId}${index}`"
|
5
|
+
:class="`pop-item`"
|
6
|
+
v-for="(ele,index) in item.popList"
|
7
|
+
:key="index"
|
8
|
+
@click="pageClick(ele, index)"
|
9
|
+
:style="{
|
10
|
+
width: `${ele.width / 750 * 100 }%`,
|
11
|
+
height:`${ele.height / (item.height / proportion) * 100}%`,
|
12
|
+
left: `${ele.left / 750 * 100 }%`,
|
13
|
+
top: `${ele.top / (item.height /proportion) * 100}%`
|
14
|
+
}">
|
15
|
+
<div class="product-hover" v-if="ele.product.openHot" @mouseover="mouseover(index)" @mouseleave="mouseLeave">
|
16
|
+
<div v-if="ele.product.initImage.length!=0" style="{fontSize: 0}">
|
17
|
+
<img :src="hoverIndex == index ?ele.product.hoverImage[0].resourcePath: ele.product.initImage[0].resourcePath" alt="">
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div v-if="hoverIndex == index" class="product-image">
|
21
|
+
<img :src="ele.product.imageType == 1 ? productImage[ele.productCode] : ele.product.productImage[0].resourcePath" alt="">
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
</template>
|
27
|
+
|
28
|
+
<script>
|
29
|
+
import hotspotJs from './hotspot.js';
|
30
|
+
export default hotspotJs;
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<style lang="scss" scoped>
|
34
|
+
@import 'hotspot';
|
35
|
+
</style>
|