分享添加

This commit is contained in:
saplf
2019-09-07 22:12:57 +08:00
parent 5611bdb69e
commit 1c0e5ddb66
7 changed files with 32 additions and 16 deletions

View File

@@ -68,7 +68,7 @@ const model: Model = {
if (confirm !== newPwd) return message.warn(formatMessage({ id: 'check.msgConfirm' })); if (confirm !== newPwd) return message.warn(formatMessage({ id: 'check.msgConfirm' }));
yield put({ type: 'onUpdateState', submitting: true }); yield put({ type: 'onUpdateState', submitting: true });
try { try {
yield call(changeFundPwd, newPwd, originVisible ? undefined : origin); yield call(changeFundPwd, newPwd, originVisible ? origin : undefined);
yield put(routerRedux.goBack()); yield put(routerRedux.goBack());
message.success(formatMessage({ id: 'fundpwd.success' })); message.success(formatMessage({ id: 'fundpwd.success' }));
} catch (e) { } catch (e) {

View File

@@ -43,7 +43,7 @@ const CommunityPage: React.FC<HomeCommunityModelState & DispatchProp> = ({
<div className="bg" /> <div className="bg" />
<span className="title">{formatMessage({ id: 'home.community.total' })}</span> <span className="title">{formatMessage({ id: 'home.community.total' })}</span>
<span className="content"> <span className="content">
<span className="large">+{info ? info.rewardAll : 0} USDT</span> <span className="large">+{info ? info.reward : 0} USDT</span>
</span> </span>
<div className={styles.card}> <div className={styles.card}>
<div className="left"> <div className="left">
@@ -51,14 +51,14 @@ const CommunityPage: React.FC<HomeCommunityModelState & DispatchProp> = ({
{formatMessage({ {formatMessage({
id: 'home.community.totalInvited', id: 'home.community.totalInvited',
}, { }, {
num: info ? info.followerNumber : 0, num: info ? info.follower : 0,
})} })}
</span> </span>
<span className="line"> <span className="line">
{formatMessage({ {formatMessage({
id: 'home.community.totalAll', id: 'home.community.totalAll',
}, { }, {
num: info ? info.communeNumber : 0, num: info ? info.groupScale : 0,
})} })}
</span> </span>
</div> </div>

View File

@@ -6,7 +6,7 @@ export async function getCommunityBasic(): Promise<CommunityBasic> {
ok, ok,
data, data,
msg, msg,
} = await http.get<CommunityBasic>('/commune/basic'); } = await http.get<CommunityBasic>('/community/basic');
if (ok && data) { if (ok && data) {
return data; return data;
} }
@@ -18,7 +18,7 @@ export async function getCommunityList(pageIndex: number, pageSize: number): Pro
ok, ok,
data, data,
msg, msg,
} = await http.get<Inviters>('/commune/list', { } = await http.get<Inviters>('/community/list', {
pageIndex, pageIndex,
pageSize, pageSize,
}); });

View File

@@ -15,6 +15,7 @@ import Header from '@/components/Header';
import styles from './style.less'; import styles from './style.less';
import { UserModelState } from '@/models/user'; import { UserModelState } from '@/models/user';
import { generateInviteHref } from './service'; import { generateInviteHref } from './service';
import { isApp, share } from '@/utils/h5plus';
const InvitePage: React.FC<DispatchProp & InviteModelState & UserModelState> = ({ const InvitePage: React.FC<DispatchProp & InviteModelState & UserModelState> = ({
dispatch, dispatch,
@@ -59,9 +60,14 @@ const InvitePage: React.FC<DispatchProp & InviteModelState & UserModelState> = (
<Icon type="copy" theme="filled" /> <Icon type="copy" theme="filled" />
</Clipboard> </Clipboard>
</div> </div>
<Button type="primary"> {isApp() && (
<Button
type="primary"
onClick={() => share(href)}
>
{formatMessage({ id: 'invite.btn' })} {formatMessage({ id: 'invite.btn' })}
</Button> </Button>
)}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -232,17 +232,17 @@ export interface CommunityBasic {
/** /**
* 累计奖励总额的数字 * 累计奖励总额的数字
*/ */
rewardAll: string; reward: string;
/** /**
* 直接邀请人数 * 直接邀请人数
*/ */
followerNumber: string; follower: string;
/** /**
* 社区总人数 * 社区总人数
*/ */
communeNumber: string; groupScale: string;
} }
export interface Inviter { export interface Inviter {

View File

@@ -362,7 +362,7 @@ interface ShareWrapper {
/** /**
* 使用系统组件发送分享 * 使用系统组件发送分享
*/ */
sendWithSystem: (message: ShareMessage, successCB: () => any, errorCB: (err: DOMException) => any) => any; sendWithSystem: (message: ShareMessage, successCB: () => any, errorCB?: (err: DOMException) => any) => any;
} }
type AppKeyType = type AppKeyType =

View File

@@ -28,7 +28,7 @@ const scan = () => {
webview.currentWebview().append(bc); webview.currentWebview().append(bc);
bc.start(); bc.start();
}); });
} };
const firstPaths = [ const firstPaths = [
'/check', '/check',
@@ -53,17 +53,26 @@ const backButtonHandler = () => {
const init = () => { const init = () => {
if (!isApp()) return; if (!isApp()) return;
plus.key.addEventListener('backbutton', backButtonHandler); plus.key.addEventListener('backbutton', backButtonHandler);
} };
const destory = () => { const destory = () => {
if (!isApp()) return; if (!isApp()) return;
plus.key.removeEventListener('backbutton', backButtonHandler); plus.key.removeEventListener('backbutton', backButtonHandler);
} };
const share = (content: string) => {
if (!isApp()) return;
plus.share.sendWithSystem({
type: 'text',
content,
}, () => { });
};
export { export {
init, init,
isApp, isApp,
scan, scan,
share,
destory, destory,
}; };
@@ -71,5 +80,6 @@ export default {
init, init,
isApp, isApp,
scan, scan,
share,
destory, destory,
}; };