Skip to content

Commit

Permalink
- [x] [条目] 章节热度图
Browse files Browse the repository at this point in the history
- [x] iOS取消更新提示
  • Loading branch information
czy0729 committed Aug 30, 2019
1 parent 974a39b commit 79ea82f
Show file tree
Hide file tree
Showing 30 changed files with 276 additions and 188 deletions.
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
node_modules
node_modules33
node_modules34
package33.json
package34.json
.vscode
.expo
.expo-shared
yarn.lock
bangumi.jks
KEYSTORE.MD
yarn.lock
bangumi.mobileprovision
ApplePushServices.p12
iPhoneDistribution.p12
5 changes: 3 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ios",
"android"
],
"version": "0.13.1",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"splash": {
Expand All @@ -24,7 +24,8 @@
"**/*"
],
"ios": {
"supportsTablet": true
"bundleIdentifier": "com.czy0729.bangumi",
"supportsTablet": false
},
"android": {
"package": "com.czy0729.bangumi"
Expand Down
Binary file modified assets/images/icon.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions components/bgm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-06-16 04:41:39
* @Last Modified by: czy0729
* @Last Modified time: 2019-06-22 14:03:14
* @Last Modified time: 2019-08-30 18:08:38
*/
import React from 'react'
import Image from './image'
Expand Down Expand Up @@ -111,15 +111,17 @@ export const bgm = {
100: require('@bgm/100.gif')
}

const Bgm = ({ index, size, ...other }) => (
<Image
src={bgm[index]}
resizeMode='contain'
size={size}
placeholder={false}
{...other}
/>
)
function Bgm({ index, size, ...other }) {
return (
<Image
src={bgm[index]}
resizeMode='contain'
size={size}
placeholder={false}
{...other}
/>
)
}

Bgm.defaultProps = {
index: 1,
Expand Down
4 changes: 2 additions & 2 deletions components/blur-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @Author: czy0729
* @Date: 2019-03-14 15:38:50
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-20 20:18:37
* @Last Modified time: 2019-08-30 18:08:56
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
Expand All @@ -20,7 +20,7 @@ const backgroundColor = {
xlight: ['rgba(255, 255, 255, 0.64)', 'rgba(255, 255, 255, 0.8)']
}

const BlurView = ({ style, src, theme, intensity, children }) => {
function BlurView({ style, src, theme, intensity, children }) {
if (!src) {
return null
}
Expand Down
6 changes: 3 additions & 3 deletions components/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-03-15 02:32:29
* @Last Modified by: czy0729
* @Last Modified time: 2019-06-22 14:14:42
* @Last Modified time: 2019-08-30 18:09:04
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
Expand All @@ -15,7 +15,7 @@ import Flex from './flex'
import Text from './text'
import Touchable from './touchable'

const Button = ({
function Button({
style,
type,
size,
Expand All @@ -25,7 +25,7 @@ const Button = ({
children,
onPress,
...other
}) => {
}) {
const _wrap = [styles.button]
const _text = [styles.text]

Expand Down
22 changes: 12 additions & 10 deletions components/divider.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
* @Author: czy0729
* @Date: 2019-03-29 03:42:01
* @Last Modified by: czy0729
* @Last Modified time: 2019-06-22 14:15:00
* @Last Modified time: 2019-08-30 18:09:18
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
import _ from '@styles'
import Flex from './flex'
import Text from './text'

const Divider = ({ style }) => (
<Flex style={[styles.divider, style]}>
<View style={styles.line} />
<Text style={styles.text} type='border' size={20}>
/ / /
</Text>
<View style={styles.line} />
</Flex>
)
function Divider({ style }) {
return (
<Flex style={[styles.divider, style]}>
<View style={styles.line} />
<Text style={styles.text} type='border' size={20}>
/ / /
</Text>
<View style={styles.line} />
</Flex>
)
}

Divider.defaultProps = {
style: undefined
Expand Down
4 changes: 2 additions & 2 deletions components/header-placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
* @Author: czy0729
* @Date: 2019-04-28 17:04:04
* @Last Modified by: czy0729
* @Last Modified time: 2019-06-22 14:15:33
* @Last Modified time: 2019-08-30 18:09:33
*/
import React from 'react'
import { View } from 'react-native'
import _ from '@styles'

const HeaderPlaceholder = ({ style, tabs }) => {
function HeaderPlaceholder({ style, tabs }) {
let height = _.headerHeight
if (tabs) {
height += _.tabsHeight
Expand Down
34 changes: 18 additions & 16 deletions components/icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@
* @Author: czy0729
* @Date: 2019-03-15 08:20:56
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-20 20:19:15
* @Last Modified time: 2019-08-30 18:09:45
*/
import React from 'react'
import * as ExpoIcon from '@expo/vector-icons'

const Icon = ({ style, name, size, color, ...other }) => (
<ExpoIcon.Ionicons
style={[
{
height: size,
lineHeight: size
},
style
]}
name={name}
size={size}
color={color}
{...other}
/>
)
function Icon({ style, name, size, color, ...other }) {
return (
<ExpoIcon.Ionicons
style={[
{
height: size,
lineHeight: size
},
style
]}
name={name}
size={size}
color={color}
{...other}
/>
)
}

Icon.defaultProps = {
style: undefined,
Expand Down
34 changes: 18 additions & 16 deletions components/iconfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
* @Author: czy0729
* @Date: 2019-05-07 14:28:43
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-20 20:19:22
* @Last Modified time: 2019-08-30 18:09:57
*/
import React from 'react'
import * as Icon from '@expo/vector-icons'
import { colorIcon } from '@styles'

const Iconfont = ({ style, name, size, color, ...other }) => (
<Icon.AntDesign
style={[
{
height: size,
lineHeight: size
},
style
]}
name={`icon-${name}`}
size={size}
color={color}
{...other}
/>
)
function Iconfont({ style, name, size, color, ...other }) {
return (
<Icon.AntDesign
style={[
{
height: size,
lineHeight: size
},
style
]}
name={`icon-${name}`}
size={size}
color={color}
{...other}
/>
)
}

Iconfont.defaultProps = {
style: undefined,
Expand Down
13 changes: 12 additions & 1 deletion components/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @Author: czy0729
* @Date: 2019-03-15 06:17:18
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-27 17:09:01
* @Last Modified time: 2019-08-30 23:17:27
*/
import React from 'react'
import { StyleSheet, View, Image as RNImage } from 'react-native'
Expand Down Expand Up @@ -108,6 +108,11 @@ export default class Image extends React.Component {
}
_src = this.getQuality(_src, qualityLevel)

// 空地址不作处理
if (_src === 'https:') {
return false
}

// 检查本地有没有图片缓存
// @issue 这个地方没判断同时一个页面有相同图片, 同时检测本地地址的会触发unmounted
res = CacheManager.get(_src).getPath()
Expand Down Expand Up @@ -141,6 +146,12 @@ export default class Image extends React.Component {
uri = `https:${uri}`
}
}

// 空地址不作处理
if (uri === 'https:') {
return false
}

this.setState({
uri
})
Expand Down
86 changes: 44 additions & 42 deletions components/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,61 @@
* @Author: czy0729
* @Date: 2019-04-06 06:57:49
* @Last Modified by: czy0729
* @Last Modified time: 2019-06-22 14:20:36
* @Last Modified time: 2019-08-30 18:10:26
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
import _ from '@styles'
import Text from './text'
import Touchable from './touchable'

const Menu = ({ style, title, data, onSelect }) => (
<View style={[styles.container, style]}>
{title.length !== 0 && (
<View style={styles.title}>
{title.map((item, index) => (
<Text
key={item}
style={index !== 0 && _.mt.sm}
type='sub'
size={12}
align='center'
>
{item}
</Text>
))}
</View>
)}
{data.map((item, index) => {
if (typeof item === 'string') {
function Menu({ style, title, data, onSelect }) {
return (
<View style={[styles.container, style]}>
{title.length !== 0 && (
<View style={styles.title}>
{title.map((item, index) => (
<Text
key={item}
style={index !== 0 && _.mt.sm}
type='sub'
size={12}
align='center'
>
{item}
</Text>
))}
</View>
)}
{data.map((item, index) => {
if (typeof item === 'string') {
return (
<View key={item} style={_.border.top}>
<Touchable style={styles.item} onPress={() => onSelect(item)}>
<Text size={16} align='center'>
{item}
</Text>
</Touchable>
</View>
)
}

if (item.type === 'divider') {
// eslint-disable-next-line react/no-array-index-key
return <View key={index} style={styles.divider} />
}

return (
<View key={item} style={_.border.top}>
<Touchable style={styles.item} onPress={() => onSelect(item)}>
<Text size={16} align='center'>
{item}
</Text>
<View key={item.title} style={_.border.top}>
<Touchable style={styles.item} onPress={() => onSelect(item.title)}>
{item.title}
</Touchable>
</View>
)
}

if (item.type === 'divider') {
// eslint-disable-next-line react/no-array-index-key
return <View key={index} style={styles.divider} />
}

return (
<View key={item.title} style={_.border.top}>
<Touchable style={styles.item} onPress={() => onSelect(item.title)}>
{item.title}
</Touchable>
</View>
)
})}
</View>
)
})}
</View>
)
}

Menu.defaultProps = {
style: undefined,
Expand Down
Loading

0 comments on commit 79ea82f

Please sign in to comment.