baiqiu-cms-decoration-dg 0.0.1

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.
Files changed (101) hide show
  1. package/.babelrc +17 -0
  2. package/.editorconfig +9 -0
  3. package/.prettierrc +8 -0
  4. package/README.md +18 -0
  5. package/dist/baiqiu-cms-decoration.min.js +26 -0
  6. package/dist/baiqiu-cms-decoration.min.js.map +1 -0
  7. package/dist/font/iconfont.eot +0 -0
  8. package/dist/font/iconfont.svg +89 -0
  9. package/dist/font/iconfont.ttf +0 -0
  10. package/dist/font/iconfont.woff +0 -0
  11. package/dist/iconfont.svg +1 -0
  12. package/index.html +11 -0
  13. package/package.json +48 -0
  14. package/src/App.vue +198 -0
  15. package/src/api/com-service.js +26 -0
  16. package/src/assets/iconfont/demo.css +539 -0
  17. package/src/assets/iconfont/iconfont.css +158 -0
  18. package/src/assets/iconfont/iconfont.eot +0 -0
  19. package/src/assets/iconfont/iconfont.json +254 -0
  20. package/src/assets/iconfont/iconfont.svg +89 -0
  21. package/src/assets/iconfont/iconfont.ttf +0 -0
  22. package/src/assets/iconfont/iconfont.woff +0 -0
  23. package/src/assets/iconfont/iconfont.woff2 +0 -0
  24. package/src/assets/img/pc-cms-v2/creation.png +0 -0
  25. package/src/assets/img/pc-cms-v2/icon.png +0 -0
  26. package/src/assets/img/pc-cms-v2/mobileNav.png +0 -0
  27. package/src/assets/img/pc-cms-v2/next1.png +0 -0
  28. package/src/assets/img/pc-cms-v2/next2.png +0 -0
  29. package/src/assets/img/pc-cms-v2/prev1.png +0 -0
  30. package/src/assets/img/pc-cms-v2/prev2.png +0 -0
  31. package/src/assets/img/pc-cms-v2/text.png +0 -0
  32. package/src/components/cms/animate.scss +19 -0
  33. package/src/components/cms/buttonItem/buttonItem.js +139 -0
  34. package/src/components/cms/buttonItem/buttonItem.scss +95 -0
  35. package/src/components/cms/buttonItem/buttonItem.vue +47 -0
  36. package/src/components/cms/buttonItem/index.js +2 -0
  37. package/src/components/cms/cms.js +102 -0
  38. package/src/components/cms/cms.scss +46 -0
  39. package/src/components/cms/cms.vue +48 -0
  40. package/src/components/cms/customLayout/customLayout.js +46 -0
  41. package/src/components/cms/customLayout/customLayout.scss +8 -0
  42. package/src/components/cms/customLayout/customLayout.vue +15 -0
  43. package/src/components/cms/customLayout/index.js +2 -0
  44. package/src/components/cms/hotspot/hotspot.js +199 -0
  45. package/src/components/cms/hotspot/hotspot.scss +20 -0
  46. package/src/components/cms/hotspot/hotspot.vue +35 -0
  47. package/src/components/cms/hotspot/index.js +2 -0
  48. package/src/components/cms/imgNav/imgNav.js +177 -0
  49. package/src/components/cms/imgNav/imgNav.scss +110 -0
  50. package/src/components/cms/imgNav/imgNav.vue +123 -0
  51. package/src/components/cms/imgNav/index.js +2 -0
  52. package/src/components/cms/index.js +2 -0
  53. package/src/components/cms/mixin.js +244 -0
  54. package/src/components/cms/multipleLayout/index.js +2 -0
  55. package/src/components/cms/multipleLayout/multipleLayout.js +54 -0
  56. package/src/components/cms/multipleLayout/multipleLayout.scss +21 -0
  57. package/src/components/cms/multipleLayout/multipleLayout.vue +25 -0
  58. package/src/components/cms/productItem/index.js +2 -0
  59. package/src/components/cms/productItem/productItem.js +293 -0
  60. package/src/components/cms/productItem/productItem.scss +180 -0
  61. package/src/components/cms/productItem/productItem.vue +117 -0
  62. package/src/components/cms/singleLayout/index.js +2 -0
  63. package/src/components/cms/singleLayout/singleLayout.js +72 -0
  64. package/src/components/cms/singleLayout/singleLayout.scss +21 -0
  65. package/src/components/cms/singleLayout/singleLayout.vue +39 -0
  66. package/src/components/cms/slideLayout/index.js +2 -0
  67. package/src/components/cms/slideLayout/slideLayout.js +248 -0
  68. package/src/components/cms/slideLayout/slideLayout.scss +18 -0
  69. package/src/components/cms/slideLayout/slideLayout.vue +44 -0
  70. package/src/components/cms/swiperItem/index.js +2 -0
  71. package/src/components/cms/swiperItem/swiperItem.js +228 -0
  72. package/src/components/cms/swiperItem/swiperItem.scss +204 -0
  73. package/src/components/cms/swiperItem/swiperItem.vue +123 -0
  74. package/src/components/cms/tabLayout/index.js +2 -0
  75. package/src/components/cms/tabLayout/navItem/index.js +2 -0
  76. package/src/components/cms/tabLayout/navItem/navItem.js +47 -0
  77. package/src/components/cms/tabLayout/navItem/navItem.scss +23 -0
  78. package/src/components/cms/tabLayout/navItem/navItem.vue +13 -0
  79. package/src/components/cms/tabLayout/tabLayout.js +158 -0
  80. package/src/components/cms/tabLayout/tabLayout.scss +26 -0
  81. package/src/components/cms/tabLayout/tabLayout.vue +43 -0
  82. package/src/components/cms/textItem/index.js +2 -0
  83. package/src/components/cms/textItem/textItem.js +72 -0
  84. package/src/components/cms/textItem/textItem.scss +41 -0
  85. package/src/components/cms/textItem/textItem.vue +26 -0
  86. package/src/components/cms/utils.js +101 -0
  87. package/src/components/cms/videoItem/index.js +2 -0
  88. package/src/components/cms/videoItem/videoItem.js +96 -0
  89. package/src/components/cms/videoItem/videoItem.scss +27 -0
  90. package/src/components/cms/videoItem/videoItem.vue +56 -0
  91. package/src/components/cms/videoPlayer/index.js +2 -0
  92. package/src/components/cms/videoPlayer/videoPlayer.js +69 -0
  93. package/src/components/cms/videoPlayer/videoPlayer.scss +37 -0
  94. package/src/components/cms/videoPlayer/videoPlayer.vue +34 -0
  95. package/src/index.js +26 -0
  96. package/src/index.scss +213 -0
  97. package/src/main.js +7 -0
  98. package/src/utils/common.js +23 -0
  99. package/src/utils/http-client.js +111 -0
  100. package/src/utils/utils.js +63 -0
  101. package/webpack.config.js +113 -0
