|
|
@@ -0,0 +1,278 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <van-action-sheet v-model:show="show" :closeable="false" class="recharge-dialog">
|
|
|
+ <div class="title">
|
|
|
+ <div class="text">支付信息</div>
|
|
|
+ <div class="close" @click="show = false">
|
|
|
+ <img src="@assets/icon_dialog_close.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="amount">
|
|
|
+ <div class="text">铸造费(元)</div>
|
|
|
+ <div class="num">29.90</div>
|
|
|
+ </div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="title-methods">支付方式</div>
|
|
|
+ <div style="padding: 0 16px">
|
|
|
+ <pay-method-pick v-model="payMethod"></pay-method-pick>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="btn-wrapper">
|
|
|
+ <van-button type="primary" :color="$colors.prim" round block class="btn-recharge" @click="pay">
|
|
|
+ 立即支付
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ </van-action-sheet>
|
|
|
+ <pay-balance v-model:tradeCode="tradeCode" ref="payBalance" @pay="pay"></pay-balance>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import PayMethodPick from '../PayMethodPick.vue';
|
|
|
+import PayBalance from '../PayBalance.vue';
|
|
|
+import resolveUrl from 'resolve-url';
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ orderId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ show: false,
|
|
|
+ payMethod: '',
|
|
|
+ tradeCode: ''
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ PayMethodPick,
|
|
|
+ PayBalance
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ pay() {
|
|
|
+ if (!this.tradeCode) {
|
|
|
+ this.$refs.payBalance.show();
|
|
|
+ } else {
|
|
|
+ this.tradeCode = '';
|
|
|
+ }
|
|
|
+ console.log(this.tradeCode);
|
|
|
+ console.log(this.payMethod);
|
|
|
+ // switch (this.payMethod) {
|
|
|
+ // case 'ALIPAY':
|
|
|
+ // this.$toast.loading('支付中');
|
|
|
+ // this.$http
|
|
|
+ // .post('/payOrder/v2/recharge', { id: this.orderId })
|
|
|
+ // .then(res => {
|
|
|
+ // this.openScheme(res);
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // }, 1000);
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // this.$toast(e.error || '支付失败');
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'BALANCE':
|
|
|
+ // if (!this.tradeCode) {
|
|
|
+ // this.$refs.payBalance.show();
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // this.$toast.loading('支付中');
|
|
|
+ // this.$http
|
|
|
+ // .post('/payOrder/v2/balance', { id: this.orderId, tradeCode: this.tradeCode })
|
|
|
+ // .then(res => {
|
|
|
+ // this.$toast.success('支付成功');
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$router.replace('/orderDetail?id=' + this.orderId);
|
|
|
+ // }, 1000);
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // this.tradeCode = '';
|
|
|
+ // this.$toast(e.error || '支付失败');
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'UNION':
|
|
|
+ // window.open(
|
|
|
+ // resolveUrl(this.$baseUrl, `/payOrder/v2/recharge/sandQuick?id=${this.orderId}`)
|
|
|
+ // .replace('www.raex.vip', 'jump.raex.vip')
|
|
|
+ // .replace('test.raex.vip', 'jumptest.raex.vip'),
|
|
|
+ // '_blank'
|
|
|
+ // );
|
|
|
+ // break;
|
|
|
+ // case 'QUICK_BIND':
|
|
|
+ // this.$toast.loading('支付中');
|
|
|
+ // this.$http
|
|
|
+ // .get('/payOrder/v2/recharge/sandQuickBind', {
|
|
|
+ // id: this.orderId
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // this.openScheme(res);
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // this.$toast(e.error || '支付失败');
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'ALI':
|
|
|
+ // this.$toast.loading('支付中');
|
|
|
+ // this.$http
|
|
|
+ // .post('/payOrder/v2/recharge/ali', { id: this.orderId })
|
|
|
+ // .then(res => {
|
|
|
+ // this.openScheme(res);
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // }, 1000);
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // this.$toast(e.error || '支付失败');
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'SYXPAY':
|
|
|
+ // this.$router.push({
|
|
|
+ // name: 'bankPay',
|
|
|
+ // query: {
|
|
|
+ // id: this.orderId,
|
|
|
+ // type: 'star'
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.recharge-dialog {
|
|
|
+ overflow: auto;
|
|
|
+ .content {
|
|
|
+ flex-basis: calc(80vh - 150px);
|
|
|
+ flex-grow: 1;
|
|
|
+ overflow: auto;
|
|
|
+ //height: calc(100vh - 300px);
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ height: 50px;
|
|
|
+ position: relative;
|
|
|
+ &::after {
|
|
|
+ .setBottomLine();
|
|
|
+ }
|
|
|
+ .flex();
|
|
|
+ .text {
|
|
|
+ margin-left: 16px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: black;
|
|
|
+ font-weight: bold;
|
|
|
+ flex-grow: 1;
|
|
|
+ }
|
|
|
+ .close {
|
|
|
+ padding: 10px 16px;
|
|
|
+ img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .amount {
|
|
|
+ background: #f5f7fa;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin: 16px;
|
|
|
+ .flex-col();
|
|
|
+ align-items: center;
|
|
|
+ padding: 18px 0;
|
|
|
+ .text {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #939599;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .num {
|
|
|
+ margin-top: 7px;
|
|
|
+ font-size: 36px;
|
|
|
+ font-family: OSP;
|
|
|
+ color: #000000;
|
|
|
+ line-height: 36px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .line {
|
|
|
+ background: @bg3;
|
|
|
+ height: 1px;
|
|
|
+ margin: 0 16px;
|
|
|
+ }
|
|
|
+ .title-methods {
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 24px;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-left: 16px;
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-right: 16px;
|
|
|
+ .bank-name {
|
|
|
+ font-size: 14px;
|
|
|
+ color: @text3;
|
|
|
+ font-weight: normal;
|
|
|
+ float: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .btn-wrapper {
|
|
|
+ height: 56px;
|
|
|
+ min-height: 56px;
|
|
|
+ .flex();
|
|
|
+ padding-bottom: env(safe-area-inset-bottom);
|
|
|
+ position: relative;
|
|
|
+ &::after {
|
|
|
+ .setTopLine();
|
|
|
+ }
|
|
|
+ .btn-recharge {
|
|
|
+ // flex-grow: 1;
|
|
|
+ // height: 38px;
|
|
|
+ // border-radius: 19px;
|
|
|
+ // background: #373a60;
|
|
|
+ // font-size: 16px;
|
|
|
+ // color: white;
|
|
|
+ // font-weight: bold;
|
|
|
+ // .flex();
|
|
|
+ // justify-content: center;
|
|
|
+ margin: 0 48px;
|
|
|
+ ::v-deep(.van-button__content) {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .iap-row {
|
|
|
+ .flex();
|
|
|
+ padding: 0 15px;
|
|
|
+ margin-top: 15px;
|
|
|
+ .iap-item {
|
|
|
+ flex-basis: 0;
|
|
|
+ flex-grow: 1;
|
|
|
+ height: 50px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: @bg3;
|
|
|
+ color: @text1;
|
|
|
+ .flex-col();
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-left: 15px;
|
|
|
+ .name {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .price {
|
|
|
+ margin-top: 2px;
|
|
|
+ font-size: 13px;
|
|
|
+ color: @text3;
|
|
|
+ }
|
|
|
+ &:first-child {
|
|
|
+ margin-left: 0;
|
|
|
+ }
|
|
|
+ &.active {
|
|
|
+ background: @prim;
|
|
|
+ color: white;
|
|
|
+ .price {
|
|
|
+ color: rgba(255, 255, 255, 0.5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|