|
@@ -47,6 +47,9 @@ export default function Page() {
|
|
|
// }, [])
|
|
// }, [])
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
|
+ if (!user.isLogin) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
checkSetting()
|
|
checkSetting()
|
|
|
getSettings()
|
|
getSettings()
|
|
|
getMemberStatus()
|
|
getMemberStatus()
|
|
@@ -90,7 +93,7 @@ export default function Page() {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
function getMemberStatus() {
|
|
function getMemberStatus() {
|
|
|
- const {access} = accessObj
|
|
|
|
|
|
|
+ const { access } = accessObj
|
|
|
if (access && access.member) {
|
|
if (access && access.member) {
|
|
|
if (access.member.status == 'NON_MEMBER') {
|
|
if (access.member.status == 'NON_MEMBER') {
|
|
|
postNotifySettings({
|
|
postNotifySettings({
|
|
@@ -218,7 +221,7 @@ export default function Page() {
|
|
|
jumpPage('', 'ProductList', navigation)
|
|
jumpPage('', 'ProductList', navigation)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function pro() {
|
|
|
|
|
|
|
+ function pro(isLogin:boolean) {
|
|
|
return <ScrollView style={{ flex: 1 }}>
|
|
return <ScrollView style={{ flex: 1 }}>
|
|
|
{/* <ProductList /> */}
|
|
{/* <ProductList /> */}
|
|
|
{/* <Text style={{fontSize:30,color:'#fff'}} onClick={iap}>iap test</Text> */}
|
|
{/* <Text style={{fontSize:30,color:'#fff'}} onClick={iap}>iap test</Text> */}
|
|
@@ -229,15 +232,21 @@ export default function Page() {
|
|
|
<Text className="setting_header">Reminders</Text>
|
|
<Text className="setting_header">Reminders</Text>
|
|
|
<View className="setting_cell">
|
|
<View className="setting_cell">
|
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>At my scheduled time</Text>
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>At my scheduled time</Text>
|
|
|
- <Text className="setting_cell_value1">{systemFast ? 'Always' : 'Off'}</Text>
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ isLogin?<Text className="setting_cell_value1">{systemFast ? 'Always' : 'Off'}</Text>:
|
|
|
|
|
+ <Text className="setting_cell_value1">Off</Text>
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
</View>
|
|
</View>
|
|
|
<Text className="setting_footer">A timely reminder so you never miss your scheduled time for fasting or sleep.</Text>
|
|
<Text className="setting_footer">A timely reminder so you never miss your scheduled time for fasting or sleep.</Text>
|
|
|
<Text className="setting_header">Extra Reminders</Text>
|
|
<Text className="setting_header">Extra Reminders</Text>
|
|
|
<View className="setting_cell">
|
|
<View className="setting_cell">
|
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>If I missed previous action</Text>
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>If I missed previous action</Text>
|
|
|
- <Switch className="myswitch" value={isExtra} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
|
|
|
|
|
- debugger
|
|
|
|
|
- // setIsMulti(e.nativeEvent.value)
|
|
|
|
|
|
|
+ <Switch className="myswitch" value={isLogin?isExtra:false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
|
|
|
|
|
+ if (!isLogin){
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const value = e.nativeEvent.value
|
|
const value = e.nativeEvent.value
|
|
|
postNotifySettings({
|
|
postNotifySettings({
|
|
|
notification: {
|
|
notification: {
|
|
@@ -261,8 +270,12 @@ export default function Page() {
|
|
|
<View className="setting_cell_group">
|
|
<View className="setting_cell_group">
|
|
|
<View className="setting_cell_group_item">
|
|
<View className="setting_cell_group_item">
|
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Sunrise</Text>
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Sunrise</Text>
|
|
|
- <Switch className="myswitch" value={isSunrise} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
|
|
|
|
|
|
|
+ <Switch className="myswitch" value={isLogin?isSunrise:false} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
|
|
|
// setIsMulti(e.nativeEvent.value)
|
|
// setIsMulti(e.nativeEvent.value)
|
|
|
|
|
+ if (!isLogin){
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const value = e.nativeEvent.value
|
|
const value = e.nativeEvent.value
|
|
|
if (e.nativeEvent.value) {
|
|
if (e.nativeEvent.value) {
|
|
|
if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
|
|
if (accessObj && accessObj.access && accessObj.access.member.status == 'NON_MEMBER') {
|
|
@@ -292,8 +305,12 @@ export default function Page() {
|
|
|
</View>
|
|
</View>
|
|
|
<View className="setting_cell_group_item">
|
|
<View className="setting_cell_group_item">
|
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Sunset</Text>
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Sunset</Text>
|
|
|
- <Switch className="myswitch" value={isSunset} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
|
|
|
|
|
|
|
+ <Switch className="myswitch" value={isLogin?isSunset:false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
|
|
|
// setIsMulti(e.nativeEvent.value)
|
|
// setIsMulti(e.nativeEvent.value)
|
|
|
|
|
+ if (!isLogin){
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const value = e.nativeEvent.value
|
|
const value = e.nativeEvent.value
|
|
|
if (e.nativeEvent.value) {
|
|
if (e.nativeEvent.value) {
|
|
|
if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
|
|
if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
|
|
@@ -322,8 +339,12 @@ export default function Page() {
|
|
|
</View>
|
|
</View>
|
|
|
<View className="setting_cell_group_item">
|
|
<View className="setting_cell_group_item">
|
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Solar Noon</Text>
|
|
<Text className="setting_cell_title" style={{ flex: 1 }}>Solar Noon</Text>
|
|
|
- <Switch className="myswitch" value={isSolarNoon} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
|
|
|
|
|
|
|
+ <Switch className="myswitch" value={isLogin?isSolarNoon:false} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
|
|
|
// setIsMulti(e.nativeEvent.value)
|
|
// setIsMulti(e.nativeEvent.value)
|
|
|
|
|
+ if (!isLogin){
|
|
|
|
|
+ jumpPage('/pages/account/ChooseAuth', 'ChooseAuth', navigation)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
const value = e.nativeEvent.value
|
|
const value = e.nativeEvent.value
|
|
|
if (e.nativeEvent.value) {
|
|
if (e.nativeEvent.value) {
|
|
|
if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
|
|
if (accessObj && accessObj.access && accessObj.member.status == 'NON_MEMBER') {
|
|
@@ -371,21 +392,16 @@ export default function Page() {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return <View className="container" style={{ flex: 1 }}>
|
|
|
|
|
- {/* <View className='setting_segment'>
|
|
|
|
|
- <Segment titles={[
|
|
|
|
|
- `Free`,
|
|
|
|
|
- `Pro`,
|
|
|
|
|
- ]}
|
|
|
|
|
- changed={(e) => {
|
|
|
|
|
- setSegmentIndex(e);
|
|
|
|
|
- // global.segmentIndex = e
|
|
|
|
|
- // console.log('segment item click', e)
|
|
|
|
|
- }} />
|
|
|
|
|
- </View> */}
|
|
|
|
|
|
|
+ if (!user.isLogin)
|
|
|
|
|
+ return <View className="container" style={{ flex: 1 }}>
|
|
|
|
|
+ {
|
|
|
|
|
+ pro(false)
|
|
|
|
|
+ }
|
|
|
|
|
+ </View>
|
|
|
|
|
|
|
|
|
|
+ return <View className="container" style={{ flex: 1 }}>
|
|
|
{
|
|
{
|
|
|
- loaded && pro()
|
|
|
|
|
|
|
+ loaded && pro(true)
|
|
|
}
|
|
}
|
|
|
{
|
|
{
|
|
|
process.env.TARO_ENV == 'rn' && kIsAndroid && checkSystemChannel() && <View className="setting_tip" onClick={goSetting}>
|
|
process.env.TARO_ENV == 'rn' && kIsAndroid && checkSystemChannel() && <View className="setting_tip" onClick={goSetting}>
|