package/src/index.scss ADDED
@@ -0,0 +1,213 @@
1
+ .lay-wrap {
2
+ .vdr {
3
+ border: none;
4
+ touch-action: auto;
5
+ outline: none;
6
+ }
7
+
8
+ // .video-js .vjs-big-play-button {
9
+ // font-size: 2.5em !important;
10
+ // line-height: 2.3em !important;
11
+ // height: 2.5em !important;
12
+ // width: 2.5em !important;
13
+ // -webkit-border-radius: 2.5em !important;
14
+ // -moz-border-radius: 2.5em !important;
15
+ // border-radius: 2.5em !important;
16
+ // background-color: #73859f;
17
+ // background-color: rgba($color: #000000, $alpha: 0.6) !important;
18
+ // border-width: 0.15em !important;
19
+ // margin-top: -1.25em !important;
20
+ // margin-left: -1.75em !important;
21
+ // border: 0.0666em solid transparent;
22
+ // }
23
+
24
+ .video-wrap .video-js .vjs-control-bar {
25
+ z-index: 99!important;
26
+ }
27
+
28
+ .vjs-has-started .vjs-control-bar {
29
+ z-index: 99!important;
30
+ }
31
+
32
+ .video-wrap .video-js .vjs-big-play-button {
33
+ opacity: 1!important;
34
+ }
35
+
36
+ // .vjs-big-play-button .vjs-icon-placeholder {
37
+ // font-size: 1.63em !important;
38
+ // }
39
+
40
+ // .video-js:hover .vjs-big-play-button, .video-js .vjs-big-play-button:focus {
41
+ // border-color: transparent;
42
+ // }
43
+
44
+ .vjs-paused .vjs-big-play-button,
45
+ .vjs-paused.vjs-has-started .vjs-big-play-button {
46
+ display: block !important;
47
+ opacity: 1;
48
+ }
49
+
50
+ .video-js .vjs-time-control {
51
+ display: block !important;
52
+ }
53
+
54
+ .video-js .vjs-remaining-time {
55
+ display: none !important;
56
+ }
57
+
58
+ .video-js .vjs-mouse-display {
59
+ display: none!important;
60
+ }
61
+
62
+ // .video-js .vjs-time-control{
63
+ // text-align: center;
64
+ // min-width: 1em!important;
65
+ // padding: 0!important;
66
+ // line-height: 30px!important;
67
+ // }
68
+
69
+ .video-wrap .video-js .vjs-control-bar .vjs-button > .vjs-icon-placeholder:before {
70
+ line-height: 30px!important;
71
+ }
72
+
73
+ .video-js .vjs-play-progress:before {
74
+ top: -0.43em!important;
75
+ line-height: 1!important;
76
+ }
77
+
78
+ .video-js .vjs-mouse-display {
79
+ display: none!important;
80
+ }
81
+
82
+ .vjs-slider-horizontal .vjs-volume-level:before {
83
+ line-height: 1!important;
84
+ top: -0.55em
85
+ }
86
+
87
+ // 分页器样式三
88
+ .swiper-pagination.swiper-pagination-bullets {
89
+ &.swiper-pagination-3 {
90
+ .swiper-pagination-bullet {
91
+ opacity: 1;
92
+ background-color: var(--color)!important;
93
+ transition: all 0.3s;
94
+ &.swiper-pagination-bullet-active {
95
+ background-color: var(--activeColor)!important;
96
+ }
97
+ }
98
+ }
99
+ }
100
+
101
+ .text-con {
102
+ p{
103
+ font-size: 16px;
104
+ }
105
+ p,h1,h2,h3,h4,h5,table,pre {
106
+ line-height: 1.5;
107
+ }
108
+
109
+ table,pre {
110
+ margin: 15px 0;
111
+ }
112
+
113
+ ul,ol{
114
+ margin: 10px 0 10px 20px;
115
+ }
116
+ ul li{
117
+ list-style-type: disc;
118
+ margin: 5px 0;
119
+ }
120
+ ol li{
121
+ list-style-type:decimal;
122
+ margin: 5px 0;
123
+ }
124
+ table td{
125
+ text-align: inherit;
126
+ }
127
+ table {
128
+ border-top: 1px solid #ccc;
129
+ border-left: 1px solid #ccc;
130
+ border-spacing: 0;
131
+ }
132
+ table th {
133
+ border-bottom: 2px solid #ccc;
134
+ text-align: center;
135
+ background-color: #f1f1f1;
136
+ }
137
+ table td, table th {
138
+ border-bottom: 1px solid #ccc;
139
+ border-right: 1px solid #ccc;
140
+ padding: 3px 5px;
141
+ min-height: 30px;
142
+ min-width: 30px;
143
+ }
144
+ a:-webkit-any-link {
145
+ cursor: pointer;
146
+ color: -webkit-link;
147
+ }
148
+
149
+ a {
150
+ width: auto;
151
+ height: auto;
152
+ }
153
+ font[size="2"] {
154
+ font-size: 12px;
155
+ }
156
+ }
157
+
158
+ .swiper-container {
159
+ .swiper-button-prev {
160
+ pointer-events: auto;
161
+ background-image: none;
162
+ left: 20px;
163
+ &:hover {
164
+ .cms2iconfont {
165
+ color: var(--hoverColor) !important;
166
+ }
167
+ }
168
+ &::after {
169
+ display: none;
170
+ }
171
+
172
+ .cms2iconfont {
173
+ font-size: 28px;
174
+ }
175
+ }
176
+
177
+ .swiper-button-next {
178
+ pointer-events: auto;
179
+ background-image: none;
180
+ right: 20px;
181
+
182
+ &:hover {
183
+ .cms2iconfont {
184
+ color: var(--hoverColor) !important;
185
+ }
186
+ }
187
+
188
+ &::after {
189
+ display: none;
190
+ }
191
+
192
+ .cms2iconfont {
193
+ font-size: 28px;
194
+ }
195
+ }
196
+
197
+
198
+ .arrow {
199
+ width: 40px;
200
+ height: 40px;
201
+ background-color: #edf5fe;
202
+ border-radius: 50%;
203
+ display: flex;
204
+ align-items: center;
205
+ justify-content: center;
206
+ flex-shrink: 0;
207
+
208
+ .cms2iconfont {
209
+ font-size: 20px;
210
+ }
211
+ }
212
+ }
213
+ }
package/src/main.js ADDED
@@ -0,0 +1,7 @@
1
+ import Vue from 'vue'
2
+ import App from './App.vue'
3
+
4
+ new Vue({
5
+ el: '#app',
6
+ render: h => h(App)
7
+ })
@@ -0,0 +1,23 @@
1
+ module.exports = {
2
+ entrance: function(that) {
3
+ window.addEventListener('scroll', ()=>{this.scroll(that)})
4
+ },
5
+ scroll: function(that) {
6
+ let h = document.documentElement.clientHeight || document.body.clientHeight
7
+ let eles = document.querySelectorAll('.entrance-con')
8
+ eles.forEach((item, index) => {
9
+ let top = item.getBoundingClientRect().top
10
+ if (top < h - 50 && item.firstChild.style.display == 'none') {
11
+ item.classList.add('entrance-demonstrate') // 该样式主要为商品组件使用,因为商品接口返回会慢于该方法的执行,若将商品组件至于页面第一个,且添加了入场动画,会造成初始进入页面动画不执行,滑动一下才执行
12
+ if(!(item.classList.contains('product-list')&&index == 0)) {
13
+ item.firstChild.style.display = 'block'
14
+ }
15
+ }
16
+ })
17
+
18
+ let refs = that.$refs.layModule
19
+ refs.forEach(item =>{
20
+ item.reportData(h)
21
+ })
22
+ }
23
+ }
@@ -0,0 +1,111 @@
1
+ import axios from "axios";
2
+
3
+ export const CONTENT_TYPE = {
4
+ json: "application/json;",
5
+ form: "application/x-www-form-urlencoded;",
6
+ html: "text/html;",
7
+ file: "multipart/form-data",
8
+ excel: "msexcel",
9
+ xml: "application/xml",
10
+ javascript: "application/x-javascript;charset=utf-8"
11
+ };
12
+ export const REQ_HEADERS = {
13
+ lang: "Accept-Language",
14
+ contentType: "Content-Type"
15
+ };
16
+
17
+ function checkResponse(response) {
18
+ if (response.status === 200) {
19
+ let result = response.data;
20
+ if (result.errorCode === "0") {
21
+ return result.data;
22
+ }
23
+ return response.data;
24
+ }
25
+ }
26
+
27
+ axios.interceptors.response.use(checkResponse, error => {
28
+ // Do something with response error
29
+ if (error.message === "Network Error") {
30
+ }
31
+ return Promise.reject(error);
32
+ });
33
+
34
+ export class HttpClient {
35
+ static async call(
36
+ url,
37
+ { method = "get", headers = {}, body = null, responseType = null} = {}
38
+ ) {
39
+ let fetchUrl = url;
40
+ let params = {
41
+ method: method,
42
+ url: fetchUrl,
43
+ responseType: responseType || "json",
44
+ headers: headers
45
+ };
46
+ if (method === "get") {
47
+ params.params = body;
48
+ } else {
49
+ params.data = body;
50
+ }
51
+
52
+ // console.log("params", params);
53
+
54
+ const response = await axios(params).catch(error => {
55
+ if (error.response) {
56
+ // The request was made and the server responded with a status code
57
+ // that falls out of the range of 2xx
58
+ console.error(error.response.status, error.response.data);
59
+ } else if (error.request) {
60
+ // The request was made but no response was received
61
+ // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
62
+ // http.ClientRequest in node.js
63
+ console.error(error.request);
64
+ } else {
65
+ // Something happened in finance up the request that triggered an Error
66
+ console.error("Error", error.message ? error.message : "");
67
+ }
68
+ // console.log(error.config)
69
+ });
70
+ return response;
71
+ }
72
+
73
+ static get(url, { mask = true, external = false, headers = {} } = {}) {
74
+ return HttpClient.call(url, {
75
+ headers,
76
+ external,
77
+ mask
78
+ });
79
+ }
80
+
81
+ static postBody(
82
+ url,
83
+ {
84
+ body = {},
85
+ language = "zh-CN",
86
+ module = "",
87
+ method = "post",
88
+ mask = true,
89
+ postData = true,
90
+ external = false,
91
+ headers = {},
92
+ compat
93
+ }
94
+ ) {
95
+ return HttpClient.call(url, {
96
+ module,
97
+ method,
98
+ headers: Object.assign(headers, {
99
+ [REQ_HEADERS.contentType]: CONTENT_TYPE.json,
100
+ common:{
101
+ languageCode: language
102
+ }
103
+ }),
104
+ body: body,
105
+ postData,
106
+ external,
107
+ mask,
108
+ compat
109
+ });
110
+ }
111
+ }
@@ -0,0 +1,63 @@
1
+ import {ComService} from '../api/com-service'
2
+
3
+ /**
4
+ * cms数据采集上报
5
+ */
6
+ function dataSaveDecorationPageComponentEventFn(params, envUrl) {
7
+ const service = new ComService()
8
+ const data = {
9
+ source: '',
10
+ medium: '',
11
+ commodity_id: params.popData.productCode || '', //商品item
12
+ commodity_name: params.popData.selectDataShow || '', //商品名称
13
+ commodity_sku_id: '',
14
+ order_id: '', //订单id
15
+ is_success: null, //订单是否成功
16
+ fail_reason: '', //订单失败原因
17
+ recommended_scenes_code: '', //商品推荐场景id
18
+ component_name: params.uniqueName, // 组件名称
19
+ component_id: params.uniqueId, //组件ID
20
+ component_type: params.componentType, //组件类型
21
+ first_navigation_commodity_id: '', //一级导航_id
22
+ first_navigation_name: '', //一级导航名称
23
+ hot_zone_id: params.popData.uniqueId || '', //热区_id
24
+ hot_zone_name: params.popData.uniqueName || '', //热区_名称
25
+ material_id: params.materialId, //素材id
26
+ material_name: params.materialName, //素材名称
27
+ navigation_type: '', //导航类型;1:一级导航,2:二级导航,3:三级导航
28
+ url_path: params.path, //当前页面
29
+ // referer: '', //http Referer
30
+ refer_info: params.refererPagePath, //上级页面
31
+ second_navigation_commodity_id: '', //二级导航_id
32
+ second_navigation_name: '', //二级导航名称
33
+ first_navigation_tap_id: '', //一级导航tab_id
34
+ first_navigation_tap_name: '', //一级导航tab名称
35
+ second_navigation_tap_id: '', //二级导航tab_id
36
+ second_navigation_tap_name: '', //二级导航tab名称
37
+ navigation_tap_type: '', //导航TapId类型;1:一级导航tap;2:二级导航tap
38
+ navigation_commodity_type: '', //导航组件类型;1:一级导航组件;2:二级导航组件
39
+ position: params.position, // 素材位置
40
+ trigger_Method_Type: params.componentMethodType
41
+ }
42
+
43
+ let distinctId = ''
44
+
45
+ if(localStorage.getItem(`${params.brand}Cookie`)) {
46
+ distinctId = localStorage.getItem(`${params.brand}Cookie`)
47
+ } else {
48
+ distinctId = `${parseInt(new Date().getTime())}${Math.floor(Math.random()*10000)}`
49
+ localStorage.setItem(`${params.brand}Cookie`, distinctId)
50
+ }
51
+
52
+ service.dataSaveDecorationPageComponentEvent(envUrl, {
53
+ eventProperty: JSON.stringify({
54
+ ...data
55
+ }),
56
+ event: params.event,
57
+ distinctId,
58
+ })
59
+ }
60
+
61
+ export {
62
+ dataSaveDecorationPageComponentEventFn
63
+ }
@@ -0,0 +1,113 @@
1
+ var path = require("path");
2
+ var webpack = require("webpack");
3
+
4
+ var entry = "./src/main.js";
5
+ var filename = "build.js";
6
+
7
+ if (process.env.NODE_ENV !== "development") {
8
+ entry = "./src/index.js";
9
+ filename = "baiqiu-cms-decoration.min.js";
10
+ }
11
+
12
+ function resolve (dir) {
13
+ return path.join(__dirname, '..', dir)
14
+ }
15
+
16
+
17
+ module.exports = {
18
+ entry,
19
+ output: {
20
+ path: path.resolve(__dirname, "./dist"),
21
+ publicPath: "/dist/",
22
+ filename,
23
+ library: "bq-cms2.0-decoration.min",
24
+ libraryTarget: "umd",
25
+ umdNamedDefine: true
26
+ },
27
+ module: {
28
+ rules: [
29
+ {
30
+ test: /\.css$/,
31
+ use: ["vue-style-loader", "css-loader"]
32
+ },
33
+ {
34
+ test: /\.scss$/,
35
+ use: ["vue-style-loader", "css-loader", "sass-loader"]
36
+ },
37
+ {
38
+ test: /\.sass$/,
39
+ use: ["vue-style-loader", "css-loader", "sass-loader?indentedSyntax"]
40
+ },
41
+ {
42
+ test: /\.vue$/,
43
+ loader: "vue-loader",
44
+ options: {
45
+ loaders: {
46
+ // Since sass-loader (weirdly) has SCSS as its default parse mode, we map
47
+ // the "scss" and "sass" values for the lang attribute to the right configs here.
48
+ // other preprocessors should work out of the box, no loader config like this necessary.
49
+ scss: ["vue-style-loader", "css-loader", "sass-loader"],
50
+ sass: [
51
+ "vue-style-loader",
52
+ "css-loader",
53
+ "sass-loader?indentedSyntax"
54
+ ]
55
+ }
56
+ // other vue-loader options go here
57
+ }
58
+ },
59
+ {
60
+ test: /\.js$/,
61
+ loader: "babel-loader",
62
+ exclude: /node_modules/
63
+ },
64
+ {
65
+ test: /\.(png|jpg|gif|svg)$/,
66
+ loader: "file-loader",
67
+ options: {
68
+ name: "[name].[ext]?[hash]"
69
+ }
70
+ },
71
+ {
72
+ test: /\.(woff|ttf|eot|svg)/,
73
+ loader: "file-loader?name=font/[name].[ext]"
74
+ }
75
+ ]
76
+ },
77
+ resolve: {
78
+ alias: {
79
+ vue$: "vue/dist/vue.esm.js"
80
+ },
81
+ extensions: ["*", ".js", ".vue", ".json"]
82
+ },
83
+ devServer: {
84
+ historyApiFallback: true,
85
+ noInfo: true,
86
+ overlay: true
87
+ },
88
+ performance: {
89
+ hints: false
90
+ },
91
+ devtool: "#eval-source-map"
92
+ };
93
+
94
+ if (process.env.NODE_ENV === "production") {
95
+ module.exports.devtool = "#source-map";
96
+ // http://vue-loader.vuejs.org/en/workflow/production.html
97
+ module.exports.plugins = (module.exports.plugins || []).concat([
98
+ new webpack.DefinePlugin({
99
+ "process.env": {
100
+ NODE_ENV: '"production"'
101
+ }
102
+ }),
103
+ new webpack.optimize.UglifyJsPlugin({
104
+ sourceMap: true,
105
+ compress: {
106
+ warnings: false
107
+ }
108
+ }),
109
+ new webpack.LoaderOptionsPlugin({
110
+ minimize: true
111
+ })
112
+ ]);
113
+ }