From b15efd9206a5b3615561e03c79a6f3dd1c02d9de Mon Sep 17 00:00:00 2001
From: "851673013@qq.com" <851673013@qq.com>
Date: Tue, 19 Jul 2022 10:25:10 +0800
Subject: [PATCH 1/7] bug629
---
.../capacityOnTheShelf/components/PutOnTheShelf.vue | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
index d7a45ddb..896a724f 100644
--- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
+++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue
@@ -138,10 +138,18 @@
>
{{ item.name }}
+
Date: Tue, 19 Jul 2022 11:08:32 +0800
Subject: [PATCH 2/7] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Algorithm/AlgorithmTopDetails.vue | 76 +++++++++----------
1 file changed, 37 insertions(+), 39 deletions(-)
diff --git a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
index 64311f72..3a1dc63b 100644
--- a/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
+++ b/front/src/views/detailsAll/components/Algorithm/AlgorithmTopDetails.vue
@@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
- * @LastEditTime: 2022-07-15 17:30:19
+ * @LastEditTime: 2022-07-19 11:07:46
* @Description: 算法详情页头部
-->
@@ -62,7 +62,7 @@
加入申购车
- {{ scFlag ? '已' : '' }}收藏
+ {{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
@@ -127,40 +127,6 @@
})
}
const componentType = ref('')
- // 收藏
- const scFlag = ref(props.dataList.isCollect)
- const scFlag2 = ref(true)
- const goTOCollection = () => {
- console.log('收藏===================》', props.dataList)
- if (scFlag2.value) {
- scFlag2.value = false
- if (scFlag.value) {
- scDel([props.dataList.id]).then((res) => {
- if (res.data.msg === 'success') {
- message.success('取消成功')
- scFlag.value = false
- scFlag2.value = true
- }
- })
- } else {
- scInsert([
- {
- resourceId: props.dataList.id,
- },
- ]).then((res) => {
- if (res.data.msg === 'success') {
- message.success('添加收藏成功!')
- scFlag.value = true
- scFlag2.value = true
- }
- })
- }
- }
- // scInsert([{ resourceId: props.dataList.id }]).then((res) => {
- // console.log(res)
- // message.success('收藏成功')
- // })
- }
if (props.dataList.infoList) {
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
@@ -217,12 +183,44 @@
if (obj) {
componentType.value = obj.attrValue
}
- if (val.isCollect) {
- scFlag.value = true
- }
}
}
)
+ // 收藏
+ const scFlag2 = ref(true)
+ const goTOCollection = () => {
+ console.log('收藏===================》', props.dataList)
+ if (scFlag2.value) {
+ scFlag2.value = false
+ if (props.dataList.isCollect == 'true') {
+ scDel([props.dataList.id]).then((res) => {
+ if (res.data.msg === 'success') {
+ message.success('取消成功')
+ // eslint-disable-next-line vue/no-mutating-props
+ props.dataList.isCollect = 'false'
+ scFlag2.value = true
+ }
+ })
+ } else {
+ scInsert([
+ {
+ resourceId: props.dataList.id,
+ },
+ ]).then((res) => {
+ if (res.data.msg === 'success') {
+ message.success('添加收藏成功!')
+ // eslint-disable-next-line vue/no-mutating-props
+ props.dataList.isCollect = 'true'
+ scFlag2.value = true
+ }
+ })
+ }
+ }
+ // scInsert([{ resourceId: props.dataList.id }]).then((res) => {
+ // console.log(res)
+ // message.success('收藏成功')
+ // })
+ }