提交 84ce1d2e 编写于 作者: DCloud_JSON's avatar DCloud_JSON

- 更新表结构,解决部分clientDB操作没有权限的问题

上级 d1fac9bb
## 1.4.7(2022-09-16)
- 可以使用 uni-scss 控制主题色
## 1.4.6(2022-09-08)
- fix: 表头年月切换,导致改变当前日期为选择月1号,且未触发change事件
## 1.4.5(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.4.4(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.4.3(2021-09-22) ## 1.4.3(2021-09-22)
- 修复 startDate、 endDate 属性失效的 bug - 修复 startDate、 endDate 属性失效的 bug
## 1.4.2(2021-08-24) ## 1.4.2(2021-08-24)
......
...@@ -96,6 +96,13 @@ ...@@ -96,6 +96,13 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-font-size-base:14px;
$uni-text-color:#333;
$uni-font-size-sm:12px;
$uni-color-error: #e43d33;
$uni-opacity-disabled: 0.3;
$uni-text-color-disable:#c0c0c0;
$uni-primary: #2979ff !default;
.uni-calendar-item__weeks-box { .uni-calendar-item__weeks-box {
flex: 1; flex: 1;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -145,11 +152,11 @@ ...@@ -145,11 +152,11 @@
} }
.uni-calendar-item--isDay-text { .uni-calendar-item--isDay-text {
color: $uni-color-primary; color: $uni-primary;
} }
.uni-calendar-item--isDay { .uni-calendar-item--isDay {
background-color: $uni-color-primary; background-color: $uni-primary;
opacity: 0.8; opacity: 0.8;
color: #fff; color: #fff;
} }
...@@ -160,13 +167,13 @@ ...@@ -160,13 +167,13 @@
} }
.uni-calendar-item--checked { .uni-calendar-item--checked {
background-color: $uni-color-primary; background-color: $uni-primary;
color: #fff; color: #fff;
opacity: 0.8; opacity: 0.8;
} }
.uni-calendar-item--multiple { .uni-calendar-item--multiple {
background-color: $uni-color-primary; background-color: $uni-primary;
color: #fff; color: #fff;
opacity: 0.8; opacity: 0.8;
} }
......
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
bindDateChange(e) { bindDateChange(e) {
const value = e.detail.value + '-1' const value = e.detail.value + '-1'
console.log(this.cale.getDate(value)); console.log(this.cale.getDate(value));
this.init(value) this.setDate(value)
}, },
/** /**
* 初始化日期显示 * 初始化日期显示
...@@ -361,6 +361,14 @@ ...@@ -361,6 +361,14 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-bg-color-mask: rgba($color: #000000, $alpha: 0.4);
$uni-border-color: #EDEDED;
$uni-text-color: #333;
$uni-bg-color-hover:#f1f1f1;
$uni-font-size-base:14px;
$uni-text-color-placeholder: #808080;
$uni-color-subtitle: #555555;
$uni-text-color-grey:#999;
.uni-calendar { .uni-calendar {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -389,13 +397,16 @@ ...@@ -389,13 +397,16 @@
.uni-calendar--fixed { .uni-calendar--fixed {
position: fixed; position: fixed;
bottom: calc(var(--window-bottom)); /* #ifdef APP-NVUE */
bottom: 0;
/* #endif */
left: 0; left: 0;
right: 0; right: 0;
transition-property: transform; transition-property: transform;
transition-duration: 0.3s; transition-duration: 0.3s;
transform: translateY(460px); transform: translateY(460px);
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
bottom: calc(var(--window-bottom));
z-index: 99; z-index: 99;
/* #endif */ /* #endif */
} }
......
...@@ -122,7 +122,6 @@ class Calendar { ...@@ -122,7 +122,6 @@ class Calendar {
let dateArr = [] let dateArr = []
let fullDate = this.date.fullDate let fullDate = this.date.fullDate
for (let i = 1; i <= dateData; i++) { for (let i = 1; i <= dateData; i++) {
let isinfo = false
let nowDate = full.year + '-' + (full.month < 10 ? let nowDate = full.year + '-' + (full.month < 10 ?
full.month : full.month) + '-' + (i < 10 ? full.month : full.month) + '-' + (i < 10 ?
'0' + i : i) '0' + i : i)
...@@ -311,11 +310,8 @@ class Calendar { ...@@ -311,11 +310,8 @@ class Calendar {
*/ */
_getWeek(dateData) { _getWeek(dateData) {
const { const {
fullDate,
year, year,
month, month
date,
day
} = this.getDate(dateData) } = this.getDate(dateData)
let firstDay = new Date(year, month - 1, 1).getDay() let firstDay = new Date(year, month - 1, 1).getDay()
let currentDay = new Date(year, month, 0).getDate() let currentDay = new Date(year, month, 0).getDate()
......
{ {
"id": "uni-calendar", "id": "uni-calendar",
"displayName": "uni-calendar 日历", "displayName": "uni-calendar 日历",
"version": "1.4.3", "version": "1.4.7",
"description": "日历组件", "description": "日历组件",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -39,7 +35,8 @@ ...@@ -39,7 +35,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [], "dependencies": [],
......
## 1.0.8(2022-09-16)
- 可以使用 uni-scss 控制主题色
## 1.0.7(2022-07-06)
- 优化 pc端图标位置不正确的问题
## 1.0.6(2022-07-05)
- 优化 显示样式
## 1.0.5(2022-07-04)
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug
## 1.0.4(2022-04-19)
- 修复 字节小程序 本地数据无法选择下一级的Bug
## 1.0.3(2022-02-25)
- 修复 nvue 不支持的 v-show 的 bug
## 1.0.2(2022-02-25)
- 修复 条件编译 nvue 不支持的 css 样式
## 1.0.1(2021-11-23) ## 1.0.1(2021-11-23)
- 修复 由上个版本引发的map、v-model等属性不生效的bug - 修复 由上个版本引发的map、v-model等属性不生效的bug
## 1.0.0(2021-11-19) ## 1.0.0(2021-11-19)
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true"> <scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true">
<view class="selected-list"> <view class="selected-list">
<view class="selected-item" v-for="(item,index) in inputSelected" :key="index"> <view class="selected-item" v-for="(item,index) in inputSelected" :key="index">
<text>{{item.text}}</text><text v-if="index<inputSelected.length-1" <text class="text-color">{{item.text}}</text><text v-if="index<inputSelected.length-1"
class="input-split-line">{{split}}</text> class="input-split-line">{{split}}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
<text v-else class="selected-area placeholder">{{placeholder}}</text> <text v-else class="selected-area placeholder">{{placeholder}}</text>
<view v-show="clearIcon && !readonly && inputSelected.length" class="icon-clear" <view v-if="clearIcon && !readonly && inputSelected.length" class="icon-clear"
@click.stop="clear"> @click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="14"></uni-icons> <uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
</view> </view>
<view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly "> <view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly ">
<view class="input-arrow"></view> <view class="input-arrow"></view>
...@@ -182,13 +182,13 @@ ...@@ -182,13 +182,13 @@
}, },
show() { show() {
this.isOpened = true this.isOpened = true
this.$nextTick(() => { setTimeout(() => {
this.$refs.pickerView.updateData({ this.$refs.pickerView.updateData({
treeData: this._treeData, treeData: this._treeData,
selected: this.selected, selected: this.selected,
selectedIndex: this.selectedIndex selectedIndex: this.selectedIndex
}) })
}) }, 200)
this.$emit('popupopened') this.$emit('popupopened')
}, },
hide() { hide() {
...@@ -212,7 +212,9 @@ ...@@ -212,7 +212,9 @@
}, },
onchange(e) { onchange(e) {
this.hide() this.hide()
this.inputSelected = e this.$nextTick(() => {
this.inputSelected = e;
})
this._dispatchEvent(e) this._dispatchEvent(e)
}, },
_processReadonly(dataList, value) { _processReadonly(dataList, value) {
...@@ -292,8 +294,9 @@ ...@@ -292,8 +294,9 @@
} }
</script> </script>
<style scoped> <style >
.uni-data-tree { .uni-data-tree {
flex: 1;
position: relative; position: relative;
font-size: 14px; font-size: 14px;
} }
...@@ -310,11 +313,13 @@ ...@@ -310,11 +313,13 @@
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
font-size: 14px; font-size: 14px;
line-height: 38px; /* line-height: 35px; */
padding: 0 5px; padding: 0 10px;
padding-right: 5px;
overflow: hidden; overflow: hidden;
/* #ifdef APP-NVUE */ height: 35px;
height: 40px; /* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */ /* #endif */
} }
...@@ -347,19 +352,24 @@ ...@@ -347,19 +352,24 @@
/* #endif */ /* #endif */
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
padding: 0 5px; /* padding: 0 5px; */
} }
.selected-item { .selected-item {
flex-direction: row; flex-direction: row;
padding: 0 1px; /* padding: 0 1px; */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
white-space: nowrap; white-space: nowrap;
/* #endif */ /* #endif */
} }
.text-color {
color: #333;
}
.placeholder { .placeholder {
color: grey; color: grey;
font-size: 12px;
} }
.input-split-line { .input-split-line {
...@@ -476,6 +486,11 @@ ...@@ -476,6 +486,11 @@
overflow: hidden; overflow: hidden;
} }
.icon-clear {
display: flex;
align-items: center;
}
/* #ifdef H5 */ /* #ifdef H5 */
@media all and (min-width: 768px) { @media all and (min-width: 768px) {
.uni-data-tree-cover { .uni-data-tree-cover {
...@@ -500,13 +515,14 @@ ...@@ -500,13 +515,14 @@
} }
.icon-clear { .icon-clear {
margin-right: 5px; /* margin-right: 5px; */
} }
} }
/* #endif */ /* #endif */
/* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ /* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */
/* #ifndef APP-NVUE */
.uni-popper__arrow, .uni-popper__arrow,
.uni-popper__arrow::after { .uni-popper__arrow::after {
position: absolute; position: absolute;
...@@ -534,4 +550,5 @@ ...@@ -534,4 +550,5 @@
border-top-width: 0; border-top-width: 0;
border-bottom-color: #fff; border-bottom-color: #fff;
} }
/* #endif */
</style> </style>
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
<template v-for="(item,index) in selected"> <template v-for="(item,index) in selected">
<view class="selected-item" <view class="selected-item"
:class="{'selected-item-active':index==selectedIndex, 'selected-item-text-overflow': ellipsis}" :class="{'selected-item-active':index==selectedIndex, 'selected-item-text-overflow': ellipsis}"
:key="index" v-if="item.text" @click="handleSelect(index)"> v-if="item.text" @click="handleSelect(index)">
<text class="">{{item.text}}</text> <text class="">{{item.text}}</text>
</view> </view>
</template> </template>
</view> </view>
</scroll-view> </scroll-view>
<view class="tab-c"> <view class="tab-c">
<template v-for="(child, i) in dataList"> <template v-for="(child, i) in dataList" >
<scroll-view class="list" :key="i" v-if="i==selectedIndex" :scroll-y="true"> <scroll-view class="list" :key="i" v-if="i==selectedIndex" :scroll-y="true">
<view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in child" :key="j" <view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in child"
@click="handleNodeClick(item, i, j)"> @click="handleNodeClick(item, i, j)">
<text class="item-text item-text-overflow">{{item[map.text]}}</text> <text class="item-text item-text-overflow">{{item[map.text]}}</text>
<view class="check" v-if="selected.length > i && item[map.value] == selected[i].value"></view> <view class="check" v-if="selected.length > i && item[map.value] == selected[i].value"></view>
...@@ -177,7 +177,9 @@ ...@@ -177,7 +177,9 @@
} }
} }
</script> </script>
<style scoped> <style lang="scss">
$uni-primary: #007aff !default;
.uni-data-pickerview { .uni-data-pickerview {
flex: 1; flex: 1;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -265,11 +267,11 @@ ...@@ -265,11 +267,11 @@
} }
.selected-item-active { .selected-item-active {
border-bottom: 2px solid #007aff; border-bottom: 2px solid $uni-primary;
} }
.selected-item-text { .selected-item-text {
color: #007aff; color: $uni-primary;
} }
.tab-c { .tab-c {
...@@ -319,7 +321,7 @@ ...@@ -319,7 +321,7 @@
.check { .check {
margin-right: 5px; margin-right: 5px;
border: 2px solid #007aff; border: 2px solid $uni-primary;
border-left: 0; border-left: 0;
border-top: 0; border-top: 0;
height: 12px; height: 12px;
......
{ {
"id": "uni-data-picker", "id": "uni-data-picker",
"displayName": "uni-data-picker 数据驱动的picker选择器", "displayName": "uni-data-picker 数据驱动的picker选择器",
"version": "1.0.1", "version": "1.0.8",
"description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -39,7 +35,8 @@ ...@@ -39,7 +35,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
...@@ -56,7 +53,7 @@ ...@@ -56,7 +53,7 @@
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "u"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
...@@ -76,7 +73,8 @@ ...@@ -76,7 +73,8 @@
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y",
"京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
......
## 0.1.9(2022-09-05)
- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框
## 0.1.8(2022-08-29)
- 修复 点击的位置不准确
## 0.1.7(2022-08-12)
- 新增 支持 disabled 属性
## 0.1.6(2022-07-06)
- 修复 pc端宽度异常的bug
## 0.1.5
- 修复 pc端宽度异常的bug
## 0.1.4(2022-07-05)
- 优化 显示样式
## 0.1.3(2022-06-02)
- 修复 localdata 赋值不生效的 bug
- 新增 支持 uni.scss 修改颜色
- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用)
## 0.1.2(2022-05-08)
- 修复 当 value 为 0 时选择不生效的 bug
## 0.1.1(2022-05-07)
- 新增 记住上次的选项(仅 collection 存在时有效)
## 0.1.0(2022-04-22)
- 初始化
<template>
<view class="uni-stat__select">
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ''}}</span>
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
<view class="uni-select" :class="{'uni-select--disabled':disabled}">
<view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{current}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<uni-icons v-if="current && clear" type="clear" color="#c0c4cc" size="24" @click="clearVal" />
<uni-icons v-else :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector">
<view class="uni-popper__arrow"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
:key="index" @click="change(item)">
<text
:class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
</view>
</view>
</view>
</template>
<script>
/**
* DataChecklist 数据选择器
* @description 通过数据渲染的下拉框组件
* @tutorial https://uniapp.dcloud.io/component/uniui/uni-data-select
* @property {String} value 默认值
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
* @property {Boolean} clear 是否可以清空已选项
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
* @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字
* @property {Boolean} disabled 是否禁用
* @event {Function} change 选中发生变化触发
*/
export default {
name: "uni-stat-select",
mixins: [uniCloud.mixinDatacom || {}],
data() {
return {
showSelector: false,
current: '',
mixinDatacomResData: [],
apps: [],
channels: []
};
},
props: {
localdata: {
type: Array,
default () {
return []
}
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
label: {
type: String,
default: ''
},
placeholder: {
type: String,
default: '请选择'
},
emptyTips: {
type: String,
default: '无选项'
},
clear: {
type: Boolean,
default: true
},
defItem: {
type: Number,
default: 0
},
disabled: {
type: Boolean,
default: false
}
},
created() {
this.last = `${this.collection}_last_selected_option_value`
if (this.collection && !this.localdata.length) {
this.mixinDatacomEasyGet()
}
},
computed: {
typePlaceholder() {
const text = {
'opendb-stat-app-versions': '版本',
'opendb-app-channels': '渠道',
'opendb-app-list': '应用'
}
const common = this.placeholder
const placeholder = text[this.collection]
return placeholder ?
common + placeholder :
common
}
},
watch: {
localdata: {
immediate: true,
handler(val, old) {
if (Array.isArray(val) && old !== val) {
this.mixinDatacomResData = val
}
}
},
// #ifndef VUE3
value() {
this.initDefVal()
},
// #endif
// #ifdef VUE3
modelValue() {
this.initDefVal()
},
// #endif
mixinDatacomResData: {
immediate: true,
handler(val) {
if (val.length) {
this.initDefVal()
}
}
}
},
methods: {
initDefVal() {
let defValue = ''
if ((this.value || this.value === 0) && !this.isDisabled(this.value)) {
defValue = this.value
} else if ((this.modelValue || this.modelValue === 0) && !this.isDisabled(this.modelValue)) {
defValue = this.modelValue
} else {
let strogeValue
if (this.collection) {
strogeValue = uni.getStorageSync(this.last)
}
if (strogeValue || strogeValue === 0) {
defValue = strogeValue
} else {
let defItem = ''
if (this.defItem > 0 && this.defItem < this.mixinDatacomResData.length) {
defItem = this.mixinDatacomResData[this.defItem - 1].value
}
defValue = defItem
}
this.emit(defValue)
}
const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : ''
},
/**
* @param {[String, Number]} value
* 判断用户给的 value 是否同时为禁用状态
*/
isDisabled(value) {
let isDisabled = false;
this.mixinDatacomResData.forEach(item => {
if (item.value === value) {
isDisabled = item.disable
}
})
return isDisabled;
},
clearVal() {
this.emit('')
if (this.collection) {
uni.removeStorageSync(this.last)
}
},
change(item) {
if (!item.disable) {
this.showSelector = false
this.current = this.formatItemName(item)
this.emit(item.value)
}
},
emit(val) {
this.$emit('change', val)
this.$emit('input', val)
this.$emit('update:modelValue', val)
if (this.collection) {
uni.setStorageSync(this.last, val)
}
},
toggleSelector() {
if(this.disabled){
return
}
this.showSelector = !this.showSelector
},
formatItemName(item) {
let {
text,
value,
channel_code
} = item
channel_code = channel_code ? `(${channel_code})` : ''
return this.collection.indexOf('app-list') > 0 ?
`${text}(${value})` :
(
text ?
text :
`未命名${channel_code}`
)
}
}
}
</script>
<style lang="scss">
$uni-base-color: #6a6a6a !default;
$uni-main-color: #333 !default;
$uni-secondary-color: #909399 !default;
$uni-border-3: #e5e5e5;
/* #ifndef APP-NVUE */
@media screen and (max-width: 500px) {
.hide-on-phone {
display: none;
}
}
/* #endif */
.uni-stat__select {
display: flex;
align-items: center;
// padding: 15px;
cursor: pointer;
width: 100%;
flex: 1;
box-sizing: border-box;
}
.uni-stat-box {
width: 100%;
flex: 1;
}
.uni-stat__actived {
width: 100%;
flex: 1;
// outline: 1px solid #2979ff;
}
.uni-label-text {
font-size: 14px;
font-weight: bold;
color: $uni-base-color;
margin: auto 0;
margin-right: 5px;
}
.uni-select {
font-size: 14px;
border: 1px solid $uni-border-3;
box-sizing: border-box;
border-radius: 4px;
padding: 0 5px;
padding-left: 10px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
user-select: none;
/* #endif */
flex-direction: row;
align-items: center;
border-bottom: solid 1px $uni-border-3;
width: 100%;
flex: 1;
height: 35px;
&--disabled{
background-color: #f5f7fa;
cursor: not-allowed;
}
}
.uni-select__label {
font-size: 16px;
// line-height: 22px;
height: 35px;
padding-right: 10px;
color: $uni-secondary-color;
}
.uni-select__input-box {
height: 35px;
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: row;
align-items: center;
}
.uni-select__input {
flex: 1;
font-size: 14px;
height: 22px;
line-height: 22px;
}
.uni-select__input-plac {
font-size: 14px;
color: $uni-secondary-color;
}
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 3;
padding: 4px 0;
}
.uni-select__selector-scroll {
/* #ifndef APP-NVUE */
max-height: 200px;
box-sizing: border-box;
/* #endif */
}
.uni-select__selector-empty,
.uni-select__selector-item {
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
line-height: 35px;
font-size: 14px;
text-align: center;
/* border-bottom: solid 1px $uni-border-3; */
padding: 0px 10px;
}
.uni-select__selector-item:hover {
background-color: #f9f9f9;
}
.uni-select__selector-empty:last-child,
.uni-select__selector-item:last-child {
/* #ifndef APP-NVUE */
border-bottom: none;
/* #endif */
}
.uni-select__selector__disabled {
opacity: 0.4;
cursor: default;
}
/* picker 弹出层通用的指示小三角 */
.uni-popper__arrow,
.uni-popper__arrow::after {
position: absolute;
display: block;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
}
.uni-popper__arrow {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px;
left: 10%;
margin-right: 3px;
border-top-width: 0;
border-bottom-color: #EBEEF5;
}
.uni-popper__arrow::after {
content: " ";
top: 1px;
margin-left: -6px;
border-top-width: 0;
border-bottom-color: #fff;
}
.uni-select__input-text {
// width: 280px;
width: 100%;
color: $uni-main-color;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
overflow: hidden;
}
.uni-select__input-placeholder {
color: $uni-base-color;
font-size: 12px;
}
.uni-select--mask {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
}
</style>
{
"id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器",
"version": "0.1.9",
"description": "通过数据驱动的下拉框选择器",
"keywords": [
"uni-ui",
"select",
"uni-data-select",
"下拉框",
"下拉选"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.1.1"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": ["uni-load-more"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "u",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
## DataSelect 下拉框选择器
> **组件名:uni-data-select**
> 代码块: `uDataSelect`
当选项过多时,使用下拉菜单展示并选择内容
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 2.2.11(2022-09-19)
- 修复,支付宝小程序样式错乱,[详情](https://github.com/dcloudio/uni-app/issues/3861)
## 2.2.10(2022-09-19)
- 修复,反向选择日期范围,日期显示异常,[详情](https://ask.dcloud.net.cn/question/153401?item_id=212892&rf=false)
## 2.2.9(2022-09-16)
- 可以使用 uni-scss 控制主题色
## 2.2.8(2022-09-08)
- 修复 close事件无效的 bug
## 2.2.7(2022-09-05)
- 修复 移动端 maskClick 无效的 bug,详见:[https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false](https://ask.dcloud.net.cn/question/140824?item_id=209458&rf=false)
## 2.2.6(2022-06-30)
- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致
## 2.2.5(2022-06-24)
- 修复 日历顶部年月及底部确认未国际化 bug
## 2.2.4(2022-03-31)
- 修复 Vue3 下动态赋值,单选类型未响应的 bug
## 2.2.3(2022-03-28)
- 修复 Vue3 下动态赋值未响应的 bug
## 2.2.2(2021-12-10) ## 2.2.2(2021-12-10)
- 修复 clear-icon 属性在小程序平台不生效的 bug - 修复 clear-icon 属性在小程序平台不生效的 bug
## 2.2.1(2021-12-10) ## 2.2.1(2021-12-10)
......
...@@ -61,7 +61,9 @@ ...@@ -61,7 +61,9 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" >
$uni-primary: #007aff !default;
.uni-calendar-item__weeks-box { .uni-calendar-item__weeks-box {
flex: 1; flex: 1;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -78,7 +80,7 @@ ...@@ -78,7 +80,7 @@
font-size: 14px; font-size: 14px;
// font-family: Lato-Bold, Lato; // font-family: Lato-Bold, Lato;
font-weight: bold; font-weight: bold;
color: #455997; color: darken($color: $uni-primary, $amount: 40%);
} }
.uni-calendar-item__weeks-lunar-text { .uni-calendar-item__weeks-lunar-text {
...@@ -138,7 +140,7 @@ ...@@ -138,7 +140,7 @@
} }
.uni-calendar-item__weeks-box .uni-calendar-item--checked { .uni-calendar-item__weeks-box .uni-calendar-item--checked {
background-color: #007aff; background-color: $uni-primary;
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
border: 3px solid #fff; border: 3px solid #fff;
...@@ -159,7 +161,7 @@ ...@@ -159,7 +161,7 @@
.uni-calendar-item--multiple .uni-calendar-item--before-checked, .uni-calendar-item--multiple .uni-calendar-item--before-checked,
.uni-calendar-item--multiple .uni-calendar-item--after-checked { .uni-calendar-item--multiple .uni-calendar-item--after-checked {
background-color: #409eff; background-color: $uni-primary;
border-radius: 50%; border-radius: 50%;
box-sizing: border-box; box-sizing: border-box;
border: 3px solid #F6F7FC; border: 3px solid #F6F7FC;
......
<template> <template>
<view class="uni-calendar" @mouseleave="leaveCale"> <view class="uni-calendar" @mouseleave="leaveCale">
<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}" <view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
@click="clean"></view> @click="clean();maskClick()"></view>
<view v-if="insert || show" class="uni-calendar__content" <view v-if="insert || show" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}"> :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}">
<view class="uni-calendar__header" :class="{'uni-calendar__header-mobile' :!insert}"> <view class="uni-calendar__header" :class="{'uni-calendar__header-mobile' :!insert}">
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</view> </view>
<picker mode="date" :value="date" fields="month" @change="bindDateChange"> <picker mode="date" :value="date" fields="month" @change="bindDateChange">
<text <text
class="uni-calendar__header-text">{{ (nowDate.year||'') + '' + ( nowDate.month||'') +''}}</text> class="uni-calendar__header-text">{{ (nowDate.year||'') + yearText + ( nowDate.month||'') + monthText}}</text>
</picker> </picker>
<view v-if="right" class="uni-calendar__header-btn-box" @click.stop="next"> <view v-if="right" class="uni-calendar__header-btn-box" @click.stop="next">
<view class="uni-calendar__header-btn uni-calendar--right"></view> <view class="uni-calendar__header-btn uni-calendar--right"></view>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<text class="uni-calendar__weeks-day-text">{{SUNText}}</text> <text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{monText}}</text> <text class="uni-calendar__weeks-day-text">{{MONText}}</text>
</view> </view>
<view class="uni-calendar__weeks-day"> <view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{TUEText}}</text> <text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
...@@ -74,7 +74,9 @@ ...@@ -74,7 +74,9 @@
:hide-second="hideSecond" :disabled="!tempRange.before" class="time-picker-style"> :hide-second="hideSecond" :disabled="!tempRange.before" class="time-picker-style">
</time-picker> </time-picker>
</view> </view>
<uni-icons type="arrowthinright" color="#999" style="line-height: 50px;"></uni-icons> <view style="line-height: 50px;">
<uni-icons type="arrowthinright" color="#999"></uni-icons>
</view>
<view class="uni-date-changed--time-end"> <view class="uni-date-changed--time-end">
<view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view> <view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view>
<time-picker type="time" :end="reactEndTime" v-model="timeRange.endTime" :border="false" <time-picker type="time" :end="reactEndTime" v-model="timeRange.endTime" :border="false"
...@@ -86,7 +88,7 @@ ...@@ -86,7 +88,7 @@
<!-- <view class="uni-calendar__header-btn-box"> <!-- <view class="uni-calendar__header-btn-box">
<text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text> <text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text>
</view> --> </view> -->
<view class="uni-datetime-picker--btn" @click="confirm">确认</view> <view class="uni-datetime-picker--btn" @click="confirm">{{confirmText}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -332,7 +334,13 @@ ...@@ -332,7 +334,13 @@
okText() { okText() {
return t("uni-datetime-picker.ok") return t("uni-datetime-picker.ok")
}, },
monText() { yearText() {
return t("uni-datetime-picker.year")
},
monthText() {
return t("uni-datetime-picker.month")
},
MONText() {
return t("uni-calender.MON") return t("uni-calender.MON")
}, },
TUEText() { TUEText() {
...@@ -353,6 +361,9 @@ ...@@ -353,6 +361,9 @@
SUNText() { SUNText() {
return t("uni-calender.SUN") return t("uni-calender.SUN")
}, },
confirmText() {
return t("uni-calender.confirm")
},
}, },
created() { created() {
// 获取日历方法实例 // 获取日历方法实例
...@@ -402,6 +413,11 @@ ...@@ -402,6 +413,11 @@
this.close() this.close()
}, },
// 蒙版点击事件
maskClick() {
this.$emit('maskClose')
},
clearCalender() { clearCalender() {
if (this.range) { if (this.range) {
this.timeRange.startTime = '' this.timeRange.startTime = ''
...@@ -537,8 +553,16 @@ ...@@ -537,8 +553,16 @@
this.cale.setMultiple(this.calendar.fullDate, true) this.cale.setMultiple(this.calendar.fullDate, true)
this.weeks = this.cale.weeks this.weeks = this.cale.weeks
this.tempSingleDate = this.calendar.fullDate this.tempSingleDate = this.calendar.fullDate
const beforeStatus = this.cale.multipleStatus.before
const beforeDate = new Date(this.cale.multipleStatus.before).getTime()
const afterDate = new Date(this.cale.multipleStatus.after).getTime()
if (beforeDate > afterDate && afterDate) {
this.tempRange.before = this.cale.multipleStatus.after
this.tempRange.after = this.cale.multipleStatus.before
} else {
this.tempRange.before = this.cale.multipleStatus.before this.tempRange.before = this.cale.multipleStatus.before
this.tempRange.after = this.cale.multipleStatus.after this.tempRange.after = this.cale.multipleStatus.after
}
this.change() this.change()
}, },
/** /**
...@@ -594,7 +618,9 @@ ...@@ -594,7 +618,9 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" >
$uni-primary: #007aff !default;
.uni-calendar { .uni-calendar {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -705,7 +731,7 @@ ...@@ -705,7 +731,7 @@
text-align: center; text-align: center;
width: 100px; width: 100px;
font-size: 14px; font-size: 14px;
color: #007aff; color: $uni-primary;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
letter-spacing: 3px; letter-spacing: 3px;
/* #endif */ /* #endif */
...@@ -884,10 +910,10 @@ ...@@ -884,10 +910,10 @@
border-radius: 100px; border-radius: 100px;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
background-color: #007aff; background-color: $uni-primary;
color: #fff; color: #fff;
font-size: 16px; font-size: 16px;
letter-spacing: 5px; letter-spacing: 2px;
} }
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
......
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
"uni-datetime-picker.ok": "ok", "uni-datetime-picker.ok": "ok",
"uni-datetime-picker.clear": "clear", "uni-datetime-picker.clear": "clear",
"uni-datetime-picker.cancel": "cancel", "uni-datetime-picker.cancel": "cancel",
"uni-datetime-picker.year": "-",
"uni-datetime-picker.month": "",
"uni-calender.MON": "MON", "uni-calender.MON": "MON",
"uni-calender.TUE": "TUE", "uni-calender.TUE": "TUE",
"uni-calender.WED": "WED", "uni-calender.WED": "WED",
"uni-calender.THU": "THU", "uni-calender.THU": "THU",
"uni-calender.FRI": "FRI", "uni-calender.FRI": "FRI",
"uni-calender.SAT": "SAT", "uni-calender.SAT": "SAT",
"uni-calender.SUN": "SUN" "uni-calender.SUN": "SUN",
"uni-calender.confirm": "confirm"
} }
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
"uni-datetime-picker.ok": "确定", "uni-datetime-picker.ok": "确定",
"uni-datetime-picker.clear": "清除", "uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消", "uni-datetime-picker.cancel": "取消",
"uni-datetime-picker.year": "年",
"uni-datetime-picker.month": "月",
"uni-calender.SUN": "日", "uni-calender.SUN": "日",
"uni-calender.MON": "一", "uni-calender.MON": "一",
"uni-calender.TUE": "二", "uni-calender.TUE": "二",
"uni-calender.WED": "三", "uni-calender.WED": "三",
"uni-calender.THU": "四", "uni-calender.THU": "四",
"uni-calender.FRI": "五", "uni-calender.FRI": "五",
"uni-calender.SAT": "六" "uni-calender.SAT": "六",
"uni-calender.confirm": "确认"
} }
\ No newline at end of file
...@@ -9,11 +9,14 @@ ...@@ -9,11 +9,14 @@
"uni-datetime-picker.ok": "確定", "uni-datetime-picker.ok": "確定",
"uni-datetime-picker.clear": "清除", "uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消", "uni-datetime-picker.cancel": "取消",
"uni-datetime-picker.year": "年",
"uni-datetime-picker.month": "月",
"uni-calender.SUN": "日", "uni-calender.SUN": "日",
"uni-calender.MON": "一", "uni-calender.MON": "一",
"uni-calender.TUE": "二", "uni-calender.TUE": "二",
"uni-calender.WED": "三", "uni-calender.WED": "三",
"uni-calender.THU": "四", "uni-calender.THU": "四",
"uni-calender.FRI": "五", "uni-calender.FRI": "五",
"uni-calender.SAT": "六" "uni-calender.SAT": "六",
"uni-calender.confirm": "確認"
} }
\ No newline at end of file
...@@ -770,7 +770,9 @@ ...@@ -770,7 +770,9 @@
} }
</script> </script>
<style> <style lang="scss">
$uni-primary: #007aff !default;
.uni-datetime-picker { .uni-datetime-picker {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
/* width: 100%; */ /* width: 100%; */
...@@ -804,7 +806,7 @@ ...@@ -804,7 +806,7 @@
.uni-datetime-picker-btn-text { .uni-datetime-picker-btn-text {
font-size: 14px; font-size: 14px;
color: #007AFF; color: $uni-primary;
} }
.uni-datetime-picker-btn-group { .uni-datetime-picker-btn-group {
...@@ -889,6 +891,7 @@ ...@@ -889,6 +891,7 @@
.uni-datetime-picker-text { .uni-datetime-picker-text {
font-size: 14px; font-size: 14px;
line-height: 50px
} }
.uni-datetime-picker-sign { .uni-datetime-picker-sign {
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<view class="uni-date-editor--x" :class="{'uni-date-editor--x__disabled': disabled, <view class="uni-date-editor--x" :class="{'uni-date-editor--x__disabled': disabled,
'uni-date-x--border': border}"> 'uni-date-x--border': border}">
<view v-if="!isRange" class="uni-date-x uni-date-single"> <view v-if="!isRange" class="uni-date-x uni-date-single">
<uni-icons type="calendar" color="#e1e1e1" size="22"></uni-icons> <uni-icons type="calendar" color="#c0c4cc" size="22"></uni-icons>
<input class="uni-date__x-input" type="text" v-model="singleVal" <input class="uni-date__x-input" type="text" v-model="singleVal"
:placeholder="singlePlaceholderText" :disabled="true" /> :placeholder="singlePlaceholderText" :disabled="true" />
</view> </view>
<view v-else class="uni-date-x uni-date-range"> <view v-else class="uni-date-x uni-date-range">
<uni-icons type="calendar" color="#e1e1e1" size="22"></uni-icons> <uni-icons type="calendar" color="#c0c4cc" size="22"></uni-icons>
<input class="uni-date__x-input t-c" type="text" v-model="range.startDate" <input class="uni-date__x-input t-c" type="text" v-model="range.startDate"
:placeholder="startPlaceholderText" :disabled="true" /> :placeholder="startPlaceholderText" :disabled="true" />
<slot> <slot>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
:placeholder="endPlaceholderText" :disabled="true" /> :placeholder="endPlaceholderText" :disabled="true" />
</view> </view>
<view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear"> <view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
<uni-icons type="clear" color="#e1e1e1" size="18"></uni-icons> <uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons>
</view> </view>
</view> </view>
</slot> </slot>
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
:disabled="!tempSingleDate" /> :disabled="!tempSingleDate" />
</time-picker> </time-picker>
</view> </view>
<calendar ref="pcSingle" :showMonth="false" <calendar ref="pcSingle" :showMonth="false" :start-date="caleRange.startDate"
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :date="defSingleDate" :end-date="caleRange.endDate" :date="defSingleDate" @change="singleChange"
@change="singleChange" style="padding: 0 8px;" /> style="padding: 0 8px;" />
<view v-if="hasTime" class="popup-x-footer"> <view v-if="hasTime" class="popup-x-footer">
<!-- <text class="">此刻</text> --> <!-- <text class="">此刻</text> -->
<text class="confirm" @click="confirmSingleChange">{{okText}}</text> <text class="confirm" @click="confirmSingleChange">{{okText}}</text>
...@@ -74,13 +74,12 @@ ...@@ -74,13 +74,12 @@
</view> </view>
</view> </view>
<view class="popup-x-body"> <view class="popup-x-body">
<calendar ref="left" :showMonth="false" <calendar ref="left" :showMonth="false" :start-date="caleRange.startDate"
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :range="true" :end-date="caleRange.endDate" :range="true" @change="leftChange" :pleStatus="endMultipleStatus"
@change="leftChange" :pleStatus="endMultipleStatus" @firstEnterCale="updateRightCale" @firstEnterCale="updateRightCale" @monthSwitch="leftMonthSwitch" style="padding: 0 8px;" />
@monthSwitch="leftMonthSwitch" style="padding: 0 8px;" /> <calendar ref="right" :showMonth="false" :start-date="caleRange.startDate"
<calendar ref="right" :showMonth="false" :end-date="caleRange.endDate" :range="true" @change="rightChange"
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :range="true" :pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
@change="rightChange" :pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
@monthSwitch="rightMonthSwitch" style="padding: 0 8px;border-left: 1px solid #F1F1F1;" /> @monthSwitch="rightMonthSwitch" style="padding: 0 8px;border-left: 1px solid #F1F1F1;" />
</view> </view>
<view v-if="hasTime" class="popup-x-footer"> <view v-if="hasTime" class="popup-x-footer">
...@@ -92,7 +91,7 @@ ...@@ -92,7 +91,7 @@
<calendar v-show="isPhone" ref="mobile" :clearDate="false" :date="defSingleDate" :defTime="reactMobDefTime" <calendar v-show="isPhone" ref="mobile" :clearDate="false" :date="defSingleDate" :defTime="reactMobDefTime"
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :selectableTimes="mobSelectableTime" :start-date="caleRange.startDate" :end-date="caleRange.endDate" :selectableTimes="mobSelectableTime"
:pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :typeHasTime="hasTime" :insert="false" :pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :typeHasTime="hasTime" :insert="false"
:hideSecond="hideSecond" @confirm="mobileChange" /> :hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" />
</view> </view>
</template> </template>
<script> <script>
...@@ -128,10 +127,23 @@ ...@@ -128,10 +127,23 @@
export default { export default {
name: 'UniDatetimePicker', name: 'UniDatetimePicker',
options: {
virtualHost: true
},
components: { components: {
calendar, calendar,
timePicker timePicker
}, },
inject: {
form: {
from: 'uniForm',
default: null
},
formItem: {
from: 'uniFormItem',
default: null
},
},
data() { data() {
return { return {
isRange: false, isRange: false,
...@@ -256,6 +268,7 @@ ...@@ -256,6 +268,7 @@
} }
} }
}, },
// #ifndef VUE3
value: { value: {
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
...@@ -266,7 +279,19 @@ ...@@ -266,7 +279,19 @@
this.initPicker(newVal) this.initPicker(newVal)
} }
}, },
// #endif
// #ifdef VUE3
modelValue: {
immediate: true,
handler(newVal, oldVal) {
if (this.isEmitValue) {
this.isEmitValue = false
return
}
this.initPicker(newVal)
}
},
// #endif
start: { start: {
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
...@@ -281,7 +306,6 @@ ...@@ -281,7 +306,6 @@
} }
} }
}, },
end: { end: {
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
...@@ -364,39 +388,27 @@ ...@@ -364,39 +388,27 @@
return t("uni-datetime-picker.clear") return t("uni-datetime-picker.clear")
}, },
showClearIcon() { showClearIcon() {
const { clearIcon, disabled, singleVal, range } = this const {
clearIcon,
disabled,
singleVal,
range
} = this
const bool = clearIcon && !disabled && (singleVal || (range.startDate && range.endDate)) const bool = clearIcon && !disabled && (singleVal || (range.startDate && range.endDate))
return bool return bool
} }
}, },
created() { created() {
this.form = this.getForm('uniForms') // if (this.form && this.formItem) {
this.formItem = this.getForm('uniFormsItem') // this.$watch('formItem.errMsg', (newVal) => {
// this.localMsg = newVal
// if (this.formItem) { // })
// if (this.formItem.name) {
// this.rename = this.formItem.name
// this.form.inputChildrens.push(this)
// }
// } // }
}, },
mounted() { mounted() {
this.platform() this.platform()
}, },
methods: { methods: {
/**
* 获取父元素实例
*/
getForm(name = 'uniForms') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false
parentName = parent.$options.name;
}
return parent;
},
initPicker(newVal) { initPicker(newVal) {
if (!newVal || Array.isArray(newVal) && !newVal.length) { if (!newVal || Array.isArray(newVal) && !newVal.length) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -504,6 +516,7 @@ ...@@ -504,6 +516,7 @@
setTimeout(() => { setTimeout(() => {
this.popup = false this.popup = false
this.$emit('maskClick', this.value) this.$emit('maskClick', this.value)
this.$refs.mobile.close()
}, 20) }, 20)
}, },
setEmit(value) { setEmit(value) {
...@@ -529,7 +542,8 @@ ...@@ -529,7 +542,8 @@
} }
} }
} }
this.formItem && this.formItem.setValue(value)
this.$emit('change', value) this.$emit('change', value)
this.$emit('input', value) this.$emit('input', value)
this.$emit('update:modelValue', value) this.$emit('update:modelValue', value)
...@@ -694,7 +708,15 @@ ...@@ -694,7 +708,15 @@
this.$refs.pcSingle && this.$refs.pcSingle.clearCalender() this.$refs.pcSingle && this.$refs.pcSingle.clearCalender()
} }
if (needEmit) { if (needEmit) {
this.formItem && this.formItem.setValue('') // 校验规则
// if(this.form && this.formItem){
// const {
// validateTrigger
// } = this.form
// if (validateTrigger === 'blur') {
// this.formItem.onFieldChange()
// }
// }
this.$emit('change', '') this.$emit('change', '')
this.$emit('input', '') this.$emit('input', '')
this.$emit('update:modelValue', '') this.$emit('update:modelValue', '')
...@@ -714,7 +736,6 @@ ...@@ -714,7 +736,6 @@
this.$refs.right && this.$refs.right.next() this.$refs.right && this.$refs.right.next()
} }
if (needEmit) { if (needEmit) {
this.formItem && this.formItem.setValue([])
this.$emit('change', []) this.$emit('change', [])
this.$emit('input', []) this.$emit('input', [])
this.$emit('update:modelValue', []) this.$emit('update:modelValue', [])
...@@ -762,7 +783,15 @@ ...@@ -762,7 +783,15 @@
} }
</script> </script>
<style> <style lang="scss">
$uni-primary: #007aff !default;
.uni-date {
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
flex: 1;
}
.uni-date-x { .uni-date-x {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -773,25 +802,25 @@ ...@@ -773,25 +802,25 @@
background-color: #fff; background-color: #fff;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
flex: 1;
} }
.uni-date-x--border { .uni-date-x--border {
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
border: 1px solid #dcdfe6; border: 1px solid #e5e5e5;
} }
.uni-date-editor--x { .uni-date-editor--x {
display: flex;
align-items: center;
position: relative; position: relative;
} }
.uni-date-editor--x .uni-date__icon-clear { .uni-date-editor--x .uni-date__icon-clear {
position: absolute; padding: 0 5px;
top: 0; display: flex;
right: 0; align-items: center;
display: inline-block;
box-sizing: border-box;
border: 9px solid transparent;
/* #ifdef H5 */ /* #ifdef H5 */
cursor: pointer; cursor: pointer;
/* #endif */ /* #endif */
...@@ -799,10 +828,15 @@ ...@@ -799,10 +828,15 @@
.uni-date__x-input { .uni-date__x-input {
padding: 0 8px; padding: 0 8px;
height: 40px; /* #ifndef APP-NVUE */
width: 100%; width: auto;
line-height: 40px; /* #endif */
position: relative;
overflow: hidden;
flex: 1;
line-height: 1;
font-size: 14px; font-size: 14px;
height: 35px;
} }
.t-c { .t-c {
...@@ -910,14 +944,14 @@ ...@@ -910,14 +944,14 @@
} }
.popup-x-footer text:hover { .popup-x-footer text:hover {
color: #007aff; color: $uni-primary;
cursor: pointer; cursor: pointer;
opacity: 0.8; opacity: 0.8;
} }
.popup-x-footer .confirm { .popup-x-footer .confirm {
margin-left: 20px; margin-left: 20px;
color: #007aff; color: $uni-primary;
} }
.uni-date-changed { .uni-date-changed {
......
{ {
"id": "uni-datetime-picker", "id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器", "displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.2", "version": "2.2.11",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [ "keywords": [
"uni-datetime-picker", "uni-datetime-picker",
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -38,7 +34,8 @@ ...@@ -38,7 +34,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
......
## 1.1.1(2022-09-19)
- 修复,输入后回车,change 事件触发两次,[详情](https://ask.dcloud.net.cn/question/152149)
## 1.1.0(2022-06-30) ## 1.1.0(2022-06-30)
- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容 - 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容
- 新增 clear 事件,点击右侧叉号图标触发 - 新增 clear 事件,点击右侧叉号图标触发
......
...@@ -202,7 +202,8 @@ ...@@ -202,7 +202,8 @@
showClearIcon: false, showClearIcon: false,
showPassword: false, showPassword: false,
focusShow: false, focusShow: false,
localMsg: '' localMsg: '',
isEnter: false // 用于判断当前是否是使用回车操作
}; };
}, },
computed: { computed: {
...@@ -372,7 +373,9 @@ ...@@ -372,7 +373,9 @@
this.focusShow = false this.focusShow = false
this.$emit('blur', event); this.$emit('blur', event);
// 根据类型返回值,在event中获取的值理论上讲都是string // 根据类型返回值,在event中获取的值理论上讲都是string
if (this.isEnter === false) {
this.$emit('change', this.val) this.$emit('change', this.val)
}
// 失去焦点时参与表单校验 // 失去焦点时参与表单校验
if (this.form && this.formItem) { if (this.form && this.formItem) {
const { const {
...@@ -390,7 +393,11 @@ ...@@ -390,7 +393,11 @@
*/ */
onConfirm(e) { onConfirm(e) {
this.$emit('confirm', this.val); this.$emit('confirm', this.val);
this.isEnter = true;
this.$emit('change', this.val) this.$emit('change', this.val)
this.$nextTick(() => {
this.isEnter = false
})
}, },
/** /**
......
{ {
"id": "uni-easyinput", "id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框", "displayName": "uni-easyinput 增强输入框",
"version": "1.1.0", "version": "1.1.1",
"description": "Easyinput 组件是对原生input组件的增强", "description": "Easyinput 组件是对原生input组件的增强",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -38,7 +34,8 @@ ...@@ -38,7 +34,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
......
## 1.2.4(2022-09-07)
小程序端由于 style 使用了对象导致报错,[详情](https://ask.dcloud.net.cn/question/152790?item_id=211778&rf=false)
## 1.2.3(2022-09-05)
- 修复 nvue 环境下,具有 tabBar 时,fab 组件下部位置无法正常获取 --window-bottom 的bug,详见:[https://ask.dcloud.net.cn/question/110638?notification_id=826310](https://ask.dcloud.net.cn/question/110638?notification_id=826310)
## 1.2.2(2021-12-29) ## 1.2.2(2021-12-29)
- 更新 组件依赖 - 更新 组件依赖
## 1.2.1(2021-11-19) ## 1.2.1(2021-11-19)
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
'uni-fab--rightBottom': rightBottom, 'uni-fab--rightBottom': rightBottom,
'uni-fab--leftTop': leftTop, 'uni-fab--leftTop': leftTop,
'uni-fab--rightTop': rightTop 'uni-fab--rightTop': rightTop
}" class="uni-fab"> }" class="uni-fab"
:style="nvueBottom"
>
<view :class="{ <view :class="{
'uni-fab__content--left': horizontal === 'left', 'uni-fab__content--left': horizontal === 'left',
'uni-fab__content--right': horizontal === 'right', 'uni-fab__content--right': horizontal === 'right',
...@@ -32,7 +34,7 @@ ...@@ -32,7 +34,7 @@
'uni-fab__circle--leftTop': leftTop, 'uni-fab__circle--leftTop': leftTop,
'uni-fab__circle--rightTop': rightTop, 'uni-fab__circle--rightTop': rightTop,
'uni-fab__content--other-platform': !isAndroidNvue 'uni-fab__content--other-platform': !isAndroidNvue
}" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor }" @click="_onClick"> }" class="uni-fab__circle uni-fab__plus" :style="{ 'background-color': styles.buttonColor, 'bottom': nvueBottom }" @click="_onClick">
<uni-icons class="fab-circle-icon" type="plusempty" :color="styles.iconColor" size="32" <uni-icons class="fab-circle-icon" type="plusempty" :color="styles.iconColor" size="32"
:class="{'uni-fab__plus--active': isShow && content.length > 0}"></uni-icons> :class="{'uni-fab__plus--active': isShow && content.length > 0}"></uni-icons>
<!-- <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view> <!-- <view class="fab-circle-v" :class="{'uni-fab__plus--active': isShow && content.length > 0}"></view>
...@@ -158,6 +160,16 @@ ...@@ -158,6 +160,16 @@
}, },
horizontalRight() { horizontalRight() {
return this.getPosition(2, 'horizontal', 'right') return this.getPosition(2, 'horizontal', 'right')
},
// 计算 nvue bottom
nvueBottom() {
const safeBottom = uni.getSystemInfoSync().windowBottom;
// #ifdef APP-NVUE
return 30 + safeBottom
// #endif
// #ifndef APP-NVUE
return 30
// #endif
} }
}, },
watch: { watch: {
......
{ {
"id": "uni-fab", "id": "uni-fab",
"displayName": "uni-fab 悬浮按钮", "displayName": "uni-fab 悬浮按钮",
"version": "1.2.2", "version": "1.2.4",
"description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -38,7 +34,8 @@ ...@@ -38,7 +34,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss","uni-icons"], "dependencies": ["uni-scss","uni-icons"],
......
## 1.2.1(2022-05-30)
- 新增 stat 属性 ,是否开启uni统计功能
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fav](https://uniapp.dcloud.io/component/uniui/uni-fav) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fav](https://uniapp.dcloud.io/component/uniui/uni-fav)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
* @property {Boolean} circle = [true|false] 是否为圆角 * @property {Boolean} circle = [true|false] 是否为圆角
* @property {Boolean} checked = [true|false] 是否为已收藏 * @property {Boolean} checked = [true|false] 是否为已收藏
* @property {Object} contentText = [true|false] 收藏按钮文字 * @property {Object} contentText = [true|false] 收藏按钮文字
* @property {Boolean} stat 是否开启统计功能
* @event {Function} click 点击 fav按钮触发事件 * @event {Function} click 点击 fav按钮触发事件
* @example <uni-fav :checked="true"/> * @example <uni-fav :checked="true"/>
*/ */
...@@ -79,6 +80,10 @@ ...@@ -79,6 +80,10 @@
contentFav: "" contentFav: ""
}; };
} }
},
stat:{
type: Boolean,
default: false
} }
}, },
computed: { computed: {
...@@ -91,7 +96,7 @@ ...@@ -91,7 +96,7 @@
}, },
watch: { watch: {
checked() { checked() {
if (uni.report) { if (uni.report && this.stat) {
if (this.checked) { if (this.checked) {
uni.report("收藏", "收藏"); uni.report("收藏", "收藏");
} else { } else {
...@@ -108,7 +113,7 @@ ...@@ -108,7 +113,7 @@
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" >
$fav-height: 25px; $fav-height: 25px;
.uni-fav { .uni-fav {
......
{ {
"id": "uni-fav", "id": "uni-fav",
"displayName": "uni-fav 收藏按钮", "displayName": "uni-fav 收藏按钮",
"version": "1.2.0", "version": "1.2.1",
"description": " Fav 收藏组件,可自定义颜色、大小。", "description": " Fav 收藏组件,可自定义颜色、大小。",
"keywords": [ "keywords": [
"fav", "fav",
......
## 1.1.0(2022-07-13)
新增,应用[pages_init](https://uniapp.dcloud.io/plugin/publish.html#pages-init)当导入插件到项目工程时,自动合并本插件的页面路由到项目的pages.json
## 1.0.5(2022-07-13)
新增,应用[pages_init](https://uniapp.dcloud.io/plugin/publish.html#pages-init)当导入插件到项目工程时,自动合并本插件的页面路由到项目的pages.json
## 1.0.4(2021-09-26) ## 1.0.4(2021-09-26)
为了数据安全,`opendb-feedback`表的`permission``delete``update`的值默认为`false` 为了数据安全,`opendb-feedback`表的`permission``delete``update`的值默认为`false`
## 1.0.3(2021-08-26) ## 1.0.3(2021-08-26)
......
{ {
"id": "uni-feedback", "id": "uni-feedback",
"displayName": "问题反馈页面模板", "displayName": "问题反馈页面模板",
"version": "1.0.4", "version": "1.1.0",
"description": "问题反馈页面模板,方便开发者快速搭建问题反馈界面", "description": "问题反馈页面模板,方便开发者快速搭建问题反馈界面",
"keywords": [ "keywords": [
"问题反馈页面模板" "问题反馈页面模板"
...@@ -72,7 +72,11 @@ ...@@ -72,7 +72,11 @@
"阿里": "y", "阿里": "y",
"百度": "y", "百度": "y",
"字节跳动": "y", "字节跳动": "y",
"QQ": "y" "QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
fabClick() { fabClick() {
// 打开新增页面 // 打开新增页面
uni.navigateTo({ uni.navigateTo({
url: './add', url: './opendb-feedback',
events: { events: {
// 监听新增数据成功后, 刷新当前页面数据 // 监听新增数据成功后, 刷新当前页面数据
refreshData: () => { refreshData: () => {
......
## 1.0.2(2022-07-04)
- 修复 在uni-forms下样式不生效的bug
## 1.0.1(2021-11-23) ## 1.0.1(2021-11-23)
- 修复 参数为对象的情况下,url在某些情况显示错误的bug - 修复 参数为对象的情况下,url在某些情况显示错误的bug
## 1.0.0(2021-11-19) ## 1.0.0(2021-11-19)
......
...@@ -84,6 +84,9 @@ ...@@ -84,6 +84,9 @@
uploadImage, uploadImage,
uploadFile uploadFile
}, },
options: {
virtualHost: true
},
emits: ['select', 'success', 'fail', 'progress', 'delete', 'update:modelValue', 'input'], emits: ['select', 'success', 'fail', 'progress', 'delete', 'update:modelValue', 'input'],
props: { props: {
// #ifdef VUE3 // #ifdef VUE3
...@@ -278,7 +281,7 @@ ...@@ -278,7 +281,7 @@
files.push(Object.assign({}, v)) files.push(Object.assign({}, v))
} }
}) })
this.uploadFiles(files) return this.uploadFiles(files)
}, },
async setValue(newVal, oldVal) { async setValue(newVal, oldVal) {
const newData = async (v) => { const newData = async (v) => {
...@@ -416,11 +419,12 @@ ...@@ -416,11 +419,12 @@
*/ */
uploadFiles(files) { uploadFiles(files) {
files = [].concat(files) files = [].concat(files)
uploadCloudFiles.call(this, files, 5, res => { return uploadCloudFiles.call(this, files, 5, res => {
this.setProgress(res, res.index, true) this.setProgress(res, res.index, true)
}) })
.then(result => { .then(result => {
this.setSuccessAndError(result) this.setSuccessAndError(result)
return result;
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
...@@ -606,7 +610,9 @@ ...@@ -606,7 +610,9 @@
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
width: 100%;
/* #endif */ /* #endif */
flex: 1;
} }
.uni-file-picker__header { .uni-file-picker__header {
......
{ {
"id": "uni-file-picker", "id": "uni-file-picker",
"displayName": "uni-file-picker 文件选择上传", "displayName": "uni-file-picker 文件选择上传",
"version": "1.0.1", "version": "1.0.2",
"description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间", "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.2.1(2022-05-30)
- 新增 stat属性,是否开启uni统计功能
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-goods-nav](https://uniapp.dcloud.io/component/uniui/uni-goods-nav) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-goods-nav](https://uniapp.dcloud.io/component/uniui/uni-goods-nav)
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
* @property {Array} options 组件参数 * @property {Array} options 组件参数
* @property {Array} buttonGroup 组件按钮组参数 * @property {Array} buttonGroup 组件按钮组参数
* @property {Boolean} fill = [true | false] 组件按钮组参数 * @property {Boolean} fill = [true | false] 组件按钮组参数
* @property {Boolean} stat 是否开启统计功能
* @event {Function} click 左侧点击事件 * @event {Function} click 左侧点击事件
* @event {Function} buttonClick 右侧按钮组点击事件 * @event {Function} buttonClick 右侧按钮组点击事件
* @example <uni-goods-nav :fill="true" options="" buttonGroup="buttonGroup" @click="" @buttonClick="" /> * @example <uni-goods-nav :fill="true" options="" buttonGroup="buttonGroup" @click="" @buttonClick="" />
...@@ -77,6 +78,10 @@ ...@@ -77,6 +78,10 @@
fill: { fill: {
type: Boolean, type: Boolean,
default: false default: false
},
stat:{
type: Boolean,
default: false
} }
}, },
methods: { methods: {
...@@ -87,7 +92,7 @@ ...@@ -87,7 +92,7 @@
}) })
}, },
buttonClick(index, item) { buttonClick(index, item) {
if (uni.report) { if (uni.report && this.stat) {
uni.report(item.text, item.text) uni.report(item.text, item.text)
} }
this.$emit('buttonClick', { this.$emit('buttonClick', {
...@@ -99,7 +104,7 @@ ...@@ -99,7 +104,7 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" >
.flex { .flex {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
......
{ {
"id": "uni-goods-nav", "id": "uni-goods-nav",
"displayName": "uni-goods-nav 商品导航", "displayName": "uni-goods-nav 商品导航",
"version": "1.2.0", "version": "1.2.1",
"description": "商品导航组件主要用于电商类应用底部导航,可自定义加入购物车,购买等操作", "description": "商品导航组件主要用于电商类应用底部导航,可自定义加入购物车,购买等操作",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.2.2(2022-05-30)
- 新增 stat属性,是否开启uni统计功能
## 1.2.1(2021-11-22) ## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题 - 修复 vue3中某些scss变量无法找到的问题
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
......
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
mode: { mode: {
type: String, type: String,
default: 'default' default: 'default'
},
stat:{
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -45,7 +49,7 @@ ...@@ -45,7 +49,7 @@
}, },
watch: { watch: {
title(newVal) { title(newVal) {
if (uni.report && newVal !== '') { if (uni.report && this.stat && newVal !== '') {
uni.report('title', newVal) uni.report('title', newVal)
} }
} }
...@@ -77,7 +81,7 @@ ...@@ -77,7 +81,7 @@
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" >
.uni-group { .uni-group {
background: #fff; background: #fff;
margin-top: 10px; margin-top: 10px;
......
{ {
"id": "uni-group", "id": "uni-group",
"displayName": "uni-group 分组", "displayName": "uni-group 分组",
"version": "1.2.1", "version": "1.2.2",
"description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块", "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.0.19(2022-09-20)
- 修复 小程序端,使用将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)的uni-ui组件,样式错乱的问题
## 1.0.18(2022-09-20)
- 修复 微信小程序端 WXSS 编译报错的bug
## 1.0.17(2022.09-19)
- 修复 无法退出登录的bug
## 1.0.16(2022-09-19)
- 修复 在 Edge 浏览器下 input[type="password"] 会出现浏览器自带的密码查看按钮
- 优化 退出登录重定向页面为 uniIdRouter.loginPage
- 新增 注册账号页面支持返回登录页面
## 1.0.15(2022-09-19)
- 更新表结构,解决在uni-admin中部分clientDB操作没有权限的问题
## 1.0.14(2022-09-16) ## 1.0.14(2022-09-16)
- 修改 配置项`isAdmin`默认值为`false` - 修改 配置项`isAdmin`默认值为`false`
## 1.0.13(2022-09-16) ## 1.0.13(2022-09-16)
......
import config from '../config' import pagesJson from '@/pages.json'
const uniIdCo = uniCloud.importObject("uni-id-co") const uniIdCo = uniCloud.importObject("uni-id-co")
export default { export default {
async logout() { async logout() {
...@@ -6,7 +6,7 @@ export default { ...@@ -6,7 +6,7 @@ export default {
uni.removeStorageSync('uni_id_token'); uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0) uni.setStorageSync('uni_id_token_expired', 0)
uni.redirectTo({ uni.redirectTo({
url: config.isAdmin ? '/uni_modules/uni-id-pages/pages/login/login-withpwd': '/uni_modules/uni-id-pages/pages/login/login-withoutpwd', url: `/${pagesJson.uniIdRouter?.loginPage ?? 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`,
}); });
uni.$emit('uni-id-pages-logout') uni.$emit('uni-id-pages-logout')
}, },
......
// 隐藏 edge 浏览器的密码查看按钮
/* #ifdef H5 */
.input-box ::v-deep{
.uni-input-input[type="password"] {
&::-ms-reveal {
display: none;
}
}
}
/* #endif */
.uni-content { .uni-content {
padding: 0 60rpx; padding: 0 60rpx;
} }
...@@ -68,9 +80,15 @@ ...@@ -68,9 +80,15 @@
margin: 6px 0; margin: 6px 0;
} }
/* #ifdef MP */
// 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98)
.uni-content ::v-deep .uni-easyinput__content,
/* #endif */
.input-box { .input-box {
padding: 4px; padding: 4px;
background-color: #F8F8F8; background-color: #F8F8F8 !important;
border-radius: 0; border-radius: 0;
font-size: 14px; font-size: 14px;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -100,4 +118,3 @@ ...@@ -100,4 +118,3 @@
.uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd{ .uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd{
height: auto !important; height: auto !important;
} }
\ No newline at end of file
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.0.14", "version": "1.0.19",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
......
...@@ -170,6 +170,10 @@ ...@@ -170,6 +170,10 @@
position: relative; position: relative;
} }
/* #ifdef MP */
// 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98)
.phone-box ::v-deep .uni-easyinput__content,
/* #endif */
.input-box { .input-box {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
box-sizing: border-box; box-sizing: border-box;
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<view class="link-box"> <view class="link-box">
<text class="link" @click="retrieveByPhone">通过手机验证码找回密码</text> <text class="link" @click="retrieveByPhone">通过手机验证码找回密码</text>
<view></view> <view></view>
<text class="link" @click="backLogin">返回登录</text>
</view> </view>
</match-media> </match-media>
</uni-forms> </uni-forms>
...@@ -182,6 +183,11 @@ ...@@ -182,6 +183,11 @@
uni.navigateTo({ uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve' url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve'
}) })
},
backLogin () {
uni.redirectTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
} }
} }
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<view class="link-box"> <view class="link-box">
<text class="link" @click="retrieveByEmail">通过邮箱验证码找回密码</text> <text class="link" @click="retrieveByEmail">通过邮箱验证码找回密码</text>
<view></view> <view></view>
<text class="link" @click="backLogin">返回登录</text>
</view> </view>
</match-media> </match-media>
</uni-forms> </uni-forms>
...@@ -206,6 +207,11 @@ ...@@ -206,6 +207,11 @@
uni.navigateTo({ uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email' url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email'
}) })
},
backLogin () {
uni.redirectTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
} }
} }
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<script> <script>
import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js'; import mixin from '@/uni_modules/uni-id-pages/common/login-page.mixin.js';
import passwordMod from '@/uni_modules/uni-id-pages/common/password.js'
const uniIdCo = uniCloud.importObject("uni-id-co", { const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI:true customUI:true
}) })
...@@ -58,36 +59,7 @@ ...@@ -58,36 +59,7 @@
} }
] ]
}, },
newPassword: { ...passwordMod.getPwdRules('newPassword', 'newPassword2')
rules: [{
required: true,
errorMessage: '请输入新密码',
},
{
pattern: /^.{6,20}$/,
errorMessage: '密码为6 - 20位',
}
]
},
newPassword2: {
rules: [{
required: true,
errorMessage: '请确认密码',
},
{
pattern: /^.{6,20}$/,
errorMessage: '密码为6 - 20位',
},
{
validateFunction: function(rule, value, data, callback) {
if (value != data.newPassword) {
callback('两次输入密码不一致')
};
return true
}
}
]
}
}, },
logo: "/static/logo.png" logo: "/static/logo.png"
} }
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
this.$refs['bind-mobile'].open() this.$refs['bind-mobile-by-sms'].open()
// #endif // #endif
// #ifdef H5 // #ifdef H5
......
{ {
"name": "uni-id-co", "name": "uni-id-co",
"version": "1.0.13", "version": "1.0.19",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"keywords": [], "keywords": [],
......
{ {
"bsonType": "object", "bsonType": "object",
"required": ["user_id"],
"permission": {
"read": "'READ_UNI_ID_LOG' in auth.permission"
},
"properties": { "properties": {
"_id": { "_id": {
"description": "ID,系统自动生成" "description": "ID,系统自动生成"
...@@ -44,6 +48,7 @@ ...@@ -44,6 +48,7 @@
}, },
"user_id": { "user_id": {
"bsonType": "string", "bsonType": "string",
"foreignKey": "uni-id-users._id",
"description": "用户id,参考uni-id-users表" "description": "用户id,参考uni-id-users表"
}, },
"username": { "username": {
...@@ -62,6 +67,5 @@ ...@@ -62,6 +67,5 @@
"bsonType": "string", "bsonType": "string",
"description": "客户端DCloud AppId" "description": "客户端DCloud AppId"
} }
}, }
"required": []
} }
{ {
"bsonType": "object", "bsonType": "object",
"required": ["permission_id", "permission_name"],
"permission": {
"read": "'READ_UNI_ID_PERMISSIONS' in auth.permission",
"create": "'CREATE_UNI_ID_PERMISSIONS' in auth.permission",
"update": "'UPDATE_UNI_ID_PERMISSIONS' in auth.permission",
"delete": "'DELETE_UNI_ID_PERMISSIONS' in auth.permission"
},
"properties": { "properties": {
"_id": { "_id": {
"description": "存储文档 ID,系统自动生成" "description": "存储文档 ID,系统自动生成"
...@@ -41,9 +48,5 @@ ...@@ -41,9 +48,5 @@
"title": "权限名称", "title": "权限名称",
"trim": "both" "trim": "both"
} }
}, }
"required": [
"permission_id",
"permission_name"
]
} }
{ {
"bsonType": "object", "bsonType": "object",
"required": ["role_id", "role_name"],
"permission": { "permission": {
"create": false, "read": "'READ_UNI_ID_ROLES' in auth.permission",
"delete": false, "create": "'CREATE_UNI_ID_ROLES' in auth.permission",
"read": false, "update": "'UPDATE_UNI_ID_ROLES' in auth.permission",
"update": false "delete": "'DELETE_UNI_ID_ROLES' in auth.permission"
}, },
"properties": { "properties": {
"_id": { "_id": {
"description": "存储文档 ID,系统自动生成" "description": "存储文档 ID,系统自动生成"
}, },
"comment": { "comment": {
"title": "备注",
"bsonType": "string", "bsonType": "string",
"description": "备注", "description": "备注",
"title": "备注",
"trim": "both" "trim": "both"
}, },
"create_date": { "create_date": {
...@@ -24,25 +25,26 @@ ...@@ -24,25 +25,26 @@
} }
}, },
"permission": { "permission": {
"title": "权限",
"bsonType": "array", "bsonType": "array",
"description": "角色拥有的权限列表",
"foreignKey": "uni-id-permissions.permission_id", "foreignKey": "uni-id-permissions.permission_id",
"title": "权限" "description": "角色拥有的权限列表",
"enum": {
"collection": "uni-id-permissions",
"field": "permission_name as text, permission_id as value"
}
}, },
"role_id": { "role_id": {
"title": "唯一ID",
"bsonType": "string", "bsonType": "string",
"description": "角色唯一标识,不可修改,不允许重复", "description": "角色唯一标识,不可修改,不允许重复",
"title": "唯一ID",
"trim": "both" "trim": "both"
}, },
"role_name": { "role_name": {
"title": "名称",
"bsonType": "string", "bsonType": "string",
"description": "角色名称", "description": "角色名称",
"title": "名称",
"trim": "both" "trim": "both"
} }
}, }
"required": [
"role_id"
]
} }
{ {
"bsonType": "object", "bsonType": "object",
"required": ["username", "password"],
"permission": { "permission": {
"update": "doc._id == auth.uid", "read": true,
"read": true "create": "'CREATE_UNI_ID_USERS' in auth.permission",
"update": "doc._id == auth.uid || 'UPDATE_UNI_ID_USERS' in auth.permission",
"delete": "'DELETE_UNI_ID_USERS' in auth.permission"
}, },
"properties": { "properties": {
"_id": { "_id": {
...@@ -425,6 +428,5 @@ ...@@ -425,6 +428,5 @@
"read": "doc._id == auth.uid" "read": "doc._id == auth.uid"
} }
} }
}, }
"required": []
} }
## 3.3.28(2022-07-27)
- 修复 app端微信登录返回的accessToken过期时间(expired)不正确的Bug
## 3.3.27(2022-07-27)
- 短信发送失败、微信登录失败等场景下输出原始错误方便排查错误
## 3.3.26(2022-07-08)
- 兼容配置放在uni-id下的逻辑,但是仍推荐使用uni-config-center
## 3.3.25(2022-06-30)
- 修复config文件不合法时未抛出具体错误的Bug
## 3.3.24(2022-06-28)
- 修复3.3.12引出的使用多应用配置时报错的Bug
## 3.3.23(2022-06-13)
- 修复上版本引出的部分依赖未找到的Bug
## 3.3.22(2022-06-13)
- 新增 preferedWebPlatform 配置用于解决HBuilderX 3.4.9版本起web端platform不一致的问题 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=prefered-web-platform)
## 3.3.21(2022-05-24)
- 修复createInstance传入clientInfo无效的Bug
## 3.3.20(2022-05-19)
- 调整以下错误码(账号已注册[uni-id-account-exists]、账号不存在[uni-id-account-not-exists]、账号已绑定[uni-id-account-bound])
## 3.3.19(2022-05-19)
- 修复 addUser 部分情况下会创建出重复账号的Bug
## 3.3.18(2022-05-12)
- 调整绑定、解绑邮箱手机号接口,只要传递code参数就进行验证码校验即使传递的值为undefined
## 3.3.17(2022-05-09) ## 3.3.17(2022-05-09)
- register_env内增加os_name字段用于区分注册时的客户端系统类型 - register_env内增加os_name字段用于区分注册时的客户端系统类型
## 3.3.16(2022-05-09) ## 3.3.16(2022-05-09)
......
{ {
"id": "uni-id", "id": "uni-id",
"displayName": "uni-id", "displayName": "uni-id",
"version": "3.3.17", "version": "3.3.28",
"description": "简单、统一、可扩展的用户中心", "description": "简单、统一、可扩展的用户中心",
"keywords": [ "keywords": [
"uniid", "uniid",
...@@ -14,11 +14,7 @@ ...@@ -14,11 +14,7 @@
"engines": { "engines": {
"HBuilderX": "^3.1.0" "HBuilderX": "^3.1.0"
}, },
"dcloudext": { "dcloudext": {
"category": [
"uniCloud",
"云函数模板"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -35,7 +31,8 @@ ...@@ -35,7 +31,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "" "npmurl": "",
"type": "unicloud-template-function"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-config-center"], "dependencies": ["uni-config-center"],
...@@ -68,7 +65,11 @@ ...@@ -68,7 +65,11 @@
"阿里": "u", "阿里": "u",
"百度": "u", "百度": "u",
"字节跳动": "u", "字节跳动": "u",
"QQ": "u" "QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
}, },
"快应用": { "快应用": {
"华为": "u", "华为": "u",
......
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{
"name": "uni-id",
"version": "3.3.28",
"description": "uni-id for uniCloud",
"main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
"repository": {
"type": "git",
"url": "git+https://gitee.com/dcloud/uni-id.git"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
}
}
\ No newline at end of file
## 1.3.6(2022-06-30)
- 修复 组件示例中插槽用法无法显示内容的bug
## 1.3.5(2022-05-24)
- 新增 stat 属性 ,可开启统计title 上报 ,仅使用了title 属性且项目开启了uni统计生效
## 1.3.4(2022-01-24) ## 1.3.4(2022-01-24)
- 更新 组件示例 - 更新 组件示例
## 1.3.3(2022-01-24) ## 1.3.3(2022-01-24)
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
* @property {Boolean} fixed = [true|false] 是否固定顶部 * @property {Boolean} fixed = [true|false] 是否固定顶部
* @property {Boolean} statusBar = [true|false] 是否包含状态栏 * @property {Boolean} statusBar = [true|false] 是否包含状态栏
* @property {Boolean} shadow = [true|false] 导航栏下是否有阴影 * @property {Boolean} shadow = [true|false] 导航栏下是否有阴影
* @property {Boolean} stat 是否开启统计标题上报
* @event {Function} clickLeft 左侧按钮点击时触发 * @event {Function} clickLeft 左侧按钮点击时触发
* @event {Function} clickRight 右侧按钮点击时触发 * @event {Function} clickRight 右侧按钮点击时触发
* @event {Function} clickTitle 中间标题点击时触发 * @event {Function} clickTitle 中间标题点击时触发
...@@ -135,6 +136,10 @@ ...@@ -135,6 +136,10 @@
type: [Number, String], type: [Number, String],
default: 60 default: 60
}, },
stat: {
type: [Boolean, String],
default: ''
}
}, },
computed: { computed: {
themeBgColor() { themeBgColor() {
...@@ -170,7 +175,7 @@ ...@@ -170,7 +175,7 @@
} }
}, },
mounted() { mounted() {
if (uni.report && this.title !== '') { if (uni.report && this.stat && this.title !== '') {
uni.report('title', this.title) uni.report('title', this.title)
} }
}, },
......
{ {
"id": "uni-nav-bar", "id": "uni-nav-bar",
"displayName": "uni-nav-bar 自定义导航栏", "displayName": "uni-nav-bar 自定义导航栏",
"version": "1.3.4", "version": "1.3.6",
"description": "自定义导航栏组件,主要用于头部导航。", "description": "自定义导航栏组件,主要用于头部导航。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.2.1(2022-09-05)
- 新增 属性 fontSize,可修改文字大小。
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar)
......
<template> <template>
<view v-if="show" class="uni-noticebar" :style="{ backgroundColor: backgroundColor }" @click="onClick"> <view v-if="show" class="uni-noticebar" :style="{ backgroundColor }" @click="onClick">
<uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound" <uni-icons v-if="showIcon === true || showIcon === 'true'" class="uni-noticebar-icon" type="sound"
:color="color" size="22" /> :color="color" :size="fontSize * 1.5" />
<view ref="textBox" class="uni-noticebar__content-wrapper" <view ref="textBox" class="uni-noticebar__content-wrapper"
:class="{'uni-noticebar__content-wrapper--scrollable':scrollable, 'uni-noticebar__content-wrapper--single':!scrollable && (single || moreText)}"> :class="{
'uni-noticebar__content-wrapper--scrollable': scrollable,
'uni-noticebar__content-wrapper--single': !scrollable && (single || moreText)
}"
:style="{ height: scrollable ? fontSize * 1.5 + 'px' : 'auto' }"
>
<view :id="elIdBox" class="uni-noticebar__content" <view :id="elIdBox" class="uni-noticebar__content"
:class="{'uni-noticebar__content--scrollable':scrollable, 'uni-noticebar__content--single':!scrollable && (single || moreText)}"> :class="{
'uni-noticebar__content--scrollable': scrollable,
'uni-noticebar__content--single': !scrollable && (single || moreText)
}"
>
<text :id="elId" ref="animationEle" class="uni-noticebar__content-text" <text :id="elId" ref="animationEle" class="uni-noticebar__content-text"
:class="{'uni-noticebar__content-text--scrollable':scrollable,'uni-noticebar__content-text--single':!scrollable && (single || showGetMore)}" :class="{
:style="{color:color, width:wrapWidth+'px', 'animationDuration': animationDuration, '-webkit-animationDuration': animationDuration ,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}">{{text}}</text> 'uni-noticebar__content-text--scrollable': scrollable,
'uni-noticebar__content-text--single': !scrollable && (single || showGetMore)
}"
:style="{
color: color,
fontSize: fontSize + 'px',
lineHeight: fontSize * 1.5 + 'px',
width: wrapWidth + 'px',
'animationDuration': animationDuration,
'-webkit-animationDuration': animationDuration,
animationPlayState: webviewHide ? 'paused' : animationPlayState,
'-webkit-animationPlayState': webviewHide ? 'paused' : animationPlayState,
animationDelay: animationDelay,
'-webkit-animationDelay': animationDelay
}"
>{{text}}</text>
</view> </view>
</view> </view>
<view v-if="showGetMore === true || showGetMore === 'true'" class="uni-noticebar__more uni-cursor-point" <view v-if="isShowGetMore" class="uni-noticebar__more uni-cursor-point"
@click="clickMore"> @click="clickMore">
<text v-if="moreText.length > 0" :style="{ color: moreColor }" class="uni-noticebar__more-text">{{ moreText }}</text> <text v-if="moreText.length > 0" :style="{ color: moreColor, fontSize: fontSize + 'px' }">{{ moreText }}</text>
<uni-icons v-else type="right" :color="moreColor" size="16" /> <uni-icons v-else type="right" :color="moreColor" :size="fontSize * 1.1" />
</view> </view>
<view class="uni-noticebar-close uni-cursor-point" v-if="(showClose === true || showClose === 'true') && (showGetMore === false || showGetMore === 'false')"> <view class="uni-noticebar-close uni-cursor-point" v-if="isShowClose">
<uni-icons <uni-icons type="closeempty" :color="color" :size="fontSize * 1.1" @click="close" />
type="closeempty" :color="color" size="16" @click="close" />
</view> </view>
</view> </view>
</template> </template>
...@@ -74,6 +97,10 @@ ...@@ -74,6 +97,10 @@
type: String, type: String,
default: '#FF9A43' default: '#FF9A43'
}, },
fontSize: {
type: Number,
default: 14
},
moreColor: { moreColor: {
type: String, type: String,
default: '#FF9A43' default: '#FF9A43'
...@@ -123,6 +150,15 @@ ...@@ -123,6 +150,15 @@
animationDelay: '0s' animationDelay: '0s'
} }
}, },
computed: {
isShowGetMore() {
return this.showGetMore === true || this.showGetMore === 'true'
},
isShowClose() {
return (this.showClose === true || this.showClose === 'true')
&& (this.showGetMore === false || this.showGetMore === 'false')
}
},
mounted() { mounted() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
var pages = getCurrentPages(); var pages = getCurrentPages();
...@@ -310,7 +346,6 @@ ...@@ -310,7 +346,6 @@
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
.uni-noticebar__content-wrapper--scrollable { .uni-noticebar__content-wrapper--scrollable {
position: relative; position: relative;
height: 18px;
} }
/* #endif */ /* #endif */
...@@ -383,10 +418,6 @@ ...@@ -383,10 +418,6 @@
padding-left: 5px; padding-left: 5px;
} }
.uni-noticebar__more-text {
font-size: 14px;
}
@keyframes notice { @keyframes notice {
100% { 100% {
transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0);
......
{ {
"id": "uni-notice-bar", "id": "uni-notice-bar",
"displayName": "uni-notice-bar 通告栏", "displayName": "uni-notice-bar 通告栏",
"version": "1.2.0", "version": "1.2.1",
"description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告", "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -17,11 +17,7 @@ ...@@ -17,11 +17,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -38,7 +34,8 @@ ...@@ -38,7 +34,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [ "dependencies": [
......
## 1.2.4(2022-09-19)
- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。
- 修复,未对移动端当前页文字做主题色适配。
## 1.2.3(2022-09-15)
- 修复未使用 uni-scss 主题色的 bug。
## 1.2.2(2022-07-06)
- 修复 es 语言 i18n 错误
## 1.2.1(2021-11-22) ## 1.2.1(2021-11-22)
- 修复 vue3中某些scss变量无法找到的问题 - 修复 vue3中某些scss变量无法找到的问题
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
......
{ {
"uni-pagination.prevText": "prev", "uni-pagination.prevText": "prev",
"uni-pagination.nextText": "next" "uni-pagination.nextText": "next",
"uni-pagination.piecePerPage": "piece/page"
} }
{ {
"uni-pagination.prevText": "anterior", "uni-pagination.prevText": "anterior",
"uni-pagination.nextText": "próxima" "uni-pagination.nextText": "prxima",
"uni-pagination.piecePerPage": "Art¨ªculo/P¨¢gina"
} }
{ {
"uni-pagination.prevText": "précédente", "uni-pagination.prevText": "précédente",
"uni-pagination.nextText": "suivante" "uni-pagination.nextText": "suivante",
"uni-pagination.piecePerPage": "Articles/Pages"
} }
{ {
"uni-pagination.prevText": "上一页", "uni-pagination.prevText": "上一页",
"uni-pagination.nextText": "下一页" "uni-pagination.nextText": "下一页",
"uni-pagination.piecePerPage": "条/页"
} }
{ {
"uni-pagination.prevText": "上一頁", "uni-pagination.prevText": "上一頁",
"uni-pagination.nextText": "下一頁" "uni-pagination.nextText": "下一頁",
"uni-pagination.piecePerPage": "條/頁"
} }
<template> <template>
<view class="uni-pagination"> <view class="uni-pagination">
<!-- #ifndef MP -->
<picker v-if="showPageSize === true || showPageSize === 'true'" class="select-picker" mode="selector"
:value="pageSizeIndex" :range="pageSizeRange" @change="pickerChange" @cancel="pickerClick"
@click.native="pickerClick">
<button type="default" size="mini" :plain="true">
<text>{{pageSizeRange[pageSizeIndex]}} {{piecePerPage}}</text>
<uni-icons class="select-picker-icon" type="arrowdown" size="12" color="#999"></uni-icons>
</button>
</picker>
<!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view class="uni-pagination__total is-phone-hide">{{ total }}</view> <view class="uni-pagination__total is-phone-hide">{{ total }}</view>
<!-- #endif --> <!-- #endif -->
...@@ -16,8 +26,7 @@ ...@@ -16,8 +26,7 @@
</view> </view>
<view class="uni-pagination__num uni-pagination__num-flex-none"> <view class="uni-pagination__num uni-pagination__num-flex-none">
<view class="uni-pagination__num-current"> <view class="uni-pagination__num-current">
<text class="uni-pagination__num-current-text is-pc-hide" <text class="uni-pagination__num-current-text is-pc-hide current-index-text">{{ currentIndex }}</text>
style="color:#409EFF">{{ currentIndex }}</text>
<text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text> <text class="uni-pagination__num-current-text is-pc-hide">/{{ maxPage || 0 }}</text>
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }" <view v-for="(item, index) in paper" :key="index" :class="{ 'page--active': item === currentIndex }"
...@@ -49,11 +58,15 @@ ...@@ -49,11 +58,15 @@
* @tutorial https://ext.dcloud.net.cn/plugin?id=32 * @tutorial https://ext.dcloud.net.cn/plugin?id=32
* @property {String} prevText 左侧按钮文字 * @property {String} prevText 左侧按钮文字
* @property {String} nextText 右侧按钮文字 * @property {String} nextText 右侧按钮文字
* @property {String} piecePerPageText 条/页文字
* @property {Number} current 当前页 * @property {Number} current 当前页
* @property {Number} total 数据总量 * @property {Number} total 数据总量
* @property {Number} pageSize 每页数据量 * @property {Number} pageSize 每页数据量
* @property {Number} showIcon = [true|false] 是否以 icon 形式展示按钮 * @property {Boolean} showIcon = [true|false] 是否以 icon 形式展示按钮
* @property {Boolean} showPageSize = [true|false] 是否展示每页条数
* @property {Array} pageSizeRange = [20, 50, 100, 500] 每页条数选框
* @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个 * @event {Function} change 点击页码按钮时触发 ,e={type,current} current为当前页,type值为:next/prev,表示点击的是上一页还是下一个
* * @event {Function} pageSizeChange 当前每页条数改变时触发 ,e={pageSize} pageSize 为当前所选的每页条数
*/ */
import { import {
...@@ -65,7 +78,7 @@ ...@@ -65,7 +78,7 @@
} = initVueI18n(messages) } = initVueI18n(messages)
export default { export default {
name: 'UniPagination', name: 'UniPagination',
emits: ['update:modelValue', 'input', 'change'], emits: ['update:modelValue', 'input', 'change', 'pageSizeChange'],
props: { props: {
value: { value: {
type: [Number, String], type: [Number, String],
...@@ -81,6 +94,9 @@ ...@@ -81,6 +94,9 @@
nextText: { nextText: {
type: String, type: String,
}, },
piecePerPageText: {
type: String
},
current: { current: {
type: [Number, String], type: [Number, String],
default: 1 default: 1
...@@ -100,18 +116,32 @@ ...@@ -100,18 +116,32 @@
type: [Boolean, String], type: [Boolean, String],
default: false default: false
}, },
showPageSize: {
// 是否以 icon 形式展示按钮
type: [Boolean, String],
default: false
},
pagerCount: { pagerCount: {
type: Number, type: Number,
default: 7 default: 7
},
pageSizeRange: {
type: Array,
default: () => [20, 50, 100, 500]
} }
}, },
data() { data() {
return { return {
pageSizeIndex: 0,
currentIndex: 1, currentIndex: 1,
paperData: [] paperData: [],
pickerShow: false
} }
}, },
computed: { computed: {
piecePerPage() {
return this.piecePerPageText || t('uni-pagination.piecePerPage')
},
prevPageText() { prevPageText() {
return this.prevText || t('uni-pagination.prevText') return this.prevText || t('uni-pagination.prevText')
}, },
...@@ -199,9 +229,31 @@ ...@@ -199,9 +229,31 @@
this.currentIndex = val this.currentIndex = val
} }
} }
},
pageSizeIndex(val) {
this.$emit('pageSizeChange', this.pageSizeRange[val])
} }
}, },
methods: { methods: {
pickerChange(e) {
this.pageSizeIndex = e.detail.value
this.pickerClick()
},
pickerClick() {
// #ifdef H5
const body = document.querySelector('body')
if (!body) return
const className = 'uni-pagination-picker-show'
this.pickerShow = !this.pickerShow
if (this.pickerShow) {
body.classList.add(className)
} else {
setTimeout(() => body.classList.remove(className), 300)
}
// #endif
},
// 选择标签 // 选择标签
selectPage(e, index) { selectPage(e, index) {
if (parseInt(e)) { if (parseInt(e)) {
...@@ -257,7 +309,7 @@ ...@@ -257,7 +309,7 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$uni-primary: #2979ff; $uni-primary: #2979ff !default;
.uni-pagination { .uni-pagination {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -352,6 +404,10 @@ ...@@ -352,6 +404,10 @@
font-size: 15px; font-size: 15px;
} }
.current-index-text{
color: $uni-primary;
}
.uni-pagination--enabled { .uni-pagination--enabled {
color: #333333; color: #333333;
opacity: 1; opacity: 1;
......
{ {
"id": "uni-pagination", "id": "uni-pagination",
"displayName": "uni-pagination 分页器", "displayName": "uni-pagination 分页器",
"version": "1.2.1", "version": "1.2.4",
"description": "Pagination 分页器组件,用于展示页码、请求数据等。", "description": "Pagination 分页器组件,用于展示页码、请求数据等。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -16,11 +16,7 @@ ...@@ -16,11 +16,7 @@
"directories": { "directories": {
"example": "../../temps/example_temps" "example": "../../temps/example_temps"
}, },
"dcloudext": { "dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -37,7 +33,8 @@ ...@@ -37,7 +33,8 @@
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-scss","uni-icons"], "dependencies": ["uni-scss","uni-icons"],
......
...@@ -9,5 +9,3 @@ ...@@ -9,5 +9,3 @@
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.3.1(2022-02-25)
- 修复 条件判断 `NaN` 错误的 bug
## 1.3.0(2021-11-19) ## 1.3.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-rate](https://uniapp.dcloud.io/component/uniui/uni-rate) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-rate](https://uniapp.dcloud.io/component/uniui/uni-rate)
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
_getRateCount(clientX) { _getRateCount(clientX) {
this._getSize() this._getSize()
const size = Number(this.size) const size = Number(this.size)
if (size === NaN) { if (isNaN(size)) {
return new Error('size 属性只能设置为数字') return new Error('size 属性只能设置为数字')
} }
const rateMoveRange = clientX - this._rateBoxLeft const rateMoveRange = clientX - this._rateBoxLeft
......
{ {
"id": "uni-rate", "id": "uni-rate",
"displayName": "uni-rate 评分", "displayName": "uni-rate 评分",
"version": "1.3.0", "version": "1.3.1",
"description": "Rate 评分组件,可自定义评分星星图标的大小、间隔、评分数。", "description": "Rate 评分组件,可自定义评分星星图标的大小、间隔、评分数。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
{
"name" : "",
"appid" : "",
"description": "应用描述",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
"usingComponents": true,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
"modules": {
"OAuth": {},
"Payment": {},
"Push": {},
"Share": {},
"Speech": {},
"VideoPlayer": {}
},
/* 应用发布信息 */
"distribute": {
/* android打包配置 */
"android": {
"permissions": [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.GET_TASKS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.READ_SMS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.SEND_SMS\"/>",
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SMS\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/>"
]
},
/* ios打包配置 */
"ios": {
"UIBackgroundModes": ["audio"]
},
/* SDK配置 */
"sdkConfigs": {
"speech": {
"ifly": {}
}
},
"orientation": ["portrait-primary"]
}
},
/* 快应用特有相关 */
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents": true
},
"h5": {
"template": "template.h5.html",
"router": {
"mode": "history",
"base": "/h5/"
}
}
}
## 1.2.3(2022-05-24)
- 新增 readonly 属性,组件只读
## 1.2.2(2022-05-06)
- 修复 vue3 input 事件不生效的bug
## 1.2.1(2022-05-06)
- 修复 多余代码导致的bug
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-search-bar](https://uniapp.dcloud.io/component/uniui/uni-search-bar) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-search-bar](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
......
s<template> <template>
<view class="uni-searchbar"> <view class="uni-searchbar">
<view :style="{borderRadius:radius+'px',backgroundColor: bgColor}" class="uni-searchbar__box" @click="searchClick"> <view :style="{borderRadius:radius+'px',backgroundColor: bgColor}" class="uni-searchbar__box"
@click="searchClick">
<view class="uni-searchbar__box-icon-search"> <view class="uni-searchbar__box-icon-search">
<slot name="searchIcon"> <slot name="searchIcon">
<uni-icons color="#c0c4cc" size="18" type="search" /> <uni-icons color="#c0c4cc" size="18" type="search" />
</slot> </slot>
</view> </view>
<input v-if="show || searchVal" :focus="showSync" :placeholder="placeholderText" :maxlength="maxlength" class="uni-searchbar__box-search-input" <input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
confirm-type="search" type="text" v-model="searchVal" @confirm="confirm" @blur="blur" @focus="emitFocus" /> class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
@confirm="confirm" @blur="blur" @focus="emitFocus" />
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text> <text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='')" class="uni-searchbar__box-icon-clear" <view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
@click="clear"> class="uni-searchbar__box-icon-clear" @click="clear">
<slot name="clearIcon"> <slot name="clearIcon">
<uni-icons color="#c0c4cc" size="20" type="clear" /> <uni-icons color="#c0c4cc" size="20" type="clear" />
</slot> </slot>
</view> </view>
</view> </view>
<text @click="cancel" class="uni-searchbar__cancel" v-if="cancelButton ==='always' || show && cancelButton ==='auto'">{{cancelTextI18n}}</text> <text @click="cancel" class="uni-searchbar__cancel"
v-if="cancelButton ==='always' || show && cancelButton ==='auto'">{{cancelTextI18n}}</text>
</view> </view>
</template> </template>
...@@ -25,7 +28,9 @@ s<template> ...@@ -25,7 +28,9 @@ s<template>
initVueI18n initVueI18n
} from '@dcloudio/uni-i18n' } from '@dcloudio/uni-i18n'
import messages from './i18n/index.js' import messages from './i18n/index.js'
const { t } = initVueI18n(messages) const {
t
} = initVueI18n(messages)
/** /**
* SearchBar 搜索栏 * SearchBar 搜索栏
...@@ -45,6 +50,7 @@ s<template> ...@@ -45,6 +50,7 @@ s<template>
* @property {String} cancelText 取消按钮的文字 * @property {String} cancelText 取消按钮的文字
* @property {String} bgColor 输入框背景颜色 * @property {String} bgColor 输入框背景颜色
* @property {Boolean} focus 是否自动聚焦 * @property {Boolean} focus 是否自动聚焦
* @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
* @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number} * @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number}
* @event {Function} input uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的value,e=value * @event {Function} input uniSearchBar 的 value 改变时触发事件,返回参数为uniSearchBar的value,e=value
* @event {Function} cancel 点击取消按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number} * @event {Function} cancel 点击取消按钮时触发事件,返回参数为uniSearchBar的value,e={value:Number}
...@@ -54,7 +60,7 @@ s<template> ...@@ -54,7 +60,7 @@ s<template>
export default { export default {
name: "UniSearchBar", name: "UniSearchBar",
emits:['input','update:modelValue','clear','cancel','confirm','blur','focus'], emits: ['input', 'update:modelValue', 'clear', 'cancel', 'confirm', 'blur', 'focus'],
props: { props: {
placeholder: { placeholder: {
type: String, type: String,
...@@ -95,6 +101,10 @@ s<template> ...@@ -95,6 +101,10 @@ s<template>
focus: { focus: {
type: Boolean, type: Boolean,
default: false default: false
},
readonly: {
type: Boolean,
default: false
} }
}, },
data() { data() {
...@@ -104,7 +114,7 @@ s<template> ...@@ -104,7 +114,7 @@ s<template>
searchVal: '' searchVal: ''
} }
}, },
computed:{ computed: {
cancelTextI18n() { cancelTextI18n() {
return this.cancelText || t("uni-search-bar.cancel") return this.cancelText || t("uni-search-bar.cancel")
}, },
...@@ -139,6 +149,7 @@ s<template> ...@@ -139,6 +149,7 @@ s<template>
immediate: true, immediate: true,
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
if(this.readonly) return
this.show = true; this.show = true;
this.$nextTick(() => { this.$nextTick(() => {
this.showSync = true this.showSync = true
...@@ -147,9 +158,7 @@ s<template> ...@@ -147,9 +158,7 @@ s<template>
} }
}, },
searchVal(newVal, oldVal) { searchVal(newVal, oldVal) {
// #ifndef VUE3
this.$emit("input", newVal) this.$emit("input", newVal)
// #endif
// #ifdef VUE3 // #ifdef VUE3
this.$emit("update:modelValue", newVal) this.$emit("update:modelValue", newVal)
// #endif // #endif
...@@ -157,6 +166,7 @@ s<template> ...@@ -157,6 +166,7 @@ s<template>
}, },
methods: { methods: {
searchClick() { searchClick() {
if(this.readonly) return
if (this.show) { if (this.show) {
return return
} }
...@@ -172,6 +182,7 @@ s<template> ...@@ -172,6 +182,7 @@ s<template>
this.searchVal = "" this.searchVal = ""
}, },
cancel() { cancel() {
if(this.readonly) return
this.$emit("cancel", { this.$emit("cancel", {
value: this.searchVal value: this.searchVal
}); });
...@@ -214,7 +225,7 @@ s<template> ...@@ -214,7 +225,7 @@ s<template>
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss">
$uni-searchbar-height: 36px; $uni-searchbar-height: 36px;
.uni-searchbar { .uni-searchbar {
......
{ {
"id": "uni-search-bar", "id": "uni-search-bar",
"displayName": "uni-search-bar 搜索栏", "displayName": "uni-search-bar 搜索栏",
"version": "1.2.0", "version": "1.2.3",
"description": "搜索栏组件,通常用于搜索商品、文章等", "description": "搜索栏组件,通常用于搜索商品、文章等",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
> 代码块: `uSearchBar` > 代码块: `uSearchBar`
评分组件 搜索栏组件
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar) ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-search-bar)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
......
## 0.0.1(2022-07-22)
- 初始化
<template>
<view class="uni-section">
<view class="uni-section-header" @click="onClick">
<view class="uni-section-header__decoration" v-if="type" :class="type" />
<slot v-else name="decoration"></slot>
<view class="uni-section-header__content">
<text :style="{'font-size':titleFontSize,'color':titleColor}" class="uni-section__content-title" :class="{'distraction':!subTitle}">{{ title }}</text>
<text v-if="subTitle" :style="{'font-size':subTitleFontSize,'color':subTitleColor}" class="uni-section-header__content-sub">{{ subTitle }}</text>
</view>
<view class="uni-section-header__slot-right">
<slot name="right"></slot>
</view>
</view>
<view class="uni-section-content" :style="{padding: _padding}">
<slot />
</view>
</view>
</template>
<script>
/**
* Section 标题栏
* @description 标题栏
* @property {String} type = [line|circle|square] 标题装饰类型
* @value line 竖线
* @value circle 圆形
* @value square 正方形
* @property {String} title 主标题
* @property {String} titleFontSize 主标题字体大小
* @property {String} titleColor 主标题字体颜色
* @property {String} subTitle 副标题
* @property {String} subTitleFontSize 副标题字体大小
* @property {String} subTitleColor 副标题字体颜色
* @property {String} padding 默认插槽 padding
*/
export default {
name: 'UniSection',
emits:['click'],
props: {
type: {
type: String,
default: ''
},
title: {
type: String,
required: true,
default: ''
},
titleFontSize: {
type: String,
default: '14px'
},
titleColor:{
type: String,
default: '#333'
},
subTitle: {
type: String,
default: ''
},
subTitleFontSize: {
type: String,
default: '12px'
},
subTitleColor: {
type: String,
default: '#999'
},
padding: {
type: [Boolean, String],
default: false
}
},
computed:{
_padding(){
if(typeof this.padding === 'string'){
return this.padding
}
return this.padding?'10px':''
}
},
watch: {
title(newVal) {
if (uni.report && newVal !== '') {
uni.report('title', newVal)
}
}
},
methods: {
onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss" >
$uni-primary: #2979ff !default;
.uni-section {
background-color: #fff;
.uni-section-header {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
padding: 12px 10px;
font-weight: normal;
&__decoration{
margin-right: 6px;
background-color: $uni-primary;
&.line {
width: 4px;
height: 12px;
border-radius: 10px;
}
&.circle {
width: 8px;
height: 8px;
border-top-right-radius: 50px;
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
border-bottom-right-radius: 50px;
}
&.square {
width: 8px;
height: 8px;
}
}
&__content {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
flex: 1;
color: #333;
.distraction {
flex-direction: row;
align-items: center;
}
&-sub {
margin-top: 2px;
}
}
&__slot-right{
font-size: 14px;
}
}
.uni-section-content{
font-size: 14px;
}
}
</style>
{
"id": "uni-section",
"displayName": "uni-section 标题栏",
"version": "0.0.1",
"description": "标题栏组件",
"keywords": [
"uni-ui",
"uniui",
"标题栏"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [
"uni-scss"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
## Section 标题栏
> **组件名:uni-section**
> 代码块: `uSection`
uni-section 组件主要用于文章、列表详情等标题展示
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-section)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
## 1.3.7(2022-06-06)
- 修复 vue3 下使用组件不能正常运行的Bug
## 1.3.6(2022-05-31)
- 修复 h5端点击click触发两次的Bug
## 1.3.5(2022-05-23)
- 修复 isPC 找不到的Bug
## 1.3.4(2022-05-19)
- 修复 在 nvue 下 disabled 失效的bug
## 1.3.3(2022-03-31)
- 修复 按钮字体大小不能设置的bug
## 1.3.2(2022-03-16)
- 修复 h5和app端下报el错误的bug
## 1.3.1(2022-03-07)
- 修复 HBuilderX 1.4.X 版本中,h5和app端下报错的bug
## 1.3.0(2021-11-19) ## 1.3.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) - 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-swipe-action](https://uniapp.dcloud.io/component/uniui/uni-swipe-action) - 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-swipe-action](https://uniapp.dcloud.io/component/uniui/uni-swipe-action)
......
...@@ -69,6 +69,8 @@ bindIngXMixins = { ...@@ -69,6 +69,8 @@ bindIngXMixins = {
}) })
}, },
touchstart(e) { touchstart(e) {
// fix by mehaotian 禁止滑动
if (this.disabled) return
// 每次只触发一次,避免多次监听造成闪烁 // 每次只触发一次,避免多次监听造成闪烁
if (this.stop) return if (this.stop) return
this.stop = true this.stop = true
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
watch: { watch: {
show(newVal) { show(newVal) {
if (this.autoClose) return if (this.autoClose) return
if (newVal && newVal !== 'none' ) { if (newVal && newVal !== 'none') {
this.transition = true this.transition = true
this.open(newVal) this.open(newVal)
} else { } else {
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
// TODO 解决 x 值不更新的问题,所以会多触发一次 nextTick ,待优化 // TODO 解决 x 值不更新的问题,所以会多触发一次 nextTick ,待优化
this.$nextTick(() => { this.$nextTick(() => {
this.x = -this.leftWidth this.x = -this.leftWidth
if(this.isopen!=='none'){ if (this.isopen !== 'none') {
this.$emit('change', 'none') this.$emit('change', 'none')
} }
this.isopen = 'none' this.isopen = 'none'
...@@ -151,7 +151,7 @@ export default { ...@@ -151,7 +151,7 @@ export default {
this.x = -this.rightWidth - this.leftWidth this.x = -this.rightWidth - this.leftWidth
} }
if(this.isopen!==type){ if (this.isopen !== type) {
this.$emit('change', type) this.$emit('change', type)
} }
this.isopen = type this.isopen = type
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册