unika-components 1.0.255 → 1.0.256

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.
@@ -10,55 +10,17 @@ button.uni-text-component {
10
10
  box-sizing: border-box;
11
11
  white-space: pre-wrap;
12
12
  }
13
-
14
- .uni-image-component {
15
- max-width: 100%;
16
- }
17
- .uni-image-mask-wrapper {
18
- display: inline-block;
19
- }
20
13
 
21
- .uni-video-component {
22
- position: relative;
23
- text-align: center;
24
- }
25
- .play-pause-button {
26
- position: absolute;
27
- top: 50%;
28
- left: 50%;
29
- transform: translate(-50%, -50%);
30
- cursor: pointer;
31
- font-size: 2rem;
32
- color: #fff;
33
- background: rgba(0, 0, 0, 0.6);
34
- border-radius: 50%;
35
- padding: 10px;
36
- transition: background 0.3s;
37
- }
38
- .play-pause-button:hover {
39
- background: rgba(0, 0, 0, 0.8);
40
- }
41
14
 
42
- .like-button {
43
- display: flex;
44
- flex-direction: column;
45
- align-items: center;
46
- cursor: pointer;
47
- }
48
-
49
- .icon-heart {
50
- font-size: 24px;
51
- color: #e74c3c;
52
- }
15
+ .uni-calendar-component {
53
16
 
54
- .liked {
55
- color: #f00; /* 更改颜色以示已赞 */
56
17
  }
57
-
58
- .like-count {
59
- margin-top: 4px;
60
- font-size: 16px;
61
- color: #333;
18
+ .slot-number {
19
+ position: absolute;
20
+ bottom: 2px;
21
+ left: 7px;
22
+ font-size: 12px;
23
+ color: #666
62
24
  }
63
25
 
64
26
  .slide-guide {
@@ -133,25 +95,58 @@ body, html {
133
95
  transform: translate3d(-50%, -50%, 0);
134
96
  }
135
97
  }
98
+
99
+ .uni-image-component {
100
+ max-width: 100%;
101
+ }
102
+ .uni-image-mask-wrapper {
103
+ display: inline-block;
104
+ }
136
105
 
106
+ .uni-video-component {
107
+ position: relative;
108
+ text-align: center;
109
+ }
110
+ .play-pause-button {
111
+ position: absolute;
112
+ top: 50%;
113
+ left: 50%;
114
+ transform: translate(-50%, -50%);
115
+ cursor: pointer;
116
+ font-size: 2rem;
117
+ color: #fff;
118
+ background: rgba(0, 0, 0, 0.6);
119
+ border-radius: 50%;
120
+ padding: 10px;
121
+ transition: background 0.3s;
122
+ }
123
+ .play-pause-button:hover {
124
+ background: rgba(0, 0, 0, 0.8);
125
+ }
137
126
 
138
- .uni-calendar-component {
127
+ .like-button {
128
+ display: flex;
129
+ flex-direction: column;
130
+ align-items: center;
131
+ cursor: pointer;
132
+ }
139
133
 
134
+ .icon-heart {
135
+ font-size: 24px;
136
+ color: #e74c3c;
140
137
  }
141
- .slot-number {
142
- position: absolute;
143
- bottom: 2px;
144
- left: 7px;
145
- font-size: 12px;
146
- color: #666
138
+
139
+ .liked {
140
+ color: #f00; /* 更改颜色以示已赞 */
147
141
  }
148
142
 
149
- .effect {
150
- width: 100%;
151
- height: 100%;
143
+ .like-count {
144
+ margin-top: 4px;
145
+ font-size: 16px;
146
+ color: #333;
152
147
  }
153
148
 
154
- .uni-lotties-component {
149
+ .effect {
155
150
  width: 100%;
156
151
  height: 100%;
157
152
  }
@@ -191,6 +186,14 @@ body, html {
191
186
  vertical-align: top;
192
187
  }
193
188
 
189
+ .uni-build-up-component {
190
+ }
191
+
192
+ .uni-lotties-component {
193
+ width: 100%;
194
+ height: 100%;
195
+ }
196
+
194
197
  .swiper-warp {
195
198
  width: 100%;
196
199
  height: 100%;
@@ -204,9 +207,6 @@ body, html {
204
207
  max-width: 100%;
205
208
  max-height: 100%;
206
209
  }
207
-
208
- .uni-build-up-component {
209
- }
210
210
 
211
211
  .uni-svg-component {
212
212
  display: inline-block;
@@ -13127,25 +13127,16 @@ var script$h = defineComponent({
13127
13127
  }
13128
13128
  });
13129
13129
  };
13130
- const reloadAnimation = (componentId) => {
13131
- const component = componentRefs.value.get(`component-${componentId}`);
13132
- console.log('1111111');
13133
- if (component) {
13134
- const innerComponent = component.querySelector('.inner-component');
13135
- console.log('bbbbbbbb');
13136
- if (innerComponent) {
13137
- console.log('aaaaaaaaaa');
13138
- const keyAttr = innerComponent.getAttribute('key');
13139
- if (keyAttr) {
13140
- console.log('bbbbbbbb');
13141
- const newKey = parseInt(keyAttr) + 1;
13142
- innerComponent.setAttribute('key', newKey.toString());
13143
- }
13144
- else {
13145
- innerComponent.setAttribute('key', '1');
13130
+ const restartLottieAnimations = () => {
13131
+ componentRefs.value.forEach((el) => {
13132
+ const lottieComponent = el.querySelector('.uni-lotties-component');
13133
+ if (lottieComponent && lottieComponent.__vue__) {
13134
+ const vueInstance = lottieComponent.__vue__;
13135
+ if (vueInstance.play) {
13136
+ vueInstance.play();
13146
13137
  }
13147
13138
  }
13148
- }
13139
+ });
13149
13140
  };
13150
13141
  const onSlideChange = (swiper) => {
13151
13142
  const currentIndex = swiper.activeIndex;
@@ -13161,7 +13152,7 @@ var script$h = defineComponent({
13161
13152
  const currentPage = props.work && props.work.pages[currentIndex];
13162
13153
  currentPage && currentPage.components.forEach((component) => {
13163
13154
  if (component.name === 'uni-lotties') {
13164
- reloadAnimation(component.id);
13155
+ restartLottieAnimations();
13165
13156
  }
13166
13157
  });
13167
13158
  };
@@ -13176,7 +13167,7 @@ var script$h = defineComponent({
13176
13167
  const currentPage = props.work && props.work.pages[currentIndex];
13177
13168
  currentPage && currentPage.components.forEach((component) => {
13178
13169
  if (component.name === 'uni-lotties') {
13179
- reloadAnimation(component.id);
13170
+ restartLottieAnimations();
13180
13171
  }
13181
13172
  });
13182
13173
  };
@@ -13134,25 +13134,16 @@
13134
13134
  }
13135
13135
  });
13136
13136
  };
13137
- const reloadAnimation = (componentId) => {
13138
- const component = componentRefs.value.get(`component-${componentId}`);
13139
- console.log('1111111');
13140
- if (component) {
13141
- const innerComponent = component.querySelector('.inner-component');
13142
- console.log('bbbbbbbb');
13143
- if (innerComponent) {
13144
- console.log('aaaaaaaaaa');
13145
- const keyAttr = innerComponent.getAttribute('key');
13146
- if (keyAttr) {
13147
- console.log('bbbbbbbb');
13148
- const newKey = parseInt(keyAttr) + 1;
13149
- innerComponent.setAttribute('key', newKey.toString());
13150
- }
13151
- else {
13152
- innerComponent.setAttribute('key', '1');
13137
+ const restartLottieAnimations = () => {
13138
+ componentRefs.value.forEach((el) => {
13139
+ const lottieComponent = el.querySelector('.uni-lotties-component');
13140
+ if (lottieComponent && lottieComponent.__vue__) {
13141
+ const vueInstance = lottieComponent.__vue__;
13142
+ if (vueInstance.play) {
13143
+ vueInstance.play();
13153
13144
  }
13154
13145
  }
13155
- }
13146
+ });
13156
13147
  };
13157
13148
  const onSlideChange = (swiper) => {
13158
13149
  const currentIndex = swiper.activeIndex;
@@ -13168,7 +13159,7 @@
13168
13159
  const currentPage = props.work && props.work.pages[currentIndex];
13169
13160
  currentPage && currentPage.components.forEach((component) => {
13170
13161
  if (component.name === 'uni-lotties') {
13171
- reloadAnimation(component.id);
13162
+ restartLottieAnimations();
13172
13163
  }
13173
13164
  });
13174
13165
  };
@@ -13183,7 +13174,7 @@
13183
13174
  const currentPage = props.work && props.work.pages[currentIndex];
13184
13175
  currentPage && currentPage.components.forEach((component) => {
13185
13176
  if (component.name === 'uni-lotties') {
13186
- reloadAnimation(component.id);
13177
+ restartLottieAnimations();
13187
13178
  }
13188
13179
  });
13189
13180
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unika-components",
3
- "version": "1.0.255",
3
+ "version": "1.0.256",
4
4
  "private": false,
5
5
  "main": "dist/unika-components.umd.js",
6
6
  "module": "dist/unika-components.esm.js",