Commit 7d463c81 authored by wlxuqu's avatar wlxuqu

1. 【新增】新增$u.sys用于获取设备的信息,相当于uni.getSystemInfoSync()的效果

2. 【新增】新增$u.os用于返回平台名称,结果为小写的"ios"或者"android"
3. 【新增】popup和mask新增hover-stop-propagation属性,阻止父节点出现点击状态
4. 【新增】layout组件的col新增text-align属性,用于控制内部的水平对齐方式
5. 【新增】upload新增limit-type参数,用于控制允许选择的图片后缀
6. 【新增】input组件新增selection-start和selection-end参数
7. 【新增】number-box组件新增只能属于正整数的positive-integer参数
8. 【新增】picker、select和keyboard组件新增cancel-text和confirm-text参数
9. 【新增】tabs组件新增item-width参数,用于控制标签的宽度,超出用过省略号表示,默认auto
10. 【新增】avatar头像新增性别和等级展示角标
11. 【新增】sticky新增unfixed取消吸顶事件
12. 【新增】action-sheet组件新增disabled属性,用于禁止某些条目的可选性
13. 【新增】最新版hx2.8.2中,waterfall组件支持支付宝小程序
14. 【新增】button组件返回的click事件中新增返回事件源参数
15. 【新增】icon组件新增用于控制图标的width和height参数,以及控制垂直方向偏移的top参数
16. 【优化】调整navbar的返回图标为nav-back,大小调整为44
17. 【优化】重构section组件,类名使用BEM规范,左侧竖线使用字体图标,新增控制竖线颜色的line-color参数
18. 【修复】改正radio和checkbox组件的label-disabled判断不严格的问题
19. 【修复】修复popup组件关闭时触发两次close事件的问题
20. 【修复】修复slider滑块组件block-color参数无效的问题
21. 【修复】修复http请求中拦截器中返回false报错的问题,优化响应拦截器返回false报找不到catch()的问题
22. 【修复】修复layout的col子组件text-align参数无效的问题
23. 【修复】修复image组件的error-icon和loadingicon参数传图片地址时无效的问题
24. 【修复】修复number-box动态设置输入值不生效的问题
parent 788462b0
......@@ -2,7 +2,7 @@
"name" : "uView",
"appid" : "__UNI__60F4B81",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.5.5",
"versionName" : "1.5.6",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
......
......@@ -828,22 +828,22 @@
"backgroundColor": "#FFFFFF",
"borderStyle": "black",
"list": [{
"pagePath": "pages/example/components",
"iconPath": "static/uview/example/component.png",
"selectedIconPath": "static/uview/example/component_select.png",
"text": "组件"
"pagePath": "pages/example/components"
// "iconPath": "static/uview/example/component.png",
// "selectedIconPath": "static/uview/example/component_select.png",
// "text": "组件"
},
{
"pagePath": "pages/example/js",
"iconPath": "static/uview/example/js.png",
"selectedIconPath": "static/uview/example/js_select.png",
"text": "工具"
"pagePath": "pages/example/js"
// "iconPath": "static/uview/example/js.png",
// "selectedIconPath": "static/uview/example/js_select.png",
// "text": "工具"
},
{
"pagePath": "pages/example/template",
"iconPath": "static/uview/example/template.png",
"selectedIconPath": "static/uview/example/template_select.png",
"text": "模板"
"pagePath": "pages/example/template"
// "iconPath": "static/uview/example/template.png",
// "selectedIconPath": "static/uview/example/template_select.png",
// "text": "模板"
}
]
}
......
......@@ -9,6 +9,7 @@
</u-cell-group>
</view>
<u-gap height="70"></u-gap>
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
......
......@@ -9,6 +9,7 @@
</u-cell-group>
</view>
<u-gap height="70"></u-gap>
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
......
......@@ -9,6 +9,7 @@
</u-cell-group>
</view>
<u-gap height="70"></u-gap>
<u-tabbar :list="vuex_tabbar" :mid-button="true"></u-tabbar>
</view>
</template>
......
static/uview/example/js.png

3.14 KB | W: | H:

static/uview/example/js.png

4.14 KB | W: | H:

static/uview/example/js.png
static/uview/example/js.png
static/uview/example/js.png
static/uview/example/js.png
  • 2-up
  • Swipe
  • Onion skin
static/uview/example/js_select.png

2.2 KB | W: | H:

static/uview/example/js_select.png

