From 4c110d0a76490f86fb8ed6f41679dd3df9ecd993 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Thu, 24 Apr 2025 20:42:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E9=A1=B5=E9=9D=A2=E8=B0=83?= =?UTF-8?q?=E6=95=B4;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_order/auth/wxLogin.vue | 11 +++-------- pages_order/sharing/article.vue | 4 +--- pages_order/sharing/group.vue | 19 +++++++------------ pages_order/sharing/personal.vue | 16 +++++++--------- pages_order/sharing/video.vue | 7 ++++--- 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/pages_order/auth/wxLogin.vue b/pages_order/auth/wxLogin.vue index 3dc2e1d..6769d47 100644 --- a/pages_order/auth/wxLogin.vue +++ b/pages_order/auth/wxLogin.vue @@ -93,14 +93,9 @@ } }, onCancel() { - uni.navigateBack({ - delta: 1, - fail: () => { - uni.reLaunch({ - url: '/pages/index/index' - }) - } - }); + uni.reLaunch({ + url: '/pages/index/index' + }) }, } } diff --git a/pages_order/sharing/article.vue b/pages_order/sharing/article.vue index b77ce4b..2609d62 100644 --- a/pages_order/sharing/article.vue +++ b/pages_order/sharing/article.vue @@ -55,7 +55,7 @@ }, onShow() { if (this.id && uni.getStorageSync('token')) { - this.initData() + this.detail.id ? this.refreshLockStatus() : this.initData() } }, async onLoad(option) { @@ -103,8 +103,6 @@ } this.$fetch('addLogShareInfo', params) - this.refreshLockStatus() - return o }, methods: { diff --git a/pages_order/sharing/group.vue b/pages_order/sharing/group.vue index 7d9f315..85045b7 100644 --- a/pages_order/sharing/group.vue +++ b/pages_order/sharing/group.vue @@ -48,7 +48,7 @@ }, onShow() { if (this.id && uni.getStorageSync('token')) { - this.fetchDetails() + this.detail.id ? this.refreshLockStatus() : this.fetchDetails() } }, onLoad(option) { @@ -88,17 +88,12 @@ query: `id=${this.id}&state=2&shareId=${this.userInfo.id}`, } - //调用增加分享次数的方法 - const params = { - id:this.id, - state:"2", - } - this.$fetch('addLogShareInfo', params) - - - - - this.refreshLockStatus() + //调用增加分享次数的方法 + const params = { + id:this.id, + state:"2", + } + this.$fetch('addLogShareInfo', params) return o }, diff --git a/pages_order/sharing/personal.vue b/pages_order/sharing/personal.vue index deafe4b..2c6b37f 100644 --- a/pages_order/sharing/personal.vue +++ b/pages_order/sharing/personal.vue @@ -49,7 +49,7 @@ }, onShow() { if (this.id && uni.getStorageSync('token')) { - this.fetchDetails() + this.detail.id ? this.refreshLockStatus() : this.fetchDetails() } }, onLoad(option) { @@ -89,14 +89,12 @@ query: `id=${this.id}&state=0&shareId=${this.userInfo.id}`, } - - //调用增加分享次数的方法 - const params = { - id:this.id, - state:"0", - } - this.$fetch('addLogShareInfo', params) - this.refreshLockStatus() + //调用增加分享次数的方法 + const params = { + id:this.id, + state:"0", + } + this.$fetch('addLogShareInfo', params) return o }, diff --git a/pages_order/sharing/video.vue b/pages_order/sharing/video.vue index 05c1ad3..fe105fa 100644 --- a/pages_order/sharing/video.vue +++ b/pages_order/sharing/video.vue @@ -62,7 +62,7 @@ }, onShow() { if (this.id && uni.getStorageSync('token')) { - this.initData() + this.detail.id ? this.refreshLockStatus() : this.initData() } }, async onLoad(option) { @@ -110,8 +110,6 @@ } this.$fetch('addLogShareInfo', params) - this.refreshLockStatus() - return o }, methods: { @@ -126,6 +124,8 @@ this.fetchCheckShare().then(result => { const { open } = result + console.log('--open', open) + this.isLocked = !open }) await this.fetchDetails(this.id) @@ -175,6 +175,7 @@ this.isLocked = false this.timeIsUp = false this.videoContext.play() + console.log('--play') } else { this.videoContext.pause() this.timeIsUp = true From 380ed75ba4e982e249848966cf93b85eb45e5cc0 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Thu, 24 Apr 2025 20:47:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E9=A1=B5=E9=9D=A2=E8=B0=83?= =?UTF-8?q?=E6=95=B4;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_order/sharing/video.vue | 57 +++++++------------------------------------ 1 file changed, 9 insertions(+), 48 deletions(-) diff --git a/pages_order/sharing/video.vue b/pages_order/sharing/video.vue index fe105fa..a1a922b 100644 --- a/pages_order/sharing/video.vue +++ b/pages_order/sharing/video.vue @@ -121,13 +121,7 @@ } }, async initData() { - this.fetchCheckShare().then(result => { - const { open } = result - - console.log('--open', open) - - this.isLocked = !open - }) + this.isLocked = true await this.fetchDetails(this.id) this.videoContext = uni.createVideoContext('video'); @@ -139,52 +133,19 @@ return {} } }, - async refreshLockStatus() { - - const result = await this.fetchCheckShare() - const { title, open } = result - - console.log('--open', open) - - this.$refs.popupUnlock.close(); - - if (open) { - this.isLocked = false - this.timeIsUp = false - this.videoContext.play() - return - } - - title && uni.showToast({ - title, - icon: 'none' - }) - + refreshLockStatus() { + this.isLocked = false + this.timeIsUp = false + this.videoContext.play() }, async onPlay() { if (!this.isLocked) { return } - - const result = await this.fetchCheckShare() - const { open, need_num, num } = result - - console.log('--open', open) - - if (open) { // 转发已达标 - this.isLocked = false - this.timeIsUp = false - this.videoContext.play() - console.log('--play') - } else { - this.videoContext.pause() - this.timeIsUp = true - uni.showToast({ - title: `还需转发${need_num - num}次`, - icon: 'none', - }) - this.$refs.popupUnlock.open(); - } + + this.videoContext.pause() + this.timeIsUp = true + this.$refs.popupUnlock.open(); }, async onTimeupdate(e) { const { currentTime } = e.target From 0cb5394675317196a9aae933a48f69349b39a4f7 Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Thu, 24 Apr 2025 20:57:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20=E9=A1=B5=E9=9D=A2=E8=B0=83?= =?UTF-8?q?=E6=95=B4;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_order/sharing/video.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages_order/sharing/video.vue b/pages_order/sharing/video.vue index a1a922b..fd4ddf5 100644 --- a/pages_order/sharing/video.vue +++ b/pages_order/sharing/video.vue @@ -136,7 +136,10 @@ refreshLockStatus() { this.isLocked = false this.timeIsUp = false - this.videoContext.play() + setTimeout(() => { + this.videoContext.play() + console.log('--play') + }) }, async onPlay() { if (!this.isLocked) { From 78fb1b72b2579524bc332b94ef3c52523228baad Mon Sep 17 00:00:00 2001 From: Fox-33 <1466778434@qq.com> Date: Sat, 26 Apr 2025 00:44:51 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E5=88=86=E4=BA=AB=E5=A5=BD?= =?UTF-8?q?=E5=8F=8B=E5=B0=81=E9=9D=A2=E5=9B=BE=E8=87=AA=E5=8A=A8=E8=A3=81?= =?UTF-8?q?=E5=88=87;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_order/components/autoCrop.vue | 111 +++++++++++++++++++++++++++++++++ pages_order/record/articleSharing.vue | 17 ++++- pages_order/record/groupSharing.vue | 17 ++++- pages_order/record/personalSharing.vue | 18 +++++- pages_order/record/videoSharing.vue | 18 +++++- 5 files changed, 169 insertions(+), 12 deletions(-) create mode 100644 pages_order/components/autoCrop.vue diff --git a/pages_order/components/autoCrop.vue b/pages_order/components/autoCrop.vue new file mode 100644 index 0000000..216993e --- /dev/null +++ b/pages_order/components/autoCrop.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/pages_order/record/articleSharing.vue b/pages_order/record/articleSharing.vue index 5e8805d..64d4717 100644 --- a/pages_order/record/articleSharing.vue +++ b/pages_order/record/articleSharing.vue @@ -109,9 +109,11 @@ 发布 - + + @@ -122,6 +124,7 @@ import formNumberBox from '../components/formNumberBox.vue' import formUpload from '../components/formUpload.vue' import formTextarea from '../components/formTextarea.vue' + import autoCrop from '../components/autoCrop.vue' export default { components: { @@ -129,6 +132,7 @@ formNumberBox, formUpload, formTextarea, + autoCrop, }, data() { return { @@ -319,7 +323,15 @@ } }, - async onSubmit() { + async preSubmit() { + try { + await this.$refs.form.validate() + this.$refs.autoCropRef.set(this.form.headImage) + } catch (err) { + + } + }, + async onSubmit(headImage) { try { await this.$refs.form.validate() @@ -327,7 +339,6 @@ const textDetails = (await this.getEditorContents())?.html const { - headImage, headTitle, num, wxCodeImage, diff --git a/pages_order/record/groupSharing.vue b/pages_order/record/groupSharing.vue index bccd03a..fe3bb14 100644 --- a/pages_order/record/groupSharing.vue +++ b/pages_order/record/groupSharing.vue @@ -124,9 +124,11 @@ 发布 - + + @@ -137,6 +139,7 @@ import formNumberBox from '../components/formNumberBox.vue' import formUpload from '../components/formUpload.vue' import formTextarea from '../components/formTextarea.vue' + import autoCrop from '../components/autoCrop.vue' export default { components: { @@ -144,6 +147,7 @@ formNumberBox, formUpload, formTextarea, + autoCrop, }, data() { return { @@ -281,7 +285,15 @@ } }, - async onSubmit() { + async preSubmit() { + try { + await this.$refs.form.validate() + this.$refs.autoCropRef.set(this.form.indexImage) + } catch (err) { + + } + }, + async onSubmit(indexImage) { try { await this.$refs.form.validate() @@ -289,7 +301,6 @@ const { headImage, headTitle, - indexImage, memberNum, num, wxCodeImage, diff --git a/pages_order/record/personalSharing.vue b/pages_order/record/personalSharing.vue index 886ecc3..567d977 100644 --- a/pages_order/record/personalSharing.vue +++ b/pages_order/record/personalSharing.vue @@ -117,9 +117,11 @@ 发布 - + + @@ -130,6 +132,7 @@ import formNumberBox from '../components/formNumberBox.vue' import formUpload from '../components/formUpload.vue' import formTextarea from '../components/formTextarea.vue' + import autoCrop from '../components/autoCrop.vue' export default { components: { @@ -137,6 +140,7 @@ formNumberBox, formUpload, formTextarea, + autoCrop, }, data() { return { @@ -267,11 +271,20 @@ textDetails, } this.status = status + } catch (err) { } }, - async onSubmit() { + async preSubmit() { + try { + await this.$refs.form.validate() + this.$refs.autoCropRef.set(this.form.indexImage) + } catch (err) { + + } + }, + async onSubmit(indexImage) { try { await this.$refs.form.validate() @@ -279,7 +292,6 @@ const { headImage, headTitle, - indexImage, num, wxCodeImage, textDetails, diff --git a/pages_order/record/videoSharing.vue b/pages_order/record/videoSharing.vue index f04be73..e279d20 100644 --- a/pages_order/record/videoSharing.vue +++ b/pages_order/record/videoSharing.vue @@ -113,18 +113,22 @@ 发布 - + +