From a51eef85fa320f58afeed7f7b6986e9f658e0e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=BD=A6=E7=A5=96?= <605893810@qq.com> Date: Thu, 28 Aug 2025 17:17:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=90=88=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/rwa_package/dongjian/check.vue | 184 ++++++++++++++++----------- 1 file changed, 107 insertions(+), 77 deletions(-) diff --git a/pages/rwa_package/dongjian/check.vue b/pages/rwa_package/dongjian/check.vue index 3532b08..8508b4a 100644 --- a/pages/rwa_package/dongjian/check.vue +++ b/pages/rwa_package/dongjian/check.vue @@ -8,11 +8,10 @@ 消费型合伙人协议 - - {{item.text}} + + {{ item.text }} - {{item.value}} + {{ item.value }} @@ -20,13 +19,13 @@ 合同签约人信息 - - {{item.text}} - {{item.value}} + + {{ item.text }} + {{ item.value }} - + 下载合同 @@ -41,45 +40,45 @@ import { getUserInfo } from '@/api/auth.js'; import Header from '@/components/common/header.vue'; import TopSafe from '@/components/common/top-safe.nvue' import ContractItem from './components/contract-item.vue' -import { getContractList,fileUrls } from '@/api/contract.js' +import { getContractList, fileUrls } from '@/api/contract.js' import func from '@/utils/func.js'; export default { - components: { Header,TopSafe,ContractItem }, + components: { Header, TopSafe, ContractItem }, data() { return { - dataList:[ - {text:'合同状态',value:'签约完成'}, - {text:'合同编号',value:'69485222011627525'}, - {text:'发起方',value:'信任桥(深圳)网络科技有限公司'}, - {text:'发起时间',value:'2025-08-11 12:00:00'}, - {text:'完成结束时间',value:'2025-08-11 12:00:00'}, + dataList: [ + { text: '合同状态', value: '' }, + { text: '合同编号', value: '' }, + { text: '发起方', value: '信任桥(深圳)网络科技有限公司' }, + { text: '发起时间', value: '' }, + { text: '完成结束时间', value: '' }, ], - bottomList:[ - {text:'签约人',value:'信任桥会员 章三'}, - {text:'状态',value:'已签署'}, - {text:'时间',value:'2025-08-11 12:00:00'}, + bottomList: [ + { text: '签约人', value: '信任桥会员 章三' }, + { text: '状态', value: '已签署' }, + { text: '时间', value: '2025-08-11 12:00:00' }, ], - obj:null, - url:'' + obj: null, + url: '' }; }, onLoad(option) { - this.init(); + this.init(); }, methods: { - init(){ + init() { this.isSignContract() }, - getfileUrls(){ + getfileUrls() { let params = { - businessType:'FLOW', - businessIds:[this.obj.flowId] + businessType: 'FLOW', + businessIds: [this.obj.flowId] } - fileUrls(params).then(res=>{ - if(res.bizcode == 100){ + fileUrls(params).then(res => { + if (res.bizcode == 100) { this.url = res.data.fileUrls[0].url; - }else{ + } else { this.$refs.uToastRef.show({ type: 'error', message: res.msg, @@ -87,21 +86,21 @@ export default { } }) }, - isSignContract(){ - - getContractList().then(res=>{ - if(res.bizcode == 100){ + isSignContract() { + + getContractList().then(res => { + if (res.bizcode == 100) { this.obj = JSON.parse(JSON.stringify(res.data[0])); - this.obj.time = func.formatDate(new Date(res.data[0].signatureTime),2); - this.obj.details.startTime = func.formatDate(new Date(res.data[0].details.startTime),2); - this.obj.details.endTime = func.formatDate(new Date(res.data[0].details.endTime),2); - this.dataList[2].value = this.obj.flowId; + this.obj.time = func.formatDate(new Date(res.data[0].signatureTime), 2); + this.obj.details.startTime = func.formatDate(new Date(res.data[0].details.startTime), 2); + this.obj.details.endTime = func.formatDate(new Date(res.data[0].details.endTime), 2); + // this.dataList[2].value = this.obj.flowId; this.dataList[3].value = this.obj.details.startTime; this.dataList[4].value = this.obj.details.endTime; this.bottomList[0].value = this.obj.signatureName; this.bottomList[2].value = this.obj.time; this.getfileUrls(); - }else{ + } else { this.$refs.uToastRef.show({ type: 'error', message: res.msg, @@ -109,84 +108,115 @@ export default { } }) }, - onOpen(){ - // window.open(this.obj.contractName,'_blank') - window.open(this.url,'_blank') - } + onOpen() { + // #ifdef APP-PLUS + uni.downloadFile({ + url: this.url, + success: (res) => { + if (res.statusCode === 200) { + uni.saveFile({ + tempFilePath: res.tempFilePath, + success: (res) => { + uni.openDocument({ + filePath: res.savedFilePath, + success: (res) => { + console.log('打开文档成功') + } + }) + } + }) + } + } + }) + // #endif + // #ifdef H5 + window.open(this.url, '_blank') + // #endif + }, + } }