This commit is contained in:
Paidax
2025-11-11 11:33:43 +08:00
parent 51a417ea20
commit dea071e25f
31 changed files with 348 additions and 110 deletions
@@ -2,9 +2,9 @@ const jcdt = {
template: /*language=HTML*/ `
<div class="jcdt-wrapper">
<div class="jcdt-container">
<div class="jcdt-title">
<span>基层动态</span>
</div>
<!-- <div class="jcdt-title">-->
<!-- <span>基层动态</span>-->
<!-- </div> -->
<div class="jcdt-content">
<div class="jcdt-list">
<div class="jcdt-item" v-for="item in list" :key="item.title" @click="onLink(item)">
@@ -48,6 +48,12 @@ const jcdt = {
width: 80%;
max-width: 80%;
margin: 0 auto;
background-color: #FFFFFF;
border-radius: 12px;
padding: 20px;
margin-bottom: 10px;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.jcdt-title{
@@ -97,6 +103,8 @@ const jcdt = {
transition: all 0.3s ease;
cursor: pointer;
height: auto;
border-radius: 12px;
}
.jcdt-item:hover{
@@ -133,67 +133,6 @@ const user = {
};
},
methods: {
getWeatherEmoji(iconCode) {
// 在 data 或 methods 外部定义(或作为 computed
const WEATHER_ICON_EMOJI = {
'100': '☀️', // 晴
'101': '⛅', // 多云
'102': '🌤️', // 少云
'103': '🌥️', // 晴间多云
'104': '☁️', // 阴
'300': '🌦️', // 阵雨
'301': '🌧️', // 强阵雨
'302': '⛈️', // 雷阵雨
'303': '⛈️', // 强雷阵雨
'304': '⛈️', // 雷阵雨伴有冰雹
'305': '🌧️', // 小雨
'306': '🌧️', // 中雨
'307': '暴雨', // 暴雨及以上可用文字
'308': '🌧️',
'309': '🌧️',
'310': '🌧️',
'311': '🌨️', // 雨夹雪
'312': '🌨️',
'313': '🌨️',
'314': '🌨️',
'315': '🌨️',
'316': '🌨️',
'317': '🌨️',
'318': '🌨️',
'399': '🌧️', // 阵雨(其他)
'400': '🌨️', // 小雪
'401': '🌨️', // 中雪
'402': '❄️', // 大雪
'403': '❄️', // 暴雪
'404': '🌫️', // 雾
'405': '🌫️', // 冻雾
'406': '🌫️', // 强浓雾
'407': '🌫️', // 霾
'408': '🌫️', // 浮尘
'409': '🌫️', // 扬沙
'410': '🌫️', // 沙尘暴
'499': '🌫️',
'500': '🌪️', // 龙卷风
'501': '🌀', // 飓风
'502': '🌫️', // 热带风暴
'503': '🌫️', // 热带低压
'504': '🌫️', // 台风
'507': '🌫️', // 雾凇
'508': '🌫️', // 冰粒
'509': '🌫️', // 米雪
'510': '🌫️', // 雨凇
'511': '🌫️', // 冰雹
'512': '🌫️', // 尘卷风
'513': '🌫️', // 沙尘
'514': '🌫️', // 浓积云
'515': '🌫️', // 积雨云
'900': '❓', // 未知
'901': '🌫️', // 热
'902': '❄️', // 冷
'999': '❓'
};
return WEATHER_ICON_EMOJI[iconCode] || '🌤️';
},
getWeatherInfo(iconCode, temp) {
const info = {
emoji: '🌤️',
@@ -250,8 +189,8 @@ const user = {
async fetchWeather() {
try {
// 存localStorage 112.13,32.01 广州 113.27,23.14
const AppMapCenterPointX = '113.27'
const AppMapCenterPointY = '23.14'
const AppMapCenterPointX = await this.getConfigKey("AppMapCenterPointX")
const AppMapCenterPointY = await this.getConfigKey("AppMapCenterPointY")
// 1. 先通过城市名获取 locationId
this.$axios.get("https://mx5rk62kvj.re.qweatherapi.com/geo/v2/city/lookup?location=" + AppMapCenterPointX + "," + AppMapCenterPointY + "&key=" + this.QWEATHER_KEY).then((geoRes) => {
@@ -331,7 +270,7 @@ const user = {
this.getRoleNames()
},
mounted() {
// this.fetchWeather();
this.fetchWeather()
},
style: /*language=CSS*/ `
.user-wrapper {