提交 a7b7de30 编写于 作者: Anne_LXM's avatar Anne_LXM

更新 依赖的uni-id-pages的版本为1.1.23

上级 29218dcb
## 1.0.6(2024-10-22)
- 新增 当 multiple 为 false 且传递的 value 为 数组时,使用数组第一项用作反显
## 1.0.5(2024-03-20) ## 1.0.5(2024-03-20)
- 修复 单选模式下选中样式不生效的bug - 修复 单选模式下选中样式不生效的bug
## 1.0.4(2024-01-27) ## 1.0.4(2024-01-27)
......
...@@ -32,19 +32,19 @@ export default { ...@@ -32,19 +32,19 @@ export default {
errorMessage: '' errorMessage: ''
} }
}, },
created() { created() {
let db = null; let db = null;
let dbCmd = null; let dbCmd = null;
if(this.collection){
this.db = uniCloud.database();
this.dbCmd = this.db.command;
}
this._isEnded = false if(this.collection){
this.db = uniCloud.database();
this.dbCmd = this.db.command;
}
this._isEnded = false
this.$watch(() => { this.$watch(() => {
var al = [] let al = []
attrs.forEach(key => { attrs.forEach(key => {
al.push(this[key]) al.push(this[key])
}) })
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
let changeName let changeName
let events = this.$scope.dataset.eventOpts let events = this.$scope.dataset.eventOpts
for (var i = 0; i < events.length; i++) { for (let i = 0; i < events.length; i++) {
let event = events[i] let event = events[i]
if (event[0].includes('^load')) { if (event[0].includes('^load')) {
changeName = event[1][0][0] changeName = event[1][0][0]
...@@ -117,9 +117,9 @@ export default { ...@@ -117,9 +117,9 @@ export default {
// #ifdef H5 // #ifdef H5
beforeDestroy() { beforeDestroy() {
if (process.env.NODE_ENV === 'development' && window.unidev) { if (process.env.NODE_ENV === 'development' && window.unidev) {
var cd = this._debugDataList let cd = this._debugDataList
var dl = unidev.clientDB.data let dl = unidev.clientDB.data
for (var i = dl.length - 1; i >= 0; i--) { for (let i = dl.length - 1; i >= 0; i--) {
if (dl[i] === cd) { if (dl[i] === cd) {
dl.splice(i, 1) dl.splice(i, 1)
break break
...@@ -313,4 +313,4 @@ export default { ...@@ -313,4 +313,4 @@ export default {
} }
} }
} }
} }
<template> <template>
<view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}"> <view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}">
<template v-if="!isLocal"> <template v-if="!isLocal">
<view class="uni-data-loading"> <view class="uni-data-loading">
<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18" <uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18"
:content-text="contentText"></uni-load-more> :content-text="contentText"></uni-load-more>
<text v-else>{{mixinDatacomErrorMessage}}</text> <text v-else>{{mixinDatacomErrorMessage}}</text>
</view> </view>
</template> </template>
<template v-else> <template v-else>
<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}" <checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}"
@change="change"> @change="change">
<label class="checklist-box" <label class="checklist-box"
:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index"> :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''" <checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''"
:checked="item.selected" /> :checked="item.selected" />
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" <view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
class="checkbox__inner" :style="item.styleIcon"> class="checkbox__inner" :style="item.styleIcon">
<view class="checkbox__inner-icon"></view> <view class="checkbox__inner-icon"></view>
</view> </view>
<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}"> <view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text> <text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
<view v-if="mode === 'list' && icon === 'right'" class="checkobx__list" :style="item.styleBackgroud"></view> <view v-if="mode === 'list' && icon === 'right'" class="checkobx__list" :style="item.styleBackgroud"></view>
</view> </view>
</label> </label>
</checkbox-group> </checkbox-group>
<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="change"> <radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="change">
<label class="checklist-box" <label class="checklist-box"
:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index"> :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
<radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''" <radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''"
:checked="item.selected" /> :checked="item.selected" />
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner" <view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner"
:style="item.styleBackgroud"> :style="item.styleBackgroud">
<view class="radio__inner-icon" :style="item.styleIcon"></view> <view class="radio__inner-icon" :style="item.styleIcon"></view>
</view> </view>
<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}"> <view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text> <text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
<view v-if="mode === 'list' && icon === 'right'" :style="item.styleRightIcon" class="checkobx__list"></view> <view v-if="mode === 'list' && icon === 'right'" :style="item.styleRightIcon" class="checkobx__list"></view>
</view> </view>
</label> </label>
</radio-group> </radio-group>
</template> </template>
</view> </view>
</template> </template>
<script> <script>
/** /**
* DataChecklist 数据选择器 * DataChecklist 数据选择器
* @description 通过数据渲染 checkbox 和 radio * @description 通过数据渲染 checkbox 和 radio
* @tutorial https://ext.dcloud.net.cn/plugin?id=xxx * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
* @property {String} mode = [default| list | button | tag] 显示模式 * @property {String} mode = [default| list | button | tag] 显示模式
* @value default 默认横排模式 * @value default 默认横排模式
* @value list 列表模式 * @value list 列表模式
* @value button 按钮模式 * @value button 按钮模式
* @value tag 标签模式 * @value tag 标签模式
* @property {Boolean} multiple = [true|false] 是否多选 * @property {Boolean} multiple = [true|false] 是否多选
* @property {Array|String|Number} value 默认值 * @property {Array|String|Number} value 默认值
* @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}] * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
* @property {Number|String} min 最小选择个数 ,multiple为true时生效 * @property {Number|String} min 最小选择个数 ,multiple为true时生效
* @property {Number|String} max 最大选择个数 ,multiple为true时生效 * @property {Number|String} max 最大选择个数 ,multiple为true时生效
* @property {Boolean} wrap 是否换行显示 * @property {Boolean} wrap 是否换行显示
* @property {String} icon = [left|right] list 列表模式下icon显示位置 * @property {String} icon = [left|right] list 列表模式下icon显示位置
* @property {Boolean} selectedColor 选中颜色 * @property {Boolean} selectedColor 选中颜色
* @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效 * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
* @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示 * @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示
* @property {Object} map 字段映射, 默认 map={text:'text',value:'value'} * @property {Object} map 字段映射, 默认 map={text:'text',value:'value'}
* @value left 左侧显示 * @value left 左侧显示
* @value right 右侧显示 * @value right 右侧显示
* @event {Function} change 选中发生变化触发 * @event {Function} change 选中发生变化触发
*/ */
export default { export default {
name: 'uniDataChecklist', name: 'uniDataChecklist',
mixins: [uniCloud.mixinDatacom || {}], mixins: [uniCloud.mixinDatacom || {}],
emits: ['input', 'update:modelValue', 'change'], emits: ['input', 'update:modelValue', 'change'],
props: { props: {
mode: { mode: {
type: String, type: String,
default: 'default' default: 'default'
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false
}, },
value: { value: {
type: [Array, String, Number], type: [Array, String, Number],
default () { default () {
return '' return ''
} }
}, },
// TODO vue3 // TODO vue3
modelValue: { modelValue: {
type: [Array, String, Number], type: [Array, String, Number],
default () { default () {
return ''; return '';
} }
}, },
localdata: { localdata: {
type: Array, type: Array,
default () { default () {
return [] return []
} }
}, },
min: { min: {
type: [Number, String], type: [Number, String],
default: '' default: ''
}, },
max: { max: {
type: [Number, String], type: [Number, String],
default: '' default: ''
}, },
wrap: { wrap: {
type: Boolean, type: Boolean,
default: false default: false
}, },
icon: { icon: {
type: String, type: String,
default: 'left' default: 'left'
}, },
selectedColor: { selectedColor: {
type: String, type: String,
default: '' default: ''
}, },
selectedTextColor: { selectedTextColor: {
type: String, type: String,
default: '' default: ''
}, },
emptyText: { emptyText: {
type: String, type: String,
default: '暂无数据' default: '暂无数据'
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false default: false
}, },
map: { map: {
type: Object, type: Object,
default () { default () {
return { return {
text: 'text', text: 'text',
value: 'value' value: 'value'
} }
} }
} }
}, },
watch: { watch: {
localdata: { localdata: {
handler(newVal) { handler(newVal) {
this.range = newVal this.range = newVal
this.dataList = this.getDataList(this.getSelectedValue(newVal)) this.dataList = this.getDataList(this.getSelectedValue(newVal))
}, },
deep: true deep: true
}, },
mixinDatacomResData(newVal) { mixinDatacomResData(newVal) {
this.range = newVal this.range = newVal
this.dataList = this.getDataList(this.getSelectedValue(newVal)) this.dataList = this.getDataList(this.getSelectedValue(newVal))
}, },
value(newVal) { value(newVal) {
this.dataList = this.getDataList(newVal) this.dataList = this.getDataList(newVal)
// fix by mehaotian is_reset 在 uni-forms 中定义 // fix by mehaotian is_reset 在 uni-forms 中定义
// if(!this.is_reset){ // if(!this.is_reset){
// this.is_reset = false // this.is_reset = false
// this.formItem && this.formItem.setValue(newVal) // this.formItem && this.formItem.setValue(newVal)
// } // }
}, },
modelValue(newVal) { modelValue(newVal) {
this.dataList = this.getDataList(newVal); this.dataList = this.getDataList(newVal);
// if(!this.is_reset){ // if(!this.is_reset){
// this.is_reset = false // this.is_reset = false
// this.formItem && this.formItem.setValue(newVal) // this.formItem && this.formItem.setValue(newVal)
// } // }
} }
}, },
data() { data() {
return { return {
dataList: [], dataList: [],
range: [], range: [],
contentText: { contentText: {
contentdown: '查看更多', contentdown: '查看更多',
contentrefresh: '加载中', contentrefresh: '加载中',
contentnomore: '没有更多' contentnomore: '没有更多'
}, },
isLocal: true, isLocal: true,
styles: { styles: {
selectedColor: '#2979ff', selectedColor: '#2979ff',
selectedTextColor: '#666', selectedTextColor: '#666',
}, },
isTop: 0 isTop: 0
}; };
}, },
computed: { computed: {
dataValue() { dataValue() {
if (this.value === '') return this.modelValue if (this.value === '') return this.modelValue
if (this.modelValue === '') return this.value if (this.modelValue === '') return this.value
return this.value return this.value
} }
}, },
created() { created() {
// this.form = this.getForm('uniForms') // this.form = this.getForm('uniForms')
// this.formItem = this.getForm('uniFormsItem') // this.formItem = this.getForm('uniFormsItem')
// this.formItem && this.formItem.setValue(this.value) // this.formItem && this.formItem.setValue(this.value)
// if (this.formItem) { // if (this.formItem) {
// this.isTop = 6 // this.isTop = 6
// if (this.formItem.name) { // if (this.formItem.name) {
// // 如果存在name添加默认值,否则formData 中不存在这个字段不校验 // // 如果存在name添加默认值,否则formData 中不存在这个字段不校验
// if(!this.is_reset){ // if(!this.is_reset){
// this.is_reset = false // this.is_reset = false
// this.formItem.setValue(this.dataValue) // this.formItem.setValue(this.dataValue)
// } // }
// this.rename = this.formItem.name // this.rename = this.formItem.name
// this.form.inputChildrens.push(this) // this.form.inputChildrens.push(this)
// } // }
// } // }
if (this.localdata && this.localdata.length !== 0) { if (this.localdata && this.localdata.length !== 0) {
this.isLocal = true this.isLocal = true
this.range = this.localdata this.range = this.localdata
this.dataList = this.getDataList(this.getSelectedValue(this.range)) this.dataList = this.getDataList(this.getSelectedValue(this.range))
} else { } else {
if (this.collection) { if (this.collection) {
this.isLocal = false this.isLocal = false
this.loadData() this.loadData()
} }
} }
}, },
methods: { methods: {
loadData() { loadData() {
this.mixinDatacomGet().then(res => { this.mixinDatacomGet().then(res => {
this.mixinDatacomResData = res.result.data this.mixinDatacomResData = res.result.data
if (this.mixinDatacomResData.length === 0) { if (this.mixinDatacomResData.length === 0) {
this.isLocal = false this.isLocal = false
this.mixinDatacomErrorMessage = this.emptyText this.mixinDatacomErrorMessage = this.emptyText
} else { } else {
this.isLocal = true this.isLocal = true
} }
}).catch(err => { }).catch(err => {
this.mixinDatacomErrorMessage = err.message this.mixinDatacomErrorMessage = err.message
}) })
}, },
/** /**
* 获取父元素实例 * 获取父元素实例
*/ */
getForm(name = 'uniForms') { getForm(name = 'uniForms') {
let parent = this.$parent; let parent = this.$parent;
let parentName = parent.$options.name; let parentName = parent.$options.name;
while (parentName !== name) { while (parentName !== name) {
parent = parent.$parent; parent = parent.$parent;
if (!parent) return false if (!parent) return false
parentName = parent.$options.name; parentName = parent.$options.name;
} }
return parent; return parent;
}, },
change(e) { change(e) {
const values = e.detail.value const values = e.detail.value
let detail = { let detail = {
value: [], value: [],
data: [] data: []
} }
if (this.multiple) { if (this.multiple) {
this.range.forEach(item => { this.range.forEach(item => {
if (values.includes(item[this.map.value] + '')) { if (values.includes(item[this.map.value] + '')) {
detail.value.push(item[this.map.value]) detail.value.push(item[this.map.value])
detail.data.push(item) detail.data.push(item)
} }
}) })
} else { } else {
const range = this.range.find(item => (item[this.map.value] + '') === values) const range = this.range.find(item => (item[this.map.value] + '') === values)
if (range) { if (range) {
detail = { detail = {
value: range[this.map.value], value: range[this.map.value],
data: range data: range
} }
} }
} }
// this.formItem && this.formItem.setValue(detail.value) // this.formItem && this.formItem.setValue(detail.value)
// TODO 兼容 vue2 // TODO 兼容 vue2
this.$emit('input', detail.value); this.$emit('input', detail.value);
// // TOTO 兼容 vue3 // // TOTO 兼容 vue3
this.$emit('update:modelValue', detail.value); this.$emit('update:modelValue', detail.value);
this.$emit('change', { this.$emit('change', {
detail detail
}) })
if (this.multiple) { if (this.multiple) {
// 如果 v-model 没有绑定 ,则走内部逻辑 // 如果 v-model 没有绑定 ,则走内部逻辑
// if (this.value.length === 0) { // if (this.value.length === 0) {
this.dataList = this.getDataList(detail.value, true) this.dataList = this.getDataList(detail.value, true)
// } // }
} else { } else {
this.dataList = this.getDataList(detail.value) this.dataList = this.getDataList(detail.value)
} }
}, },
/** /**
* 获取渲染的新数组 * 获取渲染的新数组
* @param {Object} value 选中内容 * @param {Object} value 选中内容
*/ */
getDataList(value) { getDataList(value) {
// 解除引用关系,破坏原引用关系,避免污染源数据 // 解除引用关系,破坏原引用关系,避免污染源数据
let dataList = JSON.parse(JSON.stringify(this.range)) let dataList = JSON.parse(JSON.stringify(this.range))
let list = [] let list = []
if (this.multiple) { if (this.multiple) {
if (!Array.isArray(value)) { if (!Array.isArray(value)) {
value = [] value = []
} }
} } else {
dataList.forEach((item, index) => { if (Array.isArray(value) && value.length) {
item.disabled = item.disable || item.disabled || false value = value[0]
if (this.multiple) { }
if (value.length > 0) { }
let have = value.find(val => val === item[this.map.value]) dataList.forEach((item, index) => {
item.selected = have !== undefined item.disabled = item.disable || item.disabled || false
} else { if (this.multiple) {
item.selected = false if (value.length > 0) {
} let have = value.find(val => val === item[this.map.value])
} else { item.selected = have !== undefined
item.selected = value === item[this.map.value] } else {
} item.selected = false
}
list.push(item) } else {
}) item.selected = value === item[this.map.value]
return this.setRange(list) }
},
/** list.push(item)
* 处理最大最小值 })
* @param {Object} list return this.setRange(list)
*/ },
setRange(list) { /**
let selectList = list.filter(item => item.selected) * 处理最大最小值
let min = Number(this.min) || 0 * @param {Object} list
let max = Number(this.max) || '' */
list.forEach((item, index) => { setRange(list) {
if (this.multiple) { let selectList = list.filter(item => item.selected)
if (selectList.length <= min) { let min = Number(this.min) || 0
let have = selectList.find(val => val[this.map.value] === item[this.map.value]) let max = Number(this.max) || ''
if (have !== undefined) { list.forEach((item, index) => {
item.disabled = true if (this.multiple) {
} if (selectList.length <= min) {
} let have = selectList.find(val => val[this.map.value] === item[this.map.value])
if (have !== undefined) {
if (selectList.length >= max && max !== '') { item.disabled = true
let have = selectList.find(val => val[this.map.value] === item[this.map.value]) }
if (have === undefined) { }
item.disabled = true
} if (selectList.length >= max && max !== '') {
} let have = selectList.find(val => val[this.map.value] === item[this.map.value])
} if (have === undefined) {
this.setStyles(item, index) item.disabled = true
list[index] = item }
}) }
return list }
}, this.setStyles(item, index)
/** list[index] = item
* 设置 class })
* @param {Object} item return list
* @param {Object} index },
*/ /**
setStyles(item, index) { * 设置 class
// 设置自定义样式 * @param {Object} item
item.styleBackgroud = this.setStyleBackgroud(item) * @param {Object} index
item.styleIcon = this.setStyleIcon(item) */
item.styleIconText = this.setStyleIconText(item) setStyles(item, index) {
item.styleRightIcon = this.setStyleRightIcon(item) // 设置自定义样式
}, item.styleBackgroud = this.setStyleBackgroud(item)
item.styleIcon = this.setStyleIcon(item)
/** item.styleIconText = this.setStyleIconText(item)
* 获取选中值 item.styleRightIcon = this.setStyleRightIcon(item)
* @param {Object} range },
*/
getSelectedValue(range) { /**
if (!this.multiple) return this.dataValue * 获取选中值
let selectedArr = [] * @param {Object} range
range.forEach((item) => { */
if (item.selected) { getSelectedValue(range) {
selectedArr.push(item[this.map.value]) if (!this.multiple) return this.dataValue
} let selectedArr = []
}) range.forEach((item) => {
return this.dataValue.length > 0 ? this.dataValue : selectedArr if (item.selected) {
}, selectedArr.push(item[this.map.value])
}
/** })
* 设置背景样式 return this.dataValue.length > 0 ? this.dataValue : selectedArr
*/ },
setStyleBackgroud(item) {
let styles = {} /**
let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff' * 设置背景样式
if (this.selectedColor) { */
if (this.mode !== 'list') { setStyleBackgroud(item) {
styles['border-color'] = item.selected ? selectedColor : '#DCDFE6' let styles = {}
} let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
if (this.mode === 'tag') { if (this.selectedColor) {
styles['background-color'] = item.selected ? selectedColor : '#f5f5f5' if (this.mode !== 'list') {
} styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
} }
let classles = '' if (this.mode === 'tag') {
for (let i in styles) { styles['background-color'] = item.selected ? selectedColor : '#f5f5f5'
classles += `${i}:${styles[i]};` }
} }
return classles let classles = ''
}, for (let i in styles) {
setStyleIcon(item) { classles += `${i}:${styles[i]};`
let styles = {} }
let classles = '' return classles
if (this.selectedColor) { },
let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff' setStyleIcon(item) {
styles['background-color'] = item.selected ? selectedColor : '#fff' let styles = {}
styles['border-color'] = item.selected ? selectedColor : '#DCDFE6' let classles = ''
if (this.selectedColor) {
if (!item.selected && item.disabled) { let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
styles['background-color'] = '#F2F6FC' styles['background-color'] = item.selected ? selectedColor : '#fff'
styles['border-color'] = item.selected ? selectedColor : '#DCDFE6' styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
}
} if (!item.selected && item.disabled) {
for (let i in styles) { styles['background-color'] = '#F2F6FC'
classles += `${i}:${styles[i]};` styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
} }
return classles }
}, for (let i in styles) {
setStyleIconText(item) { classles += `${i}:${styles[i]};`
let styles = {} }
let classles = '' return classles
if (this.selectedColor) { },
let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff' setStyleIconText(item) {
if (this.mode === 'tag') { let styles = {}
styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#666' let classles = ''
} else { if (this.selectedColor) {
styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#666' let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
} if (this.mode === 'tag') {
if (!item.selected && item.disabled) { styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#666'
styles.color = '#999' } else {
} styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#666'
} }
for (let i in styles) { if (!item.selected && item.disabled) {
classles += `${i}:${styles[i]};` styles.color = '#999'
} }
return classles }
}, for (let i in styles) {
setStyleRightIcon(item) { classles += `${i}:${styles[i]};`
let styles = {} }
let classles = '' return classles
if (this.mode === 'list') { },
styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6' setStyleRightIcon(item) {
} let styles = {}
for (let i in styles) { let classles = ''
classles += `${i}:${styles[i]};` if (this.mode === 'list') {
} styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6'
}
return classles for (let i in styles) {
} classles += `${i}:${styles[i]};`
} }
}
</script> return classles
}
<style lang="scss"> }
$uni-primary: #2979ff !default; }
$border-color: #DCDFE6; </script>
$disable: 0.4;
<style lang="scss">
@mixin flex { $uni-primary: #2979ff !default;
/* #ifndef APP-NVUE */ $border-color: #DCDFE6;
display: flex; $disable: 0.4;
/* #endif */
} @mixin flex {
/* #ifndef APP-NVUE */
.uni-data-loading { display: flex;
@include flex; /* #endif */
flex-direction: row; }
justify-content: center;
align-items: center; .uni-data-loading {
height: 36px; @include flex;
padding-left: 10px; flex-direction: row;
color: #999; justify-content: center;
} align-items: center;
height: 36px;
.uni-data-checklist { padding-left: 10px;
position: relative; color: #999;
z-index: 0; }
flex: 1;
.uni-data-checklist {
// 多选样式 position: relative;
.checklist-group { z-index: 0;
@include flex; flex: 1;
flex-direction: row;
flex-wrap: wrap; // 多选样式
.checklist-group {
&.is-list { @include flex;
flex-direction: column; flex-direction: row;
} flex-wrap: wrap;
.checklist-box { &.is-list {
@include flex; flex-direction: column;
flex-direction: row; }
align-items: center;
position: relative; .checklist-box {
margin: 5px 0; @include flex;
margin-right: 25px; flex-direction: row;
align-items: center;
.hidden { position: relative;
position: absolute; margin: 5px 0;
opacity: 0; margin-right: 25px;
}
.hidden {
// 文字样式 position: absolute;
.checklist-content { opacity: 0;
@include flex; }
flex: 1;
flex-direction: row; // 文字样式
align-items: center; .checklist-content {
justify-content: space-between; @include flex;
flex: 1;
.checklist-text { flex-direction: row;
font-size: 14px; align-items: center;
color: #666; justify-content: space-between;
margin-left: 5px;
line-height: 14px; .checklist-text {
} font-size: 14px;
color: #666;
.checkobx__list { margin-left: 5px;
border-right-width: 1px; line-height: 14px;
border-right-color: #007aff; }
border-right-style: solid;
border-bottom-width: 1px; .checkobx__list {
border-bottom-color: #007aff; border-right-width: 1px;
border-bottom-style: solid; border-right-color: #007aff;
height: 12px; border-right-style: solid;
width: 6px; border-bottom-width: 1px;
left: -5px; border-bottom-color: #007aff;
transform-origin: center; border-bottom-style: solid;
transform: rotate(45deg); height: 12px;
opacity: 0; width: 6px;
} left: -5px;
} transform-origin: center;
transform: rotate(45deg);
// 多选样式 opacity: 0;
.checkbox__inner { }
/* #ifndef APP-NVUE */ }
flex-shrink: 0;
box-sizing: border-box; // 多选样式
/* #endif */ .checkbox__inner {
position: relative; /* #ifndef APP-NVUE */
width: 16px; flex-shrink: 0;
height: 16px; box-sizing: border-box;
border: 1px solid $border-color; /* #endif */
border-radius: 4px; position: relative;
background-color: #fff; width: 16px;
z-index: 1; height: 16px;
border: 1px solid $border-color;
.checkbox__inner-icon { border-radius: 4px;
position: absolute; background-color: #fff;
/* #ifdef APP-NVUE */ z-index: 1;
top: 2px;
/* #endif */ .checkbox__inner-icon {
/* #ifndef APP-NVUE */ position: absolute;
top: 1px; /* #ifdef APP-NVUE */
/* #endif */ top: 2px;
left: 5px; /* #endif */
height: 8px; /* #ifndef APP-NVUE */
width: 4px; top: 1px;
border-right-width: 1px; /* #endif */
border-right-color: #fff; left: 5px;
border-right-style: solid; height: 8px;
border-bottom-width: 1px; width: 4px;
border-bottom-color: #fff; border-right-width: 1px;
border-bottom-style: solid; border-right-color: #fff;
opacity: 0; border-right-style: solid;
transform-origin: center; border-bottom-width: 1px;
transform: rotate(40deg); border-bottom-color: #fff;
} border-bottom-style: solid;
} opacity: 0;
transform-origin: center;
// 单选样式 transform: rotate(40deg);
.radio__inner { }
@include flex; }
/* #ifndef APP-NVUE */
flex-shrink: 0; // 单选样式
box-sizing: border-box; .radio__inner {
/* #endif */ @include flex;
justify-content: center; /* #ifndef APP-NVUE */
align-items: center; flex-shrink: 0;
position: relative; box-sizing: border-box;
width: 16px; /* #endif */
height: 16px; justify-content: center;
border: 1px solid $border-color; align-items: center;
border-radius: 16px; position: relative;
background-color: #fff; width: 16px;
z-index: 1; height: 16px;
border: 1px solid $border-color;
.radio__inner-icon { border-radius: 16px;
width: 8px; background-color: #fff;
height: 8px; z-index: 1;
border-radius: 10px;
opacity: 0; .radio__inner-icon {
} width: 8px;
} height: 8px;
border-radius: 10px;
// 默认样式 opacity: 0;
&.is--default { }
}
// 禁用
&.is-disable { // 默认样式
/* #ifdef H5 */ &.is--default {
cursor: not-allowed;
// 禁用
/* #endif */ &.is-disable {
.checkbox__inner { /* #ifdef H5 */
background-color: #F2F6FC; cursor: not-allowed;
border-color: $border-color;
/* #ifdef H5 */ /* #endif */
cursor: not-allowed; .checkbox__inner {
/* #endif */ background-color: #F2F6FC;
} border-color: $border-color;
/* #ifdef H5 */
.radio__inner { cursor: not-allowed;
background-color: #F2F6FC; /* #endif */
border-color: $border-color; }
}
.checklist-text {
color: #999;
}
}
// 选中
&.is-checked {
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
}
.radio__inner {
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $uni-primary;
}
}
.checklist-text {
color: $uni-primary;
}
// 选中禁用
&.is-disable {
.checkbox__inner {
opacity: $disable;
}
.checklist-text {
opacity: $disable;
}
.radio__inner {
opacity: $disable;
}
}
}
}
// 按钮样式
&.is--button {
margin-right: 10px;
padding: 5px 10px;
border: 1px $border-color solid;
border-radius: 3px;
transition: border-color 0.2s;
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
border: 1px #eee solid;
opacity: $disable;
.checkbox__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.radio__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.checklist-text {
color: #999;
}
}
&.is-checked {
border-color: $uni-primary;
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
}
.radio__inner {
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $uni-primary;
}
}
.checklist-text {
color: $uni-primary;
}
// 选中禁用
&.is-disable {
opacity: $disable;
}
}
}
// 标签样式
&.is--tag {
margin-right: 10px;
padding: 5px 10px;
border: 1px $border-color solid;
border-radius: 3px;
background-color: #f5f5f5;
.checklist-text {
margin: 0;
color: #666;
}
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
opacity: $disable;
}
&.is-checked {
background-color: $uni-primary;
border-color: $uni-primary;
.checklist-text {
color: #fff;
}
}
}
// 列表样式
&.is--list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
padding: 10px 15px;
padding-left: 0;
margin: 0;
&.is-list-border {
border-top: 1px #eee solid;
}
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
.checkbox__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.checklist-text {
color: #999;
}
}
&.is-checked {
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
}
.radio__inner { .radio__inner {
border-color: $uni-primary; background-color: #F2F6FC;
.radio__inner-icon { border-color: $border-color;
}
.checklist-text {
color: #999;
}
}
// 选中
&.is-checked {
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1; opacity: 1;
background-color: $uni-primary; transform: rotate(45deg);
} }
} }
.checklist-text { .radio__inner {
color: $uni-primary; border-color: $uni-primary;
}
.radio__inner-icon {
.checklist-content { opacity: 1;
.checkobx__list { background-color: $uni-primary;
opacity: 1; }
border-color: $uni-primary; }
}
} .checklist-text {
color: $uni-primary;
// 选中禁用 }
&.is-disable {
.checkbox__inner { // 选中禁用
opacity: $disable; &.is-disable {
} .checkbox__inner {
opacity: $disable;
.checklist-text { }
opacity: $disable;
} .checklist-text {
} opacity: $disable;
} }
}
} .radio__inner {
} opacity: $disable;
} }
}
}
}
// 按钮样式
&.is--button {
margin-right: 10px;
padding: 5px 10px;
border: 1px $border-color solid;
border-radius: 3px;
transition: border-color 0.2s;
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
border: 1px #eee solid;
opacity: $disable;
.checkbox__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.radio__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.checklist-text {
color: #999;
}
}
&.is-checked {
border-color: $uni-primary;
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
}
.radio__inner {
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $uni-primary;
}
}
.checklist-text {
color: $uni-primary;
}
// 选中禁用
&.is-disable {
opacity: $disable;
}
}
}
// 标签样式
&.is--tag {
margin-right: 10px;
padding: 5px 10px;
border: 1px $border-color solid;
border-radius: 3px;
background-color: #f5f5f5;
.checklist-text {
margin: 0;
color: #666;
}
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
opacity: $disable;
}
&.is-checked {
background-color: $uni-primary;
border-color: $uni-primary;
.checklist-text {
color: #fff;
}
}
}
// 列表样式
&.is--list {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
padding: 10px 15px;
padding-left: 0;
margin: 0;
&.is-list-border {
border-top: 1px #eee solid;
}
// 禁用
&.is-disable {
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
.checkbox__inner {
background-color: #F2F6FC;
border-color: $border-color;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
.checklist-text {
color: #999;
}
}
&.is-checked {
.checkbox__inner {
border-color: $uni-primary;
background-color: $uni-primary;
.checkbox__inner-icon {
opacity: 1;
transform: rotate(45deg);
}
}
.radio__inner {
border-color: $uni-primary;
.radio__inner-icon {
opacity: 1;
background-color: $uni-primary;
}
}
.checklist-text {
color: $uni-primary;
}
.checklist-content {
.checkobx__list {
opacity: 1;
border-color: $uni-primary;
}
}
// 选中禁用
&.is-disable {
.checkbox__inner {
opacity: $disable;
}
.checklist-text {
opacity: $disable;
}
}
}
}
}
}
}
</style> </style>
{ {
"id": "uni-data-checkbox", "id": "uni-data-checkbox",
"displayName": "uni-data-checkbox 数据选择器", "displayName": "uni-data-checkbox 数据选择器",
"version": "1.0.5", "version": "1.0.6",
"description": "通过数据驱动的单选框和复选框", "description": "通过数据驱动的单选框和复选框",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -43,12 +43,15 @@ ...@@ -43,12 +43,15 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "n"
}, },
"client": { "client": {
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "y" "app-nvue": "y",
"app-harmony": "u",
"app-uvue": "u"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
......
## 1.4.13(2024-10-08)
- 修复 校验规则在抖音开发者工具上不生效的bug,详见:[https://ask.dcloud.net.cn/question/191933](https://ask.dcloud.net.cn/question/191933)
## 1.4.12 (2024-9-21)
- 修复 form上次修改的问题
## 1.4.11 (2024-9-14)
- 修复 binddata的兼容性问题
## 1.4.10(2023-11-03) ## 1.4.10(2023-11-03)
- 优化 labelWidth 描述错误 - 优化 labelWidth 描述错误
## 1.4.9(2023-02-10) ## 1.4.9(2023-02-10)
......
...@@ -56,8 +56,13 @@ ...@@ -56,8 +56,13 @@
export default { export default {
name: 'uniFormsItem', name: 'uniFormsItem',
options: { options: {
virtualHost: true // #ifdef MP-TOUTIAO
virtualHost: false,
// #endif
// #ifndef MP-TOUTIAO
virtualHost: true
// #endif
}, },
provide() { provide() {
return { return {
......
...@@ -67,8 +67,13 @@ ...@@ -67,8 +67,13 @@
export default { export default {
name: 'uniForms', name: 'uniForms',
emits: ['validate', 'submit'], emits: ['validate', 'submit'],
options: { options: {
virtualHost: true // #ifdef MP-TOUTIAO
virtualHost: false,
// #endif
// #ifndef MP-TOUTIAO
virtualHost: true
// #endif
}, },
props: { props: {
// 即将弃用 // 即将弃用
...@@ -180,15 +185,17 @@ ...@@ -180,15 +185,17 @@
} }
} }
if (!formVm) return console.error('当前 uni-froms 组件缺少 ref 属性'); if (!formVm) return console.error('当前 uni-froms 组件缺少 ref 属性');
formVm.setValue(name, value); if(formVm.model)formVm.model[name] = value
if(formVm.modelValue)formVm.modelValue[name] = value
if(formVm.value)formVm.value[name] = value
} }
} }
} }
// #endif // #endif
// 子组件实例数组 // 子组件实例数组
this.childrens = [] this.childrens = []
// TODO 兼容旧版 uni-data-picker ,新版本中无效,只是避免报错 // TODO 兼容旧版 uni-data-picker ,新版本中无效,只是避免报错
this.inputChildrens = [] this.inputChildrens = []
this.setRules(this.rules) this.setRules(this.rules)
}, },
...@@ -394,4 +401,4 @@ ...@@ -394,4 +401,4 @@
<style lang="scss"> <style lang="scss">
.uni-forms {} .uni-forms {}
</style> </style>
{ {
"id": "uni-forms", "id": "uni-forms",
"displayName": "uni-forms 表单", "displayName": "uni-forms 表单",
"version": "1.4.10", "version": "1.4.13",
"description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "n"
}, },
"client": { "client": {
"App": { "App": {
......
...@@ -10,16 +10,15 @@ ...@@ -10,16 +10,15 @@
"权限" "权限"
], ],
"repository": "https://gitcode.net/dcloud/uni-id-common", "repository": "https://gitcode.net/dcloud/uni-id-common",
"engines": { "engines": {
"HBuilderX": "^3.1.0"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": 0
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": 0
} }
}, },
"contact": { "contact": {
......
## 1.1.22(2024-09-13) ## 1.1.23(2024-11-05)
- 注册登录时去除字符串两端的空白字符 - uni-id-co 修复 没有配置敏感信息解密密钥时导致登录报错的问题
- 删除static目录下重复资源 ## 1.1.22(2024-09-13)
## 1.1.21(2024-08-02) - 注册登录时去除字符串两端的空白字符
- uni-id-co 修复联登更新用户信息接口存在手机号或者邮箱时没有设置认证状态 - 删除static目录下重复资源
## 1.1.21(2024-08-02)
- uni-id-co 修复联登更新用户信息接口存在手机号或者邮箱时没有设置认证状态
## 1.1.20(2024-04-28) ## 1.1.20(2024-04-28)
- uni-id-co 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios) - uni-id-co 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
## 1.1.19(2024-03-20) ## 1.1.19(2024-03-20)
......
...@@ -6,13 +6,12 @@ const db = uniCloud.database(); ...@@ -6,13 +6,12 @@ const db = uniCloud.database();
const usersTable = db.collection('uni-id-users') const usersTable = db.collection('uni-id-users')
let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{} let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{}
// console.log( hostUserInfo);
const data = { const data = {
userInfo: hostUserInfo, userInfo: hostUserInfo,
hasLogin: Object.keys(hostUserInfo).length != 0 hasLogin: Object.keys(hostUserInfo).length != 0
} }
// console.log('data', data);
// 定义 mutations, 修改属性 // 定义 mutations, 修改属性
export const mutations = { export const mutations = {
// data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新 // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
...@@ -37,6 +36,10 @@ export const mutations = { ...@@ -37,6 +36,10 @@ export const mutations = {
}) })
} else { } else {
// 不等待联网查询,立即更新用户_id确保store.userInfo中的_id是最新的
const _id = uniCloud.getCurrentUserInfo().uid
this.setUserInfo({_id},{cover:true})
// 查库获取用户信息,更新store.userInfo
const uniIdCo = uniCloud.importObject("uni-id-co", { const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI: true customUI: true
}) })
...@@ -58,7 +61,7 @@ export const mutations = { ...@@ -58,7 +61,7 @@ export const mutations = {
} }
} }
}, },
async setUserInfo(data, {cover}={cover:false}) { setUserInfo(data, {cover}={cover:false}) {
// console.log('set-userInfo', data); // console.log('set-userInfo', data);
let userInfo = cover?data:Object.assign(store.userInfo,data) let userInfo = cover?data:Object.assign(store.userInfo,data)
store.userInfo = Object.assign({},userInfo) store.userInfo = Object.assign({},userInfo)
...@@ -78,13 +81,12 @@ export const mutations = { ...@@ -78,13 +81,12 @@ export const mutations = {
} }
uni.removeStorageSync('uni_id_token'); uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0) uni.setStorageSync('uni_id_token_expired', 0)
this.setUserInfo({},{cover:true})
uni.$emit('uni-id-pages-logout')
uni.redirectTo({ uni.redirectTo({
url: `/${pagesJson.uniIdRouter && pagesJson.uniIdRouter.loginPage ? pagesJson.uniIdRouter.loginPage: 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`, url: `/${pagesJson.uniIdRouter && pagesJson.uniIdRouter.loginPage ? pagesJson.uniIdRouter.loginPage: 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`,
}); });
uni.$emit('uni-id-pages-logout')
this.setUserInfo({},{cover:true})
}, },
loginBack (e = {}) { loginBack (e = {}) {
const {uniIdRedirectUrl = ''} = e const {uniIdRedirectUrl = ''} = e
let delta = 0; //判断需要返回几层 let delta = 0; //判断需要返回几层
...@@ -118,9 +120,9 @@ export const mutations = { ...@@ -118,9 +120,9 @@ export const mutations = {
if (delta) { if (delta) {
const page = pagesJson.pages[0] const page = pagesJson.pages[0]
return uni.switchTab({ return uni.reLaunch({
url: `/${page.path}` url: `/${page.path}`
}) })
} }
uni.navigateBack({ uni.navigateBack({
...@@ -139,6 +141,7 @@ export const mutations = { ...@@ -139,6 +141,7 @@ export const mutations = {
duration: 3000 duration: 3000
}); });
} }
// 异步调用(更新用户信息)防止获取头像等操作阻塞页面返回
this.updateUserInfo() this.updateUserInfo()
uni.$emit('uni-id-pages-login-success') uni.$emit('uni-id-pages-login-success')
......
...@@ -66,47 +66,47 @@ ...@@ -66,47 +66,47 @@
{ {
"id": "apple", "id": "apple",
"text": "苹果登录", "text": "苹果登录",
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/apple.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/apple.png",
}, },
{ {
"id": "univerify", "id": "univerify",
"text": "一键登录", "text": "一键登录",
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/univerify.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/univerify.png",
}, },
{ {
"id": "taobao", "id": "taobao",
"text": "淘宝登录", //暂未提供该登录方式的接口示例 "text": "淘宝登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/taobao.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/taobao.png",
}, },
{ {
"id": "facebook", "id": "facebook",
"text": "脸书登录", //暂未提供该登录方式的接口示例 "text": "脸书登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/facebook.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/facebook.png",
}, },
{ {
"id": "alipay", "id": "alipay",
"text": "支付宝登录", //暂未提供该登录方式的接口示例 "text": "支付宝登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/alipay.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/alipay.png",
}, },
{ {
"id": "qq", "id": "qq",
"text": "QQ登录", //暂未提供该登录方式的接口示例 "text": "QQ登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/qq.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/qq.png",
}, },
{ {
"id": "google", "id": "google",
"text": "谷歌登录", //暂未提供该登录方式的接口示例 "text": "谷歌登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/google.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/google.png",
}, },
{ {
"id": "douyin", "id": "douyin",
"text": "抖音登录", //暂未提供该登录方式的接口示例 "text": "抖音登录", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/douyin.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/douyin.png",
}, },
{ {
"id": "sinaweibo", "id": "sinaweibo",
"text": "新浪微博", //暂未提供该登录方式的接口示例 "text": "新浪微博", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app/uni-fab-login/sinaweibo.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png",
} }
// #endif // #endif
], ],
...@@ -211,22 +211,22 @@ ...@@ -211,22 +211,22 @@
} else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启 } else if (this.getRoute(2) == path) { // 如果上一个页面就是,马上要打开的页面,直接返回。防止重复开启
uni.navigateBack(); uni.navigateBack();
} else if (this.getRoute(1) != path) { } else if (this.getRoute(1) != path) {
if(index === 0){ if(index === 0){
uni.navigateTo({ uni.navigateTo({
url: path, url: path,
animationType: 'slide-in-left', animationType: 'slide-in-left',
complete(e) { complete(e) {
// console.log(e); // console.log(e);
} }
}) })
}else{ }else{
uni.redirectTo({ uni.redirectTo({
url: path, url: path,
animationType: 'slide-in-left', animationType: 'slide-in-left',
complete(e) { complete(e) {
// console.log(e); // console.log(e);
} }
}) })
} }
} else { } else {
console.log('出乎意料的情况,path:' + path); console.log('出乎意料的情况,path:' + path);
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.1.22", "version": "1.1.23",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
...@@ -64,9 +64,11 @@ ...@@ -64,9 +64,11 @@
"vue3": "y" "vue3": "y"
}, },
"App": { "App": {
"app-vue": "y", "app-vue": "y",
"app-nvue": "u" "app-nvue": "u",
}, "app-harmony": "u",
"app-uvue": "u"
},
"H5-mobile": { "H5-mobile": {
"Safari": "y", "Safari": "y",
"Android Browser": "y", "Android Browser": "y",
......
...@@ -21,10 +21,10 @@ function checkSecret (secret) { ...@@ -21,10 +21,10 @@ function checkSecret (secret) {
} }
} }
function encryptData (text = '') { function encryptData (text = '') {
if (!text) return text
const encryptSecret = this.config.sensitiveInfoEncryptSecret const encryptSecret = this.config.sensitiveInfoEncryptSecret
if (!text || !encryptSecret) return text
checkSecret(encryptSecret) checkSecret(encryptSecret)
const iv = encryptSecret.slice(-16) const iv = encryptSecret.slice(-16)
...@@ -40,10 +40,10 @@ function encryptData (text = '') { ...@@ -40,10 +40,10 @@ function encryptData (text = '') {
} }
function decryptData (text = '') { function decryptData (text = '') {
if (!text) return text
const encryptSecret = this.config.sensitiveInfoEncryptSecret const encryptSecret = this.config.sensitiveInfoEncryptSecret
if (!text || !encryptSecret) return text
checkSecret(encryptSecret) checkSecret(encryptSecret)
const iv = encryptSecret.slice(-16) const iv = encryptSecret.slice(-16)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"keepRunningAfterReturn": false "keepRunningAfterReturn": false
}, },
"origin-plugin-dev-name": "uni-id-pages", "origin-plugin-dev-name": "uni-id-pages",
"origin-plugin-version": "1.1.22", "origin-plugin-version": "1.1.23",
"plugin-dev-name": "uni-id-pages", "plugin-dev-name": "uni-id-pages",
"plugin-version": "1.1.22" "plugin-version": "1.1.23"
} }
\ No newline at end of file
## 1.3.6(2024-10-15)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.5(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.4(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.3.3(2022-01-20) ## 1.3.3(2022-01-20)
- 新增 showText属性 ,是否显示文本 - 新增 showText属性 ,是否显示文本
## 1.3.2(2022-01-19) ## 1.3.2(2022-01-19)
......
...@@ -36,8 +36,13 @@ ...@@ -36,8 +36,13 @@
<script> <script>
let platform let platform
setTimeout(() => { setTimeout(() => {
platform = uni.getSystemInfoSync().platform // #ifdef MP-WEIXIN
platform = uni.getDeviceInfo().platform
// #endif
// #ifndef MP-WEIXIN
platform = uni.getSystemInfoSync().platform
// #endif
}, 16) }, 16)
import { import {
......
{ {
"id": "uni-load-more", "id": "uni-load-more",
"displayName": "uni-load-more 加载更多", "displayName": "uni-load-more 加载更多",
"version": "1.3.3", "version": "1.3.6",
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。", "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
"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"], "dependencies": ["uni-scss"],
...@@ -45,7 +42,8 @@ ...@@ -45,7 +42,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "n"
}, },
"client": { "client": {
"App": { "App": {
...@@ -83,4 +81,4 @@ ...@@ -83,4 +81,4 @@
} }
} }
} }
} }
\ No newline at end of file
## 1.9.5(2024-10-15)
- 修复 微信小程序中的getSystemInfo警告
## 1.9.4(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.9.3(2024-10-12)
- 修复 微信小程序中的getSystemInfo警告
## 1.9.2(2024-09-21)
- 修复 uni-popup在android上的重复点击弹出位置不正确的bug
## 1.9.1(2024-04-02) ## 1.9.1(2024-04-02)
- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法) - 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法)
## 1.9.0(2024-03-28) ## 1.9.0(2024-03-28)
......
...@@ -192,6 +192,17 @@ ...@@ -192,6 +192,17 @@
}, },
mounted() { mounted() {
const fixSize = () => { const fixSize = () => {
// #ifdef MP-WEIXIN
const {
windowWidth,
windowHeight,
windowTop,
safeArea,
screenHeight,
safeAreaInsets
} = uni.getWindowInfo()
// #endif
// #ifndef MP-WEIXIN
const { const {
windowWidth, windowWidth,
windowHeight, windowHeight,
...@@ -200,6 +211,7 @@ ...@@ -200,6 +211,7 @@
screenHeight, screenHeight,
safeAreaInsets safeAreaInsets
} = uni.getSystemInfoSync() } = uni.getSystemInfoSync()
// #endif
this.popupWidth = windowWidth this.popupWidth = windowWidth
this.popupHeight = windowHeight + (windowTop || 0) this.popupHeight = windowHeight + (windowTop || 0)
// TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复 // TODO fix by mehaotian 是否适配底部安全区 ,目前微信ios 、和 app ios 计算有差异,需要框架修复
...@@ -350,6 +362,7 @@ ...@@ -350,6 +362,7 @@
this.showPopup = true this.showPopup = true
this.showTrans = true this.showTrans = true
this.$nextTick(() => { this.$nextTick(() => {
this.showPoptrans()
if (this.messageChild && this.type === 'message') { if (this.messageChild && this.type === 'message') {
this.messageChild.timerClose() this.messageChild.timerClose()
} }
...@@ -372,8 +385,7 @@ ...@@ -372,8 +385,7 @@
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
this.showPopup = true this.showPoptrans()
this.showTrans = true
}, },
/** /**
* 中间弹出样式处理 * 中间弹出样式处理
...@@ -403,8 +415,7 @@ ...@@ -403,8 +415,7 @@
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
this.showPopup = true this.showPoptrans()
this.showTrans = true
}, },
left(type) { left(type) {
this.popupstyle = 'left' this.popupstyle = 'left'
...@@ -423,8 +434,7 @@ ...@@ -423,8 +434,7 @@
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
this.showPopup = true this.showPoptrans()
this.showTrans = true
}, },
right(type) { right(type) {
this.popupstyle = 'right' this.popupstyle = 'right'
...@@ -443,8 +453,13 @@ ...@@ -443,8 +453,13 @@
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
this.showPopup = true this.showPoptrans()
this.showTrans = true },
showPoptrans(){
this.$nextTick(()=>{
this.showPopup = true
this.showTrans = true
})
} }
} }
} }
......
{ {
"id": "uni-popup", "id": "uni-popup",
"displayName": "uni-popup 弹出层", "displayName": "uni-popup 弹出层",
"version": "1.9.1", "version": "1.9.5",
"description": " Popup 组件,提供常用的弹层", "description": " Popup 组件,提供常用的弹层",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册