文字修改
This commit is contained in:
parent
b0ccfc9f29
commit
50409cd8c4
@ -16,8 +16,8 @@ let openPlantGrass = '-openPlantGrass-'
|
||||
let httpSix, httpApi;
|
||||
|
||||
// const env = 'dev'; // 开发
|
||||
// const env = 'prod'; // 生产
|
||||
const env = 'prew'; // 预上线
|
||||
const env = 'prod'; // 生产
|
||||
// const env = 'prew'; // 预上线
|
||||
|
||||
switch (env) {
|
||||
case 'prod':
|
||||
@ -77,4 +77,5 @@ module.exports = {
|
||||
TOKENNAME: 'X-Token',
|
||||
// 缓存时间 0 永久
|
||||
EXPIRE: 0,
|
||||
AUTH_EXPIRE_TIME: 20 * 1000 //秒
|
||||
};
|
702
manifest.json
702
manifest.json
@ -1,353 +1,353 @@
|
||||
{
|
||||
"name": "惠农生活",
|
||||
"appid": "__UNI__3A527D1",
|
||||
"description": "",
|
||||
"versionName": "2.0.53",
|
||||
"versionCode": 2053,
|
||||
"transformPx": false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
"titleNView": true,
|
||||
"usingComponents": true,
|
||||
"nvueCompiler": "uni-app",
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"compatible": {
|
||||
"ignoreVersion": true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
|
||||
},
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": false,
|
||||
"waiting": false,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {
|
||||
"VideoPlayer": {},
|
||||
"OAuth": {},
|
||||
"Payment": {},
|
||||
"Share": {},
|
||||
"iBeacon": {},
|
||||
"Maps": {},
|
||||
"Geolocation": {},
|
||||
"UniMP": {
|
||||
"description": "uni小程序"
|
||||
},
|
||||
"Push": {},
|
||||
"Barcode": {},
|
||||
"Camera": {}
|
||||
},
|
||||
"safearea": {
|
||||
"bottom": {
|
||||
"offset": "none"
|
||||
}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute": {
|
||||
/* android打包配置 */
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
|
||||
],
|
||||
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
|
||||
"permissionExternalStorage": {
|
||||
"request": "none",
|
||||
"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||
},
|
||||
"permissionPhoneState": {
|
||||
"request": "none" //拨打电话权限关闭
|
||||
},
|
||||
"minSdkVersion": 23,
|
||||
"targetSdkVersion": 30
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {
|
||||
"privacyDescription": {
|
||||
"NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报",
|
||||
"NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报",
|
||||
"NSCameraUsageDescription": "上传用户头像保存分享海报",
|
||||
"NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店",
|
||||
"NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店"
|
||||
},
|
||||
"idfa": false,
|
||||
"dSYMs": false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"amap": {
|
||||
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d",
|
||||
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945",
|
||||
"name": "amapIvoVHpJR"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
"weixin": {
|
||||
"__platform__": ["ios", "android"],
|
||||
"appid": "wx2e8f79ff281284f5",
|
||||
"UniversalLinks": "https://shop.lihaink.cn/"
|
||||
}
|
||||
},
|
||||
"share": {
|
||||
"weixin": {
|
||||
"appid": "wx2e8f79ff281284f5",
|
||||
"UniversalLinks": "https://shop.lihaink.cn/"
|
||||
}
|
||||
},
|
||||
"geolocation": {
|
||||
"amap": {
|
||||
"name": "amapIvoVHpJR",
|
||||
"__platform__": ["ios", "android"],
|
||||
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d",
|
||||
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945"
|
||||
}
|
||||
},
|
||||
"push": {},
|
||||
"oauth": {
|
||||
"weixin": {
|
||||
"appid": "wx2e8f79ff281284f5",
|
||||
"UniversalLinks": "https://shop.lihaink.cn/"
|
||||
},
|
||||
"univerify": {}
|
||||
},
|
||||
"ad": {}
|
||||
},
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen": {
|
||||
"useOriginalMsgbox": true,
|
||||
"androidStyle": "common"
|
||||
}
|
||||
},
|
||||
"nativePlugins": {
|
||||
"JG-JCore": {
|
||||
"JPUSH_APPKEY_IOS": "8a5efd65cda14fafa6e64ad3",
|
||||
"JPUSH_CHANNEL_IOS": "8a5efd65cda14fafa6e64ad3",
|
||||
"JPUSH_APPKEY_ANDROID": "b5f679f4357018605ea6fd2e",
|
||||
"JPUSH_CHANNEL_ANDROID": "",
|
||||
"__plugin_info__": {
|
||||
"name": "JG-JCore",
|
||||
"description": "极光推送JCore插件",
|
||||
"platforms": "Android,iOS",
|
||||
"url": "",
|
||||
"android_package_name": "uni.UNI3A527D1",
|
||||
"ios_bundle_id": "",
|
||||
"isCloud": false,
|
||||
"bought": -1,
|
||||
"pid": "",
|
||||
"parameters": {
|
||||
"JPUSH_APPKEY_IOS": {
|
||||
"des": "[iOS]极光portal配置应用信息时分配的AppKey",
|
||||
"key": "JCore:APP_KEY",
|
||||
"value": "daebe19b547c43128796a078"
|
||||
},
|
||||
"JPUSH_CHANNEL_IOS": {
|
||||
"des": "[iOS]用于统计分发渠道,不需要可填默认值developer-default",
|
||||
"key": "JCore:CHANNEL",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_APPKEY_ANDROID": {
|
||||
"des": "[Android]极光portal配置应用信息时分配的AppKey",
|
||||
"key": "JPUSH_APPKEY",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_CHANNEL_ANDROID": {
|
||||
"des": "[Android]用于统计分发渠道,不需要可填默认值developer-default",
|
||||
"key": "JPUSH_CHANNEL",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"JG-JPush": {
|
||||
"JPUSH_ISPRODUCTION_IOS": "true",
|
||||
"JPUSH_ADVERTISINGID_IOS": "",
|
||||
"JPUSH_DEFAULTINITJPUSH_IOS": "true",
|
||||
"JPUSH_OPPO_APPKEY": "",
|
||||
"JPUSH_OPPO_APPID": "",
|
||||
"JPUSH_OPPO_APPSECRET": "",
|
||||
"JPUSH_VIVO_APPKEY": "",
|
||||
"JPUSH_VIVO_APPID": "",
|
||||
"JPUSH_MEIZU_APPKEY": "",
|
||||
"JPUSH_MEIZU_APPID": "",
|
||||
"JPUSH_XIAOMI_APPKEY": "",
|
||||
"JPUSH_XIAOMI_APPID": "",
|
||||
"__plugin_info__": {
|
||||
"name": "JG-JPush",
|
||||
"description": "极光推送Hbuilder插件",
|
||||
"platforms": "Android,iOS",
|
||||
"url": "",
|
||||
"android_package_name": "uni.UNI3A527D1",
|
||||
"ios_bundle_id": "",
|
||||
"isCloud": false,
|
||||
"bought": -1,
|
||||
"pid": "",
|
||||
"parameters": {
|
||||
"JPUSH_ISPRODUCTION_IOS": {
|
||||
"des": "[iOS]是否是生产环境,是填true,不是填false或者不填",
|
||||
"key": "JPush:ISPRODUCTION",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_ADVERTISINGID_IOS": {
|
||||
"des": "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填",
|
||||
"key": "JPush:ADVERTISINGID",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_DEFAULTINITJPUSH_IOS": {
|
||||
"des": "[iOS]是否默认初始化,是填true,不是填false或者不填",
|
||||
"key": "JPush:DEFAULTINITJPUSH",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_OPPO_APPKEY": {
|
||||
"des": "厂商OPPO-appkey,示例:OP-12345678",
|
||||
"key": "OPPO_APPKEY",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_OPPO_APPID": {
|
||||
"des": "厂商OPPO-appId,示例:OP-12345678",
|
||||
"key": "OPPO_APPID",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_OPPO_APPSECRET": {
|
||||
"des": "厂商OPPO-appSecret,示例:OP-12345678",
|
||||
"key": "OPPO_APPSECRET",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_VIVO_APPKEY": {
|
||||
"des": "厂商VIVO-appkey,示例:12345678",
|
||||
"key": "com.vivo.push.api_key",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_VIVO_APPID": {
|
||||
"des": "厂商VIVO-appId,示例:12345678",
|
||||
"key": "com.vivo.push.app_id",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_MEIZU_APPKEY": {
|
||||
"des": "厂商MEIZU-appKey,示例:MZ-12345678",
|
||||
"key": "MEIZU_APPKEY",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_MEIZU_APPID": {
|
||||
"des": "厂商MEIZU-appId,示例:MZ-12345678",
|
||||
"key": "MEIZU_APPID",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_XIAOMI_APPKEY": {
|
||||
"des": "厂商XIAOMI-appKey,示例:MI-12345678",
|
||||
"key": "XIAOMI_APPKEY",
|
||||
"value": ""
|
||||
},
|
||||
"JPUSH_XIAOMI_APPID": {
|
||||
"des": "厂商XIAOMI-appId,示例:MI-12345678",
|
||||
"key": "XIAOMI_APPID",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp": {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "wx5fb1cc8edb3f8baa",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"minified": true,
|
||||
"postcss": true,
|
||||
"es6": true
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "获取您的位置"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": ["getLocation", "chooseAddress"],
|
||||
"usingComponents": true,
|
||||
"__usePrivacyCheck__": true
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"h5": {
|
||||
"devServer": {
|
||||
"https": false
|
||||
},
|
||||
"router": {
|
||||
"mode": "history",
|
||||
"base": ""
|
||||
},
|
||||
"domain": "",
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"qqmap": {
|
||||
"key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
|
||||
}
|
||||
}
|
||||
},
|
||||
"title": "加载中...",
|
||||
"template": "template.h5.html",
|
||||
"optimization": {
|
||||
"treeShaking": {
|
||||
"enable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
"name" : "惠农生活",
|
||||
"appid" : "__UNI__3A527D1",
|
||||
"description" : "",
|
||||
"versionName" : "2.0.26",
|
||||
"versionCode" : 2026,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"titleNView" : true,
|
||||
"usingComponents" : true,
|
||||
"nvueCompiler" : "uni-app",
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"compatible" : {
|
||||
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
|
||||
},
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : false,
|
||||
"waiting" : false,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {
|
||||
"VideoPlayer" : {},
|
||||
"OAuth" : {},
|
||||
"Payment" : {},
|
||||
"Share" : {},
|
||||
"iBeacon" : {},
|
||||
"Maps" : {},
|
||||
"Geolocation" : {},
|
||||
"UniMP" : {
|
||||
"description" : "uni小程序"
|
||||
},
|
||||
"Push" : {},
|
||||
"Barcode" : {},
|
||||
"Camera" : {}
|
||||
},
|
||||
"safearea" : {
|
||||
"bottom" : {
|
||||
"offset" : "none"
|
||||
}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
|
||||
],
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||
"permissionExternalStorage" : {
|
||||
"request" : "none",
|
||||
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
|
||||
},
|
||||
"permissionPhoneState" : {
|
||||
"request" : "none" //拨打电话权限关闭
|
||||
},
|
||||
"minSdkVersion" : 23,
|
||||
"targetSdkVersion" : 30
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {
|
||||
"privacyDescription" : {
|
||||
"NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报",
|
||||
"NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
|
||||
"NSCameraUsageDescription" : "上传用户头像保存分享海报",
|
||||
"NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
|
||||
"NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店"
|
||||
},
|
||||
"idfa" : false,
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
|
||||
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
|
||||
"name" : "amapIvoVHpJR"
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
"weixin" : {
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appid" : "wx2e8f79ff281284f5",
|
||||
"UniversalLinks" : "https://shop.lihaink.cn/"
|
||||
}
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx2e8f79ff281284f5",
|
||||
"UniversalLinks" : "https://shop.lihaink.cn/"
|
||||
}
|
||||
},
|
||||
"geolocation" : {
|
||||
"amap" : {
|
||||
"name" : "amapIvoVHpJR",
|
||||
"__platform__" : [ "ios", "android" ],
|
||||
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
|
||||
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945"
|
||||
}
|
||||
},
|
||||
"push" : {},
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx2e8f79ff281284f5",
|
||||
"UniversalLinks" : "https://shop.lihaink.cn/"
|
||||
},
|
||||
"univerify" : {}
|
||||
},
|
||||
"ad" : {}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"useOriginalMsgbox" : true,
|
||||
"androidStyle" : "common"
|
||||
}
|
||||
},
|
||||
"nativePlugins" : {
|
||||
"JG-JCore" : {
|
||||
"JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3",
|
||||
"JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3",
|
||||
"JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e",
|
||||
"JPUSH_CHANNEL_ANDROID" : "",
|
||||
"__plugin_info__" : {
|
||||
"name" : "JG-JCore",
|
||||
"description" : "极光推送JCore插件",
|
||||
"platforms" : "Android,iOS",
|
||||
"url" : "",
|
||||
"android_package_name" : "uni.UNI3A527D1",
|
||||
"ios_bundle_id" : "",
|
||||
"isCloud" : false,
|
||||
"bought" : -1,
|
||||
"pid" : "",
|
||||
"parameters" : {
|
||||
"JPUSH_APPKEY_IOS" : {
|
||||
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
|
||||
"key" : "JCore:APP_KEY",
|
||||
"value" : "daebe19b547c43128796a078"
|
||||
},
|
||||
"JPUSH_CHANNEL_IOS" : {
|
||||
"des" : "[iOS]用于统计分发渠道,不需要可填默认值developer-default",
|
||||
"key" : "JCore:CHANNEL",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_APPKEY_ANDROID" : {
|
||||
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
|
||||
"key" : "JPUSH_APPKEY",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_CHANNEL_ANDROID" : {
|
||||
"des" : "[Android]用于统计分发渠道,不需要可填默认值developer-default",
|
||||
"key" : "JPUSH_CHANNEL",
|
||||
"value" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"JG-JPush" : {
|
||||
"JPUSH_ISPRODUCTION_IOS" : "true",
|
||||
"JPUSH_ADVERTISINGID_IOS" : "",
|
||||
"JPUSH_DEFAULTINITJPUSH_IOS" : "true",
|
||||
"JPUSH_OPPO_APPKEY" : "",
|
||||
"JPUSH_OPPO_APPID" : "",
|
||||
"JPUSH_OPPO_APPSECRET" : "",
|
||||
"JPUSH_VIVO_APPKEY" : "",
|
||||
"JPUSH_VIVO_APPID" : "",
|
||||
"JPUSH_MEIZU_APPKEY" : "",
|
||||
"JPUSH_MEIZU_APPID" : "",
|
||||
"JPUSH_XIAOMI_APPKEY" : "",
|
||||
"JPUSH_XIAOMI_APPID" : "",
|
||||
"__plugin_info__" : {
|
||||
"name" : "JG-JPush",
|
||||
"description" : "极光推送Hbuilder插件",
|
||||
"platforms" : "Android,iOS",
|
||||
"url" : "",
|
||||
"android_package_name" : "uni.UNI3A527D1",
|
||||
"ios_bundle_id" : "",
|
||||
"isCloud" : false,
|
||||
"bought" : -1,
|
||||
"pid" : "",
|
||||
"parameters" : {
|
||||
"JPUSH_ISPRODUCTION_IOS" : {
|
||||
"des" : "[iOS]是否是生产环境,是填true,不是填false或者不填",
|
||||
"key" : "JPush:ISPRODUCTION",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_ADVERTISINGID_IOS" : {
|
||||
"des" : "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填",
|
||||
"key" : "JPush:ADVERTISINGID",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_DEFAULTINITJPUSH_IOS" : {
|
||||
"des" : "[iOS]是否默认初始化,是填true,不是填false或者不填",
|
||||
"key" : "JPush:DEFAULTINITJPUSH",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_OPPO_APPKEY" : {
|
||||
"des" : "厂商OPPO-appkey,示例:OP-12345678",
|
||||
"key" : "OPPO_APPKEY",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_OPPO_APPID" : {
|
||||
"des" : "厂商OPPO-appId,示例:OP-12345678",
|
||||
"key" : "OPPO_APPID",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_OPPO_APPSECRET" : {
|
||||
"des" : "厂商OPPO-appSecret,示例:OP-12345678",
|
||||
"key" : "OPPO_APPSECRET",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_VIVO_APPKEY" : {
|
||||
"des" : "厂商VIVO-appkey,示例:12345678",
|
||||
"key" : "com.vivo.push.api_key",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_VIVO_APPID" : {
|
||||
"des" : "厂商VIVO-appId,示例:12345678",
|
||||
"key" : "com.vivo.push.app_id",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_MEIZU_APPKEY" : {
|
||||
"des" : "厂商MEIZU-appKey,示例:MZ-12345678",
|
||||
"key" : "MEIZU_APPKEY",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_MEIZU_APPID" : {
|
||||
"des" : "厂商MEIZU-appId,示例:MZ-12345678",
|
||||
"key" : "MEIZU_APPID",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_XIAOMI_APPKEY" : {
|
||||
"des" : "厂商XIAOMI-appKey,示例:MI-12345678",
|
||||
"key" : "XIAOMI_APPKEY",
|
||||
"value" : ""
|
||||
},
|
||||
"JPUSH_XIAOMI_APPID" : {
|
||||
"des" : "厂商XIAOMI-appId,示例:MI-12345678",
|
||||
"key" : "XIAOMI_APPID",
|
||||
"value" : ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx5fb1cc8edb3f8baa",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"postcss" : true,
|
||||
"es6" : true
|
||||
},
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "获取您的位置"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ],
|
||||
"usingComponents" : true,
|
||||
"__usePrivacyCheck__" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"h5" : {
|
||||
"devServer" : {
|
||||
"https" : false
|
||||
},
|
||||
"router" : {
|
||||
"mode" : "history",
|
||||
"base" : ""
|
||||
},
|
||||
"domain" : "",
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
|
||||
}
|
||||
}
|
||||
},
|
||||
"title" : "加载中...",
|
||||
"template" : "template.h5.html",
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div class="broadcast_details_picBox_no noPad">
|
||||
<div class="broadcast_details_pic">
|
||||
¥{{ item.product.price }}
|
||||
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||
</div>
|
||||
<div class="broadcast_details_tit_no line1">
|
||||
{{item.product.store_name}}
|
||||
@ -271,7 +271,7 @@
|
||||
</div>
|
||||
<div class="broadcast_details_picBox_no noPad">
|
||||
<div class="broadcast_details_pic">
|
||||
¥{{ item.product.price }}
|
||||
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||
</div>
|
||||
<div class="broadcast_details_tit_no line1">
|
||||
{{item.product.store_name}}
|
||||
@ -459,7 +459,7 @@
|
||||
</div>
|
||||
<div class="broadcast_details_picBox_no noPad">
|
||||
<div class="broadcast_details_pic">
|
||||
¥{{ item.product.price }}
|
||||
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||
</div>
|
||||
<div class="broadcast_details_tit_no line1">
|
||||
{{item.product.store_name}}
|
||||
@ -612,7 +612,7 @@
|
||||
</div>
|
||||
<div class="broadcast_details_picBox_no noPad">
|
||||
<div class="broadcast_details_pic">
|
||||
¥{{ item.product.price }}
|
||||
¥{{ saleType == 1? item.product.price :item.product.wholesale_price}}
|
||||
</div>
|
||||
<div class="broadcast_details_tit_no line1">
|
||||
{{item.product.store_name}}
|
||||
@ -718,7 +718,7 @@
|
||||
<div class="broadcast_details_tit">{{productInfo.store_name}}</div>
|
||||
<div class="acea-row row-between product_price">
|
||||
<div class="broadcast_details_pic p-color">
|
||||
¥{{ productInfo.price}}
|
||||
¥{{ saleType == 1? productInfo.price :productInfo.wholesale_price}}
|
||||
</div>
|
||||
<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
|
||||
</div>
|
||||
@ -957,7 +957,8 @@
|
||||
httpUrl: '',
|
||||
press: false,
|
||||
index: 0,
|
||||
j: 0
|
||||
j: 0,
|
||||
saleType: ''
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -983,8 +984,9 @@
|
||||
this.combinationId = parseInt(option.combinationId) || 0;
|
||||
this.orderId = option.order_id || ""
|
||||
this.mer_id = option.mer_id || 0
|
||||
this.refund_order_id = option.refund_order_id || 0
|
||||
this.userId = option.userId || 0
|
||||
this.refund_order_id = option.refund_order_id || 0;
|
||||
this.userId = option.userId || 0;
|
||||
this.saleType = option.sale_type || '';
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
self.windowH = res.windowHeight
|
||||
@ -1006,6 +1008,10 @@
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
|
||||
var isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale
|
||||
console.log(isWholeSale);
|
||||
|
||||
},
|
||||
onReady() {
|
||||
this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`;
|
||||
|
@ -1502,7 +1502,7 @@
|
||||
toLogin()
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}`
|
||||
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}$sale_type=${that.sale_type}`
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -69,7 +69,11 @@
|
||||
} from '@/utils';
|
||||
import {
|
||||
getGeocoder
|
||||
} from "@/api/store.js"
|
||||
} from "@/api/store.js";
|
||||
import {
|
||||
AUTH_EXPIRE_TIME
|
||||
} from "@/config/app.js";
|
||||
import permission from '@/utils/permission';
|
||||
export default {
|
||||
name: 'homeComb',
|
||||
props: {
|
||||
@ -135,7 +139,7 @@
|
||||
isCategory: false,
|
||||
swiperTop: 0,
|
||||
isFixed: true,
|
||||
street: ''
|
||||
street: '',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -230,9 +234,43 @@
|
||||
methods: {
|
||||
async scanQRcode() {
|
||||
// #ifdef APP-PLUS
|
||||
let result = await this.$store.dispatch("permission/requestPermissions",
|
||||
'CAMERA')
|
||||
let result = await this.$store.dispatch("permission/requestPermissions", 'CAMERA');
|
||||
console.log('权限状态:' + result);
|
||||
if (result != -1) {
|
||||
console.log('允许设置...');
|
||||
uni.removeStorageSync('expireTimeCamera');
|
||||
} else {
|
||||
const expireTime = uni.getStorageSync('expireTimeCamera');
|
||||
console.log('过期时间:' + expireTime);
|
||||
if (expireTime) {
|
||||
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
|
||||
console.log('时间过期了....')
|
||||
uni.removeStorageSync('expireTimeCamera');
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '操作权限已被拒绝,请手动前往设置',
|
||||
confirmText: "立即设置",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
permission.gotoAppSetting();
|
||||
} else {
|
||||
// 设置过期时间
|
||||
console.log('重置过期时间');
|
||||
uni.setStorageSync('expireTimeCamera', +new Date());
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('时间还没过期....');
|
||||
}
|
||||
} else {
|
||||
// 设置一个过期时间
|
||||
uni.setStorageSync('expireTimeCamera', +new Date());
|
||||
}
|
||||
}
|
||||
if (result !== 1) return;
|
||||
// 授权成功移除
|
||||
uni.removeStorageSync('expireTimeCamera');
|
||||
// #endif
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
|
@ -4,6 +4,7 @@
|
||||
id="home">
|
||||
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
|
||||
bgcolor="transparent"></skeleton>
|
||||
|
||||
<view v-if="!errorNetwork"
|
||||
:style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}">
|
||||
<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
|
||||
@ -399,6 +400,7 @@
|
||||
import {
|
||||
showTab
|
||||
} from "@/utils/showTab.js";
|
||||
import permission from '../../utils/permission';
|
||||
export default {
|
||||
computed: configMap({
|
||||
hide_mer_status: 0,
|
||||
@ -625,7 +627,7 @@
|
||||
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
||||
this.activeRouter = '/' + curRoute
|
||||
},
|
||||
onLoad(options) {
|
||||
async onLoad(options) {
|
||||
let that = this
|
||||
this._options = options;
|
||||
this.diyId = options.diyId || 0;
|
||||
@ -642,6 +644,16 @@
|
||||
})
|
||||
that.pageLoad(options);
|
||||
this.$store.dispatch('INIT_CONFIG');
|
||||
|
||||
// let result = await this.$store.dispatch("permission/requestPermissions",
|
||||
// 'ACCESS_FINE_LOCATION')
|
||||
|
||||
|
||||
// console.log(result)
|
||||
|
||||
|
||||
// permission.gotoAppSetting();
|
||||
|
||||
},
|
||||
|
||||
onShow() {
|
||||
|
@ -197,18 +197,21 @@
|
||||
电话认证
|
||||
</view>
|
||||
<view class="card-cont">
|
||||
<view class="card-cont-li">
|
||||
联系电话 {{formData.phone}}
|
||||
<view class="card-cont-li" style="justify-content: flex-start;">
|
||||
<text style="margin-right: 30rpx;width:120rpx;">联系电话</text>
|
||||
<text>{{formData.phone}}</text>
|
||||
</view>
|
||||
<u-line style="margin: 28rpx 0;"></u-line>
|
||||
<view class="card-cont-li">
|
||||
<view class="" style="flex: 4;display: flex;align-items: center;">
|
||||
验证码 <u--input style="margin-left: 40rpx;" border="none" v-model="formData.code">
|
||||
<text
|
||||
style="text-align-last: justify;width:108rpx;margin-right:40rpx;">验证码</text>
|
||||
<u--input border="none" v-model="formData.code" placeholder="请输入验证码">
|
||||
</u--input>
|
||||
</view>
|
||||
<view class="" style="flex: 1;">
|
||||
<u-button @click="handleVerify" type="success" shape="circle" :plain="true"
|
||||
:text="text"></u-button>
|
||||
:text="text" style="height: 60rpx;"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -258,7 +261,7 @@
|
||||
<text style="color: #35BD3E;" @click="getConfig">《入驻协议》</text>
|
||||
</view>
|
||||
<view class="submit-btn" v-if='step!=3'>
|
||||
<u-button text="添加店铺" @click="submit" shape='circle'
|
||||
<u-button :text="step==1?'添加店铺':'资质认证'" @click="submit" shape='circle'
|
||||
color=" linear-gradient( 132deg, #38BE41 0%, #20B128 100%)"></u-button>
|
||||
</view>
|
||||
|
||||
|
@ -66,12 +66,11 @@
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="viewColor">
|
||||
<view :style="viewColor" style="position: relative;z-index: 1000000;background-color: #fff;">
|
||||
<form @submit="formSubmit" report-submit='true'>
|
||||
<view class='addAddress'>
|
||||
<view class='list'>
|
||||
|
||||
<view v-if="userAddress.detail != ''" class="sel_addr_update-wrap">
|
||||
<view v-if="userAddress && userAddress.detail != ''" class="sel_addr_update-wrap">
|
||||
<view class="sel_addr_update">
|
||||
<view class="sel_addr_wrap-l">
|
||||
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
|
||||
@ -170,6 +169,10 @@
|
||||
getGeocoder
|
||||
} from '@/api/store.js';
|
||||
import authorize from '@/components/Authorize';
|
||||
import permission from '@/utils/permission';
|
||||
import {
|
||||
AUTH_EXPIRE_TIME
|
||||
} from "@/config/app.js"
|
||||
export default {
|
||||
components: {
|
||||
areaWindow,
|
||||
@ -205,7 +208,7 @@
|
||||
longitude: '',
|
||||
detail: '', //四川省泸州市龙马潭区龙门大道15号
|
||||
location: '', // 经纬度
|
||||
|
||||
timer: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -233,11 +236,18 @@
|
||||
this.isShowAuth = true
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// if (this.timer) clearInterval(this.timer);
|
||||
// this.timer = setInterval(() => {
|
||||
// console.log(new Date().getSeconds())
|
||||
// }, 1000)
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 选择地址
|
||||
handleToChoose() {
|
||||
async handleToChoose() {
|
||||
let that = this;
|
||||
|
||||
// #ifdef H5
|
||||
uni.navigateTo({
|
||||
url: "/pages/select_address_n/select_address_n",
|
||||
@ -251,15 +261,78 @@
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef H5
|
||||
let result = await that.$store.dispatch("permission/requestPermissions", 'ACCESS_FINE_LOCATION');
|
||||
console.log('权限状态:' + result);
|
||||
if (result != -1) {
|
||||
console.log('允许设置...');
|
||||
uni.removeStorageSync('expireTime');
|
||||
const isOpen = permission.isOpenGps();
|
||||
if (isOpen) {
|
||||
that.getLocation();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您未开启GPS定位,可能导致不能获取准确定位,是否继续',
|
||||
confirmText: "继续",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
that.getLocation();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
const expireTime = uni.getStorageSync('expireTime');
|
||||
console.log('过期时间:' + expireTime);
|
||||
if (expireTime) {
|
||||
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
|
||||
console.log('时间过期了....')
|
||||
uni.removeStorageSync('expireTime');
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '操作权限已被拒绝,请手动前往设置',
|
||||
confirmText: "立即设置",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
permission.gotoAppSetting();
|
||||
} else {
|
||||
// 设置过期时间
|
||||
console.log('重置过期时间');
|
||||
uni.setStorageSync('expireTime', +new Date());
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('时间还没过期....');
|
||||
}
|
||||
} else {
|
||||
// 设置一个过期时间
|
||||
uni.setStorageSync('expireTime', +new Date());
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
// 打开地图选择地址
|
||||
getLocation() {
|
||||
let that = this;
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
that.userAddress.detail = res.name
|
||||
that.userAddress.address_detail = res.address;
|
||||
that.location = `${res.latitude},${res.longitude}`;;
|
||||
that.userAddress.detail =
|
||||
res.name
|
||||
that.userAddress
|
||||
.address_detail = res
|
||||
.address;
|
||||
that.location =
|
||||
`${res.latitude},${res.longitude}`;;
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
|
||||
OnChangeAddress(address) {
|
||||
|
@ -1,249 +1,249 @@
|
||||
// 权限说明
|
||||
|
||||
const state = {
|
||||
WRITE_EXTERNAL_STORAGE: false,
|
||||
READ_EXTERNAL_STORAGE: false,
|
||||
CAMERA: false,
|
||||
CALL_PHONE: false,
|
||||
ACCESS_FINE_LOCATION: false,
|
||||
/* #ifdef APP-PLUS */
|
||||
isIos: plus.os.name == "iOS",
|
||||
/* #endif */
|
||||
mapping: {
|
||||
'WRITE_EXTERNAL_STORAGE': {
|
||||
title: "存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_WRITE_EXTERNAL_STORAGE'
|
||||
},
|
||||
'READ_EXTERNAL_STORAGE': {
|
||||
title: "存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_READ_EXTERNAL_STORAGE'
|
||||
},
|
||||
'CAMERA': {
|
||||
title: "相机/存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_CAMERA'
|
||||
},
|
||||
'CALL_PHONE': {
|
||||
title: "拨打/管理电话权限说明",
|
||||
content: "便于您使用该功能联系商家或者商家与您联系等场景",
|
||||
methods: 'SET_CALL_PHONE'
|
||||
},
|
||||
'ACCESS_FINE_LOCATION': {
|
||||
title: "获取位置权限说明",
|
||||
content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景",
|
||||
methods: 'SET_ACCESS_FINE_LOCATION'
|
||||
}
|
||||
}
|
||||
WRITE_EXTERNAL_STORAGE: false,
|
||||
READ_EXTERNAL_STORAGE: false,
|
||||
CAMERA: false,
|
||||
CALL_PHONE: false,
|
||||
ACCESS_FINE_LOCATION: false,
|
||||
/* #ifdef APP-PLUS */
|
||||
isIos: plus.os.name == "iOS",
|
||||
/* #endif */
|
||||
mapping: {
|
||||
'WRITE_EXTERNAL_STORAGE': {
|
||||
title: "存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_WRITE_EXTERNAL_STORAGE'
|
||||
},
|
||||
'READ_EXTERNAL_STORAGE': {
|
||||
title: "存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_READ_EXTERNAL_STORAGE'
|
||||
},
|
||||
'CAMERA': {
|
||||
title: "相机/存储空间/照片权限说明",
|
||||
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。",
|
||||
methods: 'SET_CAMERA'
|
||||
},
|
||||
'CALL_PHONE': {
|
||||
title: "拨打/管理电话权限说明",
|
||||
content: "便于您使用该功能联系商家或者商家与您联系等场景",
|
||||
methods: 'SET_CALL_PHONE'
|
||||
},
|
||||
'ACCESS_FINE_LOCATION': {
|
||||
title: "获取位置权限说明",
|
||||
content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景",
|
||||
methods: 'SET_ACCESS_FINE_LOCATION'
|
||||
}
|
||||
}
|
||||
}
|
||||
const mutations = {
|
||||
SET_WRITE_EXTERNAL_STORAGE(state, val) {
|
||||
state.WRITE_EXTERNAL_STORAGE = val
|
||||
},
|
||||
SET_CALL_PHONE(state, val) {
|
||||
state.CALL_PHONE = val
|
||||
},
|
||||
SET_READ_EXTERNAL_STORAGE(state, val) {
|
||||
state.READ_EXTERNAL_STORAGE = val
|
||||
},
|
||||
SET_CAMERA(state, val) {
|
||||
state.CAMERA = val
|
||||
},
|
||||
SET_ACCESS_FINE_LOCATION(state, val) {
|
||||
state.ACCESS_FINE_LOCATION = val
|
||||
},
|
||||
SET_WRITE_EXTERNAL_STORAGE(state, val) {
|
||||
state.WRITE_EXTERNAL_STORAGE = val
|
||||
},
|
||||
SET_CALL_PHONE(state, val) {
|
||||
state.CALL_PHONE = val
|
||||
},
|
||||
SET_READ_EXTERNAL_STORAGE(state, val) {
|
||||
state.READ_EXTERNAL_STORAGE = val
|
||||
},
|
||||
SET_CAMERA(state, val) {
|
||||
state.CAMERA = val
|
||||
},
|
||||
SET_ACCESS_FINE_LOCATION(state, val) {
|
||||
state.ACCESS_FINE_LOCATION = val
|
||||
},
|
||||
}
|
||||
const actions = {
|
||||
//权限获取
|
||||
async requestPermissions({
|
||||
state,
|
||||
dispatch,
|
||||
commit
|
||||
}, permissionID) {
|
||||
try {
|
||||
if (!state[permissionID] && !state.isIos) {
|
||||
var viewObj = await dispatch('nativeObjView', permissionID);
|
||||
viewObj.show();
|
||||
}
|
||||
console.log('android.permission.' + permissionID, '当前手机权限');
|
||||
return new Promise(async (resolve, reject) => {
|
||||
//苹果不需要这个
|
||||
if(state.isIos){
|
||||
resolve(1);
|
||||
return
|
||||
}
|
||||
// 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);
|
||||
},
|
||||
function (error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error
|
||||
.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
const result = await requestAndroidPermission(
|
||||
'android.permission.' + permissionID
|
||||
);
|
||||
if (result === 1) {
|
||||
//'已获得授权'
|
||||
commit(state.mapping[permissionID].methods, true)
|
||||
} else if (result === 0) {
|
||||
//'未获得授权'
|
||||
commit(state.mapping[permissionID].methods, false)
|
||||
} else {
|
||||
commit(state.mapping[permissionID].methods, true)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '操作权限已被拒绝,请手动前往设置',
|
||||
confirmText: "立即设置",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
dispatch('gotoAppPermissionSetting')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (viewObj) viewObj.close()
|
||||
resolve(result);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
//提示框
|
||||
nativeObjView({
|
||||
state
|
||||
}, permissionID) {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
const navigationBarHeight = systemInfo.platform === 'android' ? 48 :
|
||||
44; // Set the navigation bar height based on the platform
|
||||
const totalHeight = statusBarHeight + navigationBarHeight;
|
||||
let view = new plus.nativeObj.View('per-modal', {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
backgroundColor: '#444',
|
||||
//opacity: .5;
|
||||
})
|
||||
view.drawRect({
|
||||
color: '#fff',
|
||||
radius: '5px'
|
||||
}, {
|
||||
top: totalHeight + 'px',
|
||||
left: '5%',
|
||||
width: '90%',
|
||||
height: "100px",
|
||||
})
|
||||
view.drawText(state.mapping[permissionID].title, {
|
||||
top: totalHeight + 5 + 'px',
|
||||
left: "8%",
|
||||
height: "30px"
|
||||
}, {
|
||||
align: "left",
|
||||
color: "#000",
|
||||
}, {
|
||||
onClick: function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
view.drawText(state.mapping[permissionID].content, {
|
||||
top: totalHeight + 35 + 'px',
|
||||
height: "60px",
|
||||
left: "8%",
|
||||
width: "84%"
|
||||
}, {
|
||||
whiteSpace: 'normal',
|
||||
size: "14px",
|
||||
align: "left",
|
||||
color: "#656563"
|
||||
})
|
||||
|
||||
function show() {
|
||||
view = plus.nativeObj.View.getViewById('per-modal');
|
||||
view.show()
|
||||
view = null//展示的时候也得清空,不然影响下次的关闭,不知道为啥
|
||||
}
|
||||
|
||||
function close() {
|
||||
view = plus.nativeObj.View.getViewById('per-modal');
|
||||
view.close();
|
||||
view = null
|
||||
}
|
||||
return {
|
||||
show,
|
||||
close
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转到**应用**的权限页面
|
||||
gotoAppPermissionSetting({
|
||||
state
|
||||
}) {
|
||||
if (state.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);
|
||||
}
|
||||
}
|
||||
//权限获取
|
||||
async requestPermissions({
|
||||
state,
|
||||
dispatch,
|
||||
commit
|
||||
}, permissionID) {
|
||||
try {
|
||||
if (!state[permissionID] && !state.isIos) {
|
||||
var viewObj = await dispatch('nativeObjView', permissionID);
|
||||
viewObj.show();
|
||||
}
|
||||
console.log('android.permission.' + permissionID, '当前手机权限');
|
||||
return new Promise(async (resolve, reject) => {
|
||||
//苹果不需要这个
|
||||
if (state.isIos) {
|
||||
resolve(1);
|
||||
return
|
||||
}
|
||||
// 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);
|
||||
},
|
||||
function(error) {
|
||||
console.log('申请权限错误:' + error.code + " = " + error
|
||||
.message);
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
const result = await requestAndroidPermission(
|
||||
'android.permission.' + permissionID
|
||||
);
|
||||
if (result === 1) {
|
||||
//'已获得授权'
|
||||
commit(state.mapping[permissionID].methods, true)
|
||||
} else if (result === 0) {
|
||||
//'未获得授权'
|
||||
commit(state.mapping[permissionID].methods, false)
|
||||
} else {
|
||||
commit(state.mapping[permissionID].methods, true)
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '操作权限已被拒绝,请手动前往设置',
|
||||
// confirmText: "立即设置",
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// dispatch('gotoAppPermissionSetting')
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
if (viewObj) viewObj.close()
|
||||
resolve(result);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
//提示框
|
||||
nativeObjView({
|
||||
state
|
||||
}, permissionID) {
|
||||
const systemInfo = uni.getSystemInfoSync();
|
||||
const statusBarHeight = systemInfo.statusBarHeight;
|
||||
const navigationBarHeight = systemInfo.platform === 'android' ? 48 :
|
||||
44; // Set the navigation bar height based on the platform
|
||||
const totalHeight = statusBarHeight + navigationBarHeight;
|
||||
let view = new plus.nativeObj.View('per-modal', {
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
width: '100%',
|
||||
backgroundColor: '#444',
|
||||
//opacity: .5;
|
||||
})
|
||||
view.drawRect({
|
||||
color: '#fff',
|
||||
radius: '5px'
|
||||
}, {
|
||||
top: totalHeight + 'px',
|
||||
left: '5%',
|
||||
width: '90%',
|
||||
height: "100px",
|
||||
})
|
||||
view.drawText(state.mapping[permissionID].title, {
|
||||
top: totalHeight + 5 + 'px',
|
||||
left: "8%",
|
||||
height: "30px"
|
||||
}, {
|
||||
align: "left",
|
||||
color: "#000",
|
||||
}, {
|
||||
onClick: function(e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
view.drawText(state.mapping[permissionID].content, {
|
||||
top: totalHeight + 35 + 'px',
|
||||
height: "60px",
|
||||
left: "8%",
|
||||
width: "84%"
|
||||
}, {
|
||||
whiteSpace: 'normal',
|
||||
size: "14px",
|
||||
align: "left",
|
||||
color: "#656563"
|
||||
})
|
||||
|
||||
function show() {
|
||||
view = plus.nativeObj.View.getViewById('per-modal');
|
||||
view.show()
|
||||
view = null //展示的时候也得清空,不然影响下次的关闭,不知道为啥
|
||||
}
|
||||
|
||||
function close() {
|
||||
view = plus.nativeObj.View.getViewById('per-modal');
|
||||
view.close();
|
||||
view = null
|
||||
}
|
||||
return {
|
||||
show,
|
||||
close
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转到**应用**的权限页面
|
||||
gotoAppPermissionSetting({
|
||||
state
|
||||
}) {
|
||||
if (state.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
namespaced: true,
|
||||
state,
|
||||
mutations,
|
||||
actions
|
||||
};
|
@ -11,243 +11,252 @@
|
||||
var isIOS
|
||||
|
||||
function album() {
|
||||
var result = 0;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
var result = 0;
|
||||
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
|
||||
var authStatus = PHPhotoLibrary.authorizationStatus();
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(PHPhotoLibrary);
|
||||
return result;
|
||||
}
|
||||
|
||||
function camera() {
|
||||
var result = 0;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
var result = 0;
|
||||
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
|
||||
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
|
||||
if (authStatus === 0) {
|
||||
result = null;
|
||||
} else if (authStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(AVCaptureDevice);
|
||||
return result;
|
||||
}
|
||||
|
||||
function location() {
|
||||
var result = 0;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
if (!enable) {
|
||||
result = 2;
|
||||
} else if (status === 0) {
|
||||
result = null;
|
||||
} else if (status === 3 || status === 4) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
var result = 0;
|
||||
var cllocationManger = plus.ios.import("CLLocationManager");
|
||||
var enable = cllocationManger.locationServicesEnabled();
|
||||
var status = cllocationManger.authorizationStatus();
|
||||
if (!enable) {
|
||||
result = 2;
|
||||
} else if (status === 0) {
|
||||
result = null;
|
||||
} else if (status === 3 || status === 4) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(cllocationManger);
|
||||
return result;
|
||||
}
|
||||
|
||||
function push() {
|
||||
var result = 0;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
if (enabledTypes == 0) {
|
||||
result = 0;
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = 1;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
result = 3;
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = 4;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
var result = 0;
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var app = UIApplication.sharedApplication();
|
||||
var enabledTypes = 0;
|
||||
if (app.currentUserNotificationSettings) {
|
||||
var settings = app.currentUserNotificationSettings();
|
||||
enabledTypes = settings.plusGetAttribute("types");
|
||||
if (enabledTypes == 0) {
|
||||
result = 0;
|
||||
console.log("推送权限没有开启");
|
||||
} else {
|
||||
result = 1;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
plus.ios.deleteObject(settings);
|
||||
} else {
|
||||
enabledTypes = app.enabledRemoteNotificationTypes();
|
||||
if (enabledTypes == 0) {
|
||||
result = 3;
|
||||
console.log("推送权限没有开启!");
|
||||
} else {
|
||||
result = 4;
|
||||
console.log("已经开启推送功能!")
|
||||
}
|
||||
}
|
||||
plus.ios.deleteObject(app);
|
||||
plus.ios.deleteObject(UIApplication);
|
||||
return result;
|
||||
}
|
||||
|
||||
function contact() {
|
||||
var result = 0;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus === 0) {
|
||||
result = null;
|
||||
} else if (cnAuthStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
var result = 0;
|
||||
var CNContactStore = plus.ios.import("CNContactStore");
|
||||
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
|
||||
if (cnAuthStatus === 0) {
|
||||
result = null;
|
||||
} else if (cnAuthStatus == 3) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(CNContactStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
function record() {
|
||||
var result = null;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var status = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + status);
|
||||
if (status === 1970168948) {
|
||||
result = null;
|
||||
} else if (status === 1735552628) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
var result = null;
|
||||
var avaudiosession = plus.ios.import("AVAudioSession");
|
||||
var avaudio = avaudiosession.sharedInstance();
|
||||
var status = avaudio.recordPermission();
|
||||
console.log("permissionStatus:" + status);
|
||||
if (status === 1970168948) {
|
||||
result = null;
|
||||
} else if (status === 1735552628) {
|
||||
result = 1;
|
||||
} else {
|
||||
result = 0;
|
||||
}
|
||||
plus.ios.deleteObject(avaudiosession);
|
||||
return result;
|
||||
}
|
||||
|
||||
function calendar() {
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("日历权限已经开启");
|
||||
} else {
|
||||
console.log("日历权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
function memo() {
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
var result = null;
|
||||
var EKEventStore = plus.ios.import("EKEventStore");
|
||||
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
|
||||
if (ekAuthStatus == 3) {
|
||||
result = 1;
|
||||
console.log("备忘录权限已经开启");
|
||||
} else {
|
||||
console.log("备忘录权限没有开启");
|
||||
}
|
||||
plus.ios.deleteObject(EKEventStore);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
function requestIOS(permissionID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
switch (permissionID) {
|
||||
case "push":
|
||||
resolve(push());
|
||||
break;
|
||||
case "location":
|
||||
resolve(location());
|
||||
break;
|
||||
case "record":
|
||||
resolve(record());
|
||||
break;
|
||||
case "camera":
|
||||
resolve(camera());
|
||||
break;
|
||||
case "album":
|
||||
resolve(album());
|
||||
break;
|
||||
case "contact":
|
||||
resolve(contact());
|
||||
break;
|
||||
case "calendar":
|
||||
resolve(calendar());
|
||||
break;
|
||||
case "memo":
|
||||
resolve(memo());
|
||||
break;
|
||||
default:
|
||||
resolve(0);
|
||||
break;
|
||||
}
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
switch (permissionID) {
|
||||
case "push":
|
||||
resolve(push());
|
||||
break;
|
||||
case "location":
|
||||
resolve(location());
|
||||
break;
|
||||
case "record":
|
||||
resolve(record());
|
||||
break;
|
||||
case "camera":
|
||||
resolve(camera());
|
||||
break;
|
||||
case "album":
|
||||
resolve(album());
|
||||
break;
|
||||
case "contact":
|
||||
resolve(contact());
|
||||
break;
|
||||
case "calendar":
|
||||
resolve(calendar());
|
||||
break;
|
||||
case "memo":
|
||||
resolve(memo());
|
||||
break;
|
||||
default:
|
||||
resolve(0);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function requestAndroid(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);
|
||||
},
|
||||
function(error) {
|
||||
console.log('result error: ' + error.message)
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
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);
|
||||
},
|
||||
function(error) {
|
||||
console.log('result error: ' + error.message)
|
||||
resolve({
|
||||
code: error.code,
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function gotoAppPermissionSetting() {
|
||||
if (permission.isIOS) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
if (permission.isIOS) {
|
||||
var UIApplication = plus.ios.import("UIApplication");
|
||||
var application2 = UIApplication.sharedApplication();
|
||||
var NSURL2 = plus.ios.import("NSURL");
|
||||
var setting2 = NSURL2.URLWithString("app-settings:");
|
||||
application2.openURL(setting2);
|
||||
plus.ios.deleteObject(setting2);
|
||||
plus.ios.deleteObject(NSURL2);
|
||||
plus.ios.deleteObject(application2);
|
||||
} else {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
function isOpenGps() {
|
||||
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);
|
||||
return mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
const permission = {
|
||||
get isIOS(){
|
||||
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
|
||||
},
|
||||
requestIOS: requestIOS,
|
||||
requestAndroid: requestAndroid,
|
||||
gotoAppSetting: gotoAppPermissionSetting
|
||||
get isIOS() {
|
||||
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
|
||||
},
|
||||
requestIOS: requestIOS,
|
||||
requestAndroid: requestAndroid,
|
||||
gotoAppSetting: gotoAppPermissionSetting,
|
||||
isOpenGps
|
||||
}
|
||||
|
||||
module.exports = permission
|
||||
module.exports = permission
|
@ -33,6 +33,30 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
/*判断app授权是否超时
|
||||
key:授权值
|
||||
time:过期时间
|
||||
*/
|
||||
isOverTime: (key, time) => {
|
||||
let FLAG = false;
|
||||
const AUTH_TYPE = uni.getStorageSync(key);
|
||||
// 当前时间
|
||||
const CURR_TIME = +new Date();
|
||||
|
||||
if (!AUTH_TYPE) {
|
||||
uni.setStorageSync(key, time + CURR_TIME);
|
||||
FLAG = false;
|
||||
} else {
|
||||
// 判断两天时间是否过期
|
||||
if (CURR_TIME < AUTH_TYPE) { //未过期
|
||||
FLAG = false;
|
||||
} else {
|
||||
FLAG = true;
|
||||
}
|
||||
}
|
||||
return FLAG;
|
||||
},
|
||||
|
||||
//复制
|
||||
uniCopy: ({
|
||||
content,
|
||||
@ -866,7 +890,6 @@ export default {
|
||||
if (sp === undefined) sp = [];
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
let product = sp.find(item => item.product_id == list[i].product_id);
|
||||
console.log(product);
|
||||
if (!product)
|
||||
sp.push(list[i]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user