提交 3eb772ec authored 作者: lihuihui's avatar lihuihui

修改支付

上级 f4373c31
......@@ -39,10 +39,10 @@ export function uploadPay(id, data) {
/**
* 生成订单
*/
export function genOrder(data) {
export function genOrder(data, id) {
return httpRequest({
url: '/api/pay/v1/wechat/order/pre',
method: 'post',
url: `/api/pay/v1/wechat/unified-order/alumni/${id}`,
method: 'get',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
......
......@@ -3,6 +3,7 @@
</template>
<script>
// import { isDayjs } from 'dayjs'
import * as api from '../api.js'
export default {
......@@ -14,7 +15,8 @@ export default {
return {
clearTime: null,
openId: '',
order: { options: {} }
order: { options: {} },
oId: ''
}
},
computed: {
......@@ -41,11 +43,11 @@ export default {
// 生成订单
genOrder() {
const params = {
product_id: this.productId,
open_id: this.openId,
type: 'alumni-h5'
type: 7,
notify_url: process.env.NODE_ENV !== 'development' ? `https://alumni-frontend.ezijing.com/${this.oId}` : `http://docker-alumni-api.ezijing.com/${this.oId}`
}
api.genOrder(params).then(response => {
api.genOrder(params, this.productId).then(response => {
this.order = response.data
clearInterval(this.clearTime)
this.clearTime = setInterval(() => {
......@@ -110,7 +112,9 @@ export default {
// }
// })
},
pay() {
pay(id) {
this.oId = id
console.log(this.oId)
this.getOpenId()
}
}
......
......@@ -23,7 +23,7 @@
</template>
<template v-if="item.approve_status == 1">
<div class="btn" @click="goLook(item.id)">查看</div>
<div class="btn" v-if="item.pay == 0" @click="orderPays">支付</div>
<div class="btn" v-if="item.pay == 0" @click="orderPays(item.id)">支付</div>
</template>
</div>
<div class="icon-yes" v-if="item.approve_status == 1"></div>
......@@ -106,8 +106,8 @@ export default {
}
},
methods: {
orderPays() {
this.$refs.h5pay.pay()
orderPays(id) {
this.$refs.h5pay.pay(id)
},
goLook(id) {
this.$router.push({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论