|
|
@@ -104,39 +104,8 @@ export default {
|
|
|
this.$http.get('/asset/get/' + this.$route.query.id).then(res => {
|
|
|
this.info = res;
|
|
|
console.log(this.info);
|
|
|
- // setTimeout(() => {
|
|
|
- // this.$toast.clear();
|
|
|
- // this.bs.value.refresh();
|
|
|
- // }, 100);
|
|
|
- // this.$http('/sysConfig/get/gas_fee')
|
|
|
});
|
|
|
}
|
|
|
- // else {
|
|
|
- // this.$http.get('/order/get/' + this.$route.query.orderId).then(res => {
|
|
|
- // this.info = res;
|
|
|
- // this.orderId = res.id;
|
|
|
- // setTimeout(() => {
|
|
|
- // this.bs.value.refresh();
|
|
|
- // }, 100);
|
|
|
- // this.$dialog
|
|
|
- // .alert({
|
|
|
- // title: '提示',
|
|
|
- // message:
|
|
|
- // res.status === 'NOT_PAID' || res.status === 'CANCELLED'
|
|
|
- // ? '订单支付失败,点击重新下单'
|
|
|
- // : '订单已支付,点击查看订单详情'
|
|
|
- // })
|
|
|
- // .then(() => {
|
|
|
- // if (res.status === 'NOT_PAID' || res.status === 'CANCELLED') {
|
|
|
- // this.$router.back();
|
|
|
- // } else {
|
|
|
- // this.$router.replace('/orderDetail?id' + res.id);
|
|
|
- // }
|
|
|
- // // on close
|
|
|
- // });
|
|
|
- // });
|
|
|
- // }
|
|
|
- // this.bottom = this.$refs.bottom;
|
|
|
},
|
|
|
methods: {
|
|
|
submit() {
|
|
|
@@ -151,49 +120,48 @@ export default {
|
|
|
toUserId: this.$route.query.toUserId
|
|
|
})
|
|
|
.then(res => {
|
|
|
- console.log(res);
|
|
|
- // this.$nextTick(() => {
|
|
|
- // if (this.payType === 'ALIPAY') {
|
|
|
- // document.location.replace(
|
|
|
- // path.resolve(this.$baseUrl, 'payOrder/gift/alipay?id=' + res.id)
|
|
|
- // );
|
|
|
- // } else if (this.payType === 'WEIXIN') {
|
|
|
- // if (this.inWeixin) {
|
|
|
- // this.$toast.loading('加载中');
|
|
|
- // this.$http
|
|
|
- // .post('/payOrder/gift/weixin', {
|
|
|
- // id: res.id,
|
|
|
- // openId: localStorage.getItem('openId')
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // console.log({
|
|
|
- // ...res,
|
|
|
- // package: res.package || res.packageValue
|
|
|
- // });
|
|
|
- // let _this = this;
|
|
|
- // wx.chooseWXPay({
|
|
|
- // ...res,
|
|
|
- // package: res.package || res.packageValue,
|
|
|
- // timestamp: res.timeStamp,
|
|
|
- // success(res) {
|
|
|
- // _this.$toast.success('支付成功');
|
|
|
- // // setTimeout(() => {
|
|
|
- // // _this.$router.replace('/orders');
|
|
|
- // // }, 1000);
|
|
|
- // },
|
|
|
- // fail(e) {
|
|
|
- // console.log(e);
|
|
|
- // _this.$toast('支付失败,请稍后再试');
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // document.location.replace(
|
|
|
- // path.resolve(this.$baseUrl, 'payOrder/gift/weixin_h5?id=' + res.id)
|
|
|
- // );
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.payType === 'ALIPAY') {
|
|
|
+ document.location.replace(
|
|
|
+ path.resolve(this.$baseUrl, 'payOrder/gift/alipay?id=' + res.id)
|
|
|
+ );
|
|
|
+ } else if (this.payType === 'WEIXIN') {
|
|
|
+ if (this.inWeixin) {
|
|
|
+ this.$toast.loading('加载中');
|
|
|
+ this.$http
|
|
|
+ .post('/payOrder/gift/weixin', {
|
|
|
+ id: res.id,
|
|
|
+ openId: localStorage.getItem('openId')
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log({
|
|
|
+ ...res,
|
|
|
+ package: res.package || res.packageValue
|
|
|
+ });
|
|
|
+ let _this = this;
|
|
|
+ wx.chooseWXPay({
|
|
|
+ ...res,
|
|
|
+ package: res.package || res.packageValue,
|
|
|
+ timestamp: res.timeStamp,
|
|
|
+ success(res) {
|
|
|
+ _this.$toast.success('支付成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.$router.replace('/orders');
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ fail(e) {
|
|
|
+ console.log(e);
|
|
|
+ _this.$toast('支付失败,请稍后再试');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ document.location.replace(
|
|
|
+ path.resolve(this.$baseUrl, 'payOrder/gift/weixin_h5?id=' + res.id)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
.catch(e => {
|
|
|
if (e) {
|
|
|
@@ -206,56 +174,6 @@ export default {
|
|
|
this.$toast('失败点击忘记密码进行修改');
|
|
|
}
|
|
|
});
|
|
|
- // this.$toast.loading('加载中');
|
|
|
- // this.$http
|
|
|
- // .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
|
|
|
- // .then(res => {
|
|
|
- // this.$toast.clear();
|
|
|
- // this.orderId = res.id;
|
|
|
- // this.$router.replace('/submit?orderId=' + res.id);
|
|
|
- // this.$nextTick(() => {
|
|
|
- // if (this.payType === 'ALIPAY') {
|
|
|
- // document.location.replace(path.resolve(this.$baseUrl, 'payOrder/alipay?id=' + res.id));
|
|
|
- // } else if (this.payType === 'WEIXIN') {
|
|
|
- // if (this.inWeixin) {
|
|
|
- // this.$toast.loading('加载中');
|
|
|
- // this.$http
|
|
|
- // .post('/payOrder/weixin', { id: res.id, openId: localStorage.getItem('openId') })
|
|
|
- // .then(res => {
|
|
|
- // console.log({
|
|
|
- // ...res,
|
|
|
- // package: res.package || res.packageValue
|
|
|
- // });
|
|
|
- // let _this = this;
|
|
|
- // wx.chooseWXPay({
|
|
|
- // ...res,
|
|
|
- // package: res.package || res.packageValue,
|
|
|
- // timestamp: res.timeStamp,
|
|
|
- // success(res) {
|
|
|
- // _this.$toast.success('支付成功');
|
|
|
- // setTimeout(() => {
|
|
|
- // _this.$router.replace('/orders');
|
|
|
- // }, 1000);
|
|
|
- // },
|
|
|
- // fail(e) {
|
|
|
- // console.log(e);
|
|
|
- // _this.$toast('支付失败,请稍后再试');
|
|
|
- // }
|
|
|
- // });
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // document.location.replace(
|
|
|
- // path.resolve(this.$baseUrl, 'payOrder/weixin_h5?id=' + res.id)
|
|
|
- // );
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // })
|
|
|
- // .catch(e => {
|
|
|
- // if (e) {
|
|
|
- // this.$toast(e.error);
|
|
|
- // }
|
|
|
- // });
|
|
|
}
|
|
|
}
|
|
|
};
|