谢杰标 2 tahun lalu
induk
melakukan
86197bb3b9
5 mengubah file dengan 19 tambahan dan 24 penghapusan
  1. 1 1
      common/config.js
  2. 10 14
      common/wechat.js
  3. 1 0
      package.json
  4. 6 8
      pages/bill/index.vue
  5. 1 1
      utils/request.js

+ 1 - 1
common/config.js

@@ -1,7 +1,7 @@
 // test 测试环境
 // test 测试环境
 
 
 const dev = {
 const dev = {
-  BASE_URL: "http://192.168.1.24:5055",
+  BASE_URL: "http://192.168.1.24:5030",
   BASE_IMG_URL: "https://file-dev.xyyxt.net/",
   BASE_IMG_URL: "https://file-dev.xyyxt.net/",
 };
 };
 
 

+ 10 - 14
common/wechat.js

@@ -15,11 +15,7 @@ export default {
         timestamp: result.timestamp,
         timestamp: result.timestamp,
         nonceStr: result.nonceStr,
         nonceStr: result.nonceStr,
         signature: result.signature,
         signature: result.signature,
-        jsApiList: [
-          "checkJsApi",
-          "updateTimelineShareData",
-          "updateAppMessageShareData",
-        ],
+        jsApiList: ["updateTimelineShareData", "updateAppMessageShareData"],
       });
       });
       //配置完成后,再执行分享等功能
       //配置完成后,再执行分享等功能
       if (callback) {
       if (callback) {
@@ -28,20 +24,20 @@ export default {
     });
     });
   },
   },
   //在需要自定义分享的页面中调用
   //在需要自定义分享的页面中调用
-  share: function (data, url) {
+  share: function (data) {
     // if (!this.isWechat()) {
     // if (!this.isWechat()) {
     //   return;
     //   return;
     // }
     // }
-    url = url || window.location.href;
     //每次都需要重新初始化配置,才可以进行分享
     //每次都需要重新初始化配置,才可以进行分享
     this.initJssdkShare(function (signData) {
     this.initJssdkShare(function (signData) {
-      console.log(signData, "signData");
+      let { title, desc, link, imgUrl } = data;
       jweixin.ready(function () {
       jweixin.ready(function () {
+        
         var shareData = {
         var shareData = {
-          title: data && data.title ? data.title : signData.site_name,
-          desc: data && data.desc ? data.desc : signData.site_description,
-          link: url,
-          imgUrl: data && data.img ? data.img : signData.site_logo,
+          title,
+          desc,
+          link: link || window.location.href,
+          imgUrl,
           success: function (res) {
           success: function (res) {
             // 分享后的一些操作,比如分享统计等等
             // 分享后的一些操作,比如分享统计等等
             console.log("分享成功");
             console.log("分享成功");
@@ -49,9 +45,9 @@ export default {
           cancel: function (res) {},
           cancel: function (res) {},
         };
         };
         //分享给朋友接口
         //分享给朋友接口
-        jweixin.updateAppMessageShareData(shareData);
+        // jweixin.updateAppMessageShareData(shareData);
         //分享到朋友圈接口
         //分享到朋友圈接口
-        // jweixin.updateTimelineShareData(shareData);
+        jweixin.updateTimelineShareData(shareData);
       });
       });
     });
     });
   },
   },

+ 1 - 0
package.json

@@ -1,5 +1,6 @@
 {
 {
   "dependencies": {
   "dependencies": {
+    "html2canvas": "^1.4.1",
     "jweixin-module": "^1.6.0",
     "jweixin-module": "^1.6.0",
     "tki-qrcode": "^0.1.6",
     "tki-qrcode": "^0.1.6",
     "vconsole": "^3.15.0"
     "vconsole": "^3.15.0"

+ 6 - 8
pages/bill/index.vue

@@ -104,14 +104,12 @@ export default {
     },
     },
     share() {
     share() {
       //分享微信好友
       //分享微信好友
-      wechat.share(
-        {
-          title: "穷期先生的名片",
-          desc: "拥有多年财富管理经验的理财专家",
-          img: "",
-        },
-        "h.xyyxt.net"
-      );
+      wechat.share({
+        title: "穷期先生的名片",
+        desc: "拥有多年财富管理经验的理财专家",
+        imgUrl: "",
+        link: "h.xyyxt.net",
+      });
     },
     },
   },
   },
 };
 };

+ 1 - 1
utils/request.js

@@ -30,7 +30,7 @@ export const myRequest = (options) => {
           }
           }
         : {
         : {
             AuthorizationToken:
             AuthorizationToken:
-              "SE " + (token ? token : uni.getStorageSync("token_temp")),
+              "Bearer " + (token ? token : uni.getStorageSync("token_temp")),
             TenantId: tenantId,
             TenantId: tenantId,
           },
           },
       success: async (res) => {
       success: async (res) => {