提交 31b1cb91 编写于 作者: DCloud_JSON's avatar DCloud_JSON

Merge branch 'v2' of https://gitcode.net/dcloud/uni-starter into v2

## 1.2.2(2023-01-28)
- 修复 运行/打包 控制台警告问题
## 1.2.1(2022-09-05) ## 1.2.1(2022-09-05)
- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) - 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473)
## 1.2.0(2021-11-19) ## 1.2.0(2021-11-19)
......
...@@ -192,11 +192,12 @@ ...@@ -192,11 +192,12 @@
display: flex; display: flex;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
font-feature-settings: "tnum";
min-width: 20px;
/* #endif */ /* #endif */
justify-content: center; justify-content: center;
flex-direction: row; flex-direction: row;
height: 20px; height: 20px;
min-width: 20px;
padding: 0 4px; padding: 0 4px;
line-height: 18px; line-height: 18px;
color: #fff; color: #fff;
...@@ -206,7 +207,6 @@ ...@@ -206,7 +207,6 @@
border: 1px solid #fff; border: 1px solid #fff;
text-align: center; text-align: center;
font-family: 'Helvetica Neue', Helvetica, sans-serif; font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-feature-settings: "tnum";
font-size: $bage-size; font-size: $bage-size;
/* #ifdef H5 */ /* #ifdef H5 */
z-index: 999; z-index: 999;
......
{ {
"id": "uni-badge", "id": "uni-badge",
"displayName": "uni-badge 数字角标", "displayName": "uni-badge 数字角标",
"version": "1.2.1", "version": "1.2.2",
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
"keywords": [ "keywords": [
"", "",
......
## 1.1.6(2023-01-28)
- 新增 keyboardheightchange 事件,可监听键盘高度变化
## 1.1.5(2022-11-29) ## 1.1.5(2022-11-29)
- 优化 主题样式 - 优化 主题样式
## 1.1.4(2022-10-27) ## 1.1.4(2022-10-27)
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
@blur="_Blur" @blur="_Blur"
@focus="_Focus" @focus="_Focus"
@confirm="onConfirm" @confirm="onConfirm"
@keyboardheightchange="onkeyboardheightchange"
></textarea> ></textarea>
<input <input
v-else v-else
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
@blur="_Blur" @blur="_Blur"
@input="onInput" @input="onInput"
@confirm="onConfirm" @confirm="onConfirm"
@keyboardheightchange="onkeyboardheightchange"
/> />
<template v-if="type === 'password' && passwordIcon"> <template v-if="type === 'password' && passwordIcon">
<!-- 开启密码时显示小眼睛 --> <!-- 开启密码时显示小眼睛 -->
...@@ -339,7 +341,7 @@ export default { ...@@ -339,7 +341,7 @@ export default {
init() { init() {
if (this.value || this.value === 0) { if (this.value || this.value === 0) {
this.val = this.value; this.val = this.value;
} else if (this.modelValue || this.modelValue === 0) { } else if (this.modelValue || this.modelValue === 0 || this.modelValue === '') {
this.val = this.modelValue; this.val = this.modelValue;
} else { } else {
this.val = null; this.val = null;
...@@ -456,6 +458,15 @@ export default { ...@@ -456,6 +458,15 @@ export default {
this.$emit('clear'); this.$emit('clear');
}, },
/**
* 键盘高度发生变化的时候触发此事件
* 兼容性:微信小程序2.7.0+、App 3.1.0+
* @param {Object} event
*/
onkeyboardheightchange(event) {
this.$emit("keyboardheightchange",event);
},
/** /**
* 去除空格 * 去除空格
*/ */
......
{ {
"id": "uni-easyinput", "id": "uni-easyinput",
"displayName": "uni-easyinput 增强输入框", "displayName": "uni-easyinput 增强输入框",
"version": "1.1.5", "version": "1.1.6",
"description": "Easyinput 组件是对原生input组件的增强", "description": "Easyinput 组件是对原生input组件的增强",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
......
## 1.1.0(2023-01-31)
- 【重要】优化 小程序端资源包大小(运行时大小为:731KB,发行后为:583KB;注:可以直接将本插件作为分包使用)
- 更新 微信小程序端 上传头像功能 用`wx.cropImage`实现图片裁剪
- 修复 选择一键登录时会先显示 非密码登录页面的问题
- 修复 一键登录 点击右上角的关闭按钮没有返回上一页的问题
## 1.0.41(2023-01-16) ## 1.0.41(2023-01-16)
- 优化 压缩依赖的文件资源大小 - 优化 压缩依赖的文件资源大小
## 1.0.40(2023-01-16) ## 1.0.40(2023-01-16)
......
...@@ -123,8 +123,15 @@ ...@@ -123,8 +123,15 @@
}, },
fail(e){ fail(e){
console.error(e) console.error(e)
uni.showModal({
content: 'wx.cropImage ' + e.errMsg,
showCancel: false,
confirmText:"跳过裁剪",
complete() {
callback(filePath) callback(filePath)
} }
});
}
}) })
// #endif // #endif
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view> <view>
<view class="fab-login-box"> <view class="fab-login-box">
<view class="item" v-for="(item,index) in servicesList" :key="index" <view class="item" v-for="(item,index) in servicesList" :key="index"
@click="item.path?navigateTo(item.path):login_before(item.id,false)"> @click="item.path?toPage(item.path):login_before(item.id,false)">
<image class="logo" :src="item.logo" mode="scaleToFill"></image> <image class="logo" :src="item.logo" mode="scaleToFill"></image>
<text class="login-title">{{item.text}}</text> <text class="login-title">{{item.text}}</text>
</view> </view>
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
//前一个窗口的页面地址。控制点击切换快捷登录方式是创建还是返回 //前一个窗口的页面地址。控制点击切换快捷登录方式是创建还是返回
import {store,mutations} from '@/uni_modules/uni-id-pages/common/store.js' import {store,mutations} from '@/uni_modules/uni-id-pages/common/store.js'
let allServicesList = [] let allServicesList = []
export default { export default {
computed: { computed: {
agreements() { agreements() {
...@@ -66,6 +65,7 @@ ...@@ -66,6 +65,7 @@
"text": "微信登录", "text": "微信登录",
"logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png", "logo": "/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png",
}, },
// #ifndef MP-WEIXIN
{ {
"id": "apple", "id": "apple",
"text": "苹果登录", "text": "苹果登录",
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
"text": "新浪微博", //暂未提供该登录方式的接口示例 "text": "新浪微博", //暂未提供该登录方式的接口示例
"logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png", "logo": "/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png",
} }
// #endif
], ],
univerifyStyle: { //一键登录弹出窗的样式配置参数 univerifyStyle: { //一键登录弹出窗的样式配置参数
"fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。 "fullScreen": true, // 是否全屏显示,true表示全屏模式,false表示非全屏模式,默认值为false。
...@@ -203,17 +204,18 @@ ...@@ -203,17 +204,18 @@
} }
return '/' + pages[pages.length - n].route return '/' + pages[pages.length - n].route
}, },
navigateTo(path) { toPage(path,index = 0) {
let type = ['navigateTo','redirectTo'][index]
//console.log('比较', this.getRoute(1),this.getRoute(2), path) //console.log('比较', this.getRoute(1),this.getRoute(2), path)
if (this.getRoute(1) == path.split('?')[0] && this.getRoute(1) == if (this.getRoute(1) == path.split('?')[0] && this.getRoute(1) ==
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd') { '/uni_modules/uni-id-pages/pages/login/login-withoutpwd') {
//如果要被打开的页面已经打开,且这个页面是 /uni_modules/uni-id-pages/pages/index/index 则把类型参数传给他 //如果要被打开的页面已经打开,且这个页面是 /uni_modules/uni-id-pages/pages/index/index 则把类型参数传给他
let type = path.split('?')[1].split('=')[1] let loginType = path.split('?')[1].split('=')[1]
uni.$emit('uni-id-pages-set-login-type', type) uni.$emit('uni-id-pages-setLoginType', loginType)
} 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) {
uni.navigateTo({ uni[type]({
url: path, url: path,
animationType: 'slide-in-left', animationType: 'slide-in-left',
complete(e) { complete(e) {
...@@ -321,18 +323,24 @@ ...@@ -321,18 +323,24 @@
uni.showLoading({ uni.showLoading({
mask: true mask: true
}) })
if (type == 'univerify') { if (type == 'univerify') {
let univerifyManager = uni.getUniverifyManager() let univerifyManager = uni.getUniverifyManager()
let clickAnotherButtons = false
let onButtonsClickFn = async res => { let onButtonsClickFn = async res => {
// console.log('点击了第三方登录,provider:', res, res.provider, this.univerifyStyle.buttons.list); console.log('点击了第三方登录,provider:', res, res.provider, this.univerifyStyle.buttons.list);
//同步一键登录弹出层隐私协议框是否打勾 clickAnotherButtons = true
// 同步一键登录弹出层隐私协议框是否打勾
let agree = (await uni.getCheckBoxState())[1].state let agree = (await uni.getCheckBoxState())[1].state
this.agree = agree this.agree = agree
let { let {
path path
} = this.univerifyStyle.buttons.list[res.index] } = this.univerifyStyle.buttons.list[res.index]
if (path) { if (path) {
this.navigateTo(path) if( this.getRoute(1).includes('login-withoutpwd') && path.includes('login-withoutpwd') ){
this.getParentComponent().showCurrentWebview()
}
this.toPage(path,1)
closeUniverify() closeUniverify()
} else { } else {
if (agree) { if (agree) {
...@@ -365,16 +373,20 @@ ...@@ -365,16 +373,20 @@
this.login(res.authResult, 'univerify') this.login(res.authResult, 'univerify')
}, },
fail(err) { fail(err) {
uni.showToast({ console.log(err)
title: JSON.stringify(err), if(!clickAnotherButtons){
icon: 'none', uni.navigateBack()
duration: 3000 }
}); // uni.showToast({
// title: JSON.stringify(err),
// icon: 'none',
// duration: 3000
// });
}, },
complete: async e => { complete: async e => {
uni.hideLoading() uni.hideLoading()
//同步一键登录弹出层隐私协议框是否打勾 //同步一键登录弹出层隐私协议框是否打勾
this.agree = (await uni.getCheckBoxState())[1].state // this.agree = (await uni.getCheckBoxState())[1].state
// 取消订阅自定义按钮点击事件 // 取消订阅自定义按钮点击事件
univerifyManager.offButtonsClick(onButtonsClickFn) univerifyManager.offButtonsClick(onButtonsClickFn)
} }
......
{ {
"id": "uni-id-pages", "id": "uni-id-pages",
"displayName": "uni-id-pages", "displayName": "uni-id-pages",
"version": "1.0.41", "version": "1.1.0",
"description": "云端一体简单、统一、可扩展的用户中心页面模版", "description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [ "keywords": [
"用户管理", "用户管理",
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
<template v-if="['apple','weixin', 'weixinMobile'].includes(type)"> <template v-if="['apple','weixin', 'weixinMobile'].includes(type)">
<text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text> <text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text>
<view class="quickLogin"> <view class="quickLogin">
<image v-if="type !== 'weixinMobile'" @click="quickLogin" :src="imgSrc" mode="widthFix" class="quickLoginBtn"></image> <image v-if="type !== 'weixinMobile'" @click="quickLogin" :src="imgSrc" mode="widthFix"
<button v-else type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin" class="uni-btn">微信授权手机号登录</button> class="quickLoginBtn"></image>
<button v-else type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin"
class="uni-btn">微信授权手机号登录</button>
<uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements> <uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements>
</view> </view>
</template> </template>
...@@ -19,8 +21,8 @@ ...@@ -19,8 +21,8 @@
<text class="tip">未注册的账号验证通过后将自动注册</text> <text class="tip">未注册的账号验证通过后将自动注册</text>
<view class="phone-box"> <view class="phone-box">
<view @click="chooseArea" class="area">+86</view> <view @click="chooseArea" class="area">+86</view>
<uni-easyinput :focus="focusPhone" @blur="focusPhone = false" class="input-box" type="number" :inputBorder="false" <uni-easyinput :focus="focusPhone" @blur="focusPhone = false" class="input-box" type="number"
v-model="phone" maxlength="11" placeholder="请输入手机号" /> :inputBorder="false" v-model="phone" maxlength="11" placeholder="请输入手机号" />
</view> </view>
<uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements> <uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements>
<button class="uni-btn" type="primary" @click="toSmsPage">获取验证码</button> <button class="uni-btn" type="primary" @click="toSmsPage">获取验证码</button>
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
return { return {
type: "", //快捷登录方式 type: "", //快捷登录方式
phone: "", //手机号码 phone: "", //手机号码
focusPhone:false, focusPhone: false,
logo: "/static/logo.png" logo: "/static/logo.png"
} }
}, },
...@@ -52,24 +54,27 @@ ...@@ -52,24 +54,27 @@
return /^1\d{10}$/.test(this.phone); return /^1\d{10}$/.test(this.phone);
}, },
imgSrc() { //大快捷登录按钮图 imgSrc() { //大快捷登录按钮图
return this.type == 'weixin'? '/uni_modules/uni-id-pages/static/login/weixin.png' : '/uni_modules/uni-id-pages/static/app-plus/apple.png' return this.type == 'weixin' ? '/uni_modules/uni-id-pages/static/login/weixin.png' :
'/uni_modules/uni-id-pages/static/app-plus/apple.png'
} }
}, },
async onLoad(e) { async onLoad(e) {
//获取通过url传递的参数type设置当前登录方式,如果没传递直接默认以配置的登录 //获取通过url传递的参数type设置当前登录方式,如果没传递直接默认以配置的登录
let type = e.type || config.loginTypes[0] let type = e.type || config.loginTypes[0]
this.type = type this.type = type
// console.log("this.type: -----------",this.type); // console.log("this.type: -----------",this.type);
if(type != 'univerify'){ if (type != 'univerify') {
this.focusPhone = true this.focusPhone = true
} }
this.$nextTick(() => { this.$nextTick(() => {
//关闭重复显示的登录快捷方式 //关闭重复显示的登录快捷方式
if (['weixin', 'apple'].includes(type)) { if (['weixin', 'apple'].includes(type)) {
this.$refs.uniFabLogin.servicesList = this.$refs.uniFabLogin.servicesList.filter(item =>item.id != type) this.$refs.uniFabLogin.servicesList = this.$refs.uniFabLogin.servicesList.filter(item =>
item.id != type)
} }
}) })
uni.$on('uni-id-pages-set-login-type', type => { uni.$on('uni-id-pages-setLoginType', type => {
this.type = type this.type = type
}) })
}, },
...@@ -84,21 +89,30 @@ ...@@ -84,21 +89,30 @@
// #endif // #endif
}, },
onUnload() { onUnload() {
uni.$off('uni-id-pages-set-login-type') uni.$off('uni-id-pages-setLoginType')
}, },
onReady() { onReady() {
//是否优先启动一键登录。即:页面一加载就启动一键登录 // 是否优先启动一键登录。即:页面一加载就启动一键登录
//#ifdef APP-PLUS //#ifdef APP-PLUS
if (this.type == "univerify") { if (this.type == "univerify") {
const pages = getCurrentPages();
currentWebview = pages[pages.length - 1].$getAppWebview();
currentWebview.setStyle({
"top": "2000px" // 隐藏当前页面窗体
})
this.type == this.loginTypes[1] this.type == this.loginTypes[1]
// console.log('开始一键登录'); // console.log('开始一键登录');
setTimeout(() => {
this.$refs.uniFabLogin.login_before('univerify') this.$refs.uniFabLogin.login_before('univerify')
}, 100)
} }
//#endif //#endif
}, },
methods: { methods: {
showCurrentWebview(){
// 恢复当前页面窗体的显示 一键登录,默认不显示当前窗口
currentWebview.setStyle({
"top": 0
})
},
quickLogin(e) { quickLogin(e) {
let options = {} let options = {}
...@@ -148,7 +162,7 @@ ...@@ -148,7 +162,7 @@
@import "@/uni_modules/uni-id-pages/common/login-page.scss"; @import "@/uni_modules/uni-id-pages/common/login-page.scss";
@media screen and (min-width: 690px) { @media screen and (min-width: 690px) {
.uni-content{ .uni-content {
height: 350px; height: 350px;
} }
} }
...@@ -220,7 +234,7 @@ ...@@ -220,7 +234,7 @@
} }
@media screen and (min-width: 690px) { @media screen and (min-width: 690px) {
.quickLogin{ .quickLogin {
height: auto; height: auto;
} }
} }
......
## 1.2.10(2022-11-23) ## 1.2.12(2023-02-01)
修复 uni-list-item 组件 keep-scroll-position 属性 无法设置为false的错误 - 新增 列表图标新增 customPrefix 属性 ,用法 [详见](https://uniapp.dcloud.net.cn/component/uniui/uni-icons.html#icons-props)
## 1.2.11(2023-01-31)
- 修复 无反馈效果呈现的bug
## 1.2.9(2022-11-22) ## 1.2.9(2022-11-22)
- 修复 uni-list-chat 在vue3下跳转报错的bug - 修复 uni-list-chat 在vue3下跳转报错的bug
## 1.2.8(2022-11-21) ## 1.2.8(2022-11-21)
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
} }
}, },
pageApi(api) { pageApi(api) {
uni[api]({ let callback = {
url: this.to, url: this.to,
success: res => { success: res => {
this.$emit('click', { this.$emit('click', {
...@@ -235,9 +235,24 @@ ...@@ -235,9 +235,24 @@
this.$emit('click', { this.$emit('click', {
data: err data: err
}); });
console.error(err.errMsg);
} }
}); }
switch (api) {
case 'navigateTo':
uni.navigateTo(callback)
break
case 'redirectTo':
uni.redirectTo(callback)
break
case 'reLaunch':
uni.reLaunch(callback)
break
case 'switchTab':
uni.switchTab(callback)
break
default:
uni.navigateTo(callback)
}
} }
} }
}; };
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<image :src="thumb" class="uni-list-item__icon-img" :class="['uni-list--' + thumbSize]" /> <image :src="thumb" class="uni-list-item__icon-img" :class="['uni-list--' + thumbSize]" />
</view> </view>
<view v-else-if="showExtraIcon" class="uni-list-item__icon"> <view v-else-if="showExtraIcon" class="uni-list-item__icon">
<uni-icons :color="extraIcon.color" :size="extraIcon.size" :type="extraIcon.type" /> <uni-icons :customPrefix="extraIcon.customPrefix" :color="extraIcon.color" :size="extraIcon.size" :type="extraIcon.type" />
</view> </view>
</view> </view>
</slot> </slot>
...@@ -167,7 +167,8 @@ ...@@ -167,7 +167,8 @@
return { return {
type: '', type: '',
color: '#000000', color: '#000000',
size: 20 size: 20,
customPrefix: ''
}; };
} }
}, },
...@@ -348,7 +349,7 @@ ...@@ -348,7 +349,7 @@
} }
.uni-list-item--hover { .uni-list-item--hover {
background-color: $uni-bg-color-hover; background-color: $uni-bg-color-hover !important;
} }
.uni-list-item__container { .uni-list-item__container {
......
{ {
"id": "uni-list", "id": "uni-list",
"displayName": "uni-list 列表", "displayName": "uni-list 列表",
"version": "1.2.10", "version": "1.2.12",
"description": "List 组件 ,帮助使用者快速构建列表。", "description": "List 组件 ,帮助使用者快速构建列表。",
"keywords": [ "keywords": [
"", "",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册