Browse Source

feature_20260316_日报分享内容自定义配置

zhujindu 1 month ago
parent
commit
b843d67523
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/components/share.vue

+ 10 - 1
src/components/share.vue

@@ -139,6 +139,7 @@ import { imgToBase64 } from '@/api/index';
 import VueQr from 'vue-qr';
 import ShareAtarget from './shareAtarget.vue';
 import shareReportCustom from './shareReportCustom.vue';
+import uploadAliOss from '@/utils/uploadAliOss';
 export default {
   name: 'share',
   components: { VueQr, ShareAtarget, shareReportCustom },
@@ -296,7 +297,6 @@ export default {
           this.toastLoading().clear();
           let imageUrl = canvas.toDataURL('image/png');
           this.canvasImageUrl = imageUrl;
-
           // 图片加载完成后设置滚动容器高度
           const img = new Image();
           img.onload = () => {
@@ -338,6 +338,15 @@ export default {
           this.zIndex = 9;
           this.$emit('setShareImg', true);
           this.$emit('setDailyDetailsBox', false);
+          // 上传阿里云oss
+          // 图片名称:用户名-时间戳
+          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);
+          //   }
+          // });
         })
         .catch((error) => {
           this.toastLoading().clear();