提交
This commit is contained in:
@@ -1,13 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var isIos
|
var isIos
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
isIos = (plus.os.name == "iOS")
|
isIos = (plus.os.name == "iOS")
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 判断推送权限是否开启
|
// 判断推送权限是否开启
|
||||||
function judgeIosPermissionPush() {
|
function judgeIosPermissionPush() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var UIApplication = plus.ios.import("UIApplication");
|
var UIApplication = plus.ios.import("UIApplication");
|
||||||
@@ -39,29 +38,29 @@ function judgeIosPermissionPush() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断定位权限是否开启
|
// 判断定位权限是否开启
|
||||||
function judgeIosPermissionLocation() {
|
function judgeIosPermissionLocation() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||||
var status = cllocationManger.authorizationStatus();
|
var status = cllocationManger.authorizationStatus();
|
||||||
result = (status != 2)
|
result = (status != 2)
|
||||||
console.log("定位权限开启:" + result);
|
console.log("定位权限开启:" + result);
|
||||||
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||||
/* var enable = cllocationManger.locationServicesEnabled();
|
/* var enable = cllocationManger.locationServicesEnabled();
|
||||||
var status = cllocationManger.authorizationStatus();
|
var status = cllocationManger.authorizationStatus();
|
||||||
console.log("enable:" + enable);
|
console.log("enable:" + enable);
|
||||||
console.log("status:" + status);
|
console.log("status:" + status);
|
||||||
if (enable && status != 2) {
|
if (enable && status != 2) {
|
||||||
result = true;
|
result = true;
|
||||||
console.log("手机定位服务已开启且已授予定位权限");
|
console.log("手机定位服务已开启且已授予定位权限");
|
||||||
} else {
|
} else {
|
||||||
console.log("手机系统的定位没有打开或未给予定位权限");
|
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||||
} */
|
} */
|
||||||
plus.ios.deleteObject(cllocationManger);
|
plus.ios.deleteObject(cllocationManger);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断麦克风权限是否开启
|
// 判断麦克风权限是否开启
|
||||||
function judgeIosPermissionRecord() {
|
function judgeIosPermissionRecord() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||||
@@ -78,7 +77,7 @@ function judgeIosPermissionRecord() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断相机权限是否开启
|
// 判断相机权限是否开启
|
||||||
function judgeIosPermissionCamera() {
|
function judgeIosPermissionCamera() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||||
@@ -94,7 +93,7 @@ function judgeIosPermissionCamera() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断相册权限是否开启
|
// 判断相册权限是否开启
|
||||||
function judgeIosPermissionPhotoLibrary() {
|
function judgeIosPermissionPhotoLibrary() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||||
@@ -110,7 +109,7 @@ function judgeIosPermissionPhotoLibrary() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断通讯录权限是否开启
|
// 判断通讯录权限是否开启
|
||||||
function judgeIosPermissionContact() {
|
function judgeIosPermissionContact() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var CNContactStore = plus.ios.import("CNContactStore");
|
var CNContactStore = plus.ios.import("CNContactStore");
|
||||||
@@ -125,7 +124,7 @@ function judgeIosPermissionContact() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断日历权限是否开启
|
// 判断日历权限是否开启
|
||||||
function judgeIosPermissionCalendar() {
|
function judgeIosPermissionCalendar() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var EKEventStore = plus.ios.import("EKEventStore");
|
var EKEventStore = plus.ios.import("EKEventStore");
|
||||||
@@ -140,7 +139,7 @@ function judgeIosPermissionCalendar() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断备忘录权限是否开启
|
// 判断备忘录权限是否开启
|
||||||
function judgeIosPermissionMemo() {
|
function judgeIosPermissionMemo() {
|
||||||
var result = false;
|
var result = false;
|
||||||
var EKEventStore = plus.ios.import("EKEventStore");
|
var EKEventStore = plus.ios.import("EKEventStore");
|
||||||
@@ -155,11 +154,12 @@ function judgeIosPermissionMemo() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Android权限查询
|
// Android权限查询
|
||||||
function requestAndroidPermission(permissionID) {
|
function requestAndroidPermission(permissionID) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
plus.android.requestPermissions(
|
plus.android.requestPermissions(
|
||||||
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
permissionID.split(","),
|
||||||
|
// [permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||||
function(resultObj) {
|
function(resultObj) {
|
||||||
var result = 0;
|
var result = 0;
|
||||||
for (var i = 0; i < resultObj.granted.length; i++) {
|
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||||
@@ -178,10 +178,10 @@ function requestAndroidPermission(permissionID) {
|
|||||||
result = -1
|
result = -1
|
||||||
}
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||||
// if (result != 1) {
|
// if (result != 1) {
|
||||||
// gotoAppPermissionSetting()
|
// gotoAppPermissionSetting()
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
function(error) {
|
function(error) {
|
||||||
console.log('申请权限错误:' + error.code + " = " + error.message);
|
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||||
@@ -194,7 +194,7 @@ function requestAndroidPermission(permissionID) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 使用一个方法,根据参数判断权限
|
// 使用一个方法,根据参数判断权限
|
||||||
function judgeIosPermission(permissionID) {
|
function judgeIosPermission(permissionID) {
|
||||||
if (permissionID == "location") {
|
if (permissionID == "location") {
|
||||||
return judgeIosPermissionLocation()
|
return judgeIosPermissionLocation()
|
||||||
@@ -216,13 +216,13 @@ function judgeIosPermission(permissionID) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跳转到**应用**的权限页面
|
// 跳转到**应用**的权限页面
|
||||||
function gotoAppPermissionSetting() {
|
function gotoAppPermissionSetting() {
|
||||||
if (isIos) {
|
if (isIos) {
|
||||||
var UIApplication = plus.ios.import("UIApplication");
|
var UIApplication = plus.ios.import("UIApplication");
|
||||||
var application2 = UIApplication.sharedApplication();
|
var application2 = UIApplication.sharedApplication();
|
||||||
var NSURL2 = plus.ios.import("NSURL");
|
var NSURL2 = plus.ios.import("NSURL");
|
||||||
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||||
application2.openURL(setting2);
|
application2.openURL(setting2);
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ function gotoAppPermissionSetting() {
|
|||||||
plus.ios.deleteObject(NSURL2);
|
plus.ios.deleteObject(NSURL2);
|
||||||
plus.ios.deleteObject(application2);
|
plus.ios.deleteObject(application2);
|
||||||
} else {
|
} else {
|
||||||
// console.log(plus.device.vendor);
|
// console.log(plus.device.vendor);
|
||||||
var Intent = plus.android.importClass("android.content.Intent");
|
var Intent = plus.android.importClass("android.content.Intent");
|
||||||
var Settings = plus.android.importClass("android.provider.Settings");
|
var Settings = plus.android.importClass("android.provider.Settings");
|
||||||
var Uri = plus.android.importClass("android.net.Uri");
|
var Uri = plus.android.importClass("android.net.Uri");
|
||||||
@@ -243,8 +243,8 @@ function gotoAppPermissionSetting() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查系统的设备服务是否开启
|
// 检查系统的设备服务是否开启
|
||||||
// var checkSystemEnableLocation = async function () {
|
// var checkSystemEnableLocation = async function () {
|
||||||
function checkSystemEnableLocation() {
|
function checkSystemEnableLocation() {
|
||||||
if (isIos) {
|
if (isIos) {
|
||||||
var result = false;
|
var result = false;
|
||||||
@@ -264,9 +264,142 @@ function checkSystemEnableLocation() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let permissionMap = {
|
||||||
|
"android": {
|
||||||
|
"CAMERA_EXTERNAL_STORAGE": {
|
||||||
|
"name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE,android.permission.CAMERA",
|
||||||
|
"title": "相机/相册权限说明",
|
||||||
|
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中读取和写入相册和文件内容"
|
||||||
|
},
|
||||||
|
"CAMERA": {
|
||||||
|
"name": "android.permission.CAMERA",
|
||||||
|
"title": "相机权限说明",
|
||||||
|
"content": "便于您使用该功能上传您的照片/图片用于上传用户头像、留言上传图片、申诉反馈上传图片等场景中拍摄图片"
|
||||||
|
},
|
||||||
|
// "EXTERNAL_STORAGE": {
|
||||||
|
// "name": "android.permission.READ_EXTERNAL_STORAGE,android.permission.WRITE_EXTERNAL_STORAGE",
|
||||||
|
// "title": "相册权限说明",
|
||||||
|
// "content": "便于您使用该功能上传您的照片/图片/视频及用于上传工单故障、维修图片、扫码识别设备等信息、意见反馈上传图片、上传设备、客户、设备图片等场景中读取和写入相册和文件内容"
|
||||||
|
// },
|
||||||
|
// "LOCATION": {
|
||||||
|
// "name": "android.location.LocationManager",
|
||||||
|
// "title": "定位权限说明",
|
||||||
|
// "content": "便于您使用该功能定位您当前的位置,并上报当前位置给服务器,来智能得按照当前位置给您分配距离您最近的工单信息等功能"
|
||||||
|
// },
|
||||||
|
// "CALLPHONE": {
|
||||||
|
// "name": "android.permission.CALL_PHONE",
|
||||||
|
// "title": "拨打电话权限说明",
|
||||||
|
// "content": "便于您使用该功能能够快速和提交工单信息的客户进行联系并进行及时处理"
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
"ios": {}
|
||||||
|
}
|
||||||
|
|
||||||
|
let view = null;
|
||||||
|
let viewShow = false;
|
||||||
|
|
||||||
|
function showViewDesc(permission) {
|
||||||
|
let plat = isIos ? "ios" : "android";
|
||||||
|
view = new plus.nativeObj.View('per-modal', {
|
||||||
|
top: '0px',
|
||||||
|
left: '0px',
|
||||||
|
width: '100%',
|
||||||
|
backgroundColor: 'rgba(0,0,0,0.4)',
|
||||||
|
//opacity: '.9'
|
||||||
|
})
|
||||||
|
view.drawRect({
|
||||||
|
color: '#fff',
|
||||||
|
radius: '5px'
|
||||||
|
}, {
|
||||||
|
top: '170px',
|
||||||
|
left: '5%',
|
||||||
|
width: '90%',
|
||||||
|
height: "150px",
|
||||||
|
})
|
||||||
|
view.drawText(permissionMap[plat][permission]["title"], {
|
||||||
|
top: '180px',
|
||||||
|
left: "8%",
|
||||||
|
height: "30px"
|
||||||
|
}, {
|
||||||
|
align: "left",
|
||||||
|
color: "#000",
|
||||||
|
}, {
|
||||||
|
onClick: function(e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
view.drawText(permissionMap[plat][permission]["content"], {
|
||||||
|
top: '210px',
|
||||||
|
height: "80px",
|
||||||
|
left: "8%",
|
||||||
|
width: "84%"
|
||||||
|
}, {
|
||||||
|
whiteSpace: 'normal',
|
||||||
|
size: "14px",
|
||||||
|
align: "left",
|
||||||
|
color: "#656563"
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
view.show()
|
||||||
|
}, 200)
|
||||||
|
}
|
||||||
|
|
||||||
|
function premissionCheck(permission) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
let plat = isIos ? "ios" : "android";
|
||||||
|
if (isIos) { // ios
|
||||||
|
// const camera = permission.judgeIosPermission("camera");//判断ios是否给予摄像头权限
|
||||||
|
// //ios相册没权限,系统会自动弹出授权框
|
||||||
|
// //let photoLibrary = permission.judgeIosPermission("photoLibrary");//判断ios是否给予相册权限
|
||||||
|
// if(camera){
|
||||||
|
// resolve();
|
||||||
|
// }else{
|
||||||
|
// reject('需要开启相机使用权限');
|
||||||
|
// }
|
||||||
|
resolve(1)
|
||||||
|
} else { // android
|
||||||
|
let permission_arr = permissionMap[plat][permission]["name"].split(",");
|
||||||
|
|
||||||
|
let flag = true;
|
||||||
|
for (let i = 0; i < permission_arr.length; i++) {
|
||||||
|
let status = plus.navigator.checkPermission(permission_arr[i]);
|
||||||
|
if (status == "undetermined") {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag == false) { // 未完全授权
|
||||||
|
showViewDesc(permission);
|
||||||
|
requestAndroidPermission(permissionMap[plat][permission]["name"]).then((res) => {
|
||||||
|
viewShow = false;
|
||||||
|
setTimeout(() => {
|
||||||
|
viewShow = true;
|
||||||
|
}, 120)
|
||||||
|
view.close();
|
||||||
|
// if (res == -1) {
|
||||||
|
// uni.showModal({
|
||||||
|
// title: '提示',
|
||||||
|
// content: '操作权限已被拒绝,请手动前往设置',
|
||||||
|
// confirmText: "立即设置",
|
||||||
|
// success: (res) => {
|
||||||
|
// if (res.confirm) {
|
||||||
|
// gotoAppPermissionSetting()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
resolve(res)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
judgeIosPermission: judgeIosPermission,
|
judgeIosPermission: judgeIosPermission,
|
||||||
requestAndroidPermission: requestAndroidPermission,
|
requestAndroidPermission: requestAndroidPermission,
|
||||||
checkSystemEnableLocation: checkSystemEnableLocation,
|
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||||
gotoAppPermissionSetting: gotoAppPermissionSetting
|
gotoAppPermissionSetting: gotoAppPermissionSetting,
|
||||||
}
|
premissionCheck: premissionCheck
|
||||||
|
}
|
||||||
272
js_sdk/wa-permission/permission11.js
Normal file
272
js_sdk/wa-permission/permission11.js
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
/**
|
||||||
|
* 本模块封装了Android、iOS的应用权限判断、打开应用权限设置界面、以及位置系统服务是否开启
|
||||||
|
*/
|
||||||
|
|
||||||
|
var isIos
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
isIos = (plus.os.name == "iOS")
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// 判断推送权限是否开启
|
||||||
|
function judgeIosPermissionPush() {
|
||||||
|
var result = false;
|
||||||
|
var UIApplication = plus.ios.import("UIApplication");
|
||||||
|
var app = UIApplication.sharedApplication();
|
||||||
|
var enabledTypes = 0;
|
||||||
|
if (app.currentUserNotificationSettings) {
|
||||||
|
var settings = app.currentUserNotificationSettings();
|
||||||
|
enabledTypes = settings.plusGetAttribute("types");
|
||||||
|
console.log("enabledTypes1:" + enabledTypes);
|
||||||
|
if (enabledTypes == 0) {
|
||||||
|
console.log("推送权限没有开启");
|
||||||
|
} else {
|
||||||
|
result = true;
|
||||||
|
console.log("已经开启推送功能!")
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(settings);
|
||||||
|
} else {
|
||||||
|
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||||
|
if (enabledTypes == 0) {
|
||||||
|
console.log("推送权限没有开启!");
|
||||||
|
} else {
|
||||||
|
result = true;
|
||||||
|
console.log("已经开启推送功能!")
|
||||||
|
}
|
||||||
|
console.log("enabledTypes2:" + enabledTypes);
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(app);
|
||||||
|
plus.ios.deleteObject(UIApplication);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断定位权限是否开启
|
||||||
|
function judgeIosPermissionLocation() {
|
||||||
|
var result = false;
|
||||||
|
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||||
|
var status = cllocationManger.authorizationStatus();
|
||||||
|
result = (status != 2)
|
||||||
|
console.log("定位权限开启:" + result);
|
||||||
|
// 以下代码判断了手机设备的定位是否关闭,推荐另行使用方法 checkSystemEnableLocation
|
||||||
|
/* var enable = cllocationManger.locationServicesEnabled();
|
||||||
|
var status = cllocationManger.authorizationStatus();
|
||||||
|
console.log("enable:" + enable);
|
||||||
|
console.log("status:" + status);
|
||||||
|
if (enable && status != 2) {
|
||||||
|
result = true;
|
||||||
|
console.log("手机定位服务已开启且已授予定位权限");
|
||||||
|
} else {
|
||||||
|
console.log("手机系统的定位没有打开或未给予定位权限");
|
||||||
|
} */
|
||||||
|
plus.ios.deleteObject(cllocationManger);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断麦克风权限是否开启
|
||||||
|
function judgeIosPermissionRecord() {
|
||||||
|
var result = false;
|
||||||
|
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||||
|
var avaudio = avaudiosession.sharedInstance();
|
||||||
|
var permissionStatus = avaudio.recordPermission();
|
||||||
|
console.log("permissionStatus:" + permissionStatus);
|
||||||
|
if (permissionStatus == 1684369017 || permissionStatus == 1970168948) {
|
||||||
|
console.log("麦克风权限没有开启");
|
||||||
|
} else {
|
||||||
|
result = true;
|
||||||
|
console.log("麦克风权限已经开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(avaudiosession);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断相机权限是否开启
|
||||||
|
function judgeIosPermissionCamera() {
|
||||||
|
var result = false;
|
||||||
|
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||||
|
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||||
|
console.log("authStatus:" + authStatus);
|
||||||
|
if (authStatus == 3) {
|
||||||
|
result = true;
|
||||||
|
console.log("相机权限已经开启");
|
||||||
|
} else {
|
||||||
|
console.log("相机权限没有开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(AVCaptureDevice);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断相册权限是否开启
|
||||||
|
function judgeIosPermissionPhotoLibrary() {
|
||||||
|
var result = false;
|
||||||
|
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||||
|
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||||
|
console.log("authStatus:" + authStatus);
|
||||||
|
if (authStatus == 3) {
|
||||||
|
result = true;
|
||||||
|
console.log("相册权限已经开启");
|
||||||
|
} else {
|
||||||
|
console.log("相册权限没有开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(PHPhotoLibrary);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断通讯录权限是否开启
|
||||||
|
function judgeIosPermissionContact() {
|
||||||
|
var result = false;
|
||||||
|
var CNContactStore = plus.ios.import("CNContactStore");
|
||||||
|
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||||
|
if (cnAuthStatus == 3) {
|
||||||
|
result = true;
|
||||||
|
console.log("通讯录权限已经开启");
|
||||||
|
} else {
|
||||||
|
console.log("通讯录权限没有开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(CNContactStore);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断日历权限是否开启
|
||||||
|
function judgeIosPermissionCalendar() {
|
||||||
|
var result = false;
|
||||||
|
var EKEventStore = plus.ios.import("EKEventStore");
|
||||||
|
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||||
|
if (ekAuthStatus == 3) {
|
||||||
|
result = true;
|
||||||
|
console.log("日历权限已经开启");
|
||||||
|
} else {
|
||||||
|
console.log("日历权限没有开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(EKEventStore);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断备忘录权限是否开启
|
||||||
|
function judgeIosPermissionMemo() {
|
||||||
|
var result = false;
|
||||||
|
var EKEventStore = plus.ios.import("EKEventStore");
|
||||||
|
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||||
|
if (ekAuthStatus == 3) {
|
||||||
|
result = true;
|
||||||
|
console.log("备忘录权限已经开启");
|
||||||
|
} else {
|
||||||
|
console.log("备忘录权限没有开启");
|
||||||
|
}
|
||||||
|
plus.ios.deleteObject(EKEventStore);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android权限查询
|
||||||
|
function requestAndroidPermission(permissionID) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
plus.android.requestPermissions(
|
||||||
|
[permissionID], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
|
||||||
|
function(resultObj) {
|
||||||
|
var result = 0;
|
||||||
|
for (var i = 0; i < resultObj.granted.length; i++) {
|
||||||
|
var grantedPermission = resultObj.granted[i];
|
||||||
|
console.log('已获取的权限:' + grantedPermission);
|
||||||
|
result = 1
|
||||||
|
}
|
||||||
|
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
|
||||||
|
var deniedPresentPermission = resultObj.deniedPresent[i];
|
||||||
|
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
|
||||||
|
result = 0
|
||||||
|
}
|
||||||
|
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
|
||||||
|
var deniedAlwaysPermission = resultObj.deniedAlways[i];
|
||||||
|
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
|
||||||
|
result = -1
|
||||||
|
}
|
||||||
|
resolve(result);
|
||||||
|
// 若所需权限被拒绝,则打开APP设置界面,可以在APP设置界面打开相应权限
|
||||||
|
// if (result != 1) {
|
||||||
|
// gotoAppPermissionSetting()
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
console.log('申请权限错误:' + error.code + " = " + error.message);
|
||||||
|
resolve({
|
||||||
|
code: error.code,
|
||||||
|
message: error.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用一个方法,根据参数判断权限
|
||||||
|
function judgeIosPermission(permissionID) {
|
||||||
|
if (permissionID == "location") {
|
||||||
|
return judgeIosPermissionLocation()
|
||||||
|
} else if (permissionID == "camera") {
|
||||||
|
return judgeIosPermissionCamera()
|
||||||
|
} else if (permissionID == "photoLibrary") {
|
||||||
|
return judgeIosPermissionPhotoLibrary()
|
||||||
|
} else if (permissionID == "record") {
|
||||||
|
return judgeIosPermissionRecord()
|
||||||
|
} else if (permissionID == "push") {
|
||||||
|
return judgeIosPermissionPush()
|
||||||
|
} else if (permissionID == "contact") {
|
||||||
|
return judgeIosPermissionContact()
|
||||||
|
} else if (permissionID == "calendar") {
|
||||||
|
return judgeIosPermissionCalendar()
|
||||||
|
} else if (permissionID == "memo") {
|
||||||
|
return judgeIosPermissionMemo()
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳转到**应用**的权限页面
|
||||||
|
function gotoAppPermissionSetting() {
|
||||||
|
if (isIos) {
|
||||||
|
var UIApplication = plus.ios.import("UIApplication");
|
||||||
|
var application2 = UIApplication.sharedApplication();
|
||||||
|
var NSURL2 = plus.ios.import("NSURL");
|
||||||
|
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
|
||||||
|
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||||
|
application2.openURL(setting2);
|
||||||
|
|
||||||
|
plus.ios.deleteObject(setting2);
|
||||||
|
plus.ios.deleteObject(NSURL2);
|
||||||
|
plus.ios.deleteObject(application2);
|
||||||
|
} else {
|
||||||
|
// console.log(plus.device.vendor);
|
||||||
|
var Intent = plus.android.importClass("android.content.Intent");
|
||||||
|
var Settings = plus.android.importClass("android.provider.Settings");
|
||||||
|
var Uri = plus.android.importClass("android.net.Uri");
|
||||||
|
var mainActivity = plus.android.runtimeMainActivity();
|
||||||
|
var intent = new Intent();
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
|
||||||
|
intent.setData(uri);
|
||||||
|
mainActivity.startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查系统的设备服务是否开启
|
||||||
|
// var checkSystemEnableLocation = async function () {
|
||||||
|
function checkSystemEnableLocation() {
|
||||||
|
if (isIos) {
|
||||||
|
var result = false;
|
||||||
|
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||||
|
var result = cllocationManger.locationServicesEnabled();
|
||||||
|
console.log("系统定位开启:" + result);
|
||||||
|
plus.ios.deleteObject(cllocationManger);
|
||||||
|
return result;
|
||||||
|
} else {
|
||||||
|
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 result = mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||||
|
console.log("系统定位开启:" + result);
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
judgeIosPermission: judgeIosPermission,
|
||||||
|
requestAndroidPermission: requestAndroidPermission,
|
||||||
|
checkSystemEnableLocation: checkSystemEnableLocation,
|
||||||
|
gotoAppPermissionSetting: gotoAppPermissionSetting
|
||||||
|
}
|
||||||
539
manifest.json
539
manifest.json
@@ -1,273 +1,270 @@
|
|||||||
{
|
{
|
||||||
"name" : "众妙之门",
|
"name": "众妙之门",
|
||||||
"appid" : "__UNI__5D0ED80",
|
"appid": "__UNI__5D0ED80",
|
||||||
"description" : "众妙之门",
|
"description": "众妙之门",
|
||||||
"networkTimeout" : {
|
"networkTimeout": {
|
||||||
"request" : 3000
|
"request": 3000
|
||||||
},
|
},
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
"icons" : [
|
"icons": [{
|
||||||
{
|
"sizes": "分辨率,192x192",
|
||||||
"sizes" : "分辨率,192x192",
|
"src": "图片路径"
|
||||||
"src" : "图片路径"
|
}],
|
||||||
}
|
"versionName": "1.0.18",
|
||||||
],
|
"versionCode": 1018,
|
||||||
"versionName" : "1.0.05",
|
"app-plus": {
|
||||||
"versionCode" : 1005,
|
"nvueCompiler": "weex",
|
||||||
"app-plus" : {
|
"compatible": {
|
||||||
"nvueCompiler" : "weex",
|
"ignoreVersion": true
|
||||||
"compatible" : {
|
},
|
||||||
"ignoreVersion" : true
|
"screenOrientation": [
|
||||||
},
|
"portrait-primary",
|
||||||
"screenOrientation" : [
|
"portrait-secondary",
|
||||||
"portrait-primary",
|
"landscape-primary",
|
||||||
"portrait-secondary",
|
"landscape-secondary"
|
||||||
"landscape-primary",
|
],
|
||||||
"landscape-secondary"
|
"privacy": {
|
||||||
],
|
"prompt": "template",
|
||||||
"privacy" : {
|
"template": {
|
||||||
"prompt" : "template",
|
"title": "用户协议和隐私政策",
|
||||||
"template" : {
|
"message": "请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href='https://zmzm.taihumed.com/agreement.html'>《用户协议》</a>和<a href='https://zmzm.taihumed.com/privacy.html'>《隐私协议》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
||||||
"title" : "用户协议和隐私政策",
|
"buttonAccept": "同意",
|
||||||
"message" : "请你务必审慎阅读、充分理解“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href='https://zmzm.taihumed.com/agreement.html'>《用户协议》</a>和<a href='https://zmzm.taihumed.com/privacy.html'>《隐私协议》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
"buttonRefuse": "暂不同意"
|
||||||
"buttonAccept" : "同意",
|
}
|
||||||
"buttonRefuse" : "暂不同意"
|
},
|
||||||
}
|
"modules": {
|
||||||
},
|
"Payment": {},
|
||||||
"modules" : {
|
"Share": {},
|
||||||
"Payment" : {},
|
"VideoPlayer": {},
|
||||||
"Share" : {},
|
"OAuth": {},
|
||||||
"VideoPlayer" : {},
|
"Camera": {}
|
||||||
"OAuth" : {},
|
},
|
||||||
"Camera" : {}
|
"distribute": {
|
||||||
},
|
"apple": {
|
||||||
"distribute" : {
|
"devices": "universal"
|
||||||
"apple" : {
|
},
|
||||||
"devices" : "universal"
|
// "UIBackgroundModes" : [ "audio" ]
|
||||||
},
|
"android": {
|
||||||
// "UIBackgroundModes" : [ "audio" ]
|
"permissionPhoneState": {
|
||||||
"android" : {
|
"request": "none",
|
||||||
"permissionPhoneState" : {
|
"prompt": "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
|
||||||
"request" : "none",
|
},
|
||||||
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
|
"permissionExternalStorage": {
|
||||||
},
|
"request": "none",
|
||||||
"permissionExternalStorage" : {
|
"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||||
"request" : "none",
|
},
|
||||||
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
"permissions": [
|
||||||
},
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"permissions" : [
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
|
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
],
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
|
||||||
],
|
"minSdkVersion": 21,
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"targetSdkVersion": 30,
|
||||||
"minSdkVersion" : 21,
|
"schemes": "zmzm"
|
||||||
"targetSdkVersion" : 30,
|
},
|
||||||
"schemes" : "zmzm"
|
"sdkConfigs": {
|
||||||
},
|
"ad": {},
|
||||||
"sdkConfigs" : {
|
"maps": {},
|
||||||
"ad" : {},
|
"share": {
|
||||||
"maps" : {},
|
"weixin": {
|
||||||
"share" : {
|
"appid": "wx912aa600132dc965",
|
||||||
"weixin" : {
|
"UniversalLinks": "https://verification.nuttyreading.com/uni-universallinks/__UNI__5D0ED80/"
|
||||||
"appid" : "wx912aa600132dc965",
|
}
|
||||||
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__5D0ED80/"
|
},
|
||||||
}
|
"payment": {
|
||||||
},
|
"alipay": {
|
||||||
"payment" : {
|
"__platform__": ["ios", "android"]
|
||||||
"alipay" : {
|
},
|
||||||
"__platform__" : [ "ios", "android" ]
|
"appleiap": {},
|
||||||
},
|
"weixin": {
|
||||||
"appleiap" : {},
|
"__platform__": ["ios", "android"],
|
||||||
"weixin" : {
|
"appid": "wx912aa600132dc965",
|
||||||
"__platform__" : [ "ios", "android" ],
|
"UniversalLinks": "https://verification.nuttyreading.com/uni-universallinks/__UNI__5D0ED80/"
|
||||||
"appid" : "wx912aa600132dc965",
|
}
|
||||||
"UniversalLinks" : "https://verification.nuttyreading.com/uni-universallinks/__UNI__5D0ED80/"
|
},
|
||||||
}
|
"oauth": {},
|
||||||
},
|
"push": {}
|
||||||
"oauth" : {},
|
},
|
||||||
"push" : {}
|
"splashscreen": {
|
||||||
},
|
"iosStyle": "common",
|
||||||
"splashscreen" : {
|
"androidStyle": "default",
|
||||||
"iosStyle" : "common",
|
"useOriginalMsgbox": true
|
||||||
"androidStyle" : "default",
|
},
|
||||||
"useOriginalMsgbox" : true
|
"ios": {
|
||||||
},
|
"dSYMs": false,
|
||||||
"ios" : {
|
// "UIBackgroundModes" : [ "audio" ], // 背景播放音乐
|
||||||
"dSYMs" : false,
|
"capabilities": {
|
||||||
// "UIBackgroundModes" : [ "audio" ], // 背景播放音乐
|
"entitlements": {
|
||||||
"capabilities" : {
|
"com.apple.developer.associated-domains": ["applinks:verification.nuttyreading.com"]
|
||||||
"entitlements" : {
|
}
|
||||||
"com.apple.developer.associated-domains" : [ "applinks:verification.nuttyreading.com" ]
|
},
|
||||||
}
|
"idfa": false,
|
||||||
},
|
"urltypes": "zmzm",
|
||||||
"idfa" : false,
|
"urlschemewhitelist": "nuttyreading,medicine",
|
||||||
"urltypes" : "zmzm",
|
"privacyDescription": {
|
||||||
"urlschemewhitelist" : "nuttyreading,medicine",
|
"NSPhotoLibraryUsageDescription": "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
||||||
"privacyDescription" : {
|
"NSCameraUsageDescription": "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
||||||
"NSPhotoLibraryUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
"NSPhotoLibraryAddUsageDescription": "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用"
|
||||||
"NSCameraUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用",
|
}
|
||||||
"NSPhotoLibraryAddUsageDescription" : "保障您在此app中的修改头像、申诉反馈上传图片、留言上传图片功能的正常使用"
|
},
|
||||||
}
|
"icons": {
|
||||||
},
|
"android": {
|
||||||
"icons" : {
|
"hdpi": "unpackage/res/icons/72x72.png",
|
||||||
"android" : {
|
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
},
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
"ios": {
|
||||||
},
|
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||||
"ios" : {
|
"ipad": {
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
"app": "unpackage/res/icons/76x76.png",
|
||||||
"ipad" : {
|
"app@2x": "unpackage/res/icons/152x152.png",
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"notification": "unpackage/res/icons/20x20.png",
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"settings": "unpackage/res/icons/29x29.png",
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
"spotlight": "unpackage/res/icons/40x40.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
},
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
"iphone": {
|
||||||
},
|
"app@2x": "unpackage/res/icons/120x120.png",
|
||||||
"iphone" : {
|
"app@3x": "unpackage/res/icons/180x180.png",
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
}
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
"compilerVersion": 3,
|
||||||
},
|
"nvueLaunchMode": "fast",
|
||||||
"compilerVersion" : 3,
|
"splashscreen": {
|
||||||
"nvueLaunchMode" : "fast",
|
"alwaysShowBeforeRender": false
|
||||||
"splashscreen" : {
|
},
|
||||||
"alwaysShowBeforeRender" : false
|
"nativePlugins": {},
|
||||||
},
|
"uniStatistics": {
|
||||||
"nativePlugins" : {},
|
"enable": true
|
||||||
"uniStatistics" : {
|
},
|
||||||
"enable" : true
|
"safearea": {
|
||||||
},
|
//安全区域配置,仅iOS平台生效
|
||||||
"safearea" : {
|
"bottom": {
|
||||||
//安全区域配置,仅iOS平台生效
|
// 底部安全区域配置
|
||||||
"bottom" : {
|
"offset": "none" // 底部安全区域偏移,"none"表示不空出安全区域,"auto"自动计算空出安全区域,默认值为"none"
|
||||||
// 底部安全区域配置
|
}
|
||||||
"offset" : "none" // 底部安全区域偏移,"none"表示不空出安全区域,"auto"自动计算空出安全区域,默认值为"none"
|
}
|
||||||
}
|
},
|
||||||
}
|
// 5+App特有相关
|
||||||
},
|
"quickapp": {},
|
||||||
// 5+App特有相关
|
// 快应用特有相关
|
||||||
"quickapp" : {},
|
"mp-weixin": {
|
||||||
// 快应用特有相关
|
"setting": {
|
||||||
"mp-weixin" : {
|
"urlCheck": false,
|
||||||
"setting" : {
|
"es6": true,
|
||||||
"urlCheck" : false,
|
"postcss": true,
|
||||||
"es6" : true,
|
"minified": true
|
||||||
"postcss" : true,
|
},
|
||||||
"minified" : true
|
"usingComponents": true,
|
||||||
},
|
"appid": "wx912aa600132dc965",
|
||||||
"usingComponents" : true,
|
"permission": {
|
||||||
"appid" : "wx912aa600132dc965",
|
"scope.userLocation": {
|
||||||
"permission" : {
|
"desc": "你的位置信息将用于小程序位置接口的效果展示"
|
||||||
"scope.userLocation" : {
|
}
|
||||||
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
|
},
|
||||||
}
|
"uniStatistics": {
|
||||||
},
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"h5": {
|
||||||
},
|
"template": "template.h5.html",
|
||||||
"h5" : {
|
"router": {
|
||||||
"template" : "template.h5.html",
|
"mode": "hash",
|
||||||
"router" : {
|
"base": "/uniappDemo/"
|
||||||
"mode" : "hash",
|
},
|
||||||
"base" : "/uniappDemo/"
|
"optimization": {
|
||||||
},
|
"treeShaking": {
|
||||||
"optimization" : {
|
"enable": true
|
||||||
"treeShaking" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"uniStatistics": {
|
||||||
},
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"_spaceID": "mp-3614b80b-2d75-4462-a481-4998f8187274",
|
||||||
},
|
"uniStatistics": {
|
||||||
"_spaceID" : "mp-3614b80b-2d75-4462-a481-4998f8187274",
|
"version": "2",
|
||||||
"uniStatistics" : {
|
"enable": true
|
||||||
"version" : "2",
|
},
|
||||||
"enable" : true
|
"mp-alipay": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-alipay" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-baidu": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-baidu" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-jd": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-jd" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-kuaishou": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-kuaishou" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-lark": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-lark" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-qq": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-qq" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"mp-toutiao": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"mp-toutiao" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"quickapp-webview-huawei": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"quickapp-webview-huawei" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
},
|
||||||
}
|
"quickapp-webview-union": {
|
||||||
},
|
"uniStatistics": {
|
||||||
"quickapp-webview-union" : {
|
"enable": true
|
||||||
"uniStatistics" : {
|
}
|
||||||
"enable" : true
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 小程序特有相关
|
// 小程序特有相关
|
||||||
|
|
||||||
19
pages.json
19
pages.json
@@ -39,7 +39,10 @@
|
|||||||
"path": "pages/homePage/index/index",
|
"path": "pages/homePage/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "首页",
|
"navigationBarTitleText": "首页",
|
||||||
"enablePullDownRefresh": false, // 禁止下拉刷新,
|
|
||||||
|
"enablePullDownRefresh": true,
|
||||||
|
"onReachBottomDistance": 100,
|
||||||
|
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none",
|
"bounce": "none",
|
||||||
"titleNView": false,
|
"titleNView": false,
|
||||||
@@ -228,6 +231,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/mine/aboutUs/agreement",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "协议",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"app-plus": {
|
||||||
|
"bounce": "none",
|
||||||
|
"titleNView": false,
|
||||||
|
"popGesture": "none"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/mine/wallet/recharge/index",
|
"path": "pages/mine/wallet/recharge/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -294,7 +309,7 @@
|
|||||||
"path": "pages/mine/vip/index",
|
"path": "pages/mine/vip/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "vip",
|
"navigationBarTitleText": "vip",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": false,
|
||||||
"onReachBottomDistance": 100,
|
"onReachBottomDistance": 100,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"bounce": "none",
|
"bounce": "none",
|
||||||
|
|||||||
@@ -1,29 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="goods_nav">
|
<view class="goods_nav">
|
||||||
<!-- 公共组件-每个页面必须引入 -->
|
<!-- 公共组件-每个页面必须引入 -->
|
||||||
|
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view v-for="(v,i) in iconList" class="icon_item" v-if="iconList.length>0">
|
<view v-for="(v,i) in iconList" class="icon_item" v-if="iconList.length>0">
|
||||||
<u-icon :name="v.icon" :color="v.infoColor" size="22" v-if="v.iconType" style="margin:0 auto" @click="clickIcon(v)"
|
<u-icon :name="v.icon" :color="v.infoColor" size="22" v-if="v.iconType" style="margin:0 auto"
|
||||||
></u-icon>
|
@click="clickIcon(v)"></u-icon>
|
||||||
|
|
||||||
<uni-icons :type="v.icon" size="22" :color="v.infoColor" style="margin:0 auto" v-else> </uni-icons>
|
|
||||||
<view :style="`color:${v.infoColor};`">{{ v.text }}</view>
|
|
||||||
</view>
|
|
||||||
<slot name="leftSlot"></slot>
|
|
||||||
|
|
||||||
</view>
|
<uni-icons :type="v.icon" size="22" :color="v.infoColor" style="margin:0 auto" v-else> </uni-icons>
|
||||||
<view class="right">
|
<view :style="`color:${v.infoColor};`">{{ v.text }}</view>
|
||||||
|
</view>
|
||||||
<view class="button" v-for="(v,i) in customButton" :style="`background:${v.backgroundColor} !important;color:${v.color};width:${v.width}`" @click="submit(v)">
|
<slot name="leftSlot"></slot>
|
||||||
{{ v.text }}
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
|
||||||
<!-- <view>{{ detailInfo.content }}</view> -->
|
<view class="button" v-for="(v,i) in customButton"
|
||||||
</view>
|
:style="`background:${v.backgroundColor} !important;color:${v.color};width:${v.width}`"
|
||||||
|
@click="submit(v)">
|
||||||
|
{{ v.text }}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<slot name="bottomSlot"></slot>
|
||||||
|
<!-- <view>{{ detailInfo.content }}</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -32,220 +34,219 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import $http from '@/config/requestConfig.js';
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from 'vuex';
|
||||||
|
export default {
|
||||||
|
props: ['iconList', 'customButton'],
|
||||||
|
components: {
|
||||||
|
|
||||||
import $http from '@/config/requestConfig.js';
|
},
|
||||||
import {
|
data() {
|
||||||
mapState
|
return {
|
||||||
} from 'vuex';
|
|
||||||
export default {
|
|
||||||
props: ['iconList','customButton'],
|
|
||||||
components: {
|
|
||||||
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['userInfo']),
|
...mapState(['userInfo']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
submit(v){
|
submit(v) {
|
||||||
this.$emit('submit',v)
|
this.$emit('submit', v)
|
||||||
},
|
},
|
||||||
clickIcon(v){
|
clickIcon(v) {
|
||||||
this.$emit('clickIcon',v)
|
this.$emit('clickIcon', v)
|
||||||
},
|
},
|
||||||
showPreview(e) {
|
showPreview(e) {
|
||||||
console.log('e at line 56:', e)
|
console.log('e at line 56:', e)
|
||||||
let conimg = e.target.dataset.nodes;
|
let conimg = e.target.dataset.nodes;
|
||||||
let imgs = conimg.match(/<img[^>]+>/g);//选择节点中的img
|
let imgs = conimg.match(/<img[^>]+>/g); //选择节点中的img
|
||||||
console.log('imgs at line 59:', imgs)
|
console.log('imgs at line 59:', imgs)
|
||||||
let imgList = [];
|
let imgList = [];
|
||||||
//遍历img标签的src里面的内容放在定义的数组imgList中
|
//遍历img标签的src里面的内容放在定义的数组imgList中
|
||||||
for (var j = 0; j < imgs.length; j++) {
|
for (var j = 0; j < imgs.length; j++) {
|
||||||
imgs[j].replace(/<img[^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
|
imgs[j].replace(/<img[^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
|
||||||
imgList.push(capture)
|
imgList.push(capture)
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log('imgList.push at line 64:', imgList)
|
console.log('imgList.push at line 64:', imgList)
|
||||||
|
|
||||||
|
|
||||||
//最后一步就是所有图片放在预览的方法previewImage中就可以了
|
//最后一步就是所有图片放在预览的方法previewImage中就可以了
|
||||||
// uni.previewImage({
|
// uni.previewImage({
|
||||||
// current: imgList,
|
// current: imgList,
|
||||||
// urls: imgList,
|
// urls: imgList,
|
||||||
// })
|
// })
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: imgList,
|
urls: imgList,
|
||||||
longPressActions: {
|
longPressActions: {
|
||||||
itemList: ['很抱歉,暂不支持保存图片到本地'],
|
itemList: ['很抱歉,暂不支持保存图片到本地'],
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
// console.log(res,'+++++')
|
// console.log(res,'+++++')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 放大图片
|
// 放大图片
|
||||||
previewImage(url) {
|
previewImage(url) {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [url],
|
urls: [url],
|
||||||
longPressActions: {
|
longPressActions: {
|
||||||
itemList: ['很抱歉,暂不支持保存图片到本地'],
|
itemList: ['很抱歉,暂不支持保存图片到本地'],
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
// console.log(res,'+++++')
|
// console.log(res,'+++++')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// getSearch() {
|
// getSearch() {
|
||||||
// $http.request({
|
// $http.request({
|
||||||
// url: "book/prescript/searchPrescript",
|
// url: "book/prescript/searchPrescript",
|
||||||
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
// method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||||
// data: {
|
// data: {
|
||||||
// loadAnimate: 'none', // 请求加载动画
|
// loadAnimate: 'none', // 请求加载动画
|
||||||
// 'keywords': this.searchValue,
|
// 'keywords': this.searchValue,
|
||||||
// type: this.currentCateIndex + 1
|
// type: this.currentCateIndex + 1
|
||||||
// },
|
// },
|
||||||
// header: { //默认 无 说明:请求头
|
// header: { //默认 无 说明:请求头
|
||||||
// 'Content-Type': 'application/json'
|
// 'Content-Type': 'application/json'
|
||||||
// },
|
// },
|
||||||
// }).then(res => {
|
// }).then(res => {
|
||||||
// console.log(res, '搜索结果')
|
// console.log(res, '搜索结果')
|
||||||
// if (res.code == 0 && res.list.length >= 0) {
|
// if (res.code == 0 && res.list.length >= 0) {
|
||||||
// this.showSearchList = true
|
// this.showSearchList = true
|
||||||
// this.searchList = res.list
|
// this.searchList = res.list
|
||||||
// } else {
|
// } else {
|
||||||
// this.searchList = []
|
// this.searchList = []
|
||||||
// }
|
// }
|
||||||
// }).catch(e => {
|
// }).catch(e => {
|
||||||
// // this.dataList = []
|
// // this.dataList = []
|
||||||
// this.searchList = []
|
// this.searchList = []
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
// search(res) {
|
// search(res) {
|
||||||
// console.log(res, 'res')
|
// console.log(res, 'res')
|
||||||
// // uni.showToast({
|
// // uni.showToast({
|
||||||
// // title: '搜索:' + res,
|
// // title: '搜索:' + res,
|
||||||
// // icon: 'none'
|
// // icon: 'none'
|
||||||
// // })
|
// // })
|
||||||
// if (res == '') {
|
// if (res == '') {
|
||||||
// this.showSearchList = false
|
// this.showSearchList = false
|
||||||
// this.searchList = []
|
// this.searchList = []
|
||||||
// } else {
|
// } else {
|
||||||
// this.getSearch()
|
// this.getSearch()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// },
|
// },
|
||||||
// input(res) {
|
// input(res) {
|
||||||
// console.log('----input:', res)
|
// console.log('----input:', res)
|
||||||
// if (res == '') {
|
// if (res == '') {
|
||||||
// this.searchList = []
|
// this.searchList = []
|
||||||
// } else {
|
// } else {
|
||||||
// this.getSearch()
|
// this.getSearch()
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
// clear(res) {
|
// clear(res) {
|
||||||
// console.log('----clear:', res)
|
// console.log('----clear:', res)
|
||||||
// // uni.showToast({
|
// // uni.showToast({
|
||||||
// // title: 'clear事件,清除值为:',
|
// // title: 'clear事件,清除值为:',
|
||||||
// // icon: 'none'
|
// // icon: 'none'
|
||||||
// // })
|
// // })
|
||||||
// this.searchValue = ''
|
// this.searchValue = ''
|
||||||
// this.showSearchList = false
|
// this.showSearchList = false
|
||||||
// },
|
// },
|
||||||
// blur(res) {
|
// blur(res) {
|
||||||
// // console.log('----blur:', res)
|
// // console.log('----blur:', res)
|
||||||
// // if (res == '') {
|
// // if (res == '') {
|
||||||
// // this.showSearchList = false
|
// // this.showSearchList = false
|
||||||
// // this.searchList = []
|
// // this.searchList = []
|
||||||
// // } else {
|
// // } else {
|
||||||
// // this.getSearch()
|
// // this.getSearch()
|
||||||
// // }
|
// // }
|
||||||
// },
|
// },
|
||||||
// focus(e) {
|
// focus(e) {
|
||||||
// console.log('----focus:')
|
// console.log('----focus:')
|
||||||
// // uni.showToast({
|
// // uni.showToast({
|
||||||
// // title: 'focus事件,输出值为:' + e.value,
|
// // title: 'focus事件,输出值为:' + e.value,
|
||||||
// // icon: 'none'
|
// // icon: 'none'
|
||||||
// // })
|
// // })
|
||||||
// // 等于1 就是有权限
|
// // 等于1 就是有权限
|
||||||
// // this.showSearchList = true
|
// // this.showSearchList = true
|
||||||
|
|
||||||
// },
|
// },
|
||||||
// cancel(res) {
|
// cancel(res) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: '点击取消,输入值为:' + res.value,
|
// title: '点击取消,输入值为:' + res.value,
|
||||||
// icon: 'none'
|
// icon: 'none'
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
onBackPress() {
|
onBackPress() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.key.hideSoftKeybord();
|
plus.key.hideSoftKeybord();
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.goods_nav {
|
||||||
|
background-color: #fff;
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx 20rpx 20rpx 30rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
.goods_nav {
|
.left {
|
||||||
background-color: #fff;
|
height: 100%;
|
||||||
width: 100%;
|
float: left;
|
||||||
padding: 20rpx 20rpx 20rpx 30rpx;
|
display: flex;
|
||||||
overflow: hidden;
|
align-items: center;
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
.left{
|
|
||||||
height: 100%;
|
|
||||||
float: left;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.richDetail {
|
}
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button{
|
.richDetail {
|
||||||
float: right;
|
width: 100%;
|
||||||
width: 240rpx;
|
height: 100%;
|
||||||
border-radius: 100rpx;
|
}
|
||||||
line-height: 70rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-left: 20rpx;
|
|
||||||
background: linear-gradient(90deg, rgb(254, 96, 53), rgb(239, 18, 36));
|
|
||||||
|
|
||||||
|
|
||||||
color: rgb(255, 255, 255);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon_item{
|
.button {
|
||||||
display: flex;
|
float: right;
|
||||||
justify-content:center;
|
width: 240rpx;
|
||||||
flex-direction: column;
|
border-radius: 100rpx;
|
||||||
}
|
line-height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
background: linear-gradient(90deg, rgb(254, 96, 53), rgb(239, 18, 36));
|
||||||
|
|
||||||
|
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon_item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="input_box">
|
<view class="input_box">
|
||||||
<uni-forms-item label="" name="account" label-width="0">
|
<uni-forms-item label="" name="account" label-width="0">
|
||||||
<text class="input_tit"><i>*</i>吴门医述账号:</text>
|
<text class="input_tit"><i>*</i>众秒之门账号:</text>
|
||||||
<view class="in">
|
<view class="in">
|
||||||
<input placeholder-style="font-size:26rpx" type="text" v-model="form.account"
|
<input placeholder-style="font-size:26rpx" type="text" v-model="form.account"
|
||||||
placeholder="请输入手机号/邮箱" />
|
placeholder="请输入手机号/邮箱" />
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
<view class="input_box">
|
<view class="input_box">
|
||||||
<uni-forms-item label="" name="contactInformation" label-width="0">
|
<uni-forms-item label="" name="contactInformation" label-width="0">
|
||||||
<text class="input_tit"><i>*</i>联系电话:</text>
|
<text class="input_tit"><i>*</i>联系电话:</text>
|
||||||
{{reversedMessage}}
|
{{reversedMessage}}
|
||||||
<view class="in">
|
<view class="in">
|
||||||
<input type="number" placeholder-style="font-size:26rpx" @input="telInput"
|
<input type="number" placeholder-style="font-size:26rpx" @input="telInput"
|
||||||
v-model="form.contactInformation" placeholder="请输入与您联系的手机号" />
|
v-model="form.contactInformation" placeholder="请输入与您联系的手机号" />
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
},
|
},
|
||||||
telError: false,
|
telError: false,
|
||||||
relationError: false,
|
relationError: false,
|
||||||
relationErrorPattern:false,
|
relationErrorPattern: false,
|
||||||
rules: {
|
rules: {
|
||||||
account: {
|
account: {
|
||||||
rules: [{
|
rules: [{
|
||||||
@@ -208,14 +208,14 @@
|
|||||||
// console.log('键盘输入',e);
|
// console.log('键盘输入',e);
|
||||||
this.telError = false
|
this.telError = false
|
||||||
},
|
},
|
||||||
async checkPermision(){
|
async checkPermision() {
|
||||||
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
|
var result = await permission.premissionCheck("CAMERA_EXTERNAL_STORAGE")
|
||||||
if (result != 1) {
|
if (result != 1) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async addPic(e) {
|
async addPic(e) {
|
||||||
console.log("添加图片");
|
console.log("添加图片");
|
||||||
let that = this;
|
let that = this;
|
||||||
for (var i = 0; i < e.file.length; i++) {
|
for (var i = 0; i < e.file.length; i++) {
|
||||||
//console.log(i,e.file[i].url)
|
//console.log(i,e.file[i].url)
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
success: (res) => {
|
success: (res) => {
|
||||||
that.fileList1.push({
|
that.fileList1.push({
|
||||||
url: JSON.parse(res.data).url,
|
url: JSON.parse(res.data).url,
|
||||||
});
|
});
|
||||||
console.log(that.fileList1, "that.uploadPicLIst");
|
console.log(that.fileList1, "that.uploadPicLIst");
|
||||||
},
|
},
|
||||||
fail: (error) => {
|
fail: (error) => {
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
this.fileList1.splice(event.index, 1)
|
this.fileList1.splice(event.index, 1)
|
||||||
},
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.$refs.form.validate().then(res => {
|
this.$refs.form.validate().then(res => {
|
||||||
if (this.form.type == 3) {
|
if (this.form.type == 3) {
|
||||||
if (this.form.relation == '') {
|
if (this.form.relation == '') {
|
||||||
this.relationError = true
|
this.relationError = true
|
||||||
@@ -286,20 +286,20 @@
|
|||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.fileList1 = []
|
this.fileList1 = []
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
uni.navigateBack({
|
uni.navigateBack({
|
||||||
delta: 1
|
delta: 1
|
||||||
});
|
});
|
||||||
// })
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
// console.log('表单错误信息:', err);
|
// console.log('表单错误信息:', err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交失败',
|
title: '提交失败',
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log('表单错误信息:', err);
|
console.log('表单错误信息:', err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -325,12 +325,15 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import '@/style/mixin.scss';
|
@import '@/style/mixin.scss';
|
||||||
::v-deep .uni-forms-item{
|
|
||||||
|
::v-deep .uni-forms-item {
|
||||||
margin-bottom: 26rpx !important;
|
margin-bottom: 26rpx !important;
|
||||||
}
|
}
|
||||||
.input_tit{
|
|
||||||
|
.input_tit {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 0 65rpx;
|
padding: 0 65rpx;
|
||||||
|
|||||||
140
pages/mine/aboutUs/agreement.vue
Normal file
140
pages/mine/aboutUs/agreement.vue
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<z-nav-bar :title="yszcText.title" bgColor="#fff" fontColor="#333"></z-nav-bar>
|
||||||
|
|
||||||
|
<view class="tanchu">
|
||||||
|
|
||||||
|
<!-- <view class="dp_title" v-html="yszcText.title"></view> -->
|
||||||
|
<view class="dp_content" v-html="yszcText.content"></view>
|
||||||
|
<!-- <yhxyPage></yhxyPage> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: {},
|
||||||
|
yszcText: {
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
//第一次加载
|
||||||
|
onLoad(options) {
|
||||||
|
this.options = options;
|
||||||
|
this.getSettlement(105);
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onReady() {},
|
||||||
|
//方法
|
||||||
|
methods: {
|
||||||
|
async getSettlement(id, type) {
|
||||||
|
console.log('id at line 57:', id)
|
||||||
|
//隐私策略
|
||||||
|
var data = await this.$commonJS.getAgreement(id);
|
||||||
|
if (data.content) {
|
||||||
|
data.content = data.content.replace(
|
||||||
|
/<h5>/g,
|
||||||
|
'<view style="font-weight: bold;font-size: 32rpx;margin-top: 20rpx;margin-bottom: 20rpx;">'
|
||||||
|
);
|
||||||
|
data.content = data.content.replace(/<\/h5>/g, "</view>");
|
||||||
|
}
|
||||||
|
this.yszcText = data
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.tanchu {
|
||||||
|
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.popup_box {
|
||||||
|
width: 600upx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
|
||||||
|
.popup_title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: 88upx;
|
||||||
|
line-height: 88upx;
|
||||||
|
|
||||||
|
view {
|
||||||
|
align-items: center;
|
||||||
|
font-size: 30upx;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 50upx;
|
||||||
|
height: 50upx;
|
||||||
|
margin: 0 20rpx 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup_content {
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.popup_footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
view {
|
||||||
|
width: 45%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28upx;
|
||||||
|
color: #999;
|
||||||
|
line-height: 70upx;
|
||||||
|
margin: 0 0 30rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp_title {
|
||||||
|
font-size: 36rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
color: #555;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dp_content {
|
||||||
|
max-height: 98%;
|
||||||
|
overflow-y: scroll;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #555;
|
||||||
|
line-height: 45rpx;
|
||||||
|
|
||||||
|
.dp_con1 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 32rpx;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .dp_con2 {
|
||||||
|
// font-size: 30rpx;
|
||||||
|
// margin-top: 10rpx;
|
||||||
|
// margin-bottom: 10rpx;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -249,82 +249,82 @@
|
|||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'appleiap',
|
provider: 'appleiap',
|
||||||
orderInfo: orderInfo,
|
orderInfo: orderInfo,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
that.iapCheck(res);
|
that.iapCheck(res);
|
||||||
resolve(res);
|
resolve(res);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
// console.log('其他支付错误', err);
|
// console.log('其他支付错误', err);
|
||||||
that.restoreComplateRequest()
|
that.restoreComplateRequest()
|
||||||
if (err.code == 2) {
|
if (err.code == 2) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '取消支付,内购订单即将关闭',
|
title: '取消支付,内购订单即将关闭',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付失败,内购订单即将关闭',
|
title: '支付失败,内购订单即将关闭',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
}
|
}
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 查询未关闭iap订单
|
// 查询未关闭iap订单
|
||||||
async restoreComplateRequest() {
|
async restoreComplateRequest() {
|
||||||
let that = this
|
let that = this
|
||||||
console.log('检测未完成订单')
|
console.log('检测未完成订单')
|
||||||
// if (!that.checking) {
|
// if (!that.checking) {
|
||||||
// that.checking = true
|
// that.checking = true
|
||||||
// console.log(this.iapChannel, 'this.iapChannel1')
|
// console.log(this.iapChannel, 'this.iapChannel1')
|
||||||
await this.iapChannel.restoreCompletedTransactions({
|
await this.iapChannel.restoreCompletedTransactions({
|
||||||
manualFinishTransaction: true
|
manualFinishTransaction: true
|
||||||
}, function(results) {
|
}, function(results) {
|
||||||
// console.log(that.checking)
|
// console.log(that.checking)
|
||||||
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
// results 格式为数组存放恢复的IAP商品交易信息对象 IAPTransaction,通用需将返回的支付凭证传给后端进行二次认证
|
||||||
that.ComplateRequestArr = results
|
that.ComplateRequestArr = results
|
||||||
console.log('未完成订单数组共有:=》',that.ComplateRequestArr.length )
|
console.log('未完成订单数组共有:=》', that.ComplateRequestArr.length)
|
||||||
if (results && results.length > 0) {
|
if (results && results.length > 0) {
|
||||||
results.map((item, index) => {
|
results.map((item, index) => {
|
||||||
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
// "0"为正在支付;"1"为支付成功;"2"为支付失败;"3"为支付已恢复。
|
||||||
if (item.transactionState == '1') {
|
if (item.transactionState == '1') {
|
||||||
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
// 已经支付,但是没有走逻辑的内购订单 就发给后台做验证
|
||||||
that.iapCheck('未完成订单的验证',item, index)
|
that.iapCheck('未完成订单的验证', item, index)
|
||||||
// that.finishTransaction(item)
|
// that.finishTransaction(item)
|
||||||
} else if(item.transactionState != '1' || item.transactionState != '0') {
|
} else if (item.transactionState != '1' || item.transactionState != '0') {
|
||||||
// 不是正在支付订单,也不是已经支付订单就关闭掉
|
// 不是正在支付订单,也不是已经支付订单就关闭掉
|
||||||
// 其他状态的内购订单
|
// 其他状态的内购订单
|
||||||
that.finishTransaction(item)
|
that.finishTransaction(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
async iphonepay() {
|
async iphonepay() {
|
||||||
const that = this;
|
const that = this;
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title:"检测支付环境"
|
title: "检测支付环境"
|
||||||
})
|
})
|
||||||
console.log("检测支付环境...");
|
console.log("检测支付环境...");
|
||||||
this.iapChannel = await this.getProvider()
|
this.iapChannel = await this.getProvider()
|
||||||
console.log('that.iapChannel',this.iapChannel);
|
console.log('that.iapChannel', this.iapChannel);
|
||||||
if(this.iapChannel){
|
if (this.iapChannel) {
|
||||||
this.requestOrder();
|
this.requestOrder();
|
||||||
}else{
|
} else {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:'不支持内购支付',
|
title: '不支持内购支付',
|
||||||
icon:'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
console.log("获取iap支付通道失败:" + e.message, that.iapChannel);
|
console.log("获取iap支付通道失败:" + e.message, that.iapChannel);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
requestOrder() {
|
requestOrder() {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@@ -367,15 +367,15 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: "正在支付",
|
title: "正在支付",
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
let orderInfo = {
|
let orderInfo = {
|
||||||
productid: id,
|
productid: id,
|
||||||
username: that.orderSn, // 用户标识/订单标识
|
username: that.orderSn, // 用户标识/订单标识
|
||||||
quantity:1,
|
quantity: 1,
|
||||||
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
manualFinishTransaction: true, // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
||||||
}
|
}
|
||||||
this.transaction = await this.requestPayment(orderInfo)
|
this.transaction = await this.requestPayment(orderInfo)
|
||||||
console.log('支付后的that.transaction',this.transaction);
|
console.log('支付后的that.transaction', this.transaction);
|
||||||
},
|
},
|
||||||
iapCheck(result) {
|
iapCheck(result) {
|
||||||
let that = this;
|
let that = this;
|
||||||
@@ -639,7 +639,7 @@
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请勾选 已阅读会员服务协议",
|
title: "请勾选 已阅读增值服务协议",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
1321
unpackage/dist/dev/app-plus/app-service.js
vendored
1321
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
1400
unpackage/dist/dev/app-plus/app-view.js
vendored
1400
unpackage/dist/dev/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/dev/app-plus/manifest.json
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user