瀏覽代碼

反馈页面提交

tangning 1 年之前
父節點
當前提交
1b40a41163
共有 4 個文件被更改,包括 73 次插入2 次删除
  1. 1 0
      package.json
  2. 63 0
      src/App.vue
  3. 1 1
      src/views/feedback/index.vue
  4. 8 1
      yarn.lock

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
     "ant-design-vue": "4.x",
     "axios": "1.2.1",
     "dayjs": "^1.11.7",
+    "jsonp": "^0.2.1",
     "mitt": "^3.0.0",
     "pinia": "^2.0.28",
     "pinia-plugin-persistedstate": "^3.0.1",

+ 63 - 0
src/App.vue

@@ -8,6 +8,7 @@
   import { useCookies } from '@vueuse/integrations/useCookies';
   import { useRouter } from 'vue-router';
   import { useI18n } from 'vue-i18n';
+  import jsonp from 'jsonp'
   const userStore = useUserStore();
   const { t } = useI18n();
   const wxOpenId = computed(() => {
@@ -36,6 +37,7 @@
       useCookies().set('wxOpenId', '');
       getCodeApi(123);
     }
+    wxShare();
   });
   function getUrlKey(name) {
     //获取url 参数
@@ -45,6 +47,67 @@
       ) || null
     );
   }
+  function wxShare() {
+    wxShare () {
+      
+      let url = window.location.href.split('#')[0]
+      if(window.location.ancestorOrigins){url = window.location.ancestorOrigins[0]}
+      jsonp('https://www.4dage.com/wechat/jssdk/share/?uri=' +
+  window.escape(url) + '&name=厦门四维时代微信公众号', 'success_jsonp', function (err, data) {
+        if (err) {
+          console.err(err)
+        } else {
+          console.log(wx)
+          wx.config({
+            debug: false, // 开启调试模式
+            appId: data.appId,
+            timestamp: data.timestamp,
+            nonceStr: data.nonceStr,
+            signature: data.signature,
+            jsApiList: ['checkJsApi',
+              'onMenuShareTimeline',
+              'onMenuShareAppMessage',
+              'onMenuShareQQ',
+              'onMenuShareWeibo',
+              'hideMenuItems',
+              'showMenuItems',
+              'hideAllNonBaseMenuItem',
+              'showAllNonBaseMenuItem',
+              'translateVoice',
+              'startRecord',
+              'stopRecord',
+              'onRecordEnd',
+              'playVoice',
+              'pauseVoice',
+              'stopVoice',
+              'uploadVoice',
+              'downloadVoice']
+          })
+        }
+        wx.error(function (err) {
+          console.log(err)
+        })
+        wx.ready(function () {
+          var shareData = {
+            title: '四维看看', //  标题
+            desc: '可将线下场景自动转为线上四维场景。好用不贵,全球百万用户首选', //  描述
+            link: window.location.href, //  分享的URL,必须和当前打开的网页的URL是一样的
+            imgUrl: 'https://4dkk.4dage.com/FDKKIMG/icon/kankan_icon180.png', //  缩略图地址
+            success: function () {
+
+            },
+            cancel: function () {
+
+            }
+          }
+          wx.onMenuShareAppMessage(shareData)
+          wx.onMenuShareTimeline(shareData)
+          wx.onMenuShareQQ(shareData)
+          wx.onMenuShareQZone(shareData)
+        })
+      })
+    }
+  }
   function getCodeApi(state) {
     //获取code
     console.log('getCodeApi');

+ 1 - 1
src/views/feedback/index.vue

@@ -73,7 +73,7 @@
     formData.country = '';
     formData.address = '';
     formData.countries = [];
-    formData.score = 5;
+    formData.score = 0;
     formData.scoreReason = '';
     setObjId.hardwareOptionId = '';
     setObjId.softwareOptionId = '';

+ 8 - 1
yarn.lock

@@ -2352,7 +2352,7 @@ de-indent@^1.0.2:
   resolved "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz"
   integrity sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==
 
-debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
+debug@2.6.9, debug@^2.1.3, debug@^2.2.0, debug@^2.3.3:
   version "2.6.9"
   resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
   integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
@@ -4967,6 +4967,13 @@ jsonfile@^6.0.1:
   optionalDependencies:
     graceful-fs "^4.1.6"
 
+jsonp@^0.2.1:
+  version "0.2.1"
+  resolved "http://192.168.0.47:4873/jsonp/-/jsonp-0.2.1.tgz#a65b4fa0f10bda719a05441ea7b94c55f3e15bae"
+  integrity sha512-pfog5gdDxPdV4eP7Kg87M8/bHgshlZ5pybl+yKxAnCZ5O7lCIn7Ixydj03wOlnDQesky2BPyA91SQ+5Y/mNwzw==
+  dependencies:
+    debug "^2.1.3"
+
 junk@^3.1.0:
   version "3.1.0"
   resolved "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz"