|
|
@@ -0,0 +1,264 @@
|
|
|
+<template>
|
|
|
+ <div class="domain_submit">
|
|
|
+ <div class="domain_submit_top">
|
|
|
+ <img
|
|
|
+ :src="require('@assets/icon_fanhui@3x (1).png')"
|
|
|
+ alt=""
|
|
|
+ class="domain_submit_top_img"
|
|
|
+ @click="$router.go(-1)"
|
|
|
+ />
|
|
|
+ <div>购买域名</div>
|
|
|
+ </div>
|
|
|
+ <div class="domain_submit_name">{{ domain }}</div>
|
|
|
+ <div class="domain_submit_price">
|
|
|
+ <div class="domain_submit_price_one">实际支付:</div>
|
|
|
+ <div class="domain_submit_price_two">
|
|
|
+ <img :src="require('@assets/icon_jiage@3x.png')" alt="" class="domain_submit_price_two_img" />
|
|
|
+ <div>{{ price }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="domain_submit_mode">
|
|
|
+ <div
|
|
|
+ class="domain_submit_mode_con"
|
|
|
+ @click="payType = item.type"
|
|
|
+ v-for="(item, index) in payInfos"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <div class="domain_submit_mode_con_left">
|
|
|
+ <van-image
|
|
|
+ :src="item.icon"
|
|
|
+ width="24px"
|
|
|
+ height="24px"
|
|
|
+ fit="cover"
|
|
|
+ class="domain_submit_mode_con_left_img"
|
|
|
+ />
|
|
|
+ <div class="domain_submit_mode_con_left_title">{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ class="domain_submit_mode_con_right_img"
|
|
|
+ :src="payType === item.type ? icons[0] : icons[1]"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="domain_submit_btn">
|
|
|
+ <div class="domain_submit_btn_con" @click="showPwdDialog = true">确认支付</div>
|
|
|
+ </div>
|
|
|
+ <van-number-keyboard v-model="tradeCode" :show="showKeyboard" @blur="showKeyboard = false" />
|
|
|
+ <van-dialog
|
|
|
+ v-model:show="showPwdDialog"
|
|
|
+ title="请输入支付密码"
|
|
|
+ confirmButtonText="立即支付"
|
|
|
+ show-cancel-button
|
|
|
+ confirmButtonColor="#3ab200"
|
|
|
+ @cancel="(showPwdDialog = false), $toast.clear()"
|
|
|
+ @confirm="pay"
|
|
|
+ >
|
|
|
+ <div style="padding: 20px 0">
|
|
|
+ <van-password-input
|
|
|
+ :value="tradeCode"
|
|
|
+ :focused="showKeyboard"
|
|
|
+ @focus="showKeyboard = true"
|
|
|
+ gutter="4px"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </van-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { mapState } from 'vuex';
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ payType: 'BALANCE',
|
|
|
+ showPwdDialog: false,
|
|
|
+ showKeyboard: false,
|
|
|
+ tradeCode: '',
|
|
|
+ domain: '',
|
|
|
+ price: 40,
|
|
|
+ payInfos: [
|
|
|
+ {
|
|
|
+ icon: require('@assets/icon-balance@3x.png'),
|
|
|
+ name: '余额',
|
|
|
+ type: 'BALANCE'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // icon: require('@assets/bianzu@3x.png'),
|
|
|
+ // name: '支付宝',
|
|
|
+ // type: 'ALIPAY'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // icon: require('@assets/icon-shouxinyi@3x.png'),
|
|
|
+ // name: '首信快捷支付',
|
|
|
+ // type: 'QUICK'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // icon: require('@assets/icon-yinlian@3x.png'),
|
|
|
+ // name: '银联',
|
|
|
+ // type: 'H5PAY'
|
|
|
+ // }
|
|
|
+ ],
|
|
|
+ icons: [require('@assets/icon_gouxuan_preone@3x.png'), require('@assets/icon_gouxuan_huise@3x.png')]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['userInfo'])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.domain = this.$route.query.domain;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ pay() {
|
|
|
+ this.$http
|
|
|
+ .post('/domainOrder/create', {
|
|
|
+ userId: this.userInfo.id,
|
|
|
+ domain: this.domain,
|
|
|
+ price: this.price
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (this.tradeCode == "") {
|
|
|
+ this.showPwdDialog = true;
|
|
|
+ this.$toast('请输入交易密码');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$http
|
|
|
+ .post('/payOrder/v2/domain/balance', {
|
|
|
+ id: res.id,
|
|
|
+ tradeCode: this.tradeCode
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$toast.success('支付成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.replace('/home');
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.tradeCode = '';
|
|
|
+ this.$toast(e.error || '支付失败');
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$toast(e.error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.domain_submit {
|
|
|
+ padding-top: var(--safe-top);
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ background: #030001;
|
|
|
+ position: relative;
|
|
|
+ .domain_submit_top {
|
|
|
+ position: relative;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 24px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-bottom: 46px;
|
|
|
+ }
|
|
|
+ .domain_submit_top_img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ position: absolute;
|
|
|
+ top: 24px;
|
|
|
+ left: 20px;
|
|
|
+ }
|
|
|
+ .domain_submit_name {
|
|
|
+ font-size: 24px;
|
|
|
+ text-align: center;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ margin-bottom: 50px;
|
|
|
+ }
|
|
|
+ .domain_submit_price {
|
|
|
+ width: 100%;
|
|
|
+ height: 48px;
|
|
|
+ padding: 0px 16px;
|
|
|
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .domain_submit_price_one {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #4f4d4d;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ .domain_submit_price_two {
|
|
|
+ display: flex;
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: normal;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ .domain_submit_price_two_img {
|
|
|
+ width: 11px;
|
|
|
+ height: 11px;
|
|
|
+ padding-top: 12px;
|
|
|
+ margin-right: 2px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .domain_submit_mode {
|
|
|
+ width: 100%;
|
|
|
+ padding: 0px 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ margin-top: 11px;
|
|
|
+ .domain_submit_mode_con {
|
|
|
+ width: 100%;
|
|
|
+ height: 48px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ .domain_submit_mode_con_left {
|
|
|
+ display: flex;
|
|
|
+ .domain_submit_mode_con_left_img {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ .domain_submit_mode_con_left_title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .domain_submit_mode_con_right_img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .domain_submit_btn {
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ bottom: 43px;
|
|
|
+ padding: 0px 48px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .domain_submit_btn_con {
|
|
|
+ width: 100%;
|
|
|
+ height: 38px;
|
|
|
+ border-radius: 30px;
|
|
|
+ background: #db14e2;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 38px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .van-number-keyboard {
|
|
|
+ z-index: 9999;
|
|
|
+ }
|
|
|
+ :deep(.van-password-input__item) {
|
|
|
+ background: @bg3;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|