@kaiyinchem/ky-uniui 1.1.10 → 1.1.12

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.
@@ -36,7 +36,8 @@
36
36
  </template>
37
37
 
38
38
  <script>
39
- const isDark = uni.getSystemInfoSync().theme === 'dark'
39
+ const isDark = uni.getAppBaseInfo().theme
40
+ const windowInfo = uni.getWindowInfo()
40
41
 
41
42
  export default {
42
43
  emits: ['rightClick', 'scrollTo'],
@@ -124,7 +125,7 @@
124
125
  sLoad: false,
125
126
  isLogin: false,
126
127
  messageNum: 0,
127
- barTop: 0,
128
+ barTop: windowInfo.statusBarHeight,
128
129
  opacity: 0,
129
130
  isScrollTo: false,
130
131
  menuButtonTop: 0, // 小程序胶囊按钮高度
@@ -142,11 +143,10 @@
142
143
  return this.isDark ? 'rgba(55,55,55, 0.9)' : 'rgba(255,255,255, 0.9)'
143
144
  }
144
145
  },
145
- created() {
146
- this.barTop = uni.getSystemInfoSync().safeArea.top + 50
146
+ mounted() {
147
147
  // #ifdef MP-WEIXIN
148
148
  const button = uni.getMenuButtonBoundingClientRect()
149
- this.menuButtonTop = button.top + 5
149
+ this.menuButtonTop = button.top - 5
150
150
  // #endif
151
151
  this.opacity = this.transparent ? 0 : 1
152
152
  uni.onThemeChange(res => {
@@ -29,7 +29,12 @@
29
29
  </view>
30
30
  <view
31
31
  v-if="tabItemWidth > 0 && !hasIcon"
32
- :style="{ left: tabItemOffsetLeft + 'px', width: tabItemWidth + 'px', 'background-color': activeColor }"
32
+ :style="{
33
+ left: tabItemOffsetLeft + 'px',
34
+ width: tabItemWidth + 'px',
35
+ height: tabItemHeight + 'px',
36
+ 'background-color': activeColor
37
+ }"
33
38
  class="ky-tab-slider"
34
39
  >
35
40
  </view>
@@ -98,6 +103,7 @@
98
103
  return {
99
104
  tabItemOffsetLeft: 0,
100
105
  tabItemWidth: 0,
106
+ tabItemHeight: 2,
101
107
  tabIndex: 0,
102
108
  }
103
109
  },
@@ -137,6 +143,9 @@
137
143
  parent.boundingClientRect(data => {
138
144
  this.tabItemWidth = data.width
139
145
  this.tabItemOffsetLeft = data.left
146
+ if (this.type === 'card') {
147
+ this.tabItemHeight = data.height
148
+ }
140
149
  if (this.tabIndex === index) {
141
150
  return
142
151
  }
@@ -184,13 +193,12 @@
184
193
  justify-content: center;
185
194
  border-right: 1px solid var(--color-primary);
186
195
  box-sizing: border-box;
187
- &:last-child {
188
- border-right: 0;
189
- }
190
196
  &.active {
191
- background: var(--color-primary);
192
197
  color: #ffffff;
193
198
  }
199
+ &:last-child {
200
+ border-right: 0;
201
+ }
194
202
  }
195
203
  }
196
204
  }
@@ -223,6 +231,8 @@
223
231
  margin: 0 12rpx;
224
232
  padding: 15rpx 0;
225
233
  transition: all 0.3s;
234
+ position: relative;
235
+ z-index: 1;
226
236
  color: var(--color-gray);
227
237
  &.active {
228
238
  font-weight: bold;
@@ -247,11 +257,11 @@
247
257
  .ky-tab-slider {
248
258
  position: absolute;
249
259
  background-color: var(--color-primary);
250
- height: 6rpx;
251
- border-radius: 12rpx;
252
- width: 50rpx;
253
- bottom: 0;
260
+ height: 0;
261
+ width: 0;
262
+ bottom: 1px;
254
263
  transition: all 0.3s;
264
+ z-index: -1;
255
265
  }
256
266
  }
257
267
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "locale"
10
10
  ],
11
11
  "description": "an uniapp ui",
12
- "version": "1.1.10",
12
+ "version": "1.1.12",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/yezipi/ky-uniui.git"