Skip to content

Commit 40604f6

Browse files
committed
1. 优化this.$u.test.url()URL检测方法正则无法识别"127.0.0.1"的缺陷
2. 优化Swiper轮播图组件动态修改list长度时,重置内部current值 3. 移除Slider滑块组件的use-slot参数,改由组件内部判断,原功能不受影响 4. 完善文档Select组件关于回调参数的说明,完善日历组件的演示效果 5. 修复http请求可能存在导致跨域的问题 6. 新增双箭头图标arrow-left-double和arrow-right-double 7. 增加Search搜索组件右边清除按钮的可点击区域 8. 修复navBar返回按钮可能会触发两次的问题 9. 由于加载问题,阿里,头条,百度小程序的图标改用线上资源
1 parent d8df876 commit 40604f6

File tree

19 files changed

+100
-91
lines changed

19 files changed

+100
-91
lines changed

manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
"usingComponents" : true
106106
},
107107
"mp-baidu" : {
108-
"usingComponents" : true
108+
"usingComponents" : true,
109+
"appid" : "17597421"
109110
},
110111
"mp-toutiao" : {
111112
"usingComponents" : true

pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// "current": 0, //当前激活的模式(list 的索引项)
77
// "list": [{
88
// "name": "test", //模式名称
9-
// "path": "pages/componentsA/form/index", //启动页面,必选
9+
// "path": "pages/components/changelog.html", //启动页面,必选
1010
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
1111
// }]
1212
// },

pages/componentsA/calendar/index.vue

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
<view class="u-demo-wrap" style="background-color: #FFFFFF;">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<u-calendar v-model="show" :minDate="minDate" :maxDate="maxDate" :btnType="btnType" :activeBgColor="activeBgColor"
7-
:rangeBgColor="rangeBgColor" :rangeColor="rangeColor" :startText="startText" :endText="endText" :arrowType="arrowType"
8-
:mode="mode" ref="calendar" @change="change">
9-
6+
<u-calendar v-model="show" ref="calendar" @change="change" :mode="mode"
7+
:start-text="startText" :end-text="endText" :range-color="rangeColor"
8+
:range-bg-color="rangeBgColor" :active-bg-color="activeBgColor" :btn-type="btnType"
9+
>
1010
</u-calendar>
11+
<view class="u-demo-result-line">
12+
{{result}}
13+
</view>
1114
</view>
1215
</view>
1316
<view class="u-config-wrap">
@@ -19,20 +22,12 @@
1922
<u-subsection vibrateShort :current="showBtnStatus" :list="['显示', '隐藏']" @change="showChange"></u-subsection>
2023
</view>
2124
<view class="u-config-item">
22-
<view class="u-item-title">显示错误信息</view>
23-
<u-subsection vibrateShort current="1" :list="['', '']" @change="errorMessageChange"></u-subsection>
25+
<view class="u-item-title">模式</view>
26+
<u-subsection vibrateShort current="1" :list="['单个日期', '日期范围']" @change="modeChange"></u-subsection>
2427
</view>
2528
<view class="u-config-item">
26-
<view class="u-item-title">是否必填</view>
27-
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="requiredChange"></u-subsection>
28-
</view>
29-
<view class="u-config-item">
30-
<view class="u-item-title">显示左图标和右箭头</view>
31-
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="customChange"></u-subsection>
32-
</view>
33-
<view class="u-config-item">
34-
<view class="u-item-title">第一个输入框为textarea类型</view>
35-
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="textareaChange"></u-subsection>
29+
<view class="u-item-title">自定义样式</view>
30+
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
3631
</view>
3732
</view>
3833
</view>
@@ -44,16 +39,13 @@
4439
return {
4540
show: false,
4641
mode: 'range',
47-
arrowType: 1,
48-
minDate: "1920-01-01",
49-
maxDate: "",
50-
btnType: "primary",
51-
activeBgColor: "#2979ff",
52-
rangeBgColor: "rgba(41,121,255,0.13)",
53-
rangeColor: "#2979ff",
54-
startText: "开始",
55-
endText: "结束",
56-
result: ""
42+
result: "请选择日期",
43+
startText: '开始',
44+
endText: '结束',
45+
rangeColor: '#2979ff',
46+
rangeBgColor: 'rgba(41,121,255,0.13)',
47+
activeBgColor: '#2979ff',
48+
btnType: 'primary',
5749
}
5850
},
5951
computed: {
@@ -65,11 +57,27 @@
6557
showChange(index) {
6658
this.show = !index;
6759
},
68-
errorMessageChange(index) {
69-
this.errorMessage = index == 0 ? '手机号有误' : false
60+
modeChange(index) {
61+
this.mode = index == 0 ? 'date' : 'range';
62+
this.show = true;
7063
},
71-
requiredChange(index) {
72-
this.required = index == 0 ? true : false;
64+
styleChange(index) {
65+
if(index == 0) {
66+
this.startText = '住店';
67+
this.endText = '离店';
68+
this.activeBgColor = '#19be6b';
69+
this.rangeColor = '#19be6b';
70+
this.rangeBgColor = 'rgba(25,190,107, 0.13)';
71+
this.btnType = 'success';
72+
} else {
73+
this.startText = '开始';
74+
this.endText = '结束';
75+
this.activeBgColor = '#2979ff';
76+
this.rangeColor = '#2979ff';
77+
this.rangeBgColor = 'rgba(41,121,255,0.13)';
78+
this.btnType = 'primary';
79+
}
80+
this.show = true;
7381
},
7482
customChange(index) {
7583
if(index == 0) {
@@ -86,11 +94,10 @@
8694
this.type = index == 0 ? 'textarea' : 'text';
8795
},
8896
change(e) {
89-
console.log(e)
90-
if (this.type == 1) {
91-
this.result = e.result
97+
if (this.mode == 'range') {
98+
this.result = e.startDate + " - " + e.endDate;
9299
} else {
93-
this.result = `${e.startDate}${e.endDate}`
100+
this.result = e.result;
94101
}
95102
}
96103
}

pages/componentsA/select/index.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
</view>
1010
<view class="u-config-wrap">
1111
<view class="u-config-title u-border-bottom">参数配置</view>
12+
<view class="u-config-item">
13+
<view class="u-item-title">状态</view>
14+
<u-subsection vibrateShort :current="current" :list="['打开', '收起']" @change="statusChange"></u-subsection>
15+
</view>
1216
<view class="u-config-item">
1317
<view class="u-item-title">模式</view>
1418
<u-subsection vibrateShort :list="['单列', '多列独立', '多列联动']" @change="modeChange"></u-subsection>
@@ -173,6 +177,9 @@ export default {
173177
}
174178
},
175179
methods: {
180+
statusChange(index) {
181+
this.show = !index;
182+
},
176183
modeChange(index) {
177184
let type = ['single-column', 'mutil-column', 'mutil-column-auto'];
178185
this.mode = type[index];

pages/componentsC/numberBox/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
66
<u-number-box :value="value" :bg-color="bgColor" :color="color" :min="0"
7-
:step="step" :disabled="disabled"></u-number-box>
7+
:step="step" :disabled="disabled" @change="change"></u-number-box>
88
</view>
99
</view>
1010
<view class="u-config-wrap">
@@ -63,7 +63,8 @@ export default {
6363
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
6464
},
6565
change(e) {
66-
this.value = e.value;
66+
// console.log(e);
67+
// this.value = e.value;
6768
}
6869
}
6970
};

pages/template/citySelect/u-city-select.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<u-cell-group>
1111
<u-cell-item v-for="(item,index) in provinces" :title="item.label" :arrow="false" :index="index" :key="index"
1212
@click="provinceChange">
13-
<u-icon v-show="isChooseP&&province===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
13+
<u-icon v-if="isChooseP&&province===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
1414
</u-cell-item>
1515
</u-cell-group>
1616
</scroll-view>
@@ -19,10 +19,10 @@
1919
<view class="area-item">
2020
<view class="u-padding-10 u-bg-gray" style="height: 100%;">
2121
<scroll-view :scroll-y="true" style="height: 100%">
22-
<u-cell-group v-show="isChooseP">
22+
<u-cell-group v-if="isChooseP">
2323
<u-cell-item v-for="(item,index) in citys" :title="item.label" :arrow="false" :index="index" :key="index"
2424
@click="cityChange">
25-
<u-icon v-show="isChooseC&&city===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
25+
<u-icon v-if="isChooseC&&city===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
2626
</u-cell-item>
2727
</u-cell-group>
2828
</scroll-view>
@@ -32,10 +32,10 @@
3232
<view class="area-item">
3333
<view class="u-padding-10 u-bg-gray" style="height: 100%;">
3434
<scroll-view :scroll-y="true" style="height: 100%">
35-
<u-cell-group v-show="isChooseC">
35+
<u-cell-group v-if="isChooseC">
3636
<u-cell-item v-for="(item,index) in areas" :title="item.label" :arrow="false" :index="index" :key="index"
3737
@click="areaChange">
38-
<u-icon v-show="isChooseA&&area===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
38+
<u-icon v-if="isChooseA&&area===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
3939
</u-cell-item>
4040
</u-cell-group>
4141
</scroll-view>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<view class="u-navbar-inner" :style="[navbarInnerStyle]">
66
<view class="u-back-wrap" v-if="isBack" @tap="goBack">
77
<view class="u-icon-wrap">
8-
<u-icon @click="goBack" :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
8+
<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
99
</view>
1010
<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">
1111
{{backText}}

uview-ui/components/u-number-box/u-number-box.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@
230230
handleChange(value, type) {
231231
if (this.disabled) return;
232232
this.$emit(type, {
233-
value: value,
233+
// 转为Number类型
234+
value: Number(value),
234235
index: this.index
235236
})
236237
}

uview-ui/components/u-read-more/u-read-more.vue

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view class="">
3-
<view class="u-content" :style="{ height: isLongContent && !showMore ? showHeight + 'px' : 'auto' }">
3+
<view class="u-content" :style="{ height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto' }">
44
<slot></slot>
55
</view>
66
<view @tap="toggleReadMore" v-if="isLongContent" class="u-showmore-wrap"
@@ -34,7 +34,7 @@
3434
export default {
3535
name: "u-read-more",
3636
props: {
37-
// 默认的显示占位高度,单位为px
37+
// 默认的显示占位高度,单位为rpx
3838
showHeight: {
3939
type: [Number, String],
4040
default: 400
@@ -102,19 +102,13 @@
102102
},
103103
methods: {
104104
init() {
105-
const query = uni.createSelectorQuery(this).in(this);
106-
query
107-
.select('.u-content')
108-
.boundingClientRect(res => {
109-
if (res) {
110-
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
111-
if (res.height > this.showHeight) {
112-
this.isLongContent = true;
113-
this.showMore = false;
114-
}
115-
}
116-
})
117-
.exec();
105+
this.$uGetRect('.u-content').then(res => {
106+
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
107+
if (res.height > uni.upx2px(this.showHeight)) {
108+
this.isLongContent = true;
109+
this.showMore = false;
110+
}
111+
})
118112
},
119113
// 展开或者收起
120114
toggleReadMore() {

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}, inputStyle]"
3434
/>
3535
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @touchstart="clear">
36-
<u-icon class="u-clear-icon" name="close" :size="16" color="#fff" @touchstart="clear"></u-icon>
36+
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="#c0c4cc"></u-icon>
3737
</view>
3838
</view>
3939
<view :style="[actionStyle]" class="u-action"
@@ -288,12 +288,11 @@ export default {
288288
}
289289
290290
.u-close-wrap {
291-
width: 34rpx;
292-
height: 34rpx;
291+
width: 40rpx;
292+
height: 100%;
293293
display: flex;
294294
align-items: center;
295295
justify-content: center;
296-
background-color: rgb(200, 203, 204);
297296
border-radius: 50%;
298297
}
299298

0 commit comments

Comments
 (0)