uniapp打开位置信息设置页面

uniapp yekong
let system = uni.getSystemInfoSync(); // 获取系统信息
                if (system.platform === 'android') { // 判断平台
                    var context = plus.android.importClass("android.content.Context");

                    var locationManager = plus.android.importClass("android.location.LocationManager");

                    var main = plus.android.runtimeMainActivity();

                    var mainSvr = main.getSystemService(context.LOCATION_SERVICE);

                    var Intent = plus.android.importClass('android.content.Intent');

                    var Settings = plus.android.importClass('android.provider.Settings');

                    var intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);

                    main.startActivity(intent); // 打开系统设置GPS服务页面

                }
                else{
                    plus.runtime.openURL("app-settings://");
                }
喜欢