4.18 KB | W: | H:

static/uview/example/js_select.png
static/uview/example/js_select.png
static/uview/example/js_select.png
static/uview/example/js_select.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -36,6 +36,27 @@ const store = new Vuex.Store({
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version: '1.0.1',
vuex_demo: '绛紫',
// 自定义tabbar数据
vuex_tabbar: [{
iconPath: "/static/uview/example/component.png",
selectedIconPath: "/static/uview/example/component_select.png",
text: '组件',
pagePath: '/pages/example/components'
},
{
iconPath: "/static/uview/example/js.png",
selectedIconPath: "/static/uview/example/js_select.png",
text: '工具',
midButton: true,
pagePath: '/pages/example/js'
},
{
iconPath: "/static/uview/example/template.png",
selectedIconPath: "/static/uview/example/template_select.png",
text: '模板',
pagePath: '/pages/example/template'
}
]
},
mutations: {
$uStore(state, payload) {
......
......@@ -4,13 +4,13 @@
<slot />
<view class="u-tooltip" v-if="tooltip">
<view class="u-tooltip-item u-tooltip-cancel" hover-class="u-tooltip-cancel-hover" @tap="onCancel">
{{cancelBtn ? '取消' : ''}}
{{cancelBtn ? cancelText : ''}}
</view>
<view v-if="showTips" class="u-tooltip-item u-tooltip-tips">
{{tips ? tips : mode == 'number' ? '数字键盘' : mode == 'card' ? '身份证键盘' : '车牌号键盘'}}
</view>
<view v-if="confirmBtn" @tap="onConfirm" class="u-tooltip-item u-tooltips-submit" hover-class="u-tooltips-submit-hover">
{{confirmBtn ? '完成' : ''}}
{{confirmBtn ? confirmText : ''}}
</view>
</view>
<block v-if="mode == 'number' || mode == 'card'">
......@@ -34,6 +34,8 @@
* @property {Boolean} cancel-btn 是否显示工具条左边的"取消"按钮(默认true)
* @property {Boolean} confirm-btn 是否显示工具条右边的"完成"按钮(默认true)
* @property {Boolean} mask 是否显示遮罩(默认true)
* @property {String} confirm-text 确认按钮的文字
* @property {String} cancel-text 取消按钮的文字
* @property {Number String} z-index 弹出键盘的z-index值(默认1075)
* @property {Boolean} random 是否打乱键盘按键的顺序(默认false)
* @property {Boolean} safe-area-inset-bottom 是否开启底部安全区适配(默认false)
......@@ -111,6 +113,16 @@
zIndex: {
type: [Number, String],
default: ''
},
// 取消按钮的文字
cancelText: {
type: String,
default: '取消'
},
// 确认按钮的文字
confirmText: {
type: String,
default: '确认'
}
},
data() {
......
<template>
<view>
<u-popup :zoom="zoom"
mode="center" :popup="false"
:z-index="uZIndex" v-model="value"
:length="width" :mask-close-able="maskCloseAble"
:border-radius="borderRadius"
@close="popupClose"
:negative-top="negativeTop"
>
<u-popup :zoom="zoom" mode="center" :popup="false" :z-index="uZIndex" v-model="value" :length="width"
:mask-close-able="maskCloseAble" :border-radius="borderRadius" @close="popupClose" :negative-top="negativeTop">
<view class="u-model">
<view v-if="showTitle" class="u-model-title u-line-1" :style="[titleStyle]">{{ title }}</view>
<view class="u-model-content">
<view v-if="showTitle" class="u-model__title u-line-1" :style="[titleStyle]">{{ title }}</view>
<view class="u-model__content">
<view :style="[contentStyle]" v-if="$slots.default">
<slot />
</view>
<view v-else class="u-model-content-message" :style="[contentStyle]">{{ content }}</view>
<view v-else class="u-model__content__message" :style="[contentStyle]">{{ content }}</view>
</view>
<view class="u-model-footer u-border-top" v-if="showCancelButton || showConfirmButton">
<view
v-if="showCancelButton"
:hover-stay-time="100"
hover-class="btn-hover"
class="u-model-footer-button"
type="default"
:style="[cancelBtnStyle]"
@tap="cancel"
>
<view class="u-model__footer u-border-top" v-if="showCancelButton || showConfirmButton">
<view v-if="showCancelButton" :hover-stay-time="100" hover-class="u-model__btn--hover" class="u-model__footer__button"
:style="[cancelBtnStyle]" @tap="cancel">
{{cancelText}}
</view>
<view
v-if="showConfirmButton"
:hover-stay-time="100"
:hover-class="asyncClose ? 'none' : 'btn-hover'"
class="u-model-footer-button hairline-left"
:style="[confirmBtnStyle]"
@tap="confirm"
>
<view v-if="showConfirmButton" :hover-stay-time="100" :hover-class="asyncClose ? 'none' : 'u-model__btn--hover'"
class="u-model__footer__button hairline-left" :style="[confirmBtnStyle]" @tap="confirm">
<u-loading mode="circle" :color="confirmColor" v-if="loading"></u-loading>
<block v-else>
{{confirmText}}
......@@ -48,7 +29,7 @@
</template>
<script>
/**
/**
* modal 模态框
* @description 弹出模态框,常用于消息提示、消息确认、在当前页面内完成特定的交互操作
* @tutorial https://www.uviewui.com/components/modal.html
......@@ -77,7 +58,7 @@
* @event {Function} cancel 取消按钮被点击
* @example <u-modal :src="title" :content="content"></u-modal>
*/
export default {
export default {
name: 'u-modal',
props: {
// 是否显示Modal
......@@ -148,28 +129,28 @@ export default {
// 标题的样式
titleStyle: {
type: Object,
default() {
default () {
return {}
}
},
// 内容的样式
contentStyle: {
type: Object,
default() {
default () {
return {}
}
},
// 取消按钮的样式
cancelStyle: {
type: Object,
default() {
default () {
return {}
}
},
// 确定按钮的样式
confirmStyle: {
type: Object,
default() {
default () {
return {}
}
},
......@@ -201,10 +182,14 @@ export default {
},
computed: {
cancelBtnStyle() {
return Object.assign({color: this.cancelColor}, this.cancelStyle);
return Object.assign({
color: this.cancelColor
}, this.cancelStyle);
},
confirmBtnStyle() {
return Object.assign({color: this.confirmColor}, this.confirmStyle);
return Object.assign({
color: this.confirmColor
}, this.confirmStyle);
},
uZIndex() {
return this.zIndex ? this.zIndex : this.$u.zIndex.popup;
......@@ -214,13 +199,13 @@ export default {
// 如果是异步关闭时,外部修改v-model的值为false时,重置内部的loading状态
// 避免下次打开的时候,状态混乱
value(n) {
if(n === true) this.loading = false;
if (n === true) this.loading = false;
}
},
methods: {
confirm() {
// 异步关闭
if(this.asyncClose) {
if (this.asyncClose) {
this.loading = true;
} else {
this.$emit('input', false);
......@@ -245,31 +230,31 @@ export default {
this.loading = false;
}
}
};
};
</script>
<style lang="scss" scoped>
@import "../../libs/css/style.components.scss";
@import "../../libs/css/style.components.scss";
.btn-hover {
background-color: rgb(230, 230, 230);
}
.u-model {
.u-model {
height: auto;
overflow: hidden;
font-size: 32rpx;
background-color: #fff;
&-title {
&__btn--hover {
background-color: rgb(230, 230, 230);
}
&__title {
padding-top: 48rpx;
font-weight: 500;
text-align: center;
color: $u-main-color;
}
&-content {
&-message {
&__content {
&__message {
padding: 48rpx;
font-size: 30rpx;
text-align: center;
......@@ -277,10 +262,10 @@ export default {
}
}
&-footer {
&__footer {
display: flex;
&-button {
&__button {
flex: 1;
height: 100rpx;
line-height: 100rpx;
......@@ -291,5 +276,5 @@ export default {
border-radius: 4rpx;
}
}
}
}
</style>
......@@ -16,8 +16,9 @@
]">
<u-icon
:size="midButton && item.midButton ? midButtonSize : iconSize"
:name="index == value ? item.selectedIconPath : item.iconPath"
:color="index == value ? activeColor : inactiveColor"
:name="elIconPath(index)"
img-mode="scaleToFill"
:color="elColor(index)"
:custom-prefix="item.customIcon ? 'custom-icon' : 'uicon'"
></u-icon>
<u-badge :count="item.count" :is-dot="item.isDot"
......@@ -26,7 +27,7 @@
></u-badge>
</view>
<view class="u-tabbar__content__item__text" :style="{
color: index == value ? activeColor : inactiveColor
color: elColor(index)
}">
<text class="u-line-1">{{item.text}}</text>
</view>
......@@ -34,7 +35,8 @@
<view v-if="midButton" class="u-tabbar__content__circle__border" :class="{
'u-border': borderTop,
}" :style="{
backgroundColor: bgColor
backgroundColor: bgColor,
left: midButtonLeft
}">
</view>
</view>
......@@ -110,12 +112,64 @@
type: Boolean,
default: true
},
// 是否隐藏原生tabbar
hideTabBar: {
type: Boolean,
default: true
},
},
data() {
return {
// 由于安卓太菜了,通过css居中凸起按钮的外层元素有误差,故通过js计算将其其中
midButtonLeft: '50%',
pageUrl: '', // 当前
}
},
created() {
// 是否隐藏原生tabbar
if(this.borderTop) uni.hideTabBar();
// 获取引入了u-tabbar页面的路由地址,该地址没有路径前面的"/"
let pages = getCurrentPages();
// 页面栈中的最后一个即为项为当前页面,route属性为页面路径
this.pageUrl = pages[pages.length - 1].route;
},
computed: {
elIconPath() {
return (index) => {
// 历遍u-tabbar的每一项item时,判断是否传入了pagePath参数,如果传入了
// 和data中的pageUrl参数对比,如果相等,即可判断当前的item对应当前的tabbar页面,设置高亮图标
// 采用这个方法,可以无需使用v-model绑定的value值
let pagePath = this.list[index].pagePath;
// 如果定义了pagePath属性,意味着使用系统自带tabbar方案,否则使用一个页面用几个组件模拟tabbar页面的方案
// 这两个方案对处理tabbar item的激活与否方式不一样
if(pagePath) {
if(pagePath == this.pageUrl || pagePath == '/' + this.pageUrl) {
return this.list[index].selectedIconPath;
} else {
return this.list[index].iconPath;
}
} else {
// 普通方案中,索引等于v-model值时,即为激活项
return index == this.value ? this.list[index].selectedIconPath : this.list[index].iconPath
}
}
},
elColor() {
return (index) => {
// 判断方法同理于elIconPath
let pagePath = this.list[index].pagePath;
if(pagePath) {
if(pagePath == this.pageUrl || pagePath == '/' + this.pageUrl) return this.activeColor;
else return this.inactiveColor;
} else {
return index == this.value ? this.activeColor : this.inactiveColor;
}
}
}
},
mounted() {
this.midButton && this.getMidButtonLeft();
},
methods: {
async clickHandler(index) {
if(this.beforeSwitch && typeof(this.beforeSwitch) === 'function') {
......@@ -141,7 +195,16 @@
switchTab(index) {
// 发出事件和修改v-model绑定的值
this.$emit('change', index);
// 如果有配置pagePath属性,使用uni.switchTab进行跳转
if(this.list[index].pagePath) {
uni.switchTab({
url: this.list[index].pagePath
})
} else {
// 如果配置了papgePath属性,将不会双向绑定v-model传入的value值
// 因为这个模式下,不再需要v-model绑定的value值了,而是通过getCurrentPages()适配
this.$emit('input', index);
}
},
// 计算角标的right值
getOffsetRight(count, isDot) {
......@@ -153,6 +216,12 @@
} else {
return -30;
}
},
// 获取凸起按钮外层元素的left值,让其水平居中
getMidButtonLeft() {
let windowWidth = this.$u.sys.windowWidth;
// 由于安卓中css计算left: 50%的结果不准确,故用js计算
this.midButtonLeft = (windowWidth / 2) + 'px';
}
}
}
......@@ -181,11 +250,13 @@
width: 110rpx;
height: 110rpx;
top: -48rpx;
left: 50%;
transform: translateX(-50%);
position: absolute;
z-index: 4;
background-color: #ffffff;
// 由于安卓的无能,导致只有3个tabbar item时,此css计算方式有误差
// 故使用js计算的形式来定位,此处不注释,是因为js计算有延后,避免出现位置闪动
left: 50%;
transform: translateX(-50%);
&:after {
border-radius: 100px;
......
// 此版本发布于2020-07-23
let version = '1.5.5';
// 此版本发布于2020-07-28
let version = '1.5.6';
export default {
v: version,
......
{
"name": "uview-ui",
"version": "1.5.5",
"version": "1.5.6",
"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