Commit 40604f61 authored by wlxuqu's avatar wlxuqu

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. 由于加载问题,阿里,头条,百度小程序的图标改用线上资源
parent d8df8766
......@@ -105,7 +105,8 @@
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
"usingComponents" : true,
"appid" : "17597421"
},
"mp-toutiao" : {
"usingComponents" : true
......
......@@ -6,7 +6,7 @@
// "current": 0, //当前激活的模式(list 的索引项)
// "list": [{
// "name": "test", //模式名称
// "path": "pages/componentsA/form/index", //启动页面,必选
// "path": "pages/components/changelog.html", //启动页面,必选
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
// }]
// },
......
......@@ -3,11 +3,14 @@
<view class="u-demo-wrap" style="background-color: #FFFFFF;">
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-calendar v-model="show" :minDate="minDate" :maxDate="maxDate" :btnType="btnType" :activeBgColor="activeBgColor"
:rangeBgColor="rangeBgColor" :rangeColor="rangeColor" :startText="startText" :endText="endText" :arrowType="arrowType"
:mode="mode" ref="calendar" @change="change">
<u-calendar v-model="show" ref="calendar" @change="change" :mode="mode"
:start-text="startText" :end-text="endText" :range-color="rangeColor"
:range-bg-color="rangeBgColor" :active-bg-color="activeBgColor" :btn-type="btnType"
>
</u-calendar>
<view class="u-demo-result-line">
{{result}}
</view>
</view>
</view>
<view class="u-config-wrap">
......@@ -19,20 +22,12 @@
<u-subsection vibrateShort :current="showBtnStatus" :list="['显示', '隐藏']" @change="showChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示错误信息</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="errorMessageChange"></u-subsection>
<view class="u-item-title">模式</view>
<u-subsection vibrateShort current="1" :list="['单个日期', '日期范围']" @change="modeChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">是否必填</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="requiredChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">显示左图标和右箭头</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="customChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">第一个输入框为textarea类型</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="textareaChange"></u-subsection>
<view class="u-item-title">自定义样式</view>
<u-subsection vibrateShort current="1" :list="['是', '否']" @change="styleChange"></u-subsection>
</view>
</view>
</view>
......@@ -44,16 +39,13 @@
return {
show: false,
mode: 'range',
arrowType: 1,
minDate: "1920-01-01",
maxDate: "",
btnType: "primary",
activeBgColor: "#2979ff",
rangeBgColor: "rgba(41,121,255,0.13)",
rangeColor: "#2979ff",
startText: "开始",
endText: "结束",
result: ""
result: "请选择日期",
startText: '开始',
endText: '结束',
rangeColor: '#2979ff',
rangeBgColor: 'rgba(41,121,255,0.13)',
activeBgColor: '#2979ff',
btnType: 'primary',
}
},
computed: {
......@@ -65,11 +57,27 @@
showChange(index) {
this.show = !index;
},
errorMessageChange(index) {
this.errorMessage = index == 0 ? '手机号有误' : false
modeChange(index) {
this.mode = index == 0 ? 'date' : 'range';
this.show = true;
},
requiredChange(index) {
this.required = index == 0 ? true : false;
styleChange(index) {
if(index == 0) {
this.startText = '住店';
this.endText = '离店';
this.activeBgColor = '#19be6b';
this.rangeColor = '#19be6b';
this.rangeBgColor = 'rgba(25,190,107, 0.13)';
this.btnType = 'success';
} else {
this.startText = '开始';
this.endText = '结束';
this.activeBgColor = '#2979ff';
this.rangeColor = '#2979ff';
this.rangeBgColor = 'rgba(41,121,255,0.13)';
this.btnType = 'primary';
}
this.show = true;
},
customChange(index) {
if(index == 0) {
......@@ -86,11 +94,10 @@
this.type = index == 0 ? 'textarea' : 'text';
},
change(e) {
console.log(e)
if (this.type == 1) {
this.result = e.result
if (this.mode == 'range') {
this.result = e.startDate + " - " + e.endDate;
} else {
this.result = `${e.startDate}${e.endDate}`
this.result = e.result;
}
}
}
......
......@@ -9,6 +9,10 @@
</view>
<view class="u-config-wrap">
<view class="u-config-title u-border-bottom">参数配置</view>
<view class="u-config-item">
<view class="u-item-title">状态</view>
<u-subsection vibrateShort :current="current" :list="['打开', '收起']" @change="statusChange"></u-subsection>
</view>
<view class="u-config-item">
<view class="u-item-title">模式</view>
<u-subsection vibrateShort :list="['单列', '多列独立', '多列联动']" @change="modeChange"></u-subsection>
......@@ -173,6 +177,9 @@ export default {
}
},
methods: {
statusChange(index) {
this.show = !index;
},
modeChange(index) {
let type = ['single-column', 'mutil-column', 'mutil-column-auto'];
this.mode = type[index];
......
......@@ -4,7 +4,7 @@
<view class="u-demo-title">演示效果</view>
<view class="u-demo-area">
<u-number-box :value="value" :bg-color="bgColor" :color="color" :min="0"
:step="step" :disabled="disabled"></u-number-box>
:step="step" :disabled="disabled" @change="change"></u-number-box>
</view>
</view>
<view class="u-config-wrap">
......@@ -63,7 +63,8 @@ export default {
this.step = index == 0 ? 1 : index == 1 ? 3 : index == 2 ? 5 : 8;
},
change(e) {
this.value = e.value;
// console.log(e);
// this.value = e.value;
}
}
};
......
......@@ -10,7 +10,7 @@
<u-cell-group>
<u-cell-item v-for="(item,index) in provinces" :title="item.label" :arrow="false" :index="index" :key="index"
@click="provinceChange">
<u-icon v-show="isChooseP&&province===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
<u-icon v-if="isChooseP&&province===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
</u-cell-item>
</u-cell-group>
</scroll-view>
......@@ -19,10 +19,10 @@
<view class="area-item">
<view class="u-padding-10 u-bg-gray" style="height: 100%;">
<scroll-view :scroll-y="true" style="height: 100%">
<u-cell-group v-show="isChooseP">
<u-cell-group v-if="isChooseP">
<u-cell-item v-for="(item,index) in citys" :title="item.label" :arrow="false" :index="index" :key="index"
@click="cityChange">
<u-icon v-show="isChooseC&&city===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
<u-icon v-if="isChooseC&&city===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
</u-cell-item>
</u-cell-group>
</scroll-view>
......@@ -32,10 +32,10 @@
<view class="area-item">
<view class="u-padding-10 u-bg-gray" style="height: 100%;">
<scroll-view :scroll-y="true" style="height: 100%">
<u-cell-group v-show="isChooseC">
<u-cell-group v-if="isChooseC">
<u-cell-item v-for="(item,index) in areas" :title="item.label" :arrow="false" :index="index" :key="index"
@click="areaChange">
<u-icon v-show="isChooseA&&area===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
<u-icon v-if="isChooseA&&area===index" slot="right-icon" size="34" name="checkbox-mark"></u-icon>
</u-cell-item>
</u-cell-group>
</scroll-view>
......
......@@ -5,7 +5,7 @@
<view class="u-navbar-inner" :style="[navbarInnerStyle]">
<view class="u-back-wrap" v-if="isBack" @tap="goBack">
<view class="u-icon-wrap">
<u-icon @click="goBack" :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
</view>
<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">
{{backText}}
......
......@@ -230,7 +230,8 @@
handleChange(value, type) {
if (this.disabled) return;
this.$emit(type, {
value: value,
// 转为Number类型
value: Number(value),
index: this.index
})
}
......
<template>
<view class="">
<view class="u-content" :style="{ height: isLongContent && !showMore ? showHeight + 'px' : 'auto' }">
<view class="u-content" :style="{ height: isLongContent && !showMore ? showHeight + 'rpx' : 'auto' }">
<slot></slot>
</view>
<view @tap="toggleReadMore" v-if="isLongContent" class="u-showmore-wrap"
......@@ -34,7 +34,7 @@
export default {
name: "u-read-more",
props: {
// 默认的显示占位高度,单位为px
// 默认的显示占位高度,单位为rpx
showHeight: {
type: [Number, String],
default: 400
......@@ -102,19 +102,13 @@
},
methods: {
init() {
const query = uni.createSelectorQuery(this).in(this);
query
.select('.u-content')
.boundingClientRect(res => {
if (res) {
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
if (res.height > this.showHeight) {
this.isLongContent = true;
this.showMore = false;
}
}
})
.exec();
this.$uGetRect('.u-content').then(res => {
// 判断高度,如果真实内容高度大于占位高度,则显示收起与展开的控制按钮
if (res.height > uni.upx2px(this.showHeight)) {
this.isLongContent = true;
this.showMore = false;
}
})
},
// 展开或者收起
toggleReadMore() {
......
......@@ -33,7 +33,7 @@
}, inputStyle]"
/>
<view class="u-close-wrap" v-if="keyword && clearabled && focused" @touchstart="clear">
<u-icon class="u-clear-icon" name="close" :size="16" color="#fff" @touchstart="clear"></u-icon>
<u-icon class="u-clear-icon" name="close-circle-fill" size="34" color="#c0c4cc"></u-icon>
</view>
</view>
<view :style="[actionStyle]" class="u-action"
......@@ -288,12 +288,11 @@ export default {
}
.u-close-wrap {
width: 34rpx;
height: 34rpx;
width: 40rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-color: rgb(200, 203, 204);
border-radius: 50%;
}
......
......@@ -193,7 +193,7 @@ export default {
setSelectValue() {
for(let i = 0; i < this.columnNum; i++) {
this.selectValue.push({
valut: this.columnData[i][this.defaultSelector[i]].value,
value: this.columnData[i][this.defaultSelector[i]].value,
label: this.columnData[i][this.defaultSelector[i]].label,
})
}
......
......@@ -15,7 +15,7 @@
<view class="u-slider__button-wrap" @touchstart="onTouchStart"
@touchmove="onTouchMove" @touchend="onTouchEnd"
@touchcancel="onTouchEnd">
<slot v-if="useSlot"/>
<slot v-if="$slots.default"/>
<view v-else class="u-slider__button" :style="[blockStyle, {
height: blockWidth + 'rpx',
width: blockWidth + 'rpx'
......@@ -40,7 +40,6 @@
* @property {String} blockColor 滑块颜色(默认#ffffff)
* @property {Object} blockStyle 给滑块自定义样式,对象形式
* @property {Boolean} disabled 是否禁用滑块(默认为false)
* @property {Boolean} useSlot 是否使用slot传入自定义滑块(默认为false)
* @event {Function} start 滑动触发
* @event {Function} moving 正在滑动中
* @event {Function} end 滑动结束
......@@ -106,11 +105,6 @@ export default {
return {};
}
},
// 是否传入自定义的按钮slot
useSlot: {
type: Boolean,
default: false
}
},
data() {
return {
......
......@@ -126,9 +126,9 @@ export default {
mounted() {
this.getActionRect();
// 等视图更新完后,再显示右边的可滑动按钮,防止这些按钮会"闪一下"
this.$nextTick(() => {
setTimeout(() => {
this.showBtn = true;
})
}, 10);
},
methods: {
// 点击按钮
......
<template>
<view class="u-swiper-wrap" :style="{
borderRadius: `${borderRadius}rpx`,
backgroundColor: bgColor
borderRadius: `${borderRadius}rpx`
}">
<swiper @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
......@@ -12,7 +11,8 @@
<view class="u-list-image-wrap" :class="[current != index ? 'u-list-scale' : '']" :style="{
borderRadius: `${borderRadius}rpx`,
transform: effect3d && current != index ? 'scaleY(0.9)' : 'scaleY(1)',
margin: effect3d && current != index ? '0 20rpx' : 0
margin: effect3d && current != index ? '0 20rpx' : 0,
backgroundColor: bgColor
}">
<image class="u-swiper-image" :src="item[name]" :mode="imgMode"></image>
<view v-if="title" class="u-swiper-title u-line-1" :style="{
......@@ -158,6 +158,12 @@
default: '#f3f4f6'
}
},
watch: {
// 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置current值,避免溢出
list(nVal, oVal) {
if(nVal.length !== oVal.length) this.current = 0;
}
},
data() {
return {
current: 0 // 当前活跃的swiper-item的index
......
This diff is collapsed.
// 此版本发布于2020-05-26
let version = '1.2.9';
// 此版本发布于2020-06-09
let version = '1.3.2';
export default {
v: version,
......
......@@ -16,7 +16,7 @@ function mobile(value) {
* 验证URL格式
*/
function url(value) {
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i
return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].[a-z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\/?)$/
.test(value)
}
......
......@@ -99,7 +99,6 @@ class Request {
// 默认的请求头
header: {
'content-type': 'application/json;charset=UTF-8',
'version': 1
},
method: 'POST',
// 设置为json,返回后uni.request会对数据进行一次JSON.parse
......
{
"name": "uview-ui",
"version": "1.3.0",
"version": "1.3.2",
"description": "uView UI,是uni-app生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
"main": "index.js",
"keywords": ["uview", "uView", "uni-app", "uni-app ui", "uniapp", "uviewui", "uview ui", "uviewUI", "uViewui", "uViewUI", "uView UI", "uni ui", "uni UI", "uniapp ui", "ui", "UI框架", "uniapp ui框架", "uniapp UI"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment