Compare commits
28 Commits
feature/jo
...
3d2b121b92
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d2b121b92 | |||
| 7ba04b27ff | |||
| 7f866c51be | |||
| fe33d0493c | |||
| 87f8e1f7e2 | |||
| afa94e2c48 | |||
| b8b33841d4 | |||
| 828e9b7512 | |||
| 1d8a0d7a33 | |||
| 8c5fd1a86b | |||
| a4e03ae1bd | |||
| 8e42fef4f7 | |||
| 6f7e78896a | |||
| b9cd0a3e6d | |||
| c0d27a5ab2 | |||
| 6d76c82e96 | |||
| f2e7fd9d85 | |||
| 087e05a9a0 | |||
| aea8323d95 | |||
| 61686950bd | |||
| eea89263f2 | |||
| 285db3f445 | |||
| d0369bab36 | |||
| 898c6ab6ca | |||
| 763a6245d2 | |||
| 670a389f12 | |||
| 2cb532c3d7 | |||
| 6a2c94c7cf |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
dist/
|
dist/
|
||||||
|
dist-dev/
|
||||||
deploy_versions/
|
deploy_versions/
|
||||||
.temp/
|
.temp/
|
||||||
.rn_temp/
|
.rn_temp/
|
||||||
|
|||||||
@ -12,6 +12,20 @@ const MockPlugin: PluginItem = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const CIPluginOpt = () => {
|
||||||
|
const brand = process.env.BRAND as 'prod' | 'dev'; // 取环境变量
|
||||||
|
const map = {
|
||||||
|
prod: { appid: 'wxf0724a83f8e377d2', privateKeyPath: 'keys/private.wxf0724a83f8e377d2.key' },
|
||||||
|
dev: { appid: 'wx2d56597fd541f1a6', privateKeyPath: 'keys/private.wx2d56597fd541f1a6.key' },
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
weapp: map[brand] || map.prod,
|
||||||
|
version: process.env.VERSION || '1.0.0',
|
||||||
|
desc: `build for ${brand}`,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
|
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
|
||||||
export default defineConfig(async (merge, _env: ConfigEnv) => {
|
export default defineConfig(async (merge, _env: ConfigEnv) => {
|
||||||
const baseConfig: UserConfigExport = {
|
const baseConfig: UserConfigExport = {
|
||||||
@ -25,13 +39,15 @@ export default defineConfig(async (merge, _env: ConfigEnv) => {
|
|||||||
828: 1.81 / 2
|
828: 1.81 / 2
|
||||||
},
|
},
|
||||||
sourceRoot: 'src',
|
sourceRoot: 'src',
|
||||||
outputRoot: 'dist',
|
outputRoot: process.env.OUTPUT_ROOT || 'dist',
|
||||||
plugins: ['@tarojs/plugin-html'],
|
plugins: [['@tarojs/plugin-mini-ci', CIPluginOpt()], '@tarojs/plugin-html'],
|
||||||
// plugins: ['@tarojs/plugin-html', MockPlugin],
|
// plugins: ['@tarojs/plugin-html', MockPlugin],
|
||||||
defineConstants: {
|
defineConstants: {
|
||||||
|
'process.env.BRAND': JSON.stringify(process.env.BRAND),
|
||||||
},
|
},
|
||||||
copy: {
|
copy: {
|
||||||
patterns: [
|
patterns: [
|
||||||
|
{from: 'project.config.dev.json',to: 'dist-dev/project.config.json'},
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
}
|
}
|
||||||
|
|||||||
27
keys/private.wx2d56597fd541f1a6.key
Normal file
27
keys/private.wx2d56597fd541f1a6.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEowIBAAKCAQEArjidDs/HGidBTzyOssyhX/Yvlr+BZxO3Qqe1iFBIJYWVXwiJ
|
||||||
|
KFVZw14rPKnh6ORB9qpMq3+fYJ7VsodmobnVlTaFXxJ8yi+tVZSZyZPtHabu2JVO
|
||||||
|
qu7LX709p5NTFcrmOY6+NJA827+hg6V0Nl3b4CWLsouPHgiIxpqnLeaOka3lbPMq
|
||||||
|
vQuDeMCbQNFe5Jz7C0gc6dXwEpDExNX4WiVfi4UP5bcYiUKlbdben5i6qbFrZ4QK
|
||||||
|
woYoAIhr60jQGfB6Jg7YkbbAyh42XR3BMkf2TPQqieZM1/IKNuw2evtA2BqLJuiz
|
||||||
|
cQ1qNBBXczbJv9KjBVAzAJgT4InUyJF+QfFJ6wIDAQABAoIBAQCf2kohIPvqP0Jp
|
||||||
|
VYMJA0C+L8CSbLxqu2hWvFKP9Dl+VAct30MZwtZNr8W0L5uceHMdxDv8z2iI2rPw
|
||||||
|
ztOYaE5UTmYpSWk+imhcMbC5iAT0RAq6pqQ7qkboXVaIv2BoinabMSHMUNvGNRoZ
|
||||||
|
FGKAz7XDADAhbnOudt4ofBYQw47kkko8vaDZBJS6UGN+QVJpyBtJKohaXKC6HRva
|
||||||
|
2c8zDwVZlKMrPl4WB4cg0+WPv6vUZymv8U7flwY0xJBBWwZUxqbmjqbTg8BGb5Mu
|
||||||
|
tpIZRvTGNxbDu9Ms7mdYdGGe/PFmqgj1hOomeXvBlnYz+fmWHu5ElyPGBHD92N7x
|
||||||
|
Hdcopp4BAoGBANqQUfxzjGcBvSSSowehSvgVCnUFsTxSE8c9HQRX4LtMnLCo6c6m
|
||||||
|
Hxf+l67FyY5704EW29PLu5ETdLBm6pCaIk8aJo467l8M9BOHmE/CwNciloHxXa4h
|
||||||
|
/gUKex6EsFJoT+1gaCaDJeu0gDJl49QnpYOrma2CZ8vyG3+NCotuYturAoGBAMwP
|
||||||
|
8G2ObLZUFPZAfhGZrobUom2dCtJXenYupxSvJ/rNd7zY+F3pcyi461eMIkKFaxQX
|
||||||
|
bRyDi/LRCQRKrSDuw3Dt4Ne9gkpdlI/LUDTUUbWdDuCXxfsXSRAYHC1ae0rsiGQv
|
||||||
|
PaTotkDSjdAIKdgd0bmeufFZ2Ozmid2lHzSZfwrBAoGAQXSVSSClvLeVmJ1du8w/
|
||||||
|
MnrCrfctdB40lCemSAW1ZQJ1rqZ3lw7DIyF49buAOG63EeLxpMVQAAuul6HKv9GZ
|
||||||
|
Us1HHLNjbg3oDu093S07KXLPVk0dvCer9oCEDMi6MYPR5ApKRrZiJevhtLY0+/V/
|
||||||
|
qSY8GO2D/l0chR+NN+KwMo8CgYB4Y07s04G/b4uOXC4EJC6azQems2eXAJT29D8O
|
||||||
|
LOfhRybE+xxMC1YtSCtP0xTDOgMaL1fn4pPGBRzUs1nAfBxBm5VyshMT3HGxA7ml
|
||||||
|
8TzjcG0+g0wB/pLUM+UrvJ3QbgtpT5WGnOQpCg8wFCDbp3v7jnEUunUIDlp3sNrg
|
||||||
|
JU6WAQKBgDjcfRDtnmSxSiejsZaZM7gCAYlZq6WBuvQ6WF+nD9mzEgzkw3F+1cHC
|
||||||
|
Y905VPGb/vCPAV+JdN7LxnMn2G3JoWPqrhOIT6KgPgAYbVAq1hmLqXMjGi53n9uY
|
||||||
|
39GL4UgJkywIdEkla/8zNFNKZgQulWPDJqb/MFcVo3/VegEfwdbk
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
27
keys/private.wxf0724a83f8e377d2.key
Normal file
27
keys/private.wxf0724a83f8e377d2.key
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEpAIBAAKCAQEA1Tl6FYIIWB8b+OjYY9s6cOJf71Vn0J/u/kdq5CH/LMOdNrUh
|
||||||
|
fq3shAwdDkXmuRIpHU7Noxisu71tB2EumigIwBDRVyrdwPu/p6QWyaMgrh0bdtaC
|
||||||
|
LKW/j2teNU1MCSWyCDyEeZ9PJteK5+ieX+ZPDg17HLV2dISpB71AGyM461DIHCAV
|
||||||
|
uaanUJ4MYCtp9t7OFgrD4dNzDMH0lBJBczRQAmnit0GpJD/y2rfgtL+HaKpDN8rc
|
||||||
|
w80+3HVfhKq3niy/vBbI6alqFb1Mh9O5q6/c1tEWQKPn3TzneGIDhMupGzHEzrVR
|
||||||
|
j87+1cyYi8PtBdNMPls+zPn7MoajjrASFyo1hQIDAQABAoIBABHu652zehAvTaL5
|
||||||
|
snlzjs6/u2HdxQV+7hLk3tChK10QdsCLK24EIshYXHk+19Do/hxA7HqzMJP5spnU
|
||||||
|
Sp8cjt/YikLSkCQTCGOJIYGD/tOmDxFHqVsn9ZySYzIIdkSurvKSZHH2PCoAJuaq
|
||||||
|
Yeee7zc3WwtnF7dlEPJdsG6X38mqslzaLOuiftkHJ8hQ+1rWM9FFEp/S3pLfLB+7
|
||||||
|
jEQhuVk0WjLTqmWmKvi0Nz5tUibBpF1OHtCfIhPjb1N8k/bcv1jumETx+2PDxA62
|
||||||
|
zpPNGespBaET+jeEqNCqLO7Zq8+iUO8d4XpZsFCR2cyE6zzXK2mhQ+2pW2BRU/DI
|
||||||
|
w/ZylmECgYEA6uPRJ4uk+NavoJlQCv7R9B8CGbwzbRaG8sg/NuwvTOO6D4FGUdcu
|
||||||
|
f8qA2kCd8bSCuWrS1mVgPpvzwHt5Bh3k7FC/0SfW5ZDC5Lp1IssI0jeka39vfPOD
|
||||||
|
ZdcvgJ3dUnHUrvb4L4PclgCa3KPXLTVDnK+4ExvaYOxNAaG6wROCGBsCgYEA6GMy
|
||||||
|
nCsPr21kKmhybCrhcTYoENb45hz6CCnXr4MGnYzF9c2ss2KXjR/boCdhF+3wxmmm
|
||||||
|
F4TKgcicOUfOJIXSIHBD9nphLa5CfrksLxfX0iIyNCG74aXIWl6M6QgQZdWqV4qC
|
||||||
|
xYTtFYACELIb8qK/mraMP28c9BzDpwd909ZlAt8CgYEAmpXCIa+CrA3GWgBsMEBR
|
||||||
|
9sKthDha8/E+cOuexsubuZOp8OhYWiYuwQWJ1ZlvGRJ+cf6+sUDYnXvPaJ8aIA9u
|
||||||
|
iKQACWuZv02NJjEcRACxVoAuIl0lB2vPzydWaOP8M3UczuVUoxi6BLJzOMBPLb5/
|
||||||
|
N9BhaZoMF3uMloVUvhrTpH8CgYA9sQfgeXYChjHPKEcn/AI5Qb1FKyyMOikOPb1q
|
||||||
|
dIgvDw4GgQFV5diBuHFfhNS7u4jtw2I6YCA6b/05H5zUCUqNHgCM0FQ4AkjYx2O5
|
||||||
|
ZMUAnd9iA4qTDqWvh+Y0ftWLkztTXgv1T6J40LC7qezNbvMaqVd2B5NSIsi18MEw
|
||||||
|
mXvbVQKBgQC0Rh5TJEfeBWRoIixwFuDUgHYRsdk3SV1hymYO3aKBr0uD8Arv4v1M
|
||||||
|
XO6DchFjcpKuwScjXX5yEot5PJOUTPG2T2uBPnJggtNig2dnRzQDLM+bK0vVecoz
|
||||||
|
QL9YMOYv6DNH6Z2yEfMZHZLto9Oaqm9J62hZahZ2GukFLOMBGZAVhA==
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
31
package.json
31
package.json
@ -10,29 +10,10 @@
|
|||||||
"framework": "React"
|
"framework": "React"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:weapp": "taro build --type weapp",
|
"build:weapp": "BRAND=prod taro build --type weapp",
|
||||||
"build:swan": "taro build --type swan",
|
"build:dev:weapp": "BRAND=dev OUTPUT_ROOT=dist-dev taro build --type weapp --upload",
|
||||||
"build:alipay": "taro build --type alipay",
|
"dev:weapp": "BRAND=prod npm run build:weapp -- --watch",
|
||||||
"build:tt": "taro build --type tt",
|
"dev:dev:weapp": "BRAND=dev OUTPUT_ROOT=dist-dev taro build --type weapp --watch"
|
||||||
"build:h5": "taro build --type h5",
|
|
||||||
"build:rn": "taro build --type rn",
|
|
||||||
"build:qq": "taro build --type qq",
|
|
||||||
"build:jd": "taro build --type jd",
|
|
||||||
"build:quickapp": "taro build --type quickapp",
|
|
||||||
"build:harmony-hybrid": "taro build --type harmony-hybrid",
|
|
||||||
"dev:weapp": "npm run build:weapp -- --watch",
|
|
||||||
"dev:swan": "npm run build:swan -- --watch",
|
|
||||||
"dev:alipay": "npm run build:alipay -- --watch",
|
|
||||||
"dev:tt": "npm run build:tt -- --watch",
|
|
||||||
"dev:h5": "npm run build:h5 -- --watch",
|
|
||||||
"dev:rn": "npm run build:rn -- --watch",
|
|
||||||
"dev:qq": "npm run build:qq -- --watch",
|
|
||||||
"dev:jd": "npm run build:jd -- --watch",
|
|
||||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
|
||||||
"dev:harmony-hybrid": "npm run build:harmony-hybrid -- --watch",
|
|
||||||
"test": "jest",
|
|
||||||
"lint:format": "npx prettier --write",
|
|
||||||
"lint:format-all": "npx prettier --write 'src/**/*.{ts,js,css,jsx,html,vue,tsx}'"
|
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 3 versions",
|
"last 3 versions",
|
||||||
@ -76,6 +57,7 @@
|
|||||||
"@babel/core": "^7.8.0",
|
"@babel/core": "^7.8.0",
|
||||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
|
||||||
"@tarojs/cli": "4.0.9",
|
"@tarojs/cli": "4.0.9",
|
||||||
|
"@tarojs/plugin-mini-ci": "^4.1.5",
|
||||||
"@tarojs/plugin-mock": "^0.0.9",
|
"@tarojs/plugin-mock": "^0.0.9",
|
||||||
"@tarojs/taro-loader": "4.0.9",
|
"@tarojs/taro-loader": "4.0.9",
|
||||||
"@tarojs/test-utils-react": "^0.1.1",
|
"@tarojs/test-utils-react": "^0.1.1",
|
||||||
@ -95,6 +77,7 @@
|
|||||||
"eslint-plugin-react-hooks": "^4.2.0",
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
"jest": "^29.3.1",
|
"jest": "^29.3.1",
|
||||||
"jest-environment-jsdom": "^29.5.0",
|
"jest-environment-jsdom": "^29.5.0",
|
||||||
|
"miniprogram-ci": "^2.1.14",
|
||||||
"postcss": "^8.4.18",
|
"postcss": "^8.4.18",
|
||||||
"prettier": "^3.3.1",
|
"prettier": "^3.3.1",
|
||||||
"react-refresh": "^0.11.0",
|
"react-refresh": "^0.11.0",
|
||||||
@ -110,5 +93,5 @@
|
|||||||
"@tarojs/binding"
|
"@tarojs/binding"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
|
||||||
}
|
}
|
||||||
|
|||||||
6883
pnpm-lock.yaml
generated
6883
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
47
project.config.dev.json
Normal file
47
project.config.dev.json
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"miniprogramRoot": "./",
|
||||||
|
"description": "boluo app",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": true,
|
||||||
|
"es6": false,
|
||||||
|
"enhance": false,
|
||||||
|
"compileHotReLoad": false,
|
||||||
|
"postcss": false,
|
||||||
|
"minified": true,
|
||||||
|
"babelSetting": {
|
||||||
|
"ignore": [],
|
||||||
|
"disablePlugins": [],
|
||||||
|
"outputPath": ""
|
||||||
|
},
|
||||||
|
"coverView": false,
|
||||||
|
"showShadowRootInWxmlPanel": false,
|
||||||
|
"packNpmRelationList": [],
|
||||||
|
"ignoreUploadUnusedFiles": true,
|
||||||
|
"compileWorklet": false,
|
||||||
|
"uglifyFileName": false,
|
||||||
|
"uploadWithSourceMap": true,
|
||||||
|
"packNpmManually": false,
|
||||||
|
"minifyWXSS": true,
|
||||||
|
"minifyWXML": true,
|
||||||
|
"localPlugins": false,
|
||||||
|
"disableUseStrict": false,
|
||||||
|
"useCompilerPlugins": false,
|
||||||
|
"condition": false,
|
||||||
|
"swc": false,
|
||||||
|
"disableSWC": true
|
||||||
|
},
|
||||||
|
"compileType": "miniprogram",
|
||||||
|
"srcMiniprogramRoot": "dist/",
|
||||||
|
"condition": {},
|
||||||
|
"editorSetting": {
|
||||||
|
"tabIndent": "insertSpaces",
|
||||||
|
"tabSize": 2
|
||||||
|
},
|
||||||
|
"libVersion": "3.4.6",
|
||||||
|
"packOptions": {
|
||||||
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"appid": "wx2d56597fd541f1a6",
|
||||||
|
"simulatorPluginLibVersion": {}
|
||||||
|
}
|
||||||
30
src/app.tsx
30
src/app.tsx
@ -1,4 +1,4 @@
|
|||||||
import { useLaunch } from '@tarojs/taro';
|
import Taro, { useDidShow, useLaunch } from '@tarojs/taro';
|
||||||
|
|
||||||
import { PropsWithChildren } from 'react';
|
import { PropsWithChildren } from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
@ -6,8 +6,9 @@ import { Provider } from 'react-redux';
|
|||||||
import { REFRESH_UNREAD_COUNT_TIME } from '@/constants/message';
|
import { REFRESH_UNREAD_COUNT_TIME } from '@/constants/message';
|
||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
|
import { requestServiceUrls } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
import { getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
import { decryptOpenGid, getInviteCode, getInviteCodeFromQuery } from '@/utils/partner';
|
||||||
import qiniuUpload from '@/utils/qiniu-upload';
|
import qiniuUpload from '@/utils/qiniu-upload';
|
||||||
import { requestUserInfo, updateLastLoginTime } from '@/utils/user';
|
import { requestUserInfo, updateLastLoginTime } from '@/utils/user';
|
||||||
|
|
||||||
@ -28,6 +29,31 @@ function App({ children }: PropsWithChildren<BL.Anything>) {
|
|||||||
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useDidShow(options => {
|
||||||
|
requestServiceUrls();
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
|
Taro.getGroupEnterInfo()
|
||||||
|
.then(info => {
|
||||||
|
const inviteCode = getInviteCodeFromQuery(options?.query || {});
|
||||||
|
const authCode = options?.query?.authCode;
|
||||||
|
decryptOpenGid({
|
||||||
|
inviteCode,
|
||||||
|
authCode,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
iv: info.iv,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-expect-error
|
||||||
|
encryptedData: info.encryptedData,
|
||||||
|
});
|
||||||
|
console.log('哈哈哈', info);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
console.log('没有解析到群', options?.scene);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return <Provider store={store}>{children}</Provider>;
|
return <Provider store={store}>{children}</Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { PageUrl } from '@/constants/app';
|
|||||||
import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material';
|
import { MaterialViewSource, WORK_YEAR_LABELS } from '@/constants/material';
|
||||||
import { AnchorInfo } from '@/types/material';
|
import { AnchorInfo } from '@/types/material';
|
||||||
import { calcDistance } from '@/utils/location';
|
import { calcDistance } from '@/utils/location';
|
||||||
import { getBasicInfo } from '@/utils/material';
|
import { getBasicInfo, getSalary } from '@/utils/material';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
import { activeDate } from '@/utils/time';
|
import { activeDate } from '@/utils/time';
|
||||||
|
|
||||||
@ -22,17 +22,6 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'anchor-card';
|
const PREFIX = 'anchor-card';
|
||||||
const getSalary = (data: AnchorInfo) => {
|
|
||||||
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
|
|
||||||
const prices: string[] = [];
|
|
||||||
if (fullTimeMinPrice && fullTimeMaxPrice) {
|
|
||||||
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
|
|
||||||
}
|
|
||||||
if (partyTimeMinPrice && partyTimeMaxPrice) {
|
|
||||||
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
|
|
||||||
}
|
|
||||||
return prices.filter(Boolean).join(' ');
|
|
||||||
};
|
|
||||||
|
|
||||||
function AnchorCard(props: IProps) {
|
function AnchorCard(props: IProps) {
|
||||||
const { data, jobId, validator } = props;
|
const { data, jobId, validator } = props;
|
||||||
|
|||||||
@ -5,34 +5,19 @@ import { isEqual } from 'lodash-es';
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import PickerToolbar from '@/components/picker-toolbar';
|
import PickerToolbar from '@/components/picker-toolbar';
|
||||||
import {
|
import { FULL_PRICE_OPTIONS, PART_PRICE_OPTIONS } from '@/constants/job';
|
||||||
EmployType,
|
import { ALL_ANCHOR_READ_TYPES, ANCHOR_READ_TITLE_MAP, AnchorReadType } from '@/constants/material';
|
||||||
ALL_EMPLOY_TYPES,
|
|
||||||
FULL_PRICE_OPTIONS,
|
|
||||||
PART_PRICE_OPTIONS,
|
|
||||||
EMPLOY_TYPE_TITLE_MAP,
|
|
||||||
} from '@/constants/job';
|
|
||||||
import {
|
|
||||||
ALL_ANCHOR_READ_TYPES,
|
|
||||||
ALL_GENDER_TYPES,
|
|
||||||
ANCHOR_READ_TITLE_MAP,
|
|
||||||
AnchorReadType,
|
|
||||||
GENDER_TYPE_TITLE_MAP,
|
|
||||||
GenderType,
|
|
||||||
} from '@/constants/material';
|
|
||||||
import { IAnchorFilters } from '@/types/material';
|
import { IAnchorFilters } from '@/types/material';
|
||||||
import { isUndefined } from '@/utils/common';
|
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
|
type MoreFilter = Omit<IAnchorFilters, 'employType' | 'gender'>;
|
||||||
interface IProps {
|
interface IProps {
|
||||||
value: IAnchorFilters;
|
value: MoreFilter;
|
||||||
onConfirm: (newValue: IAnchorFilters) => void;
|
onConfirm: (newValue: MoreFilter) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'anchor-picker';
|
const PREFIX = 'anchor-picker';
|
||||||
const getDefaultGender = (value: IAnchorFilters) => value.gender;
|
|
||||||
const getDefaultEmploy = (value: IAnchorFilters) => value.employType;
|
|
||||||
const getDefaultReadType = (value: IAnchorFilters) => value.readType;
|
const getDefaultReadType = (value: IAnchorFilters) => value.readType;
|
||||||
const getDefaultCategory = (value: IAnchorFilters) => value.category || '';
|
const getDefaultCategory = (value: IAnchorFilters) => value.category || '';
|
||||||
const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
||||||
@ -47,9 +32,7 @@ const getSalaryValue = (value: IAnchorFilters, full: boolean) => {
|
|||||||
|
|
||||||
function AnchorPicker(props: IProps) {
|
function AnchorPicker(props: IProps) {
|
||||||
const { value, onConfirm } = props;
|
const { value, onConfirm } = props;
|
||||||
const [gender, setGender] = useState<GenderType | undefined>(getDefaultGender(value));
|
|
||||||
const [readType, setReadType] = useState<AnchorReadType | undefined>(getDefaultReadType(value));
|
const [readType, setReadType] = useState<AnchorReadType | undefined>(getDefaultReadType(value));
|
||||||
const [employType, setEmployType] = useState<EmployType | undefined>(getDefaultEmploy(value));
|
|
||||||
const [fullSalary, setFullSalary] = useState(getSalaryValue(value, true));
|
const [fullSalary, setFullSalary] = useState(getSalaryValue(value, true));
|
||||||
const [partSalary, setPartSalary] = useState(getSalaryValue(value, false));
|
const [partSalary, setPartSalary] = useState(getSalaryValue(value, false));
|
||||||
const [category, setCategory] = useState(getDefaultCategory(value));
|
const [category, setCategory] = useState(getDefaultCategory(value));
|
||||||
@ -59,9 +42,7 @@ function AnchorPicker(props: IProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleClickReset = useCallback(() => {
|
const handleClickReset = useCallback(() => {
|
||||||
setGender(undefined);
|
|
||||||
setReadType(undefined);
|
setReadType(undefined);
|
||||||
setEmployType(undefined);
|
|
||||||
setFullSalary(null);
|
setFullSalary(null);
|
||||||
setPartSalary(null);
|
setPartSalary(null);
|
||||||
setCategory('');
|
setCategory('');
|
||||||
@ -83,10 +64,6 @@ function AnchorPicker(props: IProps) {
|
|||||||
|
|
||||||
const handleClickConfirm = useCallback(() => {
|
const handleClickConfirm = useCallback(() => {
|
||||||
const filters: IAnchorFilters = {};
|
const filters: IAnchorFilters = {};
|
||||||
if (!isUndefined(gender)) {
|
|
||||||
filters.gender = gender === GenderType.All ? undefined : gender;
|
|
||||||
}
|
|
||||||
employType && (filters.employType = employType);
|
|
||||||
readType && (filters.readType = readType);
|
readType && (filters.readType = readType);
|
||||||
category && (filters.category = category);
|
category && (filters.category = category);
|
||||||
if (fullSalary) {
|
if (fullSalary) {
|
||||||
@ -98,34 +75,10 @@ function AnchorPicker(props: IProps) {
|
|||||||
filters.highPriceForPartyTime = partSalary.maxSalary;
|
filters.highPriceForPartyTime = partSalary.maxSalary;
|
||||||
}
|
}
|
||||||
onConfirm(filters);
|
onConfirm(filters);
|
||||||
}, [gender, employType, readType, category, fullSalary, partSalary, onConfirm]);
|
}, [readType, category, fullSalary, partSalary, onConfirm]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={`${PREFIX}__title`}>性别</div>
|
|
||||||
<div className={`${PREFIX}__container`}>
|
|
||||||
{ALL_GENDER_TYPES.map((type: GenderType) => (
|
|
||||||
<div
|
|
||||||
key={type}
|
|
||||||
onClick={() => setGender(type)}
|
|
||||||
className={classNames(`${PREFIX}__item`, { selected: type === gender })}
|
|
||||||
>
|
|
||||||
{GENDER_TYPE_TITLE_MAP[type]}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__title`}>全职/兼职</div>
|
|
||||||
<div className={`${PREFIX}__container`}>
|
|
||||||
{ALL_EMPLOY_TYPES.map(type => (
|
|
||||||
<div
|
|
||||||
key={type}
|
|
||||||
onClick={() => setEmployType(type)}
|
|
||||||
className={classNames(`${PREFIX}__item`, { selected: type === employType })}
|
|
||||||
>
|
|
||||||
{EMPLOY_TYPE_TITLE_MAP[type]}
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className={`${PREFIX}__title`}>已读/未读</div>
|
<div className={`${PREFIX}__title`}>已读/未读</div>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
{ALL_ANCHOR_READ_TYPES.map(type => (
|
{ALL_ANCHOR_READ_TYPES.map(type => (
|
||||||
|
|||||||
13
src/components/gender-select/index.tsx
Normal file
13
src/components/gender-select/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Select, { ISelectProps } from '@/components/select';
|
||||||
|
import { GENDER_OPTIONS, GenderType } from '@/constants/material';
|
||||||
|
|
||||||
|
interface IProps extends Omit<ISelectProps<GenderType>, 'options'> {
|
||||||
|
value: GenderType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GenderSelect(props: IProps) {
|
||||||
|
const { value: selectValue, onSelect } = props;
|
||||||
|
return <Select options={GENDER_OPTIONS} title="性别" value={selectValue} onSelect={onSelect} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GenderSelect;
|
||||||
79
src/components/group-certification-list/index.less
Normal file
79
src/components/group-certification-list/index.less
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.group-certification-list {
|
||||||
|
min-height: calc(100vh - 98rpx);
|
||||||
|
&__banner {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
height: 72px;
|
||||||
|
padding: 32px 32px 25px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
&__title {
|
||||||
|
height: 72px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 72px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: rgba(0, 0, 0, 0.5);
|
||||||
|
position: fixed;
|
||||||
|
top: 227rpx;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
&-border {
|
||||||
|
border-bottom: 1px solid #e6e7e8;
|
||||||
|
.flex-row();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
padding: 0 8px;
|
||||||
|
flex: 0 0 120px;
|
||||||
|
width: 120px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-name {
|
||||||
|
text-align: right;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__pull-refresh {
|
||||||
|
margin-top: 72px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
height: 100px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 24px 32px 0 32px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-size: 28px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
&-border {
|
||||||
|
border-bottom: 1px solid #e6e7e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
.flex-row();
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
padding: 0 8px;
|
||||||
|
flex: 0 0 120px;
|
||||||
|
width: 120px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-name {
|
||||||
|
text-align: right;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
153
src/components/group-certification-list/index.tsx
Normal file
153
src/components/group-certification-list/index.tsx
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
import { List, PullRefresh } from '@taroify/core';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import ListPlaceholder from '@/components/list-placeholder';
|
||||||
|
import { AuthedGroupInfo } from '@/types/partner';
|
||||||
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { formatTimestamp, getAuthedGroupList as requestData } from '@/utils/partner';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'group-certification-list';
|
||||||
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
|
const FIRST_PAGE = 0;
|
||||||
|
|
||||||
|
function GroupCertificationList(props: {
|
||||||
|
refreshDisabled?: boolean;
|
||||||
|
visible?: boolean;
|
||||||
|
listHeight?: number;
|
||||||
|
className?: string;
|
||||||
|
onListEmpty?: () => void;
|
||||||
|
}) {
|
||||||
|
const { className, listHeight, refreshDisabled, visible = true, onListEmpty } = props;
|
||||||
|
const [hasMore, setHasMore] = useState(false);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
const [loadingMore, setLoadingMore] = useState(false);
|
||||||
|
const [loadMoreError, setLoadMoreError] = useState(false);
|
||||||
|
const [dataList, setDataList] = useState<AuthedGroupInfo[]>([]);
|
||||||
|
const currentPage = useRef<number>(FIRST_PAGE);
|
||||||
|
const onListEmptyRef = useRef(onListEmpty);
|
||||||
|
|
||||||
|
const handleRefresh = useCallback(async () => {
|
||||||
|
log('start pull refresh');
|
||||||
|
try {
|
||||||
|
setRefreshing(true);
|
||||||
|
setLoadMoreError(false);
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList(content);
|
||||||
|
currentPage.current = 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
!content.length && onListEmptyRef.current?.();
|
||||||
|
log('pull refresh success');
|
||||||
|
} catch (e) {
|
||||||
|
setDataList([]);
|
||||||
|
setHasMore(false);
|
||||||
|
setLoadMoreError(true);
|
||||||
|
currentPage.current = FIRST_PAGE;
|
||||||
|
log('pull refresh failed');
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleLoadMore = useCallback(async () => {
|
||||||
|
log('start load more', hasMore);
|
||||||
|
if (!hasMore) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setLoadMoreError(false);
|
||||||
|
setLoadingMore(true);
|
||||||
|
try {
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList([...dataList, ...content]);
|
||||||
|
currentPage.current = currentPage.current + 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
log('load more success');
|
||||||
|
} catch (e) {
|
||||||
|
setLoadMoreError(true);
|
||||||
|
log('load more failed');
|
||||||
|
} finally {
|
||||||
|
setLoadingMore(false);
|
||||||
|
}
|
||||||
|
}, [dataList, hasMore]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
onListEmptyRef.current = onListEmpty;
|
||||||
|
}, [onListEmpty]);
|
||||||
|
|
||||||
|
// 初始化数据&配置变更后刷新数据
|
||||||
|
useEffect(() => {
|
||||||
|
// 列表不可见时,先不做处理
|
||||||
|
if (!visible) {
|
||||||
|
log('visible changed, but is not visible, only clear list');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const refresh = async () => {
|
||||||
|
log('visible changed, start refresh list data');
|
||||||
|
try {
|
||||||
|
setDataList([]);
|
||||||
|
setLoadingMore(true);
|
||||||
|
setLoadMoreError(false);
|
||||||
|
const content = await requestData();
|
||||||
|
setDataList(content);
|
||||||
|
currentPage.current = 1;
|
||||||
|
// setHasMore(currentPage.current < totalPages);
|
||||||
|
!content.length && onListEmptyRef.current?.();
|
||||||
|
} catch (e) {
|
||||||
|
setDataList([]);
|
||||||
|
setHasMore(false);
|
||||||
|
setLoadMoreError(true);
|
||||||
|
} finally {
|
||||||
|
log('visible changed, refresh list data end');
|
||||||
|
setLoadingMore(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
refresh();
|
||||||
|
}, [visible]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<div className={`${PREFIX}__banner`}>
|
||||||
|
以下均为认证成功的群,没认证成功请先确认是否有拉运营进群,如果在,可以尝试重新分享小程序
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
<div className={`${PREFIX}__title-border`}>
|
||||||
|
<div className={`${PREFIX}__title-time`}>认证日期</div>
|
||||||
|
<div className={`${PREFIX}__title-name`}>群名称</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<PullRefresh
|
||||||
|
className={classNames(`${PREFIX}__pull-refresh`, className)}
|
||||||
|
loading={refreshing}
|
||||||
|
onRefresh={handleRefresh}
|
||||||
|
disabled={refreshDisabled}
|
||||||
|
>
|
||||||
|
<List
|
||||||
|
hasMore={hasMore}
|
||||||
|
onLoad={handleLoadMore}
|
||||||
|
loading={loadingMore || refreshing}
|
||||||
|
disabled={loadMoreError || !visible}
|
||||||
|
fixedHeight={typeof listHeight !== 'undefined'}
|
||||||
|
style={listHeight ? { height: `${listHeight}px` } : undefined}
|
||||||
|
>
|
||||||
|
{dataList.map(item => (
|
||||||
|
<div className={`${PREFIX}__item`} key={item.openGid}>
|
||||||
|
<div className={`${PREFIX}__item-border`}>
|
||||||
|
<div className={`${PREFIX}__item-content`}>
|
||||||
|
<div className={`${PREFIX}__item-time`}>{formatTimestamp(item.authDate, true)}</div>
|
||||||
|
<div className={`${PREFIX}__item-name`}>{item.groupName}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<ListPlaceholder hasMore={false} loadingMore={loadingMore} loadMoreError={loadMoreError} />
|
||||||
|
</List>
|
||||||
|
</PullRefresh>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default GroupCertificationList;
|
||||||
@ -1,6 +1,6 @@
|
|||||||
@import '@/styles/common.less';
|
@import '@/styles/common.less';
|
||||||
@import '@/styles/variables.less';
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
.job-card {
|
.job-card {
|
||||||
&__container {
|
&__container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -11,6 +11,16 @@
|
|||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__mask {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(255, 255, 255, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
&__header {
|
&__header {
|
||||||
@ -160,4 +170,4 @@
|
|||||||
color: @blColorG2;
|
color: @blColorG2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,11 +5,11 @@ import React, { useCallback } from 'react';
|
|||||||
|
|
||||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { CITY_CODE_TO_NAME_MAP, COUNTY_CODE_TO_NAME_MAP } from '@/constants/city';
|
// import { CITY_CODE_TO_NAME_MAP, COUNTY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { EMPLOY_TYPE_TITLE_MAP, EmployType } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, EmployType } from '@/constants/job';
|
||||||
import { JobInfo } from '@/types/job';
|
import { JobInfo } from '@/types/job';
|
||||||
import { LocationInfo } from '@/types/location';
|
// import { LocationInfo } from '@/types/location';
|
||||||
import { getJobSalary, getJobTitle } from '@/utils/job';
|
import { getJobSalary, getJobTitle } from '@/utils/job';
|
||||||
import { calcDistance } from '@/utils/location';
|
import { calcDistance } from '@/utils/location';
|
||||||
import { navigateTo, redirectTo } from '@/utils/route';
|
import { navigateTo, redirectTo } from '@/utils/route';
|
||||||
@ -23,16 +23,16 @@ interface IProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'job-card';
|
const PREFIX = 'job-card';
|
||||||
const getCityDes = (location: LocationInfo) => {
|
// const getCityDes = (location: LocationInfo) => {
|
||||||
if (!location) {
|
// if (!location) {
|
||||||
return '';
|
// return '';
|
||||||
}
|
// }
|
||||||
let des = CITY_CODE_TO_NAME_MAP.get(location.cityCode);
|
// let des = CITY_CODE_TO_NAME_MAP.get(location.cityCode);
|
||||||
if (location.countyCode) {
|
// if (location.countyCode) {
|
||||||
des += `-${COUNTY_CODE_TO_NAME_MAP.get(location.countyCode)}`;
|
// des += `-${COUNTY_CODE_TO_NAME_MAP.get(location.countyCode)}`;
|
||||||
}
|
// }
|
||||||
return des;
|
// return des;
|
||||||
};
|
// };
|
||||||
|
|
||||||
function JobCard(props: IProps) {
|
function JobCard(props: IProps) {
|
||||||
const { className, data, redirectOpen } = props;
|
const { className, data, redirectOpen } = props;
|
||||||
@ -84,12 +84,12 @@ function JobCard(props: IProps) {
|
|||||||
<div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div>
|
<div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div>
|
||||||
<div className={`${PREFIX}__distance-wrapper`}>
|
<div className={`${PREFIX}__distance-wrapper`}>
|
||||||
<div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div>
|
<div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div>
|
||||||
{/*{distance && (*/}
|
{distance && (
|
||||||
{/* <>*/}
|
<>
|
||||||
{/* <Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />*/}
|
<Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />
|
||||||
{/* <div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>*/}
|
<div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>
|
||||||
{/* </>*/}
|
</>
|
||||||
{/*)}*/}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__divider`} />
|
<div className={`${PREFIX}__divider`} />
|
||||||
@ -104,6 +104,7 @@ function JobCard(props: IProps) {
|
|||||||
</div>
|
</div>
|
||||||
{/*<div className={`${PREFIX}__city`}>{getCityDes(jobLocation)}</div>*/}
|
{/*<div className={`${PREFIX}__city`}>{getCityDes(jobLocation)}</div>*/}
|
||||||
</div>
|
</div>
|
||||||
|
{data.isRead && <div className={`${PREFIX}__mask`} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { List, PullRefresh } from '@taroify/core';
|
import { List, PullRefresh } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
@ -5,6 +7,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
|
|
||||||
import JobCard from '@/components/job-card';
|
import JobCard from '@/components/job-card';
|
||||||
import ListPlaceholder from '@/components/list-placeholder';
|
import ListPlaceholder from '@/components/list-placeholder';
|
||||||
|
import { EventName } from '@/constants/app';
|
||||||
import { JobType, EmployType, SortType } from '@/constants/job';
|
import { JobType, EmployType, SortType } from '@/constants/job';
|
||||||
import { JobInfo, GetJobsRequest } from '@/types/job';
|
import { JobInfo, GetJobsRequest } from '@/types/job';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
@ -58,6 +61,23 @@ function JobList(props: IJobListProps) {
|
|||||||
const prevRequestProps = useRef<IRequestProps>({});
|
const prevRequestProps = useRef<IRequestProps>({});
|
||||||
const onListEmptyRef = useRef(onListEmpty);
|
const onListEmptyRef = useRef(onListEmpty);
|
||||||
|
|
||||||
|
const handleReadJob = useCallback(
|
||||||
|
(jobId: string) => {
|
||||||
|
const index = dataList.findIndex(d => String(d.id) === jobId);
|
||||||
|
if (index < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const job = dataList[index];
|
||||||
|
if (!job || job.isRead) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
log('auto mark read', jobId);
|
||||||
|
dataList.splice(index, 1, { ...job, isRead: true });
|
||||||
|
setDataList([...dataList]);
|
||||||
|
},
|
||||||
|
[dataList]
|
||||||
|
);
|
||||||
|
|
||||||
const handleRefresh = useCallback(async () => {
|
const handleRefresh = useCallback(async () => {
|
||||||
log('start pull refresh');
|
log('start pull refresh');
|
||||||
try {
|
try {
|
||||||
@ -109,6 +129,13 @@ function JobList(props: IJobListProps) {
|
|||||||
onListEmptyRef.current = onListEmpty;
|
onListEmptyRef.current = onListEmpty;
|
||||||
}, [onListEmpty]);
|
}, [onListEmpty]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.eventCenter.on(EventName.VIEW_JOB_SUCCESS, handleReadJob);
|
||||||
|
return () => {
|
||||||
|
Taro.eventCenter.off(EventName.VIEW_JOB_SUCCESS, handleReadJob);
|
||||||
|
};
|
||||||
|
}, [handleReadJob]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
log('request params changed');
|
log('request params changed');
|
||||||
requestProps.current = {
|
requestProps.current = {
|
||||||
|
|||||||
@ -7,12 +7,11 @@ import { useCallback, useState } from 'react';
|
|||||||
import { RoleType } from '@/constants/app';
|
import { RoleType } from '@/constants/app';
|
||||||
import { CacheKey } from '@/constants/cache-key';
|
import { CacheKey } from '@/constants/cache-key';
|
||||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { GROUPS } from '@/constants/group';
|
import useServiceUrls from '@/hooks/use-service-urls';
|
||||||
import { getRoleTypeWithDefault } from '@/utils/app';
|
import { getRoleTypeWithDefault } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
import { checkCityCode, validCityCode } from '@/utils/user';
|
import { checkCityCode, validCityCode } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'join-group-hint';
|
const PREFIX = 'join-group-hint';
|
||||||
@ -25,7 +24,8 @@ const DEFAULT_GROUP = {
|
|||||||
export function JoinGroupHint() {
|
export function JoinGroupHint() {
|
||||||
const cityCode = getCurrentCityCode();
|
const cityCode = getCurrentCityCode();
|
||||||
const roleType = getRoleTypeWithDefault();
|
const roleType = getRoleTypeWithDefault();
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
const serviceUrls = useServiceUrls();
|
||||||
|
const group = serviceUrls.find(g => String(g.cityCode) === cityCode);
|
||||||
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (group && !checkCityCode(cityCode)) {
|
if (group && !checkCityCode(cityCode)) {
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
.material-card {
|
.material-card {
|
||||||
padding: 32px 24px;
|
padding: 32px 24px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background: #FFFFFF;
|
background: #ffffff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
&__header {
|
&__header {
|
||||||
@ -16,6 +16,10 @@
|
|||||||
.flex-row();
|
.flex-row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__right {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
@ -50,7 +54,7 @@
|
|||||||
|
|
||||||
&__body {
|
&__body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 156px;
|
height: 160px;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -80,38 +84,44 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__scroll-view {
|
&__info {
|
||||||
position: relative;
|
.flex-row();
|
||||||
|
gap: 24px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
|
||||||
.flex-row();
|
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&-left {
|
||||||
display: none;
|
width: 125px;
|
||||||
|
height: 160px;
|
||||||
}
|
}
|
||||||
|
&-cover {
|
||||||
&::after {
|
width: 100%;
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
width: 102px;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: linear-gradient(91.41deg, rgba(255, 255, 255, 0) 1.86%, #FFFFFF 99.47%);
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
&-right {
|
||||||
|
.name {
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: @blColor;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.info,
|
||||||
|
.worked {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: @blColorG2;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.salary {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
&__cover-list {
|
|
||||||
height: 100%;
|
|
||||||
.flex-row();
|
|
||||||
}
|
|
||||||
|
|
||||||
&__cover-image {
|
|
||||||
width: 120px;
|
|
||||||
height: 100%;
|
|
||||||
margin-right: 24px;
|
|
||||||
// 不知道为啥高度不对,可能 scroll-view 默认底部是滚动条高度?
|
|
||||||
margin-top: 38px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Image, ScrollView } from '@tarojs/components';
|
import { Image } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Loading } from '@taroify/core';
|
import { Loading } from '@taroify/core';
|
||||||
@ -9,11 +9,12 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
import LoginButton from '@/components/login-button';
|
import LoginButton from '@/components/login-button';
|
||||||
import { EventName, PageUrl } from '@/constants/app';
|
import { EventName, PageUrl } from '@/constants/app';
|
||||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||||
|
import { WORK_YEAR_LABELS } from '@/constants/material';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { collectEvent, reportEvent } from '@/utils/event';
|
||||||
import { requestProfileDetail, sortVideos } from '@/utils/material';
|
import { getBasicInfo, getSalary, requestProfileDetail, sortVideos } from '@/utils/material';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import { isValidUserInfo } from '@/utils/user';
|
import { isValidUserInfo } from '@/utils/user';
|
||||||
@ -34,8 +35,9 @@ function MaterialCard(props: IProps) {
|
|||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [profile, setProfile] = useState<MaterialProfile | null>(null);
|
const [profile, setProfile] = useState<MaterialProfile | null>(null);
|
||||||
const refreshRef = useRef((_f?: boolean) => { });
|
const refreshRef = useRef((_f?: boolean) => {});
|
||||||
const hasMaterial = !!profile;
|
const hasMaterial = !!profile;
|
||||||
|
const firstCover = sortVideos(profile?.materialVideoInfoList || [])[0];
|
||||||
|
|
||||||
const handleGoCreateProfile = useCallback(() => {
|
const handleGoCreateProfile = useCallback(() => {
|
||||||
reportEvent(ReportEventId.CLICK_GO_TO_CREATE_MATERIAL);
|
reportEvent(ReportEventId.CLICK_GO_TO_CREATE_MATERIAL);
|
||||||
@ -44,7 +46,7 @@ function MaterialCard(props: IProps) {
|
|||||||
|
|
||||||
const handleGoProfile = useCallback(() => {
|
const handleGoProfile = useCallback(() => {
|
||||||
if (!hasMaterial) {
|
if (!hasMaterial) {
|
||||||
realtimeLogger.info('handleGoProfile noMaterial')
|
realtimeLogger.info('handleGoProfile noMaterial');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
navigateTo(PageUrl.MaterialProfile).catch(err => {
|
navigateTo(PageUrl.MaterialProfile).catch(err => {
|
||||||
@ -67,7 +69,7 @@ function MaterialCard(props: IProps) {
|
|||||||
try {
|
try {
|
||||||
const profileDetail = await requestProfileDetail();
|
const profileDetail = await requestProfileDetail();
|
||||||
if (!profileDetail) {
|
if (!profileDetail) {
|
||||||
realtimeLogger.info('getProfileDetail no profileDetail')
|
realtimeLogger.info('getProfileDetail no profileDetail');
|
||||||
}
|
}
|
||||||
setProfile(profileDetail);
|
setProfile(profileDetail);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -90,8 +92,10 @@ function MaterialCard(props: IProps) {
|
|||||||
refreshRef.current?.(true);
|
refreshRef.current?.(true);
|
||||||
};
|
};
|
||||||
Taro.eventCenter.on(EventName.CREATE_PROFILE, callback);
|
Taro.eventCenter.on(EventName.CREATE_PROFILE, callback);
|
||||||
|
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
|
||||||
return () => {
|
return () => {
|
||||||
Taro.eventCenter.off(EventName.CREATE_PROFILE, callback);
|
Taro.eventCenter.off(EventName.CREATE_PROFILE, callback);
|
||||||
|
Taro.eventCenter.on(EventName.UPDATE_PROFILE, callback);
|
||||||
};
|
};
|
||||||
}, [userInfo]);
|
}, [userInfo]);
|
||||||
|
|
||||||
@ -100,16 +104,11 @@ function MaterialCard(props: IProps) {
|
|||||||
<div className={`${PREFIX}__header`}>
|
<div className={`${PREFIX}__header`}>
|
||||||
<div className={`${PREFIX}__header__left`}>
|
<div className={`${PREFIX}__header__left`}>
|
||||||
<div className={`${PREFIX}__header__title`}>我的模卡</div>
|
<div className={`${PREFIX}__header__title`}>我的模卡</div>
|
||||||
{/* {profile && (
|
|
||||||
<div
|
|
||||||
className={`${PREFIX}__header__progress`}
|
|
||||||
>{`完成度${Math.min((profile.progressBar || 0) * 100, 100)}%`}</div>
|
|
||||||
)} */}
|
|
||||||
</div>
|
</div>
|
||||||
{profile && (
|
{profile && (
|
||||||
<div className={`${PREFIX}__header__right`}>
|
<div className={`${PREFIX}__header__right`}>
|
||||||
{/* <div className={`${PREFIX}__header__status`}>{profile?.isOpen ? '开放中' : '关闭'}</div> */}
|
<div>去分享</div>
|
||||||
<ArrowRight className={`${PREFIX}__header__icon`} />
|
<ArrowRight color="#6D3DF5" className={`${PREFIX}__header__icon`} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -123,18 +122,21 @@ function MaterialCard(props: IProps) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!loading && hasMaterial && (
|
{!loading && hasMaterial && (
|
||||||
<ScrollView className={`${PREFIX}__scroll-view`} showScrollbar={false} enableFlex enhanced scrollX>
|
<div className={`${PREFIX}__info`}>
|
||||||
<div className={`${PREFIX}__cover-list`}>
|
{firstCover && (
|
||||||
{sortVideos(profile?.materialVideoInfoList || []).map(video => (
|
<div className={`${PREFIX}__info-left`}>
|
||||||
<Image
|
<Image className={`${PREFIX}__info-cover`} mode="aspectFill" src={firstCover.coverUrl} />
|
||||||
className={`${PREFIX}__cover-image`}
|
</div>
|
||||||
mode="aspectFit"
|
)}
|
||||||
key={video.coverUrl}
|
<div className={`${PREFIX}__info-right`}>
|
||||||
src={video.coverUrl}
|
<div className="name">{profile?.name}</div>
|
||||||
/>
|
<div className="info">
|
||||||
))}
|
{WORK_YEAR_LABELS[profile?.workedYear] || ''}·{getBasicInfo({ ...profile, shoeSize: null })}
|
||||||
|
</div>
|
||||||
|
<div className="worked">播过 {profile?.workedSecCategoryStr}</div>
|
||||||
|
<div className="salary">{getSalary(profile)}</div>
|
||||||
</div>
|
</div>
|
||||||
</ScrollView>
|
</div>
|
||||||
)}
|
)}
|
||||||
{loading && <Loading />}
|
{loading && <Loading />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export default function PartnerBanner() {
|
|||||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && (
|
||||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
<LoginDialog onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -39,9 +39,7 @@ function JoinEntry({ onBindSuccess }: JoinEntryProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />}
|
||||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
padding-bottom: calc(112px + env(safe-area-inset-bottom));
|
padding-bottom: calc(112px + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
&__banner {
|
&__banner {
|
||||||
background: fade(@blHighlightBg, 8);
|
background: rgb(229, 225, 248);
|
||||||
height: 88px;
|
height: 88px;
|
||||||
line-height: 88px;
|
line-height: 88px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -37,6 +37,63 @@
|
|||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__swiper {
|
||||||
|
margin-bottom: 48px;
|
||||||
|
&-wrapper {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&__swiper-item {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 130px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
&-item {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 400;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
&-details {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
&-id {
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: #999999;
|
||||||
|
padding-right: 22px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
&-info {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
margin-right: 16px;
|
||||||
|
display: inline-block;
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.money {
|
||||||
|
color: #ff5051;
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__card {
|
&__card {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
@ -61,9 +118,14 @@
|
|||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
&.grey {
|
&.grey {
|
||||||
color: @blColorG2
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +138,20 @@
|
|||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__recommend {
|
||||||
|
display: inline-flex;
|
||||||
|
line-height: 36px;
|
||||||
|
padding: 0 8px;
|
||||||
|
height: 36px;
|
||||||
|
margin-left: 16px;
|
||||||
|
background: rgba(255, 80, 81, 0.12);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #ff5051;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
&__special {
|
&__special {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
|
|||||||
@ -1,19 +1,25 @@
|
|||||||
import { Button, Canvas } from '@tarojs/components';
|
import { Button, Canvas, Image } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { useCallback, useState } from 'react';
|
import { Swiper } from '@taroify/core';
|
||||||
|
import { GoodJob } from '@taroify/icons';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { EarnType, UserProfitListItem } from '@/types/partner';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getPartnerQrcode } from '@/utils/partner';
|
import { generateMembershipCoupon, getCouponQrCode } from '@/utils/coupon';
|
||||||
|
import { formatMoney, formatTimestamp, getLastProfitList } from '@/utils/partner';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'partner-intro';
|
const PREFIX = 'partner-intro';
|
||||||
|
|
||||||
export default function PartnerIntro() {
|
export default function PartnerIntro() {
|
||||||
const [posterPath, setPosterPath] = useState('');
|
|
||||||
const getQrcode = async () => {
|
const getQrcode = async () => {
|
||||||
try {
|
try {
|
||||||
const data = await getPartnerQrcode(); // 假设 getPartnerQrcode 返回 ArrayBuffer
|
const { code } = await generateMembershipCoupon();
|
||||||
|
const data = await getCouponQrCode(code);
|
||||||
const base64 = Taro.arrayBufferToBase64(data);
|
const base64 = Taro.arrayBufferToBase64(data);
|
||||||
return `data:image/png;base64,${base64}`;
|
return `data:image/png;base64,${base64}`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -36,11 +42,9 @@ export default function PartnerIntro() {
|
|||||||
height: 2668, // 实际绘制高度
|
height: 2668, // 实际绘制高度
|
||||||
destWidth: 750, // 目标显示宽度
|
destWidth: 750, // 目标显示宽度
|
||||||
destHeight: 1334, // 目标显示高度
|
destHeight: 1334, // 目标显示高度
|
||||||
fileType: 'jpg',
|
fileType: 'png',
|
||||||
});
|
});
|
||||||
|
|
||||||
setPosterPath(tempFilePath.tempFilePath);
|
|
||||||
|
|
||||||
resolve(tempFilePath.tempFilePath);
|
resolve(tempFilePath.tempFilePath);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -57,21 +61,21 @@ export default function PartnerIntro() {
|
|||||||
const canvas = res[0].node;
|
const canvas = res[0].node;
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
canvas.width = 1500;
|
canvas.width = 550 * 2;
|
||||||
canvas.height = 2668;
|
canvas.height = 918 * 2;
|
||||||
ctx.scale(2, 2);
|
ctx.scale(2, 2);
|
||||||
|
|
||||||
// 绘制背景图片
|
// 绘制背景图片
|
||||||
const bgImage = canvas.createImage();
|
const bgImage = canvas.createImage();
|
||||||
const poster = 'https://publiccdn.neighbourhood.com.cn/img/poster.png'
|
const poster = 'https://publiccdn.neighbourhood.com.cn/img/share-coupon-poster2.png';
|
||||||
bgImage.src = poster;
|
bgImage.src = poster;
|
||||||
bgImage.onload = () => {
|
bgImage.onload = () => {
|
||||||
ctx.drawImage(bgImage, 0, 0, 750, 1334);
|
ctx.drawImage(bgImage, 0, 0, 550, 918);
|
||||||
|
|
||||||
const qrCodeImage = canvas.createImage();
|
const qrCodeImage = canvas.createImage();
|
||||||
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
||||||
qrCodeImage.onload = () => {
|
qrCodeImage.onload = () => {
|
||||||
ctx.drawImage(qrCodeImage, 235, 894, 280, 280); // 绘制二维码,位置和大小
|
ctx.drawImage(qrCodeImage, 196, 600, 180, 160); // 绘制二维码,位置和大小
|
||||||
saveCanvasToTempFile().then(tempPath => {
|
saveCanvasToTempFile().then(tempPath => {
|
||||||
resolve(tempPath);
|
resolve(tempPath);
|
||||||
});
|
});
|
||||||
@ -84,13 +88,10 @@ export default function PartnerIntro() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
const savePoster = async () => {
|
const savePoster = async () => {
|
||||||
let filePath = posterPath;
|
Taro.showLoading({ title: '正在生成海报' });
|
||||||
if (!filePath) {
|
const qrCode = await getQrcode();
|
||||||
Taro.showLoading({ title: '正在生成海报' });
|
const filePath = await drawCanvas(qrCode);
|
||||||
const qrCode = await getQrcode();
|
Taro.hideLoading();
|
||||||
filePath = await drawCanvas(qrCode);
|
|
||||||
Taro.hideLoading();
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await Taro.getSetting();
|
const res = await Taro.getSetting();
|
||||||
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
||||||
@ -115,58 +116,141 @@ export default function PartnerIntro() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleConfirm = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.GroupOwnerCertificate);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const timerRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
const [bannerList, setBannerList] = useState<UserProfitListItem[]>([]);
|
||||||
|
|
||||||
|
const getBannerList = useCallback(async () => {
|
||||||
|
if (timerRef.current) {
|
||||||
|
clearTimeout(timerRef.current);
|
||||||
|
timerRef.current = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = await getLastProfitList();
|
||||||
|
setBannerList(s => [...s, ...list]);
|
||||||
|
|
||||||
|
timerRef.current = setTimeout(
|
||||||
|
() => {
|
||||||
|
getBannerList();
|
||||||
|
},
|
||||||
|
3000 * (list.length || 10)
|
||||||
|
);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getBannerList();
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (timerRef.current) {
|
||||||
|
clearTimeout(timerRef.current);
|
||||||
|
timerRef.current = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, [getBannerList]);
|
||||||
return (
|
return (
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={`${PREFIX}__banner`}>
|
<div className={`${PREFIX}__banner`}>
|
||||||
邀请朋友加入播络,高达<span className={`${PREFIX}__highlight`}>75%</span>分成
|
邀请朋友加入播络,高达<span className={`${PREFIX}__highlight`}>75%</span>分成
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__main`}>
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__swiper-wrapper`}>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__swiper-bg`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-swipe-item.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<Swiper className={`${PREFIX}__swiper`} autoplay={3000} touchable={false}>
|
||||||
|
{bannerList.map((item, index) => (
|
||||||
|
<Swiper.Item className={`${PREFIX}__swiper-item`} key={index}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-time`}>{formatTimestamp(item.updatedAt)}</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-details`}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-id`}>{item.userId}</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
|
{[EarnType.CHAT_ACTIVITY_SHARE_L1, EarnType.CHAT_ACTIVITY_SHARE_L2].includes(item.earnType)
|
||||||
|
? '主播被开聊'
|
||||||
|
: '会员支付'}
|
||||||
|
<div className="money">+{formatMoney(item.total)}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
|
累计<div className="money">{formatMoney(item.amount)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Swiper.Item>
|
||||||
|
))}
|
||||||
|
</Swiper>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>3重收益</div>
|
||||||
<div className={`${PREFIX}__card`}>
|
<div className={`${PREFIX}__card`}>
|
||||||
<div className={`${PREFIX}__h1`}>收益一</div>
|
<div className={`${PREFIX}__h1`}>直接分成:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
直接获得被邀请人付款金额的<span className={`${PREFIX}__highlight`}>20%</span>
|
直接获得被邀请人付款金额的<span className={`${PREFIX}__highlight`}>20%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__h1`}>收益二</div>
|
<div className={`${PREFIX}__h1`}>主播分成:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
邀请的主播创建模卡,被企业开聊,每日可获得收益,分成比例高达
|
邀请的主播创建模卡,被企业开聊,每日可获得收益,分成比例高达
|
||||||
<span className={`${PREFIX}__highlight`}>50%</span>
|
<span className={`${PREFIX}__highlight`}>50%</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__h1`}>收益三</div>
|
<div className={`${PREFIX}__h1`}>邀请合伙人:</div>
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
邀请朋友加入合伙人,可额外获得所邀合伙人收益的<span className={`${PREFIX}__highlight`}>5%</span>
|
你邀请的人也加入合伙人,你可获得所邀合伙人收益的<span className={`${PREFIX}__highlight`}>5%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
<div className={`${PREFIX}__title`}>分享方法</div>
|
<div className={`${PREFIX}__title`}>邀请方法</div>
|
||||||
<div className={`${PREFIX}__card`}>
|
<div className={`${PREFIX}__card`}>
|
||||||
<div className={`${PREFIX}__body`}>分享小程序任意页面到群、朋友圈、好友即可</div>
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div>1.点击下方“赠送会员给好友”,给群员、好友送会员,每周可以送一次</div>
|
||||||
|
<div>2.分享通告列表页、通告详情页等页面至群、好友</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
<div className={`${PREFIX}__title`}>合伙人交流群</div>
|
<div className={`${PREFIX}__title`}>
|
||||||
|
群主认证
|
||||||
|
<div className={`${PREFIX}__recommend`}>
|
||||||
|
<GoodJob />
|
||||||
|
强烈认证
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className="center">
|
||||||
|
完成群主认证后,群成员通过该群访问任何人分享的播络小程序进行注册,你都能获得分成
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__service`} onClick={handleConfirm}>
|
||||||
|
立即认证
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>交流群</div>
|
||||||
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
||||||
<div className={`${PREFIX}__h1`}>加入播络合伙人交流群</div>
|
<div className={`${PREFIX}__h1`}>加入播络合伙人交流群,分享经验</div>
|
||||||
<div className={`${PREFIX}__body grey`}>学习分享邀请经验,一起赚钱</div>
|
|
||||||
<Button className={`${PREFIX}__service`} onClick={handleOpenService}>
|
<Button className={`${PREFIX}__service`} onClick={handleOpenService}>
|
||||||
点击加入
|
点击加入
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__tip`}>注:收益不设时限,可重复享有,播络保留活动最终解释权</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
||||||
|
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
<Button className={`${PREFIX}__download-button`} onClick={savePoster}>
|
<Button className={`${PREFIX}__download-button`} onClick={savePoster}>
|
||||||
下载海报
|
朋友圈海报
|
||||||
</Button>
|
</Button>
|
||||||
<Button className={`${PREFIX}__share-button`} openType="share">
|
<Button className={`${PREFIX}__share-button`} openType="share">
|
||||||
分享邀请
|
赠送会员给好友
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -8,7 +8,51 @@
|
|||||||
background: #6d3df5;
|
background: #6d3df5;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
&__simple {
|
&-simple {
|
||||||
|
padding: 39px 35px;
|
||||||
|
height: 120px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
&__bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 16px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
&__content {
|
||||||
|
.flex-row();
|
||||||
|
line-height: 42px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&__money {
|
||||||
|
font-weight: 800;
|
||||||
|
margin-left: 12px;
|
||||||
|
font-size: 44px;
|
||||||
|
}
|
||||||
|
&__button {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 44px;
|
||||||
|
right: 24px;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 32px;
|
||||||
|
&-image {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__bg {
|
&__bg {
|
||||||
@ -28,20 +72,7 @@
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__button {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 2;
|
|
||||||
top: 44px;
|
|
||||||
right: 56px;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
&-image {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
display: inline-block;
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&__title {
|
&__title {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|||||||
@ -144,24 +144,37 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getProfitStats();
|
getProfitStats();
|
||||||
}, []);
|
}, []);
|
||||||
|
if (simple) {
|
||||||
|
return (
|
||||||
|
<div className={`${PREFIX} ${PREFIX}-simple`}>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}-simple__bg`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner_bg.png"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}-simple__content`}>
|
||||||
|
<div className={`${PREFIX}-simple__title`}>总收益(元)</div>
|
||||||
|
<div className={`${PREFIX}-simple__money`}>{formatMoney(total)}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}-simple__button`} onClick={handleNavigate}>
|
||||||
|
详情
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}-simple__button-image`}
|
||||||
|
mode="aspectFit"
|
||||||
|
src={require('@/statics/svg/caret-right.svg')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX} ${simple ? `${PREFIX}__simple` : ''}`}>
|
<div className={PREFIX}>
|
||||||
<Image
|
<Image
|
||||||
className={`${PREFIX}__bg`}
|
className={`${PREFIX}__bg`}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/partner_bg.png"
|
src="https://publiccdn.neighbourhood.com.cn/img/partner_bg.png"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
/>
|
/>
|
||||||
<div className={`${PREFIX}__content`}>
|
<div className={`${PREFIX}__content`}>
|
||||||
{simple && (
|
|
||||||
<div className={`${PREFIX}__button`} onClick={handleNavigate}>
|
|
||||||
查看详情
|
|
||||||
<Image
|
|
||||||
className={`${PREFIX}__button-image`}
|
|
||||||
mode="aspectFit"
|
|
||||||
src={require('@/statics/svg/caret-right.svg')}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className={`${PREFIX}__total`}>
|
<div className={`${PREFIX}__total`}>
|
||||||
<div className={`${PREFIX}__title`}>总收益(元)</div>
|
<div className={`${PREFIX}__title`}>总收益(元)</div>
|
||||||
<div className={`${PREFIX}__money`}>{formatMoney(total)}</div>
|
<div className={`${PREFIX}__money`}>{formatMoney(total)}</div>
|
||||||
@ -183,25 +196,21 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
|
|||||||
<div className={`${PREFIX}__money`}>{formatMoney(stats.availableProfit)}</div>
|
<div className={`${PREFIX}__money`}>{formatMoney(stats.availableProfit)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!simple && (
|
<div className={`${PREFIX}__buttons`}>
|
||||||
<div className={`${PREFIX}__buttons`}>
|
<Button className={`${PREFIX}__withdraw`} onClick={handleViewWithdraw}>
|
||||||
<Button className={`${PREFIX}__withdraw`} onClick={handleViewWithdraw}>
|
提现
|
||||||
提现
|
</Button>
|
||||||
</Button>
|
<Button className={`${PREFIX}__record`} onClick={handleNavigateRecord}>
|
||||||
<Button className={`${PREFIX}__record`} onClick={handleNavigateRecord}>
|
提现记录
|
||||||
提现记录
|
</Button>
|
||||||
</Button>
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{!simple && <TipDialog open={tipOpen} onClose={handleTipClose} />}
|
<TipDialog open={tipOpen} onClose={handleTipClose} />
|
||||||
{!simple && (
|
<WithdrawDialog
|
||||||
<WithdrawDialog
|
count={Math.min(Number(formatMoney(stats.availableBalance)), 200)}
|
||||||
count={Math.min(Number(formatMoney(stats.availableBalance)), 200)}
|
open={withdrawOpen}
|
||||||
open={withdrawOpen}
|
onClose={handleWithdrawClose}
|
||||||
onClose={handleWithdrawClose}
|
/>
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -226,6 +226,20 @@
|
|||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__hint {
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
color: @blColorG1;
|
||||||
|
margin-top: 24px;
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================= 群 ================================================= //
|
// ============================================= 群 ================================================= //
|
||||||
|
|||||||
@ -152,6 +152,9 @@ export default function JobBuy(props: IProps) {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__hint`}>
|
||||||
|
注:日会员有效期为 <div className="highlight">支付后24小时</div>
|
||||||
|
</div>
|
||||||
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
||||||
{`支付 ${selectItem.amt} 元`}
|
{`支付 ${selectItem.amt} 元`}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
|
flex: 0 0 96px;
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -45,4 +46,4 @@
|
|||||||
border-top-left-radius: 24px;
|
border-top-left-radius: 24px;
|
||||||
border-top-right-radius: 24px;
|
border-top-right-radius: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/components/top-category-select/index.tsx
Normal file
13
src/components/top-category-select/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Select, { ISelectProps } from '@/components/select';
|
||||||
|
import { JOB_TYPE_SELECT_OPTIONS_WITH_ALL, JobType } from '@/constants/job';
|
||||||
|
|
||||||
|
interface IProps extends Omit<ISelectProps<JobType>, 'options'> {
|
||||||
|
value: JobType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function TopCategorySelect(props: IProps) {
|
||||||
|
const { value: selectValue, onSelect } = props;
|
||||||
|
return <Select options={JOB_TYPE_SELECT_OPTIONS_WITH_ALL} title="品类" value={selectValue} onSelect={onSelect} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TopCategorySelect;
|
||||||
@ -36,7 +36,7 @@ interface CityOption extends ISelectOption<CityValue> {
|
|||||||
const PREFIX = 'user-batch-publish';
|
const PREFIX = 'user-batch-publish';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
||||||
群发次数:每日1次,连发3天
|
群发次数:杭州、广州发3次,其他城市1次
|
||||||
内容要求:仅限带货主播招聘需求,其他不发
|
内容要求:仅限带货主播招聘需求,其他不发
|
||||||
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
||||||
const cityValues: CityValue[] = [
|
const cityValues: CityValue[] = [
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export enum EventName {
|
|||||||
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
||||||
EXIT_CHAT_PAGE = 'exit_chat_page',
|
EXIT_CHAT_PAGE = 'exit_chat_page',
|
||||||
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
||||||
|
VIEW_JOB_SUCCESS = 'view_job_success',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum OpenSource {
|
export enum OpenSource {
|
||||||
@ -34,6 +35,7 @@ export enum OpenSource {
|
|||||||
UserPage = 'user_page',
|
UserPage = 'user_page',
|
||||||
AnchorPage = 'anchor_page',
|
AnchorPage = 'anchor_page',
|
||||||
MaterialViewPage = 'material_view_page',
|
MaterialViewPage = 'material_view_page',
|
||||||
|
GroupOwnerCertificate = 'group_owner_certificate',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PageUrl {
|
export enum PageUrl {
|
||||||
@ -75,6 +77,8 @@ export enum PageUrl {
|
|||||||
Partner = 'pages/partner/index',
|
Partner = 'pages/partner/index',
|
||||||
WithdrawRecord = 'pages/withdraw-record/index',
|
WithdrawRecord = 'pages/withdraw-record/index',
|
||||||
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||||
|
GiveVip = 'pages/give-vip/index',
|
||||||
|
GroupOwnerCertificate = 'pages/group-owner-certification/index',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginUrl {
|
export enum PluginUrl {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ export enum JobType {
|
|||||||
Jewelry = 'JEWELRY', // 珠宝
|
Jewelry = 'JEWELRY', // 珠宝
|
||||||
Appliance = 'APPLIANCE', // 家电
|
Appliance = 'APPLIANCE', // 家电
|
||||||
Furniture = 'FURNITURE', // 日用家具
|
Furniture = 'FURNITURE', // 日用家具
|
||||||
|
OutdoorSports = 'OUTDOOR_SPORTS',
|
||||||
PetFamily = 'PET_FAMILY', // 母婴宠物
|
PetFamily = 'PET_FAMILY', // 母婴宠物
|
||||||
Luxury = 'LUXURY', // 奢品
|
Luxury = 'LUXURY', // 奢品
|
||||||
LocalLive = 'LOCAL_LIVE', // 本地生活
|
LocalLive = 'LOCAL_LIVE', // 本地生活
|
||||||
@ -87,6 +88,7 @@ export const JOB_TYPE_TITLE_MAP: { [key in JobType]: string } = {
|
|||||||
[JobType.Jewelry]: '珠宝',
|
[JobType.Jewelry]: '珠宝',
|
||||||
[JobType.Appliance]: '家电',
|
[JobType.Appliance]: '家电',
|
||||||
[JobType.Furniture]: '日用家具',
|
[JobType.Furniture]: '日用家具',
|
||||||
|
[JobType.OutdoorSports]: '户外运动',
|
||||||
[JobType.PetFamily]: '母婴宠物',
|
[JobType.PetFamily]: '母婴宠物',
|
||||||
[JobType.Luxury]: '奢品',
|
[JobType.Luxury]: '奢品',
|
||||||
[JobType.LocalLive]: '本地生活',
|
[JobType.LocalLive]: '本地生活',
|
||||||
@ -173,6 +175,7 @@ export const JOB_TYPE_SELECT_OPTIONS = [
|
|||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Jewelry], value: JobType.Jewelry },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Jewelry], value: JobType.Jewelry },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Appliance], value: JobType.Appliance },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Appliance], value: JobType.Appliance },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Furniture], value: JobType.Furniture },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Furniture], value: JobType.Furniture },
|
||||||
|
{ label: JOB_TYPE_TITLE_MAP[JobType.OutdoorSports], value: JobType.OutdoorSports },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.PetFamily], value: JobType.PetFamily },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.PetFamily], value: JobType.PetFamily },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Luxury], value: JobType.Luxury },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Luxury], value: JobType.Luxury },
|
||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.LocalLive], value: JobType.LocalLive },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.LocalLive], value: JobType.LocalLive },
|
||||||
@ -181,6 +184,11 @@ export const JOB_TYPE_SELECT_OPTIONS = [
|
|||||||
{ label: JOB_TYPE_TITLE_MAP[JobType.Other], value: JobType.Other },
|
{ label: JOB_TYPE_TITLE_MAP[JobType.Other], value: JobType.Other },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const JOB_TYPE_SELECT_OPTIONS_WITH_ALL = [
|
||||||
|
{ label: JOB_TYPE_TITLE_MAP[JobType.All], value: JobType.All },
|
||||||
|
...JOB_TYPE_SELECT_OPTIONS,
|
||||||
|
];
|
||||||
|
|
||||||
const MAX_SALARY = 10000000;
|
const MAX_SALARY = 10000000;
|
||||||
export const PART_EMPLOY_SALARY_OPTIONS = [
|
export const PART_EMPLOY_SALARY_OPTIONS = [
|
||||||
{ label: '不限' },
|
{ label: '不限' },
|
||||||
|
|||||||
@ -84,14 +84,25 @@ export const WORK_YEAR_OPTIONS = [
|
|||||||
{ label: WORK_YEAR_LABELS[WorkedYears.MoreThreeYear], value: WorkedYears.MoreThreeYear },
|
{ label: WORK_YEAR_LABELS[WorkedYears.MoreThreeYear], value: WorkedYears.MoreThreeYear },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ALL_GENDER_TYPES = [GenderType.All, GenderType.MEN, GenderType.WOMEN];
|
|
||||||
|
|
||||||
export const GENDER_TYPE_TITLE_MAP = {
|
export const GENDER_TYPE_TITLE_MAP = {
|
||||||
[GenderType.All]: '不限',
|
[GenderType.All]: '不限',
|
||||||
[GenderType.WOMEN]: '女',
|
[GenderType.WOMEN]: '女',
|
||||||
[GenderType.MEN]: '男',
|
[GenderType.MEN]: '男',
|
||||||
};
|
};
|
||||||
|
export const GENDER_OPTIONS = [
|
||||||
|
{
|
||||||
|
value: GenderType.All,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.All],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: GenderType.WOMEN,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.WOMEN],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: GenderType.MEN,
|
||||||
|
label: GENDER_TYPE_TITLE_MAP[GenderType.MEN],
|
||||||
|
},
|
||||||
|
];
|
||||||
export const ALL_ANCHOR_READ_TYPES = Object.values(AnchorReadType);
|
export const ALL_ANCHOR_READ_TYPES = Object.values(AnchorReadType);
|
||||||
|
|
||||||
export const ANCHOR_READ_TITLE_MAP = {
|
export const ANCHOR_READ_TITLE_MAP = {
|
||||||
|
|||||||
@ -18,7 +18,8 @@ import {
|
|||||||
ALL_SORT_TYPES,
|
ALL_SORT_TYPES,
|
||||||
EMPLOY_TYPE_TITLE_MAP,
|
EMPLOY_TYPE_TITLE_MAP,
|
||||||
EmployType,
|
EmployType,
|
||||||
JOB_TABS, JobSourceType,
|
JOB_TABS,
|
||||||
|
JobSourceType,
|
||||||
JobType,
|
JobType,
|
||||||
SORT_TYPE_TITLE_MAP,
|
SORT_TYPE_TITLE_MAP,
|
||||||
SortType,
|
SortType,
|
||||||
@ -143,12 +144,7 @@ function JobFragment(props: IProps) {
|
|||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__top-search-bar`}>
|
<div className={`${PREFIX}__top-search-bar`}>
|
||||||
<SearchInput
|
<SearchInput disabled className={`${PREFIX}__search`} placeholder="试试 女装" onClick={handleClickSearch} />
|
||||||
disabled
|
|
||||||
className={`${PREFIX}__search`}
|
|
||||||
placeholder="试试 女装"
|
|
||||||
onClick={handleClickSearch}
|
|
||||||
/>
|
|
||||||
<div className={classNames(`${PREFIX}__employType-select`)} onClick={handleClickEmployTypeSelect}>
|
<div className={classNames(`${PREFIX}__employType-select`)} onClick={handleClickEmployTypeSelect}>
|
||||||
<div className="title">
|
<div className="title">
|
||||||
{employType && employType !== EmployType.All ? EMPLOY_TYPE_TITLE_MAP[employType] : '类型'}
|
{employType && employType !== EmployType.All ? EMPLOY_TYPE_TITLE_MAP[employType] : '类型'}
|
||||||
|
|||||||
@ -98,6 +98,8 @@ export const APP_CONFIG: AppConfigType = {
|
|||||||
PageUrl.Partner,
|
PageUrl.Partner,
|
||||||
PageUrl.WithdrawRecord,
|
PageUrl.WithdrawRecord,
|
||||||
PageUrl.GroupDelegatePublish,
|
PageUrl.GroupDelegatePublish,
|
||||||
|
PageUrl.GiveVip,
|
||||||
|
PageUrl.GroupOwnerCertificate,
|
||||||
// PageUrl.DevDebug,
|
// PageUrl.DevDebug,
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
10
src/hooks/use-service-urls.tsx
Normal file
10
src/hooks/use-service-urls.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { selectServiceUrls } from '@/store/selector';
|
||||||
|
|
||||||
|
function useServiceUrls() {
|
||||||
|
const data = useSelector(selectServiceUrls);
|
||||||
|
return data || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useServiceUrls;
|
||||||
@ -1,5 +1,6 @@
|
|||||||
// export const DOMAIN = 'http://192.168.60.191:8082';
|
// export const DOMAIN = 'http://192.168.60.116:8082';
|
||||||
export const DOMAIN = 'https://neighbourhood.cn';
|
export const DOMAIN = process.env.BRAND === 'dev' ? 'https://dev.neighbourhood.cn' : 'https://neighbourhood.cn';
|
||||||
|
// export const DOMAIN = 'https://dev.neighbourhood.cn';
|
||||||
export const BASE_URL = `${DOMAIN}/api`;
|
export const BASE_URL = `${DOMAIN}/api`;
|
||||||
|
|
||||||
export enum API {
|
export enum API {
|
||||||
@ -84,4 +85,15 @@ export enum API {
|
|||||||
GET_PROFIT_STAT = '/user/profits',
|
GET_PROFIT_STAT = '/user/profits',
|
||||||
WITHDRAW = '/user/withdraw',
|
WITHDRAW = '/user/withdraw',
|
||||||
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
GET_WITHDRAW_LIST = '/user/withdraw/records',
|
||||||
|
GENERATE_MEMBERSHIP_COUPON = '/coupon/membership/generate',
|
||||||
|
CLAIM_MEMBERSHIP_COUPON = '/coupon/membership/claim',
|
||||||
|
GET_VIP_QRCODE = '/user/getVipQrCode',
|
||||||
|
// 群认证
|
||||||
|
GENERATE_GROUP_AUTH_CODE = '/partner/generateGroupAuthCode',
|
||||||
|
DECRYPT_OPEN_GID = '/partner/decryptOpenGid',
|
||||||
|
GET_USER_PROFIT_LIST = '/partner/getLatestUserProfitList',
|
||||||
|
GET_AUTHED_GROUP_LIST = '/partner/getAuthedGroupList',
|
||||||
|
GET_STAFF_CODE = '/partner/staff/{cityCode}',
|
||||||
|
// 所有城市运营
|
||||||
|
GET_ALL_CITY_OPERATOR = '/group/getAllGroup',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,11 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
color: @blColor;
|
color: @blColor;
|
||||||
|
gap: 20px;
|
||||||
|
|
||||||
|
&-item {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
.title {
|
.title {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
@ -61,11 +65,17 @@
|
|||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
}
|
}
|
||||||
&__overlay-outer {
|
&__overlay-outer {
|
||||||
top: 82px;
|
top: 72px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__overlay-inner {
|
&__overlay-inner {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
.bl-select__items-container {
|
||||||
|
max-height: calc(100vh - 610rpx);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__tips-container {
|
&__tips-container {
|
||||||
@ -91,8 +101,6 @@
|
|||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&__popup {
|
&__popup {
|
||||||
&-content {
|
&-content {
|
||||||
.flex-column();
|
.flex-column();
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import { Popup } from '@taroify/core';
|
|||||||
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import AnchorList, { IAnchorListProps } from '@/components/anchor-list';
|
import AnchorList, { IAnchorListProps } from '@/components/anchor-list';
|
||||||
import AnchorPicker from '@/components/anchor-picker';
|
import AnchorPicker from '@/components/anchor-picker';
|
||||||
import CustomNavigationBar from '@/components/custom-navigation-bar';
|
import CustomNavigationBar from '@/components/custom-navigation-bar';
|
||||||
|
import EmployTypeSelect from '@/components/employ-type-select';
|
||||||
|
import GenderSelect from '@/components/gender-select';
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import Overlay from '@/components/overlay';
|
import Overlay from '@/components/overlay';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
@ -17,8 +19,14 @@ import PartnerBanner from '@/components/partner-banner';
|
|||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import SwitchBar from '@/components/switch-bar';
|
import SwitchBar from '@/components/switch-bar';
|
||||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, EmployType, JOB_TYPE_TITLE_MAP, JobType } from '@/constants/job';
|
||||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
import {
|
||||||
|
ALL_ANCHOR_SORT_TYPES,
|
||||||
|
ANCHOR_SORT_TYPE_TITLE_MAP,
|
||||||
|
AnchorSortType,
|
||||||
|
GENDER_TYPE_TITLE_MAP,
|
||||||
|
GenderType,
|
||||||
|
} from '@/constants/material';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import useLocation from '@/hooks/use-location';
|
import useLocation from '@/hooks/use-location';
|
||||||
@ -36,6 +44,7 @@ import { getCommonShareMessage } from '@/utils/share';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
import TopCategorySelect from '@/components/top-category-select';
|
||||||
|
|
||||||
const PREFIX = 'page-anchor';
|
const PREFIX = 'page-anchor';
|
||||||
const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`;
|
const LIST_CONTAINER_CLASS = `${PREFIX}__list-container`;
|
||||||
@ -78,12 +87,22 @@ function ListWrapper(props: IAnchorListProps) {
|
|||||||
return <AnchorList listHeight={listHeight} {...props} onListEmpty={handleListEmpty} />;
|
return <AnchorList listHeight={listHeight} {...props} onListEmpty={handleListEmpty} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum FilterType {
|
||||||
|
gender,
|
||||||
|
employType,
|
||||||
|
topCategory,
|
||||||
|
more,
|
||||||
|
}
|
||||||
|
|
||||||
export default function AnchorPage() {
|
export default function AnchorPage() {
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [selectJob, setSelectJob] = useState<JobManageInfo | undefined>();
|
const [selectJob, setSelectJob] = useState<JobManageInfo | undefined>();
|
||||||
const [filters, setFilters] = useState<IAnchorFilters>({ employType: EmployType.All });
|
const [moreFilters, setMoreFilters] = useState<IAnchorFilters>({});
|
||||||
const [showFilter, setShowFilter] = useState<boolean>(false);
|
const [gender, setGender] = useState<GenderType>(GenderType.All);
|
||||||
|
const [employType, setEmployType] = useState<EmployType>(EmployType.All);
|
||||||
|
const [topCategory, setTopCategory] = useState<JobType>(JobType.All);
|
||||||
|
const [showFilter, setShowFilter] = useState<FilterType | null>(null);
|
||||||
const [sortType, setSortType] = useState<AnchorSortType>(AnchorSortType.Active);
|
const [sortType, setSortType] = useState<AnchorSortType>(AnchorSortType.Active);
|
||||||
const [openPopup, setOpenPopup] = useState<boolean>(false);
|
const [openPopup, setOpenPopup] = useState<boolean>(false);
|
||||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||||
@ -106,20 +125,35 @@ export default function AnchorPage() {
|
|||||||
[selectJob]
|
[selectJob]
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleClickSalarySelect = useCallback(() => {
|
const handleClickFilterSelect = (type: FilterType) => () => {
|
||||||
setShowFilter(!showFilter);
|
setShowFilter(type === showFilter ? null : type);
|
||||||
}, [showFilter]);
|
};
|
||||||
|
|
||||||
const handleHideFilter = useCallback(() => setShowFilter(false), []);
|
const handleHideFilter = useCallback(() => setShowFilter(null), []);
|
||||||
|
|
||||||
const handleFilterChange = useCallback(
|
const handleFilterChange = useCallback(
|
||||||
(newFilters: IAnchorFilters) => {
|
(newFilters: IAnchorFilters) => {
|
||||||
!isEqual(newFilters, filters) && setFilters(newFilters);
|
!isEqual(newFilters, moreFilters) && setMoreFilters(newFilters);
|
||||||
setShowFilter(false);
|
setShowFilter(null);
|
||||||
},
|
},
|
||||||
[filters]
|
[moreFilters]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleChangeSelectGender = useCallback((value: GenderType) => {
|
||||||
|
setGender(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleChangeSelectEmployType = useCallback((value: EmployType) => {
|
||||||
|
setEmployType(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleChangeSelectTopCategory = useCallback((value: JobType) => {
|
||||||
|
setTopCategory(value);
|
||||||
|
setShowFilter(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClickSortType = useCallback(async (type: AnchorSortType) => setSortType(type), []);
|
const handleClickSortType = useCallback(async (type: AnchorSortType) => setSortType(type), []);
|
||||||
|
|
||||||
const handleJobChange = useCallback(
|
const handleJobChange = useCallback(
|
||||||
@ -205,6 +239,15 @@ export default function AnchorPage() {
|
|||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|
||||||
|
const filters = useMemo(
|
||||||
|
() => ({
|
||||||
|
...moreFilters,
|
||||||
|
topCategory: topCategory === JobType.All ? undefined : topCategory,
|
||||||
|
gender: gender === -1 ? undefined : gender,
|
||||||
|
employType,
|
||||||
|
}),
|
||||||
|
[moreFilters, gender, employType, topCategory]
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<HomePage type={PageType.Anchor}>
|
<HomePage type={PageType.Anchor}>
|
||||||
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
||||||
@ -224,9 +267,23 @@ export default function AnchorPage() {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className={classNames(`${PREFIX}__filter`)} onClick={handleClickSalarySelect}>
|
<div className={classNames(`${PREFIX}__filter`)}>
|
||||||
<div className="title">筛选</div>
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.gender)}>
|
||||||
{showFilter ? <ArrowUp /> : <ArrowDown />}
|
<div className="title">{gender === GenderType.All ? '性别' : GENDER_TYPE_TITLE_MAP[gender]}</div>
|
||||||
|
{showFilter === FilterType.gender ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.employType)}>
|
||||||
|
<div className="title">{employType === EmployType.All ? '类型' : EMPLOY_TYPE_TITLE_MAP[employType]}</div>
|
||||||
|
{showFilter === FilterType.employType ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.topCategory)}>
|
||||||
|
<div className="title">{topCategory === JobType.All ? '品类' : JOB_TYPE_TITLE_MAP[topCategory]}</div>
|
||||||
|
{showFilter === FilterType.topCategory ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__filter-item`} onClick={handleClickFilterSelect(FilterType.more)}>
|
||||||
|
<div className="title">更多</div>
|
||||||
|
{showFilter === FilterType.more ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__banner`}>
|
<div className={`${PREFIX}__banner`}>
|
||||||
@ -243,12 +300,36 @@ export default function AnchorPage() {
|
|||||||
className={LIST_CONTAINER_CLASS}
|
className={LIST_CONTAINER_CLASS}
|
||||||
/>
|
/>
|
||||||
<Overlay
|
<Overlay
|
||||||
visible={showFilter}
|
visible={showFilter === FilterType.gender}
|
||||||
onClickOuter={handleHideFilter}
|
onClickOuter={handleHideFilter}
|
||||||
outerClassName={`${PREFIX}__overlay-outer`}
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
innerClassName={`${PREFIX}__overlay-inner`}
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
>
|
>
|
||||||
<AnchorPicker value={filters} onConfirm={handleFilterChange} />
|
<GenderSelect value={gender} onSelect={handleChangeSelectGender} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.employType}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<EmployTypeSelect value={employType} onSelect={handleChangeSelectEmployType} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.topCategory}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<TopCategorySelect value={topCategory} onSelect={handleChangeSelectTopCategory} />
|
||||||
|
</Overlay>
|
||||||
|
<Overlay
|
||||||
|
visible={showFilter === FilterType.more}
|
||||||
|
onClickOuter={handleHideFilter}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<AnchorPicker value={moreFilters} onConfirm={handleFilterChange} />
|
||||||
</Overlay>
|
</Overlay>
|
||||||
</div>
|
</div>
|
||||||
<Popup
|
<Popup
|
||||||
|
|||||||
3
src/pages/give-vip/index.config.ts
Normal file
3
src/pages/give-vip/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '赠送会员',
|
||||||
|
});
|
||||||
130
src/pages/give-vip/index.less
Normal file
130
src/pages/give-vip/index.less
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
@import '@/styles/variables.less';
|
||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.give-vip {
|
||||||
|
padding: 40px 24px 200px 24px;
|
||||||
|
&__hint {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColorG2;
|
||||||
|
gap: 12px;
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
&__icon {
|
||||||
|
width: 65px;
|
||||||
|
height: 65px;
|
||||||
|
}
|
||||||
|
&__title {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 40px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blColor;
|
||||||
|
text-align: center;
|
||||||
|
flex: 0 1 auto;
|
||||||
|
gap: 12px;
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
.highlight {
|
||||||
|
margin-left: -12px;
|
||||||
|
display: inline-block;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
&__info {
|
||||||
|
&-block {
|
||||||
|
margin-top: 48px;
|
||||||
|
}
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: #1d2129;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
&-card {
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
&-body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
}
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
height: 614px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px 32px;
|
||||||
|
box-shadow: 0px -4px 20px 0px #00000014;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__footer-body {
|
||||||
|
.flex-row();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
&__button {
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
&__coupon {
|
||||||
|
&-info {
|
||||||
|
position: relative;
|
||||||
|
margin-top: 32px;
|
||||||
|
padding: 24px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 24px;
|
||||||
|
|
||||||
|
.flex-column();
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 48px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
&-intro {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
color: @blColor;
|
||||||
|
gap: 4px;
|
||||||
|
.flex-row();
|
||||||
|
.highlight {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 56px;
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-valid {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
|
||||||
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
103
src/pages/give-vip/index.tsx
Normal file
103
src/pages/give-vip/index.tsx
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
import { Image, Button } from '@tarojs/components';
|
||||||
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Fragment, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { claimMembershipCoupon, getCouponCodeFromQuery } from '@/utils/coupon';
|
||||||
|
import { getPageQuery, switchTab } from '@/utils/route';
|
||||||
|
import { formatTime } from '@/utils/time';
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'give-vip';
|
||||||
|
const log = logWithPrefix(PREFIX);
|
||||||
|
|
||||||
|
enum State {
|
||||||
|
PENDING,
|
||||||
|
SUCCESS,
|
||||||
|
FAILED,
|
||||||
|
}
|
||||||
|
export default function GiveVip() {
|
||||||
|
const [state, setState] = useState<State>(State.PENDING);
|
||||||
|
const [expireAt, setExpireAt] = useState('');
|
||||||
|
const [usedBefore, setUsedBefore] = useState(false);
|
||||||
|
const handleNavigate = useCallback(() => {
|
||||||
|
switchTab(PageUrl.Job);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useLoad(() => {
|
||||||
|
const query = getPageQuery<{ d: string }>();
|
||||||
|
const code = getCouponCodeFromQuery(query);
|
||||||
|
claimMembershipCoupon(code!)
|
||||||
|
.then(res => {
|
||||||
|
setUsedBefore(res.usedBefore);
|
||||||
|
setExpireAt(res.usageExpireAt);
|
||||||
|
setState(Date.now() > new Date(res.usageExpireAt).getTime() ? State.FAILED : State.SUCCESS);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
setState(State.FAILED);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
{state === State.SUCCESS && (
|
||||||
|
<Fragment>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/partner-yes.svg" className={`${PREFIX}__icon`} />
|
||||||
|
<div>{usedBefore ? '宝子,你已经领过了,下周再来' : '宝子,播络会员领取成功'}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__coupon-info`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/parnet-share-bg.png" className={`${PREFIX}__bg`} />
|
||||||
|
<div className={`${PREFIX}__coupon-title`}>播络日会员</div>
|
||||||
|
<div className={`${PREFIX}__coupon-intro`}>
|
||||||
|
会员有效期内可增加<div className="highlight">10次</div>报单机会
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__coupon-valid`}>
|
||||||
|
有效期至:{formatTime(expireAt, 'YYYY/MM/DD HH:mm:ss', false)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
{state === State.FAILED && (
|
||||||
|
<Fragment>
|
||||||
|
<div className={`${PREFIX}__hint`}>
|
||||||
|
<Image
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/link-invalid.svg"
|
||||||
|
mode="aspectFit"
|
||||||
|
className={`${PREFIX}__icon`}
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__hint-title`}>宝子,链接已失效</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>
|
||||||
|
请联系分享人<div className="highlight">再次分享</div>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
)}
|
||||||
|
<div className={`${PREFIX}__info-block`}>
|
||||||
|
<div className={`${PREFIX}__info-title`}>播络简介</div>
|
||||||
|
<div className={`${PREFIX}__info-card`}>
|
||||||
|
<div className={`${PREFIX}__info-body`}>
|
||||||
|
播络通告整理汇集了本地每日新增带货主播通告,方便大家及时找到高薪工作
|
||||||
|
</div>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__info-img`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-share-coupon-img.png"
|
||||||
|
mode="heightFix"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
<div className={`${PREFIX}__footer-body`}>
|
||||||
|
<Button className={`${PREFIX}__button`} onClick={handleNavigate}>
|
||||||
|
立即使用
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SafeBottomPadding />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
4
src/pages/group-owner-certification/index.config.ts
Normal file
4
src/pages/group-owner-certification/index.config.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '群主认证',
|
||||||
|
enableShareAppMessage: true,
|
||||||
|
});
|
||||||
127
src/pages/group-owner-certification/index.less
Normal file
127
src/pages/group-owner-certification/index.less
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.group-owner-certification {
|
||||||
|
&__tabs {
|
||||||
|
--tabs-active-color: @blHighlightColor;
|
||||||
|
--tabs-nav-background-color: #fff;
|
||||||
|
--tabs-wrap-height: 98px;
|
||||||
|
|
||||||
|
> .taroify-tabs__wrap {
|
||||||
|
position: fixed;
|
||||||
|
width: 100vw;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .taroify-tabs__content {
|
||||||
|
padding-top: var(--tabs-wrap-height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__main {
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-right: 24px;
|
||||||
|
padding-top: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__block {
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
margin-bottom: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__bold {
|
||||||
|
font-weight: 500;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
|
.highlight {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin-bottom: 24px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
|
||||||
|
color: #1d2129;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__share {
|
||||||
|
.button(@height: 72px; @width: 384px; @fontSize: 28px; @fontWeight: 400; @borderRadius: 44px; @highlight: 0);
|
||||||
|
margin-top: 32px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
&__lined-wrapper {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 48px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
&__lined-title {
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: -68px;
|
||||||
|
width: 56px;
|
||||||
|
height: 1px;
|
||||||
|
background: #ccc;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
right: -68px;
|
||||||
|
width: 56px;
|
||||||
|
height: 1px;
|
||||||
|
background: #ccc;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&__city-select {
|
||||||
|
background: #F7F7F7;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 34px 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
color: #333333;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
&__qrcode {
|
||||||
|
width: 280px;
|
||||||
|
height: 280px;
|
||||||
|
background: #6F7686;
|
||||||
|
margin: auto auto 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
123
src/pages/group-owner-certification/index.tsx
Normal file
123
src/pages/group-owner-certification/index.tsx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Tabs } from '@taroify/core';
|
||||||
|
import { Arrow } from '@taroify/icons';
|
||||||
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import GroupCertificationList from '@/components/group-certification-list';
|
||||||
|
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
||||||
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useLocation from '@/hooks/use-location';
|
||||||
|
import { StaffInfo } from '@/types/partner';
|
||||||
|
import { generateGroupAuthCode, getStaffInfo } from '@/utils/partner';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'group-owner-certification';
|
||||||
|
|
||||||
|
export default function GroupOwnerCertification() {
|
||||||
|
const location = useLocation();
|
||||||
|
const inviteCode = useInviteCode();
|
||||||
|
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
||||||
|
const cityValuesChangedRef = useRef(false);
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
useShareAppMessage(async () => {
|
||||||
|
const { authCode } = await generateGroupAuthCode();
|
||||||
|
return getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
title: `群主测试,${authCode}`,
|
||||||
|
inviteCode,
|
||||||
|
params: { authCode },
|
||||||
|
path: PageUrl.GroupOwnerCertificate,
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-group-owner-certificate.png',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleClickCityMenu = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.CitySearch, { city: cityCode, source: OpenSource.GroupOwnerCertificate });
|
||||||
|
}, [cityCode]);
|
||||||
|
|
||||||
|
const handleCityChange = useCallback(data => {
|
||||||
|
console.log('handleCityChange', data);
|
||||||
|
const { openSource, cityCode: cCode } = data;
|
||||||
|
if (openSource !== OpenSource.GroupOwnerCertificate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cityValuesChangedRef.current = true;
|
||||||
|
setCityCode(cCode);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (cityValuesChangedRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setCityCode(location.cityCode);
|
||||||
|
}, [location]);
|
||||||
|
useEffect(() => {
|
||||||
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
|
return () => {
|
||||||
|
Taro.eventCenter.off(EventName.SELECT_CITY, handleCityChange);
|
||||||
|
};
|
||||||
|
}, [handleCityChange]);
|
||||||
|
|
||||||
|
const [staffInfo, setStaffInfo] = useState<StaffInfo | null>(null);
|
||||||
|
useEffect(() => {
|
||||||
|
getStaffInfo(cityCode)
|
||||||
|
.then(data => {
|
||||||
|
setStaffInfo(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setStaffInfo(null);
|
||||||
|
});
|
||||||
|
}, [cityCode]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Tabs className={`${PREFIX}__tabs`}>
|
||||||
|
<Tabs.TabPane value={0} title="认证方法">
|
||||||
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>第一步:拉运营入群</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div>拉播络城市运营进入你的带货主播群,</div>
|
||||||
|
<div>请确认你是群主且是带货主播群,不然不要拉</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__lined-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__lined-title`}>选择城市,添加运营</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__city-select`} onClick={handleClickCityMenu}>
|
||||||
|
{CITY_CODE_TO_NAME_MAP.get(cityCode)}
|
||||||
|
<Arrow size={16} />
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__lined-wrapper`}>
|
||||||
|
<div className={`${PREFIX}__lined-title`}>长按并识别二维码添加运营</div>
|
||||||
|
</div>
|
||||||
|
{staffInfo && <Image className={`${PREFIX}__qrcode`} src={staffInfo.staffQrCode} mode="aspectFill" />}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>第二步</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__h1 ${PREFIX}__bold`}>点击以下按钮分享小程序到群,并在群里打开小程序</div>
|
||||||
|
<div className={`${PREFIX}__body center`}>
|
||||||
|
<div className="highlight">1次分享只能认证一个群,有多个群请分享多次,不可在微信聊天里直接转发;</div>
|
||||||
|
一般1天内完成,超时未完成认证请重新分享或者咨询运营
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__share`} openType="share">
|
||||||
|
分享小程序
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane value={1} title="已认证的群">
|
||||||
|
<GroupCertificationList />
|
||||||
|
</Tabs.TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -5,8 +5,8 @@ import { useCallback } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useServiceUrls from '@/hooks/use-service-urls';
|
||||||
import { switchRoleType } from '@/utils/app';
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
@ -20,6 +20,7 @@ const PREFIX = 'group-v2-page';
|
|||||||
|
|
||||||
export default function GroupV2() {
|
export default function GroupV2() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const serviceUrls = useServiceUrls();
|
||||||
|
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
switchRoleType(RoleType.Anchor);
|
switchRoleType(RoleType.Anchor);
|
||||||
@ -32,15 +33,18 @@ export default function GroupV2() {
|
|||||||
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
getCommonShareMessage({ inviteCode, title: '邀请你加入本地主播求职招聘群', path: PageUrl.GroupV2 })
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(
|
||||||
if (!checkCityCode(cityCode)) {
|
cityCode => {
|
||||||
return;
|
if (!checkCityCode(cityCode)) {
|
||||||
}
|
return;
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
}
|
||||||
if (group) {
|
const group = serviceUrls.find(g => String(g.cityCode) === cityCode);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
if (group) {
|
||||||
}
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[serviceUrls]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage type={PageType.GroupV2}>
|
<HomePage type={PageType.GroupV2}>
|
||||||
|
|||||||
@ -200,7 +200,9 @@ const CompanyFooter = (props: { data: JobDetails }) => {
|
|||||||
const errorCode = e.errorCode;
|
const errorCode = e.errorCode;
|
||||||
const errorMsg = e.info?.() || e.message;
|
const errorMsg = e.info?.() || e.message;
|
||||||
collectEvent(CollectEventName.PUBLISH_OPEN_JOB_FAILED, { jobId: data.id, error: e.info?.() || e.message });
|
collectEvent(CollectEventName.PUBLISH_OPEN_JOB_FAILED, { jobId: data.id, error: e.info?.() || e.message });
|
||||||
if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_FREE_BALANCE) {
|
||||||
|
setShowBuy(true);
|
||||||
|
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
||||||
Toast.info('您购买的产品已耗尽使用次数');
|
Toast.info('您购买的产品已耗尽使用次数');
|
||||||
setShowBuy(true);
|
setShowBuy(true);
|
||||||
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
||||||
@ -286,6 +288,7 @@ export default function JobDetail() {
|
|||||||
if (!jobId) {
|
if (!jobId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Taro.eventCenter.trigger(EventName.VIEW_JOB_SUCCESS, jobId);
|
||||||
try {
|
try {
|
||||||
const res = await requestJobDetail(jobId);
|
const res = await requestJobDetail(jobId);
|
||||||
setData(res);
|
setData(res);
|
||||||
|
|||||||
@ -56,7 +56,27 @@
|
|||||||
&__icon {
|
&__icon {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__block {
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
.flex-row();
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__status {
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 32px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: @blColorG1;
|
||||||
|
|
||||||
|
&.open {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.error {
|
||||||
|
color: #FF5051;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import classNames from 'classnames';
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import { EventName, OpenSource } from '@/constants/app';
|
import { EventName, OpenSource } from '@/constants/app';
|
||||||
|
import { JOB_MANAGE_STATUS_TITLE_MAP, JobManageStatus } from '@/constants/job';
|
||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { getJobLocation, requestJobManageList } from '@/utils/job';
|
import { getJobLocation, requestJobManageList } from '@/utils/job';
|
||||||
import { getPageQuery, navigateBack } from '@/utils/route';
|
import { getPageQuery, navigateBack } from '@/utils/route';
|
||||||
@ -15,7 +16,14 @@ import Toast from '@/utils/toast';
|
|||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-job-select-my-publish';
|
const PREFIX = 'page-job-select-my-publish';
|
||||||
|
const STATUS_CLASS_MAP = {
|
||||||
|
[JobManageStatus.WaitVerify]: 'pending',
|
||||||
|
[JobManageStatus.Open]: 'open',
|
||||||
|
[JobManageStatus.Pending]: 'pending',
|
||||||
|
[JobManageStatus.Error]: 'error',
|
||||||
|
[JobManageStatus.Close]: 'close',
|
||||||
|
[JobManageStatus.Expire]: 'close',
|
||||||
|
};
|
||||||
export default function JobSelectMyPublish() {
|
export default function JobSelectMyPublish() {
|
||||||
const [list, setList] = useState<JobManageInfo[]>([]);
|
const [list, setList] = useState<JobManageInfo[]>([]);
|
||||||
const [jobId, setJobId] = useState<string | null>('1');
|
const [jobId, setJobId] = useState<string | null>('1');
|
||||||
@ -57,13 +65,18 @@ export default function JobSelectMyPublish() {
|
|||||||
</div>
|
</div>
|
||||||
<div className={`${PREFIX}__right`}>
|
<div className={`${PREFIX}__right`}>
|
||||||
<div className={`${PREFIX}__right__time`}>{formatTime(item.updated)}</div>
|
<div className={`${PREFIX}__right__time`}>{formatTime(item.updated)}</div>
|
||||||
{item.id === jobId && (
|
<div className={`${PREFIX}__right__block`}>
|
||||||
<Image
|
<div className={classNames(`${PREFIX}__right__status`, { [STATUS_CLASS_MAP[item.status]]: true })}>
|
||||||
mode="aspectFit"
|
{JOB_MANAGE_STATUS_TITLE_MAP[item.status]}
|
||||||
className={`${PREFIX}__right__icon`}
|
</div>
|
||||||
src={require('@/statics/svg/success.svg')}
|
{item.id === jobId && (
|
||||||
/>
|
<Image
|
||||||
)}
|
mode="aspectFit"
|
||||||
|
className={`${PREFIX}__right__icon`}
|
||||||
|
src={require('@/statics/svg/success.svg')}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -9,13 +9,17 @@ import PageLoading from '@/components/page-loading';
|
|||||||
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
import { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
||||||
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { JobManageStatus } from '@/constants/job';
|
import { JobManageStatus } from '@/constants/job';
|
||||||
import { MaterialViewSource } from '@/constants/material';
|
import { MaterialViewSource } from '@/constants/material';
|
||||||
import ProfileViewFragment from '@/fragments/profile/view';
|
import ProfileViewFragment from '@/fragments/profile/view';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
||||||
import { HttpError } from '@/http/error';
|
import { HttpError } from '@/http/error';
|
||||||
|
import store from '@/store';
|
||||||
|
import { cacheJobId } from '@/store/actions';
|
||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { MaterialProfile } from '@/types/material';
|
import { MaterialProfile } from '@/types/material';
|
||||||
import { IJobMessage } from '@/types/message';
|
import { IJobMessage } from '@/types/message';
|
||||||
@ -29,10 +33,6 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|||||||
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
|
||||||
import store from '@/store';
|
|
||||||
import { cacheJobId } from '@/store/actions';
|
|
||||||
|
|
||||||
const PREFIX = 'page-material-view';
|
const PREFIX = 'page-material-view';
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,9 @@ import { useState } from 'react';
|
|||||||
import PartnerIntro from '@/components/partner-intro';
|
import PartnerIntro from '@/components/partner-intro';
|
||||||
import PartnerInviteList from '@/components/partner-invite-list';
|
import PartnerInviteList from '@/components/partner-invite-list';
|
||||||
import PartnerProfit from '@/components/partner-profit';
|
import PartnerProfit from '@/components/partner-profit';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { generateMembershipCoupon } from '@/utils/coupon';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -18,9 +20,17 @@ export default function Partner() {
|
|||||||
const handleChange = v => {
|
const handleChange = v => {
|
||||||
setTab(v);
|
setTab(v);
|
||||||
};
|
};
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(async () => {
|
||||||
console.log('Partner inviteCode', inviteCode);
|
console.log('Partner inviteCode', inviteCode);
|
||||||
return getCommonShareMessage({ useCapture: false, inviteCode });
|
const { code } = await generateMembershipCoupon();
|
||||||
|
return getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
inviteCode,
|
||||||
|
title: '宝子,送你个播络会员,免费找主播工作',
|
||||||
|
path: PageUrl.GiveVip,
|
||||||
|
params: { d: code },
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-coupon1.png',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -5,5 +5,7 @@ import Toast from '@/utils/toast';
|
|||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
export default function ProtocolWebview() {
|
export default function ProtocolWebview() {
|
||||||
return <WebView src="https://neighbourhood.cn/user-agreement.html" onError={() => Toast.error('加载失败请重试')} />;
|
return (
|
||||||
|
<WebView src="https://neighbourhood.cn/user-agreement.html?t=1" onError={() => Toast.error('加载失败请重试')} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import { useCallback, useState } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import SearchCity from '@/components/search-city';
|
import SearchCity from '@/components/search-city';
|
||||||
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { GROUPS } from '@/constants/group';
|
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import useServiceUrls from '@/hooks/use-service-urls';
|
||||||
import { switchRoleType } from '@/utils/app';
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { openCustomerServiceChat } from '@/utils/common';
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
import { getCurrentCityCode } from '@/utils/location';
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
@ -23,6 +23,7 @@ const EXAMPLE_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-examp
|
|||||||
const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
const COMMENT_IMAGE = 'https://publiccdn.neighbourhood.com.cn/img/delegate-comments.png';
|
||||||
export default function BizService() {
|
export default function BizService() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const serviceUrls = useServiceUrls();
|
||||||
const [value, setValue] = useState('0');
|
const [value, setValue] = useState('0');
|
||||||
|
|
||||||
const handleClickDelegate = useCallback(() => {
|
const handleClickDelegate = useCallback(() => {
|
||||||
@ -37,15 +38,18 @@ export default function BizService() {
|
|||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfcd60708731367168d');
|
||||||
}, []);
|
}, []);
|
||||||
const handleSelectCity = useCallback(cityCode => {
|
const handleSelectCity = useCallback(
|
||||||
if (!checkCityCode(cityCode)) {
|
cityCode => {
|
||||||
return;
|
if (!checkCityCode(cityCode)) {
|
||||||
}
|
return;
|
||||||
const group = GROUPS.find(g => String(g.cityCode) === cityCode);
|
}
|
||||||
if (group) {
|
const group = serviceUrls.find(g => String(g.cityCode) === cityCode);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
if (group) {
|
||||||
}
|
openCustomerServiceChat(group.serviceUrl);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[serviceUrls]
|
||||||
|
);
|
||||||
const handleChange = useCallback(v => {
|
const handleChange = useCallback(v => {
|
||||||
setValue(v);
|
setValue(v);
|
||||||
}, []);
|
}, []);
|
||||||
@ -82,7 +86,7 @@ export default function BizService() {
|
|||||||
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
||||||
<div className={`${PREFIX}__delegate-card`}>
|
<div className={`${PREFIX}__delegate-card`}>
|
||||||
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
||||||
<div className={`${PREFIX}__delegate-body`}>群发次数:每日1次,连发3天</div>
|
<div className={`${PREFIX}__delegate-body`}>群发次数:杭州、广州发3次,其他城市1次</div>
|
||||||
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
||||||
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
import { RoleType, PageType } from '@/constants/app';
|
import { RoleType, PageType } from '@/constants/app';
|
||||||
import { LocationInfo } from '@/types/location';
|
import { LocationInfo } from '@/types/location';
|
||||||
|
import { AppState } from '@/types/store';
|
||||||
|
|
||||||
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO } from '../constants';
|
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO, SET_SERVICE_URLS } from '../constants';
|
||||||
|
|
||||||
export const changeRoleType = (value: RoleType) => ({ type: CHANGE_ROLE_TYPE, value });
|
export const changeRoleType = (value: RoleType) => ({ type: CHANGE_ROLE_TYPE, value });
|
||||||
|
|
||||||
export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, value });
|
export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, value });
|
||||||
|
|
||||||
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
|
||||||
|
|
||||||
|
export const setServiceUrls = (value: AppState['serviceUrls']) => ({ type: SET_SERVICE_URLS, value });
|
||||||
|
|||||||
@ -6,3 +6,4 @@ export const SET_BIND_PHONE = 'SET_BIND_PHONE';
|
|||||||
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
|
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
|
||||||
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
|
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
|
||||||
export const SET_JOB_ID = 'SET_JOB_ID';
|
export const SET_JOB_ID = 'SET_JOB_ID';
|
||||||
|
export const SET_SERVICE_URLS = 'SET_SERVICE_URLS';
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { CacheKey } from '@/constants/cache-key';
|
|||||||
import { LocationInfo } from '@/types/location';
|
import { LocationInfo } from '@/types/location';
|
||||||
import { AppState } from '@/types/store';
|
import { AppState } from '@/types/store';
|
||||||
|
|
||||||
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO } from '../constants';
|
import { CHANGE_ROLE_TYPE, CHANGE_HOME_PAGE, SET_LOCATION_INFO, SET_SERVICE_URLS } from '../constants';
|
||||||
|
|
||||||
const DEFAULT_LOCATION: LocationInfo = {
|
const DEFAULT_LOCATION: LocationInfo = {
|
||||||
provinceCode: '440000',
|
provinceCode: '440000',
|
||||||
@ -23,6 +23,7 @@ const INIT_STATE: AppState = {
|
|||||||
roleType: defaultAppMode,
|
roleType: defaultAppMode,
|
||||||
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
|
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
|
||||||
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
|
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
|
||||||
|
serviceUrls: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
||||||
@ -33,6 +34,8 @@ const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
|
|||||||
return { ...state, roleType: value };
|
return { ...state, roleType: value };
|
||||||
case CHANGE_HOME_PAGE:
|
case CHANGE_HOME_PAGE:
|
||||||
return { ...state, homePageType: value };
|
return { ...state, homePageType: value };
|
||||||
|
case SET_SERVICE_URLS:
|
||||||
|
return { ...state, serviceUrls: value };
|
||||||
case SET_LOCATION_INFO:
|
case SET_LOCATION_INFO:
|
||||||
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
|
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
|
||||||
return { ...state, location: value };
|
return { ...state, location: value };
|
||||||
|
|||||||
@ -5,3 +5,5 @@ export const selectRoleType = (state: IState) => state.appState.roleType;
|
|||||||
export const selectHomePageType = (state: IState) => state.appState.homePageType;
|
export const selectHomePageType = (state: IState) => state.appState.homePageType;
|
||||||
|
|
||||||
export const selectLocation = (state: IState) => state.appState.location;
|
export const selectLocation = (state: IState) => state.appState.location;
|
||||||
|
|
||||||
|
export const selectServiceUrls = (state: IState) => state.appState.serviceUrls || {};
|
||||||
|
|||||||
11
src/types/coupon.ts
Normal file
11
src/types/coupon.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export type ClaimMembershipCouponResponse = {
|
||||||
|
code: string;
|
||||||
|
usedBefore: boolean;
|
||||||
|
usageExpireAt: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type GenerateMembershipCouponResponse = {
|
||||||
|
code: string;
|
||||||
|
linkExpireAt: string;
|
||||||
|
shareUrl: string;
|
||||||
|
};
|
||||||
@ -17,6 +17,7 @@ export interface JobInfo {
|
|||||||
distance?: number; // 距离。一期没有
|
distance?: number; // 距离。一期没有
|
||||||
isAuthed?: boolean; // 是否认证
|
isAuthed?: boolean; // 是否认证
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
|
isRead?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateJobInfo extends Pick<JobInfo, 'title' | 'employType' | 'jobDescription'> {
|
export interface CreateJobInfo extends Pick<JobInfo, 'title' | 'employType' | 'jobDescription'> {
|
||||||
|
|||||||
@ -20,3 +20,14 @@ export interface GetCityCodeRequest {
|
|||||||
latitude: number; // 纬度,浮点数,范围为-90~90,负数表示南纬
|
latitude: number; // 纬度,浮点数,范围为-90~90,负数表示南纬
|
||||||
longitude: number; // 经度,范围为-180~180,负数表示西经
|
longitude: number; // 经度,范围为-180~180,负数表示西经
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CityOperatorListItem {
|
||||||
|
id: number;
|
||||||
|
staffId: number;
|
||||||
|
staffName: string;
|
||||||
|
cityName: string;
|
||||||
|
cityCode: string;
|
||||||
|
groupLink: string;
|
||||||
|
created: string;
|
||||||
|
updated: string;
|
||||||
|
}
|
||||||
|
|||||||
@ -101,6 +101,7 @@ export interface IAnchorFilters {
|
|||||||
lowPriceForPartyTime?: number;
|
lowPriceForPartyTime?: number;
|
||||||
highPriceForPartyTime?: number;
|
highPriceForPartyTime?: number;
|
||||||
category?: string;
|
category?: string;
|
||||||
|
topCategory?: string;
|
||||||
readType?: AnchorReadType;
|
readType?: AnchorReadType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,3 +87,41 @@ export interface PartnerPagination<T> {
|
|||||||
content: T[];
|
content: T[];
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
}
|
}
|
||||||
|
export enum EarnType {
|
||||||
|
ORDER_PAYMENT_SHARE_L1 = 'ORDER_PAYMENT_SHARE_L1',
|
||||||
|
ORDER_PAYMENT_SHARE_L2 = 'ORDER_PAYMENT_SHARE_L2',
|
||||||
|
CHAT_ACTIVITY_SHARE_L1 = 'CHAT_ACTIVITY_SHARE_L1',
|
||||||
|
CHAT_ACTIVITY_SHARE_L2 = 'CHAT_ACTIVITY_SHARE_L2',
|
||||||
|
OTHER = 'OTHER',
|
||||||
|
}
|
||||||
|
export interface UserProfitListItem {
|
||||||
|
userId: string;
|
||||||
|
total: number;
|
||||||
|
earnType: EarnType;
|
||||||
|
amount: number;
|
||||||
|
updatedAt: string;
|
||||||
|
}
|
||||||
|
export interface GroupAuthCode {
|
||||||
|
shareUserId: string;
|
||||||
|
authCode: string;
|
||||||
|
}
|
||||||
|
export interface AuthedGroupInfo {
|
||||||
|
userId: string;
|
||||||
|
openGid: string;
|
||||||
|
groupId: string;
|
||||||
|
groupName: string;
|
||||||
|
groupAvatar: string;
|
||||||
|
authDate: string;
|
||||||
|
}
|
||||||
|
export interface DecryptOpenGidBody {
|
||||||
|
authCode?: string;
|
||||||
|
inviteCode?: string;
|
||||||
|
encryptedData: string;
|
||||||
|
iv: string;
|
||||||
|
}
|
||||||
|
export interface StaffInfo {
|
||||||
|
id: number;
|
||||||
|
staffName: string;
|
||||||
|
staffQrCode: string;
|
||||||
|
isDefault: 0 | 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -17,4 +17,9 @@ export interface AppState {
|
|||||||
roleType: RoleType;
|
roleType: RoleType;
|
||||||
homePageType: PageType;
|
homePageType: PageType;
|
||||||
location: LocationInfo;
|
location: LocationInfo;
|
||||||
|
serviceUrls: Array<{
|
||||||
|
title: string;
|
||||||
|
cityCode: number;
|
||||||
|
serviceUrl: string;
|
||||||
|
}>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { API } from '@/http/api';
|
||||||
|
|
||||||
export const isDev = () => process.env.NODE_ENV === 'development';
|
export const isDev = () => process.env.NODE_ENV === 'development';
|
||||||
// export const isDev = () => true;
|
// export const isDev = () => true;
|
||||||
|
|
||||||
@ -13,7 +15,6 @@ export const isDesktop = (() => {
|
|||||||
return info.platform === 'windows' || info.platform === 'mac';
|
return info.platform === 'windows' || info.platform === 'mac';
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
export const logWithPrefix = isDev()
|
export const logWithPrefix = isDev()
|
||||||
? (prefix: string) =>
|
? (prefix: string) =>
|
||||||
(...args: BL.Anything[]) =>
|
(...args: BL.Anything[]) =>
|
||||||
@ -87,3 +88,9 @@ export const isValidIdCard = (idCard: string) =>
|
|||||||
export const isValidPhone = (phone: string) => /^1[3-9]\d{9}$/.test(phone);
|
export const isValidPhone = (phone: string) => /^1[3-9]\d{9}$/.test(phone);
|
||||||
|
|
||||||
export const getScrollItemId = (id?: string) => (id ? `sid-${id}` : id);
|
export const getScrollItemId = (id?: string) => (id ? `sid-${id}` : id);
|
||||||
|
|
||||||
|
export function buildUrl(url: API, params: Record<string, string | number>): API {
|
||||||
|
return Object.entries(params).reduce((result, [key, value]) => {
|
||||||
|
return result.replace(new RegExp(`\\{${key}\\}`, 'g'), String(value));
|
||||||
|
}, url) as API;
|
||||||
|
}
|
||||||
|
|||||||
31
src/utils/coupon.ts
Normal file
31
src/utils/coupon.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import http from '@/http';
|
||||||
|
import { API } from '@/http/api';
|
||||||
|
import { ClaimMembershipCouponResponse, GenerateMembershipCouponResponse } from '@/types/coupon';
|
||||||
|
|
||||||
|
export const generateMembershipCoupon = async () => {
|
||||||
|
return await http.post<GenerateMembershipCouponResponse>(API.GENERATE_MEMBERSHIP_COUPON);
|
||||||
|
};
|
||||||
|
export const claimMembershipCoupon = async (code: string) => {
|
||||||
|
return await http.post<ClaimMembershipCouponResponse>(API.CLAIM_MEMBERSHIP_COUPON, {
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
data: { code },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export const getCouponQrCode = async (code: string) => {
|
||||||
|
return await http.post(API.GET_VIP_QRCODE, {
|
||||||
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
data: { code },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
export const getCouponCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
||||||
|
if (query) {
|
||||||
|
if (query.scene) {
|
||||||
|
return query.scene.replace('d%3D', '');
|
||||||
|
}
|
||||||
|
if (query.d) {
|
||||||
|
return query.d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
@ -6,9 +6,9 @@ import { CITY_CODE_TO_NAME_MAP, COUNTY_CODE_TO_NAME_MAP, PROVINCE_CODE_TO_NAME_M
|
|||||||
import http from '@/http';
|
import http from '@/http';
|
||||||
import { API } from '@/http/api';
|
import { API } from '@/http/api';
|
||||||
import store from '@/store';
|
import store from '@/store';
|
||||||
import { setLocationInfo } from '@/store/actions';
|
import { setLocationInfo, setServiceUrls } from '@/store/actions';
|
||||||
import { selectLocation } from '@/store/selector';
|
import { selectLocation } from '@/store/selector';
|
||||||
import { GetCityCodeRequest, LocationInfo } from '@/types/location';
|
import { CityOperatorListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
|
||||||
|
|
||||||
import { authorize, getWxSetting } from './wx';
|
import { authorize, getWxSetting } from './wx';
|
||||||
|
|
||||||
@ -134,3 +134,16 @@ export async function requestLocation(force: boolean = false) {
|
|||||||
store.dispatch(setLocationInfo(location));
|
store.dispatch(setLocationInfo(location));
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function requestServiceUrls() {
|
||||||
|
const list = await http.post<CityOperatorListItem[]>(API.GET_ALL_CITY_OPERATOR);
|
||||||
|
store.dispatch(
|
||||||
|
setServiceUrls(
|
||||||
|
(list || []).map(it => ({
|
||||||
|
title: `【${it.cityName}】`,
|
||||||
|
cityCode: Number(it.cityCode),
|
||||||
|
serviceUrl: it.groupLink,
|
||||||
|
}))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -62,6 +62,28 @@ export const getBasicInfo = (profile: Pick<MaterialProfile, 'age' | 'height' | '
|
|||||||
return result.join('·');
|
return result.join('·');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getSalary = (
|
||||||
|
data: Pick<MaterialProfile, 'fullTimeMaxPrice' | 'fullTimeMinPrice' | 'partyTimeMaxPrice' | 'partyTimeMinPrice'>
|
||||||
|
) => {
|
||||||
|
const { fullTimeMinPrice, fullTimeMaxPrice, partyTimeMinPrice, partyTimeMaxPrice } = data;
|
||||||
|
const prices: string[] = [];
|
||||||
|
if (fullTimeMinPrice && fullTimeMaxPrice) {
|
||||||
|
if (fullTimeMinPrice >= 50000) {
|
||||||
|
prices.push(`${fullTimeMinPrice / 1000}K以上/月`);
|
||||||
|
} else {
|
||||||
|
prices.push(`${fullTimeMinPrice / 1000}-${fullTimeMaxPrice / 1000}K/月`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (partyTimeMinPrice && partyTimeMaxPrice) {
|
||||||
|
if (partyTimeMinPrice >= 500) {
|
||||||
|
prices.push(`500以上/小时`);
|
||||||
|
} else {
|
||||||
|
prices.push(`${partyTimeMinPrice}-${partyTimeMaxPrice}/小时`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return prices.filter(Boolean).join(' ');
|
||||||
|
};
|
||||||
|
|
||||||
export const chooseMedia = async (option: Taro.chooseMedia.Option = {}) => {
|
export const chooseMedia = async (option: Taro.chooseMedia.Option = {}) => {
|
||||||
try {
|
try {
|
||||||
const result = await Taro.chooseMedia({
|
const result = await Taro.chooseMedia({
|
||||||
|
|||||||
@ -7,16 +7,22 @@ import store from '@/store';
|
|||||||
import { setInviteCode } from '@/store/actions/partner';
|
import { setInviteCode } from '@/store/actions/partner';
|
||||||
import { IPaginationRequest } from '@/types/common';
|
import { IPaginationRequest } from '@/types/common';
|
||||||
import {
|
import {
|
||||||
|
AuthedGroupInfo,
|
||||||
|
DecryptOpenGidBody,
|
||||||
GetProfitRequest,
|
GetProfitRequest,
|
||||||
|
GroupAuthCode,
|
||||||
InviteUserInfo,
|
InviteUserInfo,
|
||||||
PartnerInviteCode,
|
PartnerInviteCode,
|
||||||
PartnerPagination,
|
PartnerPagination,
|
||||||
PartnerProfitItem,
|
PartnerProfitItem,
|
||||||
PartnerProfitsState,
|
PartnerProfitsState,
|
||||||
|
StaffInfo,
|
||||||
|
UserProfitListItem,
|
||||||
WithdrawRecord,
|
WithdrawRecord,
|
||||||
WithdrawResponse,
|
WithdrawResponse,
|
||||||
} from '@/types/partner';
|
} from '@/types/partner';
|
||||||
import { requestUserInfo } from '@/utils/user';
|
import { requestUserInfo } from '@/utils/user';
|
||||||
|
import { buildUrl } from '@/utils/common';
|
||||||
|
|
||||||
export const getInviteCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
export const getInviteCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
||||||
if (query) {
|
if (query) {
|
||||||
@ -82,7 +88,7 @@ export const formatMoney = (cents: number) => {
|
|||||||
const yuan = cents / 100;
|
const yuan = cents / 100;
|
||||||
return yuan.toFixed(2);
|
return yuan.toFixed(2);
|
||||||
};
|
};
|
||||||
export function formatTimestamp(timestamp: string): string {
|
export function formatTimestamp(timestamp: string, dateOnly?: boolean): string {
|
||||||
// 创建 Date 对象
|
// 创建 Date 对象
|
||||||
const date = new Date(/^\d+$/.test(timestamp) ? Number(timestamp) : timestamp);
|
const date = new Date(/^\d+$/.test(timestamp) ? Number(timestamp) : timestamp);
|
||||||
|
|
||||||
@ -94,7 +100,7 @@ export function formatTimestamp(timestamp: string): string {
|
|||||||
const mm = String(date.getMinutes()).padStart(2, '0');
|
const mm = String(date.getMinutes()).padStart(2, '0');
|
||||||
|
|
||||||
// 拼接成所需的格式
|
// 拼接成所需的格式
|
||||||
return `${YYYY}.${MM}.${DD} ${HH}:${mm}`;
|
return dateOnly ? `${YYYY}.${MM}.${DD}` : `${YYYY}.${MM}.${DD} ${HH}:${mm}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatUserId(input: string): string {
|
export function formatUserId(input: string): string {
|
||||||
@ -127,3 +133,24 @@ export async function getWithdrawList(data: IPaginationRequest) {
|
|||||||
contentType: 'application/x-www-form-urlencoded',
|
contentType: 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export async function getLastProfitList() {
|
||||||
|
const result = await http.get<UserProfitListItem[]>(API.GET_PROFIT_LIST);
|
||||||
|
return Array.isArray(result) ? result : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function generateGroupAuthCode() {
|
||||||
|
return await http.get<GroupAuthCode>(API.GENERATE_GROUP_AUTH_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getAuthedGroupList() {
|
||||||
|
return await http.get<AuthedGroupInfo[]>(API.GET_AUTHED_GROUP_LIST);
|
||||||
|
}
|
||||||
|
export async function decryptOpenGid(data: DecryptOpenGidBody) {
|
||||||
|
return await http.post(API.DECRYPT_OPEN_GID, {
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export async function getStaffInfo(cityCode: string) {
|
||||||
|
const result = await http.post<StaffInfo[]>(buildUrl(API.GET_STAFF_CODE, { cityCode }));
|
||||||
|
return Array.isArray(result) && result.length ? result[0] : null;
|
||||||
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ interface ShareAppProps {
|
|||||||
inviteCode?: string;
|
inviteCode?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
path?: PageUrl;
|
path?: PageUrl;
|
||||||
|
imageUrl?: string;
|
||||||
params?: Record<string, BL.Anything>;
|
params?: Record<string, BL.Anything>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ export const getCommonShareMessage = ({
|
|||||||
inviteCode,
|
inviteCode,
|
||||||
title,
|
title,
|
||||||
path,
|
path,
|
||||||
|
imageUrl: _imageUrl,
|
||||||
params = {},
|
params = {},
|
||||||
}: ShareAppProps = {}): ShareAppMessageReturn => {
|
}: ShareAppProps = {}): ShareAppMessageReturn => {
|
||||||
const inviteParams = inviteCode ? { c: inviteCode } : undefined;
|
const inviteParams = inviteCode ? { c: inviteCode } : undefined;
|
||||||
@ -36,6 +38,6 @@ export const getCommonShareMessage = ({
|
|||||||
return {
|
return {
|
||||||
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
title: title || `昨天新增了${getRandomCount()}条主播通告,宝子快来看看`,
|
||||||
path: sharePath,
|
path: sharePath,
|
||||||
imageUrl: useCapture ? undefined : imageUrl,
|
imageUrl: useCapture ? undefined : _imageUrl || imageUrl,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
export function formatTime(time: number | string, template = 'YYYY-MM-DD'): string {
|
export function formatTime(time: number | string, template = 'YYYY-MM-DD', toNum = true): string {
|
||||||
if (!time) {
|
if (!time) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
time = Number(time);
|
if (toNum) {
|
||||||
|
time = Number(time);
|
||||||
|
}
|
||||||
return dayjs(time).format(template);
|
return dayjs(time).format(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user