|
@@ -163,7 +163,7 @@ export default {
|
|
|
// 获取套餐 服务配置列表
|
|
|
fetchConfigureList() {
|
|
|
fetchConfigureList()
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.packageList = res.data.packageList
|
|
|
this.serviceList = res.data.serviceList
|
|
|
// 设置初始值
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
},
|
|
|
// 设置订单信息(这个假订单)
|
|
|
setOrderInfo() {
|
|
|
- const findOne = this.packageList.find(item => item.id === this.checkedPackage)
|
|
|
+ const findOne = this.packageList.find((item) => item.id === this.checkedPackage)
|
|
|
if (findOne) {
|
|
|
this.orderInfo.payAmount = findOne.price
|
|
|
this.orderInfo.vipId = findOne.id
|
|
@@ -202,13 +202,13 @@ export default {
|
|
|
authUserId: this.$store.getters.authUserId,
|
|
|
packageId: this.checkedPackage,
|
|
|
services: this.checkedServiceList.join(',')
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
this.orderInfo.vipRecordId = res.data
|
|
|
})
|
|
|
},
|
|
|
// 在线支付开关检测
|
|
|
payOnlineChecked() {
|
|
|
- payOnlineChecked().then(res => {
|
|
|
+ payOnlineChecked().then((res) => {
|
|
|
if (res.data === '1') {
|
|
|
this.paySwitch = true
|
|
|
} else {
|
|
@@ -223,25 +223,25 @@ export default {
|
|
|
}
|
|
|
this.payType = e.type
|
|
|
if (e.type === 'WEIXIN') {
|
|
|
- this.checkedWinxinPaySuccess({ vipRecordId: e.data.vipRecordId })
|
|
|
+ this.checkedWinxinPaySuccess({ vipRecordId: e.data.vipRecordId, orderFlag: 0 })
|
|
|
} else {
|
|
|
- this.checkedOtherPaySuccess({ mbOrderId: e.data.mbOrderId })
|
|
|
+ this.checkedOtherPaySuccess({ mbOrderId: e.data.mbOrderId, orderFlag: 0 })
|
|
|
}
|
|
|
},
|
|
|
// 查询是否成功(微信支付专用)
|
|
|
checkedWinxinPaySuccess(params) {
|
|
|
- checkedWinxinPaySuccess(params).then(res => {
|
|
|
- this.handlePayResult(res)
|
|
|
+ checkedWinxinPaySuccess(params).then((res) => {
|
|
|
+ this.handleWixinPayResult(res)
|
|
|
})
|
|
|
},
|
|
|
// 查询支付是否成功 (支付宝 银联)
|
|
|
checkedOtherPaySuccess(params) {
|
|
|
- checkedOtherPaySuccess(params).then(res => {
|
|
|
+ checkedOtherPaySuccess(params).then((res) => {
|
|
|
this.handlePayResult(res)
|
|
|
})
|
|
|
},
|
|
|
- // 处理支付查询结果
|
|
|
- handlePayResult(result) {
|
|
|
+ // 处理微信支付查询结果
|
|
|
+ handleWixinPayResult(result) {
|
|
|
result = JSON.parse(result.data)
|
|
|
if (result.data.status === '1') {
|
|
|
this.$store.dispatch('user/fetchUserVipInfo')
|
|
@@ -258,6 +258,30 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 处理网银支付宝支付查询结果
|
|
|
+ handlePayResult(result) {
|
|
|
+ result = JSON.parse(result.data)
|
|
|
+ console.log(result)
|
|
|
+ if (result.rt7_orderStatus === 'SUCCESS') {
|
|
|
+ this.$store.dispatch('user/fetchUserVipInfo')
|
|
|
+ this.$router.push({
|
|
|
+ path: '/pay/success',
|
|
|
+ query: this.redirectUrlQuery
|
|
|
+ })
|
|
|
+ } else if (result.rt7_orderStatus === 'DOING') {
|
|
|
+ this.diffScanOverTime(60 * 5, () => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/pay/faild',
|
|
|
+ query: this.redirectUrlQuery
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/pay/faild',
|
|
|
+ query: this.redirectUrlQuery
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 扫码支付开始
|
|
|
handleScanPayStart() {
|
|
|
const h = this.$createElement
|