From 6a4e106475c6e8476e3fa8c1b6cc78b2f6f4efd2 Mon Sep 17 00:00:00 2001 From: yulixing Date: Mon, 22 Jul 2019 20:14:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=9B=BE=20=E5=88=86?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/games/details/share/edit.vue | 48 ++++++++++++++++++++--- src/views/games/details/share/index.vue | 52 ++++++++++++++++++------- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/src/views/games/details/share/edit.vue b/src/views/games/details/share/edit.vue index 8516e52..86f80ac 100644 --- a/src/views/games/details/share/edit.vue +++ b/src/views/games/details/share/edit.vue @@ -24,6 +24,24 @@ disabled /> + + + + + { - return item.share_type + return { + share_type: item.share_type, + platform_id: item.platform_id + } }) } }) @@ -779,11 +806,22 @@ export default { } }, changeShareType(val) { - if (this.selectedShareType.includes(val) && this.curShareType !== val) { - this.shareForm.share_type = '' - this.$message.error('已有此分享类型,请选择其他分享类型!') + for (let i = 0; i < this.selectedShareType.length; i++) { + const shareType = this.selectedShareType[i] + if ( + shareType.share_type === val && + shareType.platform_id === this.shareForm.platform_id && + this.curShareType !== val + ) { + this.shareForm.share_type = '' + this.$message.error('该平台已有此分享类型,请选择其他分享类型!') + break + } } }, + changePlatform() { + this.changeShareType(this.shareForm.share_type) + }, submitForm(formName) { this.$refs[formName].validate(valid => { if (valid) { diff --git a/src/views/games/details/share/index.vue b/src/views/games/details/share/index.vue index 23ac4ac..07b1829 100644 --- a/src/views/games/details/share/index.vue +++ b/src/views/games/details/share/index.vue @@ -7,6 +7,22 @@ :model="filterForm" class="filter" > + + + + + +