leon há 1 ano atrás
pai
commit
98b81c04f4

+ 4 - 1
src/app.config.ts

@@ -30,7 +30,10 @@ const appConfig = defineAppConfig({
     'pages/explore/Index',
     'pages/clock/StreakDetail',
     'pages/notification/setting',
-    'pages/store/product_list'
+    'pages/store/product_list',
+    'pages/account/Album',
+    'pages/account/Journal',
+    'pages/account/PhotoWall'
   ],
   entryPagePath: 'pages/clock/Clock',
   // subPackages: [

+ 13 - 2
src/features/health/HistoryItem.tsx

@@ -12,7 +12,7 @@ import { IconMore } from "@/components/basic/Icons";
 import showActionSheet from "@/components/basic/ActionSheet";
 import { makeDone } from "@/services/health";
 
-export default function HistoryItem(props: { data: any, index: number, onClick: Function, isArchived?: boolean, refresh?: Function }) {
+export default function HistoryItem(props: { data: any, preData: any, index: number, onClick: Function, isArchived?: boolean, refresh?: Function }) {
     const health = useSelector((state: any) => state.health);
     let showActionSheetWithOptions;
     function preview(obj) {
@@ -81,8 +81,19 @@ export default function HistoryItem(props: { data: any, index: number, onClick:
         return count;
     }
 
+    function historyDate() {
+        if (!props.preData) {
+            return dayjs(props.data.window_range.start_timestamp).format('D')
+        }
+        if (dayjs(props.data.window_range.start_timestamp).format('D') ==
+            dayjs(props.preData.window_range.start_timestamp).format('D')) {
+            return ''
+        }
+        return dayjs(props.data.window_range.start_timestamp).format('D')
+    }
+
     return <View className="history_item" onClick={() => props.onClick()}>
-        <View className="history_date">{dayjs(props.data.window_range.start_timestamp).format('D')}</View>
+        <View className="history_date">{historyDate()}</View>
         <View className="history_content">
 
             <View style={{ display: 'flex', flexDirection: 'column' }}>

+ 13 - 9
src/features/health/MainHistory.tsx

@@ -105,14 +105,14 @@ export default function MainHistory(props: { type: string }) {
             </View>
         }
         {
-            health.mode == 'EAT' && health.eatArchived && health.eatArchived.archived && <View className="recent" style={{justifyContent:'center'}}>
+            health.mode == 'EAT' && health.eatArchived && health.eatArchived.archived && <View className="recent" style={{ justifyContent: 'center' }}>
                 <View className="archived_bg" onClick={() => {
-                        jumpPage('/_health/pages/archive')
-                    }}>
-                    <Text className="archived_text" style={{color:getThemeColor(health.mode)}}>[{health.eatArchived.real_count}/{health.eatArchived.target_count} Meals] Archived Yesterday</Text>
+                    jumpPage('/_health/pages/archive')
+                }}>
+                    <Text className="archived_text" style={{ color: getThemeColor(health.mode) }}>[{health.eatArchived.real_count}/{health.eatArchived.target_count} Meals] Archived Yesterday</Text>
                     {
-                        health.eatArchived.images.map((item,index)=>{
-                            return <Image src={item} key={index} className="archived_img" mode="aspectFill"/>
+                        health.eatArchived.images.map((item, index) => {
+                            return <Image src={item} key={index} className="archived_img" mode="aspectFill" />
                         })
                     }
                 </View>
@@ -122,9 +122,13 @@ export default function MainHistory(props: { type: string }) {
         {
             list.map((item, index) => {
                 return <View ref={refDemo} id="demo1" key={index}>
-                    <HistoryItem data={item} index={index} onClick={() => {
-                        jumpPage('/_health/pages/moment_detail')
-                    }} />
+                    <HistoryItem
+                        data={item}
+                        preData={index > 0 ? list[index - 1] : null}
+                        index={index}
+                        onClick={() => {
+                            jumpPage('/_health/pages/moment_detail')
+                        }} />
                     {/* {
                         props.type == 'EAT' && <HistoryEatItem data={item} index={index} />
                     }

+ 59 - 0
src/features/journal/components/journal_cover.scss

@@ -0,0 +1,59 @@
+.single {
+    width: 178px;
+    height: 178px;
+    background-color: pink;
+}
+
+.double {
+    display: flex;
+    flex-direction: row;
+}
+
+.half_img {
+    width: 88px;
+    height: 178px;
+    background-color: pink;
+}
+
+.half_top_down {
+    display: flex;
+    flex-direction: column;
+    // justify-content: space-between;
+    height: 178px;
+}
+
+.quarter_img {
+    height: 88px;
+    width: 88px;
+    background-color: pink;
+}
+
+.five_1 {
+    width: 118px;
+    height: 118px;
+    background-color: pink;
+}
+
+.seven_1{
+    width: 58px;
+    height: 118px;
+    background-color: pink;
+}
+
+.five_2 {
+    width: 58px;
+    height: 118px;
+    background-color: pink;
+}
+
+.nine_img {
+    width: 58px;
+    height: 58px;
+    background-color: pink;
+}
+
+.journal_space{
+    width: 2px;
+    height: 2px;
+    flex-shrink: 0;
+}

+ 161 - 0
src/features/journal/components/journal_cover.tsx

@@ -0,0 +1,161 @@
+import { View } from '@tarojs/components'
+import './journal_cover.scss'
+import { count } from 'console'
+import { rpxToPx } from '@/utils/tools'
+
+
+export default function JournalCover(props: { count: number }) {
+
+    switch (props.count) {
+        case 1:
+            return <View className='single'></View>
+        case 2:
+            return <View className='double'>
+                <View className='half_img' />
+                <View className='journal_space' />
+                <View className='half_img' />
+            </View>
+        case 3:
+            return <View className='double'>
+                <View style={{ display: 'flex', flexDirection: 'column' }}>
+                    <View className='half_img' />
+                </View>
+                <View className='journal_space' />
+                <View className='half_top_down'>
+                    <View className='quarter_img' />
+                    <View className='journal_space' />
+                    <View className='quarter_img' />
+                </View>
+            </View>
+        case 4:
+            return <View className='double'>
+                <View className='half_top_down' >
+                    <View className='quarter_img' />
+                    <View className='journal_space' />
+                    <View className='quarter_img' />
+                </View>
+
+                <View className='journal_space' />
+                <View className='half_top_down'>
+                    <View className='quarter_img' />
+                    <View className='journal_space' />
+                    <View className='quarter_img' />
+                </View>
+            </View>
+        case 5:
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='five_1' />
+                    <View className='journal_space' />
+                    <View className='five_2' />
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+            </View>
+
+        case 6:
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='five_1' />
+                    <View className='journal_space' />
+                    <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <View className='nine_img' />
+                        <View className='journal_space' />
+                        <View className='nine_img' />
+                    </View>
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+            </View>
+        case 7:
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='seven_1' />
+                    <View className='journal_space' />
+                    <View className='seven_1' />
+                    <View className='journal_space' />
+                    <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <View className='nine_img' />
+                        <View className='journal_space' />
+                        <View className='nine_img' />
+                    </View>
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+            </View>
+        case 8:
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='seven_1' />
+                    <View className='journal_space' />
+                    <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <View className='nine_img' />
+                        <View className='journal_space' />
+                        <View className='nine_img' />
+                    </View>
+                    <View className='journal_space' />
+                    <View style={{ display: 'flex', flexDirection: 'column' }}>
+                        <View className='nine_img' />
+                        <View className='journal_space' />
+                        <View className='nine_img' />
+                    </View>
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+            </View>
+        case 9:
+            return <View style={{ display: 'flex', flexDirection: 'column' }}>
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+                <View className='journal_space' />
+                <View style={{ display: 'flex', flexDirection: 'row' }}>
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                    <View className='journal_space' />
+                    <View className='nine_img' />
+                </View>
+            </View>
+    }
+
+    return <View>
+
+    </View>
+}

+ 0 - 0
src/features/journal/components/placeholder → src/pages/account/Album.config.ts


+ 0 - 0
src/pages/account/Album.scss


+ 10 - 0
src/pages/account/Album.tsx

@@ -0,0 +1,10 @@
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import { View } from "@tarojs/components";
+
+export default function Album(){
+    return <View>
+        <View onClick={()=>{
+            jumpPage('/pages/account/PhotoWall')
+        }}>Photo Wall</View>
+    </View>
+}

+ 0 - 0
src/pages/account/Journal.config.ts


+ 0 - 0
src/pages/account/Journal.scss


+ 25 - 0
src/pages/account/Journal.tsx

@@ -0,0 +1,25 @@
+import JournalCover from "@/features/journal/components/journal_cover";
+import { View } from "@tarojs/components";
+
+export default function Journal(){
+    return <View style={{display:'flex',flexDirection:'row',flexWrap:'wrap'}}>
+        <JournalCover count={1} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={2} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={3} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={4} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={5} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={6} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={7} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={8} />
+        <View style={{height:120,width:10}}/>
+        <JournalCover count={9} />
+        <View style={{height:10,width:10}}/>
+    </View>
+}

+ 0 - 0
src/pages/account/PhotoWall.config.ts


+ 6 - 0
src/pages/account/PhotoWall.scss

@@ -0,0 +1,6 @@
+.photo_wall {
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
+    justify-content: space-between;
+}

+ 20 - 0
src/pages/account/PhotoWall.tsx

@@ -0,0 +1,20 @@
+import { View } from "@tarojs/components";
+import './PhotoWall.scss'
+import Taro from "@tarojs/taro";
+import { useState } from "react";
+
+export default function PhotoWall() {
+    const screenWidth = Taro.getSystemInfoSync().screenWidth
+    const space = 2
+    const itemWidth = (screenWidth-space*2)/3.0
+    const [list, setList] = useState(new Array(10).fill("aaa"))
+    return <View className="photo_wall">
+        {
+            list.map((item, index) => {
+                return <View key={index} style={{ width: itemWidth, height: itemWidth, backgroundColor: 'pink',marginBottom:space }}></View>
+            })
+        }
+        <View style={{ width: itemWidth, height: itemWidth }} />
+        <View style={{ width: itemWidth, height: itemWidth }} />
+    </View>
+}

+ 2 - 1
src/pages/account/Profile.config.ts

@@ -5,5 +5,6 @@ export default definePageConfig({
     },
     // "disableScroll": true
     "enablePullDownRefresh": true,
-    "navigationBarTitleText": ""
+    "navigationBarTitleText": "",
+    "navigationBarBackgroundColor":"#f5f5f5"
   })

+ 39 - 0
src/pages/account/Profile.scss

@@ -118,4 +118,43 @@
 .px1Height::after {
     -webkit-transform: scaleY(0.5);
     transform: scaleY(0.5);
+}
+
+.profile_cell_space{
+    margin-top: 36px;
+}
+
+.profile_cell{
+    height: 128px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    padding-left: 52px;
+    padding-right: 42px;
+    position: relative;
+    color: #000;
+    background-color: #fff;
+}
+
+.profile_cell_arrow{
+    height: 34px;
+    width: 34px;
+}
+
+.profile_cell_icon{
+    width: 48px;
+    height: 48px;
+    margin-right: 12px;
+}
+
+.profile_cell_line{
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    height: 2px;
+    -webkit-transform: scaleY(0.5);
+    transform: scaleY(0.5);
+    background-color: #B2B2B2;
+    opacity: 0.4;
+    left: 112px;
 }

+ 46 - 59
src/pages/account/Profile.tsx

@@ -256,7 +256,7 @@ export default function Page() {
     }
 
     function detail() {
-        return <View className="container">
+        return <View style={{ display: 'flex', flexDirection: 'column' }}>
 
             <Box>
                 <View className="profile_card" onClick={tapProfile}>
@@ -274,64 +274,51 @@ export default function Page() {
                 </View>
             </Box>
 
-
-
-            <Box>
-                {
-                    !isMember() ? <View className="balance" onClick={tapBalance}>
-                        <Text className="title">{t('page.more.stone')}</Text>
-                        <Text className="desc" style={{ height: process.env.TARO_ENV == 'weapp' ? rpxToPx(32) : rpxToPx(64) }}>{t('page.more.stone_desc')}</Text>
-                    </View> :
-                        <View className="balance" onClick={tapBalance}>
-                            <Text className="title">{t('page.more.pro_member')}</Text>
-                            <Text className="desc">{memberdesc()}</Text>
-                        </View>
-                }
-
-            </Box>
-            {
-                user.isLogin && process.env.TARO_ENV == 'rn' && <View onClick={goSetting}>
-                    <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
-                </View>
-            }
-            {
-                user.isLogin && process.env.TARO_ENV == 'weapp' && <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
-            }
-
-            {
-                user.isLogin && user.test_user && <View>
-                    <View className="cell_top" onClick={clearF}>
-                        <Text className="cell_title">user_id</Text>
-                        <Text className="cell_value">{user.id.substring(0, 6)}***{user.id.substring(user.id.length - 10, user.id.length)}</Text>
-                        <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
-                    </View>
-                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
-                    <View className="cell_center" onClick={reset}>
-                        <Text className="cell_title">session</Text>
-                        <Text className="cell_value">{t('page.more.reset_session')}</Text>
-                        <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
-                    </View>
-                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
-                    <View className="cell_center">
-                        <Text className="cell_title">member alert</Text>
-                        <Switch checked={memberAlert} onChange={alertChanged} />
-                    </View>
-                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
-                    <View className="cell_center">
-                        <Text className="cell_title">expire based on device time</Text>
-                        {
-                            process.env.TARO_ENV == 'rn' ? <SwitchRN value={baseDeviceTime} onChange={(e) => { baseDeviceChanged(e.nativeEvent.value) }} /> : <Switch checked={baseDeviceTime} onChange={(e) => { baseDeviceChanged(e.detail.value) }} />
-                        }
-
-                    </View>
-                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
-                    <View className="cell_bottom">
-                        <Text className="cell_title">{t('page.more.debug_mode')}</Text>
-                        <Switch checked={switchOn} onChange={switchChanged} />
-                    </View>
-
-                </View>
-            }
+            <View className="profile_cell profile_cell_space" onClick={goSetting}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Metric</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+            </View>
+
+            <View className="profile_cell profile_cell_space" onClick={()=>{
+                jumpPage('/pages/account/Album')
+            }}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Album</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+                <View className="profile_cell_line" />
+            </View>
+            <View className="profile_cell" onClick={()=>{
+                jumpPage('/pages/account/Journal')
+            }}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Journal</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+            </View>
+
+            <View className="profile_cell profile_cell_space" onClick={goSetting}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Schedule</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+                <View className="profile_cell_line" />
+            </View>
+            <View className="profile_cell" onClick={goSetting}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Calendar</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+                <View className="profile_cell_line" />
+            </View>
+            <View className="profile_cell" onClick={goSetting}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Window</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+            </View>
+
+            <View className="profile_cell profile_cell_space" onClick={goSetting}>
+                <Image src={require('@assets/_health/sit.png')} className="profile_cell_icon" />
+                <Text style={{ flex: 1 }}>Settings</Text>
+                <Image src={require('@assets/_health/cell_arrow.png')} className="profile_cell_arrow" />
+            </View>
             <View style={{ height: 40 }}></View>
 
         </View>

+ 355 - 0
src/pages/account/Profile_副本.tsx

@@ -0,0 +1,355 @@
+import Buttons from "@/components/basic/Buttons";
+import { delSession } from "@/services/common";
+import { clear, getInfo, getPerm, logout, uploadPerm } from "@/services/user";
+import { View, Text, Image, Switch } from "@tarojs/components";
+import Taro, { useDidShow, usePullDownRefresh, useShareAppMessage } from "@tarojs/taro";
+import { useDispatch, useSelector } from "react-redux";
+import './Profile.scss'
+import Box from "@/components/layout/Box";
+import { BoxType, NaviBarTitleShowType, TemplateType } from "@/utils/types";
+import Layout from "@/components/layout/layout";
+import { useTranslation } from "react-i18next";
+import TableCell from "@/components/layout/TableCell";
+import { useEffect, useState } from "react";
+import { jumpPage } from "@/features/trackTimeDuration/hooks/Common";
+import Tabbar from "@/components/navigation/TabBar";
+import { getInfoSuccess, updateDebug } from "@/store/user";
+import TitleView from "@/features/trackTimeDuration/components/TitleView";
+import showAlert from "@/components/basic/Alert";
+import { kIsAndroid, kIsIOS, rpxToPx } from "@/utils/tools";
+import dayjs from "dayjs";
+
+let useNavigation, SwitchRN;
+if (process.env.TARO_ENV == 'rn') {
+    useNavigation = require("@react-navigation/native").useNavigation
+    SwitchRN = require('react-native').Switch
+}
+
+export default function Page() {
+    const dispatch = useDispatch();
+    const { t } = useTranslation()
+    const user = useSelector((state: any) => state.user);
+    const [switchOn, setSwitchOn] = useState(false)
+    const [triggered, setTriggered] = useState(true)
+    const [memberAlert, setMemberAlert] = useState(global.memberAlert)
+    const [baseDeviceTime, setBaseDeviceTime] = useState(false)
+    const accessObj = useSelector((state: any) => state.access);
+
+    let navigation;
+    if (useNavigation) {
+        navigation = useNavigation()
+    }
+
+    useEffect(() => {
+        if (process.env.TARO_ENV == 'weapp') {
+            var status = Taro.getStorageSync('isDebug')
+            setSwitchOn(status)
+        }
+        getPermissions()
+
+        if (process.env.TARO_ENV == 'rn') {
+            let Purchases = require("react-native-purchases").default
+            if (kIsIOS) {
+                Purchases.configure({
+                    apiKey: 'appl_FNFYDLwHZlXzqrKJFlErWXUHGwx',
+                    appUserID: user.id
+                })
+            }
+            else if (kIsAndroid) {
+                Purchases.configure({
+                    apiKey: 'goog_cyJSYOsnZpNqsUbCsHSdhqQdQwe',
+                    appUserID: user.id
+                })
+            }
+        }
+    }, [])
+
+    if (process.env.TARO_ENV == 'weapp') {
+        useShareAppMessage((e) => {
+            return {
+                title: t('share.title'),
+                path: 'pages/clock/Clock'
+            }
+        })
+    }
+
+    async function getCustomInfo() {
+        // if (process.env.TARO_ENV == 'rn') {
+        //     let Purchases = require("react-native-purchases").default
+        //     try {
+        //         const customerInfo = await Purchases.getCustomerInfo();
+        //         console.log('customer info', customerInfo)
+        //         // access latest customerInfo
+        //     } catch (e) {
+        //         console.log('customer info error', e)
+        //         // Error fetching customer info
+        //     }
+        // }
+
+    }
+
+    function switchChanged(e) {
+        setSwitchOn(e.detail.value)
+        Taro.setStorageSync('isDebug', e.detail.value)
+        global.isDebug = e.detail.value
+        dispatch(updateDebug({ is_debug: e.detail.value }))
+    }
+
+    function alertChanged(e) {
+        setMemberAlert(e.detail.value)
+        global.memberAlert = e.detail.value
+        Taro.setStorage({
+            key: 'memberAlert',
+            data: e.detail.value
+        })
+    }
+
+    function baseDeviceChanged(e) {
+        setBaseDeviceTime(e)
+        global.baseDeviceTime = e
+
+        uploadPerm({ expire_based_on_device_time: e }).then(res => {
+            if (global.indexPageRefresh) {
+                global.indexPageRefresh()
+            }
+        })
+    }
+
+    function getPermissions() {
+        getPerm().then(res => {
+            setBaseDeviceTime((res as any).expire_based_on_device_time)
+        })
+    }
+
+    useDidShow(() => {
+        // global.updateTab(3)
+    })
+
+    function reset() {
+        showAlert({
+            title: t('feature.common.modal.reset_session_title'),
+            content: t('feature.common.modal.reset_session_content'),
+            showCancel: false,
+            confirm: () => {
+                delSession({ type: 'WX_MP' })
+            }
+        })
+
+    }
+
+    function clearF() {
+        showAlert({
+            title: t('feature.common.modal.deluser_title'),
+            content: t('feature.common.modal.deluser_content'),
+            showCancel: true,
+            confirm: () => {
+                dispatch(clear() as any);
+            }
+        })
+    }
+
+    function tapProfile(e) {
+        if (process.env.TARO_ENV == 'weapp') {
+            e.stopPropagation()
+        }
+        if (user.isLogin) {
+            jumpPage('/pages/account/ProfileSetting', 'ProfileSetting', navigation)
+        }
+        else {
+            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+        }
+    }
+
+    function tapBalance(e) {
+        if (user.isLogin) {
+            jumpPage('/pages/store/product_list', 'ProductList', navigation)
+        }
+        else {
+            jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
+            if (process.env.TARO_ENV == 'weapp') {
+                e.stopPropagation()
+            }
+        }
+
+    }
+
+    function goSetting(e) {
+        console.log('apple')
+        jumpPage('/pages/account/Setting', 'Setting', navigation)
+        if (process.env.TARO_ENV == 'weapp' && e) {
+            e.stopPropagation()
+        }
+    }
+
+    usePullDownRefresh(() => {
+        refresh()
+    })
+
+    function refresh() {
+        setTriggered(true)
+        getInfo().then(res => {
+            console.log(res)
+            Taro.stopPullDownRefresh()
+            dispatch(getInfoSuccess(res))
+            setTriggered(false)
+        }).catch(e => {
+            Taro.stopPullDownRefresh()
+            setTriggered(false)
+        })
+    }
+
+    function headerView() {
+        return <TitleView title={t('page.more.title')} showAddBtn={false}>
+        </TitleView>
+    }
+
+    function memberdesc() {
+        if (!accessObj.access) {
+            return ''
+        }
+
+        switch (accessObj.access.member.subscription_status) {
+            case 'INITIAL':
+            case 'INACTIVE':
+            case 'INACTIVE_EXPIRED':
+                return 'Unlimited premium access to Pro features forever.';
+            case 'ACTIVE':
+                return t('page.more.member_desc', { time: time_formate(accessObj.access.member.expire) })
+            case 'ACTIVE_RENEWING':
+                return `Your membership will renew on ${time_formate(accessObj.access.member.renewal)}.`
+            case 'ACTIVE_EXPIRING':
+                return `Your membership is expiring soon on ${time_formate(accessObj.access.member.expire)}.`
+
+        }
+        if (accessObj.access.member.type == 'NON_CONSUMABLE') {
+            return 'Unlimited premium access to Pro features forever.'
+        }
+        if (accessObj.access.member.type == 'AUTO_RENEW') {
+            return `Your membership will automatically renew on ${time_formate(accessObj.access.member.expire)}.`
+            // return 'Premium access to Pro features during membership.'
+        }
+        return t('page.more.member_desc', { time: time_formate(accessObj.access.member.expire) })
+    }
+
+    function isMember() {
+        console.log('aaaa')
+        if (!user.isLogin || !accessObj || !accessObj.access) {
+            return false;
+        }
+        console.log(accessObj.access)
+        switch (accessObj.access.member.subscription_status) {
+            case 'INITIAL':
+            case 'INACTIVE':
+            case 'INACTIVE_EXPIRED':
+                return false;
+        }
+        console.log('bbbbb')
+        return true;
+    }
+
+    function time_formate(timestamp) {
+        if (global.language == 'en') {
+            return dayjs(timestamp).format('MMM D HH:mm')
+        }
+
+        return dayjs(timestamp).format('YYYY年MM月DD日 HH:mm')
+    }
+
+    function detail() {
+        return <View className="container">
+
+            <Box>
+                <View className="profile_card" onClick={tapProfile}>
+                    <View className="avatar" style={{
+                        opacity: user.isLogin ? 1 : 0.4,
+                        background: user.isLogin ? 'transparent' : '#fff'
+                    }}>
+                        {
+                            user.isLogin ? <Image src={user.avatar} className="avatar" mode="aspectFill" style={{
+                                background: user.isLogin ? 'transparent' : '#fff'
+                            }} /> : <Image src={require('@/assets/images/user.png')} className="avatar_placeholder" />
+                        }
+                    </View>
+                    <Text className="nickname">{user.isLogin ? user.nickname : t('page.more.un_login')}</Text>
+                </View>
+            </Box>
+
+
+
+            <Box>
+                {
+                    !isMember() ? <View className="balance" onClick={tapBalance}>
+                        <Text className="title">{t('page.more.stone')}</Text>
+                        <Text className="desc" style={{ height: process.env.TARO_ENV == 'weapp' ? rpxToPx(32) : rpxToPx(64) }}>{t('page.more.stone_desc')}</Text>
+                    </View> :
+                        <View className="balance" onClick={tapBalance}>
+                            <Text className="title">{t('page.more.pro_member')}</Text>
+                            <Text className="desc">{memberdesc()}</Text>
+                        </View>
+                }
+
+            </Box>
+            {
+                user.isLogin && process.env.TARO_ENV == 'rn' && <View onClick={goSetting}>
+                    <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
+                </View>
+            }
+            {
+                user.isLogin && process.env.TARO_ENV == 'weapp' && <TableCell title={t('page.more.setting')} showArrow={true} showMarginBottom={true} onClick={goSetting}></TableCell>
+            }
+
+            {
+                user.isLogin && user.test_user && <View>
+                    <View className="cell_top" onClick={clearF}>
+                        <Text className="cell_title">user_id</Text>
+                        <Text className="cell_value">{user.id.substring(0, 6)}***{user.id.substring(user.id.length - 10, user.id.length)}</Text>
+                        <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
+                    </View>
+                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
+                    <View className="cell_center" onClick={reset}>
+                        <Text className="cell_title">session</Text>
+                        <Text className="cell_value">{t('page.more.reset_session')}</Text>
+                        <Image className="cell_arrow" src={require('@/assets/images/arrow3.png')} />
+                    </View>
+                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
+                    <View className="cell_center">
+                        <Text className="cell_title">member alert</Text>
+                        <Switch checked={memberAlert} onChange={alertChanged} />
+                    </View>
+                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
+                    <View className="cell_center">
+                        <Text className="cell_title">expire based on device time</Text>
+                        {
+                            process.env.TARO_ENV == 'rn' ? <SwitchRN value={baseDeviceTime} onChange={(e) => { baseDeviceChanged(e.nativeEvent.value) }} /> : <Switch checked={baseDeviceTime} onChange={(e) => { baseDeviceChanged(e.detail.value) }} />
+                        }
+
+                    </View>
+                    <View className="cell_line" style={{ marginLeft: rpxToPx(46), marginRight: rpxToPx(46) }}></View>
+                    <View className="cell_bottom">
+                        <Text className="cell_title">{t('page.more.debug_mode')}</Text>
+                        <Switch checked={switchOn} onChange={switchChanged} />
+                    </View>
+
+                </View>
+            }
+            <View style={{ height: 40 }}></View>
+
+        </View>
+    }
+
+    return <View>
+        <Layout title={t('page.more.title')}
+            titleShowStyle={NaviBarTitleShowType.scrollToShow}
+            type={TemplateType.customHeader}
+            header={headerView()}
+            triggered={triggered}
+            refresh={refresh}
+            showPullToRefresh={true}
+        >
+            {
+                detail()
+            }
+        </Layout>
+        <Tabbar index={3} />
+    </View>
+}

+ 26 - 0
src/pages/rn/RNMain.tsx

@@ -31,6 +31,13 @@ import { kIsAndroid, kIsIOS } from '@/utils/tools';
 import { View, Text } from '@tarojs/components';
 import IndexTimePage from '@/app/time_of_day/index_time';
 import MyPlacesPage from '@/app/time_of_day/my_places';
+import Album from '../account/Album';
+import Journal from '../account/Journal';
+import AddMoment from '@/_health/pages/add_moment';
+import Move from '@/_health/pages/move';
+import Archive from '@/_health/pages/archive';
+import MomentDetail from '@/_health/pages/moment_detail';
+
 // import { View,Image } from '@tarojs/components';
 
 // 创建底部 Tab 导航器
@@ -305,6 +312,25 @@ export default function RNMain() {
         <Stack.Screen name='map' component={map} options={{
           headerBackTitle: ' '
         }} />
+        <Stack.Screen name='Album' component={Album} options={{
+          headerBackTitle: ' '
+        }} />
+        <Stack.Screen name='Journal' component={Journal} options={{
+          headerBackTitle: ' '
+        }} />
+        <Stack.Screen name='AddMoment' component={AddMoment} options={{
+          headerBackTitle: ' '
+        }} />
+        <Stack.Screen name='Move' component={Move} options={{
+          headerBackTitle: ' '
+        }} />
+        <Stack.Screen name='Archive' component={Archive} options={{
+          headerBackTitle: ' '
+        }} />
+        <Stack.Screen name='MomentDetail' component={MomentDetail} options={{
+          headerBackTitle: ' '
+        }} />
+
         {/* <Stack.Screen name='NotificationSetting' component={NotificationSetting} options={{
           headerBackTitle: ' '
         }} /> */}