开始做登录

This commit is contained in:
2024-03-15 17:20:54 +08:00
parent b9335b4ff8
commit 633cff358d
1423 changed files with 35817 additions and 19 deletions

View File

@@ -164,4 +164,35 @@ export const alertError = (message) => {
title: message,
icon: 'error'
})
}
export const loadingFunc = async callback => {
if (typeof callback !== "function") {
return
}
await showLoading()
try {
await callback()
} catch(err) {
} finally {
await hideLoading()
}
}
export const wxLogin = () => {
return new Promise((resolve, reject) => {
wx.login({
success (res) {
if (res.code) {
resolve(res.code)
return
}
reject()
},
fail: err => {
reject(err)
}
})
})
}