feat:实现了微信小程序、H5、华为快应用三端适配微信 / 支付宝 / 华为官方支付规范的支付功能

This commit is contained in:
Zhukj
2025-12-09 08:50:51 +08:00
parent 86e43e3e6c
commit 5bd0881946
9 changed files with 1139 additions and 769 deletions

View File

@@ -1,27 +1,23 @@
{
"name" : "lucky_weapp",
"appid" : "__UNI__A3A4830",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"name":"lucky_weapp",
"appid":"__UNI__A3A4830",
"description":"",
"versionName":"1.0.0",
"versionCode":"100",
"transformPx":false,
"app-plus":{
"usingComponents":true,
"nvueCompiler":"uni-app",
"splashscreen":{
"alwaysShowBeforeRender":true,
"waiting":true,
"autoclose":true,
"delay":0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"modules":{},
"distribute":{
"android":{
"permissions":[
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
@@ -46,90 +42,164 @@
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {
"ad" : {}
"ios":{},
"sdkConfigs":{
"ad":{},
// App端支付SDK配置适配原生App支付
"payment":{
"weixin":{
"appid":"wx1234567890abcdef", // 替换微信开放平台AppID
"universalLink":"https://yourdomain.com/apple-app-site-association" // 替换iOS微信Universal Link
},
"alipay":{
"appid":"2024000000000000" // 替换支付宝开放平台AppID
},
"huawei":{
"appid":"12345678" // 替换华为开发者联盟AppID应用市场申请
}
}
}
}
},
/* */
"mp-weixin" : {
"appid" : "wxa8f94045d9c2fc10",
"setting" : {
"urlCheck" : false,
"postcss" : false,
"es6" : true,
"minified" : true
"mp-weixin":{
"appid":"wxa8f94045d9c2fc10", // 你的微信小程序AppID已保留
"setting":{
"urlCheck":false,
"postcss":false,
"es6":true,
"minified":true
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "为了更好地为您提供服务"
"usingComponents":true,
"permission":{
"scope.userLocation":{
"desc":"为了更好地为您提供服务"
},
"scope.writePhotosAlbum" : {
"desc" : "为了更好地为您提供服务"
"scope.writePhotosAlbum":{
"desc":"为了更好地为您提供服务"
}
},
"requiredPrivateInfos" : [ "chooseLocation", "getLocation", "chooseAddress" ],
"__usePrivacyCheck__" : true,
"optimization" : {
"subPackages" : true
"useDeprecatedAPI":{
"getSystemInfoSync":false
},
"requiredPrivateInfos":["chooseLocation","getLocation","chooseAddress"],
"__usePrivacyCheck__":true,
"optimization":{
"subPackages":true
},
// 微信小程序支付核心配置(官方规范)
"pay":{
"merchantId":"1688888888", // 替换:你的微信支付商户号(商户平台获取)
"keyPath":"cert/apiclient_key.p12" // 可选:微信支付证书路径(退款/分账等接口需用)
},
"sdkConfigs":{
"jssdk":{
"apis":["chooseWXPay"] // 必须开启微信JSSDK支付接口H5/小程序共用)
}
}
},
"mp-alipay" : {
"usingComponents" : true,
"appid" : ""
"mp-alipay":{
"usingComponents":true,
"appid":"2024000000000000", // 替换你的支付宝小程序AppID开放平台获取
// 支付宝小程序支付配置(官方规范)
"pay":{
"merchantId":"2088888888888888" // 替换:你的支付宝支付商户号
}
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu":{
"usingComponents":true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao":{
"usingComponents":true
},
"h5" : {
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "TUHBZ-CNWKU-UHAVP-GZQ26-HNZFO-3YBF4"
"h5":{
"sdkConfigs":{
"maps":{
"qqmap":{
"key":"TUHBZ-CNWKU-UHAVP-GZQ26-HNZFO-3YBF4" // 已保留
},
// H5端微信/华为支付JSSDK配置
"weixin":{
"appid":"wxa8f94045d9c2fc10" // 和微信小程序AppID一致无需修改
},
"huawei":{
"appid":"12345678" // 替换华为开发者联盟AppID
}
}
},
"router" : {
"mode" : "history",
"base" : "/hwapp/"
"router":{
"mode":"hash", // 必须hash模式适配支付回调跳转
"base":"/hwapp/"
},
"title" : " ",
"devServer" : {
"https" : false
},
"optimization" : {
"treeShaking" : {
"enable" : false
"title":"华为支付演示",
"devServer":{
"https":false,
// H5端支付接口跨域代理解决浏览器跨域限制
"proxy":{
// 华为支付接口代理
"/api/huawei":{
"target":"https://iap-api.cloud.huawei.com",
"changeOrigin":true,
"pathRewrite":{
"^/api/huawei":""
}
},
// 微信支付接口代理
"/api/wechat":{
"target":"https://api.mch.weixin.qq.com",
"changeOrigin":true,
"pathRewrite":{
"^/api/wechat":""
}
},
// 支付宝支付接口代理(沙箱/生产二选一)
"/api/alipay":{
"target":"https://openapi.alipaydev.com", // 沙箱环境生产https://openapi.alipay.com
"changeOrigin":true,
"pathRewrite":{
"^/api/alipay":""
}
}
}
},
"domain" : " ",
"unipush" : {
"enable" : false
"optimization":{
"treeShaking":{
"enable":false
}
},
"async" : {
"loading" : "",
"error" : "",
"delay" : 0,
"timeout" : 3000
"domain":" ",
"unipush":{
"enable":false
},
"template" : ""
"async":{
"loading":"",
"error":"",
"delay":0,
"timeout":3000
},
"template":""
},
"uniStatistics" : {
"version" : "2"
"uniStatistics":{
"version":"2"
},
"sassImplementationName" : "node-sass",
/** **/
"quickapp-webview" : {
"package" : "com.jieganfsj.fivegshop",
"minPlatformVersion" : 1070,
"versionName" : "1.0.0",
"versionCode" : 0
"sassImplementationName":"node-sass",
"quickapp-webview":{
"package":"com.jieganfsj.fivegshop", // 已保留:华为快应用包名
"minPlatformVersion":1070,
"versionName":"1.0.0",
"versionCode":0,
// 华为快应用支付核心配置(官方规范)
"sdkConfigs":{
"huawei":{
"appid":"12345678", // 替换华为开发者联盟AppID
"payment":{
"merchantId":"88888888" // 替换:华为支付商户号(商户平台获取)
}
}
},
// 华为快应用必须声明的支付权限(官方强制)
"features":[
{"name":"system.pay"},
{"name":"huawei.pay"}
]
}
}
}