更新
This commit is contained in:
parent
1b9724ada9
commit
ee27f6bf79
@ -17,6 +17,7 @@
|
||||
|
||||
<script>
|
||||
import headers from '../../components/header/headers.vue'
|
||||
import upload from '../../utils/upload';
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
export default {
|
||||
@ -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) { // 从onLoad中获取的callback
|
||||
try {
|
||||
const callback = decodeURIComponent(this.callback);
|
||||
|
@ -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>
|
Loading…
Reference in New Issue
Block a user