Commit 30942293 by 赵雅纹

微信支付

parent 57faab14
......@@ -37,5 +37,6 @@
"wx358b56af62edbde1",
"wxc3b64b09b1d3dfc2",
"wx857ea77f4f7f4f34"
]
],
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
<view class='coupon-info'>
<view class='coupon-time fs-24'>{{item.point}}积分</view>
<view class='coupon-name fs-28'>{{item.title}}</view>
<view class='coupon-name fs-24'>{{item.couponTimeDesc}}</view>
<view class='coupon-desc fs-24'>查看详情 >>></view>
</view>
<view class='coupon-code fs-24' data-id="{{item.id}}" data-point="{{item.point}}" catchtap='exchange'>立即兑换</view>
......
......@@ -62,6 +62,9 @@
.coupon-name{
color:#333;
}
.fons{
font-size: 24rpx;
}
.coupon-time{
color:#fc921e;
margin-bottom: 18rpx;
......
......@@ -51,6 +51,40 @@ wxService.page({
// }
},
//微信支付
onTapWxPay(){
//调用接口回调拼接数据 TODO
this.getPayCodeParam();
},
//获取小程序支付码配置参数
getPayCodeParam(){
wxService.get(`/platform/brand/openOfflinePayView`).then(res => {
if (!res) return false;
const { result, data } = res && res.data || res && res.result
if (result == 0) {
wx.openOfflinePayView({
appId: data.appId,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
timeStamp: data.timeStamp,
paySign: data.paySign,
success: function (res) {
console.log('success', res)
},
fail: function (res) {
console.log('error', res)
},
complete: function (res) {
console.log('complete', res)
}
})
// this.setInternal();
}
})
},
/**
* 生命周期函数--监听页面显示
......
......@@ -17,7 +17,13 @@
</view>
<view class='user-qr-code'>
<canvas canvas-id="barcode" binderror="canvasIdErrorCallback" />
<view class='wx-pay-code' bindtap="onTapWxPay">微信支付</view>
</view>
</view>
<view class="form-info">
......
......@@ -59,7 +59,7 @@ page{
background-color: #ffffff;
border-radius: 7rpx;
display: flex;
height: 200rpx;
height: 300rpx;
flex-direction: column;
justify-content: center;
align-items: center;
......@@ -124,4 +124,20 @@ textarea {
margin-bottom: 20rpx;
font-size: 14px;
box-sizing: border-box;
}
.wx-pay-code{
padding-left: 0;
width: 100%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
box-sizing: border-box;
margin-top: 40rpx;
color: rgb(2, 186, 112);
}
.wx-pay-code:active{
opacity: 0.7;
}
\ No newline at end of file
......@@ -19,6 +19,8 @@
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
......
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ 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