feat: first commit
This commit is contained in:
24
src/utils/share.ts
Normal file
24
src/utils/share.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import type { ShareAppMessageReturn } from '@tarojs/taro';
|
||||
|
||||
import { PageUrl } from '@/constants/app';
|
||||
|
||||
import { getJumpUrl } from './route';
|
||||
|
||||
const imageUrl = 'https://neighbourhood.cn/share_d.jpg';
|
||||
|
||||
const getRandomCount = () => {
|
||||
const date = new Date();
|
||||
const year = date.getFullYear();
|
||||
const month = date.getMonth();
|
||||
const day = date.getDate();
|
||||
const seed = (year + month + day) * day;
|
||||
return (seed % 300) + 500;
|
||||
};
|
||||
|
||||
export const getCommonShareMessage = (useCapture: boolean = true): ShareAppMessageReturn => {
|
||||
return {
|
||||
title: `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
||||
path: getJumpUrl(PageUrl.Job),
|
||||
imageUrl: useCapture ? undefined : imageUrl,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user