fix: 修改环境判断函数

This commit is contained in:
zhangds 2024-04-25 10:04:47 +08:00
parent 3b14ae373a
commit 4c999ca9bd
3 changed files with 3 additions and 5 deletions

View File

@ -222,7 +222,7 @@
// debugger // debugger
// xw 模块 // xw 模块
if (data.is_voucher_auto) { if (data.is_voucher_auto) {
let goto_url = "/xw-pages/homepage.html"; const goto_url = "/xw-pages/homepage.html";
setTimeout(() => { setTimeout(() => {
if (type) { if (type) {
window.location.replace(goto_url); window.location.replace(goto_url);

View File

@ -605,11 +605,9 @@
* receive_mode: 1 支付宝 2 H5 * receive_mode: 1 支付宝 2 H5
* recharge_type 2 组合立减金 1立减金 * recharge_type 2 组合立减金 1立减金
*/ */
// mozilla/5.0 (iphone; cpu iphone os 11_0 like mac os x) applewebkit/604.1.38 (khtml, like gecko) version/11.0 mobile/15a372 safari/604.1 wechatdevtools/1.06.2308310 micromessenger/8.0.5 language/zh_cn webview/17140096225665648 webdebugger port/60203 token/b278ea8cbbdfa79d02f5eab56caf3a7f
if (type == 2) { if (type == 2) {
// 微信公众号授权 // 微信公众号授权
const ua = navigator.userAgent.toLowerCase(); if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
if (ua.match(/MicroMessenger/i) === "micromessenger") {
// this.publicCollection(res.data.order_number); // this.publicCollection(res.data.order_number);
let wxauth_url = "https://openapi.1688sup.com/wechat/oauth"; let wxauth_url = "https://openapi.1688sup.com/wechat/oauth";
wxauth_url = `${wxauth_url}?jump=${location.origin}/xw-pages/reduce.html`; wxauth_url = `${wxauth_url}?jump=${location.origin}/xw-pages/reduce.html`;

View File

@ -256,7 +256,7 @@
this.orderId = res.data.order_number; this.orderId = res.data.order_number;
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
// 第一步:是否是微信环境 -> 公众号授权 // 第一步:是否是微信环境 -> 公众号授权
if (ua.match(/MicroMessenger/i) === "micromessenger") { if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
this.publicCollection(res.data.order_number); this.publicCollection(res.data.order_number);
} else { } else {
// 第二步:其它环境 微信小程序 // 第二步:其它环境 微信小程序