提交 a6f84482 编写于 作者: M mahaifeng

[share]修改share目录结构

上级 ac8bcf4a
...@@ -1259,6 +1259,15 @@ ...@@ -1259,6 +1259,15 @@
} }
}, },
// #endif // #endif
// #ifdef APP
{
"path": "pages/API/share/share",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false
}
},
// #endif
{ {
"path": "pages/tabBar/CSS", "path": "pages/tabBar/CSS",
"style": { "style": {
...@@ -1858,15 +1867,6 @@ ...@@ -1858,15 +1867,6 @@
} }
}, },
// #endif // #endif
// #ifdef APP-ANDROID
{
"path": "pages/template/share/share",
"style": {
"navigationBarTitleText": "分享",
"enablePullDownRefresh": false
}
},
// #endif
// #ifdef APP || WEB // #ifdef APP || WEB
{ {
"path": "uni_modules/uni-pay-x/pages/success/success", "path": "uni_modules/uni-pay-x/pages/success/success",
......
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view direction="vertical" style="flex:1; margin-bottom: 50px;"> <scroll-view direction="vertical" style="flex:1; margin-bottom: 50px;">
<!-- #endif --> <!-- #endif -->
<view id="viewshot"> <view id="viewshot">
<button class="button" @click="shareText()">分享文本</button> <button class="button" @click="shareText()">分享文本</button>
<button class="button" @click="shareLink()">分享链接</button> <button class="button" @click="shareLink()">分享链接</button>
<button class="button" @click="sharePrivateImg()">分享单个本地图片</button> <button class="button" @click="sharePrivateImg()">分享单个本地图片</button>
<button class="button" @click="sharePrivateImgs()">分享多个本地图片</button> <button class="button" @click="sharePrivateImgs()">分享多个本地图片</button>
<button class="button" @click="shareAll()">分享链接、文本、一张图片</button> <button class="button" @click="shareAll()">分享链接、文本、一张图片</button>
<button class="button" @click="sharePrivateVideo()">分享video文件(单个)</button> <button class="button" @click="sharePrivateVideo()">分享video文件(单个)</button>
<button class="button" @click="sharePrivateVideos()">分享video文件(多个)</button> <button class="button" @click="sharePrivateVideos()">分享video文件(多个)</button>
<button class="button" @click="sharePrivateAudio()">分享Audio文件(单个)</button> <button class="button" @click="sharePrivateAudio()">分享Audio文件(单个)</button>
<button class="button" @click="sharePrivateAudios()">分享Audio文件(多个)</button> <button class="button" @click="sharePrivateAudios()">分享Audio文件(多个)</button>
<button class="button" @click="sharePrivateFile()">分享文件(单个)</button> <button class="button" @click="sharePrivateFile()">分享文件(单个)</button>
<button class="button" @click="sharePrivateFiles()">分享文件(多个)</button> <button class="button" @click="sharePrivateFiles()">分享文件(多个)</button>
<button class="button" type="primary" @click="sharePrivateErrorImg()">分享单个本地图片(错误路径)</button> <button class="button" type="primary" @click="sharePrivateErrorImg()">分享单个本地图片(错误路径)</button>
<button class="button" type="primary" @click="sharePrivateErrorImgs()">分享多个本地图片(含有错误路径)</button> <button class="button" type="primary" @click="sharePrivateErrorImgs()">分享多个本地图片(含有错误路径)</button>
<button class="button" type="primary" @click="sharePrivateErrorVideos()">分享Video文件(错误路径)</button> <button class="button" type="primary" @click="sharePrivateErrorVideos()">分享Video文件(错误路径)</button>
<button class="button" type="primary" @click="sharePrivateErrorAudios()">分享Audio文件(错误路径)</button> <button class="button" type="primary" @click="sharePrivateErrorAudios()">分享Audio文件(错误路径)</button>
<button class="button" type="primary" @click="sharePrivateErrorFiles()">分享文件(错误路径)</button> <button class="button" type="primary" @click="sharePrivateErrorFiles()">分享文件(错误路径)</button>
<button class="button" type="warn" @click="sharePubImg()">选择图片并分享</button> <button class="button" type="warn" @click="sharePubImg()">选择图片并分享</button>
<button class="button" type="warn" @click="sharePubMedias()">选择video并分享</button> <button class="button" type="warn" @click="sharePubMedias()">选择video并分享</button>
<button class="button" type="warn" @click="shareSnapShot()">指定view截图并分享</button> <button class="button" type="warn" @click="shareSnapShot()">指定view截图并分享</button>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
summary: '欢迎使用hello uniapp-x' summary: '欢迎使用hello uniapp-x'
} }
}, },
methods: { methods: {
sharePrivateErrorAudios() { sharePrivateErrorAudios() {
uni.hideToast() uni.hideToast()
...@@ -59,462 +59,462 @@ ...@@ -59,462 +59,462 @@
} }
}) })
}, },
sharePrivateErrorFiles() { sharePrivateErrorFiles() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/filemanager1/to.zip"; const path1 : string = "/static/filemanager1/to.zip";
const path2 : string = "/static/filemanager/11.txt.br"; const path2 : string = "/static/filemanager/11.txt.br";
uni.shareWithSystem({ uni.shareWithSystem({
filePaths: [path1, path2], filePaths: [path1, path2],
type:'file', type:'file',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateFile() { sharePrivateFile() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/filemanager/to.zip"; const path1 : string = "/static/filemanager/to.zip";
uni.shareWithSystem({ uni.shareWithSystem({
filePaths: [path1], filePaths: [path1],
type:'file', type:'file',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateFiles() { sharePrivateFiles() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/filemanager/to.zip"; const path1 : string = "/static/filemanager/to.zip";
const path2 : string = "/static/filemanager/1.txt.br"; const path2 : string = "/static/filemanager/1.txt.br";
uni.shareWithSystem({ uni.shareWithSystem({
filePaths: [path1, path2], filePaths: [path1, path2],
type:'file', type:'file',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateAudio() { sharePrivateAudio() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/test-audio/ForElise.mp3"; const path1 : string = "/static/test-audio/ForElise.mp3";
uni.shareWithSystem({ uni.shareWithSystem({
audioPaths: [path1], audioPaths: [path1],
type:'audio', type:'audio',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateAudios() { sharePrivateAudios() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/test-audio/ForElise.mp3"; const path1 : string = "/static/test-audio/ForElise.mp3";
const path2 : string = "/static/test-audio/ForElise.mp3"; const path2 : string = "/static/test-audio/ForElise.mp3";
uni.shareWithSystem({ uni.shareWithSystem({
audioPaths: [path1, path2], audioPaths: [path1, path2],
type:'audio', type:'audio',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateErrorVideos() { sharePrivateErrorVideos() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/test-video/10second-demo.mp4"; const path1 : string = "/static/test-video/10second-demo.mp4";
const path2 : string = "/static/test-video/10second-demo1.mp4"; const path2 : string = "/static/test-video/10second-demo1.mp4";
uni.shareWithSystem({ uni.shareWithSystem({
videoPaths: [path1, path2], videoPaths: [path1, path2],
type:'video', type:'video',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateVideo() { sharePrivateVideo() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/test-video/10second-demo.mp4"; const path1 : string = "/static/test-video/10second-demo.mp4";
uni.shareWithSystem({ uni.shareWithSystem({
videoPaths: [path1], videoPaths: [path1],
type:'video', type:'video',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateVideos() { sharePrivateVideos() {
uni.hideToast() uni.hideToast()
const path1 : string = "/static/test-video/10second-demo.mp4"; const path1 : string = "/static/test-video/10second-demo.mp4";
const path2 : string = "/static/test-video/10second-demo.mp4"; const path2 : string = "/static/test-video/10second-demo.mp4";
uni.shareWithSystem({ uni.shareWithSystem({
videoPaths: [path1, path2], videoPaths: [path1, path2],
type:'video', type:'video',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePubMedias() { sharePubMedias() {
uni.hideToast() uni.hideToast()
uni.chooseVideo({ uni.chooseVideo({
success(res) { success(res) {
uni.shareWithSystem({ uni.shareWithSystem({
videoPaths: [res.tempFilePath], videoPaths: [res.tempFilePath],
type:'video', type:'video',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
} }
}) })
}, },
shareText() { shareText() {
uni.hideToast() uni.hideToast()
uni.shareWithSystem({ uni.shareWithSystem({
summary: this.summary, summary: this.summary,
type:'text', type:'text',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
shareLink() { shareLink() {
uni.hideToast() uni.hideToast()
uni.shareWithSystem({
type:'text',
href: 'https://uniapp.dcloud.io',
success(res) {
console.log('Shared----------------------------success')
},
fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({
icon: "error",
title: "errorCode=" + res.errCode
})
},
complete(res) {
}
})
},
sharePrivateImg() {
uni.hideToast()
const imageSrc : string = "/static/test-image/logo.gif";
uni.shareWithSystem({ uni.shareWithSystem({
type:'text', type:'image',
href: 'https://uniapp.dcloud.io', imageUrl: imageSrc,
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
}, // 分享完成,请注意此时不一定是成功分享
fail(res) { },
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) fail(res) {
uni.showToast({ console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
icon: "error", uni.showToast({
title: "errorCode=" + res.errCode icon: "error",
}) title: "errorCode=" + res.errCode
}, })
complete(res) { // 分享失败
},
} complete(res) {
})
}, }
sharePrivateImg() { })
uni.hideToast() },
const imageSrc : string = "/static/test-image/logo.gif"; sharePrivateErrorImg() {
uni.hideToast()
const imageSrc : string = "/static/test-image/logo.jpg11";
uni.shareWithSystem({ uni.shareWithSystem({
type:'image',
imageUrl: imageSrc,
success(res) {
console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享
},
fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({
icon: "error",
title: "errorCode=" + res.errCode
})
// 分享失败
},
complete(res) {
}
})
},
sharePrivateErrorImg() {
uni.hideToast()
const imageSrc : string = "/static/test-image/logo.jpg11";
uni.shareWithSystem({
imageUrl: imageSrc, imageUrl: imageSrc,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
// 分享失败 // 分享失败
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateImgs() { sharePrivateImgs() {
uni.hideToast() uni.hideToast()
const errorImageSrc1 : string = "/static/test-image/logo.gif"; const errorImageSrc1 : string = "/static/test-image/logo.gif";
const errorImageSrc2 : string = "/static/test-image/logo.png"; const errorImageSrc2 : string = "/static/test-image/logo.png";
const imageSrc : string = "/static/test-image/logo.jpg"; const imageSrc : string = "/static/test-image/logo.jpg";
let imageUrlList : string[] = Array() let imageUrlList : string[] = Array()
imageUrlList.push(errorImageSrc2) imageUrlList.push(errorImageSrc2)
imageUrlList.push(imageSrc) imageUrlList.push(imageSrc)
// imageUrlList.push(errorImageSrc1) // imageUrlList.push(errorImageSrc1)
uni.shareWithSystem({ uni.shareWithSystem({
imagePaths: imageUrlList, imagePaths: imageUrlList,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePrivateErrorImgs() { sharePrivateErrorImgs() {
uni.hideToast() uni.hideToast()
const errorImageSrc1 : string = "/static/test-image/logo.jpg1"; const errorImageSrc1 : string = "/static/test-image/logo.jpg1";
const errorImageSrc2 : string = "/static/test-image/logo.jpg3"; const errorImageSrc2 : string = "/static/test-image/logo.jpg3";
const imageSrc : string = "/static/test-image/logo.jpg"; const imageSrc : string = "/static/test-image/logo.jpg";
let imageUrlList : string[] = Array() let imageUrlList : string[] = Array()
imageUrlList.push(imageSrc) imageUrlList.push(imageSrc)
imageUrlList.push(errorImageSrc1) imageUrlList.push(errorImageSrc1)
imageUrlList.push(errorImageSrc2) imageUrlList.push(errorImageSrc2)
uni.shareWithSystem({ uni.shareWithSystem({
imagePaths: imageUrlList, imagePaths: imageUrlList,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
shareAll() { shareAll() {
uni.hideToast() uni.hideToast()
const imageSrc : string = "/static/test-video/fast-forward.png"; const imageSrc : string = "/static/test-video/fast-forward.png";
let imageUrlList : string[] = Array() let imageUrlList : string[] = Array()
imageUrlList.push(imageSrc) imageUrlList.push(imageSrc)
uni.shareWithSystem({ uni.shareWithSystem({
summary: this.summary, summary: this.summary,
href: 'https://uniapp.dcloud.io', href: 'https://uniapp.dcloud.io',
imagePaths: imageUrlList, imagePaths: imageUrlList,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
sharePubImg() { sharePubImg() {
uni.hideToast() uni.hideToast()
uni.chooseImage({ uni.chooseImage({
count: 3, count: 3,
sourceType: ['camera', 'album'], sourceType: ['camera', 'album'],
success(e) { success(e) {
console.log(e) console.log(e)
console.log(JSON.stringify(e)) console.log(JSON.stringify(e))
uni.shareWithSystem({ uni.shareWithSystem({
// summary: "aa", // summary: "aa",
// href: 'https://uniapp.dcloud.io', // href: 'https://uniapp.dcloud.io',
imagePaths: e.tempFilePaths, imagePaths: e.tempFilePaths,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
} }
}) })
}, },
shareSnapShot() { shareSnapShot() {
uni.hideToast() uni.hideToast()
uni.getElementById("viewshot")?.takeSnapshot( uni.getElementById("viewshot")?.takeSnapshot(
{ {
success: function (res) { success: function (res) {
uni.shareWithSystem({ uni.shareWithSystem({
imageUrl: res.tempFilePath, imageUrl: res.tempFilePath,
type:'image', type:'image',
success(res) { success(res) {
console.log('Shared----------------------------success') console.log('Shared----------------------------success')
// 分享完成,请注意此时不一定是成功分享 // 分享完成,请注意此时不一定是成功分享
}, },
fail(res) { fail(res) {
console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg) console.log('Share failed, ' + "res.errCode =" + res.errCode + '---res.errMsg= ' + res.errMsg)
uni.showToast({ uni.showToast({
icon: "error", icon: "error",
title: "errorCode=" + res.errCode title: "errorCode=" + res.errCode
}) })
}, },
complete(res) { complete(res) {
} }
}) })
}, },
fail: function (res) { fail: function (res) {
console.log(res) console.log(res)
uni.showToast({ uni.showToast({
icon: 'error', icon: 'error',
title: '截图失败' title: '截图失败'
}) })
} }
} }
) )
}, },
} }
} }
</script> </script>
<style> <style>
.button { .button {
margin-left: 30px; margin-left: 30px;
margin-right: 30px; margin-right: 30px;
margin-bottom: 15px; margin-bottom: 15px;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册