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 397c0e82..d2216eec 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;