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

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

上级 babb9fdc
## 0.7.5(2023-12-18)
- 修复 在uni-app x项目,部分情况下,执行uni-captcha组件的setFocus无效的问题
## 0.7.4(2023-12-18)
- 更新 `package.json` -> `dependencies` 增加 `uni-popup`
## 0.7.3(2023-11-15) ## 0.7.3(2023-11-15)
- 更新 uni-popup-captcha.uvue依赖的popup组件,直接使用uni_modules下的uni-popup组件 - 更新 uni-popup-captcha.uvue依赖的popup组件,直接使用uni_modules下的uni-popup组件
## 0.7.2(2023-11-07) ## 0.7.2(2023-11-07)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<image class="loding" src="/uni_modules/uni-captcha/static/run.gif" v-if="loging" mode="widthFix" /> <image class="loding" src="/uni_modules/uni-captcha/static/run.gif" v-if="loging" mode="widthFix" />
<image class="captcha-img" :class="{opacity:loging}" @click="getImageCaptcha(true)" :src="captchaBase64" mode="widthFix" /> <image class="captcha-img" :class="{opacity:loging}" @click="getImageCaptcha(true)" :src="captchaBase64" mode="widthFix" />
</view> </view>
<input @blur="focusCaptchaInput = false" :focus="focusCaptchaInput" type="digit" class="captcha" :inputBorder="false" <input @blur="focusCaptchaInput = false" @focus="focusCaptchaInput = true" :focus="focusCaptchaInput" type="digit" class="captcha" :inputBorder="false"
maxlength="4" v-model="val" placeholder="请输入验证码" :cursor-spacing="cursorSpacing" /> maxlength="4" v-model="val" placeholder="请输入验证码" :cursor-spacing="cursorSpacing" />
</view> </view>
</template> </template>
......
...@@ -14,12 +14,8 @@ ...@@ -14,12 +14,8 @@
</template> </template>
<script> <script>
import uniPopup from './uni-popup/uni-popup.uvue';
let confirmCallBack = ():void=>console.log('未传入回调函数') let confirmCallBack = ():void=>console.log('未传入回调函数')
export default { export default {
components: {
uniPopup
},
emits:["modelValue","confirm","cancel"], emits:["modelValue","confirm","cancel"],
data() { data() {
return { return {
......
{ {
"id": "uni-captcha", "id": "uni-captcha",
"displayName": "uni-captcha", "displayName": "uni-captcha",
"version": "0.7.3", "version": "0.7.5",
"description": "云端一体图形验证码组件", "description": "云端一体图形验证码组件",
"keywords": [ "keywords": [
"captcha", "captcha",
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"engines": { "engines": {
"HBuilderX": "^3.1.0" "HBuilderX": "^3.1.0"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
"type": "unicloud-template-function" "type": "unicloud-template-function"
}, },
"uni_modules": { "uni_modules": {
"dependencies": [], "dependencies": [
"uni-popup"
],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
...@@ -72,8 +74,8 @@ ...@@ -72,8 +74,8 @@
"联盟": "u" "联盟": "u"
}, },
"Vue": { "Vue": {
"vue2": "y", "vue2": "y",
"vue3": "u" "vue3": "u"
} }
} }
} }
......
## 1.0.5(2024-03-20)
- 修复 单选模式下选中样式不生效的bug
## 1.0.4(2024-01-27)
- 修复 修复错别字chagne为change
## 1.0.3(2022-09-16) ## 1.0.3(2022-09-16)
- 可以使用 uni-scss 控制主题色 - 可以使用 uni-scss 控制主题色
## 1.0.2(2022-06-30) ## 1.0.2(2022-06-30)
......
...@@ -2,16 +2,21 @@ ...@@ -2,16 +2,21 @@
<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" :content-text="contentText"></uni-load-more> <uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18"
: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}" @change="chagne"> <checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}"
<label class="checklist-box" :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']" @change="change">
:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index"> <label class="checklist-box"
<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''" :checked="item.selected" /> :class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="checkbox__inner" :style="item.styleIcon"> :style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''"
:checked="item.selected" />
<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
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'}">
...@@ -20,13 +25,14 @@ ...@@ -20,13 +25,14 @@
</view> </view>
</label> </label>
</checkbox-group> </checkbox-group>
<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="chagne"> <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]+''" :checked="item.selected" /> <radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''"
: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'}">
...@@ -68,7 +74,7 @@ ...@@ -68,7 +74,7 @@
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,
...@@ -88,7 +94,7 @@ ...@@ -88,7 +94,7 @@
// TODO vue3 // TODO vue3
modelValue: { modelValue: {
type: [Array, String, Number], type: [Array, String, Number],
default() { default () {
return ''; return '';
} }
}, },
...@@ -122,20 +128,20 @@ ...@@ -122,20 +128,20 @@
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'
} }
} }
} }
...@@ -153,7 +159,7 @@ ...@@ -153,7 +159,7 @@
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
...@@ -177,18 +183,18 @@ ...@@ -177,18 +183,18 @@
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
} }
}, },
...@@ -197,13 +203,13 @@ ...@@ -197,13 +203,13 @@
// 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)
...@@ -223,15 +229,15 @@ ...@@ -223,15 +229,15 @@
}, },
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
}) })
}, },
...@@ -248,7 +254,7 @@ ...@@ -248,7 +254,7 @@
} }
return parent; return parent;
}, },
chagne(e) { change(e) {
const values = e.detail.value const values = e.detail.value
let detail = { let detail = {
...@@ -383,14 +389,14 @@ ...@@ -383,14 +389,14 @@
*/ */
setStyleBackgroud(item) { setStyleBackgroud(item) {
let styles = {} let styles = {}
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
if (this.selectedColor) { if (this.selectedColor) {
if (this.mode !== 'list') { if (this.mode !== 'list') {
styles['border-color'] = item.selected?selectedColor:'#DCDFE6' styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
} }
if (this.mode === 'tag') { if (this.mode === 'tag') {
styles['background-color'] = item.selected? selectedColor:'#f5f5f5' styles['background-color'] = item.selected ? selectedColor : '#f5f5f5'
} }
} }
let classles = '' let classles = ''
for (let i in styles) { for (let i in styles) {
...@@ -400,16 +406,16 @@ ...@@ -400,16 +406,16 @@
}, },
setStyleIcon(item) { setStyleIcon(item) {
let styles = {} let styles = {}
let classles = '' let classles = ''
if (this.selectedColor) { if (this.selectedColor) {
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
styles['background-color'] = item.selected?selectedColor:'#fff' 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){ if (!item.selected && item.disabled) {
styles['background-color'] = '#F2F6FC' styles['background-color'] = '#F2F6FC'
styles['border-color'] = item.selected?selectedColor:'#DCDFE6' styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
} }
} }
for (let i in styles) { for (let i in styles) {
classles += `${i}:${styles[i]};` classles += `${i}:${styles[i]};`
...@@ -418,17 +424,17 @@ ...@@ -418,17 +424,17 @@
}, },
setStyleIconText(item) { setStyleIconText(item) {
let styles = {} let styles = {}
let classles = '' let classles = ''
if (this.selectedColor) { if (this.selectedColor) {
let selectedColor = this.selectedColor?this.selectedColor:'#2979ff' let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
if (this.mode === 'tag') { if (this.mode === 'tag') {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:'#fff'):'#666' styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#666'
} else { } else {
styles.color = item.selected?(this.selectedTextColor?this.selectedTextColor:selectedColor):'#666' styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#666'
} }
if(!item.selected && item.disabled){ if (!item.selected && item.disabled) {
styles.color = '#999' styles.color = '#999'
} }
} }
for (let i in styles) { for (let i in styles) {
classles += `${i}:${styles[i]};` classles += `${i}:${styles[i]};`
...@@ -439,7 +445,7 @@ ...@@ -439,7 +445,7 @@
let styles = {} let styles = {}
let classles = '' let classles = ''
if (this.mode === 'list') { if (this.mode === 'list') {
styles['border-color'] = item.selected?this.styles.selectedColor:'#DCDFE6' styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6'
} }
for (let i in styles) { for (let i in styles) {
classles += `${i}:${styles[i]};` classles += `${i}:${styles[i]};`
...@@ -454,7 +460,7 @@ ...@@ -454,7 +460,7 @@
<style lang="scss"> <style lang="scss">
$uni-primary: #2979ff !default; $uni-primary: #2979ff !default;
$border-color: #DCDFE6; $border-color: #DCDFE6;
$disable:0.4; $disable: 0.4;
@mixin flex { @mixin flex {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -476,6 +482,7 @@ ...@@ -476,6 +482,7 @@
position: relative; position: relative;
z-index: 0; z-index: 0;
flex: 1; flex: 1;
// 多选样式 // 多选样式
.checklist-group { .checklist-group {
@include flex; @include flex;
...@@ -506,6 +513,7 @@ ...@@ -506,6 +513,7 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.checklist-text { .checklist-text {
font-size: 14px; font-size: 14px;
color: #666; color: #666;
...@@ -517,7 +525,7 @@ ...@@ -517,7 +525,7 @@
border-right-width: 1px; border-right-width: 1px;
border-right-color: #007aff; border-right-color: #007aff;
border-right-style: solid; border-right-style: solid;
border-bottom-width:1px; border-bottom-width: 1px;
border-bottom-color: #007aff; border-bottom-color: #007aff;
border-bottom-style: solid; border-bottom-style: solid;
height: 12px; height: 12px;
...@@ -542,6 +550,7 @@ ...@@ -542,6 +550,7 @@
border-radius: 4px; border-radius: 4px;
background-color: #fff; background-color: #fff;
z-index: 1; z-index: 1;
.checkbox__inner-icon { .checkbox__inner-icon {
position: absolute; position: absolute;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
...@@ -556,7 +565,7 @@ ...@@ -556,7 +565,7 @@
border-right-width: 1px; border-right-width: 1px;
border-right-color: #fff; border-right-color: #fff;
border-right-style: solid; border-right-style: solid;
border-bottom-width:1px ; border-bottom-width: 1px;
border-bottom-color: #fff; border-bottom-color: #fff;
border-bottom-style: solid; border-bottom-style: solid;
opacity: 0; opacity: 0;
...@@ -597,6 +606,7 @@ ...@@ -597,6 +606,7 @@
&.is-disable { &.is-disable {
/* #ifdef H5 */ /* #ifdef H5 */
cursor: not-allowed; cursor: not-allowed;
/* #endif */ /* #endif */
.checkbox__inner { .checkbox__inner {
background-color: #F2F6FC; background-color: #F2F6FC;
...@@ -610,6 +620,7 @@ ...@@ -610,6 +620,7 @@
background-color: #F2F6FC; background-color: #F2F6FC;
border-color: $border-color; border-color: $border-color;
} }
.checklist-text { .checklist-text {
color: #999; color: #999;
} }
...@@ -626,16 +637,20 @@ ...@@ -626,16 +637,20 @@
transform: rotate(45deg); transform: rotate(45deg);
} }
} }
.radio__inner { .radio__inner {
border-color: $uni-primary; border-color: $uni-primary;
.radio__inner-icon { .radio__inner-icon {
opacity: 1; opacity: 1;
background-color: $uni-primary; background-color: $uni-primary;
} }
} }
.checklist-text { .checklist-text {
color: $uni-primary; color: $uni-primary;
} }
// 选中禁用 // 选中禁用
&.is-disable { &.is-disable {
.checkbox__inner { .checkbox__inner {
...@@ -645,6 +660,7 @@ ...@@ -645,6 +660,7 @@
.checklist-text { .checklist-text {
opacity: $disable; opacity: $disable;
} }
.radio__inner { .radio__inner {
opacity: $disable; opacity: $disable;
} }
...@@ -667,6 +683,7 @@ ...@@ -667,6 +683,7 @@
/* #endif */ /* #endif */
border: 1px #eee solid; border: 1px #eee solid;
opacity: $disable; opacity: $disable;
.checkbox__inner { .checkbox__inner {
background-color: #F2F6FC; background-color: #F2F6FC;
border-color: $border-color; border-color: $border-color;
...@@ -674,6 +691,7 @@ ...@@ -674,6 +691,7 @@
cursor: not-allowed; cursor: not-allowed;
/* #endif */ /* #endif */
} }
.radio__inner { .radio__inner {
background-color: #F2F6FC; background-color: #F2F6FC;
border-color: $border-color; border-color: $border-color;
...@@ -681,6 +699,7 @@ ...@@ -681,6 +699,7 @@
cursor: not-allowed; cursor: not-allowed;
/* #endif */ /* #endif */
} }
.checklist-text { .checklist-text {
color: #999; color: #999;
} }
...@@ -688,9 +707,11 @@ ...@@ -688,9 +707,11 @@
&.is-checked { &.is-checked {
border-color: $uni-primary; border-color: $uni-primary;
.checkbox__inner { .checkbox__inner {
border-color: $uni-primary; border-color: $uni-primary;
background-color: $uni-primary; background-color: $uni-primary;
.checkbox__inner-icon { .checkbox__inner-icon {
opacity: 1; opacity: 1;
transform: rotate(45deg); transform: rotate(45deg);
...@@ -747,6 +768,7 @@ ...@@ -747,6 +768,7 @@
} }
} }
} }
// 列表样式 // 列表样式
&.is--list { &.is--list {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -764,6 +786,7 @@ ...@@ -764,6 +786,7 @@
&.is-disable { &.is-disable {
/* #ifdef H5 */ /* #ifdef H5 */
cursor: not-allowed; cursor: not-allowed;
/* #endif */ /* #endif */
.checkbox__inner { .checkbox__inner {
background-color: #F2F6FC; background-color: #F2F6FC;
...@@ -772,6 +795,7 @@ ...@@ -772,6 +795,7 @@
cursor: not-allowed; cursor: not-allowed;
/* #endif */ /* #endif */
} }
.checklist-text { .checklist-text {
color: #999; color: #999;
} }
...@@ -787,11 +811,15 @@ ...@@ -787,11 +811,15 @@
transform: rotate(45deg); transform: rotate(45deg);
} }
} }
.radio__inner {
.radio__inner {
border-color: $uni-primary;
.radio__inner-icon { .radio__inner-icon {
opacity: 1; opacity: 1;
background-color: $uni-primary;
} }
} }
.checklist-text { .checklist-text {
color: $uni-primary; color: $uni-primary;
} }
...@@ -818,4 +846,4 @@ ...@@ -818,4 +846,4 @@
} }
} }
} }
</style> </style>
{ {
"id": "uni-data-checkbox", "id": "uni-data-checkbox",
"displayName": "uni-data-checkbox 数据选择器", "displayName": "uni-data-checkbox 数据选择器",
"version": "1.0.3", "version": "1.0.5",
"description": "通过数据驱动的单选框和复选框", "description": "通过数据驱动的单选框和复选框",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.1.18(2024-04-11)
- 修复 easyinput组件双向绑定问题
## 1.1.17(2024-03-28)
- 修复 在头条小程序下丢失事件绑定的问题
## 1.1.16(2024-03-20)
- 修复 在密码输入情况下 清除和小眼睛覆盖bug 在edge浏览器下显示双眼睛bug
## 1.1.15(2024-02-21)
- 新增 左侧插槽:left
## 1.1.14(2024-02-19)
- 修复 onBlur的emit传值错误
## 1.1.12(2024-01-29)
- 补充 adjust-position文档属性补充
## 1.1.11(2024-01-29)
- 补充 adjust-position属性传递值:(Boolean)当键盘弹起时,是否自动上推页面
## 1.1.10(2024-01-22)
- 去除 移除无用的log输出
## 1.1.9(2023-04-11) ## 1.1.9(2023-04-11)
- 修复 vue3 下 keyboardheightchange 事件报错的bug - 修复 vue3 下 keyboardheightchange 事件报错的bug
## 1.1.8(2023-03-29) ## 1.1.8(2023-03-29)
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
*/ */
export const debounce = function(func, wait = 1000, immediate = true) { export const debounce = function(func, wait = 1000, immediate = true) {
let timer; let timer;
console.log(1);
return function() { return function() {
console.log(123);
let context = this, let context = this,
args = arguments; args = arguments;
if (timer) clearTimeout(timer); if (timer) clearTimeout(timer);
......
{ {
"id": "uni-easyinput", "id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框", "displayName": "uni-easyinput 增强输入框",
"version": "1.1.9", "version": "1.1.18",
"description": "Easyinput 组件是对原生input组件的增强", "description": "Easyinput 组件是对原生input组件的增强",
"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": {
......
## 2.0.9(2024-01-12)
fix: 修复图标大小默认值错误的问题
## 2.0.8(2023-12-14) ## 2.0.8(2023-12-14)
- 修复 项目未使用 ts 情况下,打包报错的bug - 修复 项目未使用 ts 情况下,打包报错的bug
## 2.0.7(2023-12-14) ## 2.0.7(2023-12-14)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
}, },
size: { size: {
type: Object, type: Object,
default: 24 default: 16
}, },
fontFamily: { fontFamily: {
type: String, type: String,
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
}, },
size: { size: {
type: [Number, String], type: [Number, String],
default: 24 default: 16
}, },
customPrefix: { customPrefix: {
type: String, type: String,
......
{ {
"id": "uni-icons", "id": "uni-icons",
"displayName": "uni-icons 图标", "displayName": "uni-icons 图标",
"version": "2.0.8", "version": "2.0.9",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。", "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.0.17(2024-04-26)
- 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
## 1.0.16(2023-04-25) ## 1.0.16(2023-04-25)
- 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度 - 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度
## 1.0.15(2023-04-06) ## 1.0.15(2023-04-06)
......
{ {
"id": "uni-id-common", "id": "uni-id-common",
"displayName": "uni-id-common", "displayName": "uni-id-common",
"version": "1.0.16", "version": "1.0.17",
"description": "包含uni-id token生成、校验、刷新功能的云函数公共模块", "description": "包含uni-id token生成、校验、刷新功能的云函数公共模块",
"keywords": [ "keywords": [
"uni-id-common", "uni-id-common",
"uniCloud", "uniCloud",
"token", "token",
"权限" "权限"
], ],
"repository": "https://gitcode.net/dcloud/uni-id-common", "repository": "https://gitcode.net/dcloud/uni-id-common",
"engines": { "engines": {
"HBuilderX": "^3.1.0" "HBuilderX": "^3.1.0"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
"regular": { "regular": {
"price": "0.00" "price": "0.00"
}, },
"sourcecode": { "sourcecode": {
"price": "0.00" "price": "0.00"
} }
}, },
"contact": { "contact": {
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "无", "ads": "无",
"data": "无", "data": "无",
"permissions": "无" "permissions": "无"
}, },
"npmurl": "", "npmurl": "",
"type": "unicloud-template-function" "type": "unicloud-template-function"
}, },
"uni_modules": { "uni_modules": {
"dependencies": ["uni-config-center"], "dependencies": ["uni-config-center"],
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
}, "alipay": "n"
"client": { },
"Vue": { "client": {
"vue2": "u", "Vue": {
"vue3": "u" "vue2": "u",
}, "vue3": "u"
"App": { },
"app-vue": "u", "App": {
"app-nvue": "u" "app-vue": "u",
}, "app-nvue": "u"
"H5-mobile": { },
"Safari": "u", "H5-mobile": {
"Android Browser": "u", "Safari": "u",
"微信浏览器(Android)": "u", "Android Browser": "u",
"QQ浏览器(Android)": "u" "微信浏览器(Android)": "u",
}, "QQ浏览器(Android)": "u"
"H5-pc": { },
"Chrome": "u", "H5-pc": {
"IE": "u", "Chrome": "u",
"Edge": "u", "IE": "u",
"Firefox": "u", "Edge": "u",
"Safari": "u" "Firefox": "u",
}, "Safari": "u"
"小程序": { },
"微信": "u", "小程序": {
"阿里": "u", "微信": "u",
"百度": "u", "阿里": "u",
"字节跳动": "u", "百度": "u",
"QQ": "u", "字节跳动": "u",
"钉钉": "u", "QQ": "u",
"快手": "u", "钉钉": "u",
"飞书": "u", "快手": "u",
"京东": "u" "飞书": "u",
}, "京东": "u"
"快应用": { },
"华为": "u", "快应用": {
"联盟": "u" "华为": "u",
} "联盟": "u"
} }
} }
} }
}
} }
# uni-id-common # uni-id-common
文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html) 文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html)
\ No newline at end of file
{ {
"name": "uni-id-common", "name": "uni-id-common",
"version": "1.0.16", "version": "1.0.17",
"description": "uni-id token生成、校验、刷新", "description": "uni-id token生成、校验、刷新",
"main": "index.js", "main": "index.js",
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id-common.html", "homepage": "https://uniapp.dcloud.io/uniCloud/uni-id-common.html",
......
## 1.1.17(2023-12-14) ## 1.1.20(2024-04-28)
- uni-id-co 移除一键登录、短信的调用凭据 - uni-id-co 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
## 1.1.16(2023-10-18) ## 1.1.19(2024-03-20)
- 修复 当不满足一键登录时页面回退无法继续登录的问题 - uni-id-co 修复 实人认证的认证照片在阿里云服务空间没有保存到指定路径下的Bug
## 1.1.15(2023-07-13) - uni-id-co 修复 云对象开发依赖未移除的Bug
- uni-id-co 修复 QQ登录时不存在头像时报错的问题 ## 1.1.18(2024-02-20)
- 修复 PC设置头像无效的问题
## 1.1.17(2023-12-14)
- uni-id-co 移除一键登录、短信的调用凭据
## 1.1.16(2023-10-18)
- 修复 当不满足一键登录时页面回退无法继续登录的问题
## 1.1.15(2023-07-13)
- uni-id-co 修复 QQ登录时不存在头像时报错的问题
## 1.1.14(2023-05-19) ## 1.1.14(2023-05-19)
- 修复 退出登录不会跳转至登录页的问题 - 修复 退出登录不会跳转至登录页的问题
## 1.1.13(2023-05-10) ## 1.1.13(2023-05-10)
......
...@@ -129,26 +129,24 @@ ...@@ -129,26 +129,24 @@
filePath = res.tempFilePaths[0] filePath = res.tempFilePaths[0]
//非app端剪裁头像,app端用内置的原生裁剪 //非app端剪裁头像,app端用内置的原生裁剪
// #ifndef APP-PLUS // #ifdef H5
filePath = await new Promise((callback) => { if (!this.isPC) {
// #ifdef H5 filePath = await new Promise((callback) => {
if (!this.isPC) { uni.navigateTo({
uni.navigateTo({ url: '/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage?path=' +
url: '/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage?path=' + filePath + `&options=${JSON.stringify(crop)}`,
filePath + `&options=${JSON.stringify(crop)}`, animationType: "fade-in",
animationType: "fade-in", events: {
events: { success: url => {
success: url => { callback(url)
callback(url) }
} },
}, complete(e) {
complete(e) { console.log(e);
// console.log(e); }
} });
}); })
} }
// #endif
})
// #endif // #endif
let cloudPath = this.userInfo._id + '' + Date.now() let cloudPath = this.userInfo._id + '' + Date.now()
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.1.17", "version": "1.1.20",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "y"
}, },
"client": { "client": {
"Vue": { "Vue": {
......
...@@ -171,13 +171,6 @@ function getNonceStr (length = 16) { ...@@ -171,13 +171,6 @@ function getNonceStr (length = 16) {
return str.substring(0, length) return str.substring(0, length)
} }
try {
require('lodash.merge')
} catch (error) {
console.error('uni-id-co缺少依赖,请在uniCloud/cloudfunctions/uni-id-co目录执行 npm install 安装依赖')
throw error
}
function isMatchUserApp (userAppList, matchAppList) { function isMatchUserApp (userAppList, matchAppList) {
if (userAppList === undefined || userAppList === null) { if (userAppList === undefined || userAppList === null) {
return true return true
......
...@@ -111,6 +111,8 @@ module.exports = { ...@@ -111,6 +111,8 @@ module.exports = {
switch (clientPlatform) { switch (clientPlatform) {
case 'app': case 'app':
case 'app-plus': case 'app-plus':
case 'app-android':
case 'app-ios':
clientPlatform = 'app' clientPlatform = 'app'
break break
case 'web': case 'web':
......
const rsaPublicKeyPem = require('../rsa-public-key-pem') const rsaPublicKeyPem = require('../rsa-public-key-pem')
const {
jwtVerify
} = require('../../../npm/index')
let authKeysCache = null let authKeysCache = null
module.exports = class Auth { module.exports = class Auth {
...@@ -44,7 +47,7 @@ module.exports = class Auth { ...@@ -44,7 +47,7 @@ module.exports = class Auth {
* nonce_supported: true * nonce_supported: true
* } * }
*/ */
const payload = require('jsonwebtoken').verify( const payload = jwtVerify(
identityToken, identityToken,
rsaPublicKeyPem(usedKey.n, usedKey.e), rsaPublicKeyPem(usedKey.n, usedKey.e),
{ {
......
...@@ -18,7 +18,7 @@ const uniIdConfig = createConfig({ ...@@ -18,7 +18,7 @@ const uniIdConfig = createConfig({
}) })
class ConfigUtils { class ConfigUtils {
constructor ({ constructor({
context context
} = {}) { } = {}) {
this.context = context this.context = context
...@@ -31,6 +31,8 @@ class ConfigUtils { ...@@ -31,6 +31,8 @@ class ConfigUtils {
switch (uniPlatform) { switch (uniPlatform) {
case 'app': case 'app':
case 'app-plus': case 'app-plus':
case 'app-android':
case 'app-ios':
this.platform = 'app' this.platform = 'app'
break break
case 'web': case 'web':
...@@ -43,7 +45,7 @@ class ConfigUtils { ...@@ -43,7 +45,7 @@ class ConfigUtils {
} }
} }
getConfigArray () { getConfigArray() {
let configContent let configContent
try { try {
configContent = require('uni-config-center/uni-id/config.json') configContent = require('uni-config-center/uni-id/config.json')
...@@ -57,12 +59,12 @@ class ConfigUtils { ...@@ -57,12 +59,12 @@ class ConfigUtils {
return [configContent] return [configContent]
} }
getAppConfig () { getAppConfig() {
const configArray = this.getConfigArray() const configArray = this.getConfigArray()
return configArray.find(item => item.dcloudAppid === this.appId) || configArray.find(item => item.isDefaultConfig) return configArray.find(item => item.dcloudAppid === this.appId) || configArray.find(item => item.isDefaultConfig)
} }
getPlatformConfig () { getPlatformConfig() {
const appConfig = this.getAppConfig() const appConfig = this.getAppConfig()
if (!appConfig) { if (!appConfig) {
throw new Error( throw new Error(
...@@ -76,8 +78,8 @@ class ConfigUtils { ...@@ -76,8 +78,8 @@ class ConfigUtils {
throw new Error( throw new Error(
`Client platform is ${this.platform}, but ${this.platform === 'web' ? 'h5' : 'app-plus'} was found in config. Please refer to: https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary?id=m-to-co` `Client platform is ${this.platform}, but ${this.platform === 'web' ? 'h5' : 'app-plus'} was found in config. Please refer to: https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary?id=m-to-co`
) )
} }
const defaultConfig = { const defaultConfig = {
tokenExpiresIn: 7200, tokenExpiresIn: 7200,
tokenExpiresThreshold: 1200, tokenExpiresThreshold: 1200,
...@@ -87,7 +89,7 @@ class ConfigUtils { ...@@ -87,7 +89,7 @@ class ConfigUtils {
return Object.assign(defaultConfig, appConfig, appConfig[platform]) return Object.assign(defaultConfig, appConfig, appConfig[platform])
} }
getOauthProvider ({ getOauthProvider({
provider provider
} = {}) { } = {}) {
const clientPlatform = this.platform const clientPlatform = this.platform
...@@ -101,7 +103,7 @@ class ConfigUtils { ...@@ -101,7 +103,7 @@ class ConfigUtils {
return oatuhProivder return oatuhProivder
} }
getOauthConfig ({ getOauthConfig({
provider provider
} = {}) { } = {}) {
const config = this.getPlatformConfig() const config = this.getPlatformConfig()
...@@ -122,7 +124,7 @@ class ConfigUtils { ...@@ -122,7 +124,7 @@ class ConfigUtils {
return oauthConfig return oauthConfig
} }
getHooks () { getHooks() {
if (uniIdConfig.hasFile('hooks/index.js')) { if (uniIdConfig.hasFile('hooks/index.js')) {
return require( return require(
uniIdConfig.resolve('hooks/index.js') uniIdConfig.resolve('hooks/index.js')
...@@ -132,4 +134,4 @@ class ConfigUtils { ...@@ -132,4 +134,4 @@ class ConfigUtils {
} }
} }
module.exports = ConfigUtils module.exports = ConfigUtils
\ No newline at end of file
...@@ -10,6 +10,8 @@ function getQQPlatform () { ...@@ -10,6 +10,8 @@ function getQQPlatform () {
switch (platform) { switch (platform) {
case 'app': case 'app':
case 'app-plus': case 'app-plus':
case 'app-android':
case 'app-ios':
return 'app' return 'app'
case 'mp-qq': case 'mp-qq':
return 'mp' return 'mp'
......
...@@ -16,7 +16,9 @@ const { ...@@ -16,7 +16,9 @@ const {
logout logout
} = require('./logout') } = require('./logout')
const PasswordUtils = require('./password') const PasswordUtils = require('./password')
const merge = require('lodash.merge') const {
merge
} = require('../npm/index')
async function realPreRegister (params = {}) { async function realPreRegister (params = {}) {
const { const {
......
...@@ -14,7 +14,9 @@ const { ...@@ -14,7 +14,9 @@ const {
const { const {
batchFindObjctValue batchFindObjctValue
} = require('../../common/utils') } = require('../../common/utils')
const merge = require('lodash.merge') const {
merge
} = require('../npm/index')
/** /**
* *
......
...@@ -43,6 +43,8 @@ function getWeixinPlatform () { ...@@ -43,6 +43,8 @@ function getWeixinPlatform () {
switch (platform) { switch (platform) {
case 'app': case 'app':
case 'app-plus': case 'app-plus':
case 'app-android':
case 'app-ios':
return 'app' return 'app'
case 'mp-weixin': case 'mp-weixin':
return 'mp' return 'mp'
......
...@@ -109,6 +109,7 @@ module.exports = async function (params) { ...@@ -109,6 +109,7 @@ module.exports = async function (params) {
fileID fileID
} = await uniCloud.uploadFile({ } = await uniCloud.uploadFile({
cloudPath: `user/id-card/${uid}.b64`, cloudPath: `user/id-card/${uid}.b64`,
cloudPathAsRealPath: true,
fileContent: Buffer.from(encryptData.call(this, pictureRes.data.toString('base64'))) fileContent: Buffer.from(encryptData.call(this, pictureRes.data.toString('base64')))
}) })
updateData.realname_auth.in_hand = fileID updateData.realname_auth.in_hand = fileID
......
...@@ -49,7 +49,7 @@ module.exports = async function (params = {}) { ...@@ -49,7 +49,7 @@ module.exports = async function (params = {}) {
this.config.service.sms && this.config.service.sms &&
this.config.service.sms.scene && this.config.service.sms.scene &&
this.config.service.sms.scene[scene]) || {} this.config.service.sms.scene[scene]) || {}
if (!templateId) { if (!templateId || !templateId.replace(/[^0-9a-zA-Z]/g, '')) {
await require('../../lib/utils/verify-code') await require('../../lib/utils/verify-code')
.setMobileVerifyCode.call(this, { .setMobileVerifyCode.call(this, {
mobile: params.mobile, mobile: params.mobile,
......
{ {
"name": "uni-id-co", "name": "uni-id-co",
"version": "1.1.17", "version": "1.1.20",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"keywords": [], "keywords": [],
"author": "DCloud", "author": "DCloud",
"dependencies": { "dependencies": {
"jsonwebtoken": "8.5.1",
"lodash.merge": "^4.6.2",
"uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha", "uni-captcha": "file:../../../../uni-captcha/uniCloud/cloudfunctions/common/uni-captcha",
"uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center", "uni-config-center": "file:../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center",
"uni-id-common": "file:../../../../uni-id-common/uniCloud/cloudfunctions/common/uni-id-common", "uni-id-common": "file:../../../../uni-id-common/uniCloud/cloudfunctions/common/uni-id-common",
...@@ -21,12 +19,5 @@ ...@@ -21,12 +19,5 @@
}, },
"cloudfunction-config": { "cloudfunction-config": {
"keepRunningAfterReturn": false "keepRunningAfterReturn": false
},
"devDependencies": {
"eslint": "^8.18.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.3",
"eslint-plugin-promise": "^6.0.0"
} }
} }
\ No newline at end of file
## 1.9.1(2024-04-02)
- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法)
## 1.9.0(2024-03-28)
- 修复 uni-popup-dialog 双向绑定时初始化逻辑修正
## 1.8.9(2024-03-20)
- 修复 uni-popup-dialog 数据输入时修正为双向绑定
## 1.8.8(2024-02-20)
- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug
## 1.8.7(2024-02-02)
- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦
## 1.8.6(2024-01-30)
- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数
## 1.8.5(2024-01-26)
- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示
## 1.8.4(2023-11-15) ## 1.8.4(2023-11-15)
- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close` - 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close`
## 1.8.3(2023-04-17) ## 1.8.3(2023-04-17)
......
...@@ -10,14 +10,15 @@ ...@@ -10,14 +10,15 @@
</view> </view>
<view v-else class="uni-dialog-content"> <view v-else class="uni-dialog-content">
<slot> <slot>
<input class="uni-dialog-input" v-model="val" :type="inputType" :placeholder="placeholderText" :focus="focus" > <input class="uni-dialog-input" :maxlength="maxlength" v-model="val" :type="inputType"
:placeholder="placeholderText" :focus="focus">
</slot> </slot>
</view> </view>
<view class="uni-dialog-button-group"> <view class="uni-dialog-button-group">
<view class="uni-dialog-button" @click="closeDialog"> <view class="uni-dialog-button" v-if="showClose" @click="closeDialog">
<text class="uni-dialog-button-text">{{closeText}}</text> <text class="uni-dialog-button-text">{{closeText}}</text>
</view> </view>
<view class="uni-dialog-button uni-border-left" @click="onOk"> <view class="uni-dialog-button" :class="showClose?'uni-border-left':''" @click="onOk">
<text class="uni-dialog-button-text uni-button-color">{{okText}}</text> <text class="uni-dialog-button-text uni-button-color">{{okText}}</text>
</view> </view>
</view> </view>
...@@ -28,16 +29,19 @@ ...@@ -28,16 +29,19 @@
<script> <script>
import popup from '../uni-popup/popup.js' import popup from '../uni-popup/popup.js'
import { import {
initVueI18n initVueI18n
} from '@dcloudio/uni-i18n' } from '@dcloudio/uni-i18n'
import messages from '../uni-popup/i18n/index.js' import messages from '../uni-popup/i18n/index.js'
const { t } = initVueI18n(messages) const {
t
} = initVueI18n(messages)
/** /**
* PopUp 弹出层-对话框样式 * PopUp 弹出层-对话框样式
* @description 弹出层-对话框样式 * @description 弹出层-对话框样式
* @tutorial https://ext.dcloud.net.cn/plugin?id=329 * @tutorial https://ext.dcloud.net.cn/plugin?id=329
* @property {String} value input 模式下的默认值 * @property {String} value input 模式下的默认值
* @property {String} placeholder input 模式下输入提示 * @property {String} placeholder input 模式下输入提示
* @property {Boolean} focus input模式下是否自动聚焦,默认为true
* @property {String} type = [success|warning|info|error] 主题样式 * @property {String} type = [success|warning|info|error] 主题样式
* @value success 成功 * @value success 成功
* @value warning 提示 * @value warning 提示
...@@ -46,8 +50,10 @@ ...@@ -46,8 +50,10 @@
* @property {String} mode = [base|input] 模式、 * @property {String} mode = [base|input] 模式、
* @value base 基础对话框 * @value base 基础对话框
* @value input 可输入对话框 * @value input 可输入对话框
* @showClose {Boolean} 是否显示关闭按钮
* @property {String} content 对话框内容 * @property {String} content 对话框内容
* @property {Boolean} beforeClose 是否拦截取消事件 * @property {Boolean} beforeClose 是否拦截取消事件
* @property {Number} maxlength 输入
* @event {Function} confirm 点击确认按钮触发 * @event {Function} confirm 点击确认按钮触发
* @event {Function} close 点击取消按钮触发 * @event {Function} close 点击取消按钮触发
*/ */
...@@ -55,16 +61,30 @@ ...@@ -55,16 +61,30 @@
export default { export default {
name: "uniPopupDialog", name: "uniPopupDialog",
mixins: [popup], mixins: [popup],
emits:['confirm','close'], emits: ['confirm', 'close', 'update:modelValue', 'input'],
props: { props: {
inputType:{ inputType: {
type: String, type: String,
default: 'text' default: 'text'
},
showClose: {
type: Boolean,
default: true
}, },
// #ifdef VUE2
value: { value: {
type: [String, Number], type: [String, Number],
default: '' default: ''
}, },
// #endif
// #ifdef VUE3
modelValue: {
type: [Number, String],
default: ''
},
// #endif
placeholder: { placeholder: {
type: [String, Number], type: [String, Number],
default: '' default: ''
...@@ -88,20 +108,27 @@ ...@@ -88,20 +108,27 @@
beforeClose: { beforeClose: {
type: Boolean, type: Boolean,
default: false default: false
}, },
cancelText:{ cancelText: {
type: String, type: String,
default: '' default: ''
}, },
confirmText:{ confirmText: {
type: String, type: String,
default: '' default: ''
},
maxlength: {
type: Number,
default: -1,
},
focus: {
type: Boolean,
default: true,
} }
}, },
data() { data() {
return { return {
dialogType: 'error', dialogType: 'error',
focus: false,
val: "" val: ""
} }
}, },
...@@ -129,7 +156,21 @@ ...@@ -129,7 +156,21 @@
} }
}, },
value(val) { value(val) {
this.val = val if (this.maxlength != -1 && this.mode === 'input') {
this.val = val.slice(0, this.maxlength);
} else {
this.val = val
}
},
val(val) {
// #ifdef VUE2
// TODO 兼容 vue2
this.$emit('input', val);
// #endif
// #ifdef VUE3
// TODO 兼容 vue3
this.$emit('update:modelValue', val);
// #endif
} }
}, },
created() { created() {
...@@ -138,25 +179,25 @@ ...@@ -138,25 +179,25 @@
// this.popup.closeMask() // this.popup.closeMask()
if (this.mode === 'input') { if (this.mode === 'input') {
this.dialogType = 'info' this.dialogType = 'info'
this.val = this.value this.val = this.value;
// #ifdef VUE3
this.val = this.modelValue;
// #endif
} else { } else {
this.dialogType = this.type this.dialogType = this.type
} }
}, },
mounted() {
this.focus = true
},
methods: { methods: {
/** /**
* 点击确认按钮 * 点击确认按钮
*/ */
onOk() { onOk() {
if (this.mode === 'input'){ if (this.mode === 'input') {
this.$emit('confirm', this.val) this.$emit('confirm', this.val)
}else{ } else {
this.$emit('confirm') this.$emit('confirm')
} }
if(this.beforeClose) return if (this.beforeClose) return
this.popup.close() this.popup.close()
}, },
/** /**
...@@ -164,17 +205,17 @@ ...@@ -164,17 +205,17 @@
*/ */
closeDialog() { closeDialog() {
this.$emit('close') this.$emit('close')
if(this.beforeClose) return if (this.beforeClose) return
this.popup.close() this.popup.close()
}, },
close(){ close() {
this.popup.close() this.popup.close()
} }
} }
} }
</script> </script>
<style lang="scss" > <style lang="scss">
.uni-popup-dialog { .uni-popup-dialog {
width: 300px; width: 300px;
border-radius: 11px; border-radius: 11px;
...@@ -272,4 +313,4 @@ ...@@ -272,4 +313,4 @@
.uni-popup__info { .uni-popup__info {
color: #909399; color: #909399;
} }
</style> </style>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
{ {
text: '支付宝', text: '支付宝',
icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png', icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',
name: 'wx' name: 'ali'
}, },
{ {
text: 'QQ', text: 'QQ',
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:duration="duration" :show="showTrans" @click="onTap" /> :duration="duration" :show="showTrans" @click="onTap" />
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"
:show="showTrans" @click="onTap"> :show="showTrans" @click="onTap">
<view class="uni-popup__wrapper" :style="{ backgroundColor: bg }" :class="[popupstyle]" @click="clear"> <view class="uni-popup__wrapper" :style="getStyles" :class="[popupstyle]" @click="clear">
<slot /> <slot />
</view> </view>
</uni-transition> </uni-transition>
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
* @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗 * @property {Boolean} isMaskClick = [true|false] 蒙版点击是否关闭弹窗
* @property {String} backgroundColor 主窗口背景色 * @property {String} backgroundColor 主窗口背景色
* @property {String} maskBackgroundColor 蒙版颜色 * @property {String} maskBackgroundColor 蒙版颜色
* @property {String} borderRadius 设置圆角(左上、右上、右下和左下) 示例:"10px 10px 10px 10px"
* @property {Boolean} safeArea 是否适配底部安全区 * @property {Boolean} safeArea 是否适配底部安全区
* @event {Function} change 打开关闭弹窗触发,e={show: false} * @event {Function} change 打开关闭弹窗触发,e={show: false}
* @event {Function} maskClick 点击遮罩触发 * @event {Function} maskClick 点击遮罩触发
...@@ -86,6 +87,9 @@ ...@@ -86,6 +87,9 @@
type: String, type: String,
default: 'rgba(0, 0, 0, 0.4)' default: 'rgba(0, 0, 0, 0.4)'
}, },
borderRadius:{
type: String,
}
}, },
watch: { watch: {
...@@ -157,6 +161,8 @@ ...@@ -157,6 +161,8 @@
backgroundColor: 'rgba(0, 0, 0, 0.4)' backgroundColor: 'rgba(0, 0, 0, 0.4)'
}, },
transClass: { transClass: {
backgroundColor: 'transparent',
borderRadius: this.borderRadius || "0",
position: 'fixed', position: 'fixed',
left: 0, left: 0,
right: 0 right: 0
...@@ -167,6 +173,13 @@ ...@@ -167,6 +173,13 @@
} }
}, },
computed: { computed: {
getStyles() {
let res = { backgroundColor: this.bg };
if (this.borderRadius || "0") {
res = Object.assign(res, { borderRadius: this.borderRadius })
}
return res;
},
isDesktop() { isDesktop() {
return this.popupWidth >= 500 && this.popupHeight >= 500 return this.popupWidth >= 500 && this.popupHeight >= 500
}, },
...@@ -221,6 +234,12 @@ ...@@ -221,6 +234,12 @@
this.setH5Visible() this.setH5Visible()
}, },
// #endif // #endif
activated() {
this.setH5Visible(!this.showPopup);
},
deactivated() {
this.setH5Visible(true);
},
created() { created() {
// this.mkclick = this.isMaskClick || this.maskClick // this.mkclick = this.isMaskClick || this.maskClick
if (this.isMaskClick === null && this.maskClick === null) { if (this.isMaskClick === null && this.maskClick === null) {
...@@ -240,10 +259,10 @@ ...@@ -240,10 +259,10 @@
this.maskClass.backgroundColor = this.maskBackgroundColor this.maskClass.backgroundColor = this.maskBackgroundColor
}, },
methods: { methods: {
setH5Visible() { setH5Visible(visible = true) {
// #ifdef H5 // #ifdef H5
// fix by mehaotian 处理 h5 滚动穿透的问题 // fix by mehaotian 处理 h5 滚动穿透的问题
document.getElementsByTagName('body')[0].style.overflow = 'visible' document.getElementsByTagName('body')[0].style.overflow = visible ? "visible" : "hidden";
// #endif // #endif
}, },
/** /**
...@@ -323,7 +342,8 @@ ...@@ -323,7 +342,8 @@
position: 'fixed', position: 'fixed',
left: 0, left: 0,
right: 0, right: 0,
backgroundColor: this.bg backgroundColor: this.bg,
borderRadius:this.borderRadius || "0"
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
...@@ -347,7 +367,8 @@ ...@@ -347,7 +367,8 @@
right: 0, right: 0,
bottom: 0, bottom: 0,
paddingBottom: this.safeAreaInsets + 'px', paddingBottom: this.safeAreaInsets + 'px',
backgroundColor: this.bg backgroundColor: this.bg,
borderRadius:this.borderRadius || "0",
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
...@@ -359,7 +380,13 @@ ...@@ -359,7 +380,13 @@
*/ */
center(type) { center(type) {
this.popupstyle = 'center' this.popupstyle = 'center'
this.ani = ['zoom-out', 'fade'] //微信小程序下,组合动画会出现文字向上闪动问题,再此做特殊处理
// #ifdef MP-WEIXIN
this.ani = ['fade']
// #endif
// #ifndef MP-WEIXIN
this.ani = ['zoom-out', 'fade']
// #endif
this.transClass = { this.transClass = {
position: 'fixed', position: 'fixed',
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -371,7 +398,8 @@ ...@@ -371,7 +398,8 @@
right: 0, right: 0,
top: 0, top: 0,
justifyContent: 'center', justifyContent: 'center',
alignItems: 'center' alignItems: 'center',
borderRadius:this.borderRadius || "0"
} }
// TODO 兼容 type 属性 ,后续会废弃 // TODO 兼容 type 属性 ,后续会废弃
if (type) return if (type) return
...@@ -387,6 +415,7 @@ ...@@ -387,6 +415,7 @@
bottom: 0, bottom: 0,
top: 0, top: 0,
backgroundColor: this.bg, backgroundColor: this.bg,
borderRadius:this.borderRadius || "0",
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: 'flex', display: 'flex',
flexDirection: 'column' flexDirection: 'column'
...@@ -406,6 +435,7 @@ ...@@ -406,6 +435,7 @@
right: 0, right: 0,
top: 0, top: 0,
backgroundColor: this.bg, backgroundColor: this.bg,
borderRadius:this.borderRadius || "0",
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: 'flex', display: 'flex',
flexDirection: 'column' flexDirection: 'column'
......
{ {
"id": "uni-popup", "id": "uni-popup",
"displayName": "uni-popup 弹出层", "displayName": "uni-popup 弹出层",
"version": "1.8.4", "version": "1.9.1",
"description": " Popup 组件,提供常用的弹层", "description": " Popup 组件,提供常用的弹层",
"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": {
......
## 1.3.3(2024-04-23)
- 修复 当元素会受变量影响自动隐藏的bug
## 1.3.2(2023-05-04) ## 1.3.2(2023-05-04)
- 修复 NVUE 平台报错的问题 - 修复 NVUE 平台报错的问题
## 1.3.1(2021-11-23) ## 1.3.1(2021-11-23)
......
...@@ -254,7 +254,7 @@ export default { ...@@ -254,7 +254,7 @@ export default {
}, },
animationType(type) { animationType(type) {
return { return {
fade: type ? 1 : 0, fade: type ? 0 : 1,
'slide-top': `translateY(${type ? '0' : '-100%'})`, 'slide-top': `translateY(${type ? '0' : '-100%'})`,
'slide-right': `translateX(${type ? '0' : '100%'})`, 'slide-right': `translateX(${type ? '0' : '100%'})`,
'slide-bottom': `translateY(${type ? '0' : '100%'})`, 'slide-bottom': `translateY(${type ? '0' : '100%'})`,
......
{ {
"id": "uni-transition", "id": "uni-transition",
"displayName": "uni-transition 过渡动画", "displayName": "uni-transition 过渡动画",
"version": "1.3.2", "version": "1.3.3",
"description": "元素的简单过渡动画", "description": "元素的简单过渡动画",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "n"
}, },
"client": { "client": {
"App": { "App": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册