|
|
@@ -51,7 +51,13 @@ Page({
|
|
|
|
|
|
// 处理扫码链接(options.q 包含完整的URL或activityId)
|
|
|
if (options.q) {
|
|
|
- let str = decodeURIComponent(options.q); //扫描二维码获得的跳转链接
|
|
|
+ let str = decodeURIComponent(options.q); // 扫描二维码获得的跳转链接
|
|
|
+
|
|
|
+ // 兼容一些环境中把 & 编码成 & 的情况,防止参数解析错误(如 scanCount=0&storeId=...)
|
|
|
+ if (str.indexOf('&') !== -1) {
|
|
|
+ console.log('🔧 检测到 URL 中包含 &,自动还原为 &');
|
|
|
+ str = str.replace(/&/g, '&');
|
|
|
+ }
|
|
|
|
|
|
// 检查是否是员工邀请链接(app.fmode.cn/dev/pobingfeng/manager/staff?invite=xxx)
|
|
|
if (str.includes('app.fmode.cn/dev/pobingfeng/manager/staff')) {
|
|
|
@@ -300,7 +306,13 @@ Page({
|
|
|
if (!url || url.indexOf('?') == -1) {
|
|
|
return
|
|
|
}
|
|
|
- // 提取查询参数部分(去除可能的hash部分)
|
|
|
+
|
|
|
+ // 兼容 URL 中 & 的情况,先统一还原为 &
|
|
|
+ if (url.indexOf('&') !== -1) {
|
|
|
+ url = url.replace(/&/g, '&');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 提取查询参数部分(去除可能的 hash 部分)
|
|
|
let queryString = url.split('?')[1];
|
|
|
// 如果包含 #,只取 # 之前的部分
|
|
|
if (queryString.indexOf('#') !== -1) {
|