qsh-webview-sdk 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ht = Object.defineProperty, zt = Object.defineProperties;
|
|
2
|
+
var Yt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var Je = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var Te = (t, e, r) => e in t ?
|
|
4
|
+
var Xt = Object.prototype.hasOwnProperty, Zt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Te = (t, e, r) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, g = (t, e) => {
|
|
6
6
|
for (var r in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
Xt.call(e, r) && Te(t, r, e[r]);
|
|
8
8
|
if (Je)
|
|
9
9
|
for (var r of Je(e))
|
|
10
|
-
|
|
10
|
+
Zt.call(e, r) && Te(t, r, e[r]);
|
|
11
11
|
return t;
|
|
12
|
-
}, m = (t, e) =>
|
|
12
|
+
}, m = (t, e) => zt(t, Yt(e));
|
|
13
13
|
var B = (t, e, r) => Te(t, typeof e != "symbol" ? e + "" : e, r);
|
|
14
14
|
var I = (t, e, r) => new Promise((n, i) => {
|
|
15
15
|
var s = (u) => {
|
|
@@ -75,7 +75,7 @@ function Z() {
|
|
|
75
75
|
}
|
|
76
76
|
return !1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Qt() {
|
|
79
79
|
return Se() ? "uvue" : Re() ? "nvue" : C() ? "weixin" : Z() ? "offline" : Me() ? "plus" : tt() ? "webview" : Oe() ? "UniApp" : "h5";
|
|
80
80
|
}
|
|
81
81
|
let Ee = null;
|
|
@@ -89,7 +89,7 @@ function H(t = !1) {
|
|
|
89
89
|
isHtml5Plus: Ue(),
|
|
90
90
|
isUniAppWebView: tt(),
|
|
91
91
|
isOfflineWebview: Z(),
|
|
92
|
-
type:
|
|
92
|
+
type: Qt()
|
|
93
93
|
}), Ee;
|
|
94
94
|
}
|
|
95
95
|
const f = H(), T = {
|
|
@@ -290,7 +290,7 @@ const x = {
|
|
|
290
290
|
READY: "ready",
|
|
291
291
|
ERROR: "error"
|
|
292
292
|
};
|
|
293
|
-
class
|
|
293
|
+
class er {
|
|
294
294
|
constructor() {
|
|
295
295
|
this.state = x.UNINITIALIZED, this.readyPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.initializationError = null, this.handleBridgeReady = this.handleBridgeReady.bind(this), this.handleInitializationError = this.handleInitializationError.bind(this);
|
|
296
296
|
}
|
|
@@ -423,7 +423,7 @@ class tr {
|
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
const Y = new
|
|
426
|
+
const Y = new er(), rt = () => Y.waitForReady(), tr = () => Y.isReady(), rr = () => Y.getState(), P = {
|
|
427
427
|
ERROR: 0,
|
|
428
428
|
WARN: 1,
|
|
429
429
|
INFO: 2,
|
|
@@ -668,7 +668,7 @@ if (typeof window != "undefined") {
|
|
|
668
668
|
(t || e || r) && L.enableDevMode();
|
|
669
669
|
}
|
|
670
670
|
const A = L.createModuleLogger("Bridge"), E = L.createModuleLogger("Platform"), a = L.createModuleLogger("API"), D = L.createModuleLogger("State"), Ae = /complete|loaded|interactive/;
|
|
671
|
-
function
|
|
671
|
+
function nr(t) {
|
|
672
672
|
if (!Z()) return !1;
|
|
673
673
|
A.debug("检测到离线包环境,开始初始化");
|
|
674
674
|
const e = () => {
|
|
@@ -686,16 +686,16 @@ function ir(t) {
|
|
|
686
686
|
}
|
|
687
687
|
return !0;
|
|
688
688
|
}
|
|
689
|
-
function
|
|
689
|
+
function ir(t) {
|
|
690
690
|
return Oe() || Ue() ? (A.debug("检测到 APP 环境,开始初始化"), window.__uniapp_x_postMessage || window.__uniapp_x_ || window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? (A.debug("NVUE/UVUE 环境,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)) : window.plus && Ae.test(document.readyState) ? (A.debug("Plus 环境已就绪,立即初始化"), setTimeout(t, 0)) : window.plus ? (A.debug("Plus 环境,等待 plusready 事件"), document.addEventListener("plusready", t)) : Ae.test(document.readyState) ? setTimeout(t, 0) : document.addEventListener("DOMContentLoaded", t, { once: !0 }), !0) : !1;
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function ar(t) {
|
|
693
693
|
return window.wx && window.wx.miniProgram ? (A.debug("检测到微信小程序环境,开始初始化"), window.WeixinJSBridge && window.WeixinJSBridge.invoke ? (A.debug("微信 JSBridge 已就绪,立即初始化"), setTimeout(t, 0)) : (A.debug("微信 JSBridge 未就绪,等待 WeixinJSBridgeReady 事件"), document.addEventListener("WeixinJSBridgeReady", t)), !0) : !1;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
return A.info("开始初始化 JSBridge"),
|
|
695
|
+
function sr(t) {
|
|
696
|
+
return A.info("开始初始化 JSBridge"), nr(t) ? (A.info("使用离线包环境初始化"), !0) : ir(t) ? (A.info("使用 APP 环境初始化"), !0) : ar(t) ? (A.info("使用微信小程序环境初始化"), !0) : (A.debug("使用默认 H5 环境初始化"), Ae.test(document.readyState) ? (A.debug("DOM 已就绪,立即初始化"), setTimeout(t, 0)) : (A.debug("DOM 未就绪,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)), !0);
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function or() {
|
|
699
699
|
return Y.waitForReady();
|
|
700
700
|
}
|
|
701
701
|
function nt() {
|
|
@@ -710,7 +710,7 @@ function nt() {
|
|
|
710
710
|
e(s);
|
|
711
711
|
};
|
|
712
712
|
try {
|
|
713
|
-
|
|
713
|
+
sr(() => {
|
|
714
714
|
r();
|
|
715
715
|
});
|
|
716
716
|
} catch (i) {
|
|
@@ -728,7 +728,7 @@ const b = {
|
|
|
728
728
|
function K() {
|
|
729
729
|
return typeof window == "undefined" || !window.wx ? !1 : typeof window.wx.config == "function" && typeof window.wx.ready == "function" && typeof window.wx.error == "function";
|
|
730
730
|
}
|
|
731
|
-
class
|
|
731
|
+
class cr {
|
|
732
732
|
constructor() {
|
|
733
733
|
this.state = b.UNINITIALIZED, this.configPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.lastError = null, this.configVersion = 0, this.configuredConfigKey = null, this.runtimeConfig = {
|
|
734
734
|
clientId: null,
|
|
@@ -1105,9 +1105,9 @@ class ur {
|
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
const v = new
|
|
1108
|
+
const v = new cr();
|
|
1109
1109
|
let re = !1, ge = !1, U = null, Pe = !1;
|
|
1110
|
-
function
|
|
1110
|
+
function ur(t) {
|
|
1111
1111
|
return new Promise((e) => {
|
|
1112
1112
|
let r = !1, n = null;
|
|
1113
1113
|
const i = (l) => I(null, null, function* () {
|
|
@@ -1135,10 +1135,10 @@ function We() {
|
|
|
1135
1135
|
const { force: e = !1, recoverFromError: r = !1 } = t;
|
|
1136
1136
|
if (yield at({ force: e }), !K())
|
|
1137
1137
|
throw new Error("微信 JS-SDK 未正确加载,无法执行配置");
|
|
1138
|
-
r &&
|
|
1138
|
+
r && fr();
|
|
1139
1139
|
});
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function lr(t = !1) {
|
|
1142
1142
|
if (typeof window == "undefined") return !1;
|
|
1143
1143
|
if (K())
|
|
1144
1144
|
return ge = !0, !1;
|
|
@@ -1147,7 +1147,7 @@ function fr(t = !1) {
|
|
|
1147
1147
|
const e = navigator.userAgent || "", r = /micromessenger/i.test(e), n = /miniProgram/i.test(e), i = typeof window.__wxjs_environment != "undefined" && window.__wxjs_environment === "miniprogram", s = !!(window.wx && window.wx.miniProgram);
|
|
1148
1148
|
return r && (n || i || s);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function fr() {
|
|
1151
1151
|
v.getState() === "error" && (v.reset(), Pe = !1);
|
|
1152
1152
|
}
|
|
1153
1153
|
function it() {
|
|
@@ -1169,9 +1169,9 @@ function at(t = {}) {
|
|
|
1169
1169
|
if (K())
|
|
1170
1170
|
return ge = !0, Promise.resolve();
|
|
1171
1171
|
const r = document.getElementById("weixin-jssdk");
|
|
1172
|
-
return r ? U || (re = !0, U =
|
|
1172
|
+
return r ? U || (re = !0, U = ur(r).finally(() => {
|
|
1173
1173
|
U = null;
|
|
1174
|
-
}), U) :
|
|
1174
|
+
}), U) : lr(e) ? U || (U = new Promise((n) => {
|
|
1175
1175
|
re = !0;
|
|
1176
1176
|
try {
|
|
1177
1177
|
const i = document.createElement("script");
|
|
@@ -1216,18 +1216,18 @@ function He(t = {}) {
|
|
|
1216
1216
|
function oe() {
|
|
1217
1217
|
return v.isReady();
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function dr() {
|
|
1220
1220
|
return v.getState();
|
|
1221
1221
|
}
|
|
1222
1222
|
function ve() {
|
|
1223
1223
|
return v;
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function gr() {
|
|
1226
1226
|
return I(this, null, function* () {
|
|
1227
1227
|
return E.info("手动重试微信配置"), v.reset(), Pe = !1, yield We({ force: !0 }), v.waitForReady();
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
class
|
|
1230
|
+
class hr {
|
|
1231
1231
|
constructor() {
|
|
1232
1232
|
this.plugins = /* @__PURE__ */ new Map(), this.installed = /* @__PURE__ */ new Set(), this.installOrder = [], a.debug("插件管理器已初始化");
|
|
1233
1233
|
}
|
|
@@ -1420,8 +1420,8 @@ class pr {
|
|
|
1420
1420
|
this.plugins.clear(), this.installed.clear(), this.installOrder = [];
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
|
-
const fe = new
|
|
1424
|
-
class
|
|
1423
|
+
const fe = new hr();
|
|
1424
|
+
class pr {
|
|
1425
1425
|
constructor() {
|
|
1426
1426
|
this.requestInterceptors = [], this.responseInterceptors = [], a.debug("拦截器链已初始化");
|
|
1427
1427
|
}
|
|
@@ -1535,7 +1535,7 @@ class mr {
|
|
|
1535
1535
|
};
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
|
-
const z = new
|
|
1538
|
+
const z = new pr(), mr = {
|
|
1539
1539
|
/**
|
|
1540
1540
|
* 请求日志
|
|
1541
1541
|
*/
|
|
@@ -1590,7 +1590,7 @@ const z = new mr(), wr = {
|
|
|
1590
1590
|
q.metrics.clear();
|
|
1591
1591
|
}
|
|
1592
1592
|
};
|
|
1593
|
-
function
|
|
1593
|
+
function wr(t = {}) {
|
|
1594
1594
|
const {
|
|
1595
1595
|
maxRetries: e = 3,
|
|
1596
1596
|
retryDelay: r = 1e3,
|
|
@@ -1602,7 +1602,7 @@ function Er(t = {}) {
|
|
|
1602
1602
|
})
|
|
1603
1603
|
};
|
|
1604
1604
|
}
|
|
1605
|
-
function
|
|
1605
|
+
function Er(t = {}) {
|
|
1606
1606
|
return {
|
|
1607
1607
|
request: (e) => {
|
|
1608
1608
|
const r = t[e.apiName];
|
|
@@ -1614,7 +1614,7 @@ function yr(t = {}) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
};
|
|
1616
1616
|
}
|
|
1617
|
-
class
|
|
1617
|
+
class yr {
|
|
1618
1618
|
constructor() {
|
|
1619
1619
|
this.state = {
|
|
1620
1620
|
// SDK 状态
|
|
@@ -1859,7 +1859,7 @@ class Ir {
|
|
|
1859
1859
|
};
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
|
-
const G = new
|
|
1862
|
+
const G = new yr(), c = {
|
|
1863
1863
|
// SDK 核心错误 (E_SDK_xxx)
|
|
1864
1864
|
SDK_NOT_READY: "E_SDK_001",
|
|
1865
1865
|
SDK_INIT_FAILED: "E_SDK_002",
|
|
@@ -1966,7 +1966,7 @@ const G = new Ir(), c = {
|
|
|
1966
1966
|
// 配置问题
|
|
1967
1967
|
UNKNOWN: "unknown"
|
|
1968
1968
|
// 未知问题
|
|
1969
|
-
},
|
|
1969
|
+
}, Ir = {
|
|
1970
1970
|
// 图片相关
|
|
1971
1971
|
"IMAGE/USER_CANCEL": c.IMAGE_CANCELLED,
|
|
1972
1972
|
"IMAGE/PERMISSION_DENIED": c.IMAGE_NO_PERMISSION,
|
|
@@ -2025,10 +2025,10 @@ const G = new Ir(), c = {
|
|
|
2025
2025
|
function st(t) {
|
|
2026
2026
|
return t ? t.includes("CANCEL") ? W.USER_CANCEL : t.includes("PERM") || t.includes("PERMISSION") ? W.PERMISSION : t.includes("NET") || t.includes("NETWORK") ? W.NETWORK : t.includes("PARAM") ? W.PARAM : t.includes("CONFIG") ? W.CONFIG : t.includes("SDK") || t.includes("PLATFORM") ? W.SYSTEM : W.UNKNOWN : W.UNKNOWN;
|
|
2027
2027
|
}
|
|
2028
|
-
function
|
|
2028
|
+
function Ar(t) {
|
|
2029
2029
|
return t.includes("NET_") || t.includes("TIMEOUT") || t === c.NETWORK_ERROR || t === c.NETWORK_TIMEOUT || t === c.API_TIMEOUT;
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2031
|
+
function Pr(t) {
|
|
2032
2032
|
return t.includes("CANCEL") || st(t) === W.USER_CANCEL;
|
|
2033
2033
|
}
|
|
2034
2034
|
function ne(t) {
|
|
@@ -2042,7 +2042,7 @@ class V extends Error {
|
|
|
2042
2042
|
* @param {Object} options - 选项
|
|
2043
2043
|
*/
|
|
2044
2044
|
constructor(e, r, n = {}) {
|
|
2045
|
-
super(r), this.name = "StandardError", this.code = e, this.message = r || ne(e), this.platform = n.platform || f.type, this.apiName = n.apiName, this.category = n.category || st(e), this.retriable = n.retriable !== void 0 ? n.retriable :
|
|
2045
|
+
super(r), this.name = "StandardError", this.code = e, this.message = r || ne(e), this.platform = n.platform || f.type, this.apiName = n.apiName, this.category = n.category || st(e), this.retriable = n.retriable !== void 0 ? n.retriable : Ar(e), this.originalError = n.originalError, this.details = n.details || {}, this.timestamp = Date.now();
|
|
2046
2046
|
}
|
|
2047
2047
|
/**
|
|
2048
2048
|
* 是否可重试
|
|
@@ -2056,7 +2056,7 @@ class V extends Error {
|
|
|
2056
2056
|
* @returns {boolean}
|
|
2057
2057
|
*/
|
|
2058
2058
|
isUserAction() {
|
|
2059
|
-
return
|
|
2059
|
+
return Pr(this.code);
|
|
2060
2060
|
}
|
|
2061
2061
|
/**
|
|
2062
2062
|
* 转为普通对象
|
|
@@ -2081,7 +2081,7 @@ function ot(t, e = {}) {
|
|
|
2081
2081
|
if (t instanceof V)
|
|
2082
2082
|
return t;
|
|
2083
2083
|
const { apiName: r, platform: n = f.type } = e;
|
|
2084
|
-
return t && typeof t.code == "string" && t.code.includes("/") ?
|
|
2084
|
+
return t && typeof t.code == "string" && t.code.includes("/") ? Cr(t, { apiName: r, platform: n }) : t && (t.errMsg || t.message) ? _r(t, { apiName: r, platform: n }) : typeof t == "string" ? new V(
|
|
2085
2085
|
c.UNKNOWN_ERROR,
|
|
2086
2086
|
t,
|
|
2087
2087
|
{ apiName: r, platform: n, originalError: t }
|
|
@@ -2096,8 +2096,8 @@ function ot(t, e = {}) {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
);
|
|
2098
2098
|
}
|
|
2099
|
-
function
|
|
2100
|
-
const { apiName: r, platform: n } = e, i = t.code, s =
|
|
2099
|
+
function Cr(t, e) {
|
|
2100
|
+
const { apiName: r, platform: n } = e, i = t.code, s = Ir[i] || c.UNKNOWN_ERROR;
|
|
2101
2101
|
return a.debug("转换旧版错误码", {
|
|
2102
2102
|
legacy: i,
|
|
2103
2103
|
new: s
|
|
@@ -2115,7 +2115,7 @@ function _r(t, e) {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
);
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2118
|
+
function _r(t, e) {
|
|
2119
2119
|
const { apiName: r, platform: n } = e, i = (t.errMsg || t.message || "").toLowerCase();
|
|
2120
2120
|
if (r && Ye[r]) {
|
|
2121
2121
|
const l = Ye[r];
|
|
@@ -2168,25 +2168,25 @@ const ct = {
|
|
|
2168
2168
|
return t;
|
|
2169
2169
|
}
|
|
2170
2170
|
};
|
|
2171
|
-
function
|
|
2171
|
+
function Mr(t, e = {}) {
|
|
2172
2172
|
return new V(t, ne(t), e);
|
|
2173
2173
|
}
|
|
2174
|
-
function
|
|
2174
|
+
function Rr(t) {
|
|
2175
2175
|
return t instanceof V;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function Sr(t, e, r) {
|
|
2178
2178
|
return e ? Promise.race([
|
|
2179
2179
|
t(),
|
|
2180
2180
|
new Promise((n, i) => setTimeout(() => i(new Error(`Init task timeout: ${r}`)), e))
|
|
2181
2181
|
]) : t();
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2183
|
+
function Or() {
|
|
2184
2184
|
return I(this, arguments, function* (t = [], e = {}) {
|
|
2185
2185
|
for (const r of t) {
|
|
2186
2186
|
const n = (r == null ? void 0 : r.name) || "anonymous-task", i = (r == null ? void 0 : r.run) || r;
|
|
2187
2187
|
if (typeof i == "function")
|
|
2188
2188
|
try {
|
|
2189
|
-
yield
|
|
2189
|
+
yield Sr(() => Promise.resolve().then(() => i()), r.timeoutMs, n), typeof r.onSuccess == "function" && r.onSuccess();
|
|
2190
2190
|
} catch (s) {
|
|
2191
2191
|
if (typeof r.onError == "function" && r.onError(s), typeof e.onError == "function")
|
|
2192
2192
|
e.onError(s, r);
|
|
@@ -2323,7 +2323,7 @@ class ut {
|
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
let de = [];
|
|
2326
|
-
function
|
|
2326
|
+
function Nr() {
|
|
2327
2327
|
if (de.length === 0 && window.plus) {
|
|
2328
2328
|
const t = plus.webview.currentWebview();
|
|
2329
2329
|
if (!t)
|
|
@@ -2333,7 +2333,7 @@ function br() {
|
|
|
2333
2333
|
}
|
|
2334
2334
|
return de;
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2336
|
+
function br(t, e) {
|
|
2337
2337
|
const r = {
|
|
2338
2338
|
options: {
|
|
2339
2339
|
timestamp: +/* @__PURE__ */ new Date()
|
|
@@ -2354,7 +2354,7 @@ function Tr(t, e) {
|
|
|
2354
2354
|
};
|
|
2355
2355
|
window.__uniapp_x_postMessage ? window.__uniapp_x_postMessageToService(n) : window.__uniapp_x_.postMessageToService(JSON.stringify(n));
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function Tr(t, e) {
|
|
2358
2358
|
const r = {
|
|
2359
2359
|
options: {
|
|
2360
2360
|
timestamp: +/* @__PURE__ */ new Date()
|
|
@@ -2375,14 +2375,14 @@ function vr(t, e) {
|
|
|
2375
2375
|
};
|
|
2376
2376
|
window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessageToService(n) : window.__dcloud_weex_.postMessageToService(JSON.stringify(n));
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function vr(t, e) {
|
|
2379
2379
|
const r = {
|
|
2380
2380
|
options: {
|
|
2381
2381
|
timestamp: +/* @__PURE__ */ new Date()
|
|
2382
2382
|
},
|
|
2383
2383
|
name: t,
|
|
2384
2384
|
arg: e
|
|
2385
|
-
}, n =
|
|
2385
|
+
}, n = Nr();
|
|
2386
2386
|
if (plus.webview.getWebviewById("__uniapp__service"))
|
|
2387
2387
|
plus.webview.postMessageToUniNView({
|
|
2388
2388
|
type: "WEB_INVOKE_APPSERVICE",
|
|
@@ -2398,7 +2398,7 @@ function Lr(t, e) {
|
|
|
2398
2398
|
);
|
|
2399
2399
|
}
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2401
|
+
function Lr(t, e) {
|
|
2402
2402
|
const r = {
|
|
2403
2403
|
options: {
|
|
2404
2404
|
timestamp: +/* @__PURE__ */ new Date()
|
|
@@ -2412,10 +2412,10 @@ function xr(t, e) {
|
|
|
2412
2412
|
pageId: ""
|
|
2413
2413
|
}, "*");
|
|
2414
2414
|
}
|
|
2415
|
-
function
|
|
2415
|
+
function xr(t) {
|
|
2416
2416
|
return !!(t && typeof t == "object" && t.type === "qsh_api_call" && typeof t.api == "string" && typeof t.callbackId == "string");
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2418
|
+
function Dr(t, e) {
|
|
2419
2419
|
const r = {
|
|
2420
2420
|
options: {
|
|
2421
2421
|
timestamp: +/* @__PURE__ */ new Date()
|
|
@@ -2423,7 +2423,7 @@ function Ur(t, e) {
|
|
|
2423
2423
|
name: t,
|
|
2424
2424
|
arg: e
|
|
2425
2425
|
};
|
|
2426
|
-
if (t === "postMessage" &&
|
|
2426
|
+
if (t === "postMessage" && xr(e))
|
|
2427
2427
|
return window.__offline_bridge_postMessage(e);
|
|
2428
2428
|
window.__offline_bridge_postMessage({
|
|
2429
2429
|
type: "WEB_INVOKE_APPSERVICE",
|
|
@@ -2432,7 +2432,7 @@ function Ur(t, e) {
|
|
|
2432
2432
|
});
|
|
2433
2433
|
}
|
|
2434
2434
|
function he(t, e) {
|
|
2435
|
-
Se() ?
|
|
2435
|
+
Se() ? br(t, e) : Re() ? Tr(t, e) : Z() ? Dr(t, e) : Me() ? vr(t, e) : Lr(t, e);
|
|
2436
2436
|
}
|
|
2437
2437
|
class lt extends ut {
|
|
2438
2438
|
constructor() {
|
|
@@ -2509,17 +2509,17 @@ class lt extends ut {
|
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
2511
|
}
|
|
2512
|
-
const ee = new lt(),
|
|
2512
|
+
const ee = new lt(), Ur = (t) => ee.navigateTo(t), Wr = (t) => ee.navigateBack(t), $r = (t) => ee.switchTab(t), Fr = (t) => ee.reLaunch(t), kr = (t) => ee.redirectTo(t), Br = (t) => ee.postMessage(t), Gr = (t) => ee.getEnv(t);
|
|
2513
2513
|
var ft = /* @__PURE__ */ Object.freeze({
|
|
2514
2514
|
__proto__: null,
|
|
2515
2515
|
WeixinPlatform: lt,
|
|
2516
|
-
getEnv:
|
|
2517
|
-
navigateBack:
|
|
2518
|
-
navigateTo:
|
|
2519
|
-
postMessage:
|
|
2520
|
-
reLaunch:
|
|
2521
|
-
redirectTo:
|
|
2522
|
-
switchTab:
|
|
2516
|
+
getEnv: Gr,
|
|
2517
|
+
navigateBack: Wr,
|
|
2518
|
+
navigateTo: Ur,
|
|
2519
|
+
postMessage: Br,
|
|
2520
|
+
reLaunch: Fr,
|
|
2521
|
+
redirectTo: kr,
|
|
2522
|
+
switchTab: $r
|
|
2523
2523
|
});
|
|
2524
2524
|
class dt extends ut {
|
|
2525
2525
|
constructor() {
|
|
@@ -2575,52 +2575,52 @@ class dt extends ut {
|
|
|
2575
2575
|
});
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
|
-
const te = new dt(),
|
|
2578
|
+
const te = new dt(), Kr = (t) => te.navigateTo(t), Vr = (t) => te.navigateBack(t), qr = (t) => te.switchTab(t), jr = (t) => te.reLaunch(t), Jr = (t) => te.redirectTo(t), Hr = (t) => te.postMessage(t), zr = (t) => te.getEnv(t);
|
|
2579
2579
|
var gt = /* @__PURE__ */ Object.freeze({
|
|
2580
2580
|
__proto__: null,
|
|
2581
2581
|
AppPlatform: dt,
|
|
2582
|
-
getEnv:
|
|
2583
|
-
navigateBack:
|
|
2584
|
-
navigateTo:
|
|
2585
|
-
postMessage:
|
|
2586
|
-
reLaunch:
|
|
2587
|
-
redirectTo:
|
|
2588
|
-
switchTab:
|
|
2582
|
+
getEnv: zr,
|
|
2583
|
+
navigateBack: Vr,
|
|
2584
|
+
navigateTo: Kr,
|
|
2585
|
+
postMessage: Hr,
|
|
2586
|
+
reLaunch: jr,
|
|
2587
|
+
redirectTo: Jr,
|
|
2588
|
+
switchTab: qr
|
|
2589
2589
|
});
|
|
2590
2590
|
function me() {
|
|
2591
2591
|
return C() ? ft : gt;
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2593
|
+
function Yr(t) {
|
|
2594
2594
|
return me().navigateTo(t);
|
|
2595
2595
|
}
|
|
2596
|
-
function
|
|
2596
|
+
function Xr(t) {
|
|
2597
2597
|
return me().navigateBack(t);
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2599
|
+
function Zr(t) {
|
|
2600
2600
|
return me().switchTab(t);
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2602
|
+
function Qr(t) {
|
|
2603
2603
|
return me().reLaunch(t);
|
|
2604
2604
|
}
|
|
2605
|
-
function
|
|
2605
|
+
function en(t) {
|
|
2606
2606
|
return me().redirectTo(t);
|
|
2607
2607
|
}
|
|
2608
2608
|
function ht() {
|
|
2609
2609
|
return C() ? ft : gt;
|
|
2610
2610
|
}
|
|
2611
|
-
function
|
|
2611
|
+
function tn(t = {}) {
|
|
2612
2612
|
return ht().postMessage(t);
|
|
2613
2613
|
}
|
|
2614
|
-
function
|
|
2614
|
+
function rn(t) {
|
|
2615
2615
|
return ht().getEnv(t);
|
|
2616
2616
|
}
|
|
2617
|
-
function
|
|
2617
|
+
function nn(t) {
|
|
2618
2618
|
return t && typeof t == "object" && t.__v_raw ? t.__v_raw : t;
|
|
2619
2619
|
}
|
|
2620
|
-
function
|
|
2620
|
+
function an() {
|
|
2621
2621
|
return "qsh_callback_" + Date.now() + "_" + Math.random().toString(36).substring(2, 9);
|
|
2622
2622
|
}
|
|
2623
|
-
class
|
|
2623
|
+
class sn {
|
|
2624
2624
|
constructor() {
|
|
2625
2625
|
this.callbacks = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.persistentCallbacksByApi = /* @__PURE__ */ new Map(), this.defaultTimeout = 3e4, typeof window != "undefined" && (window.qshWebviewCallbacks || (window.qshWebviewCallbacks = {})), A.debug("WebView 桥接器已初始化");
|
|
2626
2626
|
}
|
|
@@ -2660,7 +2660,7 @@ class on {
|
|
|
2660
2660
|
}), n.complete && n.complete({ success: !1 });
|
|
2661
2661
|
return;
|
|
2662
2662
|
}
|
|
2663
|
-
const u =
|
|
2663
|
+
const u = an();
|
|
2664
2664
|
if (n.success || n.fail || n.complete) {
|
|
2665
2665
|
if (this.callbacks.set(u, m(g({}, n), {
|
|
2666
2666
|
context: l
|
|
@@ -2694,7 +2694,7 @@ class on {
|
|
|
2694
2694
|
callbackId: u,
|
|
2695
2695
|
hasSuccess: !!n.success,
|
|
2696
2696
|
hasFail: !!n.fail
|
|
2697
|
-
}), console.log("message:", JSON.stringify(
|
|
2697
|
+
}), console.log("message:", JSON.stringify(nn(_), null, 2)), he("postMessage", _);
|
|
2698
2698
|
}
|
|
2699
2699
|
}), {
|
|
2700
2700
|
context: "WebViewBridge.callApi",
|
|
@@ -2773,14 +2773,14 @@ class on {
|
|
|
2773
2773
|
};
|
|
2774
2774
|
}
|
|
2775
2775
|
}
|
|
2776
|
-
const pt = new
|
|
2776
|
+
const pt = new sn(), O = (t, e, r) => pt.callApi(t, e, r), ie = (t) => pt.cleanupPersistentCallbacksByApi(t);
|
|
2777
2777
|
function mt() {
|
|
2778
2778
|
return H(!0);
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2780
|
+
function on(t) {
|
|
2781
2781
|
return t === "offline";
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function cn(t = {}) {
|
|
2784
2784
|
return d.safeExecute(() => {
|
|
2785
2785
|
a.debug("Call getCode through offline webview bridge", {
|
|
2786
2786
|
clientId: t.clientId
|
|
@@ -2806,7 +2806,7 @@ function un(t = {}) {
|
|
|
2806
2806
|
platform: mt().type
|
|
2807
2807
|
});
|
|
2808
2808
|
}
|
|
2809
|
-
function
|
|
2809
|
+
function un(t = {}) {
|
|
2810
2810
|
return d.safeExecute(() => {
|
|
2811
2811
|
var n, i;
|
|
2812
2812
|
const e = mt(), r = String((t == null ? void 0 : t.clientId) || "").trim();
|
|
@@ -2818,7 +2818,7 @@ function ln(t = {}) {
|
|
|
2818
2818
|
a.error("Get code missing clientId"), (n = t.fail) == null || n.call(t, s);
|
|
2819
2819
|
return;
|
|
2820
2820
|
}
|
|
2821
|
-
if (!
|
|
2821
|
+
if (!on(e.type)) {
|
|
2822
2822
|
const s = {
|
|
2823
2823
|
errMsg: `Current environment (${e.type}) does not support getCode`,
|
|
2824
2824
|
code: "PLATFORM_NOT_SUPPORTED"
|
|
@@ -2828,7 +2828,7 @@ function ln(t = {}) {
|
|
|
2828
2828
|
}), (i = t.fail) == null || i.call(t, s);
|
|
2829
2829
|
return;
|
|
2830
2830
|
}
|
|
2831
|
-
|
|
2831
|
+
cn(m(g({}, t), {
|
|
2832
2832
|
clientId: r
|
|
2833
2833
|
}));
|
|
2834
2834
|
}, {
|
|
@@ -2840,7 +2840,7 @@ function wt() {
|
|
|
2840
2840
|
return H(!0);
|
|
2841
2841
|
}
|
|
2842
2842
|
const Xe = ["release", "trial", "develop"];
|
|
2843
|
-
function
|
|
2843
|
+
function ln(t = {}) {
|
|
2844
2844
|
const e = String((t == null ? void 0 : t.appid) || "").trim(), r = (t == null ? void 0 : t.path) == null ? "" : t.path, n = t == null ? void 0 : t.env, i = n == null || n === "" ? void 0 : String(n).trim();
|
|
2845
2845
|
if (!e)
|
|
2846
2846
|
throw {
|
|
@@ -2863,13 +2863,13 @@ function fn(t = {}) {
|
|
|
2863
2863
|
env: i
|
|
2864
2864
|
});
|
|
2865
2865
|
}
|
|
2866
|
-
function
|
|
2866
|
+
function fn() {
|
|
2867
2867
|
return typeof window != "undefined" && window.wx && window.wx.miniProgram && typeof window.wx.miniProgram.postMessage == "function" && typeof window.wx.miniProgram.navigateBack == "function";
|
|
2868
2868
|
}
|
|
2869
|
-
function
|
|
2869
|
+
function dn(t = {}) {
|
|
2870
2870
|
return d.safeExecute(() => {
|
|
2871
2871
|
var r;
|
|
2872
|
-
if (!
|
|
2872
|
+
if (!fn()) {
|
|
2873
2873
|
const n = {
|
|
2874
2874
|
errMsg: "wx.miniProgram.postMessage or wx.miniProgram.navigateBack is not available",
|
|
2875
2875
|
code: "PLATFORM_NOT_SUPPORTED"
|
|
@@ -2924,7 +2924,7 @@ function gn(t = {}) {
|
|
|
2924
2924
|
platform: "weixin"
|
|
2925
2925
|
});
|
|
2926
2926
|
}
|
|
2927
|
-
function
|
|
2927
|
+
function gn(t = {}) {
|
|
2928
2928
|
return d.safeExecute(() => (a.debug("Call navigateToMiniProgram through webview bridge", {
|
|
2929
2929
|
appid: t.appid,
|
|
2930
2930
|
path: t.path,
|
|
@@ -2954,13 +2954,13 @@ function hn(t = {}) {
|
|
|
2954
2954
|
platform: wt().type
|
|
2955
2955
|
});
|
|
2956
2956
|
}
|
|
2957
|
-
function
|
|
2957
|
+
function hn(t = {}) {
|
|
2958
2958
|
return d.safeExecute(() => {
|
|
2959
2959
|
var n;
|
|
2960
2960
|
const e = wt();
|
|
2961
2961
|
let r;
|
|
2962
2962
|
try {
|
|
2963
|
-
r =
|
|
2963
|
+
r = ln(t);
|
|
2964
2964
|
} catch (i) {
|
|
2965
2965
|
a.error("Navigate to mini program params validation failed", i), (n = t.fail) == null || n.call(t, i);
|
|
2966
2966
|
return;
|
|
@@ -2970,31 +2970,31 @@ function pn(t = {}) {
|
|
|
2970
2970
|
appid: r.appid,
|
|
2971
2971
|
path: r.path,
|
|
2972
2972
|
env: r.env
|
|
2973
|
-
}), e.isWeixinMiniProgram ?
|
|
2973
|
+
}), e.isWeixinMiniProgram ? dn(r) : gn(r);
|
|
2974
2974
|
}, {
|
|
2975
2975
|
context: "navigateToMiniProgram",
|
|
2976
2976
|
options: t
|
|
2977
2977
|
});
|
|
2978
2978
|
}
|
|
2979
|
-
function
|
|
2979
|
+
function pn(t = "") {
|
|
2980
2980
|
return /^https?:\/\//i.test(String(t || "").trim());
|
|
2981
2981
|
}
|
|
2982
|
-
function
|
|
2982
|
+
function mn(t) {
|
|
2983
2983
|
if (t == null || t === "") return !1;
|
|
2984
2984
|
if (typeof t == "boolean") return t;
|
|
2985
2985
|
const e = String(t).trim().toLowerCase();
|
|
2986
2986
|
return e === "true" || e === "1";
|
|
2987
2987
|
}
|
|
2988
|
-
function
|
|
2988
|
+
function wn() {
|
|
2989
2989
|
return typeof window != "undefined" && window.wx && window.wx.miniProgram && typeof window.wx.miniProgram.postMessage == "function" && typeof window.wx.miniProgram.navigateBack == "function";
|
|
2990
2990
|
}
|
|
2991
|
-
function
|
|
2991
|
+
function En(t = {}) {
|
|
2992
2992
|
if (!t || typeof t != "object")
|
|
2993
2993
|
throw {
|
|
2994
2994
|
errMsg: "manualShare options must be an object",
|
|
2995
2995
|
code: "PARAM_TYPE_ERROR"
|
|
2996
2996
|
};
|
|
2997
|
-
const e = String(t.title || "").trim(), r = String(t.h5Url || "").trim(), n = String(t.clientId || "").trim(), i =
|
|
2997
|
+
const e = String(t.title || "").trim(), r = String(t.h5Url || "").trim(), n = String(t.clientId || "").trim(), i = mn(t.isPublic), s = String(t.imageUrl || "").trim(), o = String(t.description || t.desc || "").trim();
|
|
2998
2998
|
if (!e)
|
|
2999
2999
|
throw {
|
|
3000
3000
|
errMsg: "manualShare: title is required",
|
|
@@ -3010,7 +3010,7 @@ function yn(t = {}) {
|
|
|
3010
3010
|
errMsg: "manualShare: clientId is required",
|
|
3011
3011
|
code: "PARAM_MISSING"
|
|
3012
3012
|
};
|
|
3013
|
-
if (r && !
|
|
3013
|
+
if (r && !pn(r))
|
|
3014
3014
|
throw {
|
|
3015
3015
|
errMsg: "manualShare: h5Url must be a valid http(s) url",
|
|
3016
3016
|
code: "PARAM_INVALID"
|
|
@@ -3027,7 +3027,7 @@ function yn(t = {}) {
|
|
|
3027
3027
|
complete: t.complete
|
|
3028
3028
|
};
|
|
3029
3029
|
}
|
|
3030
|
-
function
|
|
3030
|
+
function yn(t) {
|
|
3031
3031
|
return {
|
|
3032
3032
|
type: "qsh_api_call",
|
|
3033
3033
|
api: "manualShare",
|
|
@@ -3042,9 +3042,9 @@ function In(t) {
|
|
|
3042
3042
|
timestamp: Date.now()
|
|
3043
3043
|
};
|
|
3044
3044
|
}
|
|
3045
|
-
function
|
|
3045
|
+
function In(t) {
|
|
3046
3046
|
return new Promise((e, r) => {
|
|
3047
|
-
const n =
|
|
3047
|
+
const n = yn(t);
|
|
3048
3048
|
a.debug(
|
|
3049
3049
|
"Relay manualShare through wx.miniProgram.postMessage",
|
|
3050
3050
|
n
|
|
@@ -3084,7 +3084,7 @@ function Et(t = {}) {
|
|
|
3084
3084
|
const e = H(!0);
|
|
3085
3085
|
let r;
|
|
3086
3086
|
try {
|
|
3087
|
-
r =
|
|
3087
|
+
r = En(t);
|
|
3088
3088
|
} catch (p) {
|
|
3089
3089
|
return (n = t.fail) == null || n.call(t, p), (i = t.complete) == null || i.call(t, p), Promise.reject(p);
|
|
3090
3090
|
}
|
|
@@ -3095,14 +3095,14 @@ function Et(t = {}) {
|
|
|
3095
3095
|
};
|
|
3096
3096
|
return (s = r.fail) == null || s.call(r, p), (o = r.complete) == null || o.call(r, p), Promise.reject(p);
|
|
3097
3097
|
}
|
|
3098
|
-
if (!
|
|
3098
|
+
if (!wn()) {
|
|
3099
3099
|
const p = {
|
|
3100
3100
|
errMsg: "wx.miniProgram.postMessage or wx.miniProgram.navigateBack is not available",
|
|
3101
3101
|
code: "PLATFORM_NOT_SUPPORTED"
|
|
3102
3102
|
};
|
|
3103
3103
|
return (l = r.fail) == null || l.call(r, p), (u = r.complete) == null || u.call(r, p), Promise.reject(p);
|
|
3104
3104
|
}
|
|
3105
|
-
return
|
|
3105
|
+
return In(r).then((p) => {
|
|
3106
3106
|
var M, _;
|
|
3107
3107
|
return (M = r.success) == null || M.call(r, p), (_ = r.complete) == null || _.call(r, p), p;
|
|
3108
3108
|
}).catch((p) => {
|
|
@@ -3116,7 +3116,7 @@ function Et(t = {}) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
);
|
|
3118
3118
|
}
|
|
3119
|
-
function
|
|
3119
|
+
function An(t = {}) {
|
|
3120
3120
|
return new Promise((e, r) => {
|
|
3121
3121
|
Et(m(g({}, t), {
|
|
3122
3122
|
success: e,
|
|
@@ -3134,13 +3134,13 @@ const Ce = {
|
|
|
3134
3134
|
// 原图
|
|
3135
3135
|
COMPRESSED: "compressed"
|
|
3136
3136
|
// 压缩图
|
|
3137
|
-
},
|
|
3137
|
+
}, Pn = {
|
|
3138
3138
|
count: 9,
|
|
3139
3139
|
sizeType: [_e.ORIGINAL, _e.COMPRESSED],
|
|
3140
3140
|
sourceType: [Ce.ALBUM, Ce.CAMERA]
|
|
3141
3141
|
};
|
|
3142
|
-
function
|
|
3143
|
-
const e = g(g({},
|
|
3142
|
+
function Cn(t = {}) {
|
|
3143
|
+
const e = g(g({}, Pn), t);
|
|
3144
3144
|
return Array.isArray(e.sizeType) || (e.sizeType = [e.sizeType].filter(Boolean)), Array.isArray(e.sourceType) || (e.sourceType = [e.sourceType].filter(Boolean)), e.count = Math.max(1, Math.min(9, parseInt(e.count) || 1)), e.sizeType.length === 0 && (e.sizeType = [_e.COMPRESSED]), e.sourceType.length === 0 && (e.sourceType = [Ce.ALBUM]), e;
|
|
3145
3145
|
}
|
|
3146
3146
|
function yt() {
|
|
@@ -3183,7 +3183,7 @@ function It(t) {
|
|
|
3183
3183
|
platform: "weixin"
|
|
3184
3184
|
});
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function _n(t) {
|
|
3187
3187
|
return d.safeExecute(() => {
|
|
3188
3188
|
a.debug("通过 WebView 桥接调用图片选择", t), O("chooseImage", m(g({}, t), { disableTimeout: !0 }), {
|
|
3189
3189
|
success: (e) => {
|
|
@@ -3203,7 +3203,7 @@ function Mn(t) {
|
|
|
3203
3203
|
platform: "uniapp"
|
|
3204
3204
|
});
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3206
|
+
function Mn(t = {}) {
|
|
3207
3207
|
return d.safeExecute(() => {
|
|
3208
3208
|
var r;
|
|
3209
3209
|
if (!yt()) {
|
|
@@ -3214,19 +3214,19 @@ function Rn(t = {}) {
|
|
|
3214
3214
|
a.error("平台不支持图片选择", { platform: f.type }), (r = t.fail) == null || r.call(t, n);
|
|
3215
3215
|
return;
|
|
3216
3216
|
}
|
|
3217
|
-
const e =
|
|
3217
|
+
const e = Cn(t);
|
|
3218
3218
|
a.info("开始选择图片", {
|
|
3219
3219
|
platform: f.type,
|
|
3220
3220
|
count: e.count,
|
|
3221
3221
|
sizeType: e.sizeType,
|
|
3222
3222
|
sourceType: e.sourceType
|
|
3223
|
-
}), C() ? It(e) :
|
|
3223
|
+
}), C() ? It(e) : _n(e);
|
|
3224
3224
|
}, {
|
|
3225
3225
|
context: "chooseImage",
|
|
3226
3226
|
options: t
|
|
3227
3227
|
});
|
|
3228
3228
|
}
|
|
3229
|
-
function
|
|
3229
|
+
function Rn() {
|
|
3230
3230
|
return {
|
|
3231
3231
|
supported: yt(),
|
|
3232
3232
|
environment: f.type,
|
|
@@ -3252,14 +3252,14 @@ const X = {
|
|
|
3252
3252
|
// Data Matrix 码
|
|
3253
3253
|
PDF417: "pdf417"
|
|
3254
3254
|
// PDF417 条码
|
|
3255
|
-
},
|
|
3255
|
+
}, Sn = {
|
|
3256
3256
|
onlyFromCamera: !0,
|
|
3257
3257
|
// 只从相机扫码
|
|
3258
3258
|
scanType: [X.QR_CODE, X.BAR_CODE]
|
|
3259
3259
|
// 支持二维码和一维码
|
|
3260
3260
|
};
|
|
3261
|
-
function
|
|
3262
|
-
const e = g(g({},
|
|
3261
|
+
function On(t = {}) {
|
|
3262
|
+
const e = g(g({}, Sn), t);
|
|
3263
3263
|
return Array.isArray(e.scanType) || (e.scanType = [e.scanType].filter(Boolean)), e.scanType.length === 0 && (e.scanType = [X.QR_CODE, X.BAR_CODE]), e.onlyFromCamera = !!e.onlyFromCamera, e;
|
|
3264
3264
|
}
|
|
3265
3265
|
function At() {
|
|
@@ -3293,7 +3293,7 @@ function Pt(t) {
|
|
|
3293
3293
|
const n = {
|
|
3294
3294
|
result: r.resultStr,
|
|
3295
3295
|
// 扫码内容
|
|
3296
|
-
scanType:
|
|
3296
|
+
scanType: Nn(r.resultStr),
|
|
3297
3297
|
// 推测扫码类型
|
|
3298
3298
|
charSet: "utf-8",
|
|
3299
3299
|
// 微信默认 UTF-8
|
|
@@ -3312,10 +3312,10 @@ function Pt(t) {
|
|
|
3312
3312
|
platform: "weixin"
|
|
3313
3313
|
});
|
|
3314
3314
|
}
|
|
3315
|
-
function
|
|
3315
|
+
function Nn(t) {
|
|
3316
3316
|
return t ? t.length > 50 || /[^\d]/.test(t) ? X.QR_CODE : X.BAR_CODE : "unknown";
|
|
3317
3317
|
}
|
|
3318
|
-
function
|
|
3318
|
+
function bn(t) {
|
|
3319
3319
|
return d.safeExecute(() => {
|
|
3320
3320
|
a.debug("通过 WebView 桥接调用扫码", t), O("scanCode", m(g({}, t), { disableTimeout: !0 }), {
|
|
3321
3321
|
success: (e) => {
|
|
@@ -3336,7 +3336,7 @@ function Tn(t) {
|
|
|
3336
3336
|
platform: "uniapp"
|
|
3337
3337
|
});
|
|
3338
3338
|
}
|
|
3339
|
-
function
|
|
3339
|
+
function Tn(t = {}) {
|
|
3340
3340
|
return d.safeExecute(() => {
|
|
3341
3341
|
var r;
|
|
3342
3342
|
if (!At()) {
|
|
@@ -3347,18 +3347,18 @@ function vn(t = {}) {
|
|
|
3347
3347
|
a.error("平台不支持扫码", { platform: f.type }), (r = t.fail) == null || r.call(t, n);
|
|
3348
3348
|
return;
|
|
3349
3349
|
}
|
|
3350
|
-
const e =
|
|
3350
|
+
const e = On(t);
|
|
3351
3351
|
a.info("开始扫码", {
|
|
3352
3352
|
platform: f.type,
|
|
3353
3353
|
onlyFromCamera: e.onlyFromCamera,
|
|
3354
3354
|
scanType: e.scanType
|
|
3355
|
-
}), C() ? Pt(e) :
|
|
3355
|
+
}), C() ? Pt(e) : bn(e);
|
|
3356
3356
|
}, {
|
|
3357
3357
|
context: "scanCode",
|
|
3358
3358
|
options: t
|
|
3359
3359
|
});
|
|
3360
3360
|
}
|
|
3361
|
-
function
|
|
3361
|
+
function vn() {
|
|
3362
3362
|
return {
|
|
3363
3363
|
supported: At(),
|
|
3364
3364
|
environment: f.type,
|
|
@@ -3382,23 +3382,23 @@ const ae = {
|
|
|
3382
3382
|
// 国测局坐标(火星坐标)
|
|
3383
3383
|
BD09: "bd09"
|
|
3384
3384
|
// 百度坐标
|
|
3385
|
-
},
|
|
3385
|
+
}, Ln = {
|
|
3386
3386
|
type: ae.WGS84,
|
|
3387
3387
|
altitude: !1
|
|
3388
|
-
},
|
|
3388
|
+
}, xn = {
|
|
3389
3389
|
scale: 18
|
|
3390
3390
|
// 地图缩放级别 1-28
|
|
3391
3391
|
};
|
|
3392
|
-
function
|
|
3393
|
-
const e = g(g({},
|
|
3392
|
+
function Dn(t = {}) {
|
|
3393
|
+
const e = g(g({}, Ln), t);
|
|
3394
3394
|
return Object.values(ae).includes(e.type) || (e.type = ae.WGS84), e.altitude = !!e.altitude, e;
|
|
3395
3395
|
}
|
|
3396
|
-
function
|
|
3396
|
+
function Un(t = {}) {
|
|
3397
3397
|
const e = g({}, t);
|
|
3398
3398
|
return Object.values(ae).includes(e.type) || (e.type = ae.WGS84), e.needFullAccuracy = !!e.needFullAccuracy, e;
|
|
3399
3399
|
}
|
|
3400
|
-
function
|
|
3401
|
-
const e = g(g({},
|
|
3400
|
+
function Wn(t = {}) {
|
|
3401
|
+
const e = g(g({}, xn), t);
|
|
3402
3402
|
if (e.latitude === void 0 || e.latitude === null)
|
|
3403
3403
|
throw {
|
|
3404
3404
|
errMsg: "缺少必需参数:latitude(纬度)",
|
|
@@ -3538,7 +3538,7 @@ function _t(t) {
|
|
|
3538
3538
|
platform: "weixin"
|
|
3539
3539
|
});
|
|
3540
3540
|
}
|
|
3541
|
-
function
|
|
3541
|
+
function $n(t) {
|
|
3542
3542
|
return d.safeExecute(() => {
|
|
3543
3543
|
a.debug("通过 WebView 桥接调用获取位置", t), O("getLocation", t, {
|
|
3544
3544
|
success: (e) => {
|
|
@@ -3559,7 +3559,7 @@ function Fn(t) {
|
|
|
3559
3559
|
platform: "uniapp"
|
|
3560
3560
|
});
|
|
3561
3561
|
}
|
|
3562
|
-
function
|
|
3562
|
+
function Fn(t) {
|
|
3563
3563
|
return d.safeExecute(() => {
|
|
3564
3564
|
a.debug("通过 WebView 桥接调用查看位置", t), O("openLocation", t, {
|
|
3565
3565
|
success: (e) => {
|
|
@@ -3577,7 +3577,7 @@ function kn(t) {
|
|
|
3577
3577
|
platform: "uniapp"
|
|
3578
3578
|
});
|
|
3579
3579
|
}
|
|
3580
|
-
function
|
|
3580
|
+
function kn(t = {}) {
|
|
3581
3581
|
return d.safeExecute(() => {
|
|
3582
3582
|
var r;
|
|
3583
3583
|
if (!$e()) {
|
|
@@ -3588,18 +3588,18 @@ function Bn(t = {}) {
|
|
|
3588
3588
|
a.error("平台不支持定位", { platform: f.type }), (r = t.fail) == null || r.call(t, n);
|
|
3589
3589
|
return;
|
|
3590
3590
|
}
|
|
3591
|
-
const e =
|
|
3591
|
+
const e = Dn(t);
|
|
3592
3592
|
a.info("开始获取位置", {
|
|
3593
3593
|
platform: f.type,
|
|
3594
3594
|
type: e.type,
|
|
3595
3595
|
altitude: e.altitude
|
|
3596
|
-
}), C() ? Ct(e) :
|
|
3596
|
+
}), C() ? Ct(e) : $n(e);
|
|
3597
3597
|
}, {
|
|
3598
3598
|
context: "getLocation",
|
|
3599
3599
|
options: t
|
|
3600
3600
|
});
|
|
3601
3601
|
}
|
|
3602
|
-
function
|
|
3602
|
+
function Bn(t = {}) {
|
|
3603
3603
|
return d.safeExecute(() => {
|
|
3604
3604
|
var r, n, i;
|
|
3605
3605
|
if (!$e()) {
|
|
@@ -3612,7 +3612,7 @@ function Gn(t = {}) {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
let e;
|
|
3614
3614
|
try {
|
|
3615
|
-
e =
|
|
3615
|
+
e = Wn(t);
|
|
3616
3616
|
} catch (s) {
|
|
3617
3617
|
a.error("参数验证失败", s), (n = t.fail) == null || n.call(t, s), (i = t.complete) == null || i.call(t);
|
|
3618
3618
|
return;
|
|
@@ -3622,13 +3622,13 @@ function Gn(t = {}) {
|
|
|
3622
3622
|
latitude: e.latitude,
|
|
3623
3623
|
longitude: e.longitude,
|
|
3624
3624
|
name: e.name
|
|
3625
|
-
}), C() ? _t(e) :
|
|
3625
|
+
}), C() ? _t(e) : Fn(e);
|
|
3626
3626
|
}, {
|
|
3627
3627
|
context: "openLocation",
|
|
3628
3628
|
options: t
|
|
3629
3629
|
});
|
|
3630
3630
|
}
|
|
3631
|
-
function
|
|
3631
|
+
function Gn() {
|
|
3632
3632
|
const t = C();
|
|
3633
3633
|
return {
|
|
3634
3634
|
supported: $e(),
|
|
@@ -3660,7 +3660,7 @@ function Mt(t, e, r) {
|
|
|
3660
3660
|
a.warn("监听回调不是函数,已跳过", { type: typeof n });
|
|
3661
3661
|
});
|
|
3662
3662
|
}
|
|
3663
|
-
function
|
|
3663
|
+
function Kn(t = {}) {
|
|
3664
3664
|
return d.safeExecute(() => {
|
|
3665
3665
|
var r, n;
|
|
3666
3666
|
if (C()) {
|
|
@@ -3671,7 +3671,7 @@ function Vn(t = {}) {
|
|
|
3671
3671
|
a.error("当前环境不支持此接口", { platform: f.type }), (r = t.fail) == null || r.call(t, i), (n = t.complete) == null || n.call(t, i);
|
|
3672
3672
|
return;
|
|
3673
3673
|
}
|
|
3674
|
-
const e =
|
|
3674
|
+
const e = Un(t);
|
|
3675
3675
|
a.info("正在开启定位监听"), O("startLocationUpdate", {
|
|
3676
3676
|
type: e.type,
|
|
3677
3677
|
needFullAccuracy: e.needFullAccuracy
|
|
@@ -3688,7 +3688,7 @@ function Vn(t = {}) {
|
|
|
3688
3688
|
});
|
|
3689
3689
|
}, { context: "startLocationUpdate" });
|
|
3690
3690
|
}
|
|
3691
|
-
function
|
|
3691
|
+
function Vn(t = {}) {
|
|
3692
3692
|
return d.safeExecute(() => {
|
|
3693
3693
|
var e, r;
|
|
3694
3694
|
if (C()) {
|
|
@@ -3712,7 +3712,7 @@ function qn(t = {}) {
|
|
|
3712
3712
|
});
|
|
3713
3713
|
}, { context: "stopLocationUpdate" });
|
|
3714
3714
|
}
|
|
3715
|
-
function
|
|
3715
|
+
function qn(t) {
|
|
3716
3716
|
return d.safeExecute(() => {
|
|
3717
3717
|
if (C()) {
|
|
3718
3718
|
a.warn("当前环境不支持此接口", { platform: f.type });
|
|
@@ -3734,7 +3734,7 @@ function jn(t) {
|
|
|
3734
3734
|
}));
|
|
3735
3735
|
}, { context: "onLocationChange" });
|
|
3736
3736
|
}
|
|
3737
|
-
function
|
|
3737
|
+
function jn(t) {
|
|
3738
3738
|
return d.safeExecute(() => {
|
|
3739
3739
|
if (C()) {
|
|
3740
3740
|
a.warn("当前环境不支持此接口", { platform: f.type });
|
|
@@ -3755,7 +3755,7 @@ function Jn(t) {
|
|
|
3755
3755
|
}));
|
|
3756
3756
|
}, { context: "offLocationChange" });
|
|
3757
3757
|
}
|
|
3758
|
-
function
|
|
3758
|
+
function Jn(t) {
|
|
3759
3759
|
return d.safeExecute(() => {
|
|
3760
3760
|
if (C()) {
|
|
3761
3761
|
a.warn("当前环境不支持此接口", { platform: f.type });
|
|
@@ -3777,7 +3777,7 @@ function Hn(t) {
|
|
|
3777
3777
|
}));
|
|
3778
3778
|
}, { context: "onLocationChangeError" });
|
|
3779
3779
|
}
|
|
3780
|
-
function
|
|
3780
|
+
function Hn(t) {
|
|
3781
3781
|
return d.safeExecute(() => {
|
|
3782
3782
|
if (C()) {
|
|
3783
3783
|
a.warn("当前环境不支持此接口", { platform: f.type });
|
|
@@ -3798,14 +3798,14 @@ function zn(t) {
|
|
|
3798
3798
|
}));
|
|
3799
3799
|
}, { context: "offLocationChangeError" });
|
|
3800
3800
|
}
|
|
3801
|
-
const
|
|
3801
|
+
const zn = {
|
|
3802
3802
|
latitude: null,
|
|
3803
3803
|
// 目标地纬度
|
|
3804
3804
|
longitude: null
|
|
3805
3805
|
// 目标地经度
|
|
3806
3806
|
};
|
|
3807
|
-
function
|
|
3808
|
-
const e = g(g({},
|
|
3807
|
+
function Yn(t = {}) {
|
|
3808
|
+
const e = g(g({}, zn), t);
|
|
3809
3809
|
return e.latitude !== null && e.latitude !== void 0 && (typeof e.latitude != "number" ? (a.warn("latitude 参数类型错误,已忽略", {
|
|
3810
3810
|
latitude: e.latitude
|
|
3811
3811
|
}), e.latitude = null) : (e.latitude < -90 || e.latitude > 90) && (a.warn("latitude 超出范围,已忽略", {
|
|
@@ -3819,7 +3819,7 @@ function Xn(t = {}) {
|
|
|
3819
3819
|
function Rt() {
|
|
3820
3820
|
return ["webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(f.type);
|
|
3821
3821
|
}
|
|
3822
|
-
function
|
|
3822
|
+
function Xn(t) {
|
|
3823
3823
|
return d.safeExecute(() => {
|
|
3824
3824
|
a.debug("通过 WebView 桥接调用位置选择", t);
|
|
3825
3825
|
const e = {
|
|
@@ -3854,7 +3854,7 @@ function Zn(t) {
|
|
|
3854
3854
|
platform: "uniapp"
|
|
3855
3855
|
});
|
|
3856
3856
|
}
|
|
3857
|
-
function
|
|
3857
|
+
function Zn(t = {}) {
|
|
3858
3858
|
return d.safeExecute(() => {
|
|
3859
3859
|
var r;
|
|
3860
3860
|
if (!Rt()) {
|
|
@@ -3865,18 +3865,18 @@ function Qn(t = {}) {
|
|
|
3865
3865
|
a.error("平台不支持位置选择", { platform: f.type }), (r = t.fail) == null || r.call(t, n);
|
|
3866
3866
|
return;
|
|
3867
3867
|
}
|
|
3868
|
-
const e =
|
|
3868
|
+
const e = Yn(t);
|
|
3869
3869
|
a.info("开始选择位置", {
|
|
3870
3870
|
platform: f.type,
|
|
3871
3871
|
latitude: e.latitude,
|
|
3872
3872
|
longitude: e.longitude
|
|
3873
|
-
}), C() ||
|
|
3873
|
+
}), C() || Xn(e);
|
|
3874
3874
|
}, {
|
|
3875
3875
|
context: "chooseLocation",
|
|
3876
3876
|
options: t
|
|
3877
3877
|
});
|
|
3878
3878
|
}
|
|
3879
|
-
function
|
|
3879
|
+
function Qn() {
|
|
3880
3880
|
return {
|
|
3881
3881
|
supported: Rt(),
|
|
3882
3882
|
environment: f.type,
|
|
@@ -3892,7 +3892,7 @@ function ei() {
|
|
|
3892
3892
|
};
|
|
3893
3893
|
}
|
|
3894
3894
|
const St = "https://iafs.xjy2.cn/img/bg.143351f0.jpg";
|
|
3895
|
-
function
|
|
3895
|
+
function ei(t) {
|
|
3896
3896
|
return t === "timeline" || Number(t) === 1 ? 1 : 0;
|
|
3897
3897
|
}
|
|
3898
3898
|
function Ne(t = "", e = "targetPath") {
|
|
@@ -3909,7 +3909,7 @@ function Ot(t = "", e = "webTarget") {
|
|
|
3909
3909
|
throw { errMsg: `share: ${e} 必须是公网链接,例如 https://example.com/path?a=1`, code: "PARAM_INVALID" };
|
|
3910
3910
|
return r;
|
|
3911
3911
|
}
|
|
3912
|
-
function
|
|
3912
|
+
function ti() {
|
|
3913
3913
|
return new Promise((t, e) => {
|
|
3914
3914
|
var s, o;
|
|
3915
3915
|
const r = typeof window != "undefined" ? window : null;
|
|
@@ -3925,7 +3925,7 @@ function ri() {
|
|
|
3925
3925
|
(o = (s = r.document) == null ? void 0 : s.addEventListener) == null || o.call(s, "plusready", i, { once: !0 });
|
|
3926
3926
|
});
|
|
3927
3927
|
}
|
|
3928
|
-
function
|
|
3928
|
+
function ri() {
|
|
3929
3929
|
return new Promise((t, e) => {
|
|
3930
3930
|
const r = typeof window != "undefined" ? window.plus : null;
|
|
3931
3931
|
if (!r || !r.share || typeof r.share.getServices != "function")
|
|
@@ -3940,13 +3940,13 @@ function ni() {
|
|
|
3940
3940
|
);
|
|
3941
3941
|
});
|
|
3942
3942
|
}
|
|
3943
|
-
function
|
|
3943
|
+
function ni(t) {
|
|
3944
3944
|
return t.isWeixinMiniProgram ? "已同步分享内容,请点击右上角“···”选择发送给朋友或分享到朋友圈。" : "正在拉起微信分享面板,请选择聊天框或朋友圈。";
|
|
3945
3945
|
}
|
|
3946
|
-
function
|
|
3946
|
+
function ii(t = {}) {
|
|
3947
3947
|
if (!t || typeof t != "object")
|
|
3948
3948
|
throw { errMsg: "shareDirected 参数必须是对象", code: "PARAM_TYPE_ERROR" };
|
|
3949
|
-
const e = String(t.kind || "").trim(), r = t.payload || {}, n =
|
|
3949
|
+
const e = String(t.kind || "").trim(), r = t.payload || {}, n = ei(t.scene);
|
|
3950
3950
|
if (!["web", "image", "text"].includes(e))
|
|
3951
3951
|
throw { errMsg: 'shareDirected: kind 仅支持 "web"|"image"|"text"', code: "PARAM_INVALID" };
|
|
3952
3952
|
if (![0, 1].includes(n))
|
|
@@ -3968,7 +3968,7 @@ function ai(t = {}) {
|
|
|
3968
3968
|
complete: t.complete
|
|
3969
3969
|
};
|
|
3970
3970
|
}
|
|
3971
|
-
function
|
|
3971
|
+
function ai(t, e) {
|
|
3972
3972
|
const { payload: r } = t;
|
|
3973
3973
|
if (e.isWeixinMiniProgram)
|
|
3974
3974
|
try {
|
|
@@ -3997,7 +3997,7 @@ function si(t, e) {
|
|
|
3997
3997
|
}
|
|
3998
3998
|
return t;
|
|
3999
3999
|
}
|
|
4000
|
-
function
|
|
4000
|
+
function si(t) {
|
|
4001
4001
|
const { kind: e, payload: r, resolvedTargetPath: n } = t, i = Ne(n || r.target, "target"), s = r.imageUrl || St;
|
|
4002
4002
|
return {
|
|
4003
4003
|
title: r.title || "分享",
|
|
@@ -4007,17 +4007,17 @@ function oi(t) {
|
|
|
4007
4007
|
custom: { kind: e, target: i.path, webTarget: r.webTarget || "", description: r.description || "" }
|
|
4008
4008
|
};
|
|
4009
4009
|
}
|
|
4010
|
-
function
|
|
4010
|
+
function oi(t) {
|
|
4011
4011
|
const { kind: e, scene: r, payload: n, resolvedWebTarget: i } = t, s = r === 1 ? "WXSceneTimeline" : "WXSceneSession", o = n.imageUrl || St;
|
|
4012
4012
|
return e === "image" ? { message: { type: "image", pictures: [n.imageUrl], extra: { scene: s } }, degradedFromText: !1 } : {
|
|
4013
4013
|
message: { type: "web", title: n.title || "分享", content: n.description || "", href: i, thumbs: [o], extra: { scene: s } },
|
|
4014
4014
|
degradedFromText: e === "text"
|
|
4015
4015
|
};
|
|
4016
4016
|
}
|
|
4017
|
-
function
|
|
4017
|
+
function ci(t) {
|
|
4018
4018
|
return I(this, null, function* () {
|
|
4019
|
-
yield
|
|
4020
|
-
const e = yield
|
|
4019
|
+
yield ti();
|
|
4020
|
+
const e = yield ri(), { message: r, degradedFromText: n } = oi(t);
|
|
4021
4021
|
return new Promise((i, s) => {
|
|
4022
4022
|
e.send(
|
|
4023
4023
|
r,
|
|
@@ -4033,10 +4033,10 @@ function Nt(t, e = "share") {
|
|
|
4033
4033
|
throw { errMsg: `当前微信小程序容器未注入 postMessage 能力,无法发起 ${e}`, code: "MINIPROGRAM_BRIDGE_UNAVAILABLE" };
|
|
4034
4034
|
r.postMessage({ data: t });
|
|
4035
4035
|
}
|
|
4036
|
-
function
|
|
4037
|
-
return { type: "qsh_api_call", api: "shareDirected", params: { miniProgramShare:
|
|
4036
|
+
function ui(t, e) {
|
|
4037
|
+
return { type: "qsh_api_call", api: "shareDirected", params: { miniProgramShare: si(t), rowCustom: e }, timestamp: Date.now() };
|
|
4038
4038
|
}
|
|
4039
|
-
function
|
|
4039
|
+
function li(t = {}) {
|
|
4040
4040
|
if (!t || typeof t != "object")
|
|
4041
4041
|
throw { errMsg: "shareMiniProgramCard 参数必须是对象", code: "PARAM_TYPE_ERROR" };
|
|
4042
4042
|
const e = t.payload || {};
|
|
@@ -4045,7 +4045,7 @@ function fi(t = {}) {
|
|
|
4045
4045
|
if (!e.targetPath) throw { errMsg: "shareMiniProgramCard: payload.targetPath 必填", code: "PARAM_MISSING" };
|
|
4046
4046
|
return Ne(e.targetPath, "targetPath"), { payload: e, success: t.success, fail: t.fail, complete: t.complete };
|
|
4047
4047
|
}
|
|
4048
|
-
function
|
|
4048
|
+
function fi(t) {
|
|
4049
4049
|
switch (String(t || "release").trim().toLowerCase()) {
|
|
4050
4050
|
case "develop":
|
|
4051
4051
|
case "development":
|
|
@@ -4064,6 +4064,24 @@ function bt(t) {
|
|
|
4064
4064
|
}
|
|
4065
4065
|
}
|
|
4066
4066
|
function di(t) {
|
|
4067
|
+
switch (String(t || "release").trim().toLowerCase()) {
|
|
4068
|
+
case "develop":
|
|
4069
|
+
case "development":
|
|
4070
|
+
case "test":
|
|
4071
|
+
return 1;
|
|
4072
|
+
case "trial":
|
|
4073
|
+
case "preview":
|
|
4074
|
+
case "experience":
|
|
4075
|
+
return 2;
|
|
4076
|
+
case "release":
|
|
4077
|
+
case "formal":
|
|
4078
|
+
case "production":
|
|
4079
|
+
return 0;
|
|
4080
|
+
default:
|
|
4081
|
+
throw { errMsg: 'shareMiniProgramCard: payload.envVersion 仅支持 "develop"|"trial"|"release"', code: "PARAM_INVALID" };
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
function gi(t) {
|
|
4067
4085
|
const { payload: e } = t;
|
|
4068
4086
|
if (!e.appid)
|
|
4069
4087
|
throw { errMsg: "shareMiniProgramCard: App 环境下 payload.appid 必填", code: "PARAM_MISSING" };
|
|
@@ -4072,9 +4090,9 @@ function di(t) {
|
|
|
4072
4090
|
} catch (r) {
|
|
4073
4091
|
throw { errMsg: "shareMiniProgramCard: App 环境下 payload.webUrl 必填,且必须是公网链接", code: (r == null ? void 0 : r.code) || "PARAM_INVALID" };
|
|
4074
4092
|
}
|
|
4075
|
-
return
|
|
4093
|
+
return fi(e.envVersion), t;
|
|
4076
4094
|
}
|
|
4077
|
-
function
|
|
4095
|
+
function hi(t) {
|
|
4078
4096
|
const { payload: e } = t, r = Ne(e.targetPath, "targetPath");
|
|
4079
4097
|
return {
|
|
4080
4098
|
title: e.title,
|
|
@@ -4083,7 +4101,7 @@ function gi(t) {
|
|
|
4083
4101
|
imageUrl: e.imageUrl
|
|
4084
4102
|
};
|
|
4085
4103
|
}
|
|
4086
|
-
function
|
|
4104
|
+
function pi(t) {
|
|
4087
4105
|
const { payload: e } = t;
|
|
4088
4106
|
return {
|
|
4089
4107
|
provider: "weixin",
|
|
@@ -4094,40 +4112,40 @@ function hi(t) {
|
|
|
4094
4112
|
miniProgram: {
|
|
4095
4113
|
id: e.appid,
|
|
4096
4114
|
path: e.targetPath,
|
|
4097
|
-
type:
|
|
4115
|
+
type: di(e.envVersion),
|
|
4098
4116
|
webUrl: e.webUrl
|
|
4099
4117
|
}
|
|
4100
4118
|
};
|
|
4101
4119
|
}
|
|
4102
|
-
function
|
|
4103
|
-
return { type: "qsh_api_call", api: "shareMiniProgramCard", params: { miniProgramShare:
|
|
4120
|
+
function mi(t, e) {
|
|
4121
|
+
return { type: "qsh_api_call", api: "shareMiniProgramCard", params: { miniProgramShare: hi(t), rowCustom: e }, timestamp: Date.now() };
|
|
4104
4122
|
}
|
|
4105
|
-
function
|
|
4123
|
+
function wi(t) {
|
|
4106
4124
|
return I(this, null, function* () {
|
|
4107
4125
|
return new Promise((e, r) => {
|
|
4108
|
-
O("shareMiniProgramCard", { appShare:
|
|
4126
|
+
O("shareMiniProgramCard", { appShare: pi(t) }, { success: (n) => e(n || {}), fail: (n) => r(n) });
|
|
4109
4127
|
});
|
|
4110
4128
|
});
|
|
4111
4129
|
}
|
|
4112
|
-
function
|
|
4130
|
+
function bt(t = {}) {
|
|
4113
4131
|
return d.safeExecute(
|
|
4114
4132
|
() => {
|
|
4115
4133
|
var s, o, l, u, p, M, _, $, ce, R, F;
|
|
4116
4134
|
let e;
|
|
4117
4135
|
try {
|
|
4118
|
-
e =
|
|
4136
|
+
e = ii(t);
|
|
4119
4137
|
} catch (w) {
|
|
4120
4138
|
return (s = t.fail) == null || s.call(t, w), Promise.reject(w);
|
|
4121
4139
|
}
|
|
4122
4140
|
const r = H(!0);
|
|
4123
4141
|
try {
|
|
4124
|
-
e =
|
|
4142
|
+
e = ai(e, r);
|
|
4125
4143
|
} catch (w) {
|
|
4126
4144
|
return (o = e.fail) == null || o.call(e, w), (l = e.complete) == null || l.call(e, w), Promise.reject(w);
|
|
4127
4145
|
}
|
|
4128
|
-
const n =
|
|
4146
|
+
const n = ni(r);
|
|
4129
4147
|
if (r.isAppPlus)
|
|
4130
|
-
return
|
|
4148
|
+
return ci(e).then((w) => {
|
|
4131
4149
|
var ue, je;
|
|
4132
4150
|
const k = m(g({}, (w == null ? void 0 : w.data) || {}), { hint: n });
|
|
4133
4151
|
return (ue = e.success) == null || ue.call(e, k), (je = e.complete) == null || je.call(e, k), k;
|
|
@@ -4137,7 +4155,7 @@ function Tt(t = {}) {
|
|
|
4137
4155
|
});
|
|
4138
4156
|
if (r.isWeixinMiniProgram)
|
|
4139
4157
|
try {
|
|
4140
|
-
Nt(
|
|
4158
|
+
Nt(ui(e, t.rowCustom), "shareDirected");
|
|
4141
4159
|
const w = { success: !0, hint: n };
|
|
4142
4160
|
return (u = e.success) == null || u.call(e, w), (p = e.complete) == null || p.call(e, w), Promise.resolve(w);
|
|
4143
4161
|
} catch (w) {
|
|
@@ -4153,31 +4171,31 @@ function Tt(t = {}) {
|
|
|
4153
4171
|
{ context: "shareDirected", options: t }
|
|
4154
4172
|
);
|
|
4155
4173
|
}
|
|
4156
|
-
function
|
|
4174
|
+
function Ei(t = {}) {
|
|
4157
4175
|
return new Promise((e, r) => {
|
|
4158
|
-
|
|
4176
|
+
bt(m(g({}, t), { success: e, fail: r }));
|
|
4159
4177
|
});
|
|
4160
4178
|
}
|
|
4161
|
-
function
|
|
4179
|
+
function Tt(t = {}) {
|
|
4162
4180
|
return d.safeExecute(
|
|
4163
4181
|
() => {
|
|
4164
4182
|
var s, o, l, u, p, M, _, $, ce;
|
|
4165
4183
|
let e;
|
|
4166
4184
|
try {
|
|
4167
|
-
e =
|
|
4185
|
+
e = li(t);
|
|
4168
4186
|
} catch (R) {
|
|
4169
4187
|
return (s = t.fail) == null || s.call(t, R), Promise.reject(R);
|
|
4170
4188
|
}
|
|
4171
4189
|
const r = H(!0);
|
|
4172
4190
|
if (r.isAppPlus)
|
|
4173
4191
|
try {
|
|
4174
|
-
e =
|
|
4192
|
+
e = gi(e);
|
|
4175
4193
|
} catch (R) {
|
|
4176
4194
|
return (o = e.fail) == null || o.call(e, R), (l = e.complete) == null || l.call(e, R), Promise.reject(R);
|
|
4177
4195
|
}
|
|
4178
4196
|
const n = r.isWeixinMiniProgram ? "已同步小程序卡片内容,请点击右上角“···”后发送给朋友。" : "正在拉起微信发送给朋友面板,请继续完成小程序卡片分享。";
|
|
4179
4197
|
if (r.isAppPlus)
|
|
4180
|
-
return
|
|
4198
|
+
return wi(e).then((R) => {
|
|
4181
4199
|
var w, k;
|
|
4182
4200
|
const F = m(g({}, R || {}), { hint: n });
|
|
4183
4201
|
return (w = e.success) == null || w.call(e, F), (k = e.complete) == null || k.call(e, F), F;
|
|
@@ -4187,7 +4205,7 @@ function vt(t = {}) {
|
|
|
4187
4205
|
});
|
|
4188
4206
|
if (r.isWeixinMiniProgram)
|
|
4189
4207
|
try {
|
|
4190
|
-
Nt(
|
|
4208
|
+
Nt(mi(e, t.rowCustom), "shareMiniProgramCard");
|
|
4191
4209
|
const R = { success: !0, hint: n };
|
|
4192
4210
|
return (u = e.success) == null || u.call(e, R), (p = e.complete) == null || p.call(e, R), Promise.resolve(R);
|
|
4193
4211
|
} catch (R) {
|
|
@@ -4199,12 +4217,12 @@ function vt(t = {}) {
|
|
|
4199
4217
|
{ context: "shareMiniProgramCard", options: t }
|
|
4200
4218
|
);
|
|
4201
4219
|
}
|
|
4202
|
-
function
|
|
4220
|
+
function yi(t = {}) {
|
|
4203
4221
|
return new Promise((e, r) => {
|
|
4204
|
-
|
|
4222
|
+
Tt(m(g({}, t), { success: e, fail: r }));
|
|
4205
4223
|
});
|
|
4206
4224
|
}
|
|
4207
|
-
const
|
|
4225
|
+
const Ii = {
|
|
4208
4226
|
OFF: "off",
|
|
4209
4227
|
// 蓝牙关闭
|
|
4210
4228
|
ON: "on",
|
|
@@ -4213,19 +4231,19 @@ const yi = {
|
|
|
4213
4231
|
// 不支持蓝牙
|
|
4214
4232
|
UNAUTHORIZED: "unauthorized"
|
|
4215
4233
|
// 未授权
|
|
4216
|
-
},
|
|
4234
|
+
}, Ai = {
|
|
4217
4235
|
allowDuplicatesKey: !1,
|
|
4218
4236
|
// 是否允许重复上报同一设备
|
|
4219
4237
|
services: []
|
|
4220
4238
|
// 指定服务 UUID 列表
|
|
4221
4239
|
};
|
|
4222
4240
|
function be(t = {}) {
|
|
4223
|
-
return g(g({},
|
|
4241
|
+
return g(g({}, Ai), t);
|
|
4224
4242
|
}
|
|
4225
4243
|
function we() {
|
|
4226
4244
|
return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(f.type);
|
|
4227
4245
|
}
|
|
4228
|
-
function
|
|
4246
|
+
function Pi(t) {
|
|
4229
4247
|
return d.safeExecute(() => I(null, null, function* () {
|
|
4230
4248
|
var e;
|
|
4231
4249
|
if (!window.wx) {
|
|
@@ -4235,7 +4253,7 @@ function Ai(t) {
|
|
|
4235
4253
|
}
|
|
4236
4254
|
oe() || (a.info("等待微信配置完成"), yield Q()), wx.openBluetoothAdapter({
|
|
4237
4255
|
success: () => {
|
|
4238
|
-
a.info("微信蓝牙适配器已打开"),
|
|
4256
|
+
a.info("微信蓝牙适配器已打开"), vt(t);
|
|
4239
4257
|
},
|
|
4240
4258
|
fail: (r) => {
|
|
4241
4259
|
var n;
|
|
@@ -4244,7 +4262,7 @@ function Ai(t) {
|
|
|
4244
4262
|
});
|
|
4245
4263
|
}), { context: "openBluetoothAdapterInWeixin" });
|
|
4246
4264
|
}
|
|
4247
|
-
function
|
|
4265
|
+
function Ci(t) {
|
|
4248
4266
|
return d.safeExecute(() => {
|
|
4249
4267
|
a.debug("通过 WebView 桥接调用蓝牙功能", t), O("bluetooth", t, {
|
|
4250
4268
|
success: (e) => {
|
|
@@ -4259,7 +4277,7 @@ function Pi(t) {
|
|
|
4259
4277
|
});
|
|
4260
4278
|
}, { context: "bluetoothInUniApp" });
|
|
4261
4279
|
}
|
|
4262
|
-
function
|
|
4280
|
+
function _i(t) {
|
|
4263
4281
|
return d.safeExecute(() => {
|
|
4264
4282
|
var e;
|
|
4265
4283
|
a.debug("通过 WebView 桥接调用蓝牙设备搜索功能", t), O("bluetoothDevicesDiscovery", {
|
|
@@ -4282,7 +4300,7 @@ function Ci(t) {
|
|
|
4282
4300
|
}, { context: "startBluetoothDevicesDiscoveryInUniApp" });
|
|
4283
4301
|
}
|
|
4284
4302
|
const ye = /* @__PURE__ */ new Set();
|
|
4285
|
-
function
|
|
4303
|
+
function Mi(t, e = {}) {
|
|
4286
4304
|
return d.safeExecute(() => {
|
|
4287
4305
|
var r;
|
|
4288
4306
|
return ye.add(t), ye.size === 1 && O("onBluetoothDeviceFound", {
|
|
@@ -4306,7 +4324,7 @@ function _i(t, e = {}) {
|
|
|
4306
4324
|
}), () => ye.delete(t);
|
|
4307
4325
|
}, { context: "qsh_onBluetoothDeviceFound" });
|
|
4308
4326
|
}
|
|
4309
|
-
function
|
|
4327
|
+
function Ri(t) {
|
|
4310
4328
|
return d.safeExecute(() => {
|
|
4311
4329
|
var e;
|
|
4312
4330
|
a.debug("通过 WebView 桥接调用蓝牙连接功能", t), O("bluetoothConnection", {
|
|
@@ -4329,7 +4347,7 @@ function Mi(t) {
|
|
|
4329
4347
|
});
|
|
4330
4348
|
}, { context: "createBLEConnectionInUniApp" });
|
|
4331
4349
|
}
|
|
4332
|
-
function
|
|
4350
|
+
function Si(t = {}) {
|
|
4333
4351
|
return d.safeExecute(() => {
|
|
4334
4352
|
var r;
|
|
4335
4353
|
if (!we()) {
|
|
@@ -4345,10 +4363,10 @@ function Ri(t = {}) {
|
|
|
4345
4363
|
platform: f.type,
|
|
4346
4364
|
services: e.services,
|
|
4347
4365
|
allowDuplicatesKey: e.allowDuplicatesKey
|
|
4348
|
-
}), C() ?
|
|
4366
|
+
}), C() ? Pi(e) : Ci(e);
|
|
4349
4367
|
}, { context: "openBluetoothAdapter", options: t });
|
|
4350
4368
|
}
|
|
4351
|
-
function
|
|
4369
|
+
function Oi(t = {}) {
|
|
4352
4370
|
return d.safeExecute(() => {
|
|
4353
4371
|
var r, n;
|
|
4354
4372
|
if (!we()) {
|
|
@@ -4364,10 +4382,10 @@ function Si(t = {}) {
|
|
|
4364
4382
|
platform: f.type,
|
|
4365
4383
|
services: e.services,
|
|
4366
4384
|
allowDuplicatesKey: e.allowDuplicatesKey
|
|
4367
|
-
}), C() ? startBluetoothDevicesDiscoveryInWeixin(e) :
|
|
4385
|
+
}), C() ? startBluetoothDevicesDiscoveryInWeixin(e) : _i(e);
|
|
4368
4386
|
}, { context: "startBluetoothDevicesDiscovery", options: t });
|
|
4369
4387
|
}
|
|
4370
|
-
function
|
|
4388
|
+
function vt(t, e = {}) {
|
|
4371
4389
|
return d.safeExecute(() => {
|
|
4372
4390
|
var n, i;
|
|
4373
4391
|
if (!we()) {
|
|
@@ -4379,10 +4397,10 @@ function Lt(t, e = {}) {
|
|
|
4379
4397
|
return;
|
|
4380
4398
|
}
|
|
4381
4399
|
const r = be(e);
|
|
4382
|
-
a.info("注册蓝牙设备发现监听", { platform: f.type }), C() ? onBluetoothDeviceFoundInWeixin(r) :
|
|
4400
|
+
a.info("注册蓝牙设备发现监听", { platform: f.type }), C() ? onBluetoothDeviceFoundInWeixin(r) : Mi(t, r);
|
|
4383
4401
|
}, { context: "onBluetoothDeviceFound", options: e });
|
|
4384
4402
|
}
|
|
4385
|
-
function
|
|
4403
|
+
function Ni(t = {}) {
|
|
4386
4404
|
return d.safeExecute(() => {
|
|
4387
4405
|
var s, o, l, u;
|
|
4388
4406
|
if (!we()) {
|
|
@@ -4405,10 +4423,10 @@ function Oi(t = {}) {
|
|
|
4405
4423
|
success: t.success,
|
|
4406
4424
|
fail: t.fail,
|
|
4407
4425
|
complete: t.complete
|
|
4408
|
-
}) :
|
|
4426
|
+
}) : Ri(e);
|
|
4409
4427
|
}, { context: "createBLEConnection", options: t });
|
|
4410
4428
|
}
|
|
4411
|
-
function
|
|
4429
|
+
function bi() {
|
|
4412
4430
|
return {
|
|
4413
4431
|
supported: we(),
|
|
4414
4432
|
environment: f.type,
|
|
@@ -4422,16 +4440,16 @@ function Ni() {
|
|
|
4422
4440
|
}
|
|
4423
4441
|
};
|
|
4424
4442
|
}
|
|
4425
|
-
const
|
|
4443
|
+
const Ti = {
|
|
4426
4444
|
// TODO: 添加更多默认配置
|
|
4427
4445
|
};
|
|
4428
|
-
function
|
|
4429
|
-
return g(g({},
|
|
4446
|
+
function vi(t = {}) {
|
|
4447
|
+
return g(g({}, Ti), t);
|
|
4430
4448
|
}
|
|
4431
|
-
function
|
|
4449
|
+
function Lt() {
|
|
4432
4450
|
return ["webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(f.type);
|
|
4433
4451
|
}
|
|
4434
|
-
function
|
|
4452
|
+
function Li(t) {
|
|
4435
4453
|
return d.safeExecute(() => {
|
|
4436
4454
|
a.debug("通过 WebView 桥接调用打印PDF", t), O("printPdf", m(g({}, t), {
|
|
4437
4455
|
isPersistent: !0
|
|
@@ -4452,10 +4470,10 @@ function vi(t) {
|
|
|
4452
4470
|
platform: "uniapp"
|
|
4453
4471
|
});
|
|
4454
4472
|
}
|
|
4455
|
-
function
|
|
4473
|
+
function xi(t = {}) {
|
|
4456
4474
|
return d.safeExecute(() => {
|
|
4457
4475
|
var r;
|
|
4458
|
-
if (!
|
|
4476
|
+
if (!Lt()) {
|
|
4459
4477
|
const n = {
|
|
4460
4478
|
errMsg: `当前环境 (${f.type}) 不支持打印PDF功能`,
|
|
4461
4479
|
code: "PLATFORM_NOT_SUPPORTED"
|
|
@@ -4463,16 +4481,16 @@ function Li(t = {}) {
|
|
|
4463
4481
|
a.error("平台不支持打印PDF", { platform: f.type }), (r = t.fail) == null || r.call(t, n);
|
|
4464
4482
|
return;
|
|
4465
4483
|
}
|
|
4466
|
-
const e =
|
|
4467
|
-
a.info("开始打印PDF", { platform: f.type }),
|
|
4484
|
+
const e = vi(t);
|
|
4485
|
+
a.info("开始打印PDF", { platform: f.type }), Li(e);
|
|
4468
4486
|
}, {
|
|
4469
4487
|
context: "printPdf",
|
|
4470
4488
|
options: t
|
|
4471
4489
|
});
|
|
4472
4490
|
}
|
|
4473
|
-
function
|
|
4491
|
+
function Di() {
|
|
4474
4492
|
return {
|
|
4475
|
-
supported:
|
|
4493
|
+
supported: Lt(),
|
|
4476
4494
|
environment: f.type,
|
|
4477
4495
|
implementation: "uniapp",
|
|
4478
4496
|
features: {
|
|
@@ -4481,7 +4499,7 @@ function xi() {
|
|
|
4481
4499
|
};
|
|
4482
4500
|
}
|
|
4483
4501
|
const xe = "/pages/face/index";
|
|
4484
|
-
function
|
|
4502
|
+
function Ui(t = {}) {
|
|
4485
4503
|
const e = g({}, t);
|
|
4486
4504
|
if (!e.name || typeof e.name != "string" || !e.name.trim())
|
|
4487
4505
|
throw {
|
|
@@ -4495,26 +4513,26 @@ function Di(t = {}) {
|
|
|
4495
4513
|
};
|
|
4496
4514
|
return e.idCardNumber = e.idCardNumber.trim(), e;
|
|
4497
4515
|
}
|
|
4498
|
-
function
|
|
4516
|
+
function xt() {
|
|
4499
4517
|
return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue"].includes(f.type);
|
|
4500
4518
|
}
|
|
4501
|
-
function
|
|
4519
|
+
function Wi() {
|
|
4502
4520
|
return typeof window != "undefined" && window.wx && window.wx.miniProgram && typeof window.wx.miniProgram.navigateTo == "function";
|
|
4503
4521
|
}
|
|
4504
|
-
function
|
|
4522
|
+
function $i(t) {
|
|
4505
4523
|
const e = m(g({}, t), {
|
|
4506
4524
|
title: document.title || "",
|
|
4507
4525
|
url: window.location.href || ""
|
|
4508
4526
|
}), r = Object.entries(e).filter(([, n]) => n != null && n !== "").map(([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`).join("&");
|
|
4509
4527
|
return r ? `${xe}?${r}` : xe;
|
|
4510
4528
|
}
|
|
4511
|
-
function
|
|
4529
|
+
function Fi(t) {
|
|
4512
4530
|
return d.safeExecute(() => {
|
|
4513
|
-
if (!
|
|
4531
|
+
if (!Wi()) {
|
|
4514
4532
|
a.error("微信小程序导航API不可用");
|
|
4515
4533
|
return;
|
|
4516
4534
|
}
|
|
4517
|
-
const e =
|
|
4535
|
+
const e = $i(t);
|
|
4518
4536
|
a.debug("跳转宿主人脸识别页面", {
|
|
4519
4537
|
name: t.name,
|
|
4520
4538
|
targetUrl: e
|
|
@@ -4532,7 +4550,7 @@ function $i(t) {
|
|
|
4532
4550
|
platform: "weixin"
|
|
4533
4551
|
});
|
|
4534
4552
|
}
|
|
4535
|
-
function
|
|
4553
|
+
function ki(t) {
|
|
4536
4554
|
return d.safeExecute(() => {
|
|
4537
4555
|
a.debug("通过 WebView 桥接调用人脸识别", {
|
|
4538
4556
|
platform: f.type,
|
|
@@ -4550,15 +4568,15 @@ function Fi(t) {
|
|
|
4550
4568
|
platform: "uniapp"
|
|
4551
4569
|
});
|
|
4552
4570
|
}
|
|
4553
|
-
function
|
|
4571
|
+
function Bi(t = {}) {
|
|
4554
4572
|
return d.safeExecute(() => {
|
|
4555
|
-
if (!
|
|
4573
|
+
if (!xt()) {
|
|
4556
4574
|
a.error("平台不支持人脸识别", { platform: f.type });
|
|
4557
4575
|
return;
|
|
4558
4576
|
}
|
|
4559
4577
|
let e;
|
|
4560
4578
|
try {
|
|
4561
|
-
e =
|
|
4579
|
+
e = Ui(t);
|
|
4562
4580
|
} catch (r) {
|
|
4563
4581
|
a.error("人脸识别参数校验失败", r);
|
|
4564
4582
|
return;
|
|
@@ -4568,19 +4586,19 @@ function ki(t = {}) {
|
|
|
4568
4586
|
name: e.name,
|
|
4569
4587
|
pagePath: xe
|
|
4570
4588
|
}), C()) {
|
|
4571
|
-
|
|
4589
|
+
Fi(e);
|
|
4572
4590
|
return;
|
|
4573
4591
|
}
|
|
4574
|
-
|
|
4592
|
+
ki(e);
|
|
4575
4593
|
}, {
|
|
4576
4594
|
context: "faceVerify",
|
|
4577
4595
|
options: t
|
|
4578
4596
|
});
|
|
4579
4597
|
}
|
|
4580
|
-
function
|
|
4598
|
+
function Gi() {
|
|
4581
4599
|
let t = "weixin";
|
|
4582
4600
|
return f.type === "UniApp" && (t = "uniapp"), {
|
|
4583
|
-
supported:
|
|
4601
|
+
supported: xt(),
|
|
4584
4602
|
environment: f.type,
|
|
4585
4603
|
implementation: t,
|
|
4586
4604
|
features: {
|
|
@@ -4590,23 +4608,23 @@ function Bi() {
|
|
|
4590
4608
|
}
|
|
4591
4609
|
};
|
|
4592
4610
|
}
|
|
4593
|
-
const
|
|
4594
|
-
function
|
|
4611
|
+
const Dt = H();
|
|
4612
|
+
function Ki() {
|
|
4595
4613
|
if (typeof window == "undefined" || !H(!0).isWeixinMiniProgram)
|
|
4596
4614
|
return !1;
|
|
4597
4615
|
const e = ve().getRuntimeConfig();
|
|
4598
4616
|
return typeof e.clientId == "string" && e.clientId.length > 0;
|
|
4599
4617
|
}
|
|
4600
|
-
function
|
|
4618
|
+
function Vi() {
|
|
4601
4619
|
return I(this, null, function* () {
|
|
4602
|
-
yield
|
|
4620
|
+
yield or(), Ki() && (yield Q());
|
|
4603
4621
|
});
|
|
4604
4622
|
}
|
|
4605
4623
|
z.useResponse(ct.response, { priority: 1e3 });
|
|
4606
4624
|
let Ze = !1;
|
|
4607
4625
|
function Qe() {
|
|
4608
4626
|
if (Ze) return;
|
|
4609
|
-
Ze = !0,
|
|
4627
|
+
Ze = !0, Or([
|
|
4610
4628
|
{ name: "load-weixin-sdk", run: at, timeoutMs: 8e3 },
|
|
4611
4629
|
{ name: "init-bridge", run: nt, timeoutMs: 8e3 }
|
|
4612
4630
|
], {
|
|
@@ -4638,13 +4656,13 @@ function y(t, { apiName: e } = {}) {
|
|
|
4638
4656
|
function Ie(t) {
|
|
4639
4657
|
return typeof t == "function" ? { success: t } : t && typeof t == "object" ? t : {};
|
|
4640
4658
|
}
|
|
4641
|
-
const Wt = y(Xr), $t = y(Zr), Ft = y(Qr), kt = y(en), Bt = y(tn)
|
|
4642
|
-
function
|
|
4643
|
-
const e = () =>
|
|
4659
|
+
const Ut = y(Yr), Wt = y(Xr), $t = y(Zr), Ft = y(Qr), kt = y(en), Bt = y(tn);
|
|
4660
|
+
function Gt(t) {
|
|
4661
|
+
const e = () => rn(t);
|
|
4644
4662
|
return (typeof window == "undefined" ? Promise.resolve() : rt()).then(() => e());
|
|
4645
4663
|
}
|
|
4646
|
-
const Fe = y(
|
|
4647
|
-
function
|
|
4664
|
+
const Fe = y(un, { apiName: "getCode" });
|
|
4665
|
+
function qi(t = {}) {
|
|
4648
4666
|
return new Promise((e, r) => {
|
|
4649
4667
|
Fe(m(g({}, t), {
|
|
4650
4668
|
success: e,
|
|
@@ -4652,10 +4670,10 @@ function Vi(t = {}) {
|
|
|
4652
4670
|
}));
|
|
4653
4671
|
});
|
|
4654
4672
|
}
|
|
4655
|
-
const ke = y(
|
|
4673
|
+
const ke = y(hn, {
|
|
4656
4674
|
apiName: "navigateToMiniProgram"
|
|
4657
4675
|
});
|
|
4658
|
-
function
|
|
4676
|
+
function ji(t = {}) {
|
|
4659
4677
|
return new Promise((e, r) => {
|
|
4660
4678
|
ke(m(g({}, t), {
|
|
4661
4679
|
success: e,
|
|
@@ -4663,8 +4681,8 @@ function qi(t = {}) {
|
|
|
4663
4681
|
}));
|
|
4664
4682
|
});
|
|
4665
4683
|
}
|
|
4666
|
-
const Be = y(
|
|
4667
|
-
function
|
|
4684
|
+
const Be = y(Mn);
|
|
4685
|
+
function Ji(t = {}) {
|
|
4668
4686
|
return new Promise((e, r) => {
|
|
4669
4687
|
Be(m(g({}, t), {
|
|
4670
4688
|
success: e,
|
|
@@ -4672,17 +4690,17 @@ function ji(t = {}) {
|
|
|
4672
4690
|
}));
|
|
4673
4691
|
});
|
|
4674
4692
|
}
|
|
4675
|
-
const
|
|
4676
|
-
function
|
|
4693
|
+
const Kt = y(xi);
|
|
4694
|
+
function Hi(t = {}) {
|
|
4677
4695
|
return new Promise((e, r) => {
|
|
4678
|
-
|
|
4696
|
+
Kt(m(g({}, t), {
|
|
4679
4697
|
success: e,
|
|
4680
4698
|
fail: r
|
|
4681
4699
|
}));
|
|
4682
4700
|
});
|
|
4683
4701
|
}
|
|
4684
|
-
const Ge = y(
|
|
4685
|
-
function
|
|
4702
|
+
const Ge = y(Tn), zi = y(Bi);
|
|
4703
|
+
function Yi(t = {}) {
|
|
4686
4704
|
return new Promise((e, r) => {
|
|
4687
4705
|
Ge(m(g({}, t), {
|
|
4688
4706
|
success: e,
|
|
@@ -4690,8 +4708,8 @@ function zi(t = {}) {
|
|
|
4690
4708
|
}));
|
|
4691
4709
|
});
|
|
4692
4710
|
}
|
|
4693
|
-
const
|
|
4694
|
-
function
|
|
4711
|
+
const Xi = y(bt, { apiName: "shareDirected" }), Zi = y(Ei, { apiName: "shareDirectedAsync" }), Qi = y(Et, { apiName: "manualShare" }), ea = y(An, { apiName: "manualShareAsync" }), Ke = y(kn);
|
|
4712
|
+
function ta(t = {}) {
|
|
4695
4713
|
return new Promise((e, r) => {
|
|
4696
4714
|
Ke(m(g({}, t), {
|
|
4697
4715
|
success: e,
|
|
@@ -4699,8 +4717,8 @@ function ea(t = {}) {
|
|
|
4699
4717
|
}));
|
|
4700
4718
|
});
|
|
4701
4719
|
}
|
|
4702
|
-
const Ve = y(
|
|
4703
|
-
function
|
|
4720
|
+
const Ve = y(Bn);
|
|
4721
|
+
function ra(t = {}) {
|
|
4704
4722
|
return new Promise((e, r) => {
|
|
4705
4723
|
Ve(m(g({}, t), {
|
|
4706
4724
|
success: e,
|
|
@@ -4708,8 +4726,8 @@ function ta(t = {}) {
|
|
|
4708
4726
|
}));
|
|
4709
4727
|
});
|
|
4710
4728
|
}
|
|
4711
|
-
const qe = y(
|
|
4712
|
-
function
|
|
4729
|
+
const qe = y(Zn);
|
|
4730
|
+
function na(t = {}) {
|
|
4713
4731
|
return new Promise((e, r) => {
|
|
4714
4732
|
qe(m(g({}, t), {
|
|
4715
4733
|
success: e,
|
|
@@ -4717,78 +4735,78 @@ function ra(t = {}) {
|
|
|
4717
4735
|
}));
|
|
4718
4736
|
});
|
|
4719
4737
|
}
|
|
4720
|
-
const
|
|
4721
|
-
function
|
|
4738
|
+
const Vt = y(Si);
|
|
4739
|
+
function ia(t = {}) {
|
|
4722
4740
|
return new Promise((e, r) => {
|
|
4723
|
-
|
|
4741
|
+
Vt(m(g({}, t), {
|
|
4724
4742
|
success: e,
|
|
4725
4743
|
fail: r
|
|
4726
4744
|
}));
|
|
4727
4745
|
});
|
|
4728
4746
|
}
|
|
4729
|
-
const
|
|
4730
|
-
function
|
|
4747
|
+
const qt = y(Oi);
|
|
4748
|
+
function aa(t = {}) {
|
|
4731
4749
|
return new Promise((e, r) => {
|
|
4732
|
-
|
|
4750
|
+
qt(m(g({}, t), {
|
|
4733
4751
|
success: e,
|
|
4734
4752
|
fail: r
|
|
4735
4753
|
}));
|
|
4736
4754
|
});
|
|
4737
4755
|
}
|
|
4738
|
-
const
|
|
4739
|
-
function
|
|
4756
|
+
const jt = y(vt);
|
|
4757
|
+
function sa(t = {}) {
|
|
4740
4758
|
return new Promise((e, r) => {
|
|
4741
|
-
|
|
4759
|
+
jt(m(g({}, t), {
|
|
4742
4760
|
success: e,
|
|
4743
4761
|
fail: r
|
|
4744
4762
|
}));
|
|
4745
4763
|
});
|
|
4746
4764
|
}
|
|
4747
|
-
const
|
|
4748
|
-
function
|
|
4765
|
+
const Jt = y(Ni);
|
|
4766
|
+
function oa(t = {}) {
|
|
4749
4767
|
return new Promise((e, r) => {
|
|
4750
|
-
|
|
4768
|
+
Jt(m(g({}, t), {
|
|
4751
4769
|
success: e,
|
|
4752
4770
|
fail: r
|
|
4753
4771
|
}));
|
|
4754
4772
|
});
|
|
4755
4773
|
}
|
|
4756
|
-
const
|
|
4774
|
+
const ca = y(Tt, { apiName: "shareMiniProgramCard" }), ua = y(yi, { apiName: "shareMiniProgramCardAsync" }), se = {
|
|
4757
4775
|
// 导航 API
|
|
4758
|
-
navigateTo:
|
|
4759
|
-
navigateBack:
|
|
4760
|
-
switchTab:
|
|
4761
|
-
reLaunch:
|
|
4762
|
-
redirectTo:
|
|
4776
|
+
navigateTo: Ut,
|
|
4777
|
+
navigateBack: Wt,
|
|
4778
|
+
switchTab: $t,
|
|
4779
|
+
reLaunch: Ft,
|
|
4780
|
+
redirectTo: kt,
|
|
4763
4781
|
// 消息 API
|
|
4764
|
-
postMessage:
|
|
4765
|
-
getEnv:
|
|
4782
|
+
postMessage: Bt,
|
|
4783
|
+
getEnv: Gt,
|
|
4766
4784
|
getCode: Fe,
|
|
4767
|
-
getCodeAsync:
|
|
4785
|
+
getCodeAsync: qi,
|
|
4768
4786
|
navigateToMiniProgram: ke,
|
|
4769
|
-
navigateToMiniProgramAsync:
|
|
4787
|
+
navigateToMiniProgramAsync: ji,
|
|
4770
4788
|
// 图片 API
|
|
4771
4789
|
chooseImage: Be,
|
|
4772
|
-
chooseImageAsync:
|
|
4790
|
+
chooseImageAsync: Ji,
|
|
4773
4791
|
// 扫码 API
|
|
4774
4792
|
scanCode: Ge,
|
|
4775
|
-
scanCodeAsync:
|
|
4793
|
+
scanCodeAsync: Yi,
|
|
4776
4794
|
// 位置 API
|
|
4777
4795
|
getLocation: Ke,
|
|
4778
|
-
getLocationAsync:
|
|
4796
|
+
getLocationAsync: ta,
|
|
4779
4797
|
openLocation: Ve,
|
|
4780
|
-
openLocationAsync:
|
|
4798
|
+
openLocationAsync: ra,
|
|
4781
4799
|
chooseLocation: qe,
|
|
4782
|
-
chooseLocationAsync:
|
|
4800
|
+
chooseLocationAsync: na,
|
|
4783
4801
|
// 位置监听 API(保留回调签名)
|
|
4784
|
-
onLocationChange: (t) => y((e = {}) =>
|
|
4785
|
-
offLocationChange: (t) => y((e = {}) =>
|
|
4786
|
-
onLocationChangeError: (t) => y((e = {}) =>
|
|
4787
|
-
offLocationChangeError: (t) => y((e = {}) =>
|
|
4788
|
-
startLocationUpdate: y(
|
|
4789
|
-
stopLocationUpdate: y(
|
|
4802
|
+
onLocationChange: (t) => y((e = {}) => qn(e.success), { apiName: "onLocationChange" })(Ie(t)),
|
|
4803
|
+
offLocationChange: (t) => y((e = {}) => jn(e.success), { apiName: "offLocationChange" })(Ie(t)),
|
|
4804
|
+
onLocationChangeError: (t) => y((e = {}) => Jn(e.success), { apiName: "onLocationChangeError" })(Ie(t)),
|
|
4805
|
+
offLocationChangeError: (t) => y((e = {}) => Hn(e.success), { apiName: "offLocationChangeError" })(Ie(t)),
|
|
4806
|
+
startLocationUpdate: y(Kn, { apiName: "startLocationUpdate" }),
|
|
4807
|
+
stopLocationUpdate: y(Vn, { apiName: "stopLocationUpdate" }),
|
|
4790
4808
|
// 环境信息
|
|
4791
|
-
environment:
|
|
4809
|
+
environment: Dt,
|
|
4792
4810
|
/**
|
|
4793
4811
|
* Wait for SDK readiness.
|
|
4794
4812
|
* In Weixin mini-program web-view, if qsh.config({ clientId }) was called,
|
|
@@ -4798,7 +4816,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4798
4816
|
* await qsh.ready()
|
|
4799
4817
|
* @since 2.0.0
|
|
4800
4818
|
*/
|
|
4801
|
-
ready:
|
|
4819
|
+
ready: Vi,
|
|
4802
4820
|
/**
|
|
4803
4821
|
* 手动初始化 JSBridge
|
|
4804
4822
|
* 默认会在 DOM 就绪时自动初始化;如需更早或手动控制,可调用本方法。
|
|
@@ -4815,7 +4833,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4815
4833
|
* if (qsh.isReady()) { console.log('ready') }
|
|
4816
4834
|
* @since 2.0.0
|
|
4817
4835
|
*/
|
|
4818
|
-
isReady:
|
|
4836
|
+
isReady: tr,
|
|
4819
4837
|
/**
|
|
4820
4838
|
* 获取当前 SDK 状态
|
|
4821
4839
|
* @returns {string}
|
|
@@ -4823,7 +4841,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4823
4841
|
* console.log(qsh.getState()) // 'ready'
|
|
4824
4842
|
* @since 2.0.0
|
|
4825
4843
|
*/
|
|
4826
|
-
getState:
|
|
4844
|
+
getState: rr,
|
|
4827
4845
|
config: He,
|
|
4828
4846
|
// 微信配置 API
|
|
4829
4847
|
weixin: {
|
|
@@ -4851,7 +4869,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4851
4869
|
* console.log(qsh.weixin.getConfigState()) // 'configured'
|
|
4852
4870
|
* @since 2.0.0
|
|
4853
4871
|
*/
|
|
4854
|
-
getConfigState:
|
|
4872
|
+
getConfigState: dr,
|
|
4855
4873
|
/**
|
|
4856
4874
|
* 手动重试微信配置
|
|
4857
4875
|
* @returns {Promise<void>}
|
|
@@ -4859,7 +4877,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4859
4877
|
* await qsh.weixin.retryConfig()
|
|
4860
4878
|
* @since 2.0.0
|
|
4861
4879
|
*/
|
|
4862
|
-
retryConfig:
|
|
4880
|
+
retryConfig: gr
|
|
4863
4881
|
},
|
|
4864
4882
|
// WebView 对象(兼容旧版本)
|
|
4865
4883
|
webView: null,
|
|
@@ -4874,7 +4892,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4874
4892
|
* console.log('是否支持:', capabilities.supported)
|
|
4875
4893
|
* @since 2.0.0
|
|
4876
4894
|
*/
|
|
4877
|
-
getImageCapabilities:
|
|
4895
|
+
getImageCapabilities: Rn,
|
|
4878
4896
|
// 扫码相关常量
|
|
4879
4897
|
ScanTypes: X,
|
|
4880
4898
|
/**
|
|
@@ -4885,7 +4903,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4885
4903
|
* console.log('是否支持:', capabilities.supported)
|
|
4886
4904
|
* @since 2.1.0
|
|
4887
4905
|
*/
|
|
4888
|
-
getScanCapabilities:
|
|
4906
|
+
getScanCapabilities: vn,
|
|
4889
4907
|
// 位置相关常量
|
|
4890
4908
|
CoordinateTypes: ae,
|
|
4891
4909
|
/**
|
|
@@ -4896,7 +4914,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4896
4914
|
* console.log('是否支持:', capabilities.supported)
|
|
4897
4915
|
* @since 2.1.0
|
|
4898
4916
|
*/
|
|
4899
|
-
getLocationCapabilities:
|
|
4917
|
+
getLocationCapabilities: Gn,
|
|
4900
4918
|
/**
|
|
4901
4919
|
* 获取位置选择功能能力信息
|
|
4902
4920
|
* @returns {Object} 能力信息对象
|
|
@@ -4905,28 +4923,28 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4905
4923
|
* console.log('是否支持:', capabilities.supported)
|
|
4906
4924
|
* @since 2.1.0
|
|
4907
4925
|
*/
|
|
4908
|
-
getChooseLocationCapabilities:
|
|
4926
|
+
getChooseLocationCapabilities: Qn,
|
|
4909
4927
|
// 蓝牙 API
|
|
4910
|
-
openBluetoothAdapter:
|
|
4911
|
-
openBluetoothAdapterAsync:
|
|
4912
|
-
startBluetoothDevicesDiscovery:
|
|
4913
|
-
startBluetoothDevicesDiscoveryAsync:
|
|
4914
|
-
onBluetoothDeviceFound:
|
|
4915
|
-
onBluetoothDeviceFoundAsync:
|
|
4916
|
-
createBLEConnection:
|
|
4917
|
-
createBLEConnectionAsync:
|
|
4928
|
+
openBluetoothAdapter: Vt,
|
|
4929
|
+
openBluetoothAdapterAsync: ia,
|
|
4930
|
+
startBluetoothDevicesDiscovery: qt,
|
|
4931
|
+
startBluetoothDevicesDiscoveryAsync: aa,
|
|
4932
|
+
onBluetoothDeviceFound: jt,
|
|
4933
|
+
onBluetoothDeviceFoundAsync: sa,
|
|
4934
|
+
createBLEConnection: Jt,
|
|
4935
|
+
createBLEConnectionAsync: oa,
|
|
4918
4936
|
// 蓝牙相关常量
|
|
4919
|
-
BluetoothStates:
|
|
4937
|
+
BluetoothStates: Ii,
|
|
4920
4938
|
//微信分享(定向模块)
|
|
4921
4939
|
/** 定向分享模块:仅 H5->宿主 WebView,图文/文字/图片到微信会话/朋友圈 */
|
|
4922
|
-
shareDirected:
|
|
4923
|
-
shareDirectedAsync:
|
|
4940
|
+
shareDirected: Xi,
|
|
4941
|
+
shareDirectedAsync: Zi,
|
|
4924
4942
|
/** 手动分享预览:仅微信小程序 web-view,通过 postMessage + navigateBack 触发宿主弹窗 */
|
|
4925
|
-
manualShare:
|
|
4926
|
-
manualShareAsync:
|
|
4943
|
+
manualShare: Qi,
|
|
4944
|
+
manualShareAsync: ea,
|
|
4927
4945
|
/** 微信小程序卡片:仅发送给朋友,不改现有 shareDirected */
|
|
4928
|
-
shareMiniProgramCard:
|
|
4929
|
-
shareMiniProgramCardAsync:
|
|
4946
|
+
shareMiniProgramCard: ca,
|
|
4947
|
+
shareMiniProgramCardAsync: ua,
|
|
4930
4948
|
/**
|
|
4931
4949
|
* 获取蓝牙功能能力信息
|
|
4932
4950
|
* @returns {Object} 能力信息对象
|
|
@@ -4934,10 +4952,10 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4934
4952
|
* const capabilities = qsh.getBluetoothCapabilities()
|
|
4935
4953
|
* console.log('是否支持:', capabilities.supported)
|
|
4936
4954
|
*/
|
|
4937
|
-
getBluetoothCapabilities:
|
|
4955
|
+
getBluetoothCapabilities: bi,
|
|
4938
4956
|
// 打印PDF API
|
|
4939
|
-
printPdf:
|
|
4940
|
-
printPdfAsync:
|
|
4957
|
+
printPdf: Kt,
|
|
4958
|
+
printPdfAsync: Hi,
|
|
4941
4959
|
/**
|
|
4942
4960
|
* 获取打印PDF功能能力信息
|
|
4943
4961
|
* @returns {Object} 能力信息对象
|
|
@@ -4945,10 +4963,10 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
4945
4963
|
* const capabilities = qsh.getPrintCapabilities()
|
|
4946
4964
|
* console.log('是否支持:', capabilities.supported)
|
|
4947
4965
|
*/
|
|
4948
|
-
getPrintCapabilities:
|
|
4966
|
+
getPrintCapabilities: Di,
|
|
4949
4967
|
// 人脸识别 API(仅支持微信小程序环境)
|
|
4950
|
-
faceVerify:
|
|
4951
|
-
getFaceCapabilities:
|
|
4968
|
+
faceVerify: zi,
|
|
4969
|
+
getFaceCapabilities: Gi,
|
|
4952
4970
|
// 插件系统
|
|
4953
4971
|
plugins: {
|
|
4954
4972
|
/**
|
|
@@ -5013,10 +5031,10 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
5013
5031
|
* 内置拦截器
|
|
5014
5032
|
*/
|
|
5015
5033
|
builtin: {
|
|
5016
|
-
logging:
|
|
5034
|
+
logging: mr,
|
|
5017
5035
|
performance: q,
|
|
5018
|
-
createRetry:
|
|
5019
|
-
createValidation:
|
|
5036
|
+
createRetry: wr,
|
|
5037
|
+
createValidation: Er,
|
|
5020
5038
|
errorNormalizer: ct
|
|
5021
5039
|
}
|
|
5022
5040
|
},
|
|
@@ -5062,7 +5080,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
5062
5080
|
* @example
|
|
5063
5081
|
* const error = qsh.errors.create('E_IMG_001', { apiName: 'chooseImage' })
|
|
5064
5082
|
*/
|
|
5065
|
-
create:
|
|
5083
|
+
create: Mr,
|
|
5066
5084
|
/**
|
|
5067
5085
|
* 判断是否为标准错误
|
|
5068
5086
|
* @param {any} error - 错误对象
|
|
@@ -5070,7 +5088,7 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
5070
5088
|
* @example
|
|
5071
5089
|
* if (qsh.errors.isStandard(error)) { ... }
|
|
5072
5090
|
*/
|
|
5073
|
-
isStandard:
|
|
5091
|
+
isStandard: Rr
|
|
5074
5092
|
},
|
|
5075
5093
|
// 状态管理
|
|
5076
5094
|
store: {
|
|
@@ -5175,14 +5193,14 @@ const oa = y(vt, { apiName: "shareMiniProgramCard" }), ca = y(Ei, { apiName: "sh
|
|
|
5175
5193
|
exportDebugInfo: () => L.exportToJSON()
|
|
5176
5194
|
}
|
|
5177
5195
|
};
|
|
5178
|
-
|
|
5179
|
-
navigateTo:
|
|
5180
|
-
navigateBack:
|
|
5181
|
-
switchTab:
|
|
5182
|
-
reLaunch:
|
|
5183
|
-
redirectTo:
|
|
5184
|
-
postMessage:
|
|
5185
|
-
getEnv:
|
|
5196
|
+
Dt.isWeixinMiniProgram ? se.webView = window.wx && window.wx.miniProgram : se.webView = {
|
|
5197
|
+
navigateTo: Ut,
|
|
5198
|
+
navigateBack: Wt,
|
|
5199
|
+
switchTab: $t,
|
|
5200
|
+
reLaunch: Ft,
|
|
5201
|
+
redirectTo: kt,
|
|
5202
|
+
postMessage: Bt,
|
|
5203
|
+
getEnv: Gt,
|
|
5186
5204
|
getCode: Fe,
|
|
5187
5205
|
navigateToMiniProgram: ke,
|
|
5188
5206
|
chooseImage: Be,
|