光照模块

This commit is contained in:
2025-11-28 14:32:01 +08:00
parent 5c1d299483
commit 39b73bcad8
2 changed files with 27 additions and 21 deletions

View File

@ -255,6 +255,8 @@ onMounted(() => {
if (window.sunshine) { if (window.sunshine) {
let data = JSON.parse(localStorage.getItem('shineSetting')) let data = JSON.parse(localStorage.getItem('shineSetting'))
// weatherData.currWeather = data.currWeather // weatherData.currWeather = data.currWeather
if (data) {
//判断是否有数据
//是否是实时光照 //是否是实时光照
if (!data?.currWeather) { if (!data?.currWeather) {
weatherData.time = data.time weatherData.time = data.time
@ -265,6 +267,7 @@ onMounted(() => {
data?.wearther.forEach((item, index) => { data?.wearther.forEach((item, index) => {
list[index].status = item.status list[index].status = item.status
}) })
}
// list = data.wearther // list = data.wearther
switchStatus.value = true switchStatus.value = true
sunshine = window.sunshine sunshine = window.sunshine
@ -278,7 +281,7 @@ onMounted(() => {
// sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 }) // sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 })
timeline.moveComplay((item) => { timeline.moveComplay((item) => {
weatherData.currWeather = false weatherData.currWeather = false
sunshine.timeBar = item sunshine && (sunshine.timeBar = item)
}) })
// timeline.setTime(myData) // timeline.setTime(myData)
@ -561,8 +564,11 @@ var shadowChange = () => {
width: 250px; width: 250px;
height: auto; height: auto;
z-index: 30; z-index: 30;
background: background: linear-gradient(
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%), 180deg,
rgba(var(--color-base1), 0) 0%,
rgba(var(--color-base1), 0.2) 100%
),
rgba(0, 0, 0, 0.6); rgba(0, 0, 0, 0.6);
padding: 10px; padding: 10px;
border: 1.5px solid rgba(var(--color-base1), 1); border: 1.5px solid rgba(var(--color-base1), 1);

View File

@ -46,14 +46,14 @@ export default class TimeLine {
that.timeline.addEventListener('mousedown', (e) => { that.timeline.addEventListener('mousedown', (e) => {
if (e.srcElement.className === 'handle') { if (e.srcElement.className === 'handle') {
if (!that.sunShine) { // if (!that.sunShine) {
ElMessage({ // ElMessage({
message: '请开启光照功能', // message: '请开启光照功能',
type: 'warning' // type: 'warning'
}) // })
} else { // } else {
that.isDragging = true; that.isDragging = true;
} // }
} }
e.preventDefault(); e.preventDefault();
}); });
@ -88,7 +88,7 @@ export default class TimeLine {
that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false) that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false)
//判断当没有开启光照时,点击停止播放时关闭实时光照按钮 //判断当没有开启光照时,点击停止播放时关闭实时光照按钮
if (document.getElementById('weatherSwitch').style.color == 'rgb(255, 255, 255)') { if (document.getElementById('weatherSwitch').style.color == 'rgba(var(--color-base1), 1)') {
callback(false) callback(false)
} }
} else {//播放 } else {//播放