Skip to content

Commit

Permalink
- [x] 挂单图
Browse files Browse the repository at this point in the history
- [x] 人物直达
  • Loading branch information
czy0729 committed Sep 3, 2019
1 parent 0c57f71 commit a495a99
Show file tree
Hide file tree
Showing 18 changed files with 372 additions and 67 deletions.
5 changes: 2 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ios",
"android"
],
"version": "1.0.0",
"version": "0.14.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"splash": {
Expand All @@ -17,8 +17,7 @@
"backgroundColor": "#ffffff"
},
"updates": {
"enabled": false,
"fallbackToCacheTimeout": 0
"enabled": false
},
"assetBundlePatterns": [
"**/*"
Expand Down
14 changes: 13 additions & 1 deletion constants/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-02-21 21:30:44
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-02 16:12:22
* @Last Modified time: 2019-09-03 22:15:34
*/
import { HOST_NAME } from './index'

Expand Down Expand Up @@ -177,6 +177,18 @@ export const API_TINYGRAIL_RAI = (page = 1, limit = TINYGRAIL_LIMIT) =>
export const API_TINYGRAIL_RECENT = (page = 1, limit = TINYGRAIL_LIMIT) =>
`${API_HOST_TINYGRAIL}/api/chara/recent/${page}/${limit}`

/**
* 新番市值
*/
export const API_TINYGRAIL_TNBC = (page = 1, limit = TINYGRAIL_LIMIT) =>
`${API_HOST_TINYGRAIL}/api/chara/tnbc/${page}/${limit}`

/**
* 新番活跃
*/
export const API_TINYGRAIL_NBC = (page = 1, limit = TINYGRAIL_LIMIT) =>
`${API_HOST_TINYGRAIL}/api/chara/nbc/${page}/${limit}`

/**
* 交易记录
* @param {*} monoId
Expand Down
6 changes: 3 additions & 3 deletions constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-02-22 01:25:31
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-01 00:35:35
* @Last Modified time: 2019-09-03 22:26:09
*/
import { Platform } from 'react-native'
import Constants from 'expo-constants'
Expand Down Expand Up @@ -31,9 +31,9 @@ export const GITHUB_URL = 'https://github.com/czy0729/Bangumi'
export const GITHUB_RELEASE_URL = `${GITHUB_URL}/releases`
export const GITHUB_RELEASE_REPOS_URL =
'https://api.github.com/repos/czy0729/Bangumi/releases'
export const GITHUB_RELEASE_VERSION = '1.0.0'
export const GITHUB_RELEASE_VERSION = '0.14.0'
export const CODE_PUSH_VERSION = ''
export const DEV = true
export const DEV = false

// 图片
export const IMG_DEFAULT_AVATAR = '//lain.bgm.tv/pic/user/s/icon.jpg'
Expand Down
2 changes: 1 addition & 1 deletion navigations.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-06-02 14:42:28
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-03 11:17:58
* @Last Modified time: 2019-09-03 22:12:35
*/
export default {
initialRouteName: 'HomeTab', // HomeTab TinygrailOverview TinygrailTrade
Expand Down
4 changes: 3 additions & 1 deletion navigations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-03-29 10:38:12
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-01 13:09:00
* @Last Modified time: 2019-09-03 22:02:13
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
Expand Down Expand Up @@ -36,6 +36,7 @@ import {
Timeline,
Tinygrail,
TinygrailOverview,
TinygrailSearch,
TinygrailTrade,
Topic,
UGCAgree,
Expand Down Expand Up @@ -111,6 +112,7 @@ const HomeStack = createStackNavigator(
Timeline,
Tinygrail,
TinygrailOverview,
TinygrailSearch,
TinygrailTrade,
Topic,
UGCAgree,
Expand Down
3 changes: 2 additions & 1 deletion screens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-04-05 21:04:57
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-01 13:08:37
* @Last Modified time: 2019-09-03 22:02:00
*/
export { default as Anitama } from './anitama'
export { default as Auth } from './auth'
Expand Down Expand Up @@ -35,4 +35,5 @@ export { default as Zone } from './zone'

export { default as Tinygrail } from './tinygrail/index'
export { default as TinygrailOverview } from './tinygrail/overview'
export { default as TinygrailSearch } from './tinygrail/search'
export { default as TinygrailTrade } from './tinygrail/trade'
17 changes: 9 additions & 8 deletions screens/tinygrail/overview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-08-25 19:12:19
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-31 15:29:24
* @Last Modified time: 2019-09-03 21:03:26
*/
import React from 'react'
import { View } from 'react-native'
Expand Down Expand Up @@ -39,9 +39,14 @@ class Tinygrail extends React.Component {

navigation.setParams({
popover: {
data: ['浏览器查看'],
data: ['进入小组', '浏览器查看'],
onSelect: key => {
switch (key) {
case '进入小组':
navigation.push('Group', {
groupId: 'tinygrail'
})
break
case '浏览器查看':
open('https://bgm.tv/rakuen')
break
Expand All @@ -52,12 +57,8 @@ class Tinygrail extends React.Component {
},
extra: (
<IconHeader
name='planet'
onPress={() =>
navigation.push('Group', {
groupId: 'tinygrail'
})
}
name='search'
onPress={() => navigation.push('TinygrailSearch')}
/>
)
})
Expand Down
60 changes: 43 additions & 17 deletions screens/tinygrail/overview/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
* @Author: czy0729
* @Date: 2019-08-25 19:51:55
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-02 21:51:07
* @Last Modified time: 2019-09-03 21:41:15
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
import { observer } from 'mobx-react'
import { Flex, Text, Touchable } from '@components'
import { Avatar, StockPreview } from '@screens/_'
import { open } from '@utils'
import { formatTime } from '@utils/app'
import _ from '@styles'

Expand All @@ -28,7 +29,8 @@ function Item(props, { navigation }) {
end,
marketValue,
total,
users
users,
bonus
} = props
const isTop = index === 0
const isICO = !!users
Expand All @@ -55,27 +57,40 @@ function Item(props, { navigation }) {
return (
<View style={styles.container}>
<Flex align='start'>
<Avatar
style={styles.image}
src={icon}
size={44}
onPress={() =>
navigation.push('Mono', {
monoId: `character/${id}`
})
}
/>
<View>
<Avatar
style={styles.image}
src={icon}
size={44}
onPress={() =>
navigation.push('Mono', {
monoId: `character/${id}`
})
}
/>
{!!bonus && (
<Flex style={styles.bonus} justify='center'>
<Text size={12} type='plain'>
{bonus}
</Text>
</Flex>
)}
</View>
<Flex.Item style={!isTop && styles.border}>
<Flex align='start'>
<Flex.Item style={_.mr.sm}>
<Touchable
style={styles.item}
highlight
onPress={() =>
navigation.push('TinygrailTrade', {
monoId: `character/${id}`
})
}
onPress={() => {
if (users) {
open(`https://bgm.tv/character/${id}`)
} else {
navigation.push('TinygrailTrade', {
monoId: `character/${id}`
})
}
}}
>
<Flex align='start'>
<Flex.Item>
Expand Down Expand Up @@ -120,5 +135,16 @@ const styles = StyleSheet.create({
border: {
borderTopColor: _.colorBorder,
borderTopWidth: StyleSheet.hairlineWidth
},
bonus: {
position: 'absolute',
zIndex: 1,
top: 10,
right: 2,
width: 18,
height: 18,
borderRadius: 9,
backgroundColor: _.colorWarning,
overflow: 'hidden'
}
})
10 changes: 9 additions & 1 deletion screens/tinygrail/overview/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-08-25 19:40:56
* @Last Modified by: czy0729
* @Last Modified time: 2019-08-27 01:05:32
* @Last Modified time: 2019-09-03 22:16:44
*/
import { observable, computed } from 'mobx'
import { tinygrailStore } from '@stores'
Expand All @@ -13,6 +13,14 @@ export const tabs = [
title: '最近活跃',
key: 'recent'
},
{
title: '新番活跃',
key: 'nbc'
},
{
title: '新番市值',
key: 'tnbc'
},
{
title: '最高市值',
key: 'mvc'
Expand Down
65 changes: 65 additions & 0 deletions screens/tinygrail/search/history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* @Author: czy0729
* @Date: 2019-09-03 22:06:19
* @Last Modified by: czy0729
* @Last Modified time: 2019-09-03 22:10:45
*/
import React from 'react'
import { StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
import { Touchable, Flex, Text, Iconfont } from '@components'
import { observer } from '@utils/decorators'
import _ from '@styles'

function History({ style }, { $, navigation }) {
const { history } = $.state
return (
<View style={style}>
{history.map(item => (
<View key={item} style={styles.item}>
<Flex style={styles.content}>
<Flex.Item>
<Text
size={15}
onPress={() =>
navigation.push('TinygrailTrade', {
monoId: item
})
}
>
{$.chara(item).name || item}
</Text>
</Flex.Item>
<Touchable
style={[styles.close, _.ml.md]}
onPress={() => $.deleteHistory(item)}
>
<Iconfont name='close' size={12} />
</Touchable>
</Flex>
</View>
))}
</View>
)
}

History.contextTypes = {
$: PropTypes.object,
navigation: PropTypes.object
}

export default observer(History)

const styles = StyleSheet.create({
item: {
paddingHorizontal: _.wind
},
content: {
paddingVertical: _.sm,
borderBottomWidth: StyleSheet.hairlineWidth,
borderBottomColor: _.colorBorder
},
close: {
padding: _.sm
}
})
Loading

0 comments on commit a495a99

Please sign in to comment.