fix:修复支付问题

This commit is contained in:
hanlin 2024-12-11 11:27:39 +08:00
parent d329ab031f
commit b4dfe55e97
9 changed files with 42 additions and 41 deletions

View File

@ -89,7 +89,7 @@ export const checkPhoneFdd = () => {
//获取openid
export const getOpenId = (data) => {
return http.request({
url: "/api/wxuser/openid",
url: "/api/wxuser/get/openid",
method: "POST",
data,
});

View File

@ -764,9 +764,8 @@ export default {
uni.login({
provider: 'weixin',
success: async ({ code }) => {
console.log('code', code)
const res3 = await this.$api.login.getOpenId({ code })
if (res3.status === 0) {
if (res3.code === 200) {
const res2 = await postDataByParams(
'/api/v2/warehouse/paid',
{
@ -786,6 +785,9 @@ export default {
})
}
})
} else {
this.loading = false
this.$common.msgToast(res2.msg)
}
} else {
this.$common.msgToast(res3.msg)

View File

@ -255,43 +255,42 @@ export default {
this.messageText = `确认补款吗`
this.$refs.alertDialog.open()
},
async getOpenId() {
uni.login({
provider: 'weixin',
success: async ({ code }) => {
const res = await this.$api.login.getOpenId({ code })
this.status = res.data.status
if (res.data.status !== 0) this.$common.msgToast(res.msg)
}
})
},
async supplementaryPayment() {
const data = {
ID: this.item.ID
}
const res = await postDataByParams(
'/api/warehouse/supply/paid',
data
)
await this.getOpenId()
if (res.code === 200 && this.status === 0) {
uni.requestPayment({
...res.data,
fail: (res) => {},
success: () => {
this.getData()
uni.showToast({
title: '补款成功',
icon: 'none'
})
uni.login({
provider: 'weixin',
success: async ({ code }) => {
const res3 = await this.$api.login.getOpenId({ code })
if (res3.code === 200) {
const res = await postDataByParams(
'/api/warehouse/supply/paid',
data
)
if (res.code === 200) {
uni.requestPayment({
...res.data,
fail: (res) => {},
success: () => {
this.getData()
uni.showToast({
title: '补款成功',
icon: 'none'
})
}
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
} else {
this.$common.msgToast(res3.msg)
}
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
}
})
},
async getDistanceFromTopToPageBottom(classValue) {
const { windowHeight, windowWidth } = await uni.getSystemInfo()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long