|
|
|
@ -74,7 +74,7 @@ |
|
|
|
|
|
|
|
<script type="module"> |
|
|
|
// 导入API函数 |
|
|
|
import { getImageApi, acceptCardApi } from './src/api/member.js'; |
|
|
|
import { getImageApi, acceptCardApi, getStateApi } from './src/api/member.js'; |
|
|
|
|
|
|
|
const userAgent = navigator.userAgent; |
|
|
|
// 获取弹窗元素 |
|
|
|
@ -153,19 +153,28 @@ |
|
|
|
|
|
|
|
if (imagePaths?.landingImageUrl) { |
|
|
|
finalLandingUrl = imagePaths.landingImageUrl; |
|
|
|
if (!cachedImage || cachedImage.url !== finalLandingUrl) { |
|
|
|
shouldShowPopup = true; |
|
|
|
saveLandingImageToCache(finalLandingUrl); |
|
|
|
popupImage.src = imagePaths.popupImageUrl; |
|
|
|
} |
|
|
|
// if (!cachedImage || cachedImage.url !== finalLandingUrl) { |
|
|
|
// shouldShowPopup = true; |
|
|
|
// saveLandingImageToCache(finalLandingUrl); |
|
|
|
// popupImage.src = imagePaths.popupImageUrl; |
|
|
|
// } |
|
|
|
} else { |
|
|
|
// 接口失败时使用缓存(如果有) |
|
|
|
finalLandingUrl = cachedImage?.url; |
|
|
|
} |
|
|
|
|
|
|
|
// 4. 设置落地图 |
|
|
|
landingImage.src = finalLandingUrl; |
|
|
|
|
|
|
|
const stateRes = await getStateApi({ |
|
|
|
user_info:userAgent |
|
|
|
}); |
|
|
|
if(stateRes.code == 200 ){ |
|
|
|
if(stateRes.data > 0){ |
|
|
|
shouldShowPopup = false |
|
|
|
} else { |
|
|
|
shouldShowPopup = true |
|
|
|
popupImage.src = imagePaths.popupImageUrl; |
|
|
|
} |
|
|
|
} |
|
|
|
// 5. 新增:根据对比结果决定是否展示弹窗 |
|
|
|
if (shouldShowPopup) { |
|
|
|
setTimeout(() => { |
|
|
|
|