1
zhaoxiaoqiang
2022-11-28 912aeddb56e0514dd9fd0b0db10319b81d9976fc
1
1 files modified
8 ■■■■ changed files
src/views/homeIndex/home-index.vue 8 ●●●● patch | view | raw | blame | history
src/views/homeIndex/home-index.vue
@@ -2,7 +2,7 @@
 * @Author: 小明丶
 * @Date: 2020-05-20 20:29:47
 * @LastEditors: zxq
 * @LastEditTime: 2022-11-28 10:36:22
 * @LastEditTime: 2022-11-28 11:05:10
 * @Description:
-->
<template>
@@ -133,6 +133,7 @@
      let url = location.href.split('#')[0]
      this.$api.wechatgetSign({ url }).then(
        res => {
          // 第二步骤   只需要首页地址分享 ,需要在每次变化时调用
          wx.config({
            debug: false, // 开启调试模式
@@ -141,6 +142,10 @@
            nonceStr: res.body.nonceStr, // 必填,生成签名的随机串
            signature: res.body.signature, // 必填,签名,见附录1
            jsApiList: ["checkJsApi", "scanQRCode"] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
          });
          wx.error(function (res) {
            console.log(res)
            // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错
          });
        },
        error => {
@@ -155,6 +160,7 @@
        if (window.android && window.android.fetchQrCode) {
          window.android.fetchQrCode();
        } else {
          wx.scanQRCode({
            needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
            scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有