From ff8105039493c59e4b51fe4b74ac67c2074bd6b0 Mon Sep 17 00:00:00 2001 From: linju Date: Thu, 2 Feb 2023 20:58:17 +0800 Subject: [PATCH] 1.1.0 --- manifest.json | 2 +- pages.json | 12 +- pages/index/index.vue | 4 +- uni_modules/uni-id-pages/changelog.md | 7 + .../uni-id-pages/common/login-page.mixin.js | 3 +- .../components/cloud-image/cloud-image.vue | 8 +- .../uni-id-pages-agreements.vue | 1 - .../uni-id-pages-avatar.vue | 39 +- .../uni-id-pages-bind-mobile.vue | 7 +- .../uni-id-pages-email-form.vue | 3 - .../uni-id-pages-fab-login.vue | 133 +++-- .../uni-id-pages-sms-form.vue | 3 - .../uni-id-pages-user-profile.vue | 11 +- uni_modules/uni-id-pages/package-lock.json | 29 -- uni_modules/uni-id-pages/package.json | 2 +- .../pages/common/webview/webview.vue | 5 - .../pages/login/login-smscode.vue | 3 - .../pages/login/login-withoutpwd.vue | 464 +++++++++--------- .../pages/register/register-admin.vue | 3 - .../uni-id-pages/pages/register/register.vue | 3 - .../pages/retrieve/retrieve-by-email.vue | 5 - .../uni-id-pages/pages/retrieve/retrieve.vue | 15 +- .../userinfo/bind-mobile/bind-mobile.vue | 2 - .../pages/userinfo/change_pwd/change_pwd.vue | 4 - .../pages/userinfo/deactivate/deactivate.vue | 3 - .../pages/userinfo/set-pwd/set-pwd.vue | 1 - .../uni-id-pages/pages/userinfo/userinfo.vue | 19 +- uni_modules/uni-id-pages/pages_init.json | 11 +- .../static/{login => app-plus}/apple.png | Bin .../{ => app-plus}/uni-fab-login/alipay.png | Bin .../{ => app-plus}/uni-fab-login/apple.png | Bin .../{ => app-plus}/uni-fab-login/douyin.png | Bin .../{ => app-plus}/uni-fab-login/facebook.png | Bin .../{ => app-plus}/uni-fab-login/google.png | Bin .../{ => app-plus}/uni-fab-login/qq.png | Bin .../uni-fab-login/sinaweibo.png | Bin .../{ => app-plus}/uni-fab-login/taobao.png | Bin .../uni-fab-login/univerify.png | Bin .../static/login/uni-fab-login/sms.png | Bin 0 -> 4285 bytes .../static/login/uni-fab-login/user.png | Bin 0 -> 2997 bytes .../static/login/uni-fab-login/weixin.png | Bin 0 -> 3934 bytes .../uni-id-pages/static/login/weixin.png | Bin 11525 -> 11483 bytes .../uni-id-pages/static/uni-fab-login/sms.png | Bin 4411 -> 0 bytes .../static/uni-fab-login/user.png | Bin 3071 -> 0 bytes .../static/uni-fab-login/weixin.png | Bin 4168 -> 0 bytes .../uni-id-co/common/validator.test.js | 343 ------------- .../database/uni-id-users.schema.json | 6 +- 47 files changed, 378 insertions(+), 773 deletions(-) delete mode 100644 uni_modules/uni-id-pages/package-lock.json rename uni_modules/uni-id-pages/static/{login => app-plus}/apple.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/alipay.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/apple.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/douyin.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/facebook.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/google.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/qq.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/sinaweibo.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/taobao.png (100%) rename uni_modules/uni-id-pages/static/{ => app-plus}/uni-fab-login/univerify.png (100%) create mode 100644 uni_modules/uni-id-pages/static/login/uni-fab-login/sms.png create mode 100644 uni_modules/uni-id-pages/static/login/uni-fab-login/user.png create mode 100644 uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png delete mode 100644 uni_modules/uni-id-pages/static/uni-fab-login/sms.png delete mode 100644 uni_modules/uni-id-pages/static/uni-fab-login/user.png delete mode 100644 uni_modules/uni-id-pages/static/uni-fab-login/weixin.png delete mode 100644 uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/validator.test.js diff --git a/manifest.json b/manifest.json index fed5166..01a379a 100644 --- a/manifest.json +++ b/manifest.json @@ -107,7 +107,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wx1002f172d7719592", "setting" : { "urlCheck" : false }, diff --git a/pages.json b/pages.json index 8ca282f..6563c18 100644 --- a/pages.json +++ b/pages.json @@ -23,13 +23,15 @@ "style": { "navigationBarTitleText": "绑定手机号码" } - }, + }, + // #ifndef MP-WEIXIN { "path": "uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage", "style": { "navigationBarTitleText": "" } - }, + }, + // #endif { "path": "uni_modules/uni-id-pages/pages/login/login-withoutpwd", "style": { @@ -53,14 +55,16 @@ "style": { "navigationBarTitleText": "注册" } - }, + }, + // #ifndef MP-WEIXIN { "path": "uni_modules/uni-id-pages/pages/register/register-admin", "style": { "navigationBarTitleText": "注册管理员账号", "enablePullDownRefresh": false } - }, + }, + // #endif { "path": "uni_modules/uni-id-pages/pages/register/register-by-email", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index fcaa8ec..500028a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -43,7 +43,9 @@ }) } else { uni.navigateTo({ - url: "/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=" + this.loginType + url: "/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=" + this.loginType, + animationType:"none", + animationDuration:0 }) } }, diff --git a/uni_modules/uni-id-pages/changelog.md b/uni_modules/uni-id-pages/changelog.md index 2c5adcc..551506a 100644 --- a/uni_modules/uni-id-pages/changelog.md +++ b/uni_modules/uni-id-pages/changelog.md @@ -1,3 +1,10 @@ +## 1.1.1(2023-02-02) +- 修复 Vue3下 一键登录条款勾选框选中状态未同步到页面 的问题 +## 1.1.0(2023-01-31) +- 【重要】优化 小程序端资源包大小(运行时大小为:731KB,发行后为:583KB;注:可以直接将本插件作为分包使用) +- 更新 微信小程序端 上传头像功能 用`wx.cropImage`实现图片裁剪 +- 修复 选择一键登录时会先显示 非密码登录页面的问题 +- 修复 一键登录 点击右上角的关闭按钮没有返回上一页的问题 ## 1.0.41(2023-01-16) - 优化 压缩依赖的文件资源大小 ## 1.0.40(2023-01-16) diff --git a/uni_modules/uni-id-pages/common/login-page.mixin.js b/uni_modules/uni-id-pages/common/login-page.mixin.js index 26936db..a30aafd 100644 --- a/uni_modules/uni-id-pages/common/login-page.mixin.js +++ b/uni_modules/uni-id-pages/common/login-page.mixin.js @@ -67,7 +67,8 @@ let mixin = { } } }, - set(agree) { + set(agree) { + console.log('set(agree)',agree); if (this.$refs.agreements) { this.$refs.agreements.isAgree = agree } else { diff --git a/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue b/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue index f36bb91..5f99a39 100644 --- a/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue +++ b/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue @@ -1,5 +1,5 @@ @@ -46,13 +46,10 @@ watch: { src:{ handler(src) { - // console.log(src); - // console.log(src.substring(0, 8)); if (src&&src.substring(0, 8) == "cloud://") { uniCloud.getTempFileURL({ fileList: [src] }).then(res=>{ - // console.log(res); this.cSrc = res.fileList[0].tempFileURL }) }else{ @@ -61,9 +58,6 @@ }, immediate: true } - }, - async mounted() { - }, methods:{ onClick(){ diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue b/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue index d2660a9..861e388 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue @@ -67,7 +67,6 @@ }, methods: { popupConfirm(){ - // console.log("popupConfirm"); this.isAgree = true retryFun() // this.$emit('popupConfirm') diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue b/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue index e9b3ae1..694594a 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue @@ -48,7 +48,6 @@ async mounted() { // #ifdef H5 this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform); - // console.log(' this.isPC', this.isPC, uni.getSystemInfoSync().platform); // #endif }, computed: { @@ -68,7 +67,6 @@ mutations.updateUserInfo({avatar_file}) }, uploadAvatarImg(res) { - // console.log(this.hasLogin); if(!this.hasLogin){ return uni.navigateTo({ url:'/uni_modules/uni-id-pages/pages/login/login-withoutpwd' @@ -84,7 +82,6 @@ count: 1, crop, success: async (res) => { - // console.log(res); let tempFile = res.tempFiles[0], avatar_file = { // #ifdef H5 @@ -95,10 +92,12 @@ // #endif }, filePath = res.tempFilePaths[0] + + //非app端剪裁头像,app端用内置的原生裁剪 // #ifndef APP-PLUS - //非app端用前端组件剪裁头像,app端用内置的原生裁剪 - if (!this.isPC) { - filePath = await new Promise((callback) => { + filePath = await new Promise((callback) => { + // #ifdef H5 + if (!this.isPC) { uni.navigateTo({ url: '/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage?path=' + filePath + `&options=${JSON.stringify(crop)}`, @@ -112,10 +111,32 @@ // console.log(e); } }); + } + // #endif + + // #ifdef MP-WEIXIN + wx.cropImage({ + src:filePath, + cropScale:"1:1", + success: res => { + callback(res.tempFilePath) + }, + fail(e){ + console.error(e) + uni.showModal({ + content: 'wx.cropImage ' + e.errMsg, + showCancel: false, + confirmText:"跳过裁剪", + complete() { + callback(filePath) + } + }); + } }) - } + // #endif + }) // #endif - // console.log(this.userInfo); + let cloudPath = this.userInfo._id + '' + Date.now() avatar_file.name = cloudPath uni.showLoading({ @@ -129,9 +150,7 @@ cloudPath, fileType: "image" }); - // console.log(result) avatar_file.url = fileID - // console.log({avatar_file}); uni.hideLoading() this.setAvatarFile(avatar_file) } diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue b/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue index 5f0b5f0..c67b260 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue @@ -41,13 +41,11 @@ uniCloud.importObject("uni-id-co",{ customUI:true }).loginByWeixin({code}).then(e=>{ - // console.log(e); resolve() }).catch(e=>{ console.log(e); reject() }).finally(e=>{ - // console.log(e); uni.hideLoading() }) }, @@ -61,13 +59,10 @@ }) }, async bindMobileByMpWeixin(e) { - // console.log(e); if (e.detail.errMsg == "getPhoneNumber:ok") { - // console.log(e.detail); //检查登录信息是否过期,否则通过重新登录刷新session_key await this.beforeGetphonenumber() uniIdCo.bindMobileByMpWeixin(e.detail).then(e => { - // console.log(e); this.$emit('success') }).finally(e => { this.closeMe() @@ -157,8 +152,8 @@ .agree::after { border: none; } - /* #endif */ + .agree:active { background-color: #F5F5F6; } diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue b/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue index ba53d73..b10d7dc 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue @@ -141,7 +141,6 @@ const uniIdCo = uniCloud.importObject("uni-id-co", { customUI: true }) - // console.log('uniIdCo', uniIdCo) console.log('sendEmailCode',{ "email": this.email, "scene": this.type, @@ -152,7 +151,6 @@ "scene": this.type, "captcha": this.captcha }).then(result => { - // console.log(result.code); uni.showToast({ title: "邮箱验证码发送成功", icon: 'none', @@ -161,7 +159,6 @@ this.reverseNumber = Number(this.count); this.getCode(); }).catch(e => { - // console.log(JSON.stringify(e)); if (e.code == "uni-id-invalid-mail-template") { this.modelValue = "123456" uni.showToast({ diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue index c652a56..2cf1ba9 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue @@ -2,7 +2,7 @@