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