feat: 小程序签名

This commit is contained in:
2025-08-13 12:16:42 +08:00
parent c507d7397f
commit 79124cbce7
+17 -21
View File
@@ -410,15 +410,15 @@ export default {
*/
confirmReceiptOk(item) {
const then = this;
// uni.showModal({
// title: '提示',
// content: '是否确认收货?',
// success: function (res) {
// if (res.confirm) {
// then.confirmReceiptFun(item);
// }
// }
// });
uni.showModal({
title: '提示',
content: '是否确认收货?',
success: function (res) {
if (res.confirm) {
then.confirmReceiptFun(item);
}
}
});
},
async confirmReceiptFun(item) {
const params = {
@@ -431,6 +431,7 @@ export default {
this.loadData();
}
},
// 判断是否已经签名
async checkSigned() {
const { bizcode, data } = await isSignContract();
@@ -438,12 +439,12 @@ export default {
this.isCheckSigne = data;
}
},
// 发起合同签章
async onSignContract(item) {
const params = {
// 需要的参数
orderId: item.id,
// orderId: 'yDt4ZUUckp9j355lUEEr2XwS6QZTaLFb'
}
const { bizcode, data } = await signContract(params);
if (bizcode === 100) {
@@ -460,19 +461,16 @@ export default {
// #endif
}
},
// 获取H5签署链接
async onGetSignUrl(flowId) {
console.log("获取H5签署链接", flowId)
const params = {
// 需要的参数
flowId: flowId,
}
const { bizcode, data } = await getSignUrl(params);
console.log("获取H5签署链接-1", data)
if (bizcode === 100) {
this.signUrl = data.flowApproverUrlInfos[0].longUrl
// this.onGetMiniProgramSignUrl(data)
this.signUrl = data.flowApproverUrlInfos[0].longUrl;
} else {
this.$refs.uToastRef.show({
type: 'error',
@@ -500,17 +498,16 @@ export default {
return null;
}
},
// 电子签的回调地址
handleMessage(e) {
const data = e.detail;
console.log('电子签的回调地址', e);
},
// 小程序签名
openTencentESign() {
// 这个链接需要后端调用腾讯电子签 API 获取
const signPath = `/pages/guide?from=app&to=CONTRACT_DETAIL&id=${this.flowId}` // 腾讯电子签小程序内部页面路径
// 小程序签名
openTencentESign(signPath) {
// 这个链接需要后端调用腾讯电子签 API 获取
uni.navigateToMiniProgram({
appId: 'wxa023b292fd19d41d', // 腾讯电子签官方小程序的 appId
path: signPath, // 跳转到的页面路径 + 参数
@@ -524,7 +521,6 @@ export default {
}
})
}
}
}
</script>