当前位置:网站首页>Wechat applet image saving function
Wechat applet image saving function
2022-06-12 08:40:00 【Pumpkin_ xiaoXuan】
uni.authorize({
scope: "scope.writePhotosAlbum",
success: (success) => {
// Save pictures to local
this.saveImg()
},
fail: (fail) => {
uni.getSetting({
success: (setting) => {
// Not allowed to save
if (setting.authSetting["scope.writePhotosAlbum"] == false) {
wx.showModal({
title: " reminder ",
content: " Please allow the applet to save an album or video ",
success: (res) => {
if (res.confirm) {
wx.openSetting();
}
},
});
} else {
// Save pictures to local
this.saveImg();
}
},
});
}
})
// How to save pictures
saveImg() {
console.log('this.codeImage', this.codeImage);
uni.saveImageToPhotosAlbum({
filePath: this.codeImage,
success: () => {
uni.showToast({
title: " Picture saved successfully ",
icon: "success",
});
},
fail: (fail) => {
console.log('fail', fail);
uni.showToast({
title: " Picture not saved ",
icon: "none",
});
},
});
},边栏推荐
- Vision transformer | arXiv 2205 - TRT vit vision transformer for tensorrt
- 正则校验用户名
- When converting tensor to ndarray in tensorflow, the run or Eval function is constantly called in the loop, and the code runs more and more slowly!
- Ankerui fire emergency lighting and evacuation indication system
- Hands on deep learning -- image classification dataset fashion MNIST
- Asp Net project add log function
- QT realizes multi screen and multi-resolution adaptation
- [GUI development] browsing function implementation model of image processing software
- MYSQL中的查询
- 【新规划】
猜你喜欢

Hands on learning and deep learning -- a brief introduction to softmax regression

Ankerui motor protector has the functions of overload inverse time limit, overload definite time limit, grounding, starting timeout, leakage, underload, phase failure, locked rotor, etc

Hands on deep learning -- concise implementation code of weight decay

What should be paid attention to when establishing MES system? What benefits can it bring to the enterprise?
![[compilation principle] understand BNF](/img/64/9a0e7507606781336fdc44116ba423.jpg)
[compilation principle] understand BNF

Vision transformer | arXiv 2205 - TRT vit vision transformer for tensorrt

【动态内存管理】malloc&calloc和realloc和笔试题和柔性数组

In the era of intelligent manufacturing, how do enterprises carry out digital transformation

The residual pressure monitoring system ensures the smoothness of the fire evacuation passage in case of fire, and protects the safe operation of large high-rise buildings and the safety of people's l

Adjust SVG width and height
随机推荐
【 pointeur avancé Ⅲ】 mise en œuvre de la fonction de tri rapide qsort& fonction de rappel en langage C
MYSQL中的查询
Figure neural network makes Google maps more intelligent
R loop assignment variable name
动态线段树leetcode.699
Model Trick | CVPR 2022 Oral - Stochastic Backpropagation A Memory Efficient Strategy
API handling Android security distance
Close asymmetric key
Easyexcel exports excel tables to the browser, and exports excel through postman test [introductory case]
【动态内存管理】malloc&calloc和realloc和笔试题和柔性数组
Knee joint
Engineers learn music theory (III) interval mode and chord
ASP. Net project development practice introduction_ Item VI_ Error report (summary of difficult problems when writing the project)
The electrical fire detector monitors each power circuit in real time
Ankerui fire emergency lighting and evacuation indication system
正则校验用户名
【新规划】
Database foundation -- normalization and relational schema
Ankerui motor protector has the functions of overload inverse time limit, overload definite time limit, grounding, starting timeout, leakage, underload, phase failure, locked rotor, etc
Oracle installation details (verification)