|
|
@@ -76,12 +76,14 @@ export default {
|
|
|
tradeCode: '',
|
|
|
domain: '',
|
|
|
price: 40,
|
|
|
+ payName: "",
|
|
|
+ id: '',
|
|
|
payInfos: [
|
|
|
{
|
|
|
icon: require('@assets/icon-balance@3x.png'),
|
|
|
name: '余额',
|
|
|
type: 'BALANCE'
|
|
|
- },
|
|
|
+ }
|
|
|
// {
|
|
|
// icon: require('@assets/bianzu@3x.png'),
|
|
|
// name: '支付宝',
|
|
|
@@ -106,40 +108,66 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.domain = this.$route.query.domain;
|
|
|
+ this.payName = this.$route.query.pay;
|
|
|
+ this.id = this.$route.query.id;
|
|
|
},
|
|
|
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);
|
|
|
- });
|
|
|
+ console.log("thsksk",this.payName)
|
|
|
+ if (this.payName == '1') {
|
|
|
+ if (this.tradeCode == '') {
|
|
|
+ this.showPwdDialog = true;
|
|
|
+ this.$toast('请输入交易密码');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$http
|
|
|
+ .post('/payOrder/v2/domain/balance', {
|
|
|
+ id: this.id,
|
|
|
+ tradeCode: this.tradeCode
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$toast.success('支付成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.replace('/home');
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.tradeCode = '';
|
|
|
+ this.$toast(e.error || '支付失败');
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ 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);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|