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

修改支付

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