From b9b943ae3ab59d8361be99d82a66dff43937a1d7 Mon Sep 17 00:00:00 2001
From: anne-lxm <1076217653@qq.com>
Date: Sun, 29 Jan 2023 22:12:41 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=93=E7=A7=AF/=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E7=AB=AF=E7=94=A8wx.cropImage=E8=A3=81?=
=?UTF-8?q?=E5=88=87=E5=A4=B4=E5=83=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/cloud-image/cloud-image.vue | 8 +--
.../uni-id-pages-agreements.vue | 1 -
.../uni-id-pages-avatar.vue | 32 ++++++---
.../uni-id-pages-bind-mobile.vue | 7 +-
.../uni-id-pages-email-form.vue | 3 -
.../uni-id-pages-fab-login.vue | 64 ++++++------------
.../uni-id-pages-sms-form.vue | 3 -
.../uni-id-pages-user-profile.vue | 11 +--
.../pages/common/webview/webview.vue | 5 --
.../pages/login/login-smscode.vue | 3 -
.../pages/login/login-withoutpwd.vue | 6 +-
.../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 +++---
.../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_modules/uni-sign-in/static/background.png | Bin 38322 -> 30068 bytes
38 files changed, 61 insertions(+), 137 deletions(-)
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
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 f36bb91a..5f99a39a 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 d2660a93..861e3887 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 e9b3ae1a..80e8f32f 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,25 @@
// console.log(e);
}
});
+ }
+ // #endif
+
+ // #ifdef MP-WEIXIN
+ wx.cropImage({
+ src:filePath,
+ cropScale:"1:1",
+ success: res => {
+ callback(res.tempFilePath)
+ },
+ fail(e){
+ console.error(e)
+ callback(filePath)
+ }
})
- }
+ // #endif
+ })
// #endif
- // console.log(this.userInfo);
+
let cloudPath = this.userInfo._id + '' + Date.now()
avatar_file.name = cloudPath
uni.showLoading({
@@ -129,9 +143,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 5f0b5f05..c67b2609 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 ba53d736..b10d7dc0 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 c652a56d..c6a98309 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
@@ -15,13 +15,7 @@
-
-
diff --git a/uni_modules/uni-id-pages/pages/login/login-smscode.vue b/uni_modules/uni-id-pages/pages/login/login-smscode.vue
index 22948258..f847cc57 100644
--- a/uni_modules/uni-id-pages/pages/login/login-smscode.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-smscode.vue
@@ -38,7 +38,6 @@
this.phone = phoneNumber;
},
onShow() {
- // console.log('onShow');
// #ifdef H5
document.onkeydown = event => {
var e = event || window.event;
@@ -68,14 +67,12 @@
"code": this.code,
"captcha": this.captcha
}).then(e => {
- // console.log(e);
this.loginSuccess(e)
}).catch(e => {
if (e.errCode == 'uni-id-captcha-required') {
this.$refs.popup.open()
} else {
console.log(e.errMsg);
- // console.log(e.errCode);
}
}).finally(e => {
this.captcha = ''
diff --git a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
index 85676414..ca60fe31 100644
--- a/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
+++ b/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue
@@ -52,14 +52,14 @@
return /^1\d{10}$/.test(this.phone);
},
imgSrc() { //大快捷登录按钮图
- return '/uni_modules/uni-id-pages/static/login/' + this.type + '.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) {
- // console.log(e);
//获取通过url传递的参数type设置当前登录方式,如果没传递直接默认以配置的登录
let type = e.type || config.loginTypes[0]
this.type = type
+ // console.log("this.type: -----------",this.type);
if(type != 'univerify'){
this.focusPhone = true
}
@@ -111,7 +111,6 @@
this.$refs.uniFabLogin.login_before(this.type, true, options)
},
toSmsPage() {
- // console.log('toSmsPage',this.agree);
if (!this.isPhone) {
this.focusPhone = true
return uni.showToast({
@@ -201,7 +200,6 @@
}
.quickLogin {
- // width: 650rpx;
height: 350px;
align-items: center;
justify-content: center;
diff --git a/uni_modules/uni-id-pages/pages/register/register-admin.vue b/uni_modules/uni-id-pages/pages/register/register-admin.vue
index 8366cd4c..fcaf88a1 100644
--- a/uni_modules/uni-id-pages/pages/register/register-admin.vue
+++ b/uni_modules/uni-id-pages/pages/register/register-admin.vue
@@ -108,12 +108,9 @@
},
submitForm(params) {
uniIdCo.registerAdmin(this.formData).then(e => {
- // console.log(e);
uni.navigateBack()
})
.catch(e => {
- // console.log(e);
- // console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this.$refs.captcha.getImageCaptcha()
uni.showModal({
diff --git a/uni_modules/uni-id-pages/pages/register/register.vue b/uni_modules/uni-id-pages/pages/register/register.vue
index 9008696d..8ea32342 100644
--- a/uni_modules/uni-id-pages/pages/register/register.vue
+++ b/uni_modules/uni-id-pages/pages/register/register.vue
@@ -109,17 +109,14 @@
}).catch((errors) => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
- // console.log(key);
this['focus' + key] = true
})
},
submitForm(params) {
uniIdCo.registerUser(this.formData).then(e => {
- // console.log(e);
this.loginSuccess(e)
})
.catch(e => {
- // console.log(e);
console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this.$refs.captcha.getImageCaptcha()
diff --git a/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue b/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
index d3cf17cd..b6e77043 100644
--- a/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
+++ b/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue
@@ -137,8 +137,6 @@
* 完成并提交
*/
submit() {
- // console.log("formData", this.formData);
- // console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
@@ -153,7 +151,6 @@
password,
captcha
}).then(e => {
- // console.log(e);
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd',
complete: (e) => {
@@ -171,11 +168,9 @@
}).catch(errors=>{
let key = errors[0].key
if(key == 'code'){
- // console.log(this.$refs.shortCode);
return this.$refs.shortCode.focusSmsCodeInput = true
}
key = key.replace(key[0], key[0].toUpperCase())
- // console.log(key,'focus'+key);
this['focus'+key] = true
})
},
diff --git a/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue b/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
index 183c4055..6e1976ba 100644
--- a/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
+++ b/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue
@@ -166,8 +166,6 @@
* 完成并提交
*/
submit() {
- // console.log("formData", this.formData);
- // console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
@@ -182,7 +180,6 @@
password,
captcha
}).then(e => {
- // console.log(e);
uni.navigateBack()
})
.catch(e => {
@@ -195,11 +192,9 @@
}).catch(errors=>{
let key = errors[0].key
if(key == 'code'){
- // console.log(this.$refs.shortCode);
return this.$refs.shortCode.focusSmsCodeInput = true
}
key = key.replace(key[0], key[0].toUpperCase())
- // console.log(key,'focus'+key);
this['focus'+key] = true
})
},
@@ -208,11 +203,11 @@
url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email'
})
},
- backLogin () {
- uni.redirectTo({
- url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
- })
- }
+ backLogin () {
+ uni.redirectTo({
+ url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
+ })
+ }
}
}
diff --git a/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue b/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
index 1fcf7863..a6b2b1f4 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue
@@ -65,10 +65,8 @@
});
}
- // console.log(this.formData);
const uniIdCo = uniCloud.importObject("uni-id-co")
uniIdCo.bindMobileBySms(this.formData).then(e => {
- // console.log(e);
uni.showToast({
title: e.errMsg,
icon: 'none',
diff --git a/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue b/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
index 8396358f..75e0e044 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue
@@ -82,8 +82,6 @@
* 完成并提交
*/
submit() {
- // console.log("formData", this.formData);
- // console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
@@ -94,7 +92,6 @@
oldPassword,
newPassword
}).then(e => {
- // console.log(e);
uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0)
uni.redirectTo({
@@ -109,7 +106,6 @@
}).catch(errors => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
- // console.log(key, 'focus' + key);
this['focus' + key] = true
})
}
diff --git a/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue b/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
index d1c9467e..6d964215 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue
@@ -39,11 +39,8 @@
content: '已经仔细阅读注销提示,知晓可能带来的后果,并确认要注销',
complete: (e) => {
if (e.confirm) {
- const db = uniCloud.database();
-
const uniIdco = uniCloud.importObject("uni-id-co");
uniIdco.closeAccount().then((e) => {
- // console.log(e);
uni.showToast({
title: '注销成功',
duration: 3000
diff --git a/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue b/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
index 1329b7f4..0b482609 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue
@@ -115,7 +115,6 @@ export default {
this.$refs.popup.open()
} else {
console.log(e.errMsg);
- // console.log(e.errCode);
}
}).finally(e => {
this.formData.captcha = ''
diff --git a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
index 36b34b17..5124c4cf 100644
--- a/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
+++ b/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue
@@ -14,9 +14,11 @@
+
+
@@ -30,8 +32,6 @@