|
|
|
|
|
|
|
|
aliPayConfigIdTwo, |
|
|
aliPayConfigIdTwo, |
|
|
obtainUserId, |
|
|
obtainUserId, |
|
|
infoQuery, |
|
|
infoQuery, |
|
|
envs, etcQYAction |
|
|
|
|
|
|
|
|
envs, signTest |
|
|
} from "@/utils/network/api"; |
|
|
} from "@/utils/network/api"; |
|
|
const imgURL = `${fileURL}image/`; |
|
|
const imgURL = `${fileURL}image/`; |
|
|
|
|
|
|
|
|
|
|
|
import { getItem } from "@/utils/storage"; |
|
|
const state = reactive({ |
|
|
const state = reactive({ |
|
|
openid: "", |
|
|
openid: "", |
|
|
orderId: "", |
|
|
orderId: "", |
|
|
|
|
|
|
|
|
type: 2, |
|
|
type: 2, |
|
|
data: { |
|
|
data: { |
|
|
payConfigId: aliPayConfigIdTwo, |
|
|
payConfigId: aliPayConfigIdTwo, |
|
|
code: res.authCode |
|
|
|
|
|
|
|
|
code: res.authCode, |
|
|
|
|
|
mobile:getItem('mobile') |
|
|
}, |
|
|
}, |
|
|
method: "POST", |
|
|
method: "POST", |
|
|
showLoading: true, |
|
|
showLoading: true, |
|
|
|
|
|
|
|
|
console.log('支付宝用户编号请求:', optionsUser) |
|
|
console.log('支付宝用户编号请求:', optionsUser) |
|
|
|
|
|
|
|
|
request(obtainUserId, optionsUser).then((res) => { |
|
|
request(obtainUserId, optionsUser).then((res) => { |
|
|
console.log('支付宝用户编号返回:', res) |
|
|
|
|
|
const bizContent = stringToJson(res.bizContent); |
|
|
|
|
|
|
|
|
console.log('支付宝用户编号返回:', res,res.bizContent) |
|
|
|
|
|
// const bizContent = stringToJson(res.bizContent); |
|
|
var data = { |
|
|
var data = { |
|
|
orderId: state.orderId, |
|
|
|
|
|
subOpenId: bizContent.openId, |
|
|
|
|
|
|
|
|
outOrderId: state.orderId, |
|
|
|
|
|
// subOpenId: bizContent.openId, |
|
|
}; |
|
|
}; |
|
|
const options = { |
|
|
const options = { |
|
|
type: 2, |
|
|
type: 2, |
|
|
|
|
|
|
|
|
method: "POST", |
|
|
method: "POST", |
|
|
showLoading: true, |
|
|
showLoading: true, |
|
|
}; |
|
|
}; |
|
|
request(etcQYAction, options).then((res) => { |
|
|
|
|
|
|
|
|
request(signTest, options).then((res) => { |
|
|
console.log("res*******", res); |
|
|
console.log("res*******", res); |
|
|
const data = stringToJson(res.bizContent); |
|
|
const data = stringToJson(res.bizContent); |
|
|
console.log("data*******", data); |
|
|
console.log("data*******", data); |
|
|
if (data.signStatus === "WAIT_SIGN") { |
|
|
|
|
|
|
|
|
if (data.signStatusCode === "WAIT_SIGN") { |
|
|
//待签约 |
|
|
//待签约 |
|
|
my.ap.navigateToAlipayPage({ |
|
|
my.ap.navigateToAlipayPage({ |
|
|
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId=" + data.alipayOrderId |
|
|
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId=" + data.alipayOrderId |
|
|
}); |
|
|
}); |
|
|
} else if (data.signStatus === "SIGNED") { |
|
|
|
|
|
|
|
|
} else if (data.signStatusCode === "SIGNED" || data.signStatusCode === "ACTIVED") { |
|
|
//已签约 |
|
|
//已签约 |
|
|
// msg("已签约"); |
|
|
// msg("已签约"); |
|
|
confirm("您已完成签约,等待业务员审核发货", () => { |
|
|
confirm("您已完成签约,等待业务员审核发货", () => { |
|
|
|
|
|
|
|
|
url: "/pages/order/order" |
|
|
url: "/pages/order/order" |
|
|
}) |
|
|
}) |
|
|
}, "已完成签约", false); |
|
|
}, "已完成签约", false); |
|
|
} else if (data.signStatus === "UNSIGN") { |
|
|
|
|
|
|
|
|
} else if (data.signStatusCode === "UNSIGN") { |
|
|
//已解约 |
|
|
//已解约 |
|
|
// msg("已解约"); |
|
|
// msg("已解约"); |
|
|
confirm( |
|
|
confirm( |