| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="uni-main">
- <view class="uni-icon">
- <img src="../../static/index/icon/pay.png" alt="">
- </view>
- <view class="uni-info">
- <view class="uni-text uni-msg">
- 支付成功!
- </view>
- <view class="uni-text">
- 支付金额:{{orderInfo.pay_money}}
- </view>
- <view class="uni-text">
- 订单编号:{{orderInfo.out_trade_no}}
- </view>
- <view class="uni-btn" @click="payBack()">
- 完成
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- orderInfo: {
- out_trade_no: 'G20210715122544',
- pay_money: 0.02,
- status: 1,
- type: 1,
- source_id: 0,
- }
- }
- },
- onLoad(option) {
- let _uni = this
- console.log(option)
- },
- methods: {
- payBack() {
- switch (this.orderInfo.type) {
- case 1:
- location.href = '/pages/index/gongdeng/fodengInfo?id=' + this.orderInfo.source_id
- break;
- case 2:
- location.href = '/pages/pay/recharge'
- break;
- default:
- location.href = '/pages/index/index'
- break;
- }
- },
- getInfo(order_sn) {
- let _uni = this
- uni.showLoading()
- this.$request.api('/api/order/info', {
- order_sn: order_sn
- }).then(res => {
- uni.hideLoading()
- if (res.success == true) {
- _uni.orderInfo = res.data
- }else{
- uni.showToast({
- title: '获取订单信息错误,将返回主页',
- icon: 'none'
- })
- setTimeout(function(){
- location.href = '/pages/index/index'
- }, 1200)
- }
- }).catch(err => {
- uni.showToast({
- title: typeof(err.msg) != 'undefined' ? err.msg : '服务器错误',
- icon: 'none'
- })
- })
- },
- },
- }
- </script>
- <style>
- .uni-main {
- text-align: center;
- }
- .uni-info {
- margin: 0 auto;
- }
- .uni-icon {
- margin-top: 100rpx;
- }
- .uni-text {
- margin-bottom: 10rpx;
-
- }
- .uni-btn {
- width: 30%;
- margin: 30rpx auto;
- background-color: #18B566;
- color: #fff;
- padding: 8rpx 10rpx;
- border-radius: 8rpx;
- }
- </style>
|