From b5f084460e9e639358fbf91056a86be8d0a5c4b2 Mon Sep 17 00:00:00 2001
From: yaolonglong <yaolonglong15@163.com>
Date: 星期四, 09 十月 2025 20:18:57 +0800
Subject: [PATCH] 获取验证码功能
---
qiye/qiyeIndex/qiyeIndex.vue | 61 +++++++++++++++++++++++-------
1 files changed, 46 insertions(+), 15 deletions(-)
diff --git a/qiye/qiyeIndex/qiyeIndex.vue b/qiye/qiyeIndex/qiyeIndex.vue
index 8c89017..91a48b8 100644
--- a/qiye/qiyeIndex/qiyeIndex.vue
+++ b/qiye/qiyeIndex/qiyeIndex.vue
@@ -171,22 +171,53 @@
success: val => {
console.log(val)
const tempFilePath = val.tempFilePath;
- uni.saveImageToPhotosAlbum({
- filePath: tempFilePath,
- success: () => {
- uni.showToast({
- title: '鍥剧墖淇濆瓨鎴愬姛',
- icon: 'success',
- duration: 2000
- });
- },
- fail: () => {
- uni.showToast({
- title: '鍥剧墖淇濆瓨澶辫触',
- icon: 'none'
- });
+ uni.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.writePhotosAlbum']) {
+ uni.authorize({
+ scope:'scope.writePhotosAlbum',
+ success() {
+ uni.saveImageToPhotosAlbum({
+ filePath: tempFilePath,
+ success: () => {
+ uni.showToast({
+ title: '鍥剧墖淇濆瓨鎴愬姛',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ fail: () => {
+ uni.showToast({
+ title: '鍥剧墖淇濆瓨澶辫触',
+ icon: 'none'
+ });
+ }
+ });
+ },
+ fail(err){
+ console.log(err)
+ }
+ })
+ }else{
+ uni.saveImageToPhotosAlbum({
+ filePath: tempFilePath,
+ success: () => {
+ uni.showToast({
+ title: '鍥剧墖淇濆瓨鎴愬姛',
+ icon: 'success',
+ duration: 2000
+ });
+ },
+ fail: () => {
+ uni.showToast({
+ title: '鍥剧墖淇濆瓨澶辫触',
+ icon: 'none'
+ });
+ }
+ });
+ }
}
- });
+ })
},
fail: err => {
uni.showToast({
--
Gitblit v1.9.1