@@ -48,6 +48,8 @@ import { | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; | |||
@@ -74,58 +76,76 @@ const savaHandle = () => { | |||
success: res => { | |||
// 获取需要的用户信息 | |||
state.code = res.authCode | |||
console.log("code*******", state.code); | |||
//如果获取openId成功 | |||
if (state.code) { | |||
var data = { | |||
orderId: state.orderId, | |||
code: state.code, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log("res*******", res); | |||
const data = stringToJson(res.bizContent); | |||
console.log("data*******", data); | |||
if (data.signStatus === "WAIT_SIGN") { | |||
//待签约 | |||
my.ap.navigateToAlipayPage({ | |||
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId | |||
}); | |||
}else if (data.signStatus === "SIGNED") { | |||
//已签约 | |||
// msg("已签约"); | |||
confirm( | |||
"您已完成签约,等待业务员审核发货", | |||
() => { | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
}) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
}, | |||
"已完成签约", | |||
false | |||
); | |||
}else if (data.signStatus === "UNSIGN") { | |||
//已解约 | |||
// msg("已解约"); | |||
confirm( | |||
"您已解约!", | |||
() => { | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
}) | |||
}, | |||
"您已解约", | |||
false | |||
); | |||
} | |||
}); | |||
console.log("code*******", state.code); | |||
const optionsUser = { | |||
type: 2, | |||
data: { | |||
payConfigId: aliPayConfigIdTwo, | |||
code: res.authCode | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
console.log('支付宝用户编号请求:', optionsUser) | |||
request(obtainUserId, optionsUser).then((res) => { | |||
console.log('支付宝用户编号返回:', res) | |||
const bizContent = stringToJson(res.bizContent); | |||
var data = { | |||
orderId: state.orderId, | |||
subOpenId: bizContent.openId, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log("res*******", res); | |||
const data = stringToJson(res.bizContent); | |||
console.log("data*******", data); | |||
if (data.signStatus === "WAIT_SIGN") { | |||
//待签约 | |||
my.ap.navigateToAlipayPage({ | |||
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId | |||
}); | |||
}else if (data.signStatus === "SIGNED") { | |||
//已签约 | |||
// msg("已签约"); | |||
confirm( | |||
"您已完成签约,等待业务员审核发货", | |||
() => { | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
}) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
}, | |||
"已完成签约", | |||
false | |||
); | |||
}else if (data.signStatus === "UNSIGN") { | |||
//已解约 | |||
// msg("已解约"); | |||
confirm( | |||
"您已解约!", | |||
() => { | |||
uni.switchTab({ | |||
url: "/pages/order/order" | |||
}) | |||
}, | |||
"您已解约", | |||
false | |||
); | |||
} | |||
}); | |||
}) | |||
} else { | |||
//如果获取openId失败 | |||
uni.showToast({ |
@@ -48,6 +48,8 @@ import { | |||
wechatAppID, | |||
wechatPayConfigId, | |||
wechatSecret, | |||
aliPayConfigIdTwo, | |||
obtainUserId, | |||
} from "@/utils/network/api"; | |||
const imgURL = `${fileURL}image/`; | |||
@@ -71,64 +73,83 @@ const addInterestsList=()=>{ | |||
url:`/subpackage/orders/interestsList?orderId=${state.orderId}&&clientFee=${state.clientFee}&&id=${state.id}` | |||
}); | |||
} | |||
const savaHandle = () => { | |||
my.getAuthCode({ | |||
scopes: 'auth_user', | |||
success: res => { | |||
// 获取需要的用户信息 | |||
state.code = res.authCode | |||
console.log("code*******", state.code); | |||
//如果获取openId成功 | |||
if (state.code) { | |||
var data = { | |||
orderId: state.orderId, | |||
code: state.code, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log("code*******", state.code); | |||
const optionsUser = { | |||
type: 2, | |||
data: { | |||
payConfigId: aliPayConfigIdTwo, | |||
code: res.authCode | |||
}, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
console.log('支付宝用户编号请求:', optionsUser) | |||
request(obtainUserId, optionsUser).then((res) => { | |||
console.log('支付宝用户编号返回:', res) | |||
const bizContent = stringToJson(res.bizContent); | |||
var data = { | |||
orderId: state.orderId, | |||
subOpenId: bizContent.openId, | |||
}; | |||
const options = { | |||
type: 2, | |||
data: data, | |||
method: "POST", | |||
showLoading: true, | |||
}; | |||
request(etcQYAction, options).then((res) => { | |||
console.log("res*******", res); | |||
const data = stringToJson(res.bizContent); | |||
console.log("data*******", data); | |||
if (data.signStatus === "WAIT_SIGN") { | |||
//待签约 | |||
my.ap.navigateToAlipayPage({ | |||
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId | |||
}); | |||
}else if (data.signStatus === "SIGNED") { | |||
//已签约 | |||
// msg("已签约"); | |||
confirm( | |||
"您已完成签约,等待业务员审核发货", | |||
() => { | |||
// uni.switchTab({ | |||
// url: "/pages/order/order" | |||
// }) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
}, | |||
"已完成签约", | |||
false | |||
); | |||
}else if (data.signStatus === "UNSIGN") { | |||
//已解约 | |||
// msg("已解约"); | |||
confirm( | |||
"您已解约!", | |||
() => { | |||
// uni.switchTab({ | |||
// url: "/pages/order/order" | |||
// }) | |||
}, | |||
"您已解约", | |||
false | |||
); | |||
} | |||
}); | |||
const data = stringToJson(res.bizContent); | |||
console.log("data*******", data); | |||
if (data.signStatus === "WAIT_SIGN") { | |||
//待签约 | |||
my.ap.navigateToAlipayPage({ | |||
path: "https://render.alipay.com/p/yuyan/180020010001250649/sign.html?orderId="+data.alipayOrderId | |||
}); | |||
}else if (data.signStatus === "SIGNED") { | |||
//已签约 | |||
// msg("已签约"); | |||
confirm( | |||
"您已完成签约,等待业务员审核发货", | |||
() => { | |||
// uni.switchTab({ | |||
// url: "/pages/order/order" | |||
// }) | |||
// uni.$emit("refreshOrder"); | |||
// uni.navigateBack(); | |||
}, | |||
"已完成签约", | |||
false | |||
); | |||
}else if (data.signStatus === "UNSIGN") { | |||
//已解约 | |||
// msg("已解约"); | |||
confirm( | |||
"您已解约!", | |||
() => { | |||
// uni.switchTab({ | |||
// url: "/pages/order/order" | |||
// }) | |||
}, | |||
"您已解约", | |||
false | |||
); | |||
} | |||
}); | |||
}) | |||
} else { | |||
//如果获取openId失败 | |||
uni.showToast({ |
@@ -26,6 +26,7 @@ export const appId = "52030131"; //应用appid 综合业务支撑平台使用 | |||
export const loginTime = 86400; //登录有效时间(单位s) 1天 | |||
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付:6a9a54bc01f6443faea7ffe132b19f6 | |||
export const aliPayConfigId = "6a9a54bc01f6443123452b1234"; //支付配置编号 支付宝小程序支付:6a9a54bc01f6443123452b1234 | |||
export const aliPayConfigIdTwo = "6a9a54bc01f644312543761234"; | |||
export const wechatAppID = "wx8fba957179c1329a"; //九州小程序APPid:wx008c60533388527a | |||
export const wechatSecret = "699c10826113ddb350fbe58a96e2b015"; //九州小程序AppSecret:95197718b43b497f02732bd9f8011080 | |||
// export const sm4Key = "5dc11f854ceca1473e1a5075ed16eb226b4543a9a05fe50f7fba40f898099ce34abba69a07a20509f315f94d808a4d0e988935588858f65a"; |