<template>
    <view class="pay-result">
        <!-- 提示图标 -->
        <view class="tip-icon">
            <image class="icon" :src="staticUrl + 'icon-pay-success.png'"></image>
            <view class="tip">订单支付成功~~</view>
        </view>
        <!-- 支付金额 -->
        <view class="payAmount">
            <text class="label">支付金额：</text>
            <text class="price">￥{{ orderInfo.payableAmount | priceFormat }}</text>
        </view>
        <!-- 执行操作 -->
        <view class="control">
            <tui-button type="base" width="600rpx" height="90rpx" shape="circle" :size="28" @click="toBuy">
                继续购买
            </tui-button>
            <tui-button
                type="base"
                :plain="true"
                width="600rpx"
                height="90rpx"
                shape="circle"
                :size="28"
                @click="onSearch"
            >
                查看订单
            </tui-button>
            <view class="share"> <text class="btn-tip">分享后可获得优惠券领取资格</text> </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            orderInfo: {
                collageId: '0',
                orderId: '18897',
                orderMark: '#18897#',
                orderNo: 'H164783438949249',
                payTotalFee: '0',
                payableAmount: '0'
            }
        }
    },
    beforeDestroy() {
        uni.removeStorageSync('PAY_ORDER_INFO')
    },
    onLoad() {
        this.orderInfo = uni.getStorageSync('PAY_ORDER_INFO')
    },
    methods: {
        toBuy() {
            this.$router.switchTab('home')
        },
        onSearch() {
            this.$router.redirectTo('order/order-list')
        }
    }
}
</script>

<style lang="scss" scoped>
.pay-result {
    height: 100vh;
    .tip-icon {
        @extend .cm-flex-center;
        flex-direction: column;
        background-color: #fff;
        height: 340rpx;
        .icon {
            width: 210rpx;
            height: 210rpx;
        }
        .tip {
            margin-top: 24rpx;
            font-size: 28rpx;
            font-weight: bold;
            color: #666;
        }
    }

    .payAmount {
        @extend .cm-flex-between;
        height: 90rpx;
        padding: 0 24rpx;
        margin-top: 24rpx;
        background-color: #fff;
        font-size: 28rpx;
        .label {
            color: #333333;
        }

        .price {
            color: #666666;
        }
    }

    .control {
        @extend .cm-flex-between;
        flex-direction: column;
        height: 280rpx;
        margin-top: 150rpx;

        .share {
            color: #ff457b;
            .btn-tip {
                font-size: 24rpx;
            }
        }
    }
}
</style>
