文字修改

This commit is contained in:
1154079537 2024-05-24 18:04:37 +08:00
parent b0ccfc9f29
commit 50409cd8c4
11 changed files with 990 additions and 825 deletions

View File

@ -16,8 +16,8 @@ let openPlantGrass = '-openPlantGrass-'
let httpSix, httpApi; let httpSix, httpApi;
// const env = 'dev'; // 开发 // const env = 'dev'; // 开发
// const env = 'prod'; // 生产 const env = 'prod'; // 生产
const env = 'prew'; // 预上线 // const env = 'prew'; // 预上线
switch (env) { switch (env) {
case 'prod': case 'prod':
@ -77,4 +77,5 @@ module.exports = {
TOKENNAME: 'X-Token', TOKENNAME: 'X-Token',
// 缓存时间 0 永久 // 缓存时间 0 永久
EXPIRE: 0, EXPIRE: 0,
AUTH_EXPIRE_TIME: 20 * 1000 //秒
}; };

View File

@ -1,353 +1,353 @@
{ {
"name": "惠农生活", "name" : "惠农生活",
"appid": "__UNI__3A527D1", "appid" : "__UNI__3A527D1",
"description": "", "description" : "",
"versionName": "2.0.53", "versionName" : "2.0.26",
"versionCode": 2053, "versionCode" : 2026,
"transformPx": false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus": { "app-plus" : {
"titleNView": true, "titleNView" : true,
"usingComponents": true, "usingComponents" : true,
"nvueCompiler": "uni-app", "nvueCompiler" : "uni-app",
"nvueStyleCompiler": "uni-app", "nvueStyleCompiler" : "uni-app",
"compilerVersion": 3, "compilerVersion" : 3,
"compatible": { "compatible" : {
"ignoreVersion": true //trueHBuilderX1.9.0 "ignoreVersion" : true //trueHBuilderX1.9.0
}, },
"splashscreen": { "splashscreen" : {
"alwaysShowBeforeRender": false, "alwaysShowBeforeRender" : false,
"waiting": false, "waiting" : false,
"autoclose": true, "autoclose" : true,
"delay": 0 "delay" : 0
}, },
/* */ /* */
"modules": { "modules" : {
"VideoPlayer": {}, "VideoPlayer" : {},
"OAuth": {}, "OAuth" : {},
"Payment": {}, "Payment" : {},
"Share": {}, "Share" : {},
"iBeacon": {}, "iBeacon" : {},
"Maps": {}, "Maps" : {},
"Geolocation": {}, "Geolocation" : {},
"UniMP": { "UniMP" : {
"description": "uni小程序" "description" : "uni小程序"
}, },
"Push": {}, "Push" : {},
"Barcode": {}, "Barcode" : {},
"Camera": {} "Camera" : {}
}, },
"safearea": { "safearea" : {
"bottom": { "bottom" : {
"offset": "none" "offset" : "none"
} }
}, },
/* */ /* */
"distribute": { "distribute" : {
/* android */ /* android */
"android": { "android" : {
"permissions": [ "permissions" : [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", "<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_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", "<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_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>", "<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>", "<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>", "<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>", "<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_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.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>", "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>" "<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
], ],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"permissionExternalStorage": { "permissionExternalStorage" : {
"request": "none", "request" : "none",
"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
}, },
"permissionPhoneState": { "permissionPhoneState" : {
"request": "none" // "request" : "none" //
}, },
"minSdkVersion": 23, "minSdkVersion" : 23,
"targetSdkVersion": 30 "targetSdkVersion" : 30
}, },
/* ios */ /* ios */
"ios": { "ios" : {
"privacyDescription": { "privacyDescription" : {
"NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报", "NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报",
"NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报", "NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
"NSCameraUsageDescription": "上传用户头像保存分享海报", "NSCameraUsageDescription" : "上传用户头像保存分享海报",
"NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店", "NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
"NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店" "NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店"
}, },
"idfa": false, "idfa" : false,
"dSYMs": false "dSYMs" : false
}, },
/* SDK */ /* SDK */
"sdkConfigs": { "sdkConfigs" : {
"maps": { "maps" : {
"amap": { "amap" : {
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945", "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
"name": "amapIvoVHpJR" "name" : "amapIvoVHpJR"
} }
}, },
"payment": { "payment" : {
"weixin": { "weixin" : {
"__platform__": ["ios", "android"], "__platform__" : [ "ios", "android" ],
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
} }
}, },
"share": { "share" : {
"weixin": { "weixin" : {
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
} }
}, },
"geolocation": { "geolocation" : {
"amap": { "amap" : {
"name": "amapIvoVHpJR", "name" : "amapIvoVHpJR",
"__platform__": ["ios", "android"], "__platform__" : [ "ios", "android" ],
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d", "appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945" "appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945"
} }
}, },
"push": {}, "push" : {},
"oauth": { "oauth" : {
"weixin": { "weixin" : {
"appid": "wx2e8f79ff281284f5", "appid" : "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/" "UniversalLinks" : "https://shop.lihaink.cn/"
}, },
"univerify": {} "univerify" : {}
}, },
"ad": {} "ad" : {}
}, },
"icons": { "icons" : {
"android": { "android" : {
"hdpi": "unpackage/res/icons/72x72.png", "hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png", "xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png", "xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png" "xxxhdpi" : "unpackage/res/icons/192x192.png"
}, },
"ios": { "ios" : {
"appstore": "unpackage/res/icons/1024x1024.png", "appstore" : "unpackage/res/icons/1024x1024.png",
"ipad": { "ipad" : {
"app": "unpackage/res/icons/76x76.png", "app" : "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png", "app@2x" : "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png", "notification" : "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png", "notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png", "proapp@2x" : "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png", "settings" : "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png", "settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png", "spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png" "spotlight@2x" : "unpackage/res/icons/80x80.png"
}, },
"iphone": { "iphone" : {
"app@2x": "unpackage/res/icons/120x120.png", "app@2x" : "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png", "app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png", "notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png", "notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png", "settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png", "settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png", "spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png" "spotlight@3x" : "unpackage/res/icons/120x120.png"
} }
} }
}, },
"splashscreen": { "splashscreen" : {
"useOriginalMsgbox": true, "useOriginalMsgbox" : true,
"androidStyle": "common" "androidStyle" : "common"
} }
}, },
"nativePlugins": { "nativePlugins" : {
"JG-JCore": { "JG-JCore" : {
"JPUSH_APPKEY_IOS": "8a5efd65cda14fafa6e64ad3", "JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_CHANNEL_IOS": "8a5efd65cda14fafa6e64ad3", "JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_APPKEY_ANDROID": "b5f679f4357018605ea6fd2e", "JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e",
"JPUSH_CHANNEL_ANDROID": "", "JPUSH_CHANNEL_ANDROID" : "",
"__plugin_info__": { "__plugin_info__" : {
"name": "JG-JCore", "name" : "JG-JCore",
"description": "极光推送JCore插件", "description" : "极光推送JCore插件",
"platforms": "Android,iOS", "platforms" : "Android,iOS",
"url": "", "url" : "",
"android_package_name": "uni.UNI3A527D1", "android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id": "", "ios_bundle_id" : "",
"isCloud": false, "isCloud" : false,
"bought": -1, "bought" : -1,
"pid": "", "pid" : "",
"parameters": { "parameters" : {
"JPUSH_APPKEY_IOS": { "JPUSH_APPKEY_IOS" : {
"des": "[iOS]极光portal配置应用信息时分配的AppKey", "des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key": "JCore:APP_KEY", "key" : "JCore:APP_KEY",
"value": "daebe19b547c43128796a078" "value" : "daebe19b547c43128796a078"
}, },
"JPUSH_CHANNEL_IOS": { "JPUSH_CHANNEL_IOS" : {
"des": "[iOS]用于统计分发渠道不需要可填默认值developer-default", "des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key": "JCore:CHANNEL", "key" : "JCore:CHANNEL",
"value": "" "value" : ""
}, },
"JPUSH_APPKEY_ANDROID": { "JPUSH_APPKEY_ANDROID" : {
"des": "[Android]极光portal配置应用信息时分配的AppKey", "des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key": "JPUSH_APPKEY", "key" : "JPUSH_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_CHANNEL_ANDROID": { "JPUSH_CHANNEL_ANDROID" : {
"des": "[Android]用于统计分发渠道不需要可填默认值developer-default", "des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key": "JPUSH_CHANNEL", "key" : "JPUSH_CHANNEL",
"value": "" "value" : ""
} }
} }
} }
}, },
"JG-JPush": { "JG-JPush" : {
"JPUSH_ISPRODUCTION_IOS": "true", "JPUSH_ISPRODUCTION_IOS" : "true",
"JPUSH_ADVERTISINGID_IOS": "", "JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS": "true", "JPUSH_DEFAULTINITJPUSH_IOS" : "true",
"JPUSH_OPPO_APPKEY": "", "JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPID": "", "JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPSECRET": "", "JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPKEY": "", "JPUSH_VIVO_APPKEY" : "",
"JPUSH_VIVO_APPID": "", "JPUSH_VIVO_APPID" : "",
"JPUSH_MEIZU_APPKEY": "", "JPUSH_MEIZU_APPKEY" : "",
"JPUSH_MEIZU_APPID": "", "JPUSH_MEIZU_APPID" : "",
"JPUSH_XIAOMI_APPKEY": "", "JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_XIAOMI_APPID": "", "JPUSH_XIAOMI_APPID" : "",
"__plugin_info__": { "__plugin_info__" : {
"name": "JG-JPush", "name" : "JG-JPush",
"description": "极光推送Hbuilder插件", "description" : "极光推送Hbuilder插件",
"platforms": "Android,iOS", "platforms" : "Android,iOS",
"url": "", "url" : "",
"android_package_name": "uni.UNI3A527D1", "android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id": "", "ios_bundle_id" : "",
"isCloud": false, "isCloud" : false,
"bought": -1, "bought" : -1,
"pid": "", "pid" : "",
"parameters": { "parameters" : {
"JPUSH_ISPRODUCTION_IOS": { "JPUSH_ISPRODUCTION_IOS" : {
"des": "[iOS]是否是生产环境是填true不是填false或者不填", "des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"key": "JPush:ISPRODUCTION", "key" : "JPush:ISPRODUCTION",
"value": "" "value" : ""
}, },
"JPUSH_ADVERTISINGID_IOS": { "JPUSH_ADVERTISINGID_IOS" : {
"des": "[iOS]广告标识符IDFA如果不需要使用IDFA可不填", "des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key": "JPush:ADVERTISINGID", "key" : "JPush:ADVERTISINGID",
"value": "" "value" : ""
}, },
"JPUSH_DEFAULTINITJPUSH_IOS": { "JPUSH_DEFAULTINITJPUSH_IOS" : {
"des": "[iOS]是否默认初始化是填true不是填false或者不填", "des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"key": "JPush:DEFAULTINITJPUSH", "key" : "JPush:DEFAULTINITJPUSH",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPKEY": { "JPUSH_OPPO_APPKEY" : {
"des": "厂商OPPO-appkey,示例OP-12345678", "des" : "厂商OPPO-appkey,示例OP-12345678",
"key": "OPPO_APPKEY", "key" : "OPPO_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPID": { "JPUSH_OPPO_APPID" : {
"des": "厂商OPPO-appId,示例OP-12345678", "des" : "厂商OPPO-appId,示例OP-12345678",
"key": "OPPO_APPID", "key" : "OPPO_APPID",
"value": "" "value" : ""
}, },
"JPUSH_OPPO_APPSECRET": { "JPUSH_OPPO_APPSECRET" : {
"des": "厂商OPPO-appSecret,示例OP-12345678", "des" : "厂商OPPO-appSecret,示例OP-12345678",
"key": "OPPO_APPSECRET", "key" : "OPPO_APPSECRET",
"value": "" "value" : ""
}, },
"JPUSH_VIVO_APPKEY": { "JPUSH_VIVO_APPKEY" : {
"des": "厂商VIVO-appkey,示例12345678", "des" : "厂商VIVO-appkey,示例12345678",
"key": "com.vivo.push.api_key", "key" : "com.vivo.push.api_key",
"value": "" "value" : ""
}, },
"JPUSH_VIVO_APPID": { "JPUSH_VIVO_APPID" : {
"des": "厂商VIVO-appId,示例12345678", "des" : "厂商VIVO-appId,示例12345678",
"key": "com.vivo.push.app_id", "key" : "com.vivo.push.app_id",
"value": "" "value" : ""
}, },
"JPUSH_MEIZU_APPKEY": { "JPUSH_MEIZU_APPKEY" : {
"des": "厂商MEIZU-appKey,示例MZ-12345678", "des" : "厂商MEIZU-appKey,示例MZ-12345678",
"key": "MEIZU_APPKEY", "key" : "MEIZU_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_MEIZU_APPID": { "JPUSH_MEIZU_APPID" : {
"des": "厂商MEIZU-appId,示例MZ-12345678", "des" : "厂商MEIZU-appId,示例MZ-12345678",
"key": "MEIZU_APPID", "key" : "MEIZU_APPID",
"value": "" "value" : ""
}, },
"JPUSH_XIAOMI_APPKEY": { "JPUSH_XIAOMI_APPKEY" : {
"des": "厂商XIAOMI-appKey,示例MI-12345678", "des" : "厂商XIAOMI-appKey,示例MI-12345678",
"key": "XIAOMI_APPKEY", "key" : "XIAOMI_APPKEY",
"value": "" "value" : ""
}, },
"JPUSH_XIAOMI_APPID": { "JPUSH_XIAOMI_APPID" : {
"des": "厂商XIAOMI-appId,示例MI-12345678", "des" : "厂商XIAOMI-appId,示例MI-12345678",
"key": "XIAOMI_APPID", "key" : "XIAOMI_APPID",
"value": "" "value" : ""
} }
} }
} }
} }
} }
}, },
/* */ /* */
"quickapp": {}, "quickapp" : {},
/* */ /* */
"mp-weixin": { "mp-weixin" : {
"appid": "wx5fb1cc8edb3f8baa", "appid" : "wx5fb1cc8edb3f8baa",
"setting": { "setting" : {
"urlCheck": false, "urlCheck" : false,
"minified": true, "minified" : true,
"postcss": true, "postcss" : true,
"es6": true "es6" : true
}, },
"permission": { "permission" : {
"scope.userLocation": { "scope.userLocation" : {
"desc": "获取您的位置" "desc" : "获取您的位置"
} }
}, },
"requiredPrivateInfos": ["getLocation", "chooseAddress"], "requiredPrivateInfos" : [ "getLocation", "chooseAddress" ],
"usingComponents": true, "usingComponents" : true,
"__usePrivacyCheck__": true "__usePrivacyCheck__" : true
}, },
"mp-alipay": { "mp-alipay" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-baidu": { "mp-baidu" : {
"usingComponents": true "usingComponents" : true
}, },
"mp-toutiao": { "mp-toutiao" : {
"usingComponents": true "usingComponents" : true
}, },
"h5": { "h5" : {
"devServer": { "devServer" : {
"https": false "https" : false
}, },
"router": { "router" : {
"mode": "history", "mode" : "history",
"base": "" "base" : ""
}, },
"domain": "", "domain" : "",
"sdkConfigs": { "sdkConfigs" : {
"maps": { "maps" : {
"qqmap": { "qqmap" : {
"key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7" "key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
} }
} }
}, },
"title": "加载中...", "title" : "加载中...",
"template": "template.h5.html", "template" : "template.h5.html",
"optimization": { "optimization" : {
"treeShaking": { "treeShaking" : {
"enable": true "enable" : true
} }
} }
} }
} }

View File

@ -113,7 +113,7 @@
</div> </div>
<div class="broadcast_details_picBox_no noPad"> <div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">
{{item.product.store_name}} {{item.product.store_name}}
@ -271,7 +271,7 @@
</div> </div>
<div class="broadcast_details_picBox_no noPad"> <div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">
{{item.product.store_name}} {{item.product.store_name}}
@ -459,7 +459,7 @@
</div> </div>
<div class="broadcast_details_picBox_no noPad"> <div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">
{{item.product.store_name}} {{item.product.store_name}}
@ -612,7 +612,7 @@
</div> </div>
<div class="broadcast_details_picBox_no noPad"> <div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic"> <div class="broadcast_details_pic">
{{ item.product.price }} {{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div> </div>
<div class="broadcast_details_tit_no line1"> <div class="broadcast_details_tit_no line1">
{{item.product.store_name}} {{item.product.store_name}}
@ -718,7 +718,7 @@
<div class="broadcast_details_tit">{{productInfo.store_name}}</div> <div class="broadcast_details_tit">{{productInfo.store_name}}</div>
<div class="acea-row row-between product_price"> <div class="acea-row row-between product_price">
<div class="broadcast_details_pic p-color"> <div class="broadcast_details_pic p-color">
{{ productInfo.price}} {{ saleType == 1? productInfo.price :productInfo.wholesale_price}}
</div> </div>
<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div> <div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
</div> </div>
@ -957,7 +957,8 @@
httpUrl: '', httpUrl: '',
press: false, press: false,
index: 0, index: 0,
j: 0 j: 0,
saleType: ''
}; };
}, },
watch: { watch: {
@ -983,8 +984,9 @@
this.combinationId = parseInt(option.combinationId) || 0; this.combinationId = parseInt(option.combinationId) || 0;
this.orderId = option.order_id || "" this.orderId = option.order_id || ""
this.mer_id = option.mer_id || 0 this.mer_id = option.mer_id || 0
this.refund_order_id = option.refund_order_id || 0 this.refund_order_id = option.refund_order_id || 0;
this.userId = option.userId || 0 this.userId = option.userId || 0;
this.saleType = option.sale_type || '';
uni.getSystemInfo({ uni.getSystemInfo({
success: function(res) { success: function(res) {
self.windowH = res.windowHeight self.windowH = res.windowHeight
@ -1006,6 +1008,10 @@
}); });
}); });
// #endif // #endif
var isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale
console.log(isWholeSale);
}, },
onReady() { onReady() {
this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`; this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`;

View File

@ -1502,7 +1502,7 @@
toLogin() toLogin()
} else { } else {
uni.navigateTo({ 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}`
}); });
} }
}, },

View File

@ -69,7 +69,11 @@
} from '@/utils'; } from '@/utils';
import { import {
getGeocoder getGeocoder
} from "@/api/store.js" } from "@/api/store.js";
import {
AUTH_EXPIRE_TIME
} from "@/config/app.js";
import permission from '@/utils/permission';
export default { export default {
name: 'homeComb', name: 'homeComb',
props: { props: {
@ -135,7 +139,7 @@
isCategory: false, isCategory: false,
swiperTop: 0, swiperTop: 0,
isFixed: true, isFixed: true,
street: '' street: '',
}; };
}, },
watch: { watch: {
@ -230,9 +234,43 @@
methods: { methods: {
async scanQRcode() { async scanQRcode() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
let result = await this.$store.dispatch("permission/requestPermissions", let result = await this.$store.dispatch("permission/requestPermissions", 'CAMERA');
'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; if (result !== 1) return;
//
uni.removeStorageSync('expireTimeCamera');
// #endif // #endif
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {

View File

@ -4,6 +4,7 @@
id="home"> id="home">
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton" <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
bgcolor="transparent"></skeleton> bgcolor="transparent"></skeleton>
<view v-if="!errorNetwork" <view v-if="!errorNetwork"
:style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}"> :style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}">
<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }"> <view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
@ -399,6 +400,7 @@
import { import {
showTab showTab
} from "@/utils/showTab.js"; } from "@/utils/showTab.js";
import permission from '../../utils/permission';
export default { export default {
computed: configMap({ computed: configMap({
hide_mer_status: 0, hide_mer_status: 0,
@ -625,7 +627,7 @@
let curRoute = routes[routes.length - 1].route // let curRoute = routes[routes.length - 1].route //
this.activeRouter = '/' + curRoute this.activeRouter = '/' + curRoute
}, },
onLoad(options) { async onLoad(options) {
let that = this let that = this
this._options = options; this._options = options;
this.diyId = options.diyId || 0; this.diyId = options.diyId || 0;
@ -642,6 +644,16 @@
}) })
that.pageLoad(options); that.pageLoad(options);
this.$store.dispatch('INIT_CONFIG'); this.$store.dispatch('INIT_CONFIG');
// let result = await this.$store.dispatch("permission/requestPermissions",
// 'ACCESS_FINE_LOCATION')
// console.log(result)
// permission.gotoAppSetting();
}, },
onShow() { onShow() {

View File

@ -197,18 +197,21 @@
电话认证 电话认证
</view> </view>
<view class="card-cont"> <view class="card-cont">
<view class="card-cont-li"> <view class="card-cont-li" style="justify-content: flex-start;">
联系电话 {{formData.phone}} <text style="margin-right: 30rpx;width:120rpx;">联系电话</text>
<text>{{formData.phone}}</text>
</view> </view>
<u-line style="margin: 28rpx 0;"></u-line> <u-line style="margin: 28rpx 0;"></u-line>
<view class="card-cont-li"> <view class="card-cont-li">
<view class="" style="flex: 4;display: flex;align-items: center;"> <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> </u--input>
</view> </view>
<view class="" style="flex: 1;"> <view class="" style="flex: 1;">
<u-button @click="handleVerify" type="success" shape="circle" :plain="true" <u-button @click="handleVerify" type="success" shape="circle" :plain="true"
:text="text"></u-button> :text="text" style="height: 60rpx;"></u-button>
</view> </view>
</view> </view>
</view> </view>
@ -258,7 +261,7 @@
<text style="color: #35BD3E;" @click="getConfig">入驻协议</text> <text style="color: #35BD3E;" @click="getConfig">入驻协议</text>
</view> </view>
<view class="submit-btn" v-if='step!=3'> <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> color=" linear-gradient( 132deg, #38BE41 0%, #20B128 100%)"></u-button>
</view> </view>

View File

@ -66,12 +66,11 @@
} }
</style> </style>
<template> <template>
<view :style="viewColor"> <view :style="viewColor" style="position: relative;z-index: 1000000;background-color: #fff;">
<form @submit="formSubmit" report-submit='true'> <form @submit="formSubmit" report-submit='true'>
<view class='addAddress'> <view class='addAddress'>
<view class='list'> <view class='list'>
<view v-if="userAddress && userAddress.detail != ''" class="sel_addr_update-wrap">
<view v-if="userAddress.detail != ''" class="sel_addr_update-wrap">
<view class="sel_addr_update"> <view class="sel_addr_update">
<view class="sel_addr_wrap-l"> <view class="sel_addr_wrap-l">
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view> <view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
@ -170,6 +169,10 @@
getGeocoder getGeocoder
} from '@/api/store.js'; } from '@/api/store.js';
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import permission from '@/utils/permission';
import {
AUTH_EXPIRE_TIME
} from "@/config/app.js"
export default { export default {
components: { components: {
areaWindow, areaWindow,
@ -205,7 +208,7 @@
longitude: '', longitude: '',
detail: '', //15 detail: '', //15
location: '', // location: '', //
timer: null
}; };
}, },
computed: { computed: {
@ -233,11 +236,18 @@
this.isShowAuth = true this.isShowAuth = true
} }
}, },
onShow() {
// if (this.timer) clearInterval(this.timer);
// this.timer = setInterval(() => {
// console.log(new Date().getSeconds())
// }, 1000)
},
methods: { methods: {
// //
handleToChoose() { async handleToChoose() {
let that = this; let that = this;
// #ifdef H5 // #ifdef H5
uni.navigateTo({ uni.navigateTo({
url: "/pages/select_address_n/select_address_n", url: "/pages/select_address_n/select_address_n",
@ -251,15 +261,78 @@
} }
}) })
// #endif // #endif
// #ifndef H5 // #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({ uni.chooseLocation({
success: function(res) { success: function(res) {
that.userAddress.detail = res.name that.userAddress.detail =
that.userAddress.address_detail = res.address; res.name
that.location = `${res.latitude},${res.longitude}`;; that.userAddress
.address_detail = res
.address;
that.location =
`${res.latitude},${res.longitude}`;;
},
fail(err) {
console.log(err);
} }
}); });
// #endif
}, },
OnChangeAddress(address) { OnChangeAddress(address) {

View File

@ -1,249 +1,249 @@
// 权限说明 // 权限说明
const state = { const state = {
WRITE_EXTERNAL_STORAGE: false, WRITE_EXTERNAL_STORAGE: false,
READ_EXTERNAL_STORAGE: false, READ_EXTERNAL_STORAGE: false,
CAMERA: false, CAMERA: false,
CALL_PHONE: false, CALL_PHONE: false,
ACCESS_FINE_LOCATION: false, ACCESS_FINE_LOCATION: false,
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
isIos: plus.os.name == "iOS", isIos: plus.os.name == "iOS",
/* #endif */ /* #endif */
mapping: { mapping: {
'WRITE_EXTERNAL_STORAGE': { 'WRITE_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明", title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。", content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_WRITE_EXTERNAL_STORAGE' methods: 'SET_WRITE_EXTERNAL_STORAGE'
}, },
'READ_EXTERNAL_STORAGE': { 'READ_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明", title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。", content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_READ_EXTERNAL_STORAGE' methods: 'SET_READ_EXTERNAL_STORAGE'
}, },
'CAMERA': { 'CAMERA': {
title: "相机/存储空间/照片权限说明", title: "相机/存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。", content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_CAMERA' methods: 'SET_CAMERA'
}, },
'CALL_PHONE': { 'CALL_PHONE': {
title: "拨打/管理电话权限说明", title: "拨打/管理电话权限说明",
content: "便于您使用该功能联系商家或者商家与您联系等场景", content: "便于您使用该功能联系商家或者商家与您联系等场景",
methods: 'SET_CALL_PHONE' methods: 'SET_CALL_PHONE'
}, },
'ACCESS_FINE_LOCATION': { 'ACCESS_FINE_LOCATION': {
title: "获取位置权限说明", title: "获取位置权限说明",
content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景", content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景",
methods: 'SET_ACCESS_FINE_LOCATION' methods: 'SET_ACCESS_FINE_LOCATION'
} }
} }
} }
const mutations = { const mutations = {
SET_WRITE_EXTERNAL_STORAGE(state, val) { SET_WRITE_EXTERNAL_STORAGE(state, val) {
state.WRITE_EXTERNAL_STORAGE = val state.WRITE_EXTERNAL_STORAGE = val
}, },
SET_CALL_PHONE(state, val) { SET_CALL_PHONE(state, val) {
state.CALL_PHONE = val state.CALL_PHONE = val
}, },
SET_READ_EXTERNAL_STORAGE(state, val) { SET_READ_EXTERNAL_STORAGE(state, val) {
state.READ_EXTERNAL_STORAGE = val state.READ_EXTERNAL_STORAGE = val
}, },
SET_CAMERA(state, val) { SET_CAMERA(state, val) {
state.CAMERA = val state.CAMERA = val
}, },
SET_ACCESS_FINE_LOCATION(state, val) { SET_ACCESS_FINE_LOCATION(state, val) {
state.ACCESS_FINE_LOCATION = val state.ACCESS_FINE_LOCATION = val
}, },
} }
const actions = { const actions = {
//权限获取 //权限获取
async requestPermissions({ async requestPermissions({
state, state,
dispatch, dispatch,
commit commit
}, permissionID) { }, permissionID) {
try { try {
if (!state[permissionID] && !state.isIos) { if (!state[permissionID] && !state.isIos) {
var viewObj = await dispatch('nativeObjView', permissionID); var viewObj = await dispatch('nativeObjView', permissionID);
viewObj.show(); viewObj.show();
} }
console.log('android.permission.' + permissionID, '当前手机权限'); console.log('android.permission.' + permissionID, '当前手机权限');
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
//苹果不需要这个 //苹果不需要这个
if(state.isIos){ if (state.isIos) {
resolve(1); resolve(1);
return return
} }
// 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_
], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装 ], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
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++) {
var grantedPermission = resultObj.granted[i]; var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission); console.log('已获取的权限:' + grantedPermission);
result = 1 result = 1
} }
for (var i = 0; i < resultObj.deniedPresent for (var i = 0; i < resultObj.deniedPresent
.length; i++) { .length; i++) {
var deniedPresentPermission = resultObj var deniedPresentPermission = resultObj
.deniedPresent[ .deniedPresent[
i]; i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission); console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0 result = 0
} }
for (var i = 0; i < resultObj.deniedAlways for (var i = 0; i < resultObj.deniedAlways
.length; i++) { .length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[ var deniedAlwaysPermission = resultObj.deniedAlways[
i]; i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission); console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1 result = -1
} }
resolve(result); resolve(result);
}, },
function (error) { function(error) {
console.log('申请权限错误:' + error.code + " = " + error console.log('申请权限错误:' + error.code + " = " + error
.message); .message);
resolve({ resolve({
code: error.code, code: error.code,
message: error.message message: error.message
}); });
} }
); );
}); });
} }
const result = await requestAndroidPermission( const result = await requestAndroidPermission(
'android.permission.' + permissionID 'android.permission.' + permissionID
); );
if (result === 1) { if (result === 1) {
//'已获得授权' //'已获得授权'
commit(state.mapping[permissionID].methods, true) commit(state.mapping[permissionID].methods, true)
} else if (result === 0) { } else if (result === 0) {
//'未获得授权' //'未获得授权'
commit(state.mapping[permissionID].methods, false) commit(state.mapping[permissionID].methods, false)
} else { } else {
commit(state.mapping[permissionID].methods, true) commit(state.mapping[permissionID].methods, true)
uni.showModal({ // uni.showModal({
title: '提示', // title: '提示',
content: '操作权限已被拒绝,请手动前往设置', // content: '操作权限已被拒绝,请手动前往设置',
confirmText: "立即设置", // confirmText: "立即设置",
success: (res) => { // success: (res) => {
if (res.confirm) { // if (res.confirm) {
dispatch('gotoAppPermissionSetting') // dispatch('gotoAppPermissionSetting')
} // }
} // }
}) // })
} }
if (viewObj) viewObj.close() if (viewObj) viewObj.close()
resolve(result); resolve(result);
}); });
} catch (error) { } catch (error) {
console.log(error); console.log(error);
reject(error); reject(error);
} }
}, },
//提示框 //提示框
nativeObjView({ nativeObjView({
state state
}, permissionID) { }, permissionID) {
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight; const statusBarHeight = systemInfo.statusBarHeight;
const navigationBarHeight = systemInfo.platform === 'android' ? 48 : const navigationBarHeight = systemInfo.platform === 'android' ? 48 :
44; // Set the navigation bar height based on the platform 44; // Set the navigation bar height based on the platform
const totalHeight = statusBarHeight + navigationBarHeight; const totalHeight = statusBarHeight + navigationBarHeight;
let view = new plus.nativeObj.View('per-modal', { let view = new plus.nativeObj.View('per-modal', {
top: '0px', top: '0px',
left: '0px', left: '0px',
width: '100%', width: '100%',
backgroundColor: '#444', backgroundColor: '#444',
//opacity: .5; //opacity: .5;
}) })
view.drawRect({ view.drawRect({
color: '#fff', color: '#fff',
radius: '5px' radius: '5px'
}, { }, {
top: totalHeight + 'px', top: totalHeight + 'px',
left: '5%', left: '5%',
width: '90%', width: '90%',
height: "100px", height: "100px",
}) })
view.drawText(state.mapping[permissionID].title, { view.drawText(state.mapping[permissionID].title, {
top: totalHeight + 5 + 'px', top: totalHeight + 5 + 'px',
left: "8%", left: "8%",
height: "30px" height: "30px"
}, { }, {
align: "left", align: "left",
color: "#000", color: "#000",
}, { }, {
onClick: function (e) { onClick: function(e) {
console.log(e); console.log(e);
} }
}) })
view.drawText(state.mapping[permissionID].content, { view.drawText(state.mapping[permissionID].content, {
top: totalHeight + 35 + 'px', top: totalHeight + 35 + 'px',
height: "60px", height: "60px",
left: "8%", left: "8%",
width: "84%" width: "84%"
}, { }, {
whiteSpace: 'normal', whiteSpace: 'normal',
size: "14px", size: "14px",
align: "left", align: "left",
color: "#656563" color: "#656563"
}) })
function show() { function show() {
view = plus.nativeObj.View.getViewById('per-modal'); view = plus.nativeObj.View.getViewById('per-modal');
view.show() view.show()
view = null//展示的时候也得清空,不然影响下次的关闭,不知道为啥 view = null //展示的时候也得清空,不然影响下次的关闭,不知道为啥
} }
function close() { function close() {
view = plus.nativeObj.View.getViewById('per-modal'); view = plus.nativeObj.View.getViewById('per-modal');
view.close(); view.close();
view = null view = null
} }
return { return {
show, show,
close close
} }
}, },
// 跳转到**应用**的权限页面 // 跳转到**应用**的权限页面
gotoAppPermissionSetting({ gotoAppPermissionSetting({
state state
}) { }) {
if (state.isIos) { if (state.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);
plus.ios.deleteObject(setting2); plus.ios.deleteObject(setting2);
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");
var mainActivity = plus.android.runtimeMainActivity(); var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent(); var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null); var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri); intent.setData(uri);
mainActivity.startActivity(intent); mainActivity.startActivity(intent);
} }
} }
} }
export default { export default {
namespaced: true, namespaced: true,
state, state,
mutations, mutations,
actions actions
}; };

View File

@ -11,243 +11,252 @@
var isIOS var isIOS
function album() { function album() {
var result = 0; var result = 0;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary"); var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus(); var authStatus = PHPhotoLibrary.authorizationStatus();
if (authStatus === 0) { if (authStatus === 0) {
result = null; result = null;
} else if (authStatus == 3) { } else if (authStatus == 3) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;
} }
plus.ios.deleteObject(PHPhotoLibrary); plus.ios.deleteObject(PHPhotoLibrary);
return result; return result;
} }
function camera() { function camera() {
var result = 0; var result = 0;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice"); var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide'); var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
if (authStatus === 0) { if (authStatus === 0) {
result = null; result = null;
} else if (authStatus == 3) { } else if (authStatus == 3) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;
} }
plus.ios.deleteObject(AVCaptureDevice); plus.ios.deleteObject(AVCaptureDevice);
return result; return result;
} }
function location() { function location() {
var result = 0; var result = 0;
var cllocationManger = plus.ios.import("CLLocationManager"); var cllocationManger = plus.ios.import("CLLocationManager");
var enable = cllocationManger.locationServicesEnabled(); var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus(); var status = cllocationManger.authorizationStatus();
if (!enable) { if (!enable) {
result = 2; result = 2;
} else if (status === 0) { } else if (status === 0) {
result = null; result = null;
} else if (status === 3 || status === 4) { } else if (status === 3 || status === 4) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;
} }
plus.ios.deleteObject(cllocationManger); plus.ios.deleteObject(cllocationManger);
return result; return result;
} }
function push() { function push() {
var result = 0; var result = 0;
var UIApplication = plus.ios.import("UIApplication"); var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication(); var app = UIApplication.sharedApplication();
var enabledTypes = 0; var enabledTypes = 0;
if (app.currentUserNotificationSettings) { if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings(); var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types"); enabledTypes = settings.plusGetAttribute("types");
if (enabledTypes == 0) { if (enabledTypes == 0) {
result = 0; result = 0;
console.log("推送权限没有开启"); console.log("推送权限没有开启");
} else { } else {
result = 1; result = 1;
console.log("已经开启推送功能!") console.log("已经开启推送功能!")
} }
plus.ios.deleteObject(settings); plus.ios.deleteObject(settings);
} else { } else {
enabledTypes = app.enabledRemoteNotificationTypes(); enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) { if (enabledTypes == 0) {
result = 3; result = 3;
console.log("推送权限没有开启!"); console.log("推送权限没有开启!");
} else { } else {
result = 4; result = 4;
console.log("已经开启推送功能!") console.log("已经开启推送功能!")
} }
} }
plus.ios.deleteObject(app); plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication); plus.ios.deleteObject(UIApplication);
return result; return result;
} }
function contact() { function contact() {
var result = 0; var result = 0;
var CNContactStore = plus.ios.import("CNContactStore"); var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0); var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (cnAuthStatus === 0) { if (cnAuthStatus === 0) {
result = null; result = null;
} else if (cnAuthStatus == 3) { } else if (cnAuthStatus == 3) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;
} }
plus.ios.deleteObject(CNContactStore); plus.ios.deleteObject(CNContactStore);
return result; return result;
} }
function record() { function record() {
var result = null; var result = null;
var avaudiosession = plus.ios.import("AVAudioSession"); var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance(); var avaudio = avaudiosession.sharedInstance();
var status = avaudio.recordPermission(); var status = avaudio.recordPermission();
console.log("permissionStatus:" + status); console.log("permissionStatus:" + status);
if (status === 1970168948) { if (status === 1970168948) {
result = null; result = null;
} else if (status === 1735552628) { } else if (status === 1735552628) {
result = 1; result = 1;
} else { } else {
result = 0; result = 0;
} }
plus.ios.deleteObject(avaudiosession); plus.ios.deleteObject(avaudiosession);
return result; return result;
} }
function calendar() { function calendar() {
var result = null; var result = null;
var EKEventStore = plus.ios.import("EKEventStore"); var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0); var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) { if (ekAuthStatus == 3) {
result = 1; result = 1;
console.log("日历权限已经开启"); console.log("日历权限已经开启");
} else { } else {
console.log("日历权限没有开启"); console.log("日历权限没有开启");
} }
plus.ios.deleteObject(EKEventStore); plus.ios.deleteObject(EKEventStore);
return result; return result;
} }
function memo() { function memo() {
var result = null; var result = null;
var EKEventStore = plus.ios.import("EKEventStore"); var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1); var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) { if (ekAuthStatus == 3) {
result = 1; result = 1;
console.log("备忘录权限已经开启"); console.log("备忘录权限已经开启");
} else { } else {
console.log("备忘录权限没有开启"); console.log("备忘录权限没有开启");
} }
plus.ios.deleteObject(EKEventStore); plus.ios.deleteObject(EKEventStore);
return result; return result;
} }
function requestIOS(permissionID) { function requestIOS(permissionID) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
switch (permissionID) { switch (permissionID) {
case "push": case "push":
resolve(push()); resolve(push());
break; break;
case "location": case "location":
resolve(location()); resolve(location());
break; break;
case "record": case "record":
resolve(record()); resolve(record());
break; break;
case "camera": case "camera":
resolve(camera()); resolve(camera());
break; break;
case "album": case "album":
resolve(album()); resolve(album());
break; break;
case "contact": case "contact":
resolve(contact()); resolve(contact());
break; break;
case "calendar": case "calendar":
resolve(calendar()); resolve(calendar());
break; break;
case "memo": case "memo":
resolve(memo()); resolve(memo());
break; break;
default: default:
resolve(0); resolve(0);
break; break;
} }
}); });
} }
function requestAndroid(permissionID) { function requestAndroid(permissionID) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
plus.android.requestPermissions( plus.android.requestPermissions(
[permissionID], [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++) {
var grantedPermission = resultObj.granted[i]; var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission); console.log('已获取的权限:' + grantedPermission);
result = 1 result = 1
} }
for (var i = 0; i < resultObj.deniedPresent.length; i++) { for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i]; var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission); console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0 result = 0
} }
for (var i = 0; i < resultObj.deniedAlways.length; i++) { for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i]; var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission); console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1 result = -1
} }
resolve(result); resolve(result);
}, },
function(error) { function(error) {
console.log('result error: ' + error.message) console.log('result error: ' + error.message)
resolve({ resolve({
code: error.code, code: error.code,
message: error.message message: error.message
}); });
} }
); );
}); });
} }
function gotoAppPermissionSetting() { function gotoAppPermissionSetting() {
if (permission.isIOS) { if (permission.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("app-settings:"); var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2); application2.openURL(setting2);
plus.ios.deleteObject(setting2); plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2); plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2); plus.ios.deleteObject(application2);
} else { } else {
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");
var mainActivity = plus.android.runtimeMainActivity(); var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent(); var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null); var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri); intent.setData(uri);
mainActivity.startActivity(intent); 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 = { const permission = {
get isIOS(){ get isIOS() {
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios') return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
}, },
requestIOS: requestIOS, requestIOS: requestIOS,
requestAndroid: requestAndroid, requestAndroid: requestAndroid,
gotoAppSetting: gotoAppPermissionSetting gotoAppSetting: gotoAppPermissionSetting,
isOpenGps
} }
module.exports = permission module.exports = permission

View File

@ -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: ({ uniCopy: ({
content, content,
@ -866,7 +890,6 @@ export default {
if (sp === undefined) sp = []; if (sp === undefined) sp = [];
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
let product = sp.find(item => item.product_id == list[i].product_id); let product = sp.find(item => item.product_id == list[i].product_id);
console.log(product);
if (!product) if (!product)
sp.push(list[i]); sp.push(list[i]);
} }