Skip to content

Commit ddbd118

Browse files
committed
- [x] [超展开] 回复功能
- [x] [章节] 回复功能 - [x] [人物] 回复功能
1 parent 4e592a6 commit ddbd118

File tree

20 files changed

+440
-202
lines changed

20 files changed

+440
-202
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
* @Author: czy0729
33
* @Date: 2019-03-13 05:15:36
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-05-16 01:54:02
5+
* @Last Modified time: 2019-06-17 12:01:10
66
*/
77
module.exports = {
88
root: true,
99
globals: {
1010
require: true,
11+
XMLHttpRequest: true,
1112
fetch: true, // react-native的fetch
1213
log: true // 测试打印函数, 能规避循环引用
1314
},

README.MD

+24-18
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,32 @@
2828

2929
#### Todo 下个版本预定功能
3030

31-
v0.6-alpha
32-
33-
- [x] Expo 升级到了 SDK 33.0, 图片加载貌似会快点
34-
- [x] [首页收藏] 书籍类显示加入 Vol、Chap
35-
- [x] [条目] 书籍可以管理 Vol、Chap
36-
- [x] [条目] 书籍单行本列表
37-
- [x] [条目] 书籍喜欢 XXX 的会员大概会喜欢
38-
- [x] [标签条目] 页面
39-
- [ ] [超展开] 回复功能(不带表情)
40-
- [ ] [章节] 回复功能(不带表情)
41-
- [ ] [人物] 回复功能(不带表情)
31+
已知问题
32+
- [ ] 楼层内容某些情况偏移
33+
- [ ] 复杂的楼层内容显示不全
34+
- [ ] IOS端不能回复, 可能要用新方法获取和管理cookie
35+
36+
v0.x
37+
- [ ] [登陆] 不使用webview, 尝试新的方式登陆
38+
- [ ] [条目] 尝试播放外源视频, 比如柠萌
4239
- [ ] [用户] 同步率
43-
- [ ] [用户] 关于 TA
40+
- [ ] [用户] 关于TA
4441
- [ ] [每日放送] 添加播放时间
4542
- [ ] [索引] 页面
4643
- [ ] [目录] 页面
44+
45+
v0.6
46+
- [x] Expo 升级到了 SDK 33.0, 图片加载貌似会快点
47+
- [x] [首页收藏] 书籍类显示加入Vol、Chap
48+
- [x] [条目] 书籍可以管理Vol、Chap
49+
- [x] [条目] 书籍单行本列表
50+
- [x] [条目] 书籍喜欢XXX的会员大概会喜欢
51+
- [x] [标签条目] 页面
52+
- [x] [超展开] 回复功能
53+
- [x] [章节] 回复功能
54+
- [x] [人物] 回复功能
4755
- [x] 加入了春菜骚话
48-
- [ ] 输入时键盘位置占位
56+
- [x] 输入时键盘位置占位
4957

5058
---
5159

@@ -83,10 +91,7 @@ npm config set registry https://registry.npmjs.org
8391
```bash
8492
git clone https://github.com/czy0729/Bangumi
8593
cd ./Bangumi
86-
yarn // or npm i
87-
88-
// SDK 33.0 第一次可能还要
89-
expo install @expo/vector-icons expo-blur expo-constants expo-file-system
94+
npm install // or yarn 因为后全面会替换掉node_modules的icon, 使用yarn可能会出现回退的现象
9095
```
9196

9297
** 前置操作 **
@@ -97,10 +102,11 @@ expo install @expo/vector-icons expo-blur expo-constants expo-file-system
97102

98103
```bash
99104
npm start
100-
Run on iOS simulator
105+
// 之后点击在浏览器打开的Expo Developer Tools, 点击 Run on iOS simulator
101106
```
102107

103108
window 用法不详, 可以查阅 [Expo](https://github.com/expo/expo) 官方文档
109+
可以选择同一局域网真机扫码调试, 需先下载Expo App
104110

105111
---
106112

app.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
"description": "A React Native App for https://bangumi.tv ",
3232
"githubUrl": "https://github.com/czy0729/Bangumi"
3333
}
34-
}
34+
}

