Skip to content

Commit

Permalink
- 暂时手动录入2023S2季度新番放送数据
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Apr 5, 2023
1 parent 6775e52 commit ac3b972
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 35 deletions.
44 changes: 23 additions & 21 deletions src/screens/_/base/eps/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2022-09-03 17:28:48
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-29 06:41:49
* @Last Modified time: 2023-04-06 05:26:23
*/
import React from 'react'
import { View } from 'react-native'
Expand Down Expand Up @@ -84,26 +84,28 @@ export default memo(
return (
<View style={containerStyle}>
{flip && <View style={styles.flip} />}
<Popover style={style} {...popoverProps}>
{flip ? (
<FlipButton {...btnPassProps} text={item.sort} onAnimated={onFliped} />
) : (
<Button {...btnPassProps} size='sm' animate={false}>
{item.sort}
</Button>
)}
{heatMap && (
<View
style={[
styles.bar,
{
/** 1.68 是比率, 增大少回复与高回复的透明度幅度 */
opacity: (item.comment - min / 1.68) / max
}
]}
/>
)}
</Popover>
<View style={style}>
<Popover {...popoverProps}>
{flip ? (
<FlipButton {...btnPassProps} text={item.sort} onAnimated={onFliped} />
) : (
<Button {...btnPassProps} size='sm' animate={false}>
{item.sort}
</Button>
)}
{heatMap && (
<View
style={[
styles.bar,
{
/** 1.68 是比率, 增大少回复与高回复的透明度幅度 */
opacity: (item.comment - min / 1.68) / max
}
]}
/>
)}
</Popover>
</View>
</View>
)
},
Expand Down
2 changes: 1 addition & 1 deletion src/screens/discovery/calendar/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-03-22 08:49:20
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-28 16:17:47
* @Last Modified time: 2023-04-06 05:36:20
*/
import { observable, computed } from 'mobx'
import bangumiData from '@assets/json/thirdParty/bangumiData.min.json'
Expand Down
5 changes: 3 additions & 2 deletions src/screens/discovery/index/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-03-22 08:49:20
* @Last Modified by: czy0729
* @Last Modified time: 2022-10-30 21:13:51
* @Last Modified time: 2023-04-06 06:30:25
*/
import { observable, computed } from 'mobx'
import {
Expand All @@ -12,6 +12,7 @@ import {
discoveryStore,
usersStore
} from '@stores'
import { ON_AIR } from '@stores/calendar/onair'
import {
date,
getTimestamp,
Expand Down Expand Up @@ -134,7 +135,7 @@ export default class ScreenDiscovery extends store {
...item,
items: item.items
.map(i => {
const { air = 0, timeCN, timeJP } = this.onAir[i.id] || {}
const { air = 0, timeCN, timeJP } = this.onAir[i.id] || ON_AIR[i.id] || {}
return {
...i,
air,
Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/v2/list/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { memoStyles } from './styles'

export const DEFAULT_PROPS = {
styles: {} as ReturnType<typeof memoStyles>,
connectRef: (() => {}) as (ref: any) => ReturnType<StoreType['connectRef']>,
forwardRef: (() => {}) as (ref: any) => ReturnType<StoreType['forwardRef']>,
data: LIST_EMPTY as ReturnType<StoreType['currentCollection']>,
title: '' as TabLabel,
scrollToTop: false as boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/v2/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default obc(({ title = '全部' }, { $ }: Ctx) => {
const index = $.tabs.findIndex(item => item.title === title)
return (
<List
connectRef={ref => $.connectRef(ref, index)}
forwardRef={ref => $.forwardRef(ref, index)}
styles={styles}
data={$.currentCollection(title)}
title={title}
Expand Down
6 changes: 3 additions & 3 deletions src/screens/home/v2/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2022-06-19 12:58:30
* @Last Modified by: czy0729
* @Last Modified time: 2023-04-05 13:18:45
* @Last Modified time: 2023-04-06 05:29:29
*/
import React, { useCallback, useMemo } from 'react'
import { PaginationList2 as ListView } from '@_'
Expand All @@ -15,7 +15,7 @@ import { DEFAULT_PROPS } from './ds'

const List = memo(
({
connectRef,
forwardRef,
styles,
data,
title,
Expand Down Expand Up @@ -48,7 +48,7 @@ const List = memo(

return (
<ListView
connectRef={connectRef}
forwardRef={forwardRef}
style={styles.listView}
contentContainerStyle={styles.contentContainerStyle}
progressViewOffset={_.ios(styles.contentContainerStyle.paddingTop - _.sm, 0)}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/home/v2/store/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export default class Action extends Fetch {
scrollToIndex = {}

/** 底部 TabBar 再次点击滚动到顶并刷新数据 */
connectRef = (
forwardRef = (
ref: {
scrollToIndex: any
},
Expand Down
18 changes: 13 additions & 5 deletions src/stores/calendar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-04-20 11:41:35
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-13 18:22:02
* @Last Modified time: 2023-04-06 06:24:42
*/
import { observable, computed, toJS } from 'mobx'
import {
Expand Down Expand Up @@ -32,6 +32,7 @@ import {
} from './init'
import { cheerioToday } from './common'
import { fixedOnAir } from './utils'
import { ON_AIR } from './onair'
import { OnAir, OnAirItem, OnAirUser } from './types'

type CacheKey = keyof typeof LOADED
Expand Down Expand Up @@ -76,6 +77,7 @@ class CalendarStore extends store implements StoreConstructor<typeof STATE> {
...deepClone(INIT_CALENDAR),
_loaded: getTimestamp()
}

const { calendar } = this.state
calendar.list.forEach(item => {
item.items.forEach(item => {
Expand Down Expand Up @@ -141,17 +143,23 @@ class CalendarStore extends store implements StoreConstructor<typeof STATE> {
}
}

// 若云端数据全为空, 不处理
if (!onAir.weekDayCN && !onAir.timeCN && !onAir.weekDayJP && !onAir.timeJP) {
// 若云端和代码本地数据全为空, 不处理
if (
!onAir.weekDayCN &&
!onAir.timeCN &&
!onAir.weekDayJP &&
!onAir.timeJP &&
!ON_AIR[subjectId]
) {
return {
...onAir
}
}

// 本地时区次优先
const onAirLocal = toLocal(
onAir.weekDayCN || onAir.weekDayJP,
onAir.timeCN || onAir.timeJP
onAir.weekDayCN || onAir.weekDayJP || ON_AIR[subjectId]?.weekDayCN,
onAir.timeCN || onAir.timeJP || ON_AIR[subjectId]?.timeCN
)
return {
...onAir,
Expand Down
Loading

0 comments on commit ac3b972

Please sign in to comment.