Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
rcj123456 committed Feb 24, 2022
1 parent b92a163 commit 3b2d2b2
Show file tree
Hide file tree
Showing 5 changed files with 3,115 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/api/loveMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getTian } from '../utils/http'
*/
enum LoveMsgURL {
// 天气
weather = 'https://v0.yiketianqi.com/api?unescape=1&version=v61&appid=43656176&appsecret=I42og6Lm',
weather = 'https://v0.yiketianqi.com/api?unescape=1&version=v61&appid=32934627&appsecret=YWDRPJ6Z',
// 每日简报
dailyBriefing = 'http://api.tianapi.com/bulletin/index',
// 今日头条
Expand Down Expand Up @@ -53,6 +53,7 @@ class API {
async getWeather(city_name: string): Promise<IWeatherResponseProps | null> {
try {
const response = await axios({ url: LoveMsgURL.weather, params: { city: city_name } })
console.log(response, '11111111111111111111111111111111111111111111111111111111111111')
const result = response.data
// 预警天气
if (!result.alarm.alarm_type && !result.alarm_content)
Expand Down
4 changes: 2 additions & 2 deletions src/libs/LoveMsg/goodMorning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ const goodWord = async() => {
console.log('goodWord', template)

wxNotify(template)
}
}
catch (error) {
console.log('goodWord:err', error)
}
}

// 天气信息
const weatherInfo = async() => {
const weather = await API.getWeather('蚌埠')
const weather = await API.getWeather('重庆')
if (weather) {
const lunarInfo = await API.getLunarDate(weather.date)
const oneWord = await API.getOneWord()
Expand Down
2 changes: 0 additions & 2 deletions src/libs/LoveMsg/templates/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const textTemplate = (data: TextTemplateProps) => {

// 添加笑话
if (caiHongpi) {
// text += `
// 彩虹屁:
text += `
${caiHongpi.content}\n`
}
Expand Down
26 changes: 13 additions & 13 deletions src/libs/LoveMsg/templates/textcard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const textCardTemplate = (data: TextCardTemplateProps) => {
win_speed_day,
air,
air_level,
// air_tips,
air_tips,
humidity,
alarm,
lunarInfo,
Expand Down Expand Up @@ -60,18 +60,18 @@ ${win}:${win_speed_day}
}

// 最高温度
if (+tem1 <= 13) {
// if (+tem1 <= 13) {
// description += `
// 哈喽哈喽~这里是来自崽崽的爱心提醒哦:
// 今日最高温度仅为🥶 ${tem1}℃,可冷可冷了~
// 鱼崽崽可要注意保暖哦~\n`
// }

if (air_tips) {
description += `
哈喽哈喽~这里是来自崽崽的爱心提醒哦:
今日最高温度仅为🥶 ${tem1}℃,可冷可冷了~
鱼崽崽可要注意保暖哦~\n`
出行建议:${air_tips}`
}

// if (air_tips) {
// description += `
// 出行建议:${air_tips}`
// }

if (oneWord) {
description += `
${oneWord.hitokoto} 』`
Expand All @@ -88,10 +88,10 @@ ${win}:${win_speed_day}
textcard: {
title,
description,
// url: 'https://api.lovelive.tools/api/SweetNothings',
// url: 'https://v1.jinrishici.com/all.svg',
// url: 'https://api.lovelive.tools/api/SweetNothings',
// url: 'https://v1.jinrishici.com/all.svg',
url: 'https://api.vvhan.com/api/60s', // 60s看世界
btntxt: 'By · 江',
btntxt: '江',
},
}
}
Loading

0 comments on commit 3b2d2b2

Please sign in to comment.