Commit ce7bdd86 authored by caimeng's avatar caimeng

支付调通

parent 3ff054ee
......@@ -5,7 +5,7 @@
// 开发环境
const BASE = {
development: {
common: "http://192.168.0.92:8080",
common: "http://192.168.0.61:8080",
event: 'http://118.31.124.88:21111',
h5: 'http://ddang-hhym-h5-s.rockstect.cn/index.html'
},
......
......@@ -61,6 +61,20 @@ export default {
console.log(err, '初始化订单详情')
}
},
// 处理支付报错
appPayFail(err) {
const a = { "errMsg": "requestPayment:fail [payment支付宝:62001]用户中途取消支付操作", "errCode": -100, "code": -100 }
const { errMsg } = err;
const lastIndexNum = errMsg.indexOf(']');
let message = errMsg.substring(lastIndexNum + 1)
if (message === '未知错误') message = '请检查您的手机是否安装了支付宝~'
uni.showToast({
icon: 'none',
title: message,
duration: 2000
});
},
// 支付
handlePay() {
......@@ -75,6 +89,7 @@ export default {
*/
service: 'payment',
success: (res) => {
console.log(res,'日111')
/*
* @ res.service 获取服务供应商 ==> 'payment'
* @ res.provider 这里选择的是支付类型,所以包含["alipay","wxpay"]
......@@ -90,23 +105,29 @@ export default {
};
//发起后台支付接口请求
that.$request('/app/payment/pay', 'POST', data).then(res => {
console.log('支付宝订单数据', res);
console.log('支付宝订单数据', JSON.stringify(res));
//调用uniapp API uni.requestPayment 支付接口
uni.requestPayment({
//服务提供商 通过uni.getProvider获取
provider: 'alipay',
//后台返回的订单数据
orderInfo: res.data.result,
orderInfo: res.result,
//调用成功的回调
success(res) {
// console.log('success:' + res);
console.log('success:' + res);
uni.showToast({
icon: 'none',
title: '支付成功,即将返回,请耐心等待!',
duration: 3000
});
setTimeout(() => {
}, 500)
uni.navigateBack();
}, 3000)
},
//调用失败的回调
fail(err) {
console.log('fail:' + err);
that.appPayFail(err)
console.log('fail:' + JSON.stringify(err));
}
})
})
......
......@@ -136,7 +136,8 @@ export default {
if (res.success) {
const { id } = res.result;
uni.showToast({
title: '下单成功',
icon:'none',
title: '订单提交成功',
duration: 1200
});
TimeOut = setTimeout(() => {
......
iosProfile=/Users/admin/Desktop/ermo/uni-app-ddh-shop/app/dev.mobileprovision
ioscertFile=/Users/admin/Desktop/hhym_dev.p12
ioscertPassword=zlUOIlsvWaGaS9DZgwBUlQ==
ioscertFile=/Users/admin/Desktop/ermo/uni-app-ddh-shop/app/dev.p12
ioscertPassword=HfmgbKS6hY8nrLPDa+l0Vw==
{"dir":"/Users/seaman/srv/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/56689380-e91e-11ef-93ef-630e667f743a/wgtRoot/__UNI__670BD78/"}
\ No newline at end of file
{"dir":"/Users/seaman/srv/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/35a59fa0-ecfd-11ef-8b7c-77cf250462a2/wgtRoot/__UNI__670BD78/"}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__670BD78","name":"花花有米","version":{"name":"2.0.0","code":200},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Camera":{},"Geolocation":{},"Contacts":{},"Barcode":{},"FacialRecognitionVerify":{},"Statistic":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"delay":0,"waiting":true},"popGesture":"none","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#FFFFFF"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"distribute":{"orientation":["portrait-primary"]},"icons":{"android":{"hdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/72x72.png","xhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/96x96.png","xxhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/144x144.png","xxxhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/192x192.png"},"ios":{"appstore":"appstore.png","ipad":{"app":"icon-ipad-app.png","app@2x":"icon-ipad-app@2x.png","notification":"icon-ipad-notification.png","notification@2x":"icon-ipad-notification@2x.png","proapp@2x":"icon-ipad-proapp@2x.png","settings":"icon-ipad-settings.png","settings@2x":"icon-ipad-settings@2x.png","spotlight":"icon-ipad-spotlight.png","spotlight@2x":"icon-ipad-spotlight@2x.png"},"iphone":{"app@2x":"icon-iphone-app@2x.png","app@3x":"icon-iphone-app@3x.png","notification@2x":"icon-iphone-notification@2x.png","notification@3x":"icon-iphone-notification@3x.png","settings@2x":"icon-iphone-settings@2x.png","settings@3x":"icon-iphone-settings@3x.png","spotlight@2x":"icon-iphone-spotlight@2x.png","spotlight@3x":"icon-iphone-spotlight@3x.png"},"prerendered":"false"}},"splashscreen":{"useOriginalMsgbox":true,"androidStyle":"common","iosStyle":"common","ios":{"storyboard":"CustomStoryboard.zip"},"android":{"hdpi":"s.9.png","xhdpi":"s.9.png","xxhdpi":"s.9.png"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"minSdkVersion":21,"permissionExternalStorage":{"prompt":"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。","request":"none"},"permissionPhoneState":{"prompt":"为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许","request":"none"},"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<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_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.INTERNET\"/>","<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/> ","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"targetSdkVersion":30,"custompermissions":true},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSCameraUsageDescription":"以便于您可以使用正常使用身份证认证、刷脸等功能","NSLocationAlwaysAndWhenInUseUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSLocationAlwaysUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSLocationWhenInUseUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSPhotoLibraryUsageDescription":"为了给您提供意见反馈服务,请允许访问您的相册信息"},"appid":"com.huahuayoumi.hhym","password":"zlUOIlsvWaGaS9DZgwBUlQ==","mobileprovision":"apple-mobileprovision.mobileprovision","p12":"apple-private.p12","devices":"iphone","plistcmds":["Add :UIFileSharingEnabled bool true"]},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"geolocation":{"amap":{"__platform__":["ios","android"],"appkey_android":"577efe7a41b5f8febeeff4265aee7d7f","appkey_ios":"1a10348866a21198b86a7ed9ba8529d0","name":"amap_13669606635BrsJEpZoq"},"system":{"__platform__":["ios","android"]}},"statics":{"umeng":{"appkey_android":"66a8937acac2a664de7c6353","appkey_ios":"66a89341cac2a664de7c6348","channelid_android":"umeng","channelid_ios":"umeng"},"description":"管理消息推送能力"}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"compatible":{"ignoreVersion":true},"nativePlugins":{"AThree-LFv2":{}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"4.45","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(255,255,255,0.4)","color":"#0F0F0F","selectedColor":"#FF6F26","list":[{"pagePath":"pages/index/index","iconPath":"/static/tab/indexfh.png","selectedIconPath":"/static/tab/indexf.png","text":"首页"},{"pagePath":"pages/web/web","iconPath":"/static/tab/index-h.png","selectedIconPath":"/static/tab/index.png","text":"贷款"},{"pagePath":"pages/sort/index","iconPath":"/static/tab/sort-h.png","selectedIconPath":"/static/tab/sort.png","text":"分类"},{"pagePath":"pages/my/index","iconPath":"/static/tab/my-h.png","selectedIconPath":"/static/tab/my.png","text":"我的"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html","adid":"126065010911"}}
\ No newline at end of file
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__670BD78","name":"花花有米","version":{"name":"2.0.0","code":200},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Camera":{},"Geolocation":{},"Contacts":{},"Barcode":{},"FacialRecognitionVerify":{},"Statistic":{},"Payment":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":false,"delay":0,"waiting":true},"popGesture":"none","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#FFFFFF"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"safearea":{"bottom":{"offset":"none"}},"distribute":{"distribute":{"orientation":["portrait-primary"]},"icons":{"android":{"hdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/72x72.png","xhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/96x96.png","xxhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/144x144.png","xxxhdpi":"/Users/admin/Desktop/ermo/uni-app-ddh-shop/unpackage/res/icons/192x192.png"},"ios":{"appstore":"appstore.png","ipad":{"app":"icon-ipad-app.png","app@2x":"icon-ipad-app@2x.png","notification":"icon-ipad-notification.png","notification@2x":"icon-ipad-notification@2x.png","proapp@2x":"icon-ipad-proapp@2x.png","settings":"icon-ipad-settings.png","settings@2x":"icon-ipad-settings@2x.png","spotlight":"icon-ipad-spotlight.png","spotlight@2x":"icon-ipad-spotlight@2x.png"},"iphone":{"app@2x":"icon-iphone-app@2x.png","app@3x":"icon-iphone-app@3x.png","notification@2x":"icon-iphone-notification@2x.png","notification@3x":"icon-iphone-notification@3x.png","settings@2x":"icon-iphone-settings@2x.png","settings@3x":"icon-iphone-settings@3x.png","spotlight@2x":"icon-iphone-spotlight@2x.png","spotlight@3x":"icon-iphone-spotlight@3x.png"},"prerendered":"false"}},"splashscreen":{"useOriginalMsgbox":true,"androidStyle":"common","iosStyle":"common","ios":{"storyboard":"CustomStoryboard.zip"},"android":{"hdpi":"s.9.png","xhdpi":"s.9.png","xxhdpi":"s.9.png"}},"google":{"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"minSdkVersion":21,"permissionExternalStorage":{"prompt":"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。","request":"none"},"permissionPhoneState":{"prompt":"为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许","request":"none"},"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<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_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CALL_PHONE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.INTERNET\"/>","<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/> ","<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />","<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"targetSdkVersion":30,"custompermissions":true},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSCameraUsageDescription":"以便于您可以使用正常使用身份证认证、刷脸等功能","NSLocationAlwaysAndWhenInUseUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSLocationAlwaysUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSLocationWhenInUseUsageDescription":"为保护您账户安全,便于为您提供所在区域专属产品和服务,请您开启定位权限","NSPhotoLibraryUsageDescription":"为了给您提供意见反馈服务,请允许访问您的相册信息"},"appid":"com.huahuayoumi.hhym","password":"HfmgbKS6hY8nrLPDa+l0Vw==","mobileprovision":"apple-mobileprovision.mobileprovision","p12":"apple-private.p12","devices":"iphone","plistcmds":["Add :UIFileSharingEnabled bool true"]},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}},"geolocation":{"amap":{"__platform__":["ios","android"],"appkey_android":"577efe7a41b5f8febeeff4265aee7d7f","appkey_ios":"1a10348866a21198b86a7ed9ba8529d0","name":"amap_13669606635BrsJEpZoq"},"system":{"__platform__":["ios","android"]}},"payment":{"alipay":{"__platform__":["ios","android"]}},"statics":{"umeng":{"appkey_android":"66a8937acac2a664de7c6353","appkey_ios":"66a89341cac2a664de7c6348","channelid_android":"umeng","channelid_ios":"umeng"},"description":"管理消息推送能力"}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"compatible":{"ignoreVersion":true},"nativePlugins":{"AThree-LFv2":{}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"4.45","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"borderStyle":"rgba(255,255,255,0.4)","color":"#0F0F0F","selectedColor":"#FF6F26","list":[{"pagePath":"pages/index/index","iconPath":"/static/tab/indexfh.png","selectedIconPath":"/static/tab/indexf.png","text":"首页"},{"pagePath":"pages/web/web","iconPath":"/static/tab/index-h.png","selectedIconPath":"/static/tab/index.png","text":"贷款"},{"pagePath":"pages/sort/index","iconPath":"/static/tab/sort-h.png","selectedIconPath":"/static/tab/sort.png","text":"分类"},{"pagePath":"pages/my/index","iconPath":"/static/tab/my-h.png","selectedIconPath":"/static/tab/my.png","text":"我的"}],"height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html","adid":"126065010911"}}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment