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

@ -17,6 +17,7 @@
<script> <script>
import headers from '../../components/header/headers.vue' import headers from '../../components/header/headers.vue'
import upload from '../../utils/upload';
import request from '@/utils/request.js' import request from '@/utils/request.js'
export default { export default {
@ -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);

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>