|
@@ -12,13 +12,17 @@ import Layout from '@/components/layout/layout'
|
|
|
import NoData from "@/components/view/NoData";
|
|
import NoData from "@/components/view/NoData";
|
|
|
import { ResultType, checkFail, checkRetry, checkStart, checkSuccess, resetStatus, setResult } from "@/store/action_results";
|
|
import { ResultType, checkFail, checkRetry, checkStart, checkSuccess, resetStatus, setResult } from "@/store/action_results";
|
|
|
import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
|
|
import RequestType, { thirdPartRequest } from "@/services/thirdPartRequest";
|
|
|
-import { NaviBarTitleShowType, TemplateType } from "@/utils/types";
|
|
|
|
|
|
|
+import { ModalType, NaviBarTitleShowType, TemplateType } from "@/utils/types";
|
|
|
import { useTranslation } from "react-i18next";
|
|
import { useTranslation } from "react-i18next";
|
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
|
|
|
|
|
+import TitleView from "@/features/trackTimeDuration/components/TitleView";
|
|
|
|
|
+import './Activity.scss'
|
|
|
|
|
+import Modal from "@/components/layout/Modal";
|
|
|
|
|
+import MoveList from "./MoveList";
|
|
|
// import { useNavigation } from "@react-navigation/native";
|
|
// import { useNavigation } from "@react-navigation/native";
|
|
|
|
|
|
|
|
let useNavigation;
|
|
let useNavigation;
|
|
|
-if (process.env.TARO_ENV=='rn'){
|
|
|
|
|
|
|
+if (process.env.TARO_ENV == 'rn') {
|
|
|
useNavigation = require("@react-navigation/native").useNavigation
|
|
useNavigation = require("@react-navigation/native").useNavigation
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -38,10 +42,11 @@ export default function Component(props: any) {
|
|
|
const [latestRecord, setLatestRecord] = useState(null)
|
|
const [latestRecord, setLatestRecord] = useState(null)
|
|
|
const [triggered, setTriggered] = useState(true)
|
|
const [triggered, setTriggered] = useState(true)
|
|
|
const [showErrorPage, setErrorPage] = useState(false)
|
|
const [showErrorPage, setErrorPage] = useState(false)
|
|
|
-
|
|
|
|
|
|
|
+ const [showModal, setShowModal] = useState(false)
|
|
|
|
|
+
|
|
|
const [count, setCount] = useState(0)
|
|
const [count, setCount] = useState(0)
|
|
|
let navigation;
|
|
let navigation;
|
|
|
- if (useNavigation){
|
|
|
|
|
|
|
+ if (useNavigation) {
|
|
|
navigation = useNavigation()
|
|
navigation = useNavigation()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -142,11 +147,11 @@ export default function Component(props: any) {
|
|
|
checkout()
|
|
checkout()
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- setAuth(successAuth, refuseAuth,t)
|
|
|
|
|
|
|
+ setAuth(successAuth, refuseAuth, t)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- jumpPage('/pages/account/ChooseAuth','ChooseAuth',navigation)
|
|
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -277,7 +282,7 @@ export default function Component(props: any) {
|
|
|
jumpPage('/pages/common/RecordsHistory?type=activity&refreshList=getCards&title=' + item.name + '&themeColor=' + item.theme_color)
|
|
jumpPage('/pages/common/RecordsHistory?type=activity&refreshList=getCards&title=' + item.name + '&themeColor=' + item.theme_color)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- jumpPage('/pages/account/ChooseAuth','ChooseAuth',navigation)
|
|
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -332,8 +337,17 @@ export default function Component(props: any) {
|
|
|
isEnable = true;
|
|
isEnable = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function addBtnClick() {
|
|
|
|
|
+ setShowModal(true)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function headerView() {
|
|
|
|
|
+ return <TitleView title={t('page.activity.title')} showAddBtn={true} onClick={addBtnClick}>
|
|
|
|
|
+ </TitleView>
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function detail() {
|
|
function detail() {
|
|
|
- return <View>
|
|
|
|
|
|
|
+ return <View className="activity_container">
|
|
|
{
|
|
{
|
|
|
list.map((item: any, index) => {
|
|
list.map((item: any, index) => {
|
|
|
var value = '0'
|
|
var value = '0'
|
|
@@ -376,7 +390,7 @@ export default function Component(props: any) {
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
value = t('feature.track_something.activity.today_un_check')
|
|
value = t('feature.track_something.activity.today_un_check')
|
|
|
- desc = t('feature.track_something.activity.check_history')//'查看历史记录'
|
|
|
|
|
|
|
+ desc = t('feature.track_something.activity.check_history')//'查看历史记录'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -402,31 +416,56 @@ export default function Component(props: any) {
|
|
|
</View>
|
|
</View>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // return <ScrollView style={{ backgroundColor: '#000',flex:1 }} scrollY refresherEnabled={true}
|
|
|
|
|
- // refresherThreshold={100} refresherBackground="#000"
|
|
|
|
|
- // refresherDefaultStyle="white" onRefresherRefresh={getCards}
|
|
|
|
|
- // refresherTriggered={triggered}>
|
|
|
|
|
- // {showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
|
|
|
|
|
- // </ScrollView>
|
|
|
|
|
- // return showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ function modalDetail() {
|
|
|
|
|
+ return <View>
|
|
|
|
|
+ <MoveList list={[
|
|
|
|
|
+ { id: 1, name: '集美仓' },
|
|
|
|
|
+ { id: 2, name: '海沧仓' },
|
|
|
|
|
+ { id: 3, name: '思明仓' },
|
|
|
|
|
+ { id: 4, name: '湖里仓' },
|
|
|
|
|
+ { id: 11, name: '集美仓1' },
|
|
|
|
|
+ { id: 21, name: '海沧仓1' },
|
|
|
|
|
+ { id: 31, name: '思明仓1' },
|
|
|
|
|
+ { id: 41, name: '湖里仓1' },
|
|
|
|
|
+ { id: 10, name: '集美仓2' },
|
|
|
|
|
+ { id: 20, name: '海沧仓2' },
|
|
|
|
|
+ { id: 30, name: '思明仓2' },
|
|
|
|
|
+ { id: 40, name: '湖里仓2' }
|
|
|
|
|
+ ]}
|
|
|
|
|
+ itemHeight={45}
|
|
|
|
|
+ renderItem={(item) => (
|
|
|
|
|
+ <View
|
|
|
|
|
+ style={{
|
|
|
|
|
+ height: 40,
|
|
|
|
|
+ lineHeight: '40px',
|
|
|
|
|
+ borderBottom: '1px solid #e8e8e8',
|
|
|
|
|
+ padding: '0 15px',
|
|
|
|
|
+ color:'#fff'
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {item.name}
|
|
|
|
|
+ </View>
|
|
|
|
|
+ )}
|
|
|
|
|
+ onchange={(e) => {
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ }}/>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return <View style={{ position: 'relative' }}>
|
|
return <View style={{ position: 'relative' }}>
|
|
|
- <Layout children={showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
|
|
|
|
|
|
|
+ <Layout type={TemplateType.customHeader} header={headerView()} children={showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
|
|
|
title={t('page.activity.title')}
|
|
title={t('page.activity.title')}
|
|
|
- type={process.env.TARO_ENV == 'rn' ? TemplateType.flex : TemplateType.grid}
|
|
|
|
|
|
|
+ // type={process.env.TARO_ENV == 'rn' ? TemplateType.flex : TemplateType.grid}
|
|
|
refresh={() => { getCards() }}
|
|
refresh={() => { getCards() }}
|
|
|
triggered={triggered}
|
|
triggered={triggered}
|
|
|
titleShowStyle={NaviBarTitleShowType.scrollToShow}
|
|
titleShowStyle={NaviBarTitleShowType.scrollToShow}
|
|
|
/>
|
|
/>
|
|
|
|
|
+ {
|
|
|
|
|
+ showModal && <Modal modalType={ModalType.bottom} dismiss={() => setShowModal(false)} confirm={() => { }}>
|
|
|
|
|
+ {
|
|
|
|
|
+ modalDetail()
|
|
|
|
|
+ }
|
|
|
|
|
+ </Modal>
|
|
|
|
|
+ }
|
|
|
</View>
|
|
</View>
|
|
|
- // return <Layout children={showErrorPage ? <NoData refresh={() => { getCards() }} /> : detail()}
|
|
|
|
|
- // title={t('page.activity.title')}
|
|
|
|
|
- // type={TemplateType.grid}
|
|
|
|
|
- // refresh={() => { getCards() }}
|
|
|
|
|
- // triggered={triggered}
|
|
|
|
|
- // more={() => { getCards() }}
|
|
|
|
|
- // titleShowStyle={NaviBarTitleShowType.scrollToShow}
|
|
|
|
|
- // />
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|