# 2022-04-07

### 1.4.2开源社区版:
无
### 0.3.4 专业版:
【升级】升级小程序前端框架到uView2.0.30版本。
【修复】修复商品详情斑斓图视频和图片混播的情况下,视频被压缩50%宽度的问题。
【修复】修复注册赠送积分关系处理错误的问题。
【修复】修复微信支付组装订单body超过128字符,导致的生成订单异常的情况。
This commit is contained in:
JianWeie
2022-04-07 21:55:44 +08:00
parent 00e0128346
commit 876625f4c6
30 changed files with 334 additions and 173 deletions

View File

@@ -569,14 +569,26 @@
let products = res.data.product; let products = res.data.product;
_this.goodsInfo = info; _this.goodsInfo = info;
//if (_this.goodsInfo.album && _this.goodsInfo.video) { if (_this.goodsInfo.album) {
// var videoObj = { var albums = [];
// url: _this.goodsInfo.video, for (var i = 0; i < _this.goodsInfo.album.length; i++) {
// poster: _this.goodsInfo.image let album = {
// }; url: _this.goodsInfo.album[i],
// _this.goodsInfo.album.unshift(videoObj); type: 'image'
// _this.autoplay = false; }
//} albums.push(album);
}
_this.goodsInfo.album = albums;
if (_this.goodsInfo.video) {
let videoObj = {
url: _this.goodsInfo.video,
poster: _this.goodsInfo.image,
type: 'video'
}
_this.goodsInfo.album.unshift(videoObj);
_this.autoplay = false;
}
}
_this.isfav = _this.goodsInfo.isfav; _this.isfav = _this.goodsInfo.isfav;
_this.type = _this.goodsInfo.groupType; _this.type = _this.goodsInfo.groupType;
@@ -797,11 +809,11 @@
}, },
// 图片点击放大 // 图片点击放大
clickImg(index) { clickImg(index) {
// 预览图片 if (this.goodsInfo.album[index].type == 'image') {
uni.previewImage({ uni.previewImage({
urls: this.goodsInfo.album, urls: [this.goodsInfo.album[index].url],
current: index
}); });
}
}, },
//在线客服,只有手机号的,请自己替换为手机号 //在线客服,只有手机号的,请自己替换为手机号
showChat() { showChat() {

View File

@@ -708,14 +708,26 @@
_this.goodsInfo = info; _this.goodsInfo = info;
//if (_this.goodsInfo.album && _this.goodsInfo.video) { if (_this.goodsInfo.album) {
// var videoObj = { var albums = [];
// url: _this.goodsInfo.video, for (var i = 0; i < _this.goodsInfo.album.length; i++) {
// poster: _this.goodsInfo.image let album = {
// }; url: _this.goodsInfo.album[i],
// _this.goodsInfo.album.unshift(videoObj); type: 'image'
// _this.autoplay = false; }
//} albums.push(album);
}
_this.goodsInfo.album = albums;
if (_this.goodsInfo.video) {
let videoObj = {
url: _this.goodsInfo.video,
poster: _this.goodsInfo.image,
type: 'video'
}
_this.goodsInfo.album.unshift(videoObj);
_this.autoplay = false;
}
}
_this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2); _this.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
_this.product = _this.spesClassHandle(products); _this.product = _this.spesClassHandle(products);
@@ -947,11 +959,11 @@
}, },
// 图片点击放大 // 图片点击放大
clickImg(index) { clickImg(index) {
// 预览图片 if (this.goodsInfo.album[index].type == 'image') {
uni.previewImage({ uni.previewImage({
urls: this.goodsInfo.album, urls: [this.goodsInfo.album[index].url],
current: index
}); });
}
}, },
//在线客服,只有手机号的,请自己替换为手机号 //在线客服,只有手机号的,请自己替换为手机号
showChat() { showChat() {

View File

@@ -573,14 +573,26 @@
_this.goodsInfo = info; _this.goodsInfo = info;
//if (_this.goodsInfo.album && _this.goodsInfo.video) { if (_this.goodsInfo.album) {
// var videoObj = { var albums = [];
// url: _this.goodsInfo.video, for (var i = 0; i < _this.goodsInfo.album.length; i++) {
// poster: _this.goodsInfo.image let album = {
// }; url: _this.goodsInfo.album[i],
// _this.goodsInfo.album.unshift(videoObj); type: 'image'
// _this.autoplay = false; }
//} albums.push(album);
}
_this.goodsInfo.album = albums;
if (_this.goodsInfo.video) {
let videoObj = {
url: _this.goodsInfo.video,
poster: _this.goodsInfo.image,
type: 'video'
}
_this.goodsInfo.album.unshift(videoObj);
_this.autoplay = false;
}
}
_this.isfav = _this.goodsInfo.isfav; _this.isfav = _this.goodsInfo.isfav;
_this.type = _this.goodsInfo.groupType; _this.type = _this.goodsInfo.groupType;
@@ -800,11 +812,11 @@
}, },
// 图片点击放大 // 图片点击放大
clickImg(index) { clickImg(index) {
// 预览图片 if (this.goodsInfo.album[index].type == 'image') {
uni.previewImage({ uni.previewImage({
urls: this.goodsInfo.album, urls: [this.goodsInfo.album[index].url],
current: index
}); });
}
}, },
//在线客服,只有手机号的,请自己替换为手机号 //在线客服,只有手机号的,请自己替换为手机号
showChat() { showChat() {

View File

@@ -607,14 +607,26 @@
let products = res.data.product; let products = res.data.product;
_this.goodsInfo = info; _this.goodsInfo = info;
//if (_this.goodsInfo.album && _this.goodsInfo.video) { if (_this.goodsInfo.album) {
// var videoObj = { var albums = [];
// url: _this.goodsInfo.video, for (var i = 0; i < _this.goodsInfo.album.length; i++) {
// poster: _this.goodsInfo.image let album = {
// }; url: _this.goodsInfo.album[i],
// _this.goodsInfo.album.unshift(videoObj); type: 'image'
// _this.autoplay = false; }
//} albums.push(album);
}
_this.goodsInfo.album = albums;
if (_this.goodsInfo.video) {
let videoObj = {
url: _this.goodsInfo.video,
poster: _this.goodsInfo.image,
type: 'video'
}
_this.goodsInfo.album.unshift(videoObj);
_this.autoplay = false;
}
}
_this.isfav = res.data.isFav; _this.isfav = res.data.isFav;
_this.product = _this.spesClassHandle(products); _this.product = _this.spesClassHandle(products);
@@ -641,10 +653,26 @@
let products = res.data.product; let products = res.data.product;
_this.goodsInfo = info; _this.goodsInfo = info;
//if (_this.goodsInfo.album && _this.goodsInfo.video) { if (_this.goodsInfo.album) {
// _this.goodsInfo.album.unshift(_this.goodsInfo.video); var albums = [];
// _this.autoplay = false; for (var i = 0; i < _this.goodsInfo.album.length; i++) {
//} let album = {
url: _this.goodsInfo.album[i],
type: 'image'
}
albums.push(album);
}
_this.goodsInfo.album = albums;
if (_this.goodsInfo.video) {
let videoObj = {
url: _this.goodsInfo.video,
poster: _this.goodsInfo.image,
type: 'video'
}
_this.goodsInfo.album.unshift(videoObj);
_this.autoplay = false;
}
}
_this.isfav = res.data.isFav; _this.isfav = res.data.isFav;
_this.product = _this.spesClassHandle(products); _this.product = _this.spesClassHandle(products);
@@ -886,11 +914,11 @@
}, },
// 图片点击放大 // 图片点击放大
clickImg(index) { clickImg(index) {
// 预览图片 if (this.goodsInfo.album[index].type =='image') {
uni.previewImage({ uni.previewImage({
urls: this.goodsInfo.album, urls: [this.goodsInfo.album[index].url],
current: index
}); });
}
}, },
//在线客服,只有手机号的,请自己替换为手机号 //在线客服,只有手机号的,请自己替换为手机号
showChat() { showChat() {

View File

@@ -1,3 +1,28 @@
## 2.0.302022-04-04
# uView2.0重磅发布,利剑出鞘,一统江湖
1. `u-rate`增加`readonly`属性
2. `tabs`滑块支持设置背景图片
3. 修复`u-subsection` `mode``subsection`时,滑块样式不正确的问题
4. `u-code-input`添加光标效果动画
5. 修复`popup``open`事件不触发
6. 修复`u-flex-column`无效的问题
7. 修复`u-datetime-picker`索引在特定场合异常问题
8. 修复`u-datetime-picker`最小时间字符串模板错误问题
9. `u-swiper`添加`m3u8`验证
10. `u-swiper`修改判断image和video逻辑
11. 修复`swiper`无法使用本地图片问题,增加`type`参数
12. 修复`u-row-notice`格式错误问题
13. 修复`u-switch`组件当`unit``rpx`时,`nodeStyle`消失的问题
14. 修复`datetime-picker`组件`showToolbar``visibleItemCount`属性无效的问题
15. 修复`upload`组件条件编译位置判断错误,导致`previewImage`属性设置为`false`时,整个组件都会被隐藏的问题
16. 修复`u-checkbox-group`设置`shape`属性无效的问题
17. 修复`u-upload``capture`传入字符串的时候不生效的问题
18. 修复`u-action-sheet`组件,关闭事件逻辑错误的问题
19. 修复`u-list`触顶事件的触发错误的问题
20. 修复`u-text`只有手机号可拨打的问题
21. 修复`u-textarea`不能换行的问题
22. 其他修复
## 2.0.292022-03-13 ## 2.0.292022-03-13
# uView2.0重磅发布,利剑出鞘,一统江湖 # uView2.0重磅发布,利剑出鞘,一统江湖

View File

@@ -3,8 +3,7 @@
<u-popup <u-popup
:show="show" :show="show"
mode="bottom" mode="bottom"
@close="close" @close="closeHandler"
:closeOnClickOverlay="closeOnClickOverlay"
:safeAreaInsetBottom="safeAreaInsetBottom" :safeAreaInsetBottom="safeAreaInsetBottom"
:round="round" :round="round"
> >
@@ -100,7 +99,7 @@
:hover-stay-time="150" :hover-stay-time="150"
v-if="cancelText" v-if="cancelText"
class="u-action-sheet__cancel-text" class="u-action-sheet__cancel-text"
@tap="close" @tap="cancel"
>{{cancelText}}</text> >{{cancelText}}</text>
</view> </view>
</view> </view>
@@ -167,12 +166,16 @@
}, },
}, },
methods: { methods: {
close() { closeHandler() {
// 允许点击遮罩关闭时才发出close事件 // 允许点击遮罩关闭时才发出close事件
if(this.closeOnClickOverlay) { if(this.closeOnClickOverlay) {
this.$emit('close') this.$emit('close')
} }
}, },
// 点击取消按钮
cancel() {
this.$emit('close')
},
selectHandler(index) { selectHandler(index) {
const item = this.actions[index] const item = this.actions[index]
if (item && !item.disabled && !item.loading) { if (item && !item.disabled && !item.loading) {

View File

@@ -23,6 +23,7 @@
v-if="mode === 'line'" v-if="mode === 'line'"
:style="[lineStyle]" :style="[lineStyle]"
></view> ></view>
<view v-if="codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
</view> </view>
<input <input
:disabled="disabledKeyboard" :disabled="disabledKeyboard"
@@ -166,6 +167,10 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import "../../libs/css/components.scss"; @import "../../libs/css/components.scss";
$u-code-input-cursor-width: 1px;
$u-code-input-cursor-height: 40%;
$u-code-input-cursor-animation-duration: 1s;
$u-code-input-cursor-animation-name: u-cursor-flicker;
.u-code-input { .u-code-input {
@include flex; @include flex;
@@ -176,6 +181,7 @@
@include flex; @include flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative;
&__text { &__text {
font-size: 15px; font-size: 15px;
@@ -197,6 +203,15 @@
width: 40px; width: 40px;
background-color: $u-content-color; background-color: $u-content-color;
} }
&__cursor {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: $u-code-input-cursor-width;
height: $u-code-input-cursor-height;
animation: $u-code-input-cursor-animation-duration u-cursor-flicker infinite;
}
} }
&__input { &__input {
@@ -210,4 +225,16 @@
text-align: left; text-align: left;
} }
} }
@keyframes u-cursor-flicker {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style> </style>

View File

@@ -6,6 +6,8 @@
:columns="columns" :columns="columns"
:title="title" :title="title"
:itemHeight="itemHeight" :itemHeight="itemHeight"
:showToolbar="showToolbar"
:visibleItemCount="visibleItemCount"
:defaultIndex="innerDefaultIndex" :defaultIndex="innerDefaultIndex"
:cancelText="cancelText" :cancelText="cancelText"
:confirmText="confirmText" :confirmText="confirmText"
@@ -148,7 +150,7 @@
let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1) let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1)
let hour = 0, minute = 0 let hour = 0, minute = 0
// 此月份的最大天数 // 此月份的最大天数
const maxDate = dayjs(`${year}-${month}-${date}`).daysInMonth() const maxDate = dayjs(`${year}-${month}`).daysInMonth()
// year-month模式下date不会出现在列中设置为1为了符合后边需要减1的需求 // year-month模式下date不会出现在列中设置为1为了符合后边需要减1的需求
if (this.mode === 'year-month') { if (this.mode === 'year-month') {
date = 1 date = 1
@@ -251,7 +253,7 @@
value = this.minDate value = this.minDate
} else if (!isDateMode && !value) { } else if (!isDateMode && !value) {
// 如果是时间类型,而又没有默认值的话,就用最小时间 // 如果是时间类型,而又没有默认值的话,就用最小时间
value = `${uni.$u.padZero(this.minHour)}:uni.$u.padZero(this.minMinute)}` value = `${uni.$u.padZero(this.minHour)}:${uni.$u.padZero(this.minMinute)}`
} }
// 时间类型 // 时间类型
if (!isDateMode) { if (!isDateMode) {

View File

@@ -139,7 +139,7 @@
// 滚动到底部时触发非nvue有效 // 滚动到底部时触发非nvue有效
scrolltoupper(e) { scrolltoupper(e) {
uni.$u.sleep(30).then(() => { uni.$u.sleep(30).then(() => {
this.$emit('scrolltolower') this.$emit('scrolltoupper')
// 这一句很重要能绝对保证在性功能障碍的webview滚动条到顶时取消偏移值让页面置顶 // 这一句很重要能绝对保证在性功能障碍的webview滚动条到顶时取消偏移值让页面置顶
this.offset = 0 this.offset = 0
}) })

View File

@@ -61,7 +61,7 @@
* @property {Boolean} icon 加载中时是否显示图标(默认 true * @property {Boolean} icon 加载中时是否显示图标(默认 true
* @property {String | Number} fontSize 字体大小(默认 14 * @property {String | Number} fontSize 字体大小(默认 14
* @property {String} color 字体颜色(默认 '#606266' * @property {String} color 字体颜色(默认 '#606266'
* @property {String} loadingIcon 加载前的提示语(默认 'circle' * @property {String} loadingIcon 加载图标(默认 'circle'
* @property {String} loadmoreText 加载前的提示语(默认 '加载更多' * @property {String} loadmoreText 加载前的提示语(默认 '加载更多'
* @property {String} loadingText 加载中提示语(默认 '正在加载...' * @property {String} loadingText 加载中提示语(默认 '正在加载...'
* @property {String} nomoreText 没有更多的提示语(默认 '没有更多了' * @property {String} nomoreText 没有更多的提示语(默认 '没有更多了'

View File

@@ -13,7 +13,7 @@
:customStyle="transitionStyle" :customStyle="transitionStyle"
:mode="position" :mode="position"
:duration="duration" :duration="duration"
@after-enter="afterEnter" @afterEnter="afterEnter"
@click="clickHandler" @click="clickHandler"
> >
<view <view

View File

@@ -15,6 +15,11 @@ export default {
type: Boolean, type: Boolean,
default: uni.$u.props.rate.disabled default: uni.$u.props.rate.disabled
}, },
// 是否只读
readonly: {
type: Boolean,
default: uni.$u.props.rate.readonly
},
// 星星的大小单位px // 星星的大小单位px
size: { size: {
type: [String, Number], type: [String, Number],

View File

@@ -86,6 +86,7 @@
* @property {String | Number} value 用于v-model双向绑定选中的星星数量 (默认 1 ) * @property {String | Number} value 用于v-model双向绑定选中的星星数量 (默认 1 )
* @property {String | Number} count 最多可选的星星数量 (默认 5 * @property {String | Number} count 最多可选的星星数量 (默认 5
* @property {Boolean} disabled 是否禁止用户操作 (默认 false * @property {Boolean} disabled 是否禁止用户操作 (默认 false
* @property {Boolean} readonly 是否只读 (默认 false
* @property {String | Number} size 星星的大小单位px (默认 18 * @property {String | Number} size 星星的大小单位px (默认 18
* @property {String} inactiveColor 未选中星星的颜色 (默认 '#b2b2b2' * @property {String} inactiveColor 未选中星星的颜色 (默认 '#b2b2b2'
* @property {String} activeColor 选中的星星颜色 (默认 '#FA3534' * @property {String} activeColor 选中的星星颜色 (默认 '#FA3534'
@@ -206,7 +207,7 @@
}, },
// 获取当前激活的评分图标 // 获取当前激活的评分图标
getActiveIndex(x,isClick = false) { getActiveIndex(x,isClick = false) {
if (this.disabled) { if (this.disabled || this.readonly) {
return; return;
} }
// 判断当前操作的点的x坐标值是否在允许的边界范围内 // 判断当前操作的点的x坐标值是否在允许的边界范围内

View File

@@ -97,7 +97,7 @@
} }
}, },
fontSize() { fontSize() {
t // #ifdef APP-NVUE // #ifdef APP-NVUE
this.nvueInit = true this.nvueInit = true
// #endif // #endif
// #ifndef APP-NVUE // #ifndef APP-NVUE

View File

@@ -15,10 +15,10 @@
mode === 'subsection' && mode === 'subsection' &&
'u-subsection__bar--first', 'u-subsection__bar--first',
current > 0 && current > 0 &&
current < this.list.length - 1 && current < list.length - 1 &&
mode === 'subsection' && mode === 'subsection' &&
'u-subsection__bar--center', 'u-subsection__bar--center',
current === this.list.length - 1 && current === list.length - 1 &&
mode === 'subsection' && mode === 'subsection' &&
'u-subsection__bar--last', 'u-subsection__bar--last',
]" ]"

View File

@@ -44,7 +44,7 @@
<!-- 在nvue中image图片的宽度默认为屏幕宽度需要通过flex:1撑开另外必须设置高度才能显示图片 --> <!-- 在nvue中image图片的宽度默认为屏幕宽度需要通过flex:1撑开另外必须设置高度才能显示图片 -->
<image <image
class="u-swiper__wrapper__item__wrapper__image" class="u-swiper__wrapper__item__wrapper__image"
v-if="$u.test.image(getSource(item))" v-if="getItemType(item) === 'image'"
:src="getSource(item)" :src="getSource(item)"
:mode="imgMode" :mode="imgMode"
@tap="clickHandler(index)" @tap="clickHandler(index)"
@@ -55,7 +55,7 @@
></image> ></image>
<video <video
class="u-swiper__wrapper__item__wrapper__video" class="u-swiper__wrapper__item__wrapper__video"
v-if="$u.test.video(getSource(item))" v-if="getItemType(item) === 'video'"
:id="`video-${index}`" :id="`video-${index}`"
:enable-progress-gesture="false" :enable-progress-gesture="false"
:src="getSource(item)" :src="getSource(item)"
@@ -154,6 +154,15 @@
} }
}, },
methods: { methods: {
getItemType(item) {
if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
if (typeof item === 'object' && this.keyName) {
if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'
if (item.type === 'image') return 'image'
if (item.type === 'video') return 'video'
return 'image'
}
},
// 获取目标路径可能数组中为字符串对象的形式额外可指定对象的目标属性名keyName // 获取目标路径可能数组中为字符串对象的形式额外可指定对象的目标属性名keyName
getSource(item) { getSource(item) {
if (typeof item === 'string') return item if (typeof item === 'string') return item

View File

@@ -67,6 +67,9 @@
} }
}, },
computed: { computed: {
isActive(){
return this.value === this.activeValue;
},
switchStyle() { switchStyle() {
let style = {} let style = {}
// 这里需要加2是为了腾出边框的距离否则圆点node会和外边框紧贴在一起 // 这里需要加2是为了腾出边框的距离否则圆点node会和外边框紧贴在一起
@@ -78,7 +81,7 @@
if(this.customInactiveColor) { if(this.customInactiveColor) {
style.borderColor = 'rgba(0, 0, 0, 0)' style.borderColor = 'rgba(0, 0, 0, 0)'
} }
style.backgroundColor = this.value === this.activeValue ? this.activeColor : this.inactiveColor style.backgroundColor = this.isActive ? this.activeColor : this.inactiveColor
return style; return style;
}, },
nodeStyle() { nodeStyle() {
@@ -86,7 +89,8 @@
// 如果自定义非激活颜色将node圆点的尺寸减少两个像素让其与外边框距离更大一点 // 如果自定义非激活颜色将node圆点的尺寸减少两个像素让其与外边框距离更大一点
style.width = uni.$u.addUnit(this.size - this.space) style.width = uni.$u.addUnit(this.size - this.space)
style.height = uni.$u.addUnit(this.size - this.space) style.height = uni.$u.addUnit(this.size - this.space)
style.transform = `translateX(${this.value === this.activeValue ? -this.space : -this.size}px)` const translateX = this.isActive ? uni.$u.addUnit(this.space) : uni.$u.addUnit(this.size);
style.transform = `translateX(-${translateX})`
return style return style
}, },
bgStyle() { bgStyle() {
@@ -96,7 +100,7 @@
style.height = uni.$u.addUnit(this.size) style.height = uni.$u.addUnit(this.size)
style.backgroundColor = this.inactiveColor style.backgroundColor = this.inactiveColor
// 打开时,让此元素收缩,否则反之 // 打开时,让此元素收缩,否则反之
style.transform = `scale(${this.value === this.activeValue ? 0 : 1})` style.transform = `scale(${this.isActive ? 0 : 1})`
return style return style
}, },
customInactiveColor() { customInactiveColor() {
@@ -107,7 +111,7 @@
methods: { methods: {
clickHandler() { clickHandler() {
if (!this.disabled && !this.loading) { if (!this.disabled && !this.loading) {
const oldValue = this.value === this.activeValue ? this.inactiveValue : this.activeValue const oldValue = this.isActive ? this.inactiveValue : this.activeValue
if(!this.asyncChange) { if(!this.asyncChange) {
this.$emit('input', oldValue) this.$emit('input', oldValue)
} }

View File

@@ -35,6 +35,11 @@ export default {
type: [String, Number], type: [String, Number],
default: uni.$u.props.tabs.lineHeight default: uni.$u.props.tabs.lineHeight
}, },
// 滑块背景显示大小,当滑块背景设置为图片时使用
lineBgSize: {
type: String,
default: uni.$u.props.tabs.lineBgSize
},
// 菜单item的样式 // 菜单item的样式
itemStyle: { itemStyle: {
type: [String, Object], type: [String, Object],

View File

@@ -51,7 +51,8 @@
:style="[{ :style="[{
width: $u.addUnit(lineWidth), width: $u.addUnit(lineWidth),
height: $u.addUnit(lineHeight), height: $u.addUnit(lineHeight),
backgroundColor: lineColor background: lineColor,
backgroundSize: lineBgSize,
}]" }]"
> >
<!-- #endif --> <!-- #endif -->
@@ -64,7 +65,8 @@
transform: `translate(${lineOffsetLeft}px)`, transform: `translate(${lineOffsetLeft}px)`,
transitionDuration: `${firstTime ? 0 : duration}ms`, transitionDuration: `${firstTime ? 0 : duration}ms`,
height: $u.addUnit(lineHeight), height: $u.addUnit(lineHeight),
backgroundColor: lineColor background: lineColor,
backgroundSize: lineBgSize,
}]" }]"
> >
<!-- #endif --> <!-- #endif -->
@@ -338,7 +340,7 @@
&__line { &__line {
height: 3px; height: 3px;
background-color: $u-primary; background: $u-primary;
width: 30px; width: 30px;
position: absolute; position: absolute;
bottom: 2px; bottom: 2px;

View File

@@ -146,7 +146,7 @@ export default {
methods: { methods: {
clickHandler() { clickHandler() {
// 如果为手机号模式,拨打电话 // 如果为手机号模式,拨打电话
if (this.call && this.mode === 'phone' && uni.$u.test.mobile(this.text)) { if (this.call && this.mode === 'phone') {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: this.text phoneNumber: this.text
}) })

View File

@@ -36,7 +36,7 @@ export default {
return uni.$u.timeFormat(text, 'yyyy-mm-dd') return uni.$u.timeFormat(text, 'yyyy-mm-dd')
} if (mode === 'phone') { } if (mode === 'phone') {
// 判断是否合法的手机号 // 判断是否合法的手机号
!uni.$u.test.mobile(text) && uni.$u.error('手机号模式下text参数需要为手机号码格式') // !uni.$u.test.mobile(text) && uni.$u.error('手机号模式下text参数需要为手机号码格式')
if (uni.$u.test.func(format)) { if (uni.$u.test.func(format)) {
// 如果用户传入的是函数,使用函数格式化 // 如果用户传入的是函数,使用函数格式化
return format(text) return format(text)

View File

@@ -41,10 +41,11 @@ export default {
// #ifdef H5 // #ifdef H5
await uni.$u.sleep(20) await uni.$u.sleep(20)
// #endif // #endif
// 标识动画尚未结束
this.$emit('enter')
this.transitionEnded = false
// 组件动画进入后触发的事件 // 组件动画进入后触发的事件
this.$emit('afterEnter') this.$emit('afterEnter')
// 标识动画尚未结束
this.transitionEnded = false
// 赋予组件enter-to类名 // 赋予组件enter-to类名
this.classes = classNames['enter-to'] this.classes = classNames['enter-to']
}) })
@@ -61,8 +62,9 @@ export default {
this.classes = classNames.leave this.classes = classNames.leave
this.$nextTick(() => { this.$nextTick(() => {
// 标记动画已经结束了 // 动画正在离场的状态
this.transitionEnded = false this.transitionEnded = false
this.$emit('leave')
// 组件执行动画,到了执行的执行时间后,执行一些额外处理 // 组件执行动画,到了执行的执行时间后,执行一些额外处理
setTimeout(this.onTransitionEnd, this.duration) setTimeout(this.onTransitionEnd, this.duration)
this.classes = classNames['leave-to'] this.classes = classNames['leave-to']

View File

@@ -1,6 +1,7 @@
<template> <template>
<view class="u-upload" :style="[$u.addStyle(customStyle)]"> <view class="u-upload" :style="[$u.addStyle(customStyle)]">
<view class="u-upload__wrap" v-if="previewImage"> <view class="u-upload__wrap" >
<template v-if="previewImage">
<view <view
class="u-upload__wrap__preview" class="u-upload__wrap__preview"
v-for="(item, index) in lists" v-for="(item, index) in lists"
@@ -85,6 +86,9 @@
<!-- #endif --> <!-- #endif -->
</view> </view>
</view> </view>
</template>
<template v-if="isInCount"> <template v-if="isInCount">
<view <view
v-if="$slots.default || $slots.$default" v-if="$slots.default || $slots.$default"
@@ -205,11 +209,18 @@
disabled disabled
} = this; } = this;
if (disabled) return; if (disabled) return;
// 如果用户传入的是字符串,需要格式化成数组
let capture;
try {
capture = uni.$u.test.array(this.capture) ? this.capture : this.capture.split(',');
}catch(e) {
capture = [];
}
chooseFile( chooseFile(
Object.assign({ Object.assign({
accept: this.accept, accept: this.accept,
multiple: this.multiple, multiple: this.multiple,
capture: this.capture, capture: capture,
compressed: this.compressed, compressed: this.compressed,
maxDuration: this.maxDuration, maxDuration: this.maxDuration,
sizeType: this.sizeType, sizeType: this.sizeType,

View File

@@ -1,5 +1,5 @@
// 此版本发布于2022-03-13 // 此版本发布于2022-04-04
const version = '2.0.29' const version = '2.0.30'
// 开发环境才提示,生产环境不会提示 // 开发环境才提示,生产环境不会提示
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {

View File

@@ -11,7 +11,7 @@ export default {
// checkbox组件 // checkbox组件
checkbox: { checkbox: {
name: '', name: '',
shape: 'square', shape: '',
size: '', size: '',
checkbox: false, checkbox: false,
disabled: '', disabled: '',

View File

@@ -21,6 +21,7 @@ export default {
}), }),
lineWidth: 20, lineWidth: 20,
lineHeight: 3, lineHeight: 3,
lineBgSize: 'cover',
itemStyle: () => ({ itemStyle: () => ({
height: '44px' height: '44px'
}), }),

View File

@@ -15,7 +15,7 @@ export default {
placeholderClass: 'textarea-placeholder', placeholderClass: 'textarea-placeholder',
placeholderStyle: 'color: #c0c4cc', placeholderStyle: 'color: #c0c4cc',
height: 70, height: 70,
confirmType: 'done', confirmType: '',
disabled: false, disabled: false,
count: false, count: false,
focus: false, focus: false,

View File

@@ -36,7 +36,7 @@
.u-flex-y, .u-flex-y,
.u-flex-column { .u-flex-column {
@include flex('column'); @include flex(column);
} }
.u-flex-x-center { .u-flex-x-center {

View File

@@ -232,9 +232,9 @@ function promise(value) {
* @param {Object} value * @param {Object} value
*/ */
function image(value) { function image(value) {
// 由于有很多图片链接并不是.jpg等结尾而是带有很多get参数故不能采用判断扩展名的形式只能简单的判断是否为http开头 const newValue = value.split('?')[0]
const IMAGE_REGEXP = /^http/i const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i
return IMAGE_REGEXP.test(value) return IMAGE_REGEXP.test(newValue)
} }
/** /**
@@ -242,7 +242,7 @@ function image(value) {
* @param {Object} value * @param {Object} value
*/ */
function video(value) { function video(value) {
const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i
return VIDEO_REGEXP.test(value) return VIDEO_REGEXP.test(value)
} }

View File

@@ -2,7 +2,7 @@
"id": "uview-ui", "id": "uview-ui",
"name": "uview-ui", "name": "uview-ui",
"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖", "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
"version": "2.0.29", "version": "2.0.30",
"description": "uView UI已完美兼容nvue全面的组件和便捷的工具会让您信手拈来如鱼得水", "description": "uView UI已完美兼容nvue全面的组件和便捷的工具会让您信手拈来如鱼得水",
"keywords": [ "keywords": [
"uview", "uview",