This commit is contained in:
xyc 2025-04-16 16:15:01 +08:00
parent 1b9724ada9
commit ee27f6bf79
2 changed files with 197 additions and 177 deletions

View File

@ -16,10 +16,11 @@
</template>
<script>
import headers from '../../components/header/headers.vue'
import request from '@/utils/request.js'
import headers from '../../components/header/headers.vue'
import upload from '../../utils/upload';
import request from '@/utils/request.js'
export default {
export default {
data() {
return {
titles: "合同",
@ -31,6 +32,7 @@ export default {
},
contentTemp: '',
content: '',
userUrl: '',
List: [],
show: false,
status: 'loading',
@ -55,6 +57,21 @@ export default {
}
this.callback = options.callback;
this.userData = uni.getStorageSync('userInfo');
// tempFilePath
uni.$off('tempFilePath');
uni.$on('tempFilePath', (data) => {
console.log('Received tempFilePath:', data);
//
upload({
url: '/app-api/small-upload/common/upload',
filePath: data,
}).then((res) => {
this.userUrl = res.data.url
console.log(this.userUrl, 'userUrl');
this.signatureChange()
})
});
},
onShow() {
this.getdriveSchool()
@ -91,8 +108,10 @@ export default {
}
// 线
this.content = this.content.replace(/<u[^>]*>([^<]*)name([^<]*)<\/u>/g, `<u>$1${this.contractData.name}$2</u>`);
this.content = this.content.replace(/<u[^>]*>([^<]*)type([^<]*)<\/u>/g, `<u>$1${this.contractData.type}$2</u>`);
this.content = this.content.replace(/<u[^>]*>([^<]*)name([^<]*)<\/u>/g,
`<u>$1${this.contractData.name}$2</u>`);
this.content = this.content.replace(/<u[^>]*>([^<]*)type([^<]*)<\/u>/g,
`<u>$1${this.contractData.type}$2</u>`);
},
@ -110,6 +129,7 @@ export default {
tenantId: this.tenantId,
userId: this.userData.id,
content: this.content,
userUrl: this.userUrl,
}
})
console.log(res);
@ -122,7 +142,8 @@ export default {
const pages = getCurrentPages();
const prevPage = pages[pages.length - 2];
if (prevPage && (prevPage.route === 'pagesA/register/index' || prevPage.route === '/pagesA/register/index')) {
if (prevPage && (prevPage.route === 'pagesA/register/index' || prevPage.route ===
'/pagesA/register/index')) {
if (this.callback) { // onLoadcallback
try {
const callback = decodeURIComponent(this.callback);
@ -135,7 +156,7 @@ export default {
}
}
setTimeout(function () {
setTimeout(function() {
//
uni.navigateTo({
url: '/newPages/newIndex/index'
@ -153,26 +174,26 @@ export default {
},
}
}
}
</script>
<style scoped lang="scss">
.content {
.content {
background: #f4f5f6;
height: 100vh;
}
}
.container {
.container {
width: 100%;
background: #f4f5f6;
box-sizing: border-box;
padding-top: 88px;
}
}
.f-box {
.f-box {
width: 100%;
box-sizing: border-box;
padding: 15px;
}
}
</style>

View File

@ -141,7 +141,7 @@
success: function(res) {
console.log(res, '签名');
//base64
that.emit(res.tempFilePath)
uni.$emit('tempFilePath', res.tempFilePath)
},
fail(e) {
console.log(JSON.stringify(e))
@ -240,5 +240,4 @@
font-size: 130rpx;
transform: rotate(-20deg);
}
</style>