Commit afdc8bf7 authored by GuanHua's avatar GuanHua

fix: 收藏列表点击再次购买被浏览器拦截弹窗的问题

parent 3af3ebf1
......@@ -68,6 +68,11 @@ const Commodity: React.FC = () => {
break
}
el.target = '_blank';
el.id = detail.commodity.id
// 防止反复添加
if(!document.getElementById(detail.commodity.id)) {
document.body.appendChild(el);
}
el.click()
} else {
message.destroy()
......@@ -130,7 +135,7 @@ const Commodity: React.FC = () => {
PublicApi.postSearchShopCommodityCollectDeleteCommodityCollect(param).then(res => {
if (res.code === 1000) {
fetchCollectCommodityList()
resolve()
resolve(true)
} else {
reject()
}
......
......@@ -21,11 +21,11 @@ const Information: React.FC = () => {
* 获取收藏的资讯列表
*/
const fetchCollectInformationList = () => {
let param = {
const param: any = {
current,
pageSize
}
//@ts-ignore
PublicApi.getManageContentInformationCollectList(param).then(res => {
if (res.code === 1000) {
setList(res.data.data)
......@@ -40,9 +40,13 @@ const Information: React.FC = () => {
const linkToDetail = (detail) => {
if (detail.status === 2) {
let el = document.createElement('a')
const el = document.createElement('a')
el.href = `/infomation/detail?id=${detail.id}`;
el.target = '_blank';
el.id = detail.id
if(!document.getElementById(detail.id)) {
document.body.appendChild(el);
}
el.click()
} else {
message.destroy()
......@@ -57,7 +61,7 @@ const Information: React.FC = () => {
content: `是否要取消收藏?`,
onOk: () => {
return new Promise((resolve, reject) => {
let param = {
const param = {
informationId: detail.id,
status: false
}
......@@ -65,7 +69,7 @@ const Information: React.FC = () => {
if (res.code === 1000) {
// fetchPurchaseList()
fetchCollectInformationList()
resolve()
resolve(true)
} else {
reject()
}
......
......@@ -71,6 +71,10 @@ const Shops: React.FC = () => {
const el = document.createElement('a')
el.href = `/shop?shopId=${btoa(JSON.stringify({ shopId: detail.id, memberId: detail.memberId }))}`;
el.target = '_blank';
el.id = detail.id
if(!document.getElementById(detail.id)) {
document.body.appendChild(el);
}
el.click()
} else {
message.destroy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment