Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
502cbd00
U
uni-app
项目概览
MuGuiLin
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
502cbd00
编写于
8月 23, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(push): add newPath event
上级
2f1b877a
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
159 addition
and
48 deletion
+159
-48
packages/uni-app-plus/dist/style.css
packages/uni-app-plus/dist/style.css
+1
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+34
-33
packages/uni-push/dist/uni-push.es.js
packages/uni-push/dist/uni-push.es.js
+32
-0
packages/uni-push/dist/uni-push.plus.es.js
packages/uni-push/dist/uni-push.plus.es.js
+53
-7
packages/uni-push/src/index.ts
packages/uni-push/src/index.ts
+2
-0
packages/uni-push/src/plus.ts
packages/uni-push/src/plus.ts
+3
-7
packages/uni-push/src/route.ts
packages/uni-push/src/route.ts
+34
-0
未找到文件。
packages/uni-app-plus/dist/style.css
浏览文件 @
502cbd00
此差异已折叠。
点击以展开。
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
502cbd00
...
@@ -1792,7 +1792,7 @@ function normalizeCustomEvent(name, domEvt, el, detail) {
...
@@ -1792,7 +1792,7 @@ function normalizeCustomEvent(name, domEvt, el, detail) {
};
};
}
}
const uniFormKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniForm" : "uf");
const uniFormKey = PolySymbol(process.env.NODE_ENV !== "production" ? "uniForm" : "uf");
var index$
A
= /* @__PURE__ */ defineBuiltInComponent({
var index$
B
= /* @__PURE__ */ defineBuiltInComponent({
name: "Form",
name: "Form",
emits: ["submit", "reset"],
emits: ["submit", "reset"],
setup(_props, {
setup(_props, {
...
@@ -1852,7 +1852,7 @@ function useProvideLabel() {
...
@@ -1852,7 +1852,7 @@ function useProvideLabel() {
});
});
return handlers;
return handlers;
}
}
var index$
z
= /* @__PURE__ */ defineBuiltInComponent({
var index$
A
= /* @__PURE__ */ defineBuiltInComponent({
name: "Label",
name: "Label",
props: labelProps,
props: labelProps,
setup(props2, {
setup(props2, {
...
@@ -1980,7 +1980,7 @@ const buttonProps = {
...
@@ -1980,7 +1980,7 @@ const buttonProps = {
default: false
default: false
}
}
};
};
var index$
y
= /* @__PURE__ */ defineBuiltInComponent({
var index$
z
= /* @__PURE__ */ defineBuiltInComponent({
name: "Button",
name: "Button",
props: buttonProps,
props: buttonProps,
setup(props2, {
setup(props2, {
...
@@ -4200,13 +4200,13 @@ const createMediaQueryObserver = /* @__PURE__ */ defineSyncApi("createMediaQuery
...
@@ -4200,13 +4200,13 @@ const createMediaQueryObserver = /* @__PURE__ */ defineSyncApi("createMediaQuery
}
}
return new ServiceMediaQueryObserver(getCurrentPageVm());
return new ServiceMediaQueryObserver(getCurrentPageVm());
});
});
let index$
x
= 0;
let index$
y
= 0;
let optionsCache = {};
let optionsCache = {};
function operateEditor(componentId, pageId, type, options) {
function operateEditor(componentId, pageId, type, options) {
const data = { options };
const data = { options };
const needCallOptions = options && ("success" in options || "fail" in options || "complete" in options);
const needCallOptions = options && ("success" in options || "fail" in options || "complete" in options);
if (needCallOptions) {
if (needCallOptions) {
const callbackId = String(index$
x
++);
const callbackId = String(index$
y
++);
data.callbackId = callbackId;
data.callbackId = callbackId;
optionsCache[callbackId] = options;
optionsCache[callbackId] = options;
}
}
...
@@ -6590,7 +6590,7 @@ const props$x = {
...
@@ -6590,7 +6590,7 @@ const props$x = {
default: true
default: true
}
}
};
};
var index$
w
= /* @__PURE__ */ defineBuiltInComponent({
var index$
x
= /* @__PURE__ */ defineBuiltInComponent({
inheritAttrs: false,
inheritAttrs: false,
name: "Canvas",
name: "Canvas",
compatConfig: {
compatConfig: {
...
@@ -7057,7 +7057,7 @@ const props$w = {
...
@@ -7057,7 +7057,7 @@ const props$w = {
default: ""
default: ""
}
}
};
};
var index$
v
= /* @__PURE__ */ defineBuiltInComponent({
var index$
w
= /* @__PURE__ */ defineBuiltInComponent({
name: "CheckboxGroup",
name: "CheckboxGroup",
props: props$w,
props: props$w,
emits: ["change"],
emits: ["change"],
...
@@ -7133,7 +7133,7 @@ const props$v = {
...
@@ -7133,7 +7133,7 @@ const props$v = {
default: ""
default: ""
}
}
};
};
var index$
u
= /* @__PURE__ */ defineBuiltInComponent({
var index$
v
= /* @__PURE__ */ defineBuiltInComponent({
name: "Checkbox",
name: "Checkbox",
props: props$v,
props: props$v,
setup(props2, {
setup(props2, {
...
@@ -8018,7 +8018,7 @@ const props$t = /* @__PURE__ */ extend({}, props$u, {
...
@@ -8018,7 +8018,7 @@ const props$t = /* @__PURE__ */ extend({}, props$u, {
default: false
default: false
}
}
});
});
var index$
t
= /* @__PURE__ */ defineBuiltInComponent({
var index$
u
= /* @__PURE__ */ defineBuiltInComponent({
name: "Editor",
name: "Editor",
props: props$t,
props: props$t,
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
emit: ["ready", "focus", "blur", "input", "statuschange", ...emit$1],
...
@@ -8080,7 +8080,7 @@ const ICONS = {
...
@@ -8080,7 +8080,7 @@ const ICONS = {
c: GREY_COLOR
c: GREY_COLOR
}
}
};
};
var index$
s
= /* @__PURE__ */ defineBuiltInComponent({
var index$
t
= /* @__PURE__ */ defineBuiltInComponent({
name: "Icon",
name: "Icon",
props: {
props: {
type: {
type: {
...
@@ -8144,7 +8144,7 @@ const IMAGE_MODES = {
...
@@ -8144,7 +8144,7 @@ const IMAGE_MODES = {
"bottom left": ["left bottom"],
"bottom left": ["left bottom"],
"bottom right": ["right bottom"]
"bottom right": ["right bottom"]
};
};
var index$
r
= /* @__PURE__ */ defineBuiltInComponent({
var index$
s
= /* @__PURE__ */ defineBuiltInComponent({
name: "Image",
name: "Image",
props: props$s,
props: props$s,
setup(props2, {
setup(props2, {
...
@@ -10325,7 +10325,7 @@ function createNavigatorOnClick(props2) {
...
@@ -10325,7 +10325,7 @@ function createNavigatorOnClick(props2) {
}
}
};
};
}
}
var index$
q
= /* @__PURE__ */ defineBuiltInComponent({
var index$
r
= /* @__PURE__ */ defineBuiltInComponent({
name: "Navigator",
name: "Navigator",
inheritAttrs: false,
inheritAttrs: false,
compatConfig: {
compatConfig: {
...
@@ -11426,7 +11426,7 @@ const progressProps = {
...
@@ -11426,7 +11426,7 @@ const progressProps = {
default: 0
default: 0
}
}
};
};
var index$
p
= /* @__PURE__ */ defineBuiltInComponent({
var index$
q
= /* @__PURE__ */ defineBuiltInComponent({
name: "Progress",
name: "Progress",
props: progressProps,
props: progressProps,
setup(props2) {
setup(props2) {
...
@@ -11505,7 +11505,7 @@ const props$p = {
...
@@ -11505,7 +11505,7 @@ const props$p = {
default: ""
default: ""
}
}
};
};
var index$
o
= /* @__PURE__ */ defineBuiltInComponent({
var index$
p
= /* @__PURE__ */ defineBuiltInComponent({
name: "RadioGroup",
name: "RadioGroup",
props: props$p,
props: props$p,
setup(props2, {
setup(props2, {
...
@@ -11612,7 +11612,7 @@ const props$o = {
...
@@ -11612,7 +11612,7 @@ const props$o = {
default: ""
default: ""
}
}
};
};
var index$
n
= /* @__PURE__ */ defineBuiltInComponent({
var index$
o
= /* @__PURE__ */ defineBuiltInComponent({
name: "Radio",
name: "Radio",
props: props$o,
props: props$o,
setup(props2, {
setup(props2, {
...
@@ -11939,7 +11939,7 @@ const props$n = {
...
@@ -11939,7 +11939,7 @@ const props$n = {
}
}
}
}
};
};
var index$
m
= /* @__PURE__ */ defineBuiltInComponent({
var index$
n
= /* @__PURE__ */ defineBuiltInComponent({
name: "RichText",
name: "RichText",
compatConfig: {
compatConfig: {
MODE: 3
MODE: 3
...
@@ -12509,7 +12509,7 @@ const props$l = {
...
@@ -12509,7 +12509,7 @@ const props$l = {
default: false
default: false
}
}
};
};
var index$
l
= /* @__PURE__ */ defineBuiltInComponent({
var index$
m
= /* @__PURE__ */ defineBuiltInComponent({
name: "Slider",
name: "Slider",
props: props$l,
props: props$l,
emits: ["changing", "change"],
emits: ["changing", "change"],
...
@@ -13344,7 +13344,7 @@ const props$i = {
...
@@ -13344,7 +13344,7 @@ const props$i = {
default: "#007aff"
default: "#007aff"
}
}
};
};
var index$
k
= /* @__PURE__ */ defineBuiltInComponent({
var index$
l
= /* @__PURE__ */ defineBuiltInComponent({
name: "Switch",
name: "Switch",
props: props$i,
props: props$i,
emits: ["change"],
emits: ["change"],
...
@@ -13446,7 +13446,7 @@ function normalizeText(text2, { space, decode: decode2 }) {
...
@@ -13446,7 +13446,7 @@ function normalizeText(text2, { space, decode: decode2 }) {
}
}
return text2.replace(/ /g, SPACE_UNICODE.nbsp).replace(/ /g, SPACE_UNICODE.ensp).replace(/ /g, SPACE_UNICODE.emsp).replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
return text2.replace(/ /g, SPACE_UNICODE.nbsp).replace(/ /g, SPACE_UNICODE.ensp).replace(/ /g, SPACE_UNICODE.emsp).replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'");
}
}
var index$
j
= /* @__PURE__ */ defineBuiltInComponent({
var index$
k
= /* @__PURE__ */ defineBuiltInComponent({
name: "Text",
name: "Text",
props: {
props: {
selectable: {
selectable: {
...
@@ -13522,7 +13522,7 @@ function setFixMargin() {
...
@@ -13522,7 +13522,7 @@ function setFixMargin() {
const DARK_TEST_STRING = "(prefers-color-scheme: dark)";
const DARK_TEST_STRING = "(prefers-color-scheme: dark)";
fixMargin = String(navigator.platform).indexOf("iP") === 0 && String(navigator.vendor).indexOf("Apple") === 0 && window.matchMedia(DARK_TEST_STRING).media !== DARK_TEST_STRING;
fixMargin = String(navigator.platform).indexOf("iP") === 0 && String(navigator.vendor).indexOf("Apple") === 0 && window.matchMedia(DARK_TEST_STRING).media !== DARK_TEST_STRING;
}
}
var index$
i
= /* @__PURE__ */ defineBuiltInComponent({
var index$
j
= /* @__PURE__ */ defineBuiltInComponent({
name: "Textarea",
name: "Textarea",
props: props$h,
props: props$h,
emits: ["confirm", "linechange", ...emit],
emits: ["confirm", "linechange", ...emit],
...
@@ -13647,7 +13647,7 @@ var index$i = /* @__PURE__ */ defineBuiltInComponent({
...
@@ -13647,7 +13647,7 @@ var index$i = /* @__PURE__ */ defineBuiltInComponent({
};
};
}
}
});
});
var index$
h
= /* @__PURE__ */ defineBuiltInComponent({
var index$
i
= /* @__PURE__ */ defineBuiltInComponent({
name: "View",
name: "View",
props: extend({}, hoverProps),
props: extend({}, hoverProps),
setup(props2, {
setup(props2, {
...
@@ -13711,13 +13711,13 @@ function useOn(name, callback) {
...
@@ -13711,13 +13711,13 @@ function useOn(name, callback) {
onMounted(() => UniViewJSBridge.on(name, callback));
onMounted(() => UniViewJSBridge.on(name, callback));
onBeforeUnmount(() => UniViewJSBridge.off(name));
onBeforeUnmount(() => UniViewJSBridge.off(name));
}
}
let index$
g
= 0;
let index$
h
= 0;
function useContextInfo(_id) {
function useContextInfo(_id) {
const page = useCurrentPageId();
const page = useCurrentPageId();
const instance2 = getCurrentInstance();
const instance2 = getCurrentInstance();
const vm = instance2.proxy;
const vm = instance2.proxy;
const type = vm.$options.name.toLowerCase();
const type = vm.$options.name.toLowerCase();
const id2 = _id || vm.id || `context${index$
g
++}`;
const id2 = _id || vm.id || `context${index$
h
++}`;
onMounted(() => {
onMounted(() => {
const el = vm.$el;
const el = vm.$el;
el.__uniContextInfo = {
el.__uniContextInfo = {
...
@@ -14248,7 +14248,7 @@ function initHistory() {
...
@@ -14248,7 +14248,7 @@ function initHistory() {
});
});
return history2;
return history2;
}
}
var index$
f
= {
var index$
g
= {
install(app) {
install(app) {
initApp$1(app);
initApp$1(app);
initViewPlugin(app);
initViewPlugin(app);
...
@@ -15084,7 +15084,7 @@ const props$g = {
...
@@ -15084,7 +15084,7 @@ const props$g = {
default: true
default: true
}
}
};
};
var index$
e
= /* @__PURE__ */ defineBuiltInComponent({
var index$
f
= /* @__PURE__ */ defineBuiltInComponent({
name: "Video",
name: "Video",
props: props$g,
props: props$g,
emits: ["fullscreenchange", "progress", "loadedmetadata", "waiting", "error", "play", "pause", "ended", "timeupdate"],
emits: ["fullscreenchange", "progress", "loadedmetadata", "waiting", "error", "play", "pause", "ended", "timeupdate"],
...
@@ -15317,7 +15317,7 @@ const props$f = {
...
@@ -15317,7 +15317,7 @@ const props$f = {
default: true
default: true
}
}
};
};
var index$
d
= /* @__PURE__ */ defineBuiltInComponent({
var index$
e
= /* @__PURE__ */ defineBuiltInComponent({
inheritAttrs: false,
inheritAttrs: false,
name: "WebView",
name: "WebView",
props: props$f,
props: props$f,
...
@@ -17594,13 +17594,13 @@ const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({
...
@@ -17594,13 +17594,13 @@ const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({
console.warn(t2("uni.chooseFile.notUserActivation"));
console.warn(t2("uni.chooseFile.notUserActivation"));
}
}
}, ChooseImageProtocol, ChooseImageOptions);
}, ChooseImageProtocol, ChooseImageOptions);
let index$
c
= 0;
let index$
d
= 0;
let overflow = "";
let overflow = "";
function preventScroll(prevent) {
function preventScroll(prevent) {
let before = index$
c
;
let before = index$
d
;
index$
c
+= prevent ? 1 : -1;
index$
d
+= prevent ? 1 : -1;
index$
c = Math.max(0, index$c
);
index$
d = Math.max(0, index$d
);
if (index$
c
> 0) {
if (index$
d
> 0) {
if (before === 0) {
if (before === 0) {
overflow = document.body.style.overflow;
overflow = document.body.style.overflow;
document.body.style.overflow = "hidden";
document.body.style.overflow = "hidden";
...
@@ -18366,10 +18366,11 @@ const onSocketOpen = /* @__PURE__ */ on("open");
...
@@ -18366,10 +18366,11 @@ const onSocketOpen = /* @__PURE__ */ on("open");
const onSocketError = /* @__PURE__ */ on("error");
const onSocketError = /* @__PURE__ */ on("error");
const onSocketMessage = /* @__PURE__ */ on("message");
const onSocketMessage = /* @__PURE__ */ on("message");
const onSocketClose = /* @__PURE__ */ on("close");
const onSocketClose = /* @__PURE__ */ on("close");
let index$c = 0;
function getJSONP(url, options, success, error) {
function getJSONP(url, options, success, error) {
var js = document.createElement("script");
var js = document.createElement("script");
var callbackKey = options.callback || "callback";
var callbackKey = options.callback || "callback";
var callbackName = "__
callback" + Date.now()
;
var callbackName = "__
uni_jsonp_callback_" + index$c++
;
var timeout = options.timeout || 3e4;
var timeout = options.timeout || 3e4;
var timing;
var timing;
function end() {
function end() {
...
@@ -22839,4 +22840,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
...
@@ -22839,4 +22840,4 @@ var index = /* @__PURE__ */ defineSystemComponent({
return openBlock(), createBlock("div", clazz, [loadingVNode]);
return openBlock(), createBlock("div", clazz, [loadingVNode]);
}
}
});
});
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$
y as Button, index$5 as Camera, index$w as Canvas, index$u as Checkbox, index$v as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$t as Editor, index$A as Form, index$s as Icon, index$r as Image, Input, index$z as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$q as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$p as Progress, index$n as Radio, index$o as RadioGroup, ResizeSensor, index$m as RichText, ScrollView, index$l as Slider, Swiper, SwiperItem, index$k as Switch, index$j as Text, index$i as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$e as Video, index$h as View, index$d as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closePreviewImage, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getAppBaseInfo, getClipboardData, getCurrentPages$1 as getCurrentPages, getDeviceInfo, getEnterOptionsSync, getFileInfo, getImageInfo, getLaunchOptionsSync, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getPushClientId, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, getWindowInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, interceptors, invokePushCallback, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offAppHide, offAppShow, offCompassChange, offError, offNetworkStatusChange, offPageNotFound, offPushMessage, offUnhandledRejection, offWindowResize, onAccelerometerChange, onAppHide, onAppShow, onCompassChange, onError, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onPageNotFound, onPushMessage, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUnhandledRejection, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$f
as plugin, preloadPage, previewImage, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setClipboardData, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, setPageMeta, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
export { $emit, $off, $on, $once, index$8 as Ad, index$7 as AdContentPage, index$6 as AdDraw, index$1 as AsyncErrorComponent, index as AsyncLoadingComponent, index$
z as Button, index$5 as Camera, index$x as Canvas, index$v as Checkbox, index$w as CheckboxGroup, index$a as CoverImage, index$b as CoverView, index$u as Editor, index$B as Form, index$t as Icon, index$s as Image, Input, index$A as Label, LayoutComponent, index$4 as LivePlayer, index$3 as LivePusher, Map$1 as Map, MovableArea, MovableView, index$r as Navigator, index$2 as PageComponent, index$9 as Picker, PickerView, PickerViewColumn, index$q as Progress, index$o as Radio, index$p as RadioGroup, ResizeSensor, index$n as RichText, ScrollView, index$m as Slider, Swiper, SwiperItem, index$l as Switch, index$k as Text, index$j as Textarea, UniServiceJSBridge$1 as UniServiceJSBridge, UniViewJSBridge$1 as UniViewJSBridge, index$f as Video, index$i as View, index$e as WebView, addInterceptor, addPhoneContact, arrayBufferToBase64, base64ToArrayBuffer, canIUse, canvasGetImageData, canvasPutImageData, canvasToTempFilePath, chooseFile, chooseImage, chooseLocation, chooseVideo, clearStorage, clearStorageSync, closePreviewImage, closeSocket, connectSocket, createAnimation$1 as createAnimation, createCameraContext, createCanvasContext, createInnerAudioContext, createIntersectionObserver, createLivePlayerContext, createMapContext, createMediaQueryObserver, createSelectorQuery, createVideoContext, cssBackdropFilter, cssConstant, cssEnv, cssVar, downloadFile, getApp$1 as getApp, getAppBaseInfo, getClipboardData, getCurrentPages$1 as getCurrentPages, getDeviceInfo, getEnterOptionsSync, getFileInfo, getImageInfo, getLaunchOptionsSync, getLeftWindowStyle, getLocale, getLocation, getNetworkType, getProvider, getPushClientId, getRealPath, getRecorderManager, getRightWindowStyle, getSavedFileInfo, getSavedFileList, getScreenBrightness, getSelectedTextRange$1 as getSelectedTextRange, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getTopWindowStyle, getVideoInfo, getWindowInfo, hideKeyboard, hideLeftWindow, hideLoading, hideNavigationBarLoading, hideRightWindow, hideTabBar, hideTabBarRedDot, hideToast, hideTopWindow, interceptors, invokePushCallback, loadFontFace, login, makePhoneCall, navigateBack, navigateTo, offAccelerometerChange, offAppHide, offAppShow, offCompassChange, offError, offNetworkStatusChange, offPageNotFound, offPushMessage, offUnhandledRejection, offWindowResize, onAccelerometerChange, onAppHide, onAppShow, onCompassChange, onError, onGyroscopeChange, onLocaleChange, onMemoryWarning, onNetworkStatusChange, onPageNotFound, onPushMessage, onSocketClose, onSocketError, onSocketMessage, onSocketOpen, onTabBarMidButtonTap, onUnhandledRejection, onUserCaptureScreen, onWindowResize, openDocument, openLocation, pageScrollTo, index$g
as plugin, preloadPage, previewImage, reLaunch, redirectTo, removeInterceptor, removeSavedFileInfo, removeStorage, removeStorageSync, removeTabBarBadge, request, saveFile, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, sendSocketMessage, setClipboardData, setKeepScreenOn, setLeftWindowStyle, setLocale, setNavigationBarColor, setNavigationBarTitle, setPageMeta, setRightWindowStyle, setScreenBrightness, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, setTopWindowStyle, setupApp, setupPage, setupWindow, showActionSheet, showLeftWindow, showLoading, showModal, showNavigationBarLoading, showRightWindow, showTabBar, showTabBarRedDot, showToast, showTopWindow, startAccelerometer, startCompass, startGyroscope, startPullDownRefresh, stopAccelerometer, stopCompass, stopGyroscope, stopPullDownRefresh, switchTab, uni$1 as uni, uploadFile, upx2px, useI18n, useTabBar, vibrateLong, vibrateShort };
packages/uni-push/dist/uni-push.es.js
浏览文件 @
502cbd00
...
@@ -103,6 +103,36 @@ var GtPush = /*@__PURE__*/getDefaultExportFromCjs(gtpushMin);
...
@@ -103,6 +103,36 @@ var GtPush = /*@__PURE__*/getDefaultExportFromCjs(gtpushMin);
function initPushNotification() {
function initPushNotification() {
// 仅 App 端
// 仅 App 端
if (typeof plus !== 'undefined' && plus.push) {
if (typeof plus !== 'undefined' && plus.push) {
plus.globalEvent.addEventListener('newPath', ({ path }) => {
if (!path) {
return;
}
// 指定的页面为当前页面
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
if (currentPage &&
currentPage.$page &&
currentPage.$page.fullPath === path) {
return;
}
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
uni.navigateTo({
url: path,
fail(res) {
if (res.errMsg.indexOf('tabbar') > -1) {
uni.switchTab({
url: path,
fail(res) {
console.error(res.errMsg);
},
});
}
else {
console.error(res.errMsg);
}
},
});
});
plus.push.addEventListener('click', (result) => {
plus.push.addEventListener('click', (result) => {
// @ts-expect-error
// @ts-expect-error
uni.invokePushCallback({
uni.invokePushCallback({
...
@@ -141,7 +171,9 @@ if (!appid) {
...
@@ -141,7 +171,9 @@ if (!appid) {
});
});
}
}
else {
else {
// #ifdef APP
initPushNotification();
initPushNotification();
// #endif
GtPush.init({
GtPush.init({
appid,
appid,
onError: (res) => {
onError: (res) => {
...
...
packages/uni-push/dist/uni-push.plus.es.js
浏览文件 @
502cbd00
// @ts-expect-error
function
initPushNotification
()
{
uni
.
invokePushCallback
({
// 仅 App 端
type
:
'
enabled
'
,
if
(
typeof
plus
!==
'
undefined
'
&&
plus
.
push
)
{
offline
:
true
,
plus
.
globalEvent
.
addEventListener
(
'
newPath
'
,
({
path
})
=>
{
});
if
(
!
path
)
{
Promise
.
resolve
().
then
(()
=>
{
return
;
plus
.
push
.
setAutoNotification
&&
plus
.
push
.
setAutoNotification
(
false
);
}
// 指定的页面为当前页面
const
pages
=
getCurrentPages
();
const
currentPage
=
pages
[
pages
.
length
-
1
];
if
(
currentPage
&&
currentPage
.
$page
&&
currentPage
.
$page
.
fullPath
===
path
)
{
return
;
}
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
uni
.
navigateTo
({
url
:
path
,
fail
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'
tabbar
'
)
>
-
1
)
{
uni
.
switchTab
({
url
:
path
,
fail
(
res
)
{
console
.
error
(
res
.
errMsg
);
},
});
}
else
{
console
.
error
(
res
.
errMsg
);
}
},
});
});
plus
.
push
.
addEventListener
(
'
click
'
,
(
result
)
=>
{
plus
.
push
.
addEventListener
(
'
click
'
,
(
result
)
=>
{
// @ts-expect-error
// @ts-expect-error
uni
.
invokePushCallback
({
uni
.
invokePushCallback
({
...
@@ -12,6 +38,26 @@ Promise.resolve().then(() => {
...
@@ -12,6 +38,26 @@ Promise.resolve().then(() => {
message
:
result
,
message
:
result
,
});
});
});
});
uni
.
onPushMessage
((
res
)
=>
{
if
(
res
.
type
===
'
receive
'
&&
res
.
data
&&
res
.
data
.
force_notification
)
{
// 创建通知栏
uni
.
createPushMessage
(
res
.
data
);
res
.
stopped
=
true
;
}
});
}
}
// @ts-expect-error
uni
.
invokePushCallback
({
type
:
'
enabled
'
,
offline
:
true
,
});
Promise
.
resolve
().
then
(()
=>
{
initPushNotification
();
plus
.
push
.
setAutoNotification
&&
plus
.
push
.
setAutoNotification
(
false
);
plus
.
push
.
addEventListener
(
'
receive
'
,
(
result
)
=>
{
plus
.
push
.
addEventListener
(
'
receive
'
,
(
result
)
=>
{
// @ts-expect-error
// @ts-expect-error
uni
.
invokePushCallback
({
uni
.
invokePushCallback
({
...
...
packages/uni-push/src/index.ts
浏览文件 @
502cbd00
...
@@ -21,7 +21,9 @@ if (!appid) {
...
@@ -21,7 +21,9 @@ if (!appid) {
})
})
})
})
}
else
{
}
else
{
// #ifdef APP
initPushNotification
()
initPushNotification
()
// #endif
GtPush
.
init
({
GtPush
.
init
({
appid
,
appid
,
onError
:
(
res
)
=>
{
onError
:
(
res
)
=>
{
...
...
packages/uni-push/src/plus.ts
浏览文件 @
502cbd00
import
{
initPushNotification
}
from
'
./route
'
// @ts-expect-error
// @ts-expect-error
uni
.
invokePushCallback
({
uni
.
invokePushCallback
({
type
:
'
enabled
'
,
type
:
'
enabled
'
,
offline
:
true
,
offline
:
true
,
})
})
Promise
.
resolve
().
then
(()
=>
{
Promise
.
resolve
().
then
(()
=>
{
initPushNotification
()
plus
.
push
.
setAutoNotification
&&
plus
.
push
.
setAutoNotification
(
false
)
plus
.
push
.
setAutoNotification
&&
plus
.
push
.
setAutoNotification
(
false
)
plus
.
push
.
addEventListener
(
'
click
'
,
(
result
)
=>
{
// @ts-expect-error
uni
.
invokePushCallback
({
type
:
'
click
'
,
message
:
result
,
})
})
plus
.
push
.
addEventListener
(
'
receive
'
,
(
result
)
=>
{
plus
.
push
.
addEventListener
(
'
receive
'
,
(
result
)
=>
{
// @ts-expect-error
// @ts-expect-error
uni
.
invokePushCallback
({
uni
.
invokePushCallback
({
...
...
packages/uni-push/src/route.ts
浏览文件 @
502cbd00
export
function
initPushNotification
()
{
export
function
initPushNotification
()
{
// 仅 App 端
// 仅 App 端
if
(
typeof
plus
!==
'
undefined
'
&&
plus
.
push
)
{
if
(
typeof
plus
!==
'
undefined
'
&&
plus
.
push
)
{
;(
plus
as
any
).
globalEvent
.
addEventListener
(
'
newPath
'
,
({
path
}:
{
path
:
string
})
=>
{
if
(
!
path
)
{
return
}
// 指定的页面为当前页面
const
pages
=
getCurrentPages
()
const
currentPage
=
pages
[
pages
.
length
-
1
]
if
(
currentPage
&&
(
currentPage
as
any
).
$page
&&
(
currentPage
as
any
).
$page
.
fullPath
===
path
)
{
return
}
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
uni
.
navigateTo
({
url
:
path
,
fail
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'
tabbar
'
)
>
-
1
)
{
uni
.
switchTab
({
url
:
path
,
fail
(
res
)
{
console
.
error
(
res
.
errMsg
)
},
})
}
else
{
console
.
error
(
res
.
errMsg
)
}
},
})
}
)
plus
.
push
.
addEventListener
(
'
click
'
,
(
result
)
=>
{
plus
.
push
.
addEventListener
(
'
click
'
,
(
result
)
=>
{
// @ts-expect-error
// @ts-expect-error
uni
.
invokePushCallback
({
uni
.
invokePushCallback
({
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录