Compare commits
2 Commits
409d5f0ab8
...
b4dfe55e97
Author | SHA1 | Date | |
---|---|---|---|
b4dfe55e97 | |||
d329ab031f |
@ -89,7 +89,7 @@ export const checkPhoneFdd = () => {
|
|||||||
//获取openid
|
//获取openid
|
||||||
export const getOpenId = (data) => {
|
export const getOpenId = (data) => {
|
||||||
return http.request({
|
return http.request({
|
||||||
url: "/api/wxuser/openid",
|
url: "/api/wxuser/get/openid",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
@ -751,16 +751,6 @@ export default {
|
|||||||
fileListLen++
|
fileListLen++
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
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 signContract() {
|
async signContract() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const data1 = {
|
const data1 = {
|
||||||
@ -770,25 +760,40 @@ export default {
|
|||||||
'/api/v2/warehouse/create',
|
'/api/v2/warehouse/create',
|
||||||
data1
|
data1
|
||||||
)
|
)
|
||||||
await this.getOpenId()
|
if (res1.code === 200) {
|
||||||
if (res1.code === 200 && this.status === 0) {
|
uni.login({
|
||||||
const res2 = await postDataByParams('/api/v2/warehouse/paid', {
|
provider: 'weixin',
|
||||||
ID: res1.data.ID
|
success: async ({ code }) => {
|
||||||
})
|
const res3 = await this.$api.login.getOpenId({ code })
|
||||||
if (res2.code === 200) {
|
if (res3.code === 200) {
|
||||||
uni.requestPayment({
|
const res2 = await postDataByParams(
|
||||||
...res2.data,
|
'/api/v2/warehouse/paid',
|
||||||
fail: (res) => {
|
{
|
||||||
this.loading = false
|
ID: res1.data.ID
|
||||||
},
|
}
|
||||||
success: () => {
|
)
|
||||||
this.loading = false
|
if (res2.code === 200) {
|
||||||
uni.navigateTo({
|
uni.requestPayment({
|
||||||
url: `/pages/paySuccess/paySuccess?ID=${res1.data.ID}`
|
...res2.data,
|
||||||
})
|
fail: (res) => {
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
|
success: () => {
|
||||||
|
this.loading = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/paySuccess/paySuccess?ID=${res1.data.ID}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.loading = false
|
||||||
|
this.$common.msgToast(res2.msg)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$common.msgToast(res3.msg)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async obtainAmount() {
|
async obtainAmount() {
|
||||||
|
@ -255,43 +255,42 @@ export default {
|
|||||||
this.messageText = `确认补款吗`
|
this.messageText = `确认补款吗`
|
||||||
this.$refs.alertDialog.open()
|
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() {
|
async supplementaryPayment() {
|
||||||
const data = {
|
const data = {
|
||||||
ID: this.item.ID
|
ID: this.item.ID
|
||||||
}
|
}
|
||||||
const res = await postDataByParams(
|
uni.login({
|
||||||
'/api/warehouse/supply/paid',
|
provider: 'weixin',
|
||||||
data
|
success: async ({ code }) => {
|
||||||
)
|
const res3 = await this.$api.login.getOpenId({ code })
|
||||||
await this.getOpenId()
|
if (res3.code === 200) {
|
||||||
if (res.code === 200 && this.status === 0) {
|
const res = await postDataByParams(
|
||||||
uni.requestPayment({
|
'/api/warehouse/supply/paid',
|
||||||
...res.data,
|
data
|
||||||
fail: (res) => {},
|
)
|
||||||
success: () => {
|
if (res.code === 200) {
|
||||||
this.getData()
|
uni.requestPayment({
|
||||||
uni.showToast({
|
...res.data,
|
||||||
title: '补款成功',
|
fail: (res) => {},
|
||||||
icon: 'none'
|
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) {
|
async getDistanceFromTopToPageBottom(classValue) {
|
||||||
const { windowHeight, windowWidth } = await uni.getSystemInfo()
|
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
Loading…
Reference in New Issue
Block a user