提交 e59ebeae 编写于 作者: guangjun.yang's avatar guangjun.yang

分享,保存图片等

上级 5e2e512e
...@@ -37,21 +37,26 @@ ...@@ -37,21 +37,26 @@
<div class="qr-wrapper"> <div class="qr-wrapper">
<img src="~@/images/annual/qr-code.png" alt /> <img src="~@/images/annual/qr-code.png" alt />
</div> </div>
<section v-if="type == 1" class="bottom"> <section v-if="isHide && type == 1" class="bottom">
<img src="~@/images/annual/save-btn.png" alt /> <img @click="save" src="~@/images/annual/save-btn.png" alt />
<img src="~@/images/annual/share-btn.png" alt /> <img @click="share" src="~@/images/annual/share-btn.png" alt />
</section> </section>
<section v-if="type == 2" class="bottom"> <section v-if="type == 2" class="bottom">
<img class="btn-l" src="~@/images/annual/share-btn-l.png" alt /> <!-- <img @click="callApp" class="btn-l" src="~@/images/annual/share-btn-l.png" alt /> -->
<WxOpenCommon :url="openPath" ></WxOpenCommon>
</section> </section>
</div> </div>
</template> </template>
<script> <script>
import Logo from "@/components/annual-summary/logo"; import Logo from "@/components/annual-summary/logo";
let _this = null; import WxOpenCommon from '@/components/wx-open';
import {
getWebPageUrl
} from "@/utils"
export default { export default {
components: { components: {
Logo Logo,
WxOpenCommon
}, },
props: { props: {
type: { type: {
...@@ -63,44 +68,34 @@ export default { ...@@ -63,44 +68,34 @@ export default {
default: () => { default: () => {
return {}; return {};
} }
},
isHide: {
type: Boolean,
default: true
} }
}, },
data() { data() {
return { return {
isHide: true, openPath: '',
// isHide: true,
} }
}, },
created() { created() {
_this = this; this.openPath = getWebPageUrl(`profexam/#/as-index`);
// 截屏时通知前端
window.__screenCaptureEvent = function() {
console.log('in screenCaptureEvent');
_this.$sendBuriedData({
component_tag: '557#557002'
});
}
// 保存图片的回调
window.__savePage2Picture = function(param) {
this.isHide = true;
console.log("__savePage2Picture", param);
}
}, },
methods: { methods: {
// 保存图片 // 保存图片
savePage2Picture() { save() {
this.isHide = false; this.$emit('save');
this.$forceUpdate()
this.$nextTick( () => {
rocNative.savePage2Picture({
__funcName: "__savePage2Picture"
});
})
}, },
// 分享按钮
share() {
this.$emit('share');
}
}, },
}; };
......
此差异已折叠。
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<Card5 :anualData="anualData"></Card5> <Card5 :anualData="anualData"></Card5>
</div> </div>
<div class="swiper-slide"> <div class="swiper-slide">
<Card6 :anualData="anualData"></Card6> <Card6 :anualData="anualData" @save="savePage2Picture" @share="share" :isHide="isHide"></Card6>
</div> </div>
</div> </div>
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
isWeb: window.__isWeb, isWeb: window.__isWeb,
isInfresh: false, isInfresh: false,
showLoading: false, showLoading: false,
isHide: true,
anualData: { anualData: {
orderNum: 1, orderNum: 1,
learnTime4Show: 1 learnTime4Show: 1
...@@ -69,6 +70,23 @@ export default { ...@@ -69,6 +70,23 @@ export default {
created() { created() {
_this = this; _this = this;
_this = this;
// 截屏时通知前端
window.__screenCaptureEvent = function() {
console.log("in screenCaptureEvent");
_this.$sendBuriedData({
component_tag: "557#557002"
});
};
// 保存图片的回调
window.__savePage2Picture = function(param) {
this.isHide = true;
console.log("__savePage2Picture", param);
};
// 先调用存储权限(只有安卓手机需要)
this.isAndroid && rocNative.openExternalStoragePermission();
window.__getUserInfoAS = function(param) { window.__getUserInfoAS = function(param) {
console.log("__getUserInfoAS", param); console.log("__getUserInfoAS", param);
...@@ -190,7 +208,7 @@ export default { ...@@ -190,7 +208,7 @@ export default {
// token是否失效校验 // token是否失效校验
checkToken() { checkToken() {
let param = { let param = {
token: this.anualData.userToken || this.token, token: this.userInfo.userToken || this.token,
setEntry: true setEntry: true
}; };
this.GET("campaign/admin/task/checkToken", param).then(res => { this.GET("campaign/admin/task/checkToken", param).then(res => {
...@@ -205,6 +223,32 @@ export default { ...@@ -205,6 +223,32 @@ export default {
} else { } else {
} }
}); });
},
// 保存图片
savePage2Picture() {
this.isHide = false;
this.$forceUpdate();
this.$nextTick(() => {
rocNative.savePage2Picture({
__funcName: "__savePage2Picture"
});
});
},
// 调用原生分享(弹框)
share() {
let shareUrl = getWebPageUrl(`profexam/#/as-share?uuid=${anualData.uuid}`);
this.$rocNative &&
this.$rocNative.shareWechat({
type: 6,
shareId: 0,
shareUrl: shareUrl,
title1: "云鹊医2020年度个人学习报告",
title2: "点击查看我的专属学习报告",
shareImageUrl:
"https://file.yunqueyi.com/logo.png?version=" + new Date().getTime()
});
} }
} }
}; };
......
<template> <template>
<div class="as-share-wrapper"> <div class="as-share-wrapper">
<Card6 type="2" :anualData="anualData"></Card6> <Card6 type="2" :anualData="anualData" ></Card6>
<Loading v-show="showLoading" /> <Loading v-show="showLoading" />
</div> </div>
</template> </template>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册