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

View File

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