Skip to content

Commit 0a653c2

Browse files
committed
feat: add changelog page
1 parent 195df5e commit 0a653c2

File tree

12 files changed

+153
-1
lines changed

12 files changed

+153
-1
lines changed

miniprogram/app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"pages/index/index",
44
"pages/detail/index",
55
"pages/my/index",
6-
"pages/myStarred/index"
6+
"pages/myStarred/index",
7+
"pages/changelog/index",
8+
"pages/changelog/detail"
79
],
810
"window": {
911
"backgroundColor": "#f6f6f6",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import log from './log'
2+
3+
Page({
4+
data: {
5+
item: {},
6+
detail: [],
7+
},
8+
9+
onLoad: function (options) {
10+
if (options.index) {
11+
const item = log[options.index]
12+
this.setData({
13+
item,
14+
index: options.index,
15+
detail: item.detail
16+
})
17+
wx.setNavigationBarTitle({
18+
title: `v${item.version} 更新`
19+
})
20+
}
21+
},
22+
23+
onShareAppMessage: function () {
24+
const { index, item } = this.data
25+
return {
26+
title: `程序员做饭 - v${item.version} 更新`,
27+
path: `/pages/changelog/detail?index=${index}`
28+
}
29+
}
30+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"usingComponents": {}
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<view class="container">
2+
<block wx:for="{{detail}}" wx:key="index" >
3+
<t-cell description="{{item.value}}">
4+
<t-tag theme="{{item.type == 'bug' ? 'danger' : 'primary'}}" variant="light" slot="left-icon">{{item.type}}</t-tag>
5+
</t-cell>
6+
</block>
7+
</view>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/changelog/detail.wxss */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import log from './log'
2+
3+
Page({
4+
data: {
5+
log
6+
},
7+
8+
onLoad: function (options) {
9+
10+
},
11+
12+
onShareAppMessage: function () {
13+
return {
14+
title: '程序员做饭-更新日志',
15+
path: '/pages/changelog/index'
16+
}
17+
}
18+
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"navigationBarTitleText": "更新日志",
3+
"usingComponents": {}
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<view class="container">
2+
<block wx:for="{{log}}" wx:key="index" >
3+
<t-cell title="v{{item.version}} 更新" url="./detail?index={{index}}" description="{{item.date}}" hover arrow />
4+
</block>
5+
</view>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/changelog/index.wxss */

miniprogram/pages/changelog/log.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
export default [{
2+
version: '0.3.1',
3+
detail: [{
4+
type: 'feature',
5+
value: '详情页:增加广告开关提醒'
6+
},{
7+
type: 'feature',
8+
value: '个人中心:增加更新日志'
9+
}],
10+
date: '2022-03-11'
11+
},{
12+
version: '0.3.0',
13+
detail: [{
14+
type: 'feature',
15+
value: '增加广告(用于实验)'
16+
},{
17+
type: 'feature',
18+
value: '个人中心:增加广告开关'
19+
}],
20+
date: '2022-03-11'
21+
}, {
22+
version: '0.2.1',
23+
detail: [{
24+
type: 'feature',
25+
value: '增加版本更新机制'
26+
},{
27+
type: 'bug',
28+
value: '修复按钮中图标没对齐的问题'
29+
}],
30+
date: '2022-03-10'
31+
}, {
32+
version: '0.2.0',
33+
detail: [{
34+
type: 'feature',
35+
value: '支持点赞、收藏'
36+
}, {
37+
type: 'feature',
38+
value: '个人中心:支持打开我的收藏'
39+
}],
40+
date: '2022-03-08'
41+
}, {
42+
version: '0.1.3',
43+
detail: [{
44+
type: 'feature',
45+
value: '详情页:优化 UI'
46+
}, {
47+
type: 'feature',
48+
value: '个人中心:新增当前版本信息'
49+
}, {
50+
type: 'feature',
51+
value: '个人中心:支持跳转 TDesign 组件库小程序'
52+
}, {
53+
type: 'bug',
54+
value: '修复偶尔无法触发倒计时的问题'
55+
}],
56+
date: '2022-03-06'
57+
}, {
58+
version: '0.1.2',
59+
detail: [{
60+
type: 'feature',
61+
value: '详情页:优化倒计时样式'
62+
}],
63+
date: '2022-03-05'
64+
}, {
65+
version: '0.1.0',
66+
detail: [{
67+
type: 'feature',
68+
value: '首发版本 🎉'
69+
}],
70+
date: '2022-03-05'
71+
}]

0 commit comments

Comments
 (0)