From df43efef3167499656d72db12499e45f933dbf62 Mon Sep 17 00:00:00 2001 From: gaoyuanwei <2826352639@qq.com> Date: Mon, 25 Jul 2022 09:52:23 +0800 Subject: [PATCH] =?UTF-8?q?701bug=20=20=20=E9=80=9A=E7=9F=A5=E5=B0=8F?= =?UTF-8?q?=E9=93=83=E9=93=9B=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Algorithm/AlgorithmTopDetails.vue | 29 ++++++++++++------- .../Application/ApplicationTopDetails.vue | 29 ++++++++++++------- .../Business/BusinessTopDetails.vue | 29 ++++++++++++------- .../Developer/DeveloperTopDetails.vue | 29 ++++++++++++------- .../LayerService/LayerServiceTopDetails.vue | 29 ++++++++++++------- front/src/views/home/components/header.vue | 2 +- 6 files changed, 96 insertions(+), 51 deletions(-) diff --git a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue index 3a1dc63b..588af45f 100644 --- a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue +++ b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue @@ -87,16 +87,25 @@ const deploymentLocation = ref('') //部署位置 //加入申购车 const addShoppingCart = () => { - console.log('加入申购车==================>', props.dataList) - sgcInsert({ - delFlag: '0', - resourceId: props.dataList.id, - // userId: userId.value, - }).then((res) => { - console.log(res) - message.success('添加申购车成功!') - mybus.emit('getSgcNum') - }) + if (props.dataList.isInShoppingCart) { + message.error('已经加入申购车了') + } else { + console.log('加入申购车==================>', props.dataList) + sgcInsert({ + delFlag: '0', + resourceId: props.dataList.id, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + props.dataList.isInShoppingCart = true + console.log( + props.dataList.isInShoppingCart, + 'props.dataList.isInShoppingCart' + ) + }) + } } //立即申请 function toView() { diff --git a/front/src/views/detailsAll/components/Application/ApplicationTopDetails.vue b/front/src/views/detailsAll/components/Application/ApplicationTopDetails.vue index 6f0205e8..44f635b0 100644 --- a/front/src/views/detailsAll/components/Application/ApplicationTopDetails.vue +++ b/front/src/views/detailsAll/components/Application/ApplicationTopDetails.vue @@ -90,16 +90,25 @@ const applicationArea = ref('') // // 加入申购车 const addShoppingCart = () => { - console.log('加入申购车==================>', props.dataList) - sgcInsert({ - delFlag: '0', - resourceId: props.dataList.id, - // userId: userId.value, - }).then((res) => { - console.log(res) - message.success('添加申购车成功!') - mybus.emit('getSgcNum') - }) + if (props.dataList.isInShoppingCart) { + message.error('已经加入申购车了') + } else { + console.log('加入申购车==================>', props.dataList) + sgcInsert({ + delFlag: '0', + resourceId: props.dataList.id, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + props.dataList.isInShoppingCart = true + console.log( + props.dataList.isInShoppingCart, + 'props.dataList.isInShoppingCart' + ) + }) + } } // // 立即申请 function toView() { diff --git a/front/src/views/detailsAll/components/Business/BusinessTopDetails.vue b/front/src/views/detailsAll/components/Business/BusinessTopDetails.vue index 123ae579..3ba478df 100644 --- a/front/src/views/detailsAll/components/Business/BusinessTopDetails.vue +++ b/front/src/views/detailsAll/components/Business/BusinessTopDetails.vue @@ -87,16 +87,25 @@ const componentType = ref('') //组件类型 // // 加入申购车 const addShoppingCart = () => { - console.log('加入申购车==================>', props.dataList) - sgcInsert({ - delFlag: '0', - resourceId: props.dataList.id, - // userId: userId.value, - }).then((res) => { - console.log(res) - message.success('添加申购车成功!') - mybus.emit('getSgcNum') - }) + if (props.dataList.isInShoppingCart) { + message.error('已经加入申购车了') + } else { + console.log('加入申购车==================>', props.dataList) + sgcInsert({ + delFlag: '0', + resourceId: props.dataList.id, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + props.dataList.isInShoppingCart = true + console.log( + props.dataList.isInShoppingCart, + 'props.dataList.isInShoppingCart' + ) + }) + } } // // 立即申请 function toView() { diff --git a/front/src/views/detailsAll/components/Developer/DeveloperTopDetails.vue b/front/src/views/detailsAll/components/Developer/DeveloperTopDetails.vue index de247e25..752b715d 100644 --- a/front/src/views/detailsAll/components/Developer/DeveloperTopDetails.vue +++ b/front/src/views/detailsAll/components/Developer/DeveloperTopDetails.vue @@ -82,16 +82,25 @@ const deploymentLocation = ref('') //部署位置 // 加入申购车 const addShoppingCart = () => { - console.log('加入申购车==================>', props.dataList) - sgcInsert({ - delFlag: '0', - resourceId: props.dataList.id, - // userId: userId.value, - }).then((res) => { - console.log(res) - message.success('添加申购车成功!') - mybus.emit('getSgcNum') - }) + if (props.dataList.isInShoppingCart) { + message.error('已经加入申购车了') + } else { + console.log('加入申购车==================>', props.dataList) + sgcInsert({ + delFlag: '0', + resourceId: props.dataList.id, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + props.dataList.isInShoppingCart = true + console.log( + props.dataList.isInShoppingCart, + 'props.dataList.isInShoppingCart' + ) + }) + } } // 立即申请 function toView() { diff --git a/front/src/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue b/front/src/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue index 88bbc7e5..5f3175cd 100644 --- a/front/src/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue +++ b/front/src/views/detailsAll/components/LayerService/LayerServiceTopDetails.vue @@ -82,16 +82,25 @@ const deploymentLocation = ref('') //部署位置 // 加入申购车 const addShoppingCart = () => { - console.log('加入申购车==================>', props.dataList) - sgcInsert({ - delFlag: '0', - resourceId: props.dataList.id, - // userId: userId.value, - }).then((res) => { - console.log(res) - message.success('添加申购车成功!') - mybus.emit('getSgcNum') - }) + if (props.dataList.isInShoppingCart) { + message.error('已经加入申购车了') + } else { + console.log('加入申购车==================>', props.dataList) + sgcInsert({ + delFlag: '0', + resourceId: props.dataList.id, + // userId: userId.value, + }).then((res) => { + console.log(res) + message.success('添加申购车成功!') + mybus.emit('getSgcNum') + props.dataList.isInShoppingCart = true + console.log( + props.dataList.isInShoppingCart, + 'props.dataList.isInShoppingCart' + ) + }) + } } // 立即申请 function toView() { diff --git a/front/src/views/home/components/header.vue b/front/src/views/home/components/header.vue index 8e68f09a..36fd4337 100644 --- a/front/src/views/home/components/header.vue +++ b/front/src/views/home/components/header.vue @@ -465,7 +465,7 @@ border-radius: 0.05rem; position: absolute; top: 0.45rem; - right: 3.1rem; + right: 2.9rem; overflow-y: scroll; .bottom { cursor: pointer;