|
@@ -3,12 +3,15 @@ import './index.less'
|
|
|
import React, { useEffect, useState } from "react";
|
|
|
import axios from 'axios';
|
|
|
import { connect } from 'react-redux'
|
|
|
+import { Link } from 'react-router-dom';
|
|
|
+import * as actionTypes from './../../store/actionTypes/index'
|
|
|
const mapStateToProps = state => {
|
|
|
return {
|
|
|
- count: state.count
|
|
|
+ count:state.count.count
|
|
|
}
|
|
|
}
|
|
|
const srt: React.FC = (props: any) => {
|
|
|
+ console.log(props)
|
|
|
const [srt, setStr] = useState<string[][]>([])
|
|
|
//解析时间
|
|
|
const parseSrtTime = function (str: string): number {
|
|
@@ -18,8 +21,9 @@ const srt: React.FC = (props: any) => {
|
|
|
|
|
|
return Number(str0) * 3600000 + Number(str1) * 60000 + Number(str2)
|
|
|
}
|
|
|
-
|
|
|
+ const countName = props.count+'个'
|
|
|
useEffect(() => {
|
|
|
+ console.log(props)
|
|
|
axios({
|
|
|
url: './7月12日.srt',
|
|
|
responseType: 'text'
|
|
@@ -45,19 +49,22 @@ const srt: React.FC = (props: any) => {
|
|
|
url: "https://jsjp-admin.zzxcx.net/jsjp-admin/open-api/gzpt/userInfo/configKey/jsjp_android",
|
|
|
method: 'GET'
|
|
|
})
|
|
|
+
|
|
|
}, [])
|
|
|
-
|
|
|
+
|
|
|
return (
|
|
|
<div className='srt'>
|
|
|
<div className='lyric'><span className='line'>全局count:{props.count}</span><button onClick={() => {
|
|
|
props.dispatch({
|
|
|
- type: 'SET_COUNT',
|
|
|
+ type: actionTypes.CHANGE_COUNT,
|
|
|
paylod: (props.count + 1)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
}>增加count</button></div>
|
|
|
+ <div>{countName}</div>
|
|
|
+ <Link to={'/wxcode'}>前往wxcode</Link>
|
|
|
<div className='lyric'>
|
|
|
{
|
|
|
srt.map((item, index) => {
|