|
@@ -1,186 +1,15 @@
|
|
|
-import { View, Text, Button } from "@tarojs/components";
|
|
|
-import { useState } from "react";
|
|
|
-import Taro, { useDidShow, useRouter } from "@tarojs/taro";
|
|
|
-import MemberRights from "./components/member-rights/index";
|
|
|
-import ListRow from "@/components/list/list-row";
|
|
|
-import { useAppStore } from "@/store/appStore";
|
|
|
-import { useUserStore } from "@/store/userStore";
|
|
|
-import { formatDate } from "@/utils/index";
|
|
|
-import NavBar from "@/components/nav-bar/index";
|
|
|
-import { navToWebView, navToVip } from "@/utils/index";
|
|
|
-import { ENABLE_UPGRADE_VIP, VIP_LEVEL } from "@/config/index";
|
|
|
-// import PopupMp from "@/components/popup/popup-mp";
|
|
|
-import { APP_STORY_URL, APP_AGREEMENT_URL } from "@/config";
|
|
|
-import { reportPageVisit, reportClicked } from "@/utils/report";
|
|
|
-import TabPageWrapper from "@/components/tab-page-wrapper/index";
|
|
|
-import ListRowAuthPhone from "./components/list-row-auth-phone/index";
|
|
|
-import { IS_MINI_GREEN_LEAF } from "@/config";
|
|
|
-import PopupModal from '@/components/popup/popup-modal'
|
|
|
+import { View, Text, Image } from "@tarojs/components";
|
|
|
+import Taro, { useDidShow } from "@tarojs/taro";
|
|
|
+import NavBarNormal from "@/components/nav-bar-normal/index";
|
|
|
+import PageCustom from "@/components/page-custom/index";
|
|
|
|
|
|
export default () => {
|
|
|
- const isIos = useAppStore((state) => state.isIos);
|
|
|
- const appConfig = useAppStore((state) => state.appConfig);
|
|
|
- const { fetchUser } = useUserStore();
|
|
|
- const user = useUserStore((state) => state.user);
|
|
|
- const { fetchAppConfig } = useAppStore();
|
|
|
- const vip = user?.vip ?? VIP_LEVEL.FREE;
|
|
|
- const [visible, setVisible] = useState(false);
|
|
|
- const router = useRouter();
|
|
|
- console.log(router.params)
|
|
|
- const goVip = () => {
|
|
|
- // isIos && appConfig?.auditing
|
|
|
- if (isIos) {
|
|
|
- reportClicked("upgradeButton");
|
|
|
-
|
|
|
- setVisible(true);
|
|
|
- // Taro.showModal({
|
|
|
- // content: '根据微信规定,iOS平台暂不提供支付功能。',
|
|
|
- // showCancel: false,
|
|
|
- // });
|
|
|
- } else {
|
|
|
- reportClicked("upgradeButton");
|
|
|
- navToVip();
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- // 每次显示都要重新获取,用户可能在公众号充值成为 vip
|
|
|
- useDidShow(() => {
|
|
|
- fetchAppConfig();
|
|
|
- fetchUser();
|
|
|
- });
|
|
|
-
|
|
|
- reportPageVisit();
|
|
|
-
|
|
|
- const renderCardHeader = () => {
|
|
|
- if (!ENABLE_UPGRADE_VIP) {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Text className="text-black text-16 leading-24 font-medium py-12 flex-1">
|
|
|
- 普通会员
|
|
|
- </Text>
|
|
|
- </>
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- if (vip === VIP_LEVEL.SUPER) {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <View className="flex flex-col gap-2 flex-1">
|
|
|
- <Text className="text-black text-16 leading-24 font-medium">
|
|
|
- 超级会员
|
|
|
- </Text>
|
|
|
- {user?.vipExpireAt && (
|
|
|
- <View className="text-black-6 text-12 leading-20">
|
|
|
- 有效期至 {formatDate(new Date(user.vipExpireAt))}
|
|
|
- </View>
|
|
|
- )}
|
|
|
- </View>
|
|
|
- </>
|
|
|
- );
|
|
|
- }
|
|
|
- if (vip === VIP_LEVEL.PLUS) {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <View className="flex flex-col gap-2 flex-1">
|
|
|
- <Text className="text-black text-16 leading-24 font-medium">
|
|
|
- 高级会员
|
|
|
- </Text>
|
|
|
- {user?.vipExpireAt && (
|
|
|
- <View className="text-black-6 text-12 leading-20">
|
|
|
- 有效期至 {formatDate(new Date(user.vipExpireAt))}
|
|
|
- </View>
|
|
|
- )}
|
|
|
- </View>
|
|
|
- <View
|
|
|
- className="text-black-3 px-12 py-6 text-12 leading-20 rounded-50 bg-white font-medium"
|
|
|
- onClick={goVip}
|
|
|
- >
|
|
|
- 升级超级权益
|
|
|
- </View>
|
|
|
- </>
|
|
|
- );
|
|
|
- }
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Text className="text-black text-16 leading-24 font-medium py-12 flex-1">
|
|
|
- 普通会员
|
|
|
- </Text>
|
|
|
- <View
|
|
|
- className="text-black-3 px-12 py-6 text-12 leading-20 rounded-50 bg-white font-medium"
|
|
|
- onClick={goVip}
|
|
|
- >
|
|
|
- 升级权益
|
|
|
- </View>
|
|
|
- </>
|
|
|
- );
|
|
|
- };
|
|
|
-
|
|
|
+
|
|
|
return (
|
|
|
- <TabPageWrapper>
|
|
|
- <NavBar>
|
|
|
- <View className="flex items-center">
|
|
|
- <Text>会员</Text>
|
|
|
- </View>
|
|
|
- </NavBar>
|
|
|
-
|
|
|
- <View className="w-full">
|
|
|
- <View className="w-full flex py-24 px-20 bg-primary-color rounded-20">
|
|
|
- <View className="flex w-full flex-col gap-36 items-start">
|
|
|
- <View className="flex w-full items-center">
|
|
|
- {appConfig && renderCardHeader()}
|
|
|
- </View>
|
|
|
-
|
|
|
- {appConfig && (
|
|
|
- <MemberRights vip={vip} appConfig={appConfig}></MemberRights>
|
|
|
- )}
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- <View className="flex flex-col gap-8 w-full pt-32 mb-38">
|
|
|
- {IS_MINI_GREEN_LEAF && (
|
|
|
- <>
|
|
|
- <ListRow
|
|
|
- emoji="😎"
|
|
|
- label="产品故事"
|
|
|
- onClick={() => navToWebView(APP_STORY_URL)}
|
|
|
- ></ListRow>
|
|
|
- <ListRow
|
|
|
- emoji="💌"
|
|
|
- label="服务协议"
|
|
|
- onClick={() => navToWebView(APP_AGREEMENT_URL)}
|
|
|
- ></ListRow>
|
|
|
- </>
|
|
|
- )}
|
|
|
- <ListRow emoji="🌟" label="提一些想法">
|
|
|
- <Button
|
|
|
- openType="contact"
|
|
|
- className="absolute left-0 top-0 right-0 bottom-0 opacity-0"
|
|
|
- ></Button>
|
|
|
- </ListRow>
|
|
|
-
|
|
|
- <ListRowAuthPhone></ListRowAuthPhone>
|
|
|
- {/* <ListRow
|
|
|
- label="版本说明"
|
|
|
- arrow={false}
|
|
|
- rightRenderer={() => (
|
|
|
- <Text className="text-black-3 text-14 leading-22">
|
|
|
- v{APP_VERSION}
|
|
|
- </Text>
|
|
|
- )}
|
|
|
- ></ListRow> */}
|
|
|
- {/* <ListRow label="安全退出"></ListRow> */}
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- <PopupModal show={visible} setShow={setVisible}>
|
|
|
- <View className="mb-10">根据微信规定,iOS平台暂不提供支付功能。</View>
|
|
|
- <View className="w-4/5 h-30 relative">
|
|
|
- <Button
|
|
|
- openType="contact"
|
|
|
- className="absolute left-0 top-0 right-0 bottom-0 opacity-0"
|
|
|
- ></Button>
|
|
|
- 更多咨询请 <Text className="primary-color-dark">联系客服</Text>
|
|
|
- </View>
|
|
|
- </PopupModal>
|
|
|
- {/* <PopupMp show={visible} onClose={() => setVisible(false)}></PopupMp> */}
|
|
|
- </TabPageWrapper>
|
|
|
+ <PageCustom>
|
|
|
+ <NavBarNormal leftColumn={()=> <Text>我的</Text>}>
|
|
|
+ </NavBarNormal>
|
|
|
+ <View className="p-20">暂无数据</View>
|
|
|
+ </PageCustom>
|
|
|
);
|
|
|
};
|