From 956923bc20695d7c878bd6c8f37c3c2a8dc08325 Mon Sep 17 00:00:00 2001 From: xuminyui <576362016@qq.com> Date: Thu, 28 Sep 2023 11:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cameraContext/cameraContext.vue | 5 +- pages/realName/realName.vue | 72 ++++++++++++++------------- 2 files changed, 41 insertions(+), 36 deletions(-) diff --git a/pages/cameraContext/cameraContext.vue b/pages/cameraContext/cameraContext.vue index 71b1ed9..6205045 100644 --- a/pages/cameraContext/cameraContext.vue +++ b/pages/cameraContext/cameraContext.vue @@ -71,6 +71,7 @@ export default { this.tempVideoPath = res.tempVideoPath; this.tips = "⚪录制完成"; this.isEnd = false; + uni.setStorageSync("tempVideoPath", res.tempVideoPath); } }); }, 5000); @@ -96,8 +97,8 @@ export default { // }); // }, back() { - uni.redirectTo({ - url: "/pages/realName/realName?tempVideoPath=" + this.tempVideoPath + uni.navigateBack({ + delta: 2 }); } } diff --git a/pages/realName/realName.vue b/pages/realName/realName.vue index b055109..7372d9d 100644 --- a/pages/realName/realName.vue +++ b/pages/realName/realName.vue @@ -100,33 +100,46 @@ export default { fileList2: [], video: '', isChecked: false, - isFddSuccess:false, + isFddSuccess: false, // show:false }; }, - async onLoad(options) { - if (options.tempVideoPath) { - this.video = await this.uploadFilePromise(options.tempVideoPath) - console.log('this.video', this.video) - const data = { - num: uni.getStorageSync("info").num || '', - name: uni.getStorageSync("info").name || '', - fileList: uni.getStorageSync("info").fileList || [], - fileList2: uni.getStorageSync("info").fileList2, - video: this.video - } - uni.setStorageSync("info", data) + // onLoad(options) { + // console.log(this.isFddSuccess) + // if (this.isFddSuccess) { + // this.nextTick(() => { + + // }) + // } + // }, + async onShow() { + this.checkFdd() + if (uni.getStorageSync('tempVideoPath')) { + const tempVideoPath = uni.getStorageSync('tempVideoPath'); + this.video = await this.uploadFilePromise(tempVideoPath) + uni.removeStorageSync("tempVideoPath") + console.log('this.video', this.video,uni.getStorageSync('tempVideoPath')) + // const data = { + // num: uni.getStorageSync("info").num || '', + // name: uni.getStorageSync("info").name || '', + // fileList: uni.getStorageSync("info").fileList || [], + // fileList2: uni.getStorageSync("info").fileList2, + // video: this.video + // } + // uni.setStorageSync("info", data) } - this.name = uni.getStorageSync("info").name || '' - this.num = uni.getStorageSync("info").num || '' - this.fileList = uni.getStorageSync("info").fileList || [] - this.fileList2 = uni.getStorageSync("info").fileList2 || [] - this.video = uni.getStorageSync("info").video || '' - // this.isFdd = uni.getStorageSync("isFdd") || false - uni.removeStorageSync("info") }, - onShow() { - this.checkFdd() + watch:{ + isFddSuccess(newValue){ + if(newValue){ + this.name = uni.getStorageSync("info").name || '' + this.num = uni.getStorageSync("info").num || '' + this.fileList = uni.getStorageSync("info").fileList || [] + this.fileList2 = uni.getStorageSync("info").fileList2 || [] + this.video = uni.getStorageSync("info").video || '' + uni.removeStorageSync("info") + } + } }, methods: { changeName(value) { @@ -136,13 +149,6 @@ export default { this.num = value; }, camera() { - const data = { - num: this.num, - name: this.name, - fileList: this.fileList, - fileList2: this.fileList2 - } - uni.setStorageSync("info", data) uni.navigateTo({ url: '/pages/cameraContext/cameraContext' }); @@ -207,7 +213,6 @@ export default { }) for (let i = 0; i < lists.length; i++) { const result = await this.uploadFilePromise(lists[i].url, 'check') - console.log(result) let item = this[`fileList`][fileListLen] this[`fileList`].splice(fileListLen, 1, Object.assign(item, { status: 'success', @@ -247,7 +252,6 @@ export default { name: "file", success: (res) => { const { path } = JSON.parse(res.data).data; - console.log('@@@@', path) resolve(path); if (type === 'check') { this.chenckId(path) @@ -283,10 +287,10 @@ export default { mobile }) if (res.status === 0) { - uni.setStorageSync("fddUrl",res.data?.url); + uni.setStorageSync("fddUrl", res.data?.url); uni.navigateTo({ - url: "/pages/realName/FDDRegister", - }); + url: "/pages/realName/FDDRegister", + }); } else { this.$common.msgToast(res.msg) }