Commit ee1ce25b by 冷斌

fix bug

parent e1ef20af
...@@ -23,7 +23,7 @@ class RechangeController extends HomebaseController ...@@ -23,7 +23,7 @@ class RechangeController extends HomebaseController
{ {
return [ return [
'wechat' => [ 'wechat' => [
'appid' => 'wx98dd4477b89cb388', // app 开放平台的APPID // 'appid' => 'wx98dd4477b89cb388', // app 开放平台的APPID
'app_id' => 'wx37327dbb9d7b33f3', // 公众号 APPID 'app_id' => 'wx37327dbb9d7b33f3', // 公众号 APPID
'miniapp_id' => '', //小程序 APPID 'miniapp_id' => '', //小程序 APPID
'appSecret' => '7f8291af4e0795ee375f66487a721627', // 公众号 秘钥 'appSecret' => '7f8291af4e0795ee375f66487a721627', // 公众号 秘钥
...@@ -43,12 +43,16 @@ class RechangeController extends HomebaseController ...@@ -43,12 +43,16 @@ class RechangeController extends HomebaseController
public function wx() public function wx()
{ {
echo $this->getPay()->driver('wechat')->gateway('wap')->pay([ $data = [
'out_trade_no' => '128047_20200426175416265', // 订单号 'ulr' => $this->getPay()->driver('wechat')->gateway('wap')->pay([
'total_fee' => '1', // 订单金额,**单位:分** 'out_trade_no' => time(), // 订单号
'body' => '测试支付', // 订单描述 'total_fee' => '1', // 订单金额,**单位:分**
'body' => '测试支付', // 订单描述
// 'spbill_create_ip' => '', // 支付人的 IP // 'spbill_create_ip' => '', // 支付人的 IP
]); ])
];
echo json_encode(array("ret"=>200,'data'=>$data,'msg'=>''));
die; die;
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<body style="background: #FAFAFA;"> <body style="background: #FAFAFA;">
<div class="app" id="app" style="padding-top: 0;"> <div class="app" id="app" style="padding-top: 0;">
<div class="Recharge"> <div class="Recharge">
<div class="header"> <div class="header">
<div class="zhanghu">账户ID</div> <div class="zhanghu">账户ID</div>
<div class="inputBox"> <div class="inputBox">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</div> </div>
<div class="foot_right"> <div class="foot_right">
<img src="__PUBLIC__/appapi/pay/img/wx-icon.png" > <img src="__PUBLIC__/appapi/pay/img/wx-icon.png" >
<span>微信支付</span> <span @click="wx">微信支付</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -99,6 +99,35 @@ ...@@ -99,6 +99,35 @@
sel_money(index){ sel_money(index){
this.sel_num = index this.sel_num = index
}, },
wx() {
let _this = this;
$.ajax({
url:"/index.php?g=Appapi&m=rechange&a=wx",
dataType:"json",
data: {
},
type:"POST",
success:function(data){
console.log(data);
if(data.ret==200){
// let d = data.data;
// if (d.code > 0) {
// layer.msg(d.msg);
// } else {
// let info = d.info[0];
// sessionStorage.setItem("user_info",JSON.stringify(info));
// window.location.href = '/index.php?g=Appapi&m=Profit&a=index&uid='+info.id+'&token=' + info.token;
// }
}else{
layer.msg(data.msg);
}
},
error:function(e){
layer.msg(e.msg);
}
})
}
}, },
watch: { watch: {
//数据监测函数 //数据监测函数
......
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