|
@@ -812,7 +812,7 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
}
|
|
|
}
|
|
|
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
|
- const result = Reflect.set(target, key, value, receiver);
|
|
|
+ const result2 = Reflect.set(target, key, value, receiver);
|
|
|
if (target === toRaw(receiver)) {
|
|
|
if (!hadKey) {
|
|
|
trigger(target, "add", key, value);
|
|
@@ -820,23 +820,23 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
trigger(target, "set", key, value, oldValue);
|
|
|
}
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
deleteProperty(target, key) {
|
|
|
const hadKey = hasOwn(target, key);
|
|
|
const oldValue = target[key];
|
|
|
- const result = Reflect.deleteProperty(target, key);
|
|
|
- if (result && hadKey) {
|
|
|
+ const result2 = Reflect.deleteProperty(target, key);
|
|
|
+ if (result2 && hadKey) {
|
|
|
trigger(target, "delete", key, void 0, oldValue);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
has(target, key) {
|
|
|
- const result = Reflect.has(target, key);
|
|
|
+ const result2 = Reflect.has(target, key);
|
|
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
|
track(target, "has", key);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
ownKeys(target) {
|
|
|
track(
|
|
@@ -957,21 +957,21 @@ function deleteEntry(key) {
|
|
|
checkIdentityKeys(target, has2, key);
|
|
|
}
|
|
|
const oldValue = get2 ? get2.call(target, key) : void 0;
|
|
|
- const result = target.delete(key);
|
|
|
+ const result2 = target.delete(key);
|
|
|
if (hadKey) {
|
|
|
trigger(target, "delete", key, void 0, oldValue);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
function clear() {
|
|
|
const target = toRaw(this);
|
|
|
const hadItems = target.size !== 0;
|
|
|
const oldTarget = isMap(target) ? new Map(target) : new Set(target);
|
|
|
- const result = target.clear();
|
|
|
+ const result2 = target.clear();
|
|
|
if (hadItems) {
|
|
|
trigger(target, "clear", void 0, void 0, oldTarget);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
function createForEach(isReadonly2, isShallow2) {
|
|
|
return function forEach(callback, thisArg) {
|
|
@@ -1252,6 +1252,9 @@ function isReadonly(value) {
|
|
|
function isShallow(value) {
|
|
|
return !!(value && value["__v_isShallow"]);
|
|
|
}
|
|
|
+function isProxy(value) {
|
|
|
+ return isReactive(value) || isReadonly(value);
|
|
|
+}
|
|
|
function toRaw(observed) {
|
|
|
const raw = observed && observed["__v_raw"];
|
|
|
return raw ? toRaw(raw) : observed;
|
|
@@ -2043,6 +2046,47 @@ function setCurrentRenderingInstance(instance) {
|
|
|
instance && instance.type.__scopeId || null;
|
|
|
return prev;
|
|
|
}
|
|
|
+const COMPONENTS = "components";
|
|
|
+function resolveComponent(name, maybeSelfReference) {
|
|
|
+ return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
|
+}
|
|
|
+function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
|
+ const instance = currentRenderingInstance || currentInstance;
|
|
|
+ if (instance) {
|
|
|
+ const Component2 = instance.type;
|
|
|
+ if (type === COMPONENTS) {
|
|
|
+ const selfName = getComponentName(
|
|
|
+ Component2,
|
|
|
+ false
|
|
|
+ );
|
|
|
+ if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
|
+ return Component2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const res = (
|
|
|
+ // local registration
|
|
|
+ // check instance[type] first which is resolved for options API
|
|
|
+ resolve(instance[type] || Component2[type], name) || // global registration
|
|
|
+ resolve(instance.appContext[type], name)
|
|
|
+ );
|
|
|
+ if (!res && maybeSelfReference) {
|
|
|
+ return Component2;
|
|
|
+ }
|
|
|
+ if (warnMissing && !res) {
|
|
|
+ const extra = type === COMPONENTS ? `
|
|
|
+If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
|
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ } else {
|
|
|
+ warn$1(
|
|
|
+ `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+function resolve(registry, name) {
|
|
|
+ return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
|
+}
|
|
|
const INITIAL_WATCHER_VALUE = {};
|
|
|
function watch(source, cb, options) {
|
|
|
if (!isFunction(cb)) {
|
|
@@ -3657,6 +3701,12 @@ const Static = Symbol.for("v-stc");
|
|
|
function isVNode(value) {
|
|
|
return value ? value.__v_isVNode === true : false;
|
|
|
}
|
|
|
+const InternalObjectKey = `__vInternal`;
|
|
|
+function guardReactiveProps(props) {
|
|
|
+ if (!props)
|
|
|
+ return null;
|
|
|
+ return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
|
|
|
+}
|
|
|
const emptyAppContext = createAppContext();
|
|
|
let uid = 0;
|
|
|
function createComponentInstance(vnode, parent, suspense) {
|
|
@@ -4040,10 +4090,10 @@ function unwrapper(target) {
|
|
|
const ARRAYTYPE = "[object Array]";
|
|
|
const OBJECTTYPE = "[object Object]";
|
|
|
function diff(current, pre) {
|
|
|
- const result = {};
|
|
|
+ const result2 = {};
|
|
|
syncKeys(current, pre);
|
|
|
- _diff(current, pre, "", result);
|
|
|
- return result;
|
|
|
+ _diff(current, pre, "", result2);
|
|
|
+ return result2;
|
|
|
}
|
|
|
function syncKeys(current, pre) {
|
|
|
current = unwrapper(current);
|
|
@@ -4068,7 +4118,7 @@ function syncKeys(current, pre) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-function _diff(current, pre, path, result) {
|
|
|
+function _diff(current, pre, path, result2) {
|
|
|
current = unwrapper(current);
|
|
|
if (current === pre)
|
|
|
return;
|
|
@@ -4076,7 +4126,7 @@ function _diff(current, pre, path, result) {
|
|
|
const rootPreType = toTypeString(pre);
|
|
|
if (rootCurrentType == OBJECTTYPE) {
|
|
|
if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
|
|
|
- setResult(result, path, current);
|
|
|
+ setResult(result2, path, current);
|
|
|
} else {
|
|
|
for (let key in current) {
|
|
|
const currentValue = unwrapper(current[key]);
|
|
@@ -4086,7 +4136,7 @@ function _diff(current, pre, path, result) {
|
|
|
if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
|
|
|
if (currentValue != preValue) {
|
|
|
setResult(
|
|
|
- result,
|
|
|
+ result2,
|
|
|
(path == "" ? "" : path + ".") + key,
|
|
|
currentValue
|
|
|
);
|
|
@@ -4094,14 +4144,14 @@ function _diff(current, pre, path, result) {
|
|
|
} else if (currentType == ARRAYTYPE) {
|
|
|
if (preType != ARRAYTYPE) {
|
|
|
setResult(
|
|
|
- result,
|
|
|
+ result2,
|
|
|
(path == "" ? "" : path + ".") + key,
|
|
|
currentValue
|
|
|
);
|
|
|
} else {
|
|
|
if (currentValue.length < preValue.length) {
|
|
|
setResult(
|
|
|
- result,
|
|
|
+ result2,
|
|
|
(path == "" ? "" : path + ".") + key,
|
|
|
currentValue
|
|
|
);
|
|
@@ -4111,7 +4161,7 @@ function _diff(current, pre, path, result) {
|
|
|
item,
|
|
|
preValue[index2],
|
|
|
(path == "" ? "" : path + ".") + key + "[" + index2 + "]",
|
|
|
- result
|
|
|
+ result2
|
|
|
);
|
|
|
});
|
|
|
}
|
|
@@ -4119,7 +4169,7 @@ function _diff(current, pre, path, result) {
|
|
|
} else if (currentType == OBJECTTYPE) {
|
|
|
if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
|
|
|
setResult(
|
|
|
- result,
|
|
|
+ result2,
|
|
|
(path == "" ? "" : path + ".") + key,
|
|
|
currentValue
|
|
|
);
|
|
@@ -4129,7 +4179,7 @@ function _diff(current, pre, path, result) {
|
|
|
currentValue[subKey],
|
|
|
preValue[subKey],
|
|
|
(path == "" ? "" : path + ".") + key + "." + subKey,
|
|
|
- result
|
|
|
+ result2
|
|
|
);
|
|
|
}
|
|
|
}
|
|
@@ -4138,22 +4188,22 @@ function _diff(current, pre, path, result) {
|
|
|
}
|
|
|
} else if (rootCurrentType == ARRAYTYPE) {
|
|
|
if (rootPreType != ARRAYTYPE) {
|
|
|
- setResult(result, path, current);
|
|
|
+ setResult(result2, path, current);
|
|
|
} else {
|
|
|
if (current.length < pre.length) {
|
|
|
- setResult(result, path, current);
|
|
|
+ setResult(result2, path, current);
|
|
|
} else {
|
|
|
current.forEach((item, index2) => {
|
|
|
- _diff(item, pre[index2], path + "[" + index2 + "]", result);
|
|
|
+ _diff(item, pre[index2], path + "[" + index2 + "]", result2);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- setResult(result, path, current);
|
|
|
+ setResult(result2, path, current);
|
|
|
}
|
|
|
}
|
|
|
-function setResult(result, k, v) {
|
|
|
- result[k] = v;
|
|
|
+function setResult(result2, k, v) {
|
|
|
+ result2[k] = v;
|
|
|
}
|
|
|
function hasComponentEffect(instance) {
|
|
|
return queue$1.includes(instance.update);
|
|
@@ -4495,13 +4545,13 @@ function renderComponentRoot(instance) {
|
|
|
instance.$ei = 0;
|
|
|
pruneComponentPropsCache2(uid2);
|
|
|
instance.__counter = instance.__counter === 0 ? 1 : 0;
|
|
|
- let result;
|
|
|
+ let result2;
|
|
|
const prev = setCurrentRenderingInstance(instance);
|
|
|
try {
|
|
|
if (vnode.shapeFlag & 4) {
|
|
|
fallthroughAttrs(inheritAttrs, props, propsOptions, attrs);
|
|
|
const proxyToUse = withProxy || proxy;
|
|
|
- result = render.call(
|
|
|
+ result2 = render.call(
|
|
|
proxyToUse,
|
|
|
proxyToUse,
|
|
|
renderCache,
|
|
@@ -4518,7 +4568,7 @@ function renderComponentRoot(instance) {
|
|
|
Component2.props ? attrs : getFunctionalFallthrough(attrs)
|
|
|
);
|
|
|
const render2 = Component2;
|
|
|
- result = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
|
|
|
+ result2 = render2.length > 1 ? render2(props, { attrs, slots, emit: emit2 }) : render2(
|
|
|
props,
|
|
|
null
|
|
|
/* we know it doesn't need it */
|
|
@@ -4526,11 +4576,11 @@ function renderComponentRoot(instance) {
|
|
|
}
|
|
|
} catch (err) {
|
|
|
handleError(err, instance, 1);
|
|
|
- result = false;
|
|
|
+ result2 = false;
|
|
|
}
|
|
|
setRef$1(instance);
|
|
|
setCurrentRenderingInstance(prev);
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
}
|
|
|
function fallthroughAttrs(inheritAttrs, props, propsOptions, fallthroughAttrs2) {
|
|
|
if (props && fallthroughAttrs2 && inheritAttrs !== false) {
|
|
@@ -4825,15 +4875,15 @@ if (typeof atob !== "function") {
|
|
|
}
|
|
|
str += "==".slice(2 - (str.length & 3));
|
|
|
var bitmap;
|
|
|
- var result = "";
|
|
|
+ var result2 = "";
|
|
|
var r1;
|
|
|
var r2;
|
|
|
var i = 0;
|
|
|
for (; i < str.length; ) {
|
|
|
bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
|
|
|
- result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
|
|
+ result2 += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
|
|
}
|
|
|
- return result;
|
|
|
+ return result2;
|
|
|
};
|
|
|
} else {
|
|
|
realAtob = atob;
|
|
@@ -4897,6 +4947,11 @@ function initApp(app) {
|
|
|
}
|
|
|
}
|
|
|
const propsCaches = /* @__PURE__ */ Object.create(null);
|
|
|
+function renderProps(props) {
|
|
|
+ const { uid: uid2, __counter } = getCurrentInstance();
|
|
|
+ const propsId = (propsCaches[uid2] || (propsCaches[uid2] = [])).push(guardReactiveProps(props)) - 1;
|
|
|
+ return uid2 + "," + propsId + "," + __counter;
|
|
|
+}
|
|
|
function pruneComponentPropsCache(uid2) {
|
|
|
delete propsCaches[uid2];
|
|
|
}
|
|
@@ -4937,6 +4992,102 @@ function getCreateApp() {
|
|
|
return my[method];
|
|
|
}
|
|
|
}
|
|
|
+function vOn(value, key) {
|
|
|
+ const instance = getCurrentInstance();
|
|
|
+ const ctx = instance.ctx;
|
|
|
+ const extraKey = typeof key !== "undefined" && (ctx.$mpPlatform === "mp-weixin" || ctx.$mpPlatform === "mp-qq" || ctx.$mpPlatform === "mp-xhs") && (isString(key) || typeof key === "number") ? "_" + key : "";
|
|
|
+ const name = "e" + instance.$ei++ + extraKey;
|
|
|
+ const mpInstance = ctx.$scope;
|
|
|
+ if (!value) {
|
|
|
+ delete mpInstance[name];
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ const existingInvoker = mpInstance[name];
|
|
|
+ if (existingInvoker) {
|
|
|
+ existingInvoker.value = value;
|
|
|
+ } else {
|
|
|
+ mpInstance[name] = createInvoker(value, instance);
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+}
|
|
|
+function createInvoker(initialValue, instance) {
|
|
|
+ const invoker = (e2) => {
|
|
|
+ patchMPEvent(e2);
|
|
|
+ let args = [e2];
|
|
|
+ if (instance && instance.ctx.$getTriggerEventDetail) {
|
|
|
+ if (typeof e2.detail === "number") {
|
|
|
+ e2.detail = instance.ctx.$getTriggerEventDetail(e2.detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e2.detail && e2.detail.__args__) {
|
|
|
+ args = e2.detail.__args__;
|
|
|
+ }
|
|
|
+ const eventValue = invoker.value;
|
|
|
+ const invoke = () => callWithAsyncErrorHandling(patchStopImmediatePropagation(e2, eventValue), instance, 5, args);
|
|
|
+ const eventTarget = e2.target;
|
|
|
+ const eventSync = eventTarget ? eventTarget.dataset ? String(eventTarget.dataset.eventsync) === "true" : false : false;
|
|
|
+ if (bubbles.includes(e2.type) && !eventSync) {
|
|
|
+ setTimeout(invoke);
|
|
|
+ } else {
|
|
|
+ const res = invoke();
|
|
|
+ if (e2.type === "input" && (isArray(res) || isPromise(res))) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ invoker.value = initialValue;
|
|
|
+ return invoker;
|
|
|
+}
|
|
|
+const bubbles = [
|
|
|
+ // touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
|
|
|
+ // 'touchstart',
|
|
|
+ // 'touchmove',
|
|
|
+ // 'touchcancel',
|
|
|
+ // 'touchend',
|
|
|
+ "tap",
|
|
|
+ "longpress",
|
|
|
+ "longtap",
|
|
|
+ "transitionend",
|
|
|
+ "animationstart",
|
|
|
+ "animationiteration",
|
|
|
+ "animationend",
|
|
|
+ "touchforcechange"
|
|
|
+];
|
|
|
+function patchMPEvent(event, instance) {
|
|
|
+ if (event.type && event.target) {
|
|
|
+ event.preventDefault = NOOP;
|
|
|
+ event.stopPropagation = NOOP;
|
|
|
+ event.stopImmediatePropagation = NOOP;
|
|
|
+ if (!hasOwn(event, "detail")) {
|
|
|
+ event.detail = {};
|
|
|
+ }
|
|
|
+ if (hasOwn(event, "markerId")) {
|
|
|
+ event.detail = typeof event.detail === "object" ? event.detail : {};
|
|
|
+ event.detail.markerId = event.markerId;
|
|
|
+ }
|
|
|
+ if (isPlainObject(event.detail) && hasOwn(event.detail, "checked") && !hasOwn(event.detail, "value")) {
|
|
|
+ event.detail.value = event.detail.checked;
|
|
|
+ }
|
|
|
+ if (isPlainObject(event.detail)) {
|
|
|
+ event.target = extend({}, event.target, event.detail);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+function patchStopImmediatePropagation(e2, value) {
|
|
|
+ if (isArray(value)) {
|
|
|
+ const originalStop = e2.stopImmediatePropagation;
|
|
|
+ e2.stopImmediatePropagation = () => {
|
|
|
+ originalStop && originalStop.call(e2);
|
|
|
+ e2._stopped = true;
|
|
|
+ };
|
|
|
+ return value.map((fn) => (e3) => !e3._stopped && fn(e3));
|
|
|
+ } else {
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+}
|
|
|
+const o = (value, key) => vOn(value, key);
|
|
|
+const p = (props) => renderProps(props);
|
|
|
function createApp$1(rootComponent, rootProps = null) {
|
|
|
rootComponent && (rootComponent.mpType = "app");
|
|
|
return createVueApp(rootComponent, rootProps).use(plugin);
|
|
@@ -5258,8 +5409,8 @@ function promisify$1(name, fn) {
|
|
|
if (hasCallback(args)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, fn, extend({}, args), rest));
|
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
- invokeApi(name, fn, extend({}, args, { success: resolve, fail: reject }), rest);
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
+ invokeApi(name, fn, extend({}, args, { success: resolve2, fail: reject }), rest);
|
|
|
})));
|
|
|
};
|
|
|
}
|
|
@@ -5270,10 +5421,10 @@ function formatApiArgs(args, options) {
|
|
|
}
|
|
|
}
|
|
|
function invokeSuccess(id, name, res) {
|
|
|
- const result = {
|
|
|
+ const result2 = {
|
|
|
errMsg: name + ":ok"
|
|
|
};
|
|
|
- return invokeCallback(id, extend(res || {}, result));
|
|
|
+ return invokeCallback(id, extend(res || {}, result2));
|
|
|
}
|
|
|
function invokeFail(id, name, errMsg, errRes = {}) {
|
|
|
const errMsgPrefix = name + ":fail";
|
|
@@ -5379,19 +5530,19 @@ const upx2px = defineSyncApi(API_UPX2PX, (number, newDeviceWidth) => {
|
|
|
return 0;
|
|
|
}
|
|
|
let width = newDeviceWidth || deviceWidth;
|
|
|
- let result = number / BASE_DEVICE_WIDTH * width;
|
|
|
- if (result < 0) {
|
|
|
- result = -result;
|
|
|
+ let result2 = number / BASE_DEVICE_WIDTH * width;
|
|
|
+ if (result2 < 0) {
|
|
|
+ result2 = -result2;
|
|
|
}
|
|
|
- result = Math.floor(result + EPS);
|
|
|
- if (result === 0) {
|
|
|
+ result2 = Math.floor(result2 + EPS);
|
|
|
+ if (result2 === 0) {
|
|
|
if (deviceDPR === 1 || !isIOS) {
|
|
|
- result = 1;
|
|
|
+ result2 = 1;
|
|
|
} else {
|
|
|
- result = 0.5;
|
|
|
+ result2 = 0.5;
|
|
|
}
|
|
|
}
|
|
|
- return number < 0 ? -result : result;
|
|
|
+ return number < 0 ? -result2 : result2;
|
|
|
}, Upx2pxProtocol);
|
|
|
function __f__(type, filename, ...args) {
|
|
|
if (filename) {
|
|
@@ -5580,7 +5731,7 @@ function invokeGetPushCidCallbacks(cid2, errMsg) {
|
|
|
getPushCidCallbacks.length = 0;
|
|
|
}
|
|
|
const API_GET_PUSH_CLIENT_ID = "getPushClientId";
|
|
|
-const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, reject }) => {
|
|
|
+const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve: resolve2, reject }) => {
|
|
|
Promise.resolve().then(() => {
|
|
|
if (typeof enabled === "undefined") {
|
|
|
enabled = false;
|
|
@@ -5589,7 +5740,7 @@ const getPushClientId = defineAsyncApi(API_GET_PUSH_CLIENT_ID, (_, { resolve, re
|
|
|
}
|
|
|
getPushCidCallbacks.push((cid2, errMsg) => {
|
|
|
if (cid2) {
|
|
|
- resolve({ cid: cid2 });
|
|
|
+ resolve2({ cid: cid2 });
|
|
|
} else {
|
|
|
reject(errMsg);
|
|
|
}
|
|
@@ -5658,9 +5809,9 @@ function promisify(name, api) {
|
|
|
if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
|
|
|
return wrapperReturnValue(name, invokeApi(name, api, extend({}, options), rest));
|
|
|
}
|
|
|
- return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {
|
|
|
+ return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
|
|
|
invokeApi(name, api, extend({}, options, {
|
|
|
- success: resolve,
|
|
|
+ success: resolve2,
|
|
|
fail: reject
|
|
|
}), rest);
|
|
|
})));
|
|
@@ -6267,13 +6418,13 @@ function initRuntimeSocket(hosts, port, id) {
|
|
|
}
|
|
|
const SOCKET_TIMEOUT = 500;
|
|
|
function tryConnectSocket(host2, port, id) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
+ return new Promise((resolve2, reject) => {
|
|
|
const socket = index.connectSocket({
|
|
|
url: `ws://${host2}:${port}/${id}`,
|
|
|
multiple: true,
|
|
|
// 支付宝小程序 是否开启多实例
|
|
|
fail() {
|
|
|
- resolve(null);
|
|
|
+ resolve2(null);
|
|
|
}
|
|
|
});
|
|
|
const timer = setTimeout(() => {
|
|
@@ -6281,19 +6432,19 @@ function tryConnectSocket(host2, port, id) {
|
|
|
code: 1006,
|
|
|
reason: "connect timeout"
|
|
|
});
|
|
|
- resolve(null);
|
|
|
+ resolve2(null);
|
|
|
}, SOCKET_TIMEOUT);
|
|
|
socket.onOpen((e) => {
|
|
|
clearTimeout(timer);
|
|
|
- resolve(socket);
|
|
|
+ resolve2(socket);
|
|
|
});
|
|
|
socket.onClose((e) => {
|
|
|
clearTimeout(timer);
|
|
|
- resolve(null);
|
|
|
+ resolve2(null);
|
|
|
});
|
|
|
socket.onError((e) => {
|
|
|
clearTimeout(timer);
|
|
|
- resolve(null);
|
|
|
+ resolve2(null);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
@@ -6641,14 +6792,14 @@ function formatCSSStyleDeclaration(style, depth) {
|
|
|
};
|
|
|
}
|
|
|
function formatObjectProperty(name, value, depth) {
|
|
|
- const result = formatArg(value, depth);
|
|
|
- result.name = name;
|
|
|
- return result;
|
|
|
+ const result2 = formatArg(value, depth);
|
|
|
+ result2.name = name;
|
|
|
+ return result2;
|
|
|
}
|
|
|
function formatArrayElement(value, index2, depth) {
|
|
|
- const result = formatArg(value, depth);
|
|
|
- result.name = `${index2}`;
|
|
|
- return result;
|
|
|
+ const result2 = formatArg(value, depth);
|
|
|
+ result2.name = `${index2}`;
|
|
|
+ return result2;
|
|
|
}
|
|
|
function formatSetEntry(value, depth) {
|
|
|
return {
|
|
@@ -6756,9 +6907,9 @@ function isConsoleWritable() {
|
|
|
return isWritable;
|
|
|
}
|
|
|
function initRuntimeSocketService() {
|
|
|
- const hosts = "192.168.1.8,127.0.0.1";
|
|
|
+ const hosts = "192.168.1.10,127.0.0.1";
|
|
|
const port = "8090";
|
|
|
- const id = "mp-weixin_K9WxGx";
|
|
|
+ const id = "mp-weixin_H_8Yl-";
|
|
|
const lazy = typeof swan !== "undefined";
|
|
|
let restoreError = lazy ? () => {
|
|
|
} : initOnError();
|
|
@@ -7704,7 +7855,260 @@ const createSubpackageApp = initCreateSubpackageApp();
|
|
|
wx.createPluginApp = global.createPluginApp = createPluginApp;
|
|
|
wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
|
|
|
}
|
|
|
+function getDefaultExportFromCjs(x) {
|
|
|
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
|
+}
|
|
|
+var _createClass = /* @__PURE__ */ function() {
|
|
|
+ function a(e, c) {
|
|
|
+ for (var b = 0; b < c.length; b++) {
|
|
|
+ var d = c[b];
|
|
|
+ d.enumerable = d.enumerable || false;
|
|
|
+ d.configurable = true;
|
|
|
+ if ("value" in d) {
|
|
|
+ d.writable = true;
|
|
|
+ }
|
|
|
+ Object.defineProperty(e, d.key, d);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return function(d, b, c) {
|
|
|
+ if (b) {
|
|
|
+ a(d.prototype, b);
|
|
|
+ }
|
|
|
+ if (c) {
|
|
|
+ a(d, c);
|
|
|
+ }
|
|
|
+ return d;
|
|
|
+ };
|
|
|
+}();
|
|
|
+function _classCallCheck(a, b) {
|
|
|
+ if (!(a instanceof b)) {
|
|
|
+ throw new TypeError("Cannot call a class as a function");
|
|
|
+ }
|
|
|
+}
|
|
|
+var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: "key格式错误", PARAM_ERR: 310, PARAM_ERR_MSG: "请求参数信息有误", SYSTEM_ERR: 600, SYSTEM_ERR_MSG: "系统错误", WX_ERR_CODE: 1e3, WX_OK_CODE: 200 };
|
|
|
+var BASE_URL = "https://apis.map.qq.com/ws/";
|
|
|
+var URL_SEARCH = BASE_URL + "place/v1/search";
|
|
|
+var URL_SUGGESTION = BASE_URL + "place/v1/suggestion";
|
|
|
+var URL_GET_GEOCODER = BASE_URL + "geocoder/v1/";
|
|
|
+var URL_CITY_LIST = BASE_URL + "district/v1/list";
|
|
|
+var URL_AREA_LIST = BASE_URL + "district/v1/getchildren";
|
|
|
+var URL_DISTANCE = BASE_URL + "distance/v1/";
|
|
|
+var Utils = { location2query: function location2query(c) {
|
|
|
+ if (typeof c == "string") {
|
|
|
+ return c;
|
|
|
+ }
|
|
|
+ var b = "";
|
|
|
+ for (var a = 0; a < c.length; a++) {
|
|
|
+ var e = c[a];
|
|
|
+ if (!!b) {
|
|
|
+ b += ";";
|
|
|
+ }
|
|
|
+ if (e.location) {
|
|
|
+ b = b + e.location.lat + "," + e.location.lng;
|
|
|
+ }
|
|
|
+ if (e.latitude && e.longitude) {
|
|
|
+ b = b + e.latitude + "," + e.longitude;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return b;
|
|
|
+}, getWXLocation: function getWXLocation(c, b, a) {
|
|
|
+ wx$1.getLocation({ type: "gcj02", success: c, fail: b, complete: a });
|
|
|
+}, getLocationParam: function getLocationParam(b) {
|
|
|
+ if (typeof b == "string") {
|
|
|
+ var a = b.split(",");
|
|
|
+ if (a.length === 2) {
|
|
|
+ b = { latitude: b.split(",")[0], longitude: b.split(",")[1] };
|
|
|
+ } else {
|
|
|
+ b = {};
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return b;
|
|
|
+}, polyfillParam: function polyfillParam(a) {
|
|
|
+ a.success = a.success || function() {
|
|
|
+ };
|
|
|
+ a.fail = a.fail || function() {
|
|
|
+ };
|
|
|
+ a.complete = a.complete || function() {
|
|
|
+ };
|
|
|
+}, checkParamKeyEmpty: function checkParamKeyEmpty(c, b) {
|
|
|
+ if (!c[b]) {
|
|
|
+ var a = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + b + "参数格式有误");
|
|
|
+ c.fail(a);
|
|
|
+ c.complete(a);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+}, checkKeyword: function checkKeyword(a) {
|
|
|
+ return !this.checkParamKeyEmpty(a, "keyword");
|
|
|
+}, checkLocation: function checkLocation(c) {
|
|
|
+ var a = this.getLocationParam(c.location);
|
|
|
+ if (!a || !a.latitude || !a.longitude) {
|
|
|
+ var b = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + " location参数格式有误");
|
|
|
+ c.fail(b);
|
|
|
+ c.complete(b);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}, buildErrorConfig: function buildErrorConfig(a, b) {
|
|
|
+ return { status: a, message: b };
|
|
|
+}, buildWxRequestConfig: function buildWxRequestConfig(c, a) {
|
|
|
+ var b = this;
|
|
|
+ a.header = { "content-type": "application/json" };
|
|
|
+ a.method = "GET";
|
|
|
+ a.success = function(d) {
|
|
|
+ var e = d.data;
|
|
|
+ if (e.status === 0) {
|
|
|
+ c.success(e);
|
|
|
+ } else {
|
|
|
+ c.fail(e);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ a.fail = function(d) {
|
|
|
+ d.statusCode = ERROR_CONF.WX_ERR_CODE;
|
|
|
+ c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg));
|
|
|
+ };
|
|
|
+ a.complete = function(d) {
|
|
|
+ var e = +d.statusCode;
|
|
|
+ switch (e) {
|
|
|
+ case ERROR_CONF.WX_ERR_CODE:
|
|
|
+ c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, d.errMsg));
|
|
|
+ break;
|
|
|
+ case ERROR_CONF.WX_OK_CODE:
|
|
|
+ var f = d.data;
|
|
|
+ if (f.status === 0) {
|
|
|
+ c.complete(f);
|
|
|
+ } else {
|
|
|
+ c.complete(b.buildErrorConfig(f.status, f.message));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return a;
|
|
|
+}, locationProcess: function locationProcess(f, e, c, a) {
|
|
|
+ var d = this;
|
|
|
+ c = c || function(g) {
|
|
|
+ g.statusCode = ERROR_CONF.WX_ERR_CODE;
|
|
|
+ f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg));
|
|
|
+ };
|
|
|
+ a = a || function(g) {
|
|
|
+ if (g.statusCode == ERROR_CONF.WX_ERR_CODE) {
|
|
|
+ f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg));
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if (!f.location) {
|
|
|
+ d.getWXLocation(e, c, a);
|
|
|
+ } else {
|
|
|
+ if (d.checkLocation(f)) {
|
|
|
+ var b = Utils.getLocationParam(f.location);
|
|
|
+ e(b);
|
|
|
+ }
|
|
|
+ }
|
|
|
+} };
|
|
|
+var QQMapWX = function() {
|
|
|
+ function b(i) {
|
|
|
+ _classCallCheck(this, b);
|
|
|
+ if (!i.key) {
|
|
|
+ throw Error("key值不能为空");
|
|
|
+ }
|
|
|
+ this.key = i.key;
|
|
|
+ }
|
|
|
+ _createClass(b, [{ key: "search", value: function f(i) {
|
|
|
+ var l = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ if (!Utils.checkKeyword(i)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var k = { keyword: i.keyword, orderby: i.orderby || "_distance", page_size: i.page_size || 10, page_index: i.page_index || 1, output: "json", key: l.key };
|
|
|
+ if (i.address_format) {
|
|
|
+ k.address_format = i.address_format;
|
|
|
+ }
|
|
|
+ if (i.filter) {
|
|
|
+ k.filter = i.filter;
|
|
|
+ }
|
|
|
+ var n = i.distance || "1000";
|
|
|
+ var j = i.auto_extend || 1;
|
|
|
+ var m = function m2(o2) {
|
|
|
+ k.boundary = "nearby(" + o2.latitude + "," + o2.longitude + "," + n + "," + j + ")";
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_SEARCH, data: k }));
|
|
|
+ };
|
|
|
+ Utils.locationProcess(i, m);
|
|
|
+ } }, { key: "getSuggestion", value: function h(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ if (!Utils.checkKeyword(i)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var j = { keyword: i.keyword, region: i.region || "全国", region_fix: i.region_fix || 0, policy: i.policy || 0, output: "json", key: k.key };
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_SUGGESTION, data: j }));
|
|
|
+ } }, { key: "reverseGeocoder", value: function a(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ var j = { coord_type: i.coord_type || 5, get_poi: i.get_poi || 0, output: "json", key: k.key };
|
|
|
+ if (i.poi_options) {
|
|
|
+ j.poi_options = i.poi_options;
|
|
|
+ }
|
|
|
+ var l = function l2(m) {
|
|
|
+ j.location = m.latitude + "," + m.longitude;
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_GET_GEOCODER, data: j }));
|
|
|
+ };
|
|
|
+ Utils.locationProcess(i, l);
|
|
|
+ } }, { key: "geocoder", value: function g(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ if (Utils.checkParamKeyEmpty(i, "address")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var j = { address: i.address, output: "json", key: k.key };
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_GET_GEOCODER, data: j }));
|
|
|
+ } }, { key: "getCityList", value: function c(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ var j = { output: "json", key: k.key };
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_CITY_LIST, data: j }));
|
|
|
+ } }, { key: "getDistrictByCityId", value: function d(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ if (Utils.checkParamKeyEmpty(i, "id")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var j = { id: i.id || "", output: "json", key: k.key };
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_AREA_LIST, data: j }));
|
|
|
+ } }, { key: "calculateDistance", value: function e(i) {
|
|
|
+ var k = this;
|
|
|
+ i = i || {};
|
|
|
+ Utils.polyfillParam(i);
|
|
|
+ if (Utils.checkParamKeyEmpty(i, "to")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var j = { mode: i.mode || "walking", to: Utils.location2query(i.to), output: "json", key: k.key };
|
|
|
+ var l = function l2(m) {
|
|
|
+ j.from = m.latitude + "," + m.longitude;
|
|
|
+ wx$1.request(Utils.buildWxRequestConfig(i, { url: URL_DISTANCE, data: j }));
|
|
|
+ };
|
|
|
+ if (i.from) {
|
|
|
+ i.location = i.from;
|
|
|
+ }
|
|
|
+ Utils.locationProcess(i, l);
|
|
|
+ } }]);
|
|
|
+ return b;
|
|
|
+}();
|
|
|
+var qqmapWxJssdk_min = QQMapWX;
|
|
|
+const QQMapWX$1 = /* @__PURE__ */ getDefaultExportFromCjs(qqmapWxJssdk_min);
|
|
|
+exports.QQMapWX = QQMapWX$1;
|
|
|
exports._export_sfc = _export_sfc;
|
|
|
exports.createSSRApp = createSSRApp;
|
|
|
exports.index = index;
|
|
|
+exports.o = o;
|
|
|
+exports.onMounted = onMounted;
|
|
|
+exports.p = p;
|
|
|
+exports.ref = ref;
|
|
|
+exports.resolveComponent = resolveComponent;
|
|
|
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|