components/fixed-textarea.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: czy0729
33
* @Date: 2019-06-10 22:24:08
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-06-16 17:20:01
5+
* @Last Modified time: 2019-06-17 22:53:07
66
*/
77
import React from 'react'
88
import { StyleSheet, ScrollView, View } from 'react-native'
@@ -22,6 +22,8 @@ const maxHistoryCount = 7
2222
export default class FixedTextarea extends React.Component {
2323
static defaultProps = {
2424
value: '',
25+
placeholder: '',
26+
onClose: Function.prototype,
2527
onSubmit: Function.prototype // value => {}
2628
}
2729

@@ -78,6 +80,9 @@ export default class FixedTextarea extends React.Component {
7880
}
7981

8082
onBlur = () => {
83+
const { onClose } = this.props
84+
onClose()
85+
8186
this.setState({
8287
showTextarea: false,
8388
showBgm: false,
@@ -143,6 +148,9 @@ export default class FixedTextarea extends React.Component {
143148
}
144149

145150
clear = () => {
151+
const { onClose } = this.props
152+
onClose()
153+
146154
this.setState({
147155
value: '',
148156
showTextarea: false
@@ -264,6 +272,7 @@ export default class FixedTextarea extends React.Component {
264272
}
265273

266274
renderTextarea() {
275+
const { placeholder } = this.props
267276
const { value, showTextarea, showBgm } = this.state
268277
const canSend = value !== ''
269278
return (
@@ -274,7 +283,7 @@ export default class FixedTextarea extends React.Component {
274283
ref={ref => (this.ref = ref)}
275284
style={styles.textarea}
276285
value={value}
277-
placeholder='不吐槽一下吗'
286+
placeholder={placeholder || '不吐槽一下吗'}
278287
rows={showTextarea || showBgm ? 6 : 1}
279288
selectionColor={_.colorMain}
280289
clear
@@ -310,9 +319,10 @@ export default class FixedTextarea extends React.Component {
310319
常用
311320
</Text>
312321
<Flex wrap='wrap'>
313-
{history.map(item => (
322+
{history.map((item, index) => (
314323
<Touchable
315-
key={item}
324+
// eslint-disable-next-line react/no-array-index-key
325+
key={index}
316326
style={styles.bgm}
317327
onPress={() => this.onSelectBgm(item)}
318328
>

components/render-html.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @Author: czy0729
55
* @Date: 2019-04-29 19:54:57
66
* @Last Modified by: czy0729
7-
* @Last Modified time: 2019-06-17 01:10:05
7+
* @Last Modified time: 2019-06-17 14:19:06
88
*/
99
import React from 'react'
1010
import { StyleSheet, View, Image as RNImage, Text } from 'react-native'
@@ -107,13 +107,13 @@ export default class RenderHtml extends React.Component {
107107
// bgm表情, 表情调用本地资源
108108
if (alt.indexOf('(bgm') !== -1) {
109109
const index = parseInt(alt.replace(/\(bgm|\)/g, '')) - 23 // 偏移量
110-
props.source =
111-
parseInt(index) <= 100 ? bgm[index] : { uri: `${HOST}/${src}` }
112110
props.style = {
113111
width: 20,
114-
height: 20,
115-
resizeMode: 'contain'
112+
height: 20
116113
}
114+
props.source =
115+
parseInt(index) <= 100 ? bgm[index] : { uri: `${HOST}/${src}` }
116+
props.resizeMode = 'stretch'
117117

118118
// 当后面还有连续表情的时候
119119
if (this.continuousBgmImagesCount) {
@@ -245,10 +245,12 @@ export default class RenderHtml extends React.Component {
245245
// })
246246
// }
247247

248+
// 鬼知道CDN那边加了什么
249+
const _html = html.replace(/data-cfsrc=/g, 'src=')
248250
return (
249251
<View style={style}>
250252
<HTML
251-
html={html}
253+
html={_html}
252254
baseFontStyle={baseFontStyle}
253255
onLinkPress={this.onLinkPress}
254256
{...this.generateConfig(imagesMaxWidth, baseFontStyle)}

constants/html.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: czy0729
44
* @Date: 2019-04-12 22:58:20
55
* @Last Modified by: czy0729
6-
* @Last Modified time: 2019-06-16 21:57:58
6+
* @Last Modified time: 2019-06-18 00:11:30
77
*/
88
import { MODEL_TIMELINE_SCOPE } from '@constants/model'
99
import { urlStringify } from '@utils'
@@ -138,7 +138,7 @@ export const HTML_USER_COLLECTIONS = (
138138
/**
139139
* 回复帖子
140140
* @param {*} topicId 351116
141-
* @param {*} type group/topic | subject/topic | subject/ep | person
141+
* @param {*} type group/topic | subject/topic | subject/ep | person | character
142142
* ---------- config ----------
143143
* @param {*} content (bgm38) 来一个38
144144
* @param {*} related_photo 0

constants/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: czy0729
44
* @Date: 2019-02-22 01:25:31
55
* @Last Modified by: czy0729
6-
* @Last Modified time: 2019-06-14 21:09:55
6+
* @Last Modified time: 2019-06-18 01:11:33
77
*/
88
import { Platform } from 'react-native'
99
import Constants from 'expo-constants'
@@ -30,7 +30,7 @@ export const GITHUB_URL = 'https://github.com/czy0729/Bangumi'
3030
export const GITHUB_RELEASE_URL = `${GITHUB_URL}/releases`
3131
export const GITHUB_RELEASE_REPOS_URL =
3232
'https://api.github.com/repos/czy0729/Bangumi/releases'
33-
export const GITHUB_RELEASE_VERSION = '0.5-alpha' // since 20190602
33+
export const GITHUB_RELEASE_VERSION = '0.6-alpha' // since 20190618
3434

3535
// 图片
3636
// 白

navigations.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* @Author: czy0729
33
* @Date: 2019-06-02 14:42:28
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-06-16 19:55:15
5+
* @Last Modified time: 2019-06-18 00:35:07
66
*/
77
export default {
8-
initialRouteName: 'HomeTab', // HomeTab
9-
initialRouteParams: {
10-
subjectId: 18007, // 238923 100444 204135
11-
topicId: 'group/350926', // ep/768491
12-
userId: 419012,
13-
monoId: 'character/7454', // character/70323 person/5745
14-
type: 'anime',
15-
tag: '水树奈奈'
16-
}
8+
initialRouteName: 'HomeTab' // HomeTab
9+
// initialRouteParams: {
10+
// subjectId: 18007, // 238923 100444 204135
11+
// topicId: 'group/346386', // ep/768491
12+
// userId: 419012,
13+
// monoId: 'character/7454', // character/70323 person/5745
14+
// type: 'anime',
15+
// tag: '水树奈奈'
16+
// }
1717
}

navigations/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: czy0729
33
* @Date: 2019-03-29 10:38:12
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-06-16 20:16:47
5+
* @Last Modified time: 2019-06-17 01:41:51
66
*/
77
import React from 'react'
88
import { StyleSheet, View } from 'react-native'
@@ -45,7 +45,7 @@ const HomeTab = createBottomTabNavigator(
4545
Rakuen
4646
},
4747
{
48-
initialRouteName: 'Rakuen',
48+
initialRouteName: 'Home',
4949
tabBarComponent: props => {
5050
if (IOS) {
5151
return (

navigations/stacks/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* @Author: czy0729
33
* @Date: 2019-04-24 18:50:55
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-06-17 00:33:26
5+
* @Last Modified time: 2019-06-17 09:48:15
66
*/
77
import { StyleSheet, Platform } from 'react-native'
8+
import StackViewStyleInterpolator from '@components/@react-navigation-stack/StackViewStyleInterpolator'
89
import { IOS } from '@constants'
910
import { wind, colorTitle, colorBorder } from '@styles'
10-
import StackViewStyleInterpolator from './StackViewStyleInterpolator'
1111

1212
const config = {
1313
headerMode: 'screen',

screens/mono/info.js

+26-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: czy0729
33
* @Date: 2019-05-11 17:19:56
44
* @Last Modified by: czy0729
5-
* @Last Modified time: 2019-06-03 01:00:07
5+
* @Last Modified time: 2019-06-18 00:34:38
66
*/
77
import React from 'react'
88
import { StyleSheet, View } from 'react-native'
@@ -14,7 +14,9 @@ import {
1414
Image,
1515
HeaderPlaceholder,
1616
RenderHtml,
17-
Divider
17+
Divider,
18+
Touchable,
19+
Iconfont
1820
} from '@components'
1921
import { SectionTitle } from '@screens/_'
2022
import { IOS } from '@constants'
@@ -25,9 +27,9 @@ import Jobs from './jobs'
2527

2628
const maxSize = _.window.width - _.wind * 2
2729

28-
const Info = (props, { $ }) => {
30+
const Info = (props, { $, navigation }) => {
2931
const { name, nameCn, cover, info, detail } = $.mono
30-
const { _name, _image } = $.params
32+
const { monoId, _name, _image } = $.params
3133
return (
3234
<>
3335
{!IOS && <HeaderPlaceholder />}
@@ -59,15 +61,33 @@ const Info = (props, { $ }) => {
5961
<Voice style={_.mt.md} />
6062
<Works style={_.mt.md} />
6163
<Jobs style={_.mt.md} />
62-
<SectionTitle style={[styles.title, _.mt.lg, _.mb.md]}>
64+
<SectionTitle
65+
style={[styles.title, _.mt.lg, _.mb.md]}
66+
right={
67+
<Touchable
68+
onPress={() => {
69+
const type = monoId.includes('character/') ? 'crt' : 'prsn'
70+
navigation.push('Topic', {
71+
topicId: `${type}/${monoId.match(/\d+/g)[0]}`
72+
})
73+
}}
74+
>
75+
<Flex>
76+
<Text type='sub'>去吐槽</Text>
77+
<Iconfont name='right' size={16} />
78+
</Flex>
79+
</Touchable>
80+
}
81+
>
6382
吐槽箱
6483
</SectionTitle>
6584
</>
6685
)
6786
}
6887

6988
Info.contextTypes = {
70-
$: PropTypes.object
89+
$: PropTypes.object,
90+
navigation: PropTypes.object
7191
}
7292

7393
export default observer(Info)

0 commit comments

Comments
 (0)