扫描小程序码分享
我这边的一款小程序,在鸿蒙系统下的微信中,下载字帖功能不可用,但是没办法去调试。
点击“笔画下载”或者“默写下载”后应该保存成这种形式的A4大小图片
但是在鸿蒙系统下的微信中保存是空白图片。
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
给个保存图片代码代码片段,这边测试一下请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
title: "保存成功,请在相册查看",
icon: "none",
});
},
fail() {
uni.hideLoading();
uni.showToast({
title: "下载失败",
}
fail: (error) => {
uni.showModal({
title: "提示",
content: "检测到您有未开启的权限,为保证功能正常使用,请保持保存到相册权限均为开启状态",
confirmText: "去开启",
success: ({
confirm
}) => {
if (confirm) uni.openSetting();
//获取分享URL
getShareUrl() {
let data = {
client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl,
type: this.$globalConstVars.shareModel.url,
page: this.$globalConstVars.shareType.mathdetails,
params: {
mathdetailsId: this.id,
};
let userToken = this.$db.get("userToken");
if (userToken && userToken != "") {
<view class="zksoftshop-basis-6" style="display: flex;">
<u-button type="error" size="medium" :custom-style="submitStatusStyle" @click="getSubject()">下载</u-button>
<button class="zksoftshop-btn" style="background-color: #fff;display: flex;align-items: center; width:150rpx;" open-type="share">
<uv-icon name="share-fill" style="display: inline-block;" color="#FFC704" size="15"></uv-icon>
<text style="color:#FFC704 ;">分享</text>
</button>
<ku-painter name="好学少年" :palette="subjectpalette" @imgOK="imgOK" @imgErr="imgErr"></ku-painter>
</view>
imgOK(e) {
this.imgSrc = e.path; // 点击打印出来的内容就可以看见图片了
this.saveHandler();
imgErr(e) {
console.log('error', e);
title: "生成失败",
getSubject() {
uni.showLoading({
title: '生成中...',
mask: true,
})
const palette = {
width: "2880px",
height: "4508px",
background: "#ffffff",
views: [],
// css 使用数组形式抽离相同样式
const arr1 = [{
type: "text", //标题
text: this.info.title + this.info.counts + "题",
css: {
代码片段,还真没用过这个功能呢,我这边是uniapp项目,可以用吗?
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
给个保存图片代码代码片段,这边测试一下请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
title: "保存成功,请在相册查看",
icon: "none",
});
},
fail() {
uni.hideLoading();
uni.showToast({
title: "下载失败",
icon: "none",
});
}
});
},
fail: (error) => {
uni.hideLoading();
uni.showModal({
title: "提示",
content: "检测到您有未开启的权限,为保证功能正常使用,请保持保存到相册权限均为开启状态",
confirmText: "去开启",
success: ({
confirm
}) => {
if (confirm) uni.openSetting();
},
});
},
});
},
//获取分享URL
getShareUrl() {
let data = {
client: this.$globalConstVars.shareClient.wxMiNiProgram,
url: this.$globalConstVars.shareUrl,
type: this.$globalConstVars.shareModel.url,
page: this.$globalConstVars.shareType.mathdetails,
params: {
mathdetailsId: this.id,
},
};
let userToken = this.$db.get("userToken");
if (userToken && userToken != "") {
<view class="zksoftshop-basis-6" style="display: flex;">
<u-button type="error" size="medium" :custom-style="submitStatusStyle" @click="getSubject()">下载</u-button>
<button class="zksoftshop-btn" style="background-color: #fff;display: flex;align-items: center; width:150rpx;" open-type="share">
<uv-icon name="share-fill" style="display: inline-block;" color="#FFC704" size="15"></uv-icon>
<text style="color:#FFC704 ;">分享</text>
</button>
<ku-painter name="好学少年" :palette="subjectpalette" @imgOK="imgOK" @imgErr="imgErr"></ku-painter>
</view>
imgOK(e) {
this.imgSrc = e.path; // 点击打印出来的内容就可以看见图片了
this.saveHandler();
},
imgErr(e) {
uni.hideLoading();
console.log('error', e);
uni.showToast({
title: "生成失败",
icon: "none",
});
},
getSubject() {
uni.showLoading({
title: '生成中...',
mask: true,
})
const palette = {
width: "2880px",
height: "4508px",
background: "#ffffff",
views: [],
};
// css 使用数组形式抽离相同样式
const arr1 = [{
type: "text", //标题
text: this.info.title + this.info.counts + "题",
css: {
代码片段,还真没用过这个功能呢,我这边是uniapp项目,可以用吗?