Skip to content

Commit 46a5308

Browse files
committed
1. 修复在nvue下样式的警告和报错问题
2. 修复grid组件在头条小程序的报错的问题 3. 优化tabs组件在头条小程序的表现问题 4. 修复index-list组件在头条小程序上的兼容性 5. 修复layout组件在头条小程序上的兼容性 6. 修复table组件在头条小程序上的兼容性 7. 修复checkbox组件在头条小程序上的兼容性 8. 修复radio组件在头条小程序上的兼容性 9. 修复form和form-item在头条小程序上的兼容性 10. 修复popup在头条小程序上底部有缺失的问题,同时连带修复使用了popup的keyborad和picker,calendar等组件的问题 11. 优化toast组件多次调用,可能会造成配置混乱的问题 12. 修复rate组件在微信,头条小程序上滑动选择可能不正确的问题 13. 优化line组件在头条小程序上的兼容性 14. 修复message-input组件在头条小程序上的兼容性 15. 优化link组件在头条小程序上复制链接后,toast弹出瞬间被关闭的问题 16. 优化empty演示在头条小程序上的兼容性 17. 优化tag组件在支付宝小程序上不支持行内样式加"!important"的问题
1 parent 92669cb commit 46a5308

File tree

17 files changed

+123
-112
lines changed

17 files changed

+123
-112
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.6.5",
5+
"versionName" : "1.6.6",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages/componentsA/empty/index.vue

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,58 +17,58 @@
1717
<view class="u-config-item">
1818
<view class="u-item-title">模式选择</view>
1919
<u-table>
20-
<u-tr>
21-
<u-td>
20+
<u-tr class="u-tr">
21+
<u-td class="u-td">
2222
<u-button :hair-line="false" size="mini" @click="modeChange('car')">购物车为空</u-button>
2323
</u-td>
24-
<u-td>
24+
<u-td class="u-td">
2525
<u-button :hair-line="false" size="mini" @click="modeChange('page')">页面不存在</u-button>
2626
</u-td>
27-
<u-td>
27+
<u-td class="u-td">
2828
<u-button :hair-line="false" size="mini" @click="modeChange('search')">没有搜索结果</u-button>
2929
</u-td>
3030
</u-tr>
31-
<u-tr>
32-
<u-td>
31+
<u-tr class="u-tr">
32+
<u-td class="u-td">
3333
<u-button :hair-line="false" size="mini" @click="modeChange('address')">没有收货地址</u-button>
3434
</u-td>
35-
<u-td>
35+
<u-td class="u-td">
3636
<u-button :hair-line="false" size="mini" @click="modeChange('wifi')">没有WiFi</u-button>
3737
</u-td>
38-
<u-td>
38+
<u-td class="u-td">
3939
<u-button :hair-line="false" size="mini" @click="modeChange('order')">订单为空</u-button>
4040
</u-td>
4141
</u-tr>
42-
<u-tr>
43-
<u-td>
42+
<u-tr class="u-tr">
43+
<u-td class="u-td">
4444
<u-button :hair-line="false" size="mini" @click="modeChange('coupon')">没有优惠券</u-button>
4545
</u-td>
46-
<u-td>
46+
<u-td class="u-td">
4747
<u-button :hair-line="false" size="mini" @click="modeChange('favor')">没有收藏</u-button>
4848
</u-td>
49-
<u-td>
49+
<u-td class="u-td">
5050
<u-button :hair-line="false" size="mini" @click="modeChange('permission')">无权限</u-button>
5151
</u-td>
5252
</u-tr>
53-
<u-tr>
54-
<u-td>
53+
<u-tr class="u-tr">
54+
<u-td class="u-td">
5555
<u-button :hair-line="false" size="mini" @click="modeChange('history')">无历史记录</u-button>
5656
</u-td>
57-
<u-td>
57+
<u-td class="u-td">
5858
<u-button :hair-line="false" size="mini" @click="modeChange('news')">无新闻列表</u-button>
5959
</u-td>
60-
<u-td>
60+
<u-td class="u-td">
6161
<u-button :hair-line="false" size="mini" @click="modeChange('message')">消息列表为空</u-button>
6262
</u-td>
6363
</u-tr>
64-
<u-tr>
65-
<u-td>
64+
<u-tr class="u-tr">
65+
<u-td class="u-td">
6666
<u-button :hair-line="false" size="mini" @click="modeChange('list')">列表为空</u-button>
6767
</u-td>
68-
<u-td>
68+
<u-td class="u-td">
6969
<u-button :hair-line="false" size="mini" @click="modeChange('data')">数据为空</u-button>
7070
</u-td>
71-
<u-td>
71+
<u-td class="u-td">
7272
待扩展
7373
</u-td>
7474
</u-tr>

