1
0
gemercheung 2 лет назад
Родитель
Сommit
cc20bf3616

+ 1 - 1
packages/qjkankan-editor/.env.testprod

@@ -7,5 +7,5 @@ VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
-VUE_APP_DEBBUG_FLAG=0728-01
+VUE_APP_DEBBUG_FLAG=0807-01
 VUE_APP_DEBBUG_NOTIFY=0

+ 41 - 14
packages/qjkankan-editor/src/views/material/popup/share.vue

@@ -1,8 +1,11 @@
 <template>
   <popup v-if="show">
-    <div class="ui-message ui-message-confirm message-material" style="width: 500px">
+    <div
+      class="ui-message ui-message-confirm message-material"
+      style="width: 500px"
+    >
       <div class="ui-message-header header-material">
-        <span>{{share}}</span>
+        <span>{{ share }}</span>
         <span @click="$emit('close')">
           <i class="iconfont icon-close"></i>
         </span>
@@ -10,11 +13,19 @@
       <div class="ui-message-main">
         <ul>
           <li>
-            <span>{{work_link}}</span>
-            <input :title="item.share+`&lang=${$lang}`" class="ui-input" disabled type="text" maxlength="15"  v-model="item.share" />
+            <span>{{ work_link }}</span>
+            <input
+              :title="item.share + `&vr=${defaultscenesCode}lang=${$lang}`"
+              class="ui-input"
+              disabled
+              type="text"
+              maxlength="15"
+              v-model="item.share"
+            />
           </li>
           <li>
-            <span>{{work_qrCode}}</span>
+            <span>{{ work_qrCode }} </span>
+
             <img :src="item.qrCode + `?${Math.random()}` || $thumb" alt="" />
           </li>
         </ul>
@@ -22,10 +33,13 @@
 
       <div class="ui-message-footer footer-material">
         <button @click="downloadImg(item)" class="ui-button">
-          {{download_qrCode}}
+          {{ download_qrCode }}
         </button>
-        <button @click="copy(item.share+`&lang=${$lang}`)" class="ui-button submit">
-          {{copy_link}}
+        <button
+          @click="copy(item.share + `&vr=${defaultscenesCode}lang=${$lang}`)"
+          class="ui-button submit"
+        >
+          {{ copy_link }}
         </button>
       </div>
     </div>
@@ -34,9 +48,9 @@
 
 <script>
 import Popup from "@/components/shared/popup";
-import {i18n} from "@/lang"
+import { i18n } from "@/lang";
 
-let dataUrlToBold = function(url) {
+let dataUrlToBold = function (url) {
   let arr = url.split(","),
     mime = arr[0].match(/:(.*?);/)[1],
     bStr = atob(arr[1]),
@@ -64,10 +78,21 @@ export default {
       key: "",
     };
   },
+  computed: {
+    defaultscenesCode: function () {
+      if (this.item.firstScene) {
+        return this.item.firstScene.sceneCode || "";
+      } else {
+        return Array.from(this.item.scenes).length > 0
+          ? Array.from(this.item.scenes)[0].sceneCode
+          : "";
+      }
+    },
+  },
   mounted() {},
   methods: {
     downloadImg(workItem) {
-      let val = workItem.qrCode
+      let val = workItem.qrCode;
       // var a = document.createElement("a");
       // a.download = 'qrcode';
       // a.href = 'https://4dkk.4dage.com/720yun_fd_manage/620/qrCode.jpg';
@@ -79,7 +104,7 @@ export default {
       let image = new Image();
       image.setAttribute("crossOrigin", "anonymous"); //消除跨域
       image.src = val;
-      image.onload = function() {
+      image.onload = function () {
         //借助canvas实现 消除 图片地址会先直接窗口打开图片地址
         let canvas = document.createElement("canvas");
         canvas.width = image.width;
@@ -116,9 +141,11 @@ export default {
       textArea.select();
 
       try {
-        document.execCommand("copy") ? this.$msg.success(this.$i18n.t('gather.scene_link_copy_tips')) : this.$msg.error(this.$i18n.t('gather.scene_link_copy_failed'));
+        document.execCommand("copy")
+          ? this.$msg.success(this.$i18n.t("gather.scene_link_copy_tips"))
+          : this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
       } catch (err) {
-        this.$msg.error(this.$i18n.t('gather.scene_link_copy_failed'));
+        this.$msg.error(this.$i18n.t("gather.scene_link_copy_failed"));
       }
 
       document.body.removeChild(textArea);

+ 1 - 1
packages/qjkankan-view/.env.testprod

@@ -7,7 +7,7 @@ VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_URL_FILL=/qjkankan
 # 接口请求地址
 VUE_APP_APIS_URL=https://test.4dkankan.com/
-VUE_APP_DEBBUG_FLAG=0801-02
+VUE_APP_DEBBUG_FLAG=0807-01
 VUE_APP_DEBBUG_NOTIFY=0
 VUE_APP_DEBBUG_V4=0
 VUE_APP_DEBBUG_V4_URL="http://192.168.0.186:8081"

+ 19 - 19
packages/qjkankan-view/src/utils/wxshare.js

@@ -6,12 +6,13 @@ export function toConfigure() {
       url: "//www.4dage.com/wechat/jssdk/share",
       type: "get",
       data: {
-        uri: location.href.split("#")[0],
+        uri: window.location.href.split("#")[0],
         name: "厦门四维时代微信公众号",
       },
       dataType: "jsonp",
       //jsonpCallback: "success_jsonp",
       success: function (data, textStatus) {
+        console.log("微信签名", data);
         wx.config({
           debug: false,
           appId: data.appId,
@@ -22,8 +23,8 @@ export function toConfigure() {
             "checkJsApi",
             "updateAppMessageShareData",
             "updateTimelineShareData",
-            "onMenuShareAppMessage",
-            "onMenuShareTimeline",
+            // "onMenuShareAppMessage",
+            // "onMenuShareTimeline",
             "onMenuShareQQ",
             "onMenuShareWeibo",
             // "hideMenuItems",
@@ -100,24 +101,20 @@ function setup({ title, link, imgUrl, desc }) {
 
   wx.ready(function () {
     // 微信朋友圈
-    data.open = "wx_friends";
+    // data.open = "wx_friends";
     // wx.onMenuShareTimeline({ title, link: path + jsonToStr(data), imgUrl, desc });
-    wx.updateTimelineShareData({
-      title,
-      link: path + jsonToStr(data),
-      imgUrl,
-      desc,
-    });
+
+    const shareData = {
+      title: title,
+      desc: desc,
+      link: window.location.href,
+      imgUrl: imgUrl,
+    };
+    wx.updateAppMessageShareData(shareData);
+    wx.updateTimelineShareData(shareData);
+    console.log("shareData", shareData);
     // 微信好友
-    data.open = "wx_friend";
-    wx.updateAppMessageShareData({
-      title,
-      desc,
-      link: path + jsonToStr(data),
-      imgUrl,
-      type: defaultChar,
-      dataUrl: defaultChar,
-    });
+
     // 微博
     data.open = "weibo";
     wx.onMenuShareWeibo({
@@ -150,6 +147,9 @@ function setup({ title, link, imgUrl, desc }) {
     });
     wx.error(function (e) {});
   });
+  wx.error(function (res) {
+    console.log("微信分享错误信息", res);
+  });
 }
 
 export default async (args) => {