微信小程序 支付宝小程序 支付宝微信扫码进小程序后参数的获取方式, 两个有点差异

时间:2021-05-07 19:01:34   收藏:0   阅读:24
  onLaunch: function () {
    const params = wx.getLaunchOptionsSync();
    let str = params.query ? params.query.q : "";
    if (str) {
      str = decodeURIComponent(str);
      if (str.indexOf("qr=") === -1) return;
      const qr = str.split("qr=")[1];
      this.$store.commit("save_qr", qr);
    }
  },

 

上面微信

 

 

下面支付宝

 

 

    const str = option.query ? option.query.qrCode : "";
    if (str) {
      if (str.indexOf("qr=") === -1) return;
      const qr = str.split("qr=")[1];
      this.$store.commit("SAVE_QR", qr);
    }

 

原文:https://www.cnblogs.com/l24118028/p/14738917.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!