pages/componentsA/modal/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:show-title="showTitle" :async-close="asyncClose"
1010
@confirm="confirm" :content="content"
1111
>
12-
<!-- #ifndef MP-WEIXIN -->
12+
<!-- #ifndef MP-WEIXIN || MP-TOUTIAO -->
1313
<view class="warp" style="margin: 30rpx;" v-if="contentSlot">
1414
<image class="logo" src="https://uviewui.com/common/logo.png" style="width: 220rpx;" mode="widthFix"></image>
1515
</view>

pages/componentsA/slider/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@end="end"
1212
@moving="moving"
1313
>
14-
<!-- #ifndef MP-WEIXIN -->
14+
<!-- #ifndef MP-WEIXIN || MP-TOUTIAO -->
1515
<view class="" v-if="useSlot">
1616
<view class="badge-button">
1717
{{value}}

pages/componentsB/line/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area u-flex u-row-center">
6-
<u-line :border-style="borderStyle" color="red" :color="color" :length="length" :direction="direction" :hair-line="hairLine"></u-line>
6+
<!-- 头条小程序因为兼容性,必须要给组件写上u-line类 -->
7+
<u-line class="u-line" :border-style="borderStyle" color="red" :color="color" :length="length" :direction="direction" :hair-line="hairLine"></u-line>
78
</view>
89
</view>
910
<view class="u-config-wrap">

pages/componentsB/tabbar/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
</view>
2929
</view>
3030
<u-tabbar
31-
:beforeSwitch="beforeSwitch"
3231
v-model="current"
3332
:show="show"
3433
:bg-color="bgColor"

pages/componentsC/test/index.vue

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,37 @@
11
<template>
22
<view class="">
3-
<u-dropdown ref="uDropdown" @open="open" @close="close">
4-
<u-dropdown-item v-model="value1" title="距离" :options="options1" @change="change"></u-dropdown-item>
5-
<u-dropdown-item v-model="value2" title="温度" :options="options2"></u-dropdown-item>
6-
</u-dropdown>
3+
<u-button @click="show = true;">打开弹窗</u-button>
4+
<u-popup mode="bottom" v-model="show">
5+
<view class="content">
6+
<u-image class="image" width="500rpx" height="300rpx" src="https://cdn.uviewui.com/uview/example/fade.jpg"></u-image>
7+
8+
<view class="confrim-btn">
9+
<u-button @click="show = false;">确定</u-button>
10+
</view>
11+
</view>
12+
</u-popup>
713
</view>
814
</template>
915

