Skip to content

Commit 51e06d6

Browse files
committed
😠 kao
1 parent 7e64681 commit 51e06d6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
// 配置信息
1010
module.exports = {
1111
fromDisplayText: '小范大人', // 收件箱展示的来件人名字 done
12-
to: ['[email protected]','[email protected]','[email protected]'], // 发送到谁,填邮箱done
12+
to: ['[email protected]', '[email protected]', '[email protected]'], // 发送到谁,填邮箱done
1313
masterAccount: '[email protected]',
1414
location: '101210301',
1515
type: '1,2,3,5,7,9,13,15,16',
1616
startDay: '2022-07-09',
17+
moneyRange: [0, 400],
1718
imgs: [
1819
'https://img1.imgtp.com/2023/03/22/YHtQFzIB.jpg',
1920
'https://img1.imgtp.com/2023/07/12/0cPNJVaH.jpg',

emailHtml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function fn(weatherData, lifeData, word, imgurl, lovingDays) {
5353
</div>
5454
<!-- 每日一句 -->
5555
<div>
56-
<p style="font-size: 14px; text-indent: 2em; font-style: italic;">
56+
<p style="font-size: 16px; font-style: italic;">
5757
${word}
5858
</p>
5959
</div>

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const {
2626
type,
2727
startDay,
2828
imgs,
29+
moneyRange
2930
} = require('./config');
3031

3132
async function init() {
@@ -44,13 +45,18 @@ async function init() {
4445
`https://devapi.qweather.com/v7/indices/1d?key=${wk}&location=${location}&type=${type}`
4546
);
4647
const lifeData = await lifeRes.json();
48+
49+
4750
// // 获取one一个文案及图片
4851
// const oneRes = await fetch(
4952
// `http://api.tianapi.com/txapi/one/index?key=${tianXingKey}`
5053
// );
5154
// const oneData = await oneRes.json();
5255
// const { word, imgurl } = oneData.newslist[0];
53-
const word = "Tips:记得不要吃甜食!不要忘拔插座!";
56+
const money = getRandom(moneyRange[0], moneyRange[1]);
57+
const moneyRate = Math.random();
58+
const word = `【约会基金】:范方出资 ${(money * moneyRate).toFixed(2)} 元,钱方出资 ${(money * (1 - moneyRate)).toFixed(2)} 元,共 ${money} 元。`;
59+
console.log(`🥩 此次约会基金===>[${word}]`)
5460
const img = imgs[getRandom(0, imgs.length - 1)];
5561
console.log(`🍉 此次的图片为[${img}]`)
5662
const temp = await fetch(img);

0 commit comments

Comments
 (0)