BUG修改

This commit is contained in:
a0049873 2022-07-19 11:13:15 +08:00
parent dbe0edfcd7
commit a52966d68a
4 changed files with 28 additions and 36 deletions

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:30:26
* @LastEditTime: 2022-07-19 11:09:23
* @Description: 算法详情页头部
-->
<template>
@ -64,7 +64,7 @@
申请使用
</a-button>
<a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
{{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button>
</div>
</div>
@ -144,17 +144,17 @@
}
//
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) {
if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') {
message.success('取消成功')
scFlag.value = false
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true
}
})
@ -166,7 +166,8 @@
]).then((res) => {
if (res.data.msg === 'success') {
message.success('添加收藏成功!')
scFlag.value = true
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true
}
})
@ -191,9 +192,6 @@
applicationArea.value = props.dataList.infoList.filter(
(val) => val.attrType === '应用领域'
)[0].attrValue
if (val.isCollect) {
scFlag.value = true
}
}
}
)

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:31:32
* @LastEditTime: 2022-07-19 11:09:52
* @Description: 算法详情页头部
-->
<template>
@ -63,7 +63,7 @@
加入申购车
</a-button>
<a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
{{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button>
</div>
</div>
@ -127,17 +127,17 @@
})
}
//
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) {
if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') {
message.success('取消成功')
scFlag.value = false
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true
}
})
@ -149,7 +149,8 @@
]).then((res) => {
if (res.data.msg === 'success') {
message.success('添加收藏成功!')
scFlag.value = true
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true
}
})
@ -200,9 +201,6 @@
if (obj) {
componentType.value = obj.attrValue
}
if (val.isCollect) {
scFlag.value = true
}
}
}
)

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:32:08
* @LastEditTime: 2022-07-19 11:10:06
* @Description: 开发组件详情页头部
-->
<template>
@ -59,7 +59,7 @@
加入购物车
</a-button>
<a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
{{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button>
</div>
</div>
@ -122,17 +122,17 @@
})
}
//
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) {
if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') {
message.success('取消成功')
scFlag.value = false
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true
}
})
@ -144,7 +144,8 @@
]).then((res) => {
if (res.data.msg === 'success') {
message.success('添加收藏成功!')
scFlag.value = true
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true
}
})
@ -206,9 +207,6 @@
if (obj) {
componentType.value = obj.attrValue
}
if (val.isCollect) {
scFlag.value = true
}
}
}
)

View File

@ -2,7 +2,7 @@
* @Author: hisense.liangjunhua
* @Date: 2022-06-08 11:56:28
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-07-15 17:32:31
* @LastEditTime: 2022-07-19 11:10:20
* @Description: 算法详情页头部
-->
<template>
@ -59,7 +59,7 @@
加入申购车
</a-button>
<a-button type="primary" @click="goTOCollection()">
{{ scFlag ? '已' : '' }}收藏
{{ props.dataList.isCollect == 'true' ? '已' : '' }}收藏
</a-button>
</div>
</div>
@ -122,17 +122,17 @@
})
}
//
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) {
if (props.dataList.isCollect) {
scDel([props.dataList.id]).then((res) => {
if (res.data.msg === 'success') {
message.success('取消成功')
scFlag.value = false
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = false
scFlag2.value = true
}
})
@ -144,7 +144,8 @@
]).then((res) => {
if (res.data.msg === 'success') {
message.success('添加收藏成功!')
scFlag.value = true
// eslint-disable-next-line vue/no-mutating-props
props.dataList.isCollect = true
scFlag2.value = true
}
})
@ -199,9 +200,6 @@
if (obj) {
componentType.value = obj.attrValue
}
if (val.isCollect) {
scFlag.value = true
}
}
}
)