1016
<script>
1117
export default {
1218
data() {
1319
return {
14-
value1: 1,
15-
value2: 2,
16-
options1: [{
17-
label: '默认排序',
18-
value: 1,
19-
},
20-
{
21-
label: '距离优先',
22-
value: 2,
23-
}
24-
],
25-
options2: [{
26-
label: '去冰',
27-
value: 1,
28-
},
29-
{
30-
label: '加冰',
31-
value: 2,
32-
},
33-
],
34-
}
35-
},
36-
methods: {
37-
open(index) {
38-
// 展开某个下来菜单时,先关闭原来的其他菜单高亮
39-
// 同时内部会自动给当前展开项进行高亮
40-
this.$refs.uDropdown.highlight();
41-
},
42-
close(index) {
43-
// 关闭的时候,给当前项加上高亮
44-
// 当然,您也可以通过监听dropdown-item的@change事件进行处理
45-
this.$refs.uDropdown.highlight(index);
46-
},
47-
change() {
48-
// 更多的细节,请自行实现
20+
show: true
4921
}
5022
}
5123
}
52-
</script>
24+
</script>
25+
26+
<style lang="scss" scoped>
27+
.content {
28+
padding: 24rpx;
29+
text-align: center;
30+
position: relative;
31+
}
32+
33+
.image {
34+
position: absolute;
35+
top: -200rpx;
36+
}
37+
</style>

