完善扫码支付功能

zw-dev
lsl 3 years ago
parent dfb2221c1c
commit 94f2d4256f

@ -81,27 +81,13 @@ Page({
}, },
scanCodeEvent(){ scanCodeEvent(){
var that = this; var that = this;
var DEV_CODE = "34ADE4201285" var DEV_CODE = ""
//扫码代码 //扫码代码
wx.scanCode({ wx.scanCode({
onlyFromCamera: true,// 只允许从相机扫码 onlyFromCamera: true,// 只允许从相机扫码
success(res){ success(res){
console.log("扫码成功:"+JSON.stringify(res)) console.log("扫码成功:"+JSON.stringify(res))
DEV_CODE = res.result DEV_CODE = res.result
},
fail (err) {
// console.log(err)
wx.showToast({
title:'扫描失败',
icon: 'none',
duration: 1000
})
}
})
var PUBLIC_KEY = "" var PUBLIC_KEY = ""
req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{ req.getRequest('/api/dict/value/login-public-key',{}).then((res)=>{
if(res.data.code==200){//扫码登录成功 if(res.data.code==200){//扫码登录成功
@ -129,11 +115,20 @@ Page({
} }
) )
}else{
wx.showToast({
title:'扫码失败,请确认您的二维码是否正确!',
icon: 'none',
duration: 1000
})
} }
console.log(res); console.log(res);
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
},
})
//调用RSA加密 //调用RSA加密
/*wx.scanCode({ /*wx.scanCode({

Loading…
Cancel
Save