|
|
@@ -249,25 +249,24 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
// 引导用户去设置页面开启通知
|
|
|
- this.$refs["DialogBox"]
|
|
|
- .confirm({
|
|
|
- title: "开启通知",
|
|
|
- content: "为了及时接收重要消息,请开启通知权限",
|
|
|
- DialogType: "inquiry",
|
|
|
- btn1: "取消",
|
|
|
- btn2: "确定",
|
|
|
- animation: 0,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- const Intent = plus.android.importClass('android.content.Intent');
|
|
|
- const Settings = plus.android.importClass('android.provider.Settings');
|
|
|
- const Uri = plus.android.importClass('android.net.Uri');
|
|
|
-
|
|
|
- const intent = new Intent();
|
|
|
- intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
|
|
- intent.putExtra(Settings.EXTRA_APP_PACKAGE, main.getPackageName());
|
|
|
- main.startActivity(intent);
|
|
|
- });
|
|
|
+ uni.showModal({
|
|
|
+ title: "开启通知",
|
|
|
+ content: "为了及时接收重要消息,请开启通知权限",
|
|
|
+ cancelText: "取消",
|
|
|
+ confirmText: "确定",
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ const Intent = plus.android.importClass('android.content.Intent');
|
|
|
+ const Settings = plus.android.importClass('android.provider.Settings');
|
|
|
+ const Uri = plus.android.importClass('android.net.Uri');
|
|
|
+
|
|
|
+ const intent = new Intent();
|
|
|
+ intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
|
|
|
+ intent.putExtra(Settings.EXTRA_APP_PACKAGE, main.getPackageName());
|
|
|
+ main.startActivity(intent);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
// iOS
|