pages/example/components.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,16 @@ export default [{
219219
icon: 'mask',
220220
title: 'Mask 遮罩层',
221221
title_en: 'Mask',
222-
}, {
222+
},
223+
// #ifndef MP-TOUTIAO
224+
{
223225
path: '/pages/componentsA/noNetwork/index',
224226
icon: 'noNetwork',
225227
title: 'NoNetwork 无网络提示',
226228
title_en: 'NoNetwork',
227-
}, {
229+
},
230+
// #endif
231+
{
228232
path: '/pages/componentsC/grid/index',
229233
icon: 'grid',
230234
title: 'Grid 宫格布局',
@@ -250,12 +254,14 @@ export default [{
250254
title: 'Sticky 吸顶',
251255
title_en: 'Sticky',
252256
},
257+
// #ifndef MP-TOUTIAO
253258
{
254259
path: '/pages/componentsB/waterfall/index',
255260
icon: 'waterfall',
256261
title: 'Waterfall 瀑布流',
257262
title_en: 'Waterfall',
258263
},
264+
// #endif
259265
{
260266
path: '/pages/componentsB/divider/index',
261267
icon: 'divider',

uview-ui/components/u-link/u-link.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@
6767
// #ifdef MP
6868
uni.setClipboardData({
6969
data: this.href,
70-
success() {
70+
success: () => {
7171
uni.hideToast();
72+
this.$nextTick(() => {
73+
this.$u.toast(this.mpTips);
74+
})
7275
}
7376
});
74-
this.$nextTick(() => {
75-
this.$u.toast(this.mpTips);
76-
})
7777
// #endif
7878
}
7979
}

uview-ui/components/u-message-input/u-message-input.vue

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<view class="u-char-box">
33
<view class="u-char-flex">
44
<input :disabled="disabledKeyboard" :value="valueModel" type="number" :focus="focus" :maxlength="maxlength" class="u-input" @input="getVal"/>
5-
<view v-for="(item, index) in maxlength" :key="index">
5+
<!-- 这里需要通过new Array生成一个供循环的数组,是因为头条小程序不支持通过v-for历遍一个数值,其他端都是正常的 -->
6+
<view v-for="(item, index) in (new Array(maxlength).fill(0))" :key="index">
67
<view :class="[breathe && charArrLength == index ? 'u-breathe' : '', 'u-char-item',
78
charArrLength === index && mode == 'box' ? 'u-box-active' : '',
89
mode === 'box' ? 'u-box' : '']" :style="{
@@ -118,13 +119,13 @@
118119
}
119120
},
120121
watch: {
121-
maxlength: {
122-
// 此值设置为true,会在组件加载后无需maxlength变化就会执行一次本监听函数,无需再created生命周期中处理
123-
immediate: true,
124-
handler(val) {
125-
this.maxlength = Number(val);
126-
}
127-
},
122+
// maxlength: {
123+
// // 此值设置为true,会在组件加载后无需maxlength变化就会执行一次本监听函数,无需再created生命周期中处理
124+
// immediate: true,
125+
// handler(val) {
126+
// this.maxlength = Number(val);
127+
// }
128+
// },
128129
value: {
129130
immediate: true,
130131
handler(val) {

uview-ui/components/u-popup/u-popup.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<view v-if="visibleSync" :style="[customStyle, {
33
zIndex: uZindex - 1
44
}]" class="u-drawer" hover-stop-propagation>
5-
<u-mask :custom-style="maskCustomStyle" :maskClickAble="maskCloseAble" :z-index="uZindex - 2" :show="showDrawer && mask" @click="maskClick"></u-mask>
5+
<u-mask :duration="duration" :custom-style="maskCustomStyle" :maskClickAble="maskCloseAble" :z-index="uZindex - 2" :show="showDrawer && mask" @click="maskClick"></u-mask>
66
<view
77
class="u-drawer-content"
88
@tap="modeCenterClose(mode)"
@@ -188,6 +188,11 @@ export default {
188188
default() {
189189
return {}
190190
}
191+
},
192+
// 遮罩打开或收起的动画过渡时间,单位ms
193+
duration: {
194+
type: [String, Number],
195+
default: 250
191196
}
192197
},
193198
data() {
@@ -237,6 +242,7 @@ export default {
237242
// 不加可能圆角无效
238243
style.overflow = 'hidden';
239244
}
245+
if(this.duration) style.transition = `all ${this.duration / 1000}s linear`;
240246
return style;
241247
},
242248
// 中部弹窗的特有样式
@@ -323,7 +329,7 @@ export default {
323329
this.timer = setTimeout(() => {
324330
this[param2] = status;
325331
this.$emit(status ? 'open' : 'close');
326-
}, 300);
332+
}, this.duration);
327333
}
328334
}
329335
}
@@ -351,7 +357,7 @@ export default {
351357
/* #endif */
352358
position: absolute;
353359
z-index: 1003;
354-
transition: all 0.3s linear;
360+
transition: all 0.25s linear;
355361
}
356362
357363
.u-drawer__scroll-view {

uview-ui/components/u-rate/u-rate.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ export default {
123123
// 获取评分组件盒子的布局信息
124124
getElRectById() {
125125
// uView封装的获取节点的方法,详见文档
126-
this.$u.getRect('#' + this.elId).then(res => {
126+
this.$uGetRect('#' + this.elId).then(res => {
127127
this.starBoxLeft = res.left;
128128
})
129129
},
130130
// 获取单个星星的尺寸
131131
getElRectByClass() {
132132
// uView封装的获取节点的方法,详见文档
133-
this.$u.getRect('.' + this.elClass).then(res => {
133+
this.$uGetRect('.' + this.elClass).then(res => {
134134
this.starWidth = res.width;
135135
// 把每个星星右边到组件盒子左边的距离放入数组中
136136
for (let i = 0; i < this.count; i++) {
@@ -191,8 +191,10 @@ export default {
191191
}
192192
},
193193
mounted() {
194-
this.getElRectById();
195-
this.getElRectByClass();
194+
setTimeout(() => {
195+
this.getElRectById();
196+
this.getElRectByClass();
197+
}, 100)
196198
}
197199
};
198200
</script>

uview-ui/components/u-tag/u-tag.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@
112112
customStyle() {
113113
let style = {};
114114
// 文字颜色(如果有此值,会覆盖type值的颜色)
115-
if(this.color) style.color = this.color+"!important";
115+
if(this.color) style.color = this.color;
116116
// tag的背景颜色(如果有此值,会覆盖type值的颜色)
117-
if(this.bgColor) style.backgroundColor = this.bgColor+"!important";
117+
if(this.bgColor) style.backgroundColor = this.bgColor;
118118
// 如果是镂空型tag,没有传递边框颜色(borderColor)的话,使用文字的颜色(color属性)
119119
if(this.mode == 'plain' && this.color && !this.borderColor) style.borderColor = this.color;
120120
else style.borderColor = this.borderColor;

0 commit comments

Comments
 (0)