mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:53:27 +08:00
# 2022-04-07
### 1.4.2开源社区版: 无 ### 0.3.4 专业版: 【升级】升级小程序前端框架到uView2.0.30版本。 【修复】修复商品详情斑斓图视频和图片混播的情况下,视频被压缩50%宽度的问题。 【修复】修复注册赠送积分关系处理错误的问题。 【修复】修复微信支付组装订单body超过128字符,导致的生成订单异常的情况。
This commit is contained in:
@@ -569,14 +569,26 @@
|
||||
let products = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
|
||||
//if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
// var videoObj = {
|
||||
// url: _this.goodsInfo.video,
|
||||
// poster: _this.goodsInfo.image
|
||||
// };
|
||||
// _this.goodsInfo.album.unshift(videoObj);
|
||||
// _this.autoplay = false;
|
||||
//}
|
||||
if (_this.goodsInfo.album) {
|
||||
var albums = [];
|
||||
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 = _this.goodsInfo.isfav;
|
||||
_this.type = _this.goodsInfo.groupType;
|
||||
@@ -797,11 +809,11 @@
|
||||
},
|
||||
// 图片点击放大
|
||||
clickImg(index) {
|
||||
// 预览图片
|
||||
uni.previewImage({
|
||||
urls: this.goodsInfo.album,
|
||||
current: index
|
||||
});
|
||||
if (this.goodsInfo.album[index].type == 'image') {
|
||||
uni.previewImage({
|
||||
urls: [this.goodsInfo.album[index].url],
|
||||
});
|
||||
}
|
||||
},
|
||||
//在线客服,只有手机号的,请自己替换为手机号
|
||||
showChat() {
|
||||
|
||||
@@ -708,14 +708,26 @@
|
||||
|
||||
_this.goodsInfo = info;
|
||||
|
||||
//if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
// var videoObj = {
|
||||
// url: _this.goodsInfo.video,
|
||||
// poster: _this.goodsInfo.image
|
||||
// };
|
||||
// _this.goodsInfo.album.unshift(videoObj);
|
||||
// _this.autoplay = false;
|
||||
//}
|
||||
if (_this.goodsInfo.album) {
|
||||
var albums = [];
|
||||
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.discountAmount = parseFloat(info.pinTuanRule.discountAmount).toFixed(2);
|
||||
_this.product = _this.spesClassHandle(products);
|
||||
@@ -947,11 +959,11 @@
|
||||
},
|
||||
// 图片点击放大
|
||||
clickImg(index) {
|
||||
// 预览图片
|
||||
uni.previewImage({
|
||||
urls: this.goodsInfo.album,
|
||||
current: index
|
||||
});
|
||||
if (this.goodsInfo.album[index].type == 'image') {
|
||||
uni.previewImage({
|
||||
urls: [this.goodsInfo.album[index].url],
|
||||
});
|
||||
}
|
||||
},
|
||||
//在线客服,只有手机号的,请自己替换为手机号
|
||||
showChat() {
|
||||
|
||||
@@ -573,14 +573,26 @@
|
||||
|
||||
_this.goodsInfo = info;
|
||||
|
||||
//if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
// var videoObj = {
|
||||
// url: _this.goodsInfo.video,
|
||||
// poster: _this.goodsInfo.image
|
||||
// };
|
||||
// _this.goodsInfo.album.unshift(videoObj);
|
||||
// _this.autoplay = false;
|
||||
//}
|
||||
if (_this.goodsInfo.album) {
|
||||
var albums = [];
|
||||
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 = _this.goodsInfo.isfav;
|
||||
_this.type = _this.goodsInfo.groupType;
|
||||
@@ -800,11 +812,11 @@
|
||||
},
|
||||
// 图片点击放大
|
||||
clickImg(index) {
|
||||
// 预览图片
|
||||
uni.previewImage({
|
||||
urls: this.goodsInfo.album,
|
||||
current: index
|
||||
});
|
||||
if (this.goodsInfo.album[index].type == 'image') {
|
||||
uni.previewImage({
|
||||
urls: [this.goodsInfo.album[index].url],
|
||||
});
|
||||
}
|
||||
},
|
||||
//在线客服,只有手机号的,请自己替换为手机号
|
||||
showChat() {
|
||||
|
||||
@@ -607,14 +607,26 @@
|
||||
let products = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
|
||||
//if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
// var videoObj = {
|
||||
// url: _this.goodsInfo.video,
|
||||
// poster: _this.goodsInfo.image
|
||||
// };
|
||||
// _this.goodsInfo.album.unshift(videoObj);
|
||||
// _this.autoplay = false;
|
||||
//}
|
||||
if (_this.goodsInfo.album) {
|
||||
var albums = [];
|
||||
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.product = _this.spesClassHandle(products);
|
||||
@@ -641,10 +653,26 @@
|
||||
let products = res.data.product;
|
||||
_this.goodsInfo = info;
|
||||
|
||||
//if (_this.goodsInfo.album && _this.goodsInfo.video) {
|
||||
// _this.goodsInfo.album.unshift(_this.goodsInfo.video);
|
||||
// _this.autoplay = false;
|
||||
//}
|
||||
if (_this.goodsInfo.album) {
|
||||
var albums = [];
|
||||
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.product = _this.spesClassHandle(products);
|
||||
@@ -886,11 +914,11 @@
|
||||
},
|
||||
// 图片点击放大
|
||||
clickImg(index) {
|
||||
// 预览图片
|
||||
uni.previewImage({
|
||||
urls: this.goodsInfo.album,
|
||||
current: index
|
||||
});
|
||||
if (this.goodsInfo.album[index].type =='image') {
|
||||
uni.previewImage({
|
||||
urls: [this.goodsInfo.album[index].url],
|
||||
});
|
||||
}
|
||||
},
|
||||
//在线客服,只有手机号的,请自己替换为手机号
|
||||
showChat() {
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
## 2.0.30(2022-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.29(2022-03-13)
|
||||
# uView2.0重磅发布,利剑出鞘,一统江湖
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
<u-popup
|
||||
:show="show"
|
||||
mode="bottom"
|
||||
@close="close"
|
||||
:closeOnClickOverlay="closeOnClickOverlay"
|
||||
@close="closeHandler"
|
||||
:safeAreaInsetBottom="safeAreaInsetBottom"
|
||||
:round="round"
|
||||
>
|
||||
@@ -100,7 +99,7 @@
|
||||
:hover-stay-time="150"
|
||||
v-if="cancelText"
|
||||
class="u-action-sheet__cancel-text"
|
||||
@tap="close"
|
||||
@tap="cancel"
|
||||
>{{cancelText}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -167,12 +166,16 @@
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
closeHandler() {
|
||||
// 允许点击遮罩关闭时,才发出close事件
|
||||
if(this.closeOnClickOverlay) {
|
||||
this.$emit('close')
|
||||
}
|
||||
},
|
||||
// 点击取消按钮
|
||||
cancel() {
|
||||
this.$emit('close')
|
||||
},
|
||||
selectHandler(index) {
|
||||
const item = this.actions[index]
|
||||
if (item && !item.disabled && !item.loading) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
v-if="mode === 'line'"
|
||||
:style="[lineStyle]"
|
||||
></view>
|
||||
<view v-if="codeArray.length === index" :style="{backgroundColor: color}" class="u-code-input__item__cursor"></view>
|
||||
</view>
|
||||
<input
|
||||
:disabled="disabledKeyboard"
|
||||
@@ -166,6 +167,10 @@
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@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 {
|
||||
@include flex;
|
||||
@@ -176,6 +181,7 @@
|
||||
@include flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
&__text {
|
||||
font-size: 15px;
|
||||
@@ -197,6 +203,15 @@
|
||||
width: 40px;
|
||||
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 {
|
||||
@@ -210,4 +225,16 @@
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes u-cursor-flicker {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
:columns="columns"
|
||||
:title="title"
|
||||
:itemHeight="itemHeight"
|
||||
:showToolbar="showToolbar"
|
||||
:visibleItemCount="visibleItemCount"
|
||||
:defaultIndex="innerDefaultIndex"
|
||||
:cancelText="cancelText"
|
||||
:confirmText="confirmText"
|
||||
@@ -148,7 +150,7 @@
|
||||
let date = parseInt(values[2] ? this.intercept(values[2][indexs[2]]) : 1)
|
||||
let hour = 0, minute = 0
|
||||
// 此月份的最大天数
|
||||
const maxDate = dayjs(`${year}-${month}-${date}`).daysInMonth()
|
||||
const maxDate = dayjs(`${year}-${month}`).daysInMonth()
|
||||
// year-month模式下,date不会出现在列中,设置为1,为了符合后边需要减1的需求
|
||||
if (this.mode === 'year-month') {
|
||||
date = 1
|
||||
@@ -251,7 +253,7 @@
|
||||
value = this.minDate
|
||||
} 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) {
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
// 滚动到底部时触发,非nvue有效
|
||||
scrolltoupper(e) {
|
||||
uni.$u.sleep(30).then(() => {
|
||||
this.$emit('scrolltolower')
|
||||
this.$emit('scrolltoupper')
|
||||
// 这一句很重要,能绝对保证在性功能障碍的webview,滚动条到顶时,取消偏移值,让页面置顶
|
||||
this.offset = 0
|
||||
})
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
* @property {Boolean} icon 加载中时是否显示图标(默认 true )
|
||||
* @property {String | Number} fontSize 字体大小(默认 14 )
|
||||
* @property {String} color 字体颜色(默认 '#606266' )
|
||||
* @property {String} loadingIcon 加载前的提示语(默认 'circle' )
|
||||
* @property {String} loadingIcon 加载图标(默认 'circle' )
|
||||
* @property {String} loadmoreText 加载前的提示语(默认 '加载更多' )
|
||||
* @property {String} loadingText 加载中提示语(默认 '正在加载...' )
|
||||
* @property {String} nomoreText 没有更多的提示语(默认 '没有更多了' )
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
:customStyle="transitionStyle"
|
||||
:mode="position"
|
||||
:duration="duration"
|
||||
@after-enter="afterEnter"
|
||||
@afterEnter="afterEnter"
|
||||
@click="clickHandler"
|
||||
>
|
||||
<view
|
||||
|
||||
@@ -15,6 +15,11 @@ export default {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.rate.disabled
|
||||
},
|
||||
// 是否只读
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: uni.$u.props.rate.readonly
|
||||
},
|
||||
// 星星的大小,单位px
|
||||
size: {
|
||||
type: [String, Number],
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
* @property {String | Number} value 用于v-model双向绑定选中的星星数量 (默认 1 )
|
||||
* @property {String | Number} count 最多可选的星星数量 (默认 5 )
|
||||
* @property {Boolean} disabled 是否禁止用户操作 (默认 false )
|
||||
* @property {Boolean} readonly 是否只读 (默认 false )
|
||||
* @property {String | Number} size 星星的大小,单位px (默认 18 )
|
||||
* @property {String} inactiveColor 未选中星星的颜色 (默认 '#b2b2b2' )
|
||||
* @property {String} activeColor 选中的星星颜色 (默认 '#FA3534' )
|
||||
@@ -206,7 +207,7 @@
|
||||
},
|
||||
// 获取当前激活的评分图标
|
||||
getActiveIndex(x,isClick = false) {
|
||||
if (this.disabled) {
|
||||
if (this.disabled || this.readonly) {
|
||||
return;
|
||||
}
|
||||
// 判断当前操作的点的x坐标值,是否在允许的边界范围内
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
},
|
||||
fontSize() {
|
||||
t // #ifdef APP-NVUE
|
||||
// #ifdef APP-NVUE
|
||||
this.nvueInit = true
|
||||
// #endif
|
||||
// #ifndef APP-NVUE
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
mode === 'subsection' &&
|
||||
'u-subsection__bar--first',
|
||||
current > 0 &&
|
||||
current < this.list.length - 1 &&
|
||||
current < list.length - 1 &&
|
||||
mode === 'subsection' &&
|
||||
'u-subsection__bar--center',
|
||||
current === this.list.length - 1 &&
|
||||
current === list.length - 1 &&
|
||||
mode === 'subsection' &&
|
||||
'u-subsection__bar--last',
|
||||
]"
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<!-- 在nvue中,image图片的宽度默认为屏幕宽度,需要通过flex:1撑开,另外必须设置高度才能显示图片 -->
|
||||
<image
|
||||
class="u-swiper__wrapper__item__wrapper__image"
|
||||
v-if="$u.test.image(getSource(item))"
|
||||
v-if="getItemType(item) === 'image'"
|
||||
:src="getSource(item)"
|
||||
:mode="imgMode"
|
||||
@tap="clickHandler(index)"
|
||||
@@ -55,7 +55,7 @@
|
||||
></image>
|
||||
<video
|
||||
class="u-swiper__wrapper__item__wrapper__video"
|
||||
v-if="$u.test.video(getSource(item))"
|
||||
v-if="getItemType(item) === 'video'"
|
||||
:id="`video-${index}`"
|
||||
:enable-progress-gesture="false"
|
||||
:src="getSource(item)"
|
||||
@@ -154,6 +154,15 @@
|
||||
}
|
||||
},
|
||||
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
|
||||
getSource(item) {
|
||||
if (typeof item === 'string') return item
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isActive(){
|
||||
return this.value === this.activeValue;
|
||||
},
|
||||
switchStyle() {
|
||||
let style = {}
|
||||
// 这里需要加2,是为了腾出边框的距离,否则圆点node会和外边框紧贴在一起
|
||||
@@ -78,7 +81,7 @@
|
||||
if(this.customInactiveColor) {
|
||||
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;
|
||||
},
|
||||
nodeStyle() {
|
||||
@@ -86,7 +89,8 @@
|
||||
// 如果自定义非激活颜色,将node圆点的尺寸减少两个像素,让其与外边框距离更大一点
|
||||
style.width = 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
|
||||
},
|
||||
bgStyle() {
|
||||
@@ -96,7 +100,7 @@
|
||||
style.height = uni.$u.addUnit(this.size)
|
||||
style.backgroundColor = this.inactiveColor
|
||||
// 打开时,让此元素收缩,否则反之
|
||||
style.transform = `scale(${this.value === this.activeValue ? 0 : 1})`
|
||||
style.transform = `scale(${this.isActive ? 0 : 1})`
|
||||
return style
|
||||
},
|
||||
customInactiveColor() {
|
||||
@@ -107,7 +111,7 @@
|
||||
methods: {
|
||||
clickHandler() {
|
||||
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) {
|
||||
this.$emit('input', oldValue)
|
||||
}
|
||||
|
||||
@@ -35,6 +35,11 @@ export default {
|
||||
type: [String, Number],
|
||||
default: uni.$u.props.tabs.lineHeight
|
||||
},
|
||||
// 滑块背景显示大小,当滑块背景设置为图片时使用
|
||||
lineBgSize: {
|
||||
type: String,
|
||||
default: uni.$u.props.tabs.lineBgSize
|
||||
},
|
||||
// 菜单item的样式
|
||||
itemStyle: {
|
||||
type: [String, Object],
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
:style="[{
|
||||
width: $u.addUnit(lineWidth),
|
||||
height: $u.addUnit(lineHeight),
|
||||
backgroundColor: lineColor
|
||||
background: lineColor,
|
||||
backgroundSize: lineBgSize,
|
||||
}]"
|
||||
>
|
||||
<!-- #endif -->
|
||||
@@ -64,7 +65,8 @@
|
||||
transform: `translate(${lineOffsetLeft}px)`,
|
||||
transitionDuration: `${firstTime ? 0 : duration}ms`,
|
||||
height: $u.addUnit(lineHeight),
|
||||
backgroundColor: lineColor
|
||||
background: lineColor,
|
||||
backgroundSize: lineBgSize,
|
||||
}]"
|
||||
>
|
||||
<!-- #endif -->
|
||||
@@ -338,7 +340,7 @@
|
||||
|
||||
&__line {
|
||||
height: 3px;
|
||||
background-color: $u-primary;
|
||||
background: $u-primary;
|
||||
width: 30px;
|
||||
position: absolute;
|
||||
bottom: 2px;
|
||||
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
methods: {
|
||||
clickHandler() {
|
||||
// 如果为手机号模式,拨打电话
|
||||
if (this.call && this.mode === 'phone' && uni.$u.test.mobile(this.text)) {
|
||||
if (this.call && this.mode === 'phone') {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.text
|
||||
})
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
return uni.$u.timeFormat(text, 'yyyy-mm-dd')
|
||||
} 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)) {
|
||||
// 如果用户传入的是函数,使用函数格式化
|
||||
return format(text)
|
||||
|
||||
@@ -41,10 +41,11 @@ export default {
|
||||
// #ifdef H5
|
||||
await uni.$u.sleep(20)
|
||||
// #endif
|
||||
// 组件动画进入后触发的事件
|
||||
this.$emit('afterEnter')
|
||||
// 标识动画尚未结束
|
||||
this.$emit('enter')
|
||||
this.transitionEnded = false
|
||||
// 组件动画进入后触发的事件
|
||||
this.$emit('afterEnter')
|
||||
// 赋予组件enter-to类名
|
||||
this.classes = classNames['enter-to']
|
||||
})
|
||||
@@ -61,8 +62,9 @@ export default {
|
||||
this.classes = classNames.leave
|
||||
|
||||
this.$nextTick(() => {
|
||||
// 标记动画已经结束了
|
||||
this.transitionEnded = false
|
||||
// 动画正在离场的状态
|
||||
this.transitionEnded = false
|
||||
this.$emit('leave')
|
||||
// 组件执行动画,到了执行的执行时间后,执行一些额外处理
|
||||
setTimeout(this.onTransitionEnd, this.duration)
|
||||
this.classes = classNames['leave-to']
|
||||
|
||||
@@ -1,90 +1,94 @@
|
||||
<template>
|
||||
<view class="u-upload" :style="[$u.addStyle(customStyle)]">
|
||||
<view class="u-upload__wrap" v-if="previewImage">
|
||||
<view
|
||||
class="u-upload__wrap__preview"
|
||||
v-for="(item, index) in lists"
|
||||
:key="index"
|
||||
>
|
||||
<image
|
||||
v-if="item.isImage || (item.type && item.type === 'image')"
|
||||
:src="item.thumb || item.url"
|
||||
:mode="imageMode"
|
||||
class="u-upload__wrap__preview__image"
|
||||
@tap="onPreviewImage(item)"
|
||||
:style="[{
|
||||
width: $u.addUnit(width),
|
||||
height: $u.addUnit(height)
|
||||
}]"
|
||||
/>
|
||||
<view class="u-upload__wrap" >
|
||||
<template v-if="previewImage">
|
||||
<view
|
||||
v-else
|
||||
class="u-upload__wrap__preview__other"
|
||||
class="u-upload__wrap__preview"
|
||||
v-for="(item, index) in lists"
|
||||
:key="index"
|
||||
>
|
||||
<u-icon
|
||||
color="#80CBF9"
|
||||
size="26"
|
||||
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
|
||||
></u-icon>
|
||||
<text class="u-upload__wrap__preview__other__text">{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}</text>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__status"
|
||||
v-if="item.status === 'uploading' || item.status === 'failed'"
|
||||
>
|
||||
<view class="u-upload__status__icon">
|
||||
<u-icon
|
||||
v-if="item.status === 'failed'"
|
||||
name="close-circle"
|
||||
color="#ffffff"
|
||||
size="25"
|
||||
/>
|
||||
<u-loading-icon
|
||||
size="22"
|
||||
mode="circle"
|
||||
color="#ffffff"
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
<text
|
||||
v-if="item.message"
|
||||
class="u-upload__status__message"
|
||||
>{{ item.message }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__deletable"
|
||||
v-if="item.status !== 'uploading' && (deletable || item.deletable)"
|
||||
@tap.stop="deleteItem(index)"
|
||||
>
|
||||
<view class="u-upload__deletable__icon">
|
||||
<u-icon
|
||||
name="close"
|
||||
color="#ffffff"
|
||||
size="10"
|
||||
></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__success"
|
||||
v-if="item.status === 'success'"
|
||||
>
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<image
|
||||
:src="successIcon"
|
||||
class="u-upload__success__icon"
|
||||
></image>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<view class="u-upload__success__icon">
|
||||
v-if="item.isImage || (item.type && item.type === 'image')"
|
||||
:src="item.thumb || item.url"
|
||||
:mode="imageMode"
|
||||
class="u-upload__wrap__preview__image"
|
||||
@tap="onPreviewImage(item)"
|
||||
:style="[{
|
||||
width: $u.addUnit(width),
|
||||
height: $u.addUnit(height)
|
||||
}]"
|
||||
/>
|
||||
<view
|
||||
v-else
|
||||
class="u-upload__wrap__preview__other"
|
||||
>
|
||||
<u-icon
|
||||
name="checkmark"
|
||||
color="#ffffff"
|
||||
size="12"
|
||||
color="#80CBF9"
|
||||
size="26"
|
||||
:name="item.isVideo || (item.type && item.type === 'video') ? 'movie' : 'folder'"
|
||||
></u-icon>
|
||||
<text class="u-upload__wrap__preview__other__text">{{item.isVideo || (item.type && item.type === 'video') ? '视频' : '文件'}}</text>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__status"
|
||||
v-if="item.status === 'uploading' || item.status === 'failed'"
|
||||
>
|
||||
<view class="u-upload__status__icon">
|
||||
<u-icon
|
||||
v-if="item.status === 'failed'"
|
||||
name="close-circle"
|
||||
color="#ffffff"
|
||||
size="25"
|
||||
/>
|
||||
<u-loading-icon
|
||||
size="22"
|
||||
mode="circle"
|
||||
color="#ffffff"
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
<text
|
||||
v-if="item.message"
|
||||
class="u-upload__status__message"
|
||||
>{{ item.message }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__deletable"
|
||||
v-if="item.status !== 'uploading' && (deletable || item.deletable)"
|
||||
@tap.stop="deleteItem(index)"
|
||||
>
|
||||
<view class="u-upload__deletable__icon">
|
||||
<u-icon
|
||||
name="close"
|
||||
color="#ffffff"
|
||||
size="10"
|
||||
></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="u-upload__success"
|
||||
v-if="item.status === 'success'"
|
||||
>
|
||||
<!-- #ifdef APP-NVUE -->
|
||||
<image
|
||||
:src="successIcon"
|
||||
class="u-upload__success__icon"
|
||||
></image>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef APP-NVUE -->
|
||||
<view class="u-upload__success__icon">
|
||||
<u-icon
|
||||
name="checkmark"
|
||||
color="#ffffff"
|
||||
size="12"
|
||||
></u-icon>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<template v-if="isInCount">
|
||||
<view
|
||||
v-if="$slots.default || $slots.$default"
|
||||
@@ -205,11 +209,18 @@
|
||||
disabled
|
||||
} = this;
|
||||
if (disabled) return;
|
||||
// 如果用户传入的是字符串,需要格式化成数组
|
||||
let capture;
|
||||
try {
|
||||
capture = uni.$u.test.array(this.capture) ? this.capture : this.capture.split(',');
|
||||
}catch(e) {
|
||||
capture = [];
|
||||
}
|
||||
chooseFile(
|
||||
Object.assign({
|
||||
accept: this.accept,
|
||||
multiple: this.multiple,
|
||||
capture: this.capture,
|
||||
capture: capture,
|
||||
compressed: this.compressed,
|
||||
maxDuration: this.maxDuration,
|
||||
sizeType: this.sizeType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 此版本发布于2022-03-13
|
||||
const version = '2.0.29'
|
||||
// 此版本发布于2022-04-04
|
||||
const version = '2.0.30'
|
||||
|
||||
// 开发环境才提示,生产环境不会提示
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
|
||||
@@ -11,7 +11,7 @@ export default {
|
||||
// checkbox组件
|
||||
checkbox: {
|
||||
name: '',
|
||||
shape: 'square',
|
||||
shape: '',
|
||||
size: '',
|
||||
checkbox: false,
|
||||
disabled: '',
|
||||
|
||||
@@ -21,6 +21,7 @@ export default {
|
||||
}),
|
||||
lineWidth: 20,
|
||||
lineHeight: 3,
|
||||
lineBgSize: 'cover',
|
||||
itemStyle: () => ({
|
||||
height: '44px'
|
||||
}),
|
||||
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
placeholderClass: 'textarea-placeholder',
|
||||
placeholderStyle: 'color: #c0c4cc',
|
||||
height: 70,
|
||||
confirmType: 'done',
|
||||
confirmType: '',
|
||||
disabled: false,
|
||||
count: false,
|
||||
focus: false,
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
.u-flex-y,
|
||||
.u-flex-column {
|
||||
@include flex('column');
|
||||
@include flex(column);
|
||||
}
|
||||
|
||||
.u-flex-x-center {
|
||||
|
||||
@@ -232,9 +232,9 @@ function promise(value) {
|
||||
* @param {Object} value
|
||||
*/
|
||||
function image(value) {
|
||||
// 由于有很多图片链接并不是.jpg等结尾,而是带有很多get参数,故不能采用判断扩展名的形式,只能简单的判断是否为http开头
|
||||
const IMAGE_REGEXP = /^http/i
|
||||
return IMAGE_REGEXP.test(value)
|
||||
const newValue = value.split('?')[0]
|
||||
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i
|
||||
return IMAGE_REGEXP.test(newValue)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ function image(value) {
|
||||
* @param {Object} 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)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"id": "uview-ui",
|
||||
"name": "uview-ui",
|
||||
"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
|
||||
"version": "2.0.29",
|
||||
"version": "2.0.30",
|
||||
"description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
|
||||
"keywords": [
|
||||
"uview",
|
||||
|
||||
Reference in New Issue
Block a user