| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <view style="padding: 30rpx;" >
- <view class="bd">
- <text class="font2">付款金额</text>
- <text class="font1">¥{{price}}</text>
- <view class="flex">
- <view class="flex_item">付款方式</view>
- <view>微信支付</view>
- </view>
- <button type="button" class="btn" @click="pay">立即支付</button>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- price:0.01
- }
- },
- onLoad(option) {
-
- },
- onShow(){
- },
- methods: {
- pay(){
- this.wxPayment({orderNo:"123"})
- },
- wxPayment(param){
- let self = this
- this.$api.wxPayment(param).then(res => {
- if (res.data.code == 200){
- let data = res.data.data
- uni.requestPayment({
- provider: data.provider,
- nonceStr: data.nonceStr,
- package: data.package,
- signType: data.signType,
- paySign: data.paySign,
- timeStamp: String(data.timeStamp),
- success: function (res) {
- console.log('success:' + JSON.stringify(res));
- },
- fail: function (err) {
- console.log('fail:' + JSON.stringify(err));
- }
- });
- }
- })
- },
- },
-
- }
- </script>
- <style scope>
-
- page {
- background: #f3f3f3;
- font-size: 28rpx;
- }
- .flex {
- display: flex;
- align-items: center;
- }
- .flex_item {
- flex: 1;
- }
- .container {
- padding: 30rpx;
- }
- .container .bd {
- background: #fff;
- border-radius: 10rpx;
- padding: 100rpx 30rpx 50rpx;
- }
- .container .bd .font1 {
- display: block;
- text-align: center;
- font-size: 88rpx;
- }
- .container .bd .font2 {
- display: block;
- text-align: center;
- font-size: 30rpx;
- margin: 30rpx 0 60rpx;
- color: #525252;
- }
- .container .bd .flex {
- border-bottom: 1px solid #eee;
- padding: 30rpx 0;
- margin-bottom: 30rpx;
- }
- .container .bd .btn {
- color: #fff;
- font-size: 28rpx;
- padding: 10rpx 0;
- background: #eb3b2f;
- }
- </style>
|