|
|
@@ -136,7 +136,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import html2canvas from 'html2canvas';
|
|
|
-import { imgToBase64 } from '@/api/index';
|
|
|
+import { imgToBase64, shareReportMobile } from '@/api/index';
|
|
|
import VueQr from 'vue-qr';
|
|
|
import ShareAtarget from './shareAtarget.vue';
|
|
|
import shareBtarget from './shareBtarget.vue';
|
|
|
@@ -205,9 +205,15 @@ export default {
|
|
|
qrcode: null,
|
|
|
vueQrText: '',
|
|
|
heightFlag: 'start', //图片高度不足,居中显示
|
|
|
+ shareDuration: 0, //分享时间
|
|
|
+ shareInterval: null,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.shareDuration = 0;
|
|
|
+ this.shareInterval = setInterval(() => {
|
|
|
+ this.shareDuration++;
|
|
|
+ }, 1000);
|
|
|
this.zIndex = -1;
|
|
|
this.canvasImageUrl = '';
|
|
|
let links = process.env.NODE_ENV == 'production' ? 'http://1.npz.cn/3/' : 'http://1.npz.cn/2/';
|
|
|
@@ -344,11 +350,18 @@ export default {
|
|
|
// 图片名称:用户名-时间戳
|
|
|
let username = this.reportTarget.nickName;
|
|
|
let imgName = username + '-' + new Date().getTime();
|
|
|
- // uploadAliOss(imageUrl, imgName).then((res) => {
|
|
|
- // if (res.url && res.url.indexOf('http') != -1) {
|
|
|
- // console.log(res.url);
|
|
|
- // }
|
|
|
- // });
|
|
|
+ uploadAliOss(imageUrl, imgName).then((res) => {
|
|
|
+ if (res.url && res.url.indexOf('http') != -1) {
|
|
|
+ console.log(res.url);
|
|
|
+ shareReportMobile({
|
|
|
+ reportId: this.reportId, // long 汇报主键id
|
|
|
+ imageUrl: res.url, // String 分享日报的图片的URL
|
|
|
+ shareDuration: this.shareDuration, // long 分享用时(秒)
|
|
|
+ }).then((res) => {
|
|
|
+ if (this.shareInterval) clearInterval(this.shareInterval);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
this.toastLoading().clear();
|