|
|
@ -40,9 +40,9 @@ import feedbackBtn from "../assets/img/Feedback/feedbackBtn.png"; |
|
|
|
import AiEmotion from "./AiEmotion.vue"; |
|
|
|
import HistoryRecord from "./components/HistoryRecord.vue"; |
|
|
|
|
|
|
|
// import VConsole from "vconsole"; |
|
|
|
import VConsole from "vconsole"; |
|
|
|
|
|
|
|
// const vConsole = new VConsole(); |
|
|
|
const vConsole = new VConsole(); |
|
|
|
|
|
|
|
const isMobile = ref(null); |
|
|
|
|
|
|
@ -998,6 +998,7 @@ const showCount = async () => { |
|
|
|
]); |
|
|
|
changeLevelList.value = res.data; |
|
|
|
activeLevel.value = changeLevelList.value[0]; |
|
|
|
|
|
|
|
changeRule.value.token = res.data[0].ratio; |
|
|
|
gold.value = res2.data.total; |
|
|
|
|
|
|
@ -1023,11 +1024,13 @@ const changeToken = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const goRecharge = () => { |
|
|
|
console.log("执行前往充值方法"); |
|
|
|
sessionStorage.setItem("rechargeFlag", "1"); |
|
|
|
sessionStorage.setItem("activeLevel", JSON.stringify(activeLevel.value)); |
|
|
|
|
|
|
|
if (isMobile.value) { |
|
|
|
console.log("用户是移动端"); |
|
|
|
// 调用原生方法跳转到首页 |
|
|
|
|
|
|
|
uni.postMessage({ |
|
|
|
data: { |
|
|
|
val: { |
|
|
@ -1048,9 +1051,10 @@ const goRecharge = () => { |
|
|
|
window.parent.location.href = |
|
|
|
"http://121.89.234.155:8807/user/myGold?token=" + |
|
|
|
encodeURIComponent(localStorage.getItem("localToken")) + |
|
|
|
"&where=xiaocaishen&successUrl=https://hwjb.homilychart.com/aixiaocaishen/homePage"; |
|
|
|
// "&where=xiaocaishen&successUrl=https://hwjb.homilychart.com/aixiaocaishen/homePage"; |
|
|
|
"&where=xiaocaishen&successUrl=http://192.168.1.5:3000/aixiaocaishen/homePage"; |
|
|
|
} else { |
|
|
|
window.parent.location.href = |
|
|
|
window.parent.location.href = |
|
|
|
"https://web.homilychart.com/user/myGold?token=" + |
|
|
|
encodeURIComponent(localStorage.getItem("localToken")) + |
|
|
|
"&where=xiaocaishen&successUrl=https://mp.homilychart.com/aixiaocaishen/homePage"; |
|
|
@ -1107,12 +1111,48 @@ onMounted(async () => { |
|
|
|
// 添加原生事件监听器 |
|
|
|
window.addEventListener("resize", throttledJudgeDevice); |
|
|
|
|
|
|
|
window.receiveUniAppMessage = async function (messageData) { |
|
|
|
console.log("收到 uni-app 消息:", messageData); |
|
|
|
|
|
|
|
// 根据消息类型进行不同处理 |
|
|
|
switch (messageData.type) { |
|
|
|
case "paymentSuccess": |
|
|
|
// 处理支付成功消息 |
|
|
|
const [res1, res2] = await Promise.all([ |
|
|
|
godExchangeAPI({ state: 1 }), |
|
|
|
getGoldCoinAPI({ token: String(localStorage.getItem("localToken")) }), |
|
|
|
]); |
|
|
|
gold.value = res2.data.total; |
|
|
|
rechargeDialogVisible.value = false; |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
console.log("未知消息类型:", messageData.type); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
console.log( |
|
|
|
"sessionStorage.getItem('rechargeFlag')", |
|
|
|
sessionStorage.getItem("rechargeFlag") |
|
|
|
); |
|
|
|
console.log( |
|
|
|
"getQueryVariable('successType')", |
|
|
|
getQueryVariable("successType") |
|
|
|
); |
|
|
|
console.log("window.href", window.location.href); |
|
|
|
|
|
|
|
if ( |
|
|
|
sessionStorage.getItem("rechargeFlag") == "1" && |
|
|
|
getQueryVariable("successType") == "success" |
|
|
|
) { |
|
|
|
await godExchangeAPI({ state: 1 }); |
|
|
|
showCount(); |
|
|
|
await showCount(); |
|
|
|
activeLevel.value = |
|
|
|
JSON.parse(sessionStorage.getItem("activeLevel")) || |
|
|
|
changeLevelList.value[0]; |
|
|
|
console.log("activeLevel", activeLevel.value); |
|
|
|
|
|
|
|
sessionStorage.removeItem("activeLevel"); |
|
|
|
sessionStorage.setItem("rechargeFlag", "0"); |
|
|
|
} |
|
|
|
}); |
|
|
@ -1126,6 +1166,8 @@ onUnmounted(() => { |
|
|
|
// 清理AiEmotion页面的高度监听器 |
|
|
|
stopAiEmotionHeightObserver(); |
|
|
|
|
|
|
|
delete window.receiveUniAppMessage; |
|
|
|
|
|
|
|
// 清理图表交互相关的定时器和全局函数 |
|
|
|
if (chartInteractionTimer.value) { |
|
|
|
clearTimeout(chartInteractionTimer.value); |
|
|
|