setLoginVisible(false)} onSuccess={handleLoginSuccess} needPhone={needPhone} />
)}
>
);
diff --git a/src/components/login-dialog/index.less b/src/components/login-dialog/index.less
index dd69a63..96a3a68 100644
--- a/src/components/login-dialog/index.less
+++ b/src/components/login-dialog/index.less
@@ -17,22 +17,4 @@
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
margin-top: 40px;
}
-
- &__cancel-button {
- min-width: fit-content;
- font-size: 28px;
- line-height: 32px;
- color: @blHighlightColor;
- background: transparent;
- border: none;
- margin-top: 40px;
-
- &::after {
- border-color: transparent
- }
- }
-
- &__checkbox {
- margin-top: 40px;
- }
}
diff --git a/src/components/login-dialog/index.tsx b/src/components/login-dialog/index.tsx
index 8a65571..317c9ed 100644
--- a/src/components/login-dialog/index.tsx
+++ b/src/components/login-dialog/index.tsx
@@ -1,18 +1,12 @@
-import { Button } from '@tarojs/components';
-
import { Dialog } from '@taroify/core';
-import { useCallback, useState } from 'react';
import PhoneButton, { IPhoneButtonProps } from '@/components/phone-button';
-import { ProtocolPrivacyCheckbox } from '@/components/protocol-privacy';
-import Toast from '@/utils/toast';
import './index.less';
interface IProps {
title?: string;
onCancel: () => void;
- disableCheck?: boolean;
needPhone?: IPhoneButtonProps['needPhone'];
onSuccess?: IPhoneButtonProps['onSuccess'];
onBindPhone?: IPhoneButtonProps['onBindPhone'];
@@ -21,46 +15,21 @@ interface IProps {
const PREFIX = 'login-dialog';
export default function LoginDialog(props: IProps) {
- const {
- title = '使用播络服务前,请先登录',
- disableCheck = false,
- needPhone,
- onSuccess,
- onCancel,
- onBindPhone,
- } = props;
- const [checked, setChecked] = useState(disableCheck);
-
- const handleTipCheck = useCallback(() => {
- Toast.info('请先阅读并同意协议');
- }, []);
+ const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
return (
diff --git a/src/components/partner-kanban/index.tsx b/src/components/partner-kanban/index.tsx
index 5190b2c..ce43d1b 100644
--- a/src/components/partner-kanban/index.tsx
+++ b/src/components/partner-kanban/index.tsx
@@ -74,7 +74,7 @@ function WithdrawDialog(props: { open: boolean; onClose: () => void; count: numb
{+props.count}
元
- 单笔最大500元
+ 单日提现最大200元
@@ -193,7 +193,7 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
{!simple && }
{!simple && (
diff --git a/src/components/phone-button/index.tsx b/src/components/phone-button/index.tsx
index 542449f..91199e2 100644
--- a/src/components/phone-button/index.tsx
+++ b/src/components/phone-button/index.tsx
@@ -19,7 +19,7 @@ export interface IPhoneButtonProps extends ButtonProps {
message?: string;
// 绑定后是否需要刷新接口获取手机号
needPhone?: boolean;
- onBindPhone?: (status: BindPhoneStatus) => void;
+ onBindPhone?: (status: BindPhoneStatus, e: ITouchEvent) => void;
onSuccess?: (e: ITouchEvent) => void;
}
@@ -44,17 +44,17 @@ export default function PhoneButton(props: IPhoneButtonProps) {
const encryptedData = e.detail.encryptedData;
const iv = e.detail.iv;
if (!encryptedData || !iv) {
- onBindPhone?.(BindPhoneStatus.Cancel);
+ onBindPhone?.(BindPhoneStatus.Cancel, e as ITouchEvent);
return Toast.error('取消授权');
}
try {
await setPhoneNumber({ encryptedData, iv });
needPhone && (await requestUserInfo());
Toast.success(message);
- onBindPhone?.(BindPhoneStatus.Success);
+ onBindPhone?.(BindPhoneStatus.Success, e as ITouchEvent);
onSuccess?.(e as ITouchEvent);
} catch (err) {
- onBindPhone?.(BindPhoneStatus.Error);
+ onBindPhone?.(BindPhoneStatus.Error, e as ITouchEvent);
Toast.error('绑定失败');
log('bind phone fail', err);
}
diff --git a/src/constants/cache-key.ts b/src/constants/cache-key.ts
index 3b82f17..594ca08 100644
--- a/src/constants/cache-key.ts
+++ b/src/constants/cache-key.ts
@@ -10,5 +10,6 @@ export enum CacheKey {
LAST_SELECT_MY_JOB = '__last_select_my_job__',
CLOSE_PARTNER_BANNER = '__close_partner_banner__',
INVITE_CODE = '__invite_code__',
- AGREEMENT_SIGNED = '__agreement_signed__'
+ AGREEMENT_SIGNED = '__agreement_signed__',
+ CITY_CODES = '__city_codes__',
}
diff --git a/src/pages/anchor/index.tsx b/src/pages/anchor/index.tsx
index e0cc517..c46c9c6 100644
--- a/src/pages/anchor/index.tsx
+++ b/src/pages/anchor/index.tsx
@@ -186,7 +186,7 @@ export default function AnchorPage() {
});
useShareAppMessage(() => {
- return getCommonShareMessage(true, inviteCode);
+ return getCommonShareMessage(true, inviteCode, '数万名优质主播等你来挑');
});
useDidShow(() => requestUnreadMessageCount());
diff --git a/src/pages/group-v2/index.tsx b/src/pages/group-v2/index.tsx
index be3f6d0..062efd8 100644
--- a/src/pages/group-v2/index.tsx
+++ b/src/pages/group-v2/index.tsx
@@ -11,6 +11,7 @@ import { getCurrentCityCode } from '@/utils/location';
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
import { getPageQuery } from '@/utils/route';
import { getCommonShareMessage } from '@/utils/share';
+import { checkCityCode } from '@/utils/user';
import './index.less';
const PREFIX = 'group-v2-page';
@@ -26,6 +27,9 @@ export default function GroupV2() {
useShareAppMessage(() => getCommonShareMessage(true, inviteCode));
const handleSelectCity = useCallback(cityCode => {
+ if (!checkCityCode(cityCode)) {
+ return;
+ }
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
if (group) {
openCustomerServiceChat(group.serviceUrl);
diff --git a/src/pages/job-detail/index.tsx b/src/pages/job-detail/index.tsx
index a939a34..2a3bcf9 100644
--- a/src/pages/job-detail/index.tsx
+++ b/src/pages/job-detail/index.tsx
@@ -112,7 +112,6 @@ const AnchorFooter = (props: { data: JobDetails }) => {
}, [data]);
const handleDialogHidden = useCallback(() => setDialogVisible(false), []);
-
return (
<>
diff --git a/src/pages/user-batch-publish/index.tsx b/src/pages/user-batch-publish/index.tsx
index b5dba25..c5cac68 100644
--- a/src/pages/user-batch-publish/index.tsx
+++ b/src/pages/user-batch-publish/index.tsx
@@ -11,6 +11,7 @@ import useInviteCode from '@/hooks/use-invite-code';
import { openCustomerServiceChat } from '@/utils/common';
import { getCurrentCityCode } from '@/utils/location';
import { getCommonShareMessage } from '@/utils/share';
+import { checkCityCode } from '@/utils/user';
import './index.less';
const PREFIX = 'page-biz-service';
@@ -22,6 +23,9 @@ export default function BizService() {
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
}, []);
const handleSelectCity = useCallback(cityCode => {
+ if (!checkCityCode(cityCode)) {
+ return;
+ }
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
if (group) {
openCustomerServiceChat(group.serviceUrl);
diff --git a/src/utils/share.ts b/src/utils/share.ts
index eff7582..f30082e 100644
--- a/src/utils/share.ts
+++ b/src/utils/share.ts
@@ -15,10 +15,14 @@ const getRandomCount = () => {
return (seed % 300) + 500;
};
-export const getCommonShareMessage = (useCapture: boolean = true, inviteCode?: string): ShareAppMessageReturn => {
+export const getCommonShareMessage = (
+ useCapture: boolean = true,
+ inviteCode?: string,
+ title?: string
+): ShareAppMessageReturn => {
console.log('share share message', getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined));
return {
- title: `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
+ title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
path: getJumpUrl(PageUrl.Job, inviteCode ? { c: inviteCode } : undefined),
imageUrl: useCapture ? undefined : imageUrl,
};
diff --git a/src/utils/user.ts b/src/utils/user.ts
index 3915838..227e05f 100644
--- a/src/utils/user.ts
+++ b/src/utils/user.ts
@@ -151,3 +151,20 @@ export async function followGroup(blGroupId: FollowGroupRequest['blGroupId']) {
export const getAgreementSigned = (): boolean | '' => Taro.getStorageSync(CacheKey.AGREEMENT_SIGNED);
export const setAgreementSigned = (signed: boolean) => Taro.setStorageSync(CacheKey.AGREEMENT_SIGNED, signed);
+export const getCityCodes = (): string[] => {
+ const cachedValue = Taro.getStorageSync(CacheKey.CITY_CODES);
+ return !cachedValue || !Array.isArray(cachedValue) ? [] : cachedValue;
+};
+export const setCityCodes = (cityCode: string[]) => Taro.setStorageSync(CacheKey.CITY_CODES, cityCode);
+export const checkCityCode = (cityCode: string): boolean => {
+ const cachedCityCodes = getCityCodes();
+ const isNewCityCode = cachedCityCodes.indexOf(cityCode) === -1;
+ if (cachedCityCodes.length === 2 && isNewCityCode) {
+ Toast.info('最多只能进入2个城市');
+ return false;
+ }
+ if (isNewCityCode) {
+ setCityCodes([...cachedCityCodes, cityCode]);
+ }
+ return true;
+};