Compare commits
48 Commits
b0dd660dde
...
feat/group
| Author | SHA1 | Date | |
|---|---|---|---|
| fde2027588 | |||
| a179654898 | |||
| bc141fcf1b | |||
| 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 | |||
| 34f9c8d0e6 | |||
| 943f921e56 | |||
| 33ef940d6e | |||
| 61336b5282 | |||
| 10e7f39c92 | |||
| 1c1bb146fc | |||
| 260e543fe6 | |||
| 0cd1a46762 | |||
| 1ddc8b46c9 | |||
| 5820fa8d25 | |||
| 80846d507f | |||
| 42d1208ee4 | |||
| 2c48a70b6d | |||
| e8cf28b6e9 | |||
| de7f0e14fe | |||
| de2f380cd9 | |||
| 0020eb8dbe |
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": {}
|
||||||
|
}
|
||||||
@ -12,4 +12,9 @@ page {
|
|||||||
.taroify-tabs__wrap__scroll {
|
.taroify-tabs__wrap__scroll {
|
||||||
.base-bg();
|
.base-bg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
src: url('https://publiccdn.neighbourhood.com.cn/font/almmheiti.ttf');
|
||||||
|
}
|
||||||
|
|||||||
32
src/app.tsx
32
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 { requestCityOperators } 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,33 @@ function App({ children }: PropsWithChildren<BL.Anything>) {
|
|||||||
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
setInterval(() => requestUnreadMessageCount(), REFRESH_UNREAD_COUNT_TIME);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useDidShow(options => {
|
||||||
|
requestCityOperators();
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
|
const inviteCode = getInviteCodeFromQuery(options?.query || {});
|
||||||
|
const authCode = options?.query?.authCode;
|
||||||
|
if (inviteCode || authCode) {
|
||||||
|
Taro.getGroupEnterInfo()
|
||||||
|
.then(info => {
|
||||||
|
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/employ-type-select/index.tsx
Normal file
13
src/components/employ-type-select/index.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import Select, { ISelectProps } from '@/components/select';
|
||||||
|
import { EmployType, JOB_EMPLOY_TYPE_OPTIONS } from '@/constants/job';
|
||||||
|
|
||||||
|
interface IProps extends Omit<ISelectProps<EmployType>, 'options'> {
|
||||||
|
value: EmployType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function EmployTypeSelect(props: IProps) {
|
||||||
|
const { value: selectValue, onSelect } = props;
|
||||||
|
return <Select options={JOB_EMPLOY_TYPE_OPTIONS} title="类型" value={selectValue} onSelect={onSelect} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EmployTypeSelect;
|
||||||
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;
|
||||||
85
src/components/group-certification-list/index.less
Normal file
85
src/components/group-certification-list/index.less
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.group-certification-list {
|
||||||
|
min-height: calc(100vh - 98rpx);
|
||||||
|
&__banner {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24px;
|
||||||
|
height: 74px;
|
||||||
|
padding: 32px 32px 25px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: #999999;
|
||||||
|
background: #F5F6FA;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 1;
|
||||||
|
top: 99px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
&__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,18 +1,21 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import BaseTabBar from '@/components/tab-bar';
|
import BaseTabBar from '@/components/tab-bar';
|
||||||
|
import { PageType } from '@/constants/app';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
interface IProps extends React.PropsWithChildren {}
|
interface IProps extends React.PropsWithChildren {
|
||||||
|
type: PageType;
|
||||||
|
}
|
||||||
|
|
||||||
export default function HomePage(props: IProps) {
|
export default function HomePage(props: IProps) {
|
||||||
const { children } = props;
|
const { children, type } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{children}
|
{children}
|
||||||
<BaseTabBar />
|
<BaseTabBar type={type} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
@ -102,8 +102,9 @@ function JobCard(props: IProps) {
|
|||||||
/>
|
/>
|
||||||
<div className={`${PREFIX}__publisher-name`}>{publisher}</div>
|
<div className={`${PREFIX}__publisher-name`}>{publisher}</div>
|
||||||
</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';
|
||||||
@ -35,6 +38,7 @@ function JobList(props: IJobListProps) {
|
|||||||
visible = true,
|
visible = true,
|
||||||
cityCode = 'ALL',
|
cityCode = 'ALL',
|
||||||
category = JobType.All,
|
category = JobType.All,
|
||||||
|
sourceType,
|
||||||
employType = EmployType.All,
|
employType = EmployType.All,
|
||||||
sortType = SortType.RECOMMEND,
|
sortType = SortType.RECOMMEND,
|
||||||
isFollow = false,
|
isFollow = false,
|
||||||
@ -57,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 {
|
||||||
@ -108,12 +129,20 @@ 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 = {
|
||||||
category,
|
category,
|
||||||
cityCode,
|
cityCode,
|
||||||
employType,
|
employType,
|
||||||
|
sourceType,
|
||||||
sortType,
|
sortType,
|
||||||
isFollow,
|
isFollow,
|
||||||
isOwner,
|
isOwner,
|
||||||
@ -128,6 +157,7 @@ function JobList(props: IJobListProps) {
|
|||||||
}, [
|
}, [
|
||||||
category,
|
category,
|
||||||
cityCode,
|
cityCode,
|
||||||
|
sourceType,
|
||||||
employType,
|
employType,
|
||||||
sortType,
|
sortType,
|
||||||
isFollow,
|
isFollow,
|
||||||
@ -176,7 +206,7 @@ function JobList(props: IJobListProps) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
refresh();
|
refresh();
|
||||||
}, [visible, cityCode, employType, sortType, keyWord, minSalary, maxSalary, blGroupId]);
|
}, [visible, cityCode, employType, sourceType, sortType, keyWord, minSalary, maxSalary, blGroupId]);
|
||||||
|
|
||||||
// log('render', `hasMore: ${hasMore}, loadingMore: ${loadingMore}, refreshing: ${refreshing}`);
|
// log('render', `hasMore: ${hasMore}, loadingMore: ${loadingMore}, refreshing: ${refreshing}`);
|
||||||
|
|
||||||
|
|||||||
41
src/components/join-group-hint/index.less
Normal file
41
src/components/join-group-hint/index.less
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.join-group-hint {
|
||||||
|
.flex-row();
|
||||||
|
background: #FFFFFF;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 32px 24px;
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
width: 80px;
|
||||||
|
height: 80px;
|
||||||
|
margin-right: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__left {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 8px;
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__right {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__button {
|
||||||
|
.button(@width: 186px, @height: 64px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 32px, @highlight: 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
63
src/components/join-group-hint/index.tsx
Normal file
63
src/components/join-group-hint/index.tsx
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Plus } from '@taroify/icons';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import { RoleType } from '@/constants/app';
|
||||||
|
import { CacheKey } from '@/constants/cache-key';
|
||||||
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
|
import { getRoleTypeWithDefault } from '@/utils/app';
|
||||||
|
import { openCustomerServiceChat } from '@/utils/common';
|
||||||
|
import { getCurrentCityCode } from '@/utils/location';
|
||||||
|
import { checkCityCode, validCityCode } from '@/utils/user';
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'join-group-hint';
|
||||||
|
|
||||||
|
const DEFAULT_GROUP = {
|
||||||
|
name: '播络主播招聘群',
|
||||||
|
serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8',
|
||||||
|
};
|
||||||
|
|
||||||
|
export function JoinGroupHint() {
|
||||||
|
const cityCode = getCurrentCityCode();
|
||||||
|
const roleType = getRoleTypeWithDefault();
|
||||||
|
const cityOperators = useCityOperators();
|
||||||
|
const group = cityOperators.find(g => String(g.cityCode) === cityCode);
|
||||||
|
const [clicked, setClicked] = useState(!!Taro.getStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED));
|
||||||
|
const handleClick = useCallback(() => {
|
||||||
|
if (group && !checkCityCode(cityCode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openCustomerServiceChat(group ? group.groupLink : DEFAULT_GROUP.serviceUrl);
|
||||||
|
Taro.setStorageSync(CacheKey.JOIN_GROUP_CARD_CLICKED, true);
|
||||||
|
setClicked(true);
|
||||||
|
}, [cityCode, group]);
|
||||||
|
if (!validCityCode(cityCode) || clicked) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Image
|
||||||
|
className={`${PREFIX}__icon`}
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/group-avatar.png"
|
||||||
|
mode="aspectFit"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__left`}>
|
||||||
|
<div className={`${PREFIX}__left-title`}>
|
||||||
|
{group ? `${CITY_CODE_TO_NAME_MAP.get(cityCode)}主播招聘群` : DEFAULT_GROUP.name}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__left-desc`}>{roleType === RoleType.Anchor ? '高薪工作早知道' : '免费招主播'}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__right`}>
|
||||||
|
<Button className={`${PREFIX}__button`} onClick={handleClick}>
|
||||||
|
<Plus />
|
||||||
|
加入该群
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -18,7 +18,7 @@ export default function LoginDialog(props: IProps) {
|
|||||||
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
const { title = '使用播络服务前,请先登录', needPhone, onSuccess, onCancel, onBindPhone } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open onClose={onCancel}>
|
<Dialog open onClose={onCancel} className={PREFIX}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__title`}>{title}</div>
|
<div className={`${PREFIX}__title`}>{title}</div>
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -80,4 +80,8 @@
|
|||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__no-subscription {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -57,7 +57,9 @@ export function MessageNoTimesDialog(props: INoTimesProps) {
|
|||||||
<Dialog className={NO_TIMES} onClose={onClose} open={open}>
|
<Dialog className={NO_TIMES} onClose={onClose} open={open}>
|
||||||
<Dialog.Content>
|
<Dialog.Content>
|
||||||
<div className={`${NO_TIMES}__title`}>未读消息提醒次数不够了!</div>
|
<div className={`${NO_TIMES}__title`}>未读消息提醒次数不够了!</div>
|
||||||
<div className={`${NO_TIMES}__tips`}>有通知次数才能<span className="highlight">及时收到</span>招聘邀请,快点击“点我增加”吧~</div>
|
<div className={`${NO_TIMES}__tips`}>
|
||||||
|
有通知次数才能<span className="highlight">及时收到</span>招聘邀请,快点击“点我增加”吧~
|
||||||
|
</div>
|
||||||
<div className={`${NO_TIMES}__body`}>
|
<div className={`${NO_TIMES}__body`}>
|
||||||
<div className={`${NO_TIMES}__times`}>{`未读消息提醒剩余:${times}次`}</div>
|
<div className={`${NO_TIMES}__times`}>{`未读消息提醒剩余:${times}次`}</div>
|
||||||
<Button className={`${NO_TIMES}__btn`} onClick={onClick}>
|
<Button className={`${NO_TIMES}__btn`} onClick={onClick}>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import './index.less';
|
|||||||
|
|
||||||
const PREFIX = 'partner-fragment-banner';
|
const PREFIX = 'partner-fragment-banner';
|
||||||
|
|
||||||
export default function PartnerBanner() {
|
export default function PartnerBanner({ isBoss = false }) {
|
||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const needPhone = isNeedPhone(userInfo);
|
const needPhone = isNeedPhone(userInfo);
|
||||||
const isPartner = userInfo.isPartner;
|
const isPartner = userInfo.isPartner;
|
||||||
@ -50,7 +50,11 @@ export default function PartnerBanner() {
|
|||||||
<div className={PREFIX} onClick={handleClick}>
|
<div className={PREFIX} onClick={handleClick}>
|
||||||
<Image
|
<Image
|
||||||
className={`${PREFIX}__image`}
|
className={`${PREFIX}__image`}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/partner_banner.png"
|
src={
|
||||||
|
isBoss
|
||||||
|
? 'https://publiccdn.neighbourhood.com.cn/img/partner_banner.png'
|
||||||
|
: 'https://publiccdn.neighbourhood.com.cn/img/partner-banner-boss.png'
|
||||||
|
}
|
||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
{needPhone && (
|
{needPhone && (
|
||||||
@ -60,9 +64,7 @@ export default function PartnerBanner() {
|
|||||||
)}
|
)}
|
||||||
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
<div className={`${PREFIX}__close`} onClick={handlePartnerBannerClose} />
|
||||||
</div>
|
</div>
|
||||||
{visible && (
|
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={handleBind} needPhone={needPhone} />}
|
||||||
<LoginDialog disableCheck 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} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,26 +2,53 @@
|
|||||||
@import '@/styles/common.less';
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
.partner-intro {
|
.partner-intro {
|
||||||
padding-top: 112px;
|
background: #eae5fb;
|
||||||
padding-bottom: calc(112px + constant(safe-area-inset-bottom));
|
padding-top: 271px;
|
||||||
padding-bottom: calc(112px + env(safe-area-inset-bottom));
|
position: relative;
|
||||||
|
padding-bottom: calc(142px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(142px + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
&__banner {
|
&__bg {
|
||||||
background: fade(@blHighlightBg, 8);
|
width: 100%;
|
||||||
height: 88px;
|
height: 705px;
|
||||||
line-height: 88px;
|
position: absolute;
|
||||||
text-align: center;
|
top: 0;
|
||||||
font-size: 28px;
|
|
||||||
position: fixed;
|
|
||||||
top: 98px;
|
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
}
|
||||||
width: 100vw;
|
&__slogan {
|
||||||
|
top: 66px;
|
||||||
|
left: 44px;
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 44px;
|
||||||
|
line-height: 62px;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-highlight {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 9px;
|
||||||
|
font-size: 64px;
|
||||||
|
line-height: 62px;
|
||||||
|
background: linear-gradient(87.53deg, #683DE3 0.4%, #39227D 84.55%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
text-fill-color: transparent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__main {
|
&__main {
|
||||||
padding-left: 24px;
|
padding-left: 24px;
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__highlight {
|
&__highlight {
|
||||||
@ -34,14 +61,73 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__block {
|
&__block {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 12px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__swiper {
|
||||||
|
&-wrapper {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid #6d3df5;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__swiper-item {
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 130px;
|
||||||
|
padding: 24px 32px;
|
||||||
|
&-time {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #333333;
|
||||||
|
font-weight: 400;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
&-details {
|
||||||
|
margin-top: 5px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
&-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;
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
padding: 24px 32px;
|
padding: 68px 32px 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__h1 {
|
&__h1 {
|
||||||
@ -51,33 +137,81 @@
|
|||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
margin-top: 32px;
|
margin-top: 32px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&.no-dot {
|
||||||
|
&:after {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
background: #ffd236;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: absolute;
|
||||||
|
left: -6px;
|
||||||
|
top: -3px;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__body {
|
&__body {
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
margin-bottom: 24px;
|
margin-left: 48px;
|
||||||
|
margin-right: 48px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
line-height: 32px;
|
line-height: 80px;
|
||||||
|
height: 80px;
|
||||||
|
transform: translateY(50%);
|
||||||
|
background: #ffd236;
|
||||||
|
box-shadow: 0px 12px 0px #ffa35d;
|
||||||
|
border-radius: 60px;
|
||||||
color: #1d2129;
|
color: #1d2129;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__recommend {
|
||||||
|
display: inline-flex;
|
||||||
|
line-height: 36px;
|
||||||
|
padding: 0 8px;
|
||||||
|
height: 36px;
|
||||||
|
background: rgb(255, 80, 81);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #fff;
|
||||||
|
align-items: center;
|
||||||
|
position: absolute;
|
||||||
|
gap: 6px;
|
||||||
|
right: -25px;
|
||||||
|
top: -18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__special {
|
&__special {
|
||||||
padding: 32px;
|
padding-top: 75px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
|
|
||||||
.partner-intro__body {
|
.partner-intro__body {
|
||||||
@ -100,6 +234,7 @@
|
|||||||
&__footer {
|
&__footer {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 12px 32px;
|
padding: 12px 32px;
|
||||||
@ -112,17 +247,20 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__download-button {
|
&__download-button {
|
||||||
flex: 1 1;
|
//flex: 1 1;
|
||||||
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
&__share-button {
|
&__share-button {
|
||||||
flex: 2 2;
|
//flex: 2 2;
|
||||||
|
flex: 0 0 406px;
|
||||||
|
width: 406px;
|
||||||
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
margin-left: 32px;
|
//margin-left: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,172 +1,166 @@
|
|||||||
import { Button, Canvas } from '@tarojs/components';
|
import { Button, Canvas, Image } from '@tarojs/components';
|
||||||
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 { formatMoney, formatTimestamp, formatUserId, 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 handleConfirm = useCallback(() => {
|
||||||
const getQrcode = async () => {
|
navigateTo(PageUrl.GroupOwnerCertificate);
|
||||||
try {
|
}, []);
|
||||||
const data = await getPartnerQrcode(); // 假设 getPartnerQrcode 返回 ArrayBuffer
|
|
||||||
const base64 = Taro.arrayBufferToBase64(data);
|
|
||||||
return `data:image/png;base64,${base64}`;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取二维码失败', error);
|
|
||||||
Taro.showToast({ title: '获取二维码失败', icon: 'none' });
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const saveCanvasToTempFile = (): Promise<string> => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
try {
|
|
||||||
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
|
||||||
query.fields({ node: true }).exec(async res => {
|
|
||||||
const canvas = res[0].node;
|
|
||||||
const tempFilePath = await Taro.canvasToTempFilePath({
|
|
||||||
canvas,
|
|
||||||
x: 0,
|
|
||||||
y: 0,
|
|
||||||
width: 1500, // 实际绘制宽度
|
|
||||||
height: 2668, // 实际绘制高度
|
|
||||||
destWidth: 750, // 目标显示宽度
|
|
||||||
destHeight: 1334, // 目标显示高度
|
|
||||||
fileType: 'jpg',
|
|
||||||
});
|
|
||||||
|
|
||||||
setPosterPath(tempFilePath.tempFilePath);
|
|
||||||
|
|
||||||
resolve(tempFilePath.tempFilePath);
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('保存 Canvas 到临时文件失败', error);
|
|
||||||
Taro.showToast({ title: '保存 Canvas 失败', icon: 'none' });
|
|
||||||
reject(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const drawCanvas = (qrCode: string): Promise<string> => {
|
|
||||||
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
|
||||||
return new Promise(resolve => {
|
|
||||||
query.fields({ node: true, size: true }).exec(async res => {
|
|
||||||
const canvas = res[0].node;
|
|
||||||
const ctx = canvas.getContext('2d');
|
|
||||||
|
|
||||||
canvas.width = 1500;
|
|
||||||
canvas.height = 2668;
|
|
||||||
ctx.scale(2, 2);
|
|
||||||
|
|
||||||
// 绘制背景图片
|
|
||||||
const bgImage = canvas.createImage();
|
|
||||||
const poster = 'https://publiccdn.neighbourhood.com.cn/img/poster.png'
|
|
||||||
bgImage.src = poster;
|
|
||||||
bgImage.onload = () => {
|
|
||||||
ctx.drawImage(bgImage, 0, 0, 750, 1334);
|
|
||||||
|
|
||||||
const qrCodeImage = canvas.createImage();
|
|
||||||
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
|
||||||
qrCodeImage.onload = () => {
|
|
||||||
ctx.drawImage(qrCodeImage, 235, 894, 280, 280); // 绘制二维码,位置和大小
|
|
||||||
saveCanvasToTempFile().then(tempPath => {
|
|
||||||
resolve(tempPath);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
bgImage.onerror = err => {
|
|
||||||
console.error(err);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const savePoster = async () => {
|
|
||||||
let filePath = posterPath;
|
|
||||||
if (!filePath) {
|
|
||||||
Taro.showLoading({ title: '正在生成海报' });
|
|
||||||
const qrCode = await getQrcode();
|
|
||||||
filePath = await drawCanvas(qrCode);
|
|
||||||
Taro.hideLoading();
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await Taro.getSetting();
|
|
||||||
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
|
||||||
if (hasPermission === false) {
|
|
||||||
Taro.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '需要访问相册权限才能保存图片,请前往设置开启权限',
|
|
||||||
showCancel: false,
|
|
||||||
success() {
|
|
||||||
Taro.openSetting();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
await Taro.authorize({ scope: 'scope.writePhotosAlbum' });
|
|
||||||
await Taro.saveImageToPhotosAlbum({ filePath });
|
|
||||||
Taro.showToast({ title: '保存成功', icon: 'success' });
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
Taro.showToast({ title: '保存失败', icon: 'none' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOpenService = useCallback(() => {
|
const handleOpenService = useCallback(() => {
|
||||||
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
openCustomerServiceChat('https://work.weixin.qq.com/kfid/kfc4fcf6b109b3771d7');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleJump = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.PartnerShareVip);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
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(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`}>
|
<Image
|
||||||
邀请朋友加入播络,高达<span className={`${PREFIX}__highlight`}>75%</span>分成
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-intro-bg.png"
|
||||||
|
className={`${PREFIX}__bg`}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__slogan`}>
|
||||||
|
<div>邀请朋友加入播络</div>
|
||||||
|
<div>
|
||||||
|
高达<div className={`${PREFIX}__slogan-highlight`}>75%</div>分成
|
||||||
|
</div>
|
||||||
</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={`${item.userId}-${index}`}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-time`}>{formatTimestamp(item.updatedAt)}</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-details`}>
|
||||||
|
<div className={`${PREFIX}__swiper-item-id`}>{formatUserId(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.amount, 1)}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__swiper-item-info`}>
|
||||||
|
累计<div className="money">{formatMoney(item.total, 1)}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Swiper.Item>
|
||||||
|
))}
|
||||||
|
</Swiper>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={`${PREFIX}__block`}>
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<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`}>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 className={`${PREFIX}__h1`}>方法一:</div>
|
||||||
|
<div>点击下方“赠送会员给好友”,给群员、好友送会员,每周可以送一次</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法二:</div>
|
||||||
|
<div>分享通告列表页、通告详情页等页面至群、好友</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 ${PREFIX}__special`}>
|
<div className={`${PREFIX}__card ${PREFIX}__special`}>
|
||||||
<div className={`${PREFIX}__h1`}>加入播络合伙人交流群</div>
|
<div className={`${PREFIX}__h1 no-dot`}>加入播络合伙人交流群,分享经验</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}__share-button`} onClick={handleJump}>
|
||||||
下载海报
|
赠送会员给好友
|
||||||
</Button>
|
|
||||||
<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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
82
src/components/prejob-popup/index.less
Normal file
82
src/components/prejob-popup/index.less
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
@import '@/styles/common.less';
|
||||||
|
@import '@/styles/variables.less';
|
||||||
|
|
||||||
|
.prejob-popup {
|
||||||
|
&__content {
|
||||||
|
padding: 40px 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 48px;
|
||||||
|
margin-bottom: 31px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
.flex-row();
|
||||||
|
margin-bottom: 40px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 88px;
|
||||||
|
height: 88px;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
&.material {
|
||||||
|
background: #feba00;
|
||||||
|
> image {
|
||||||
|
width: 40px;
|
||||||
|
height: 46px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.vip {
|
||||||
|
background: #b094ff;
|
||||||
|
> image {
|
||||||
|
width: 48px;
|
||||||
|
height: 42px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.video {
|
||||||
|
background: #34a853;
|
||||||
|
> image {
|
||||||
|
width: 46px;
|
||||||
|
height: 44px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-main {
|
||||||
|
padding: 0 24px;
|
||||||
|
flex: 1;
|
||||||
|
.title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.desc {
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 36px;
|
||||||
|
color: @blColorG1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-action {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__btn {
|
||||||
|
.button(@width: 136px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 43px, @highlight: 0);
|
||||||
|
background: #f2f2f2;
|
||||||
|
}
|
||||||
|
}
|
||||||
89
src/components/prejob-popup/index.tsx
Normal file
89
src/components/prejob-popup/index.tsx
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import { Button, Image } from '@tarojs/components';
|
||||||
|
|
||||||
|
import { Popup, Dialog } from '@taroify/core';
|
||||||
|
import { Fragment, useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
import JobBuy from '@/components/product-dialog/steps-ui/job-buy';
|
||||||
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import { GET_CONTACT_TYPE } from '@/constants/job';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
onCancel: () => void;
|
||||||
|
onConfirm: (type: GET_CONTACT_TYPE) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const PREFIX = 'prejob-popup';
|
||||||
|
|
||||||
|
const GET_CONTACT_TYPE_OPTIONS = [
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.MATERIAL,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/file.svg',
|
||||||
|
title: '创建模卡(免费报单)',
|
||||||
|
desc: '免费报单,优先推荐给企业,机会更多',
|
||||||
|
btnText: '创建',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: GET_CONTACT_TYPE.VIP,
|
||||||
|
icon: 'https://publiccdn.neighbourhood.com.cn/img/diamond.svg',
|
||||||
|
title: '播络会员',
|
||||||
|
desc: '开通会员每天可查看10个',
|
||||||
|
btnText: '开通',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export function PrejobPopup({ onCancel, onConfirm }: IProps) {
|
||||||
|
const [openPopup, setOpenPopup] = useState(true);
|
||||||
|
const [openDialog, setOpenDialog] = useState(false);
|
||||||
|
const handleClick = (type: GET_CONTACT_TYPE) => () => {
|
||||||
|
if (type === GET_CONTACT_TYPE.MATERIAL) {
|
||||||
|
navigateTo(PageUrl.MaterialUploadVideo);
|
||||||
|
onConfirm(type);
|
||||||
|
}
|
||||||
|
if (type === GET_CONTACT_TYPE.VIP) {
|
||||||
|
setOpenPopup(false);
|
||||||
|
setOpenDialog(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleAfterBuy = useCallback(async () => {
|
||||||
|
onConfirm(GET_CONTACT_TYPE.VIP);
|
||||||
|
}, [onConfirm]);
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<Popup rounded className={PREFIX} placement="bottom" open={openPopup} onClose={onCancel}>
|
||||||
|
<div className={`${PREFIX}__content`}>
|
||||||
|
<div className={`${PREFIX}__title`}>以下方式任选其一均可获取联系方式</div>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
{GET_CONTACT_TYPE_OPTIONS.map(option => {
|
||||||
|
return (
|
||||||
|
<div className={`${PREFIX}__item`} key={option.type}>
|
||||||
|
<div className={`${PREFIX}__item-icon ${option.type}`}>
|
||||||
|
<Image mode="aspectFit" src={option.icon} />
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item-main`}>
|
||||||
|
<div className="title">{option.title}</div>
|
||||||
|
<div className="desc">{option.desc}</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__item-action`}>
|
||||||
|
<Button className={`${PREFIX}__btn`} onClick={handleClick(option.type)}>
|
||||||
|
{option.btnText}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<SafeBottomPadding />
|
||||||
|
</Popup>
|
||||||
|
<Dialog open={openDialog} onClose={onCancel}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<JobBuy onConfirm={handleAfterBuy} buyOnly />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ export const PREFIX = 'product-dialog';
|
|||||||
export enum DialogStatus {
|
export enum DialogStatus {
|
||||||
// 加载中
|
// 加载中
|
||||||
LOADING = 'loading',
|
LOADING = 'loading',
|
||||||
|
PRE_ACTION = 'pre_action',
|
||||||
// 直接联系通告主
|
// 直接联系通告主
|
||||||
JOB_CONTACT_DIRECT = 'job_contact_direct',
|
JOB_CONTACT_DIRECT = 'job_contact_direct',
|
||||||
// 联系客服去联系通告主 -> 订阅通知
|
// 联系客服去联系通告主 -> 订阅通知
|
||||||
|
|||||||
@ -82,7 +82,10 @@ function ProductGroupDialog(props: IProps) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
||||||
const [time, detail] = await Promise.all([requestProductBalance(PRODUCT_CODE), requestGroupDetail(blGroupId)]);
|
const [[time], detail] = await Promise.all([
|
||||||
|
requestProductBalance(PRODUCT_CODE),
|
||||||
|
requestGroupDetail(blGroupId),
|
||||||
|
]);
|
||||||
setGroupDetail(detail);
|
setGroupDetail(detail);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.GROUP_NEED_BUY_ADD);
|
setStatus(DialogStatus.GROUP_NEED_BUY_ADD);
|
||||||
|
|||||||
@ -133,6 +133,7 @@
|
|||||||
&__header {
|
&__header {
|
||||||
.flex-row();
|
.flex-row();
|
||||||
.header-font();
|
.header-font();
|
||||||
|
font-size: 32px;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -143,7 +144,8 @@
|
|||||||
&__describe {
|
&__describe {
|
||||||
.flex-row();
|
.flex-row();
|
||||||
.describe-font();
|
.describe-font();
|
||||||
margin-top: 24px;
|
margin-top: 18px;
|
||||||
|
line-height: 40px;
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
@ -158,13 +160,13 @@
|
|||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 170px;
|
width: 182px;
|
||||||
height: 192px;
|
height: 192px;
|
||||||
.flex-column();
|
.flex-column();
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border: 2px solid @blHighlightColor;
|
border: 2px solid @blHighlightColor;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
margin-right: 24px;
|
margin-right: 15px;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
@ -224,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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================= 群 ================================================= //
|
// ============================================= 群 ================================================= //
|
||||||
@ -652,6 +668,11 @@
|
|||||||
&.highlight {
|
&.highlight {
|
||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.highlight-span {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__button {
|
&__button {
|
||||||
@ -660,4 +681,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,7 +102,7 @@ function ProductJobWithGroupDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
// 否则:如果有解锁次数,显示是否确定消费。无解锁次数,显示不无次数 UI
|
||||||
const time = await requestProductBalance(ProductType.AddGroup);
|
const [time] = await requestProductBalance(ProductType.AddGroup);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.JOB_CONTACT_NEED_BUY_GROUP);
|
setStatus(DialogStatus.JOB_CONTACT_NEED_BUY_GROUP);
|
||||||
} else {
|
} else {
|
||||||
@ -119,7 +119,7 @@ function ProductJobWithGroupDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 自动报单
|
// 自动报单
|
||||||
const time = await requestProductBalance(ProductType.GetJob);
|
const [time] = await requestProductBalance(ProductType.GetJob);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
setStatus(DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -41,7 +41,7 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
}, [onClose]);
|
}, [onClose]);
|
||||||
|
|
||||||
const handleAfterBuy = useCallback(async () => {
|
const handleAfterBuy = useCallback(async () => {
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
Toast.error('发生错误请重试');
|
Toast.error('发生错误请重试');
|
||||||
onClose();
|
onClose();
|
||||||
@ -83,7 +83,7 @@ function ProductJobDialog(props: Omit<IProps, 'visible'>) {
|
|||||||
handleContact(result.declarationTypeResult);
|
handleContact(result.declarationTypeResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const time = await requestProductBalance(PRODUCT_CODE);
|
const [time] = await requestProductBalance(PRODUCT_CODE);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
const allowBuy = await requestAllBuyProduct(PRODUCT_CODE);
|
||||||
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
setStatus(allowBuy ? DialogStatus.JOB_BUY : DialogStatus.JOB_UNABLE_UNLOCK);
|
||||||
|
|||||||
@ -99,12 +99,8 @@ export function CompanyPublishJobDialog(props: IProps) {
|
|||||||
|
|
||||||
const handleNext = useCallback(async () => {
|
const handleNext = useCallback(async () => {
|
||||||
onClose(true);
|
onClose(true);
|
||||||
if (userInfo.bossAuthStatus) {
|
navigateTo(PageUrl.JobPublish);
|
||||||
navigateTo(PageUrl.JobPublish);
|
}, [onClose]);
|
||||||
} else {
|
|
||||||
navigateTo(PageUrl.CertificationStart);
|
|
||||||
}
|
|
||||||
}, [userInfo, onClose]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initRef.current = async () => {
|
initRef.current = async () => {
|
||||||
@ -115,7 +111,7 @@ export function CompanyPublishJobDialog(props: IProps) {
|
|||||||
try {
|
try {
|
||||||
const productCode = ProductType.CompanyPublishJob;
|
const productCode = ProductType.CompanyPublishJob;
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
const time = await requestProductBalance(productCode);
|
const [time] = await requestProductBalance(productCode);
|
||||||
if (time <= 0) {
|
if (time <= 0) {
|
||||||
setStatus(DialogStatus.COMPANY_PUBLISH_JOB_BUY);
|
setStatus(DialogStatus.COMPANY_PUBLISH_JOB_BUY);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -26,53 +26,51 @@ interface Item {
|
|||||||
title: string;
|
title: string;
|
||||||
price: string;
|
price: string;
|
||||||
amt: number;
|
amt: number;
|
||||||
contents: { content: string; highlight?: boolean }[];
|
contents: { content: string; highlight?: boolean; inlineHighlight?: string }[];
|
||||||
badge?: string;
|
badge?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const LIST: Item[] = [
|
const LIST: Item[] = [
|
||||||
{
|
// {
|
||||||
id: ProductSpecId.BOSS_VIP_NEW_1,
|
// id: ProductSpecId.BOSS_VIP_NEW_1,
|
||||||
title: '展示一周',
|
// title: '展示一周',
|
||||||
price: '480播豆',
|
// price: '480播豆',
|
||||||
amt: 48,
|
// amt: 48,
|
||||||
badge: '限时体验',
|
// badge: '限时体验',
|
||||||
contents: [
|
// contents: [
|
||||||
{ content: '-1个通告' },
|
// { content: '-通告每日优先展示' },
|
||||||
{ content: '-每天可查看20个主播详情' },
|
// { content: '-每天可查看20个主播详情' },
|
||||||
{ content: '-每天可自主联系10个主播' },
|
// { content: '-每天可主动联系10个主播' },
|
||||||
// { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
// // { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
||||||
{ content: '-有效期一周' },
|
// { content: '-有效期一周' },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: ProductSpecId.BOSS_VIP_NEW_2,
|
id: ProductSpecId.BOSS_VIP_NEW_2,
|
||||||
title: '展示一月',
|
title: '推荐一月',
|
||||||
price: '960播豆',
|
price: '680播豆',
|
||||||
amt: 96,
|
amt: 68,
|
||||||
badge: '五折',
|
badge: '限时体验',
|
||||||
contents: [
|
contents: [
|
||||||
{ content: '-1个通告' },
|
{ content: '-通告每日优先展示', highlight: true },
|
||||||
{ content: '-每天可查看20个主播详情' },
|
{ content: '-每天可查看20个主播详情,', inlineHighlight: '可主动联系10个' },
|
||||||
{ content: '-每天可自主联系10个主播' },
|
|
||||||
// { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
// { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
||||||
{ content: '-有效期一个月' },
|
{ content: '-有效期一个月' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// id: ProductSpecId.BOSS_VIP_NEW_3,
|
id: ProductSpecId.BOSS_VIP_NEW_3,
|
||||||
// title: '季会员',
|
title: '推荐一季',
|
||||||
// price: '2680播豆',
|
price: '1360播豆',
|
||||||
// amt: 268,
|
amt: 136,
|
||||||
// badge: '7折',
|
badge: '6.7折',
|
||||||
// contents: [
|
contents: [
|
||||||
// { content: '-1个通告' },
|
{ content: '-通告每日优先展示', highlight: true },
|
||||||
// { content: '-每天可查看20个主播详情' },
|
{ content: '-每天可查看20个主播详情', inlineHighlight: '可主动联系10个' },
|
||||||
// { content: '-每天可自主联系10个主播' },
|
// { content: '-播络可代为联系60个主播(高成功率)', highlight: true },
|
||||||
// { content: '-播络可代为联系60个主播(高成功率)', highlight: true },
|
{ content: '-有效期一个季度' },
|
||||||
// { content: '-有效期3个月' },
|
],
|
||||||
// ],
|
},
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const subscribe = async () => {
|
const subscribe = async () => {
|
||||||
@ -161,6 +159,7 @@ export default function CompanyPublishJobBuy(props: IProps) {
|
|||||||
key={i.content}
|
key={i.content}
|
||||||
>
|
>
|
||||||
{i.content}
|
{i.content}
|
||||||
|
{i.inlineHighlight && <div className="highlight-span">{i.inlineHighlight}</div>}
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export default function GroupBuy(props: IProps) {
|
|||||||
if (status !== OrderStatus.Success) {
|
if (status !== OrderStatus.Success) {
|
||||||
throw new Error('order status error');
|
throw new Error('order status error');
|
||||||
}
|
}
|
||||||
const time = await requestProductBalance(ProductType.AddGroup);
|
const [time] = await requestProductBalance(ProductType.AddGroup);
|
||||||
log('handleBuy new addGroupTime', time);
|
log('handleBuy new addGroupTime', time);
|
||||||
onConfirm(time);
|
onConfirm(time);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import { postSubscribe, subscribeMessage } from '@/utils/subscribe';
|
|||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
buyOnly?: boolean;
|
||||||
onConfirm: () => void;
|
onConfirm: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ interface Item {
|
|||||||
id: ProductSpecId;
|
id: ProductSpecId;
|
||||||
title: string;
|
title: string;
|
||||||
content: string;
|
content: string;
|
||||||
|
buyOnlyContent?: string;
|
||||||
price: string;
|
price: string;
|
||||||
amt: number;
|
amt: number;
|
||||||
badge?: string;
|
badge?: string;
|
||||||
@ -31,17 +33,19 @@ interface Item {
|
|||||||
const LIST: Item[] = [
|
const LIST: Item[] = [
|
||||||
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
{ id: ProductSpecId.WeeklyVIP, title: '非会员', content: '每日2次', price: '免费', amt: 0 },
|
||||||
{
|
{
|
||||||
id: ProductSpecId.WeeklyVIP,
|
id: ProductSpecId.DailyVIP,
|
||||||
title: '周会员',
|
title: '日会员',
|
||||||
content: '每日5次',
|
content: '每日+10次',
|
||||||
|
buyOnlyContent: '每日12次',
|
||||||
price: '60播豆',
|
price: '60播豆',
|
||||||
amt: 6,
|
amt: 6,
|
||||||
badge: '限时体验',
|
badge: '限时体验',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: ProductSpecId.NewMonthlyVIP,
|
id: ProductSpecId.WeeklyVIP,
|
||||||
title: '月会员',
|
title: '周会员',
|
||||||
content: '每日5次',
|
content: '每日+10次',
|
||||||
|
buyOnlyContent: '每日12次',
|
||||||
price: '180播豆',
|
price: '180播豆',
|
||||||
amt: 18,
|
amt: 18,
|
||||||
badge: ' 超值',
|
badge: ' 超值',
|
||||||
@ -62,7 +66,7 @@ const subscribe = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function JobBuy(props: IProps) {
|
export default function JobBuy(props: IProps) {
|
||||||
const { onConfirm } = props;
|
const { onConfirm, buyOnly } = props;
|
||||||
const [selectItem, setSelectItem] = useState(LIST[1]);
|
const [selectItem, setSelectItem] = useState(LIST[1]);
|
||||||
|
|
||||||
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
const handleClickItem = useCallback((newSelectItem: Item) => setSelectItem(newSelectItem), []);
|
||||||
@ -106,32 +110,50 @@ export default function JobBuy(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX}__job-buy`}>
|
<div className={`${PREFIX}__job-buy`}>
|
||||||
<div className={`${PREFIX}__job-buy__header`}>
|
{buyOnly ? (
|
||||||
<div>今日通告对接次数</div>
|
<div className={`${PREFIX}__job-buy__header`}>开通播络会员即可直接查看联系方式</div>
|
||||||
<div className="highlight">已用完</div>
|
) : (
|
||||||
</div>
|
<div className={`${PREFIX}__job-buy__header`}>
|
||||||
<div className={`${PREFIX}__job-buy__describe`}>
|
<div>今日通告对接次数</div>
|
||||||
<div>请</div>
|
<div className="highlight">已用完</div>
|
||||||
<div className="highlight">明日</div>
|
</div>
|
||||||
<div>再来 或 </div>
|
)}
|
||||||
<div className="highlight">升级会员</div>
|
{buyOnly ? (
|
||||||
</div>
|
<div className={`${PREFIX}__job-buy__describe`}>每天可获取12个联系方式</div>
|
||||||
|
) : (
|
||||||
|
<div className={`${PREFIX}__job-buy__describe`}>
|
||||||
|
<div>请</div>
|
||||||
|
<div className="highlight">明日</div>
|
||||||
|
<div>再来 或 </div>
|
||||||
|
<div className="highlight">升级会员</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={`${PREFIX}__job-buy__container`}>
|
<div className={`${PREFIX}__job-buy__container`}>
|
||||||
{LIST.map(item => (
|
{LIST.map(item => {
|
||||||
<div
|
if (buyOnly && !item.amt) {
|
||||||
key={item.price}
|
return null;
|
||||||
className={classNames(`${PREFIX}__job-buy__item`, {
|
}
|
||||||
selected: item.amt === selectItem.amt,
|
return (
|
||||||
disabled: item.amt === 0,
|
<div
|
||||||
})}
|
key={item.price}
|
||||||
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
className={classNames(`${PREFIX}__job-buy__item`, {
|
||||||
>
|
selected: item.amt === selectItem.amt,
|
||||||
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.amt === 0 })}>{item.title}</div>
|
disabled: item.amt === 0,
|
||||||
<div className={`${PREFIX}__job-buy__item__content`}>{item.content}</div>
|
})}
|
||||||
<div className={`${PREFIX}__job-buy__item__price`}>{item.price}</div>
|
onClick={item.amt === 0 ? undefined : () => handleClickItem(item)}
|
||||||
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
>
|
||||||
</div>
|
<div className={classNames(`${PREFIX}__job-buy__item__title`, { free: item.amt === 0 })}>
|
||||||
))}
|
{item.title}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__item__content`}>{buyOnly ? item.buyOnlyContent : item.content}</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__item__price`}>{item.price}</div>
|
||||||
|
{item.badge && <Badge className={`${PREFIX}__job-buy__item__badge`} text={item.badge} />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__job-buy__hint`}>
|
||||||
|
注:日会员有效期为 <div className="highlight">支付后24小时</div>
|
||||||
</div>
|
</div>
|
||||||
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
||||||
{`支付 ${selectItem.amt} 元`}
|
{`支付 ${selectItem.amt} 元`}
|
||||||
|
|||||||
@ -2,9 +2,10 @@ import { BaseEventOrig, InputProps, ScrollView } from '@tarojs/components';
|
|||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
import { Search } from '@taroify/core';
|
import { Search } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { Fragment, useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { CITY_CODE_TO_NAME_MAP, CITY_INDEXES_LIST, GROUP_CITY_INDEXES_LIST } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP, CITY_INDEXES_LIST } from '@/constants/city';
|
||||||
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -68,8 +69,19 @@ export default function SearchCity({
|
|||||||
const [touchAnchor, setTouchAnchor] = useState<string | undefined>();
|
const [touchAnchor, setTouchAnchor] = useState<string | undefined>();
|
||||||
const [touchMoving, setTouchMoving] = useState(false);
|
const [touchMoving, setTouchMoving] = useState(false);
|
||||||
const [searchResult, setSearchResult] = useState<Item[]>([]);
|
const [searchResult, setSearchResult] = useState<Item[]>([]);
|
||||||
|
const cityOperators = useCityOperators();
|
||||||
|
const groupCityCodes = cityOperators.map(it => (it.groupLink ? it.cityCode : null)).filter(Boolean);
|
||||||
const showSearchList = searchResult.length > 0;
|
const showSearchList = searchResult.length > 0;
|
||||||
const CITY_LIST = forGroup ? GROUP_CITY_INDEXES_LIST : CITY_INDEXES_LIST;
|
const CITY_LIST = forGroup
|
||||||
|
? CITY_INDEXES_LIST.map(({ letter, data }) => {
|
||||||
|
return {
|
||||||
|
letter,
|
||||||
|
data: data.filter(it => groupCityCodes.includes(it.cityCode)),
|
||||||
|
};
|
||||||
|
}).filter(item => item.data.length > 0)
|
||||||
|
: CITY_INDEXES_LIST;
|
||||||
|
|
||||||
|
const HOT_CITY_LIST = forGroup ? HOT_CITY.filter(it => groupCityCodes.includes(`${it.cityCode}`)) : HOT_CITY;
|
||||||
|
|
||||||
const handleSearchChange = useCallback((event: BaseEventOrig<InputProps.inputEventDetail>) => {
|
const handleSearchChange = useCallback((event: BaseEventOrig<InputProps.inputEventDetail>) => {
|
||||||
const value = event.detail.value;
|
const value = event.detail.value;
|
||||||
@ -173,19 +185,25 @@ export default function SearchCity({
|
|||||||
<div>
|
<div>
|
||||||
<div className={`${PREFIX}__position-title`}>当前城市</div>
|
<div className={`${PREFIX}__position-title`}>当前城市</div>
|
||||||
<div className={`${PREFIX}__position-city`}>{CITY_CODE_TO_NAME_MAP.get(currentCity)}</div>
|
<div className={`${PREFIX}__position-city`}>{CITY_CODE_TO_NAME_MAP.get(currentCity)}</div>
|
||||||
<div className={`${PREFIX}__hot-city-title`}>热门城市</div>
|
{!!HOT_CITY_LIST.length && (
|
||||||
<div className={`${PREFIX}__hot-city-container`}>
|
<Fragment>
|
||||||
{HOT_CITY.map(city => (
|
<div className={`${PREFIX}__hot-city-title`}>热门城市</div>
|
||||||
<div
|
<div className={`${PREFIX}__hot-city-container`}>
|
||||||
key={city.cityCode}
|
{HOT_CITY_LIST.map(city => {
|
||||||
className={`${PREFIX}__hot-city-item`}
|
return (
|
||||||
data-code={city.cityCode}
|
<div
|
||||||
onClick={handleSelectCity}
|
key={city.cityCode}
|
||||||
>
|
className={`${PREFIX}__hot-city-item`}
|
||||||
{city.cityName}
|
data-code={city.cityCode}
|
||||||
|
onClick={handleSelectCity}
|
||||||
|
>
|
||||||
|
{city.cityName}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
))}
|
</Fragment>
|
||||||
</div>
|
)}
|
||||||
<div className={`${PREFIX}__indexes-list`}>
|
<div className={`${PREFIX}__indexes-list`}>
|
||||||
{CITY_LIST.map(item => {
|
{CITY_LIST.map(item => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
import { Tabbar } from '@taroify/core';
|
import { Tabbar } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
|
||||||
|
|
||||||
import { APP_TAB_BAR_ID, RoleType, PageType, PageUrl } from '@/constants/app';
|
import { APP_TAB_BAR_ID, RoleType, PageType, PageUrl } from '@/constants/app';
|
||||||
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST, TabItemType } from '@/hooks/use-config';
|
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST, TabItemType } from '@/hooks/use-config';
|
||||||
import useMessage from '@/hooks/use-message';
|
import useMessage from '@/hooks/use-message';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
import { changeHomePage } from '@/store/actions';
|
|
||||||
import { selectHomePageType } from '@/store/selector';
|
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { switchTab } from '@/utils/route';
|
import { switchTab } from '@/utils/route';
|
||||||
|
|
||||||
@ -16,6 +13,7 @@ import './index.less';
|
|||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
type: PageType;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PREFIX = 'base-tab-bar';
|
const PREFIX = 'base-tab-bar';
|
||||||
@ -40,25 +38,21 @@ const TabItem = (props: { item: TabItemType }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function BaseTabBar(props: IProps) {
|
function BaseTabBar({ className, type }: IProps) {
|
||||||
const { className } = props;
|
|
||||||
const roleType = useRoleType();
|
const roleType = useRoleType();
|
||||||
const currentPage = useSelector(selectHomePageType);
|
|
||||||
const dispatch = useDispatch();
|
|
||||||
|
|
||||||
const tabs = roleType === RoleType.Anchor ? ANCHOR_TAB_LIST : COMPANY_TAB_LIST;
|
const tabs = roleType === RoleType.Anchor ? ANCHOR_TAB_LIST : COMPANY_TAB_LIST;
|
||||||
|
|
||||||
const handleTabClick = useCallback(
|
const handleTabClick = useCallback(
|
||||||
(value: PageType) => {
|
(value: PageType) => {
|
||||||
if (value === currentPage) {
|
if (value === type) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatch(changeHomePage(value));
|
|
||||||
const item = tabs.find((i: TabItemType) => i.type === value);
|
const item = tabs.find((i: TabItemType) => i.type === value);
|
||||||
log('tab bar changed', value, item?.pagePath);
|
log('tab bar changed', value, item?.pagePath);
|
||||||
item && switchTab(item.pagePath as PageUrl);
|
item && switchTab(item.pagePath as PageUrl);
|
||||||
},
|
},
|
||||||
[tabs, currentPage, dispatch]
|
[tabs, type]
|
||||||
);
|
);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
@ -72,14 +66,14 @@ function BaseTabBar(props: IProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(`${PREFIX}__wrapper`, className)} id={APP_TAB_BAR_ID}>
|
<div className={classNames(`${PREFIX}__wrapper`, className)} id={APP_TAB_BAR_ID}>
|
||||||
<Tabbar className={PREFIX} defaultValue={currentPage}>
|
<Tabbar className={PREFIX} value={type}>
|
||||||
{tabs.map((item: TabItemType) => {
|
{tabs.map((item: TabItemType) => {
|
||||||
return (
|
return (
|
||||||
<Tabbar.TabItem
|
<Tabbar.TabItem
|
||||||
key={item.pagePath}
|
key={item.pagePath}
|
||||||
value={item.type}
|
value={item.type}
|
||||||
onClick={() => handleTabClick(item.type)}
|
onClick={() => handleTabClick(item.type)}
|
||||||
className={classNames(`${PREFIX}__item`, { selected: item.type === currentPage })}
|
className={classNames(`${PREFIX}__item`, { selected: item.type === type })}
|
||||||
>
|
>
|
||||||
<TabItem item={item} />
|
<TabItem item={item} />
|
||||||
</Tabbar.TabItem>
|
</Tabbar.TabItem>
|
||||||
|
|||||||
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,22 +36,22 @@ 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[] = [
|
||||||
{ cityCode: '440100', cityName: '广州', count: 300 }, // 800
|
{ cityCode: '440100', cityName: '广州', count: 800 },
|
||||||
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
{ cityCode: '440300', cityName: '深圳', count: 100 },
|
||||||
{ cityCode: '330100', cityName: '杭州', count: 300 }, // 750
|
{ cityCode: '330100', cityName: '杭州', count: 750 },
|
||||||
{ cityCode: '110100', cityName: '北京', count: 100 }, // 150
|
{ cityCode: '110100', cityName: '北京', count: 150 },
|
||||||
{ cityCode: '510100', cityName: '成都', count: 100 },
|
{ cityCode: '510100', cityName: '成都', count: 100 },
|
||||||
// { cityCode: '500100', cityName: '重庆', count: 50 },
|
{ cityCode: '500100', cityName: '重庆', count: 50 },
|
||||||
{ cityCode: '430100', cityName: '长沙', count: 50 },
|
{ cityCode: '430100', cityName: '长沙', count: 50 },
|
||||||
{ cityCode: '350200', cityName: '厦门', count: 50 },
|
{ cityCode: '350200', cityName: '厦门', count: 50 },
|
||||||
{ cityCode: '310100', cityName: '上海', count: 100 }, // 150
|
{ cityCode: '310100', cityName: '上海', count: 150 },
|
||||||
{ cityCode: '420100', cityName: '武汉', count: 50 }, // 80
|
{ cityCode: '420100', cityName: '武汉', count: 80 },
|
||||||
{ cityCode: '610100', cityName: '西安', count: 50 }, // 60
|
{ cityCode: '610100', cityName: '西安', count: 60 },
|
||||||
{ cityCode: '410100', cityName: '郑州', count: 100 }, // 150
|
{ cityCode: '410100', cityName: '郑州', count: 150 },
|
||||||
].sort((a, b) => b.count - a.count);
|
].sort((a, b) => b.count - a.count);
|
||||||
const MIN_GROUP_SIZE = 20;
|
const MIN_GROUP_SIZE = 20;
|
||||||
const GROUP_OPTIONS = [
|
const GROUP_OPTIONS = [
|
||||||
@ -62,7 +62,7 @@ const GROUP_OPTIONS = [
|
|||||||
{ value: 100, productSpecId: ProductSpecId.GroupBatchPublish100, label: '100', price: 68 },
|
{ value: 100, productSpecId: ProductSpecId.GroupBatchPublish100, label: '100', price: 68 },
|
||||||
{ value: 150, productSpecId: ProductSpecId.GroupBatchPublish150, label: '150', price: 98 },
|
{ value: 150, productSpecId: ProductSpecId.GroupBatchPublish150, label: '150', price: 98 },
|
||||||
{ value: 300, productSpecId: ProductSpecId.GroupBatchPublish300, label: '300', price: 128 },
|
{ value: 300, productSpecId: ProductSpecId.GroupBatchPublish300, label: '300', price: 128 },
|
||||||
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 188 }, // 168
|
{ value: 500, productSpecId: ProductSpecId.GroupBatchPublish500, label: '500', price: 168 },
|
||||||
{ value: 750, productSpecId: ProductSpecId.GroupBatchPublish750, label: '750', price: 188 },
|
{ value: 750, productSpecId: ProductSpecId.GroupBatchPublish750, label: '750', price: 188 },
|
||||||
{ value: 800, productSpecId: ProductSpecId.GroupBatchPublish800, label: '800', price: 198 },
|
{ value: 800, productSpecId: ProductSpecId.GroupBatchPublish800, label: '800', price: 198 },
|
||||||
{ value: 1000, productSpecId: ProductSpecId.GroupBatchPublish1000, label: '1000', price: 288 },
|
{ value: 1000, productSpecId: ProductSpecId.GroupBatchPublish1000, label: '1000', price: 288 },
|
||||||
@ -146,7 +146,7 @@ export default function UserBatchPublish() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
const cOptions: CityOption[] = cityValues.map(value => ({ value, label: value.cityName }));
|
||||||
const initCity = cOptions[0].value;
|
const initCity = (cOptions.find(o => o.label === '重庆') || cOptions[0]).value;
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setCity(initCity);
|
setCity(initCity);
|
||||||
|
|||||||
@ -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,9 @@ 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',
|
||||||
|
PartnerShareVip = 'pages/partner-share-vip/index',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PluginUrl {
|
export enum PluginUrl {
|
||||||
|
|||||||
@ -12,4 +12,5 @@ export enum CacheKey {
|
|||||||
INVITE_CODE = '__invite_code__',
|
INVITE_CODE = '__invite_code__',
|
||||||
AGREEMENT_SIGNED = '__agreement_signed__',
|
AGREEMENT_SIGNED = '__agreement_signed__',
|
||||||
CITY_CODES = '__city_codes__',
|
CITY_CODES = '__city_codes__',
|
||||||
|
JOIN_GROUP_CARD_CLICKED = '__join_group_card_clicked__',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5934,6 +5934,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '杭州',
|
cityName: '杭州',
|
||||||
keyword: 'HANGZHOU杭州',
|
keyword: 'HANGZHOU杭州',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '230100',
|
||||||
|
cityName: '哈尔滨',
|
||||||
|
keyword: 'HAERBIN哈尔滨',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
cityCode: '340100',
|
cityCode: '340100',
|
||||||
cityName: '合肥',
|
cityName: '合肥',
|
||||||
@ -5941,6 +5946,16 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
letter: 'J',
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
cityCode: '370100',
|
||||||
|
cityName: '济南',
|
||||||
|
keyword: 'JINAN济南',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
letter: 'K',
|
letter: 'K',
|
||||||
data: [
|
data: [
|
||||||
@ -5984,11 +5999,21 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '上海',
|
cityName: '上海',
|
||||||
keyword: 'SHANGHAI上海',
|
keyword: 'SHANGHAI上海',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '210100',
|
||||||
|
cityName: '沈阳',
|
||||||
|
keyword: 'SHENYANG沈阳',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
cityCode: '440300',
|
cityCode: '440300',
|
||||||
cityName: '深圳',
|
cityName: '深圳',
|
||||||
keyword: 'SHENZHEN深圳',
|
keyword: 'SHENZHEN深圳',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '130100',
|
||||||
|
cityName: '石家庄',
|
||||||
|
keyword: 'SHIJIAZHUANG石家庄',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
cityCode: '320500',
|
cityCode: '320500',
|
||||||
cityName: '苏州',
|
cityName: '苏州',
|
||||||
@ -6004,6 +6029,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '天津',
|
cityName: '天津',
|
||||||
keyword: 'TIANJIN天津',
|
keyword: 'TIANJIN天津',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '140100',
|
||||||
|
cityName: '太原',
|
||||||
|
keyword: 'TAIYUAN太原',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -6044,6 +6074,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
|||||||
cityName: '郑州',
|
cityName: '郑州',
|
||||||
keyword: 'ZHENGZHOU郑州',
|
keyword: 'ZHENGZHOU郑州',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cityCode: '430200',
|
||||||
|
cityName: '株洲',
|
||||||
|
keyword: 'ZHUZHOU株洲',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -56,5 +56,11 @@ export const GROUPS: GroupItem[] = [
|
|||||||
{ title: '【温州】', cityCode: 330300, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcb0ea5f197a18b335' },
|
{ title: '【温州】', cityCode: 330300, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcb0ea5f197a18b335' },
|
||||||
{ title: '【天津】', cityCode: 120100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcda46c23dade6f6a3' },
|
{ title: '【天津】', cityCode: 120100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcda46c23dade6f6a3' },
|
||||||
{ title: '【昆明】', cityCode: 530100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcf2aebcbf3d46d9cd' },
|
{ title: '【昆明】', cityCode: 530100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcf2aebcbf3d46d9cd' },
|
||||||
|
{ title: '【石家庄】', cityCode: 130100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfc7dedcc69aaa9cdae' },
|
||||||
|
{ title: '【太原】', cityCode: 140100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfccc8b59411baa7c24' },
|
||||||
|
{ title: '【株洲】', cityCode: 430200, serviceUrl: 'https://work.weixin.qq.com/kfid/kfc8584f903f9263f85' },
|
||||||
|
{ title: '【哈尔滨】', cityCode: 230100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcaf757d0590d2bad0' },
|
||||||
|
{ title: '【沈阳】', cityCode: 210100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcbe96e71d87061f88' },
|
||||||
|
{ title: '【济南】', cityCode: 370100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfc57d4d9bd032fe89c' },
|
||||||
{ title: '【全国】', cityCode: 440300, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8' },
|
{ title: '【全国】', cityCode: 440300, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcc60ac7b6420787a8' },
|
||||||
];
|
];
|
||||||
|
|||||||
@ -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', // 本地生活
|
||||||
@ -21,6 +22,12 @@ export enum EmployType {
|
|||||||
Part = 'PARTY_TIME',
|
Part = 'PARTY_TIME',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum JobSourceType {
|
||||||
|
All = 'All',
|
||||||
|
VX = 'vx',
|
||||||
|
BL = 'bl',
|
||||||
|
}
|
||||||
|
|
||||||
export enum SortType {
|
export enum SortType {
|
||||||
RECOMMEND = 'RECOMMEND',
|
RECOMMEND = 'RECOMMEND',
|
||||||
DISTANCE = 'DISTANCE',
|
DISTANCE = 'DISTANCE',
|
||||||
@ -66,6 +73,12 @@ export const EMPLOY_TYPE_TITLE_MAP = {
|
|||||||
[EmployType.Full]: '全职',
|
[EmployType.Full]: '全职',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const JOB_SOURCE_TYPE_TITLE_MAP = {
|
||||||
|
[JobSourceType.All]: '全部',
|
||||||
|
[JobSourceType.BL]: '急招',
|
||||||
|
[JobSourceType.VX]: '群通告',
|
||||||
|
};
|
||||||
|
|
||||||
export const JOB_TYPE_TITLE_MAP: { [key in JobType]: string } = {
|
export const JOB_TYPE_TITLE_MAP: { [key in JobType]: string } = {
|
||||||
[JobType.All]: '全部',
|
[JobType.All]: '全部',
|
||||||
[JobType.Finery]: '服饰',
|
[JobType.Finery]: '服饰',
|
||||||
@ -75,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]: '本地生活',
|
||||||
@ -101,16 +115,31 @@ export const JOB_MANAGE_STATUS_TITLE_MAP = {
|
|||||||
|
|
||||||
export const JOB_PAGE_TABS = [
|
export const JOB_PAGE_TABS = [
|
||||||
{
|
{
|
||||||
type: EmployType.All,
|
type: JobSourceType.All,
|
||||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.All],
|
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.All],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: EmployType.Part,
|
type: JobSourceType.BL,
|
||||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.Part],
|
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.BL],
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: JobSourceType.VX,
|
||||||
|
// title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.VX],
|
||||||
|
// },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const JOB_EMPLOY_TYPE_OPTIONS = [
|
||||||
|
{
|
||||||
|
value: EmployType.All,
|
||||||
|
label: EMPLOY_TYPE_TITLE_MAP[EmployType.All],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: EmployType.Full,
|
value: EmployType.Part,
|
||||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.Full],
|
label: EMPLOY_TYPE_TITLE_MAP[EmployType.Part],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: EmployType.Full,
|
||||||
|
label: EMPLOY_TYPE_TITLE_MAP[EmployType.Full],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -146,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 },
|
||||||
@ -154,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: '不限' },
|
||||||
@ -174,3 +209,8 @@ export const FULL_EMPLOY_SALARY_OPTIONS = [
|
|||||||
export const PART_PRICE_OPTIONS = PART_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
export const PART_PRICE_OPTIONS = PART_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
||||||
|
|
||||||
export const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
export const FULL_PRICE_OPTIONS = FULL_EMPLOY_SALARY_OPTIONS.filter(o => !!o.value);
|
||||||
|
|
||||||
|
export enum GET_CONTACT_TYPE {
|
||||||
|
VIP = 'vip',
|
||||||
|
MATERIAL = 'material',
|
||||||
|
}
|
||||||
|
|||||||
@ -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 = {
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export enum ProductSpecId {
|
|||||||
AddGroup2 = 'ADDGROUP_2',
|
AddGroup2 = 'ADDGROUP_2',
|
||||||
AddGroup3 = 'ADDGROUP_3',
|
AddGroup3 = 'ADDGROUP_3',
|
||||||
BossVip = 'BOSSVIP',
|
BossVip = 'BOSSVIP',
|
||||||
|
DailyVIP = 'VIP_D',
|
||||||
WeeklyVIP = 'VIP_W',
|
WeeklyVIP = 'VIP_W',
|
||||||
MonthlyVIP = 'VIP_M', // 30 每天十次
|
MonthlyVIP = 'VIP_M', // 30 每天十次
|
||||||
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
|
NewMonthlyVIP = 'VIP_M_NEW', // 18 每天五次
|
||||||
|
|||||||
@ -54,6 +54,7 @@
|
|||||||
flex: 1 0;
|
flex: 1 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__employType-select,
|
||||||
&__salary-select,
|
&__salary-select,
|
||||||
&__search-city {
|
&__search-city {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -2,10 +2,11 @@ import { Image } from '@tarojs/components';
|
|||||||
import { NodesRef, useDidHide } from '@tarojs/taro';
|
import { NodesRef, useDidHide } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
import EmployTypeSelect from '@/components/employ-type-select';
|
||||||
import JobList, { IJobListProps } from '@/components/job-list';
|
import JobList, { IJobListProps } from '@/components/job-list';
|
||||||
import Overlay from '@/components/overlay';
|
import Overlay from '@/components/overlay';
|
||||||
import PartnerBanner from '@/components/partner-banner';
|
import PartnerBanner from '@/components/partner-banner';
|
||||||
@ -13,7 +14,16 @@ import SalarySelect from '@/components/salary-select';
|
|||||||
import SearchInput from '@/components/search';
|
import SearchInput from '@/components/search';
|
||||||
import { APP_TAB_BAR_ID, PageUrl } from '@/constants/app';
|
import { APP_TAB_BAR_ID, PageUrl } from '@/constants/app';
|
||||||
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
|
||||||
import { JOB_TABS, JobType, EmployType, ALL_SORT_TYPES, SORT_TYPE_TITLE_MAP, SortType } from '@/constants/job';
|
import {
|
||||||
|
ALL_SORT_TYPES,
|
||||||
|
EMPLOY_TYPE_TITLE_MAP,
|
||||||
|
EmployType,
|
||||||
|
JOB_TABS,
|
||||||
|
JobSourceType,
|
||||||
|
JobType,
|
||||||
|
SORT_TYPE_TITLE_MAP,
|
||||||
|
SortType,
|
||||||
|
} from '@/constants/job';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import { SalaryRange } from '@/types/job';
|
import { SalaryRange } from '@/types/job';
|
||||||
import { Coordinate } from '@/types/location';
|
import { Coordinate } from '@/types/location';
|
||||||
@ -24,9 +34,11 @@ import './index.less';
|
|||||||
interface IProps {
|
interface IProps {
|
||||||
cityCode: string;
|
cityCode: string;
|
||||||
sortType: SortType;
|
sortType: SortType;
|
||||||
|
sourceType: JobSourceType;
|
||||||
employType: EmployType;
|
employType: EmployType;
|
||||||
coordinate: Coordinate;
|
coordinate: Coordinate;
|
||||||
onClickCity: () => void;
|
onClickCity: () => void;
|
||||||
|
onClickEmployType: (type: EmployType) => void;
|
||||||
onClickSort: (type: SortType) => void;
|
onClickSort: (type: SortType) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,20 +86,35 @@ function ListWrapper(props: IJobListProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function JobFragment(props: IProps) {
|
function JobFragment(props: IProps) {
|
||||||
const { cityCode, employType, sortType = SortType.RECOMMEND, coordinate, onClickCity, onClickSort } = props;
|
const {
|
||||||
|
cityCode,
|
||||||
|
employType,
|
||||||
|
sourceType,
|
||||||
|
sortType = SortType.RECOMMEND,
|
||||||
|
coordinate,
|
||||||
|
onClickEmployType,
|
||||||
|
onClickCity,
|
||||||
|
onClickSort,
|
||||||
|
} = props;
|
||||||
const listHeight = useListHeight(CALC_LIST_PROPS);
|
const listHeight = useListHeight(CALC_LIST_PROPS);
|
||||||
const [tabType, setTabType] = useState<JobType>(JobType.All);
|
const [tabType, setTabType] = useState<JobType>(JobType.All);
|
||||||
const [salaryRange, setSalaryRange] = useState<SalaryRange | undefined>();
|
const [salaryRange, setSalaryRange] = useState<SalaryRange | undefined>();
|
||||||
const [showSalarySelect, setShowSalarySelect] = useState<boolean>(false);
|
const [showSalarySelect, setShowSalarySelect] = useState<boolean>(false);
|
||||||
|
const [showEmployTypeSelect, setShowEmployTypeSelect] = useState<boolean>(false);
|
||||||
const { latitude, longitude } = coordinate;
|
const { latitude, longitude } = coordinate;
|
||||||
|
|
||||||
const handleClickSearch = useCallback(() => navigateTo(PageUrl.JobSearch, { city: cityCode }), [cityCode]);
|
const handleClickSearch = useCallback(() => navigateTo(PageUrl.JobSearch, { city: cityCode }), [cityCode]);
|
||||||
|
|
||||||
const handleClickSalarySelect = useCallback(() => {
|
const handleClickSalarySelect = useCallback(() => {
|
||||||
setShowSalarySelect(!showSalarySelect);
|
setShowSalarySelect(s => !s);
|
||||||
}, [showSalarySelect]);
|
}, []);
|
||||||
|
|
||||||
|
const handleClickEmployTypeSelect = useCallback(() => {
|
||||||
|
setShowEmployTypeSelect(s => !s);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleHideSalarySelect = useCallback(() => setShowSalarySelect(false), []);
|
const handleHideSalarySelect = useCallback(() => setShowSalarySelect(false), []);
|
||||||
|
const handleHideEmployTypeSelect = useCallback(() => setShowEmployTypeSelect(false), []);
|
||||||
|
|
||||||
const handleSelectSalary = useCallback((value?: SalaryRange) => {
|
const handleSelectSalary = useCallback((value?: SalaryRange) => {
|
||||||
log('handleSelectSalary', value);
|
log('handleSelectSalary', value);
|
||||||
@ -95,6 +122,15 @@ function JobFragment(props: IProps) {
|
|||||||
setShowSalarySelect(false);
|
setShowSalarySelect(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleSelectEmployType = useCallback(
|
||||||
|
(value?: EmployType) => {
|
||||||
|
console.log('哈哈哈', value);
|
||||||
|
setShowEmployTypeSelect(false);
|
||||||
|
onClickEmployType(value!);
|
||||||
|
},
|
||||||
|
[onClickEmployType]
|
||||||
|
);
|
||||||
|
|
||||||
const onTypeChange = useCallback(
|
const onTypeChange = useCallback(
|
||||||
value => {
|
value => {
|
||||||
log('onTypeChange', value);
|
log('onTypeChange', value);
|
||||||
@ -109,6 +145,12 @@ function JobFragment(props: IProps) {
|
|||||||
<div className={`${PREFIX}__container`}>
|
<div className={`${PREFIX}__container`}>
|
||||||
<div className={`${PREFIX}__top-search-bar`}>
|
<div className={`${PREFIX}__top-search-bar`}>
|
||||||
<SearchInput disabled className={`${PREFIX}__search`} placeholder="试试 女装" onClick={handleClickSearch} />
|
<SearchInput disabled className={`${PREFIX}__search`} placeholder="试试 女装" onClick={handleClickSearch} />
|
||||||
|
<div className={classNames(`${PREFIX}__employType-select`)} onClick={handleClickEmployTypeSelect}>
|
||||||
|
<div className="title">
|
||||||
|
{employType && employType !== EmployType.All ? EMPLOY_TYPE_TITLE_MAP[employType] : '类型'}
|
||||||
|
</div>
|
||||||
|
{showEmployTypeSelect ? <ArrowUp /> : <ArrowDown />}
|
||||||
|
</div>
|
||||||
<div className={classNames(`${PREFIX}__search-city`)} onClick={onClickCity}>
|
<div className={classNames(`${PREFIX}__search-city`)} onClick={onClickCity}>
|
||||||
<div className="title">{CITY_CODE_TO_NAME_MAP.get(cityCode)}</div>
|
<div className="title">{CITY_CODE_TO_NAME_MAP.get(cityCode)}</div>
|
||||||
<ArrowDown />
|
<ArrowDown />
|
||||||
@ -139,6 +181,7 @@ function JobFragment(props: IProps) {
|
|||||||
sortType={sortType}
|
sortType={sortType}
|
||||||
latitude={latitude}
|
latitude={latitude}
|
||||||
longitude={longitude}
|
longitude={longitude}
|
||||||
|
sourceType={sourceType}
|
||||||
employType={employType}
|
employType={employType}
|
||||||
minSalary={salaryRange?.minSalary}
|
minSalary={salaryRange?.minSalary}
|
||||||
maxSalary={salaryRange?.maxSalary}
|
maxSalary={salaryRange?.maxSalary}
|
||||||
@ -157,6 +200,15 @@ function JobFragment(props: IProps) {
|
|||||||
>
|
>
|
||||||
<SalarySelect type={employType} value={salaryRange} onSelect={handleSelectSalary} />
|
<SalarySelect type={employType} value={salaryRange} onSelect={handleSelectSalary} />
|
||||||
</Overlay>
|
</Overlay>
|
||||||
|
|
||||||
|
<Overlay
|
||||||
|
visible={showEmployTypeSelect}
|
||||||
|
onClickOuter={handleHideEmployTypeSelect}
|
||||||
|
outerClassName={`${PREFIX}__overlay-outer`}
|
||||||
|
innerClassName={`${PREFIX}__overlay-inner`}
|
||||||
|
>
|
||||||
|
<EmployTypeSelect value={employType} onSelect={handleSelectEmployType} />
|
||||||
|
</Overlay>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ const log = logWithPrefix(PREFIX);
|
|||||||
const realtimeLogger = Taro.getRealtimeLogManager();
|
const realtimeLogger = Taro.getRealtimeLogManager();
|
||||||
realtimeLogger.tag(PREFIX);
|
realtimeLogger.tag(PREFIX);
|
||||||
const calcInitCityCodes = (codeString: string = '') => {
|
const calcInitCityCodes = (codeString: string = '') => {
|
||||||
const codes = codeString.split('、');
|
const codes = (codeString || '').split('、');
|
||||||
return codes.filter(code => !!CITY_CODE_TO_NAME_MAP.get(code));
|
return codes.filter(code => !!CITY_CODE_TO_NAME_MAP.get(code));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
background: #0000005c;
|
background: #6D3DF5B2;
|
||||||
border-radius: 48px;
|
border-radius: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,4 +232,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.join-group-hint {
|
||||||
|
margin: 24px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import { navigateTo } from '@/utils/route';
|
|||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
import onChangeEventDetail = SwiperProps.onChangeEventDetail;
|
||||||
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
@ -29,7 +30,7 @@ const log = logWithPrefix(PREFIX);
|
|||||||
const DEFAULT_TEXT = '未填写';
|
const DEFAULT_TEXT = '未填写';
|
||||||
|
|
||||||
const getIndentCity = (codeString: string = '') => {
|
const getIndentCity = (codeString: string = '') => {
|
||||||
const codes = codeString.split('、');
|
const codes = (codeString||'').split('、');
|
||||||
const cityNames: string[] = [];
|
const cityNames: string[] = [];
|
||||||
codes.forEach(code => {
|
codes.forEach(code => {
|
||||||
const cityName = CITY_CODE_TO_NAME_MAP.get(code);
|
const cityName = CITY_CODE_TO_NAME_MAP.get(code);
|
||||||
@ -207,6 +208,7 @@ export default function ProfileViewFragment(props: IProps) {
|
|||||||
>{`${coverIndex + 1}/${profile.materialVideoInfoList.length}`}</div>
|
>{`${coverIndex + 1}/${profile.materialVideoInfoList.length}`}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{!editable && <JoinGroupHint />}
|
||||||
<div className={`${PREFIX}__body`}>
|
<div className={`${PREFIX}__body`}>
|
||||||
<div className={`${PREFIX}__basic-info`}>
|
<div className={`${PREFIX}__basic-info`}>
|
||||||
<div className={`${PREFIX}__basic-info__name-container`}>
|
<div className={`${PREFIX}__basic-info__name-container`}>
|
||||||
@ -228,7 +230,9 @@ export default function ProfileViewFragment(props: IProps) {
|
|||||||
{index ? (
|
{index ? (
|
||||||
<div className={`${PREFIX}__info-group__header__title`}>{data.title}</div>
|
<div className={`${PREFIX}__info-group__header__title`}>{data.title}</div>
|
||||||
) : (
|
) : (
|
||||||
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>{data.title}</DevDiv>
|
<DevDiv className={`${PREFIX}__info-group__header__title`} OnDev={onDev}>
|
||||||
|
{data.title}
|
||||||
|
</DevDiv>
|
||||||
)}
|
)}
|
||||||
{editable && (
|
{editable && (
|
||||||
<div className={`${PREFIX}__info-group__header__edit`} onClick={() => handleEditGroupItem(data.type)}>
|
<div className={`${PREFIX}__info-group__header__edit`} onClick={() => handleEditGroupItem(data.type)}>
|
||||||
|
|||||||
@ -13,6 +13,21 @@
|
|||||||
.taroify-cell__value {
|
.taroify-cell__value {
|
||||||
color: @blColor;
|
color: @blColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 80, 81, 0.16);
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 16px;
|
||||||
|
> image {
|
||||||
|
width: 18px;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__go-publish-cell {
|
&__go-publish-cell {
|
||||||
@ -24,4 +39,6 @@
|
|||||||
color: @blHighlightColor;
|
color: @blHighlightColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Image } from '@tarojs/components';
|
||||||
|
|
||||||
import { Cell } from '@taroify/core';
|
import { Cell } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
@ -5,7 +7,6 @@ import { useCallback } from 'react';
|
|||||||
import CertificationStatus from '@/components/certification-status';
|
import CertificationStatus from '@/components/certification-status';
|
||||||
import WechatCell from '@/components/wx-cell';
|
import WechatCell from '@/components/wx-cell';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageUrl } from '@/constants/app';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
@ -18,10 +19,6 @@ export default function CompanyFragment() {
|
|||||||
// const [showPublish, setShowPublish] = useState(false);
|
// const [showPublish, setShowPublish] = useState(false);
|
||||||
|
|
||||||
const handlePublishJob = useCallback(async () => {
|
const handlePublishJob = useCallback(async () => {
|
||||||
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
|
||||||
navigateTo(PageUrl.CertificationStart);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
navigateTo(PageUrl.CertificationManage);
|
navigateTo(PageUrl.CertificationManage);
|
||||||
}, [userInfo]);
|
}, [userInfo]);
|
||||||
|
|
||||||
@ -32,7 +29,14 @@ export default function CompanyFragment() {
|
|||||||
<Cell
|
<Cell
|
||||||
isLink
|
isLink
|
||||||
align="center"
|
align="center"
|
||||||
title="发通告,让主播主动报单"
|
title={
|
||||||
|
<div>
|
||||||
|
<div className={`${PREFIX}__cell-icon`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
|
||||||
|
</div>
|
||||||
|
发布急招通告,优先展示
|
||||||
|
</div>
|
||||||
|
}
|
||||||
className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
|
className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
|
||||||
onClick={handlePublishJob}
|
onClick={handlePublishJob}
|
||||||
>
|
>
|
||||||
|
|||||||
10
src/hooks/use-cached-job.tsx
Normal file
10
src/hooks/use-cached-job.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { selectCreatedJob } from '@/store/selector/job';
|
||||||
|
|
||||||
|
function useCachedJobId() {
|
||||||
|
const data = useSelector(selectCreatedJob);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useCachedJobId;
|
||||||
10
src/hooks/use-city-operators.tsx
Normal file
10
src/hooks/use-city-operators.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import { selectCityOperators } from '@/store/selector';
|
||||||
|
|
||||||
|
function useCityOperators() {
|
||||||
|
const data = useSelector(selectCityOperators);
|
||||||
|
return data || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export default useCityOperators;
|
||||||
@ -48,7 +48,7 @@ const CompanyTabs: TabItemType[] = [
|
|||||||
{
|
{
|
||||||
type: PageType.BatchPublish,
|
type: PageType.BatchPublish,
|
||||||
pagePath: PageUrl.UserBatchPublish,
|
pagePath: PageUrl.UserBatchPublish,
|
||||||
text: '免费招',
|
text: '代招代发',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -98,6 +98,9 @@ export const APP_CONFIG: AppConfigType = {
|
|||||||
PageUrl.Partner,
|
PageUrl.Partner,
|
||||||
PageUrl.WithdrawRecord,
|
PageUrl.WithdrawRecord,
|
||||||
PageUrl.GroupDelegatePublish,
|
PageUrl.GroupDelegatePublish,
|
||||||
|
PageUrl.GiveVip,
|
||||||
|
PageUrl.GroupOwnerCertificate,
|
||||||
|
PageUrl.PartnerShareVip,
|
||||||
// PageUrl.DevDebug,
|
// PageUrl.DevDebug,
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
|
|||||||
13
src/hooks/use-previous.ts
Normal file
13
src/hooks/use-previous.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
function usePrevious<T>(value: T) {
|
||||||
|
const ref = useRef<T>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
ref.current = value;
|
||||||
|
}, [value]);
|
||||||
|
|
||||||
|
return ref.current;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default usePrevious;
|
||||||
@ -1,5 +1,6 @@
|
|||||||
// export const DOMAIN = 'http://192.168.60.148: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',
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ export enum RESPONSE_ERROR_CODE {
|
|||||||
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE', // 聊天或者模卡查看超出限制
|
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE', // 聊天或者模卡查看超出限制
|
||||||
INSUFFICIENT_FREE_BALANCE = 'INSUFFICIENT_FREE_BALANCE', // 免费查看次数(未购买会员)超限
|
INSUFFICIENT_FREE_BALANCE = 'INSUFFICIENT_FREE_BALANCE', // 免费查看次数(未购买会员)超限
|
||||||
BOSS_VIP_EXPIRED = 'BOSS_VIP_EXPIRED', // 会员过期
|
BOSS_VIP_EXPIRED = 'BOSS_VIP_EXPIRED', // 会员过期
|
||||||
|
CHAT_MSG_SEND_NOT_ALLOW = 'CHAT_MSG_SEND_NOT_ALLOW',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RESPONSE_ERROR_INFO: { [key in RESPONSE_ERROR_CODE]?: string } = {
|
export const RESPONSE_ERROR_INFO: { [key in RESPONSE_ERROR_CODE]?: string } = {
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class Http {
|
|||||||
url: BASE_URL + url,
|
url: BASE_URL + url,
|
||||||
data,
|
data,
|
||||||
method: method,
|
method: method,
|
||||||
header: { 'content-type': contentType /*'user-Id': '588002047871053824' */ },
|
header: { 'content-type': contentType /*,'user-Id': '588002047871053824'*/ },
|
||||||
};
|
};
|
||||||
return this.request(option);
|
return this.request(option);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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 {
|
||||||
@ -90,4 +100,23 @@
|
|||||||
color: @blColor;
|
color: @blColor;
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__popup {
|
||||||
|
&-content {
|
||||||
|
.flex-column();
|
||||||
|
padding: 40px 32px 64px 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 36px;
|
||||||
|
line-height: 57px;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-confirm {
|
||||||
|
.button(@width: 360px, @height: 72px, @fontSize: 28px, @fontWeight: 400, @borderRadius: 44px);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,28 +1,39 @@
|
|||||||
import { Image } from '@tarojs/components';
|
import { Button, Image } from '@tarojs/components';
|
||||||
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
import { Popup } from '@taroify/core';
|
||||||
|
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';
|
||||||
import PartnerBanner from '@/components/partner-banner';
|
import PartnerBanner from '@/components/partner-banner';
|
||||||
|
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, PageUrl } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType, JobManageStatus } 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';
|
||||||
import { JobManageInfo } from '@/types/job';
|
import { JobManageInfo } from '@/types/job';
|
||||||
import { Coordinate } from '@/types/location';
|
import { Coordinate } from '@/types/location';
|
||||||
import { IAnchorFilters } from '@/types/material';
|
import { IAnchorFilters } from '@/types/material';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { getLastSelectMyJobId, requestJobManageList, setLastSelectMyJobId } from '@/utils/job';
|
import { getLastSelectMyJobId, requestJobManageList, setLastSelectMyJobId } from '@/utils/job';
|
||||||
import { getWxLocation } from '@/utils/location';
|
import { getWxLocation } from '@/utils/location';
|
||||||
@ -31,7 +42,9 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|||||||
import { getPageQuery, navigateTo } from '@/utils/route';
|
import { getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
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`;
|
||||||
@ -74,13 +87,24 @@ 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 [coordinate, setCoordinate] = useState<Coordinate>({
|
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||||
latitude: location.latitude,
|
latitude: location.latitude,
|
||||||
longitude: location.longitude,
|
longitude: location.longitude,
|
||||||
@ -91,6 +115,8 @@ export default function AnchorPage() {
|
|||||||
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
||||||
log('select job change', select);
|
log('select job change', select);
|
||||||
setSelectJob(select);
|
setSelectJob(select);
|
||||||
|
console.log('哈哈哈', !select);
|
||||||
|
setOpenPopup(!select);
|
||||||
setLastSelectMyJobId(select?.id || '');
|
setLastSelectMyJobId(select?.id || '');
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -99,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(
|
||||||
@ -124,7 +165,7 @@ export default function AnchorPage() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handlePublishJobChange = useCallback(async () => {
|
const handlePublishJobChange = useCallback(async () => {
|
||||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
const { jobResults = [] } = await requestJobManageList();
|
||||||
if (!selectJob) {
|
if (!selectJob) {
|
||||||
// 之前没有开发中的通告,自动选中第一个开放中的通告
|
// 之前没有开发中的通告,自动选中第一个开放中的通告
|
||||||
handleChangeSelectJob(jobResults[0]);
|
handleChangeSelectJob(jobResults[0]);
|
||||||
@ -140,6 +181,10 @@ export default function AnchorPage() {
|
|||||||
}
|
}
|
||||||
}, [selectJob, handleChangeSelectJob]);
|
}, [selectJob, handleChangeSelectJob]);
|
||||||
|
|
||||||
|
const handleGoCreate = useCallback(() => {
|
||||||
|
navigateTo(PageUrl.JobPublish);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_MY_PUBLISH_JOB, handleJobChange);
|
Taro.eventCenter.on(EventName.SELECT_MY_PUBLISH_JOB, handleJobChange);
|
||||||
Taro.eventCenter.on(EventName.COMPANY_JOB_PUBLISH_CHANGED, handlePublishJobChange);
|
Taro.eventCenter.on(EventName.COMPANY_JOB_PUBLISH_CHANGED, handlePublishJobChange);
|
||||||
@ -165,13 +210,16 @@ export default function AnchorPage() {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Company);
|
||||||
|
|
||||||
const query = getPageQuery();
|
const query = getPageQuery();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
const { jobResults = [] } = await requestJobManageList();
|
||||||
if (!jobResults.length) {
|
if (!jobResults.length) {
|
||||||
Toast.info('当前是根据定位为您展示主播');
|
setOpenPopup(true);
|
||||||
|
// Toast.info('当前是根据定位为您展示主播');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const lastSelectJobId = getLastSelectMyJobId();
|
const lastSelectJobId = getLastSelectMyJobId();
|
||||||
@ -185,14 +233,27 @@ export default function AnchorPage() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
return getCommonShareMessage({ useCapture: true, inviteCode, title: '数万名优质主播等你来挑' });
|
return getCommonShareMessage({ inviteCode, title: '数万名优质主播等你来挑', path: PageUrl.Anchor });
|
||||||
});
|
});
|
||||||
|
|
||||||
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>
|
<HomePage type={PageType.Anchor}>
|
||||||
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
{!!loading && <PageLoading className={`${PREFIX}__loading`} />}
|
||||||
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
<CustomNavigationBar className={`${PREFIX}__navigation-bar`}>
|
||||||
{selectJob && <SwitchBar title={selectJob.title.substring(0, 4)} onClick={handleClickSwitch} />}
|
{selectJob && <SwitchBar title={selectJob.title.substring(0, 4)} onClick={handleClickSwitch} />}
|
||||||
@ -210,13 +271,27 @@ 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`}>
|
||||||
<PartnerBanner />
|
<PartnerBanner isBoss />
|
||||||
</div>
|
</div>
|
||||||
<ListWrapper
|
<ListWrapper
|
||||||
filters={filters}
|
filters={filters}
|
||||||
@ -229,14 +304,53 @@ 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
|
||||||
|
rounded
|
||||||
|
open={openPopup}
|
||||||
|
placement="bottom"
|
||||||
|
className={`${PREFIX}__popup`}
|
||||||
|
onClose={() => setOpenPopup(false)}
|
||||||
|
>
|
||||||
|
<div className={`${PREFIX}__popup-content`}>
|
||||||
|
<div className={`${PREFIX}__popup-title`}>创建通告后可根据位置展示主播</div>
|
||||||
|
<Button className={`${PREFIX}__popup-confirm`} onClick={handleGoCreate}>
|
||||||
|
去创建
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<SafeBottomPadding />
|
||||||
|
</Popup>
|
||||||
</HomePage>
|
</HomePage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,14 +6,15 @@ import classNames from 'classnames';
|
|||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import JobManageList, { IJobManageListProps } from '@/components/job-manage-list';
|
import JobManageList, { IJobManageListProps } from '@/components/job-manage-list';
|
||||||
import { CompanyPublishJobDialog } from '@/components/product-dialog/publish-job';
|
|
||||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import { ReportEventId } from '@/constants/event';
|
import { ReportEventId } from '@/constants/event';
|
||||||
import { JOB_MANAGE_TABS, JobManageStatus, JobManageType } from '@/constants/job';
|
import { JOB_MANAGE_TABS, JobManageStatus, JobManageType } from '@/constants/job';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { reportEvent } from '@/utils/event';
|
import { reportEvent } from '@/utils/event';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
import { ensureUserInfo } from '@/utils/user';
|
import { ensureUserInfo } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -91,7 +92,6 @@ export default function CertificationManage() {
|
|||||||
const userInfo = useUserInfo();
|
const userInfo = useUserInfo();
|
||||||
const listHeight = useListHeight(CALC_LIST_PROPS);
|
const listHeight = useListHeight(CALC_LIST_PROPS);
|
||||||
const [tabType, setTabType] = useState<JobManageType>(JobManageType.All);
|
const [tabType, setTabType] = useState<JobManageType>(JobManageType.All);
|
||||||
const [showPublish, setShowPublish] = useState(false);
|
|
||||||
|
|
||||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ export default function CertificationManage() {
|
|||||||
if (!(await ensureUserInfo(userInfo))) {
|
if (!(await ensureUserInfo(userInfo))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setShowPublish(true);
|
navigateTo(PageUrl.JobPublish);
|
||||||
}, [userInfo]);
|
}, [userInfo]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -124,7 +124,6 @@ export default function CertificationManage() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<SafeBottomPadding className={SAFE_BOTTOM_PADDING_CLASS} />
|
<SafeBottomPadding className={SAFE_BOTTOM_PADDING_CLASS} />
|
||||||
<div>{showPublish && <CompanyPublishJobDialog userInfo={userInfo} onClose={() => setShowPublish(false)} />}</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,29 @@
|
|||||||
import { BaseEventOrig, Button, ButtonProps, Image, InputProps } from '@tarojs/components';
|
import { BaseEventOrig, Button, ButtonProps, Image, InputProps } from '@tarojs/components';
|
||||||
import Taro, { UploadTask } from '@tarojs/taro';
|
import Taro, { UploadTask } from '@tarojs/taro';
|
||||||
|
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { Dialog } from '@taroify/core';
|
||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import BlFormInput from '@/components/bl-form-input';
|
import BlFormInput from '@/components/bl-form-input';
|
||||||
import BlFormItem from '@/components/bl-form-item';
|
import BlFormItem from '@/components/bl-form-item';
|
||||||
import LoadingDialog from '@/components/loading-dialog';
|
import LoadingDialog from '@/components/loading-dialog';
|
||||||
|
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 { PageUrl } from '@/constants/app';
|
import { EventName, PageUrl } from '@/constants/app';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||||
|
import { ProductType } from '@/constants/product';
|
||||||
|
import useCachedJobId from '@/hooks/use-cached-job';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
|
import store from '@/store';
|
||||||
|
import { clearCachedJobId } from '@/store/actions';
|
||||||
import { ICertificationRequest } from '@/types/company';
|
import { ICertificationRequest } from '@/types/company';
|
||||||
import { isValidIdCard, isValidPhone, logWithPrefix } from '@/utils/common';
|
import { isValidIdCard, isValidPhone, logWithPrefix } from '@/utils/common';
|
||||||
import { postCertification, getPhone } from '@/utils/company';
|
import { postCertification, getPhone } from '@/utils/company';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { collectEvent, reportEvent } from '@/utils/event';
|
||||||
|
import { postPublishJob } from '@/utils/job';
|
||||||
import { chooseMedia } from '@/utils/material';
|
import { chooseMedia } from '@/utils/material';
|
||||||
|
import { requestProductBalance } from '@/utils/product';
|
||||||
import { redirectTo } from '@/utils/route';
|
import { redirectTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import { dispatchUpdateUser, requestUserInfo } from '@/utils/user';
|
import { dispatchUpdateUser, requestUserInfo } from '@/utils/user';
|
||||||
@ -23,6 +31,7 @@ import { uploadVideo } from '@/utils/video';
|
|||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
|
|
||||||
const PREFIX = 'page-certification';
|
const PREFIX = 'page-certification';
|
||||||
const log = logWithPrefix(PREFIX);
|
const log = logWithPrefix(PREFIX);
|
||||||
const needIdCard = false;
|
const needIdCard = false;
|
||||||
@ -100,6 +109,8 @@ export default function Certification() {
|
|||||||
// const [code, setCode] = useState('');
|
// const [code, setCode] = useState('');
|
||||||
const [company, setCompany] = useState('');
|
const [company, setCompany] = useState('');
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
const [showBuy, setShowBuy] = useState(false);
|
||||||
|
const cachedJobId = useCachedJobId();
|
||||||
|
|
||||||
const handleClickIdCardLeft = useCallback(async () => {
|
const handleClickIdCardLeft = useCallback(async () => {
|
||||||
reportEvent(ReportEventId.CLICK_UPLOAD_ID_CARD, { type: 'left' });
|
reportEvent(ReportEventId.CLICK_UPLOAD_ID_CARD, { type: 'left' });
|
||||||
@ -133,6 +144,29 @@ export default function Certification() {
|
|||||||
setCompany(value);
|
setCompany(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleCloseBuy = useCallback(() => {
|
||||||
|
setShowBuy(false);
|
||||||
|
redirectTo(PageUrl.CertificationManage);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handlePublishJob = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
Taro.showLoading();
|
||||||
|
await postPublishJob(cachedJobId!);
|
||||||
|
await Toast.success('通告发布成功', 1500, true);
|
||||||
|
store.dispatch(clearCachedJobId());
|
||||||
|
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||||
|
redirectTo(PageUrl.CertificationManage);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('submit error', e);
|
||||||
|
Toast.error('通告发布失败');
|
||||||
|
collectEvent(CollectEventName.PUBLISH_JOB_FAILED, e);
|
||||||
|
redirectTo(PageUrl.CertificationManage);
|
||||||
|
} finally {
|
||||||
|
Taro.hideLoading();
|
||||||
|
}
|
||||||
|
}, [cachedJobId]);
|
||||||
|
|
||||||
const handleSubmit = useCallback(async () => {
|
const handleSubmit = useCallback(async () => {
|
||||||
reportEvent(ReportEventId.CLICK_CERTIFICATION_SUBMIT);
|
reportEvent(ReportEventId.CLICK_CERTIFICATION_SUBMIT);
|
||||||
const data: ICertificationRequest = {
|
const data: ICertificationRequest = {
|
||||||
@ -157,7 +191,14 @@ export default function Certification() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dispatchUpdateUser({ bossAuthStatus: CertificationStatusType.Success });
|
dispatchUpdateUser({ bossAuthStatus: CertificationStatusType.Success });
|
||||||
redirectTo(PageUrl.CertificationManage);
|
|
||||||
|
const [time] = await requestProductBalance(ProductType.CompanyPublishJob);
|
||||||
|
if (time <= 0) {
|
||||||
|
setShowBuy(true);
|
||||||
|
Taro.hideLoading();
|
||||||
|
} else {
|
||||||
|
await handlePublishJob();
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('submit error', e);
|
console.error('submit error', e);
|
||||||
Toast.error('认证失败请重试');
|
Toast.error('认证失败请重试');
|
||||||
@ -173,6 +214,7 @@ export default function Certification() {
|
|||||||
try {
|
try {
|
||||||
const { phoneNumber } = await getPhone(e.detail.code);
|
const { phoneNumber } = await getPhone(e.detail.code);
|
||||||
setRevisedPhone(phoneNumber);
|
setRevisedPhone(phoneNumber);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error('获取手机号失败');
|
Toast.error('获取手机号失败');
|
||||||
}
|
}
|
||||||
@ -262,6 +304,11 @@ export default function Certification() {
|
|||||||
<div>
|
<div>
|
||||||
<LoadingDialog open={open} text="认证中" />
|
<LoadingDialog open={open} text="认证中" />
|
||||||
</div>
|
</div>
|
||||||
|
<Dialog open={showBuy} onClose={handleCloseBuy}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<CompanyPublishJobBuy onNext={handlePublishJob} />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { Button } from '@taroify/core';
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import { PageUrl } from '@/constants/app';
|
import { PageType, PageUrl } from '@/constants/app';
|
||||||
import { copy, logWithPrefix } from '@/utils/common';
|
import { copy, logWithPrefix } from '@/utils/common';
|
||||||
import { navigateTo } from '@/utils/route';
|
import { navigateTo } from '@/utils/route';
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ export default function DevDebug() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.DEV}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
{/* <div>{`最近一次的订单 ID: ${lastOrderNo}`}</div>
|
{/* <div>{`最近一次的订单 ID: ${lastOrderNo}`}</div>
|
||||||
<Button onClick={() => handleCreateOrder(OrderType.Group)} style={marginTopStyle} color="primary">
|
<Button onClick={() => handleCreateOrder(OrderType.Group)} style={marginTopStyle} color="primary">
|
||||||
|
|||||||
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,
|
||||||
|
});
|
||||||
129
src/pages/group-owner-certification/index.less
Normal file
129
src/pages/group-owner-certification/index.less
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
@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;
|
||||||
|
padding-bottom: calc(48px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(48px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
&__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;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.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;
|
||||||
|
display: block;
|
||||||
|
margin: auto auto 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
130
src/pages/group-owner-certification/index.tsx
Normal file
130
src/pages/group-owner-certification/index.tsx
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
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.Job,
|
||||||
|
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}
|
||||||
|
showMenuByLongpress
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__title`}>第二步</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__h1 ${PREFIX}__bold`}>点击以下按钮分享小程序到群,并在群里打开小程序</div>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className="highlight">1次分享只能认证一个群,有多个群请分享多次,不可在微信聊天里直接转发;</div>
|
||||||
|
<div>一般1天内完成,超时未完成认证请重新分享或者咨询运营</div>
|
||||||
|
</div>
|
||||||
|
<Button className={`${PREFIX}__share`} openType="share">
|
||||||
|
分享小程序
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Tabs.TabPane>
|
||||||
|
<Tabs.TabPane value={1} title="已认证的群">
|
||||||
|
<GroupCertificationList />
|
||||||
|
</Tabs.TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -4,8 +4,10 @@ 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 { GROUPS } from '@/constants/group';
|
import { PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
|
import useCityOperators from '@/hooks/use-city-operators';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
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';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||||
@ -18,33 +20,41 @@ const PREFIX = 'group-v2-page';
|
|||||||
|
|
||||||
export default function GroupV2() {
|
export default function GroupV2() {
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const cityOperators = useCityOperators();
|
||||||
|
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
|
|
||||||
const query = getPageQuery();
|
const query = getPageQuery();
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
});
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage({ inviteCode }));
|
useShareAppMessage(() =>
|
||||||
|
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 = cityOperators.find(g => String(g.cityCode) === cityCode);
|
||||||
openCustomerServiceChat(group.serviceUrl);
|
if (group) {
|
||||||
}
|
openCustomerServiceChat(group.groupLink);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[cityOperators]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.GroupV2}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<SearchCity
|
<SearchCity
|
||||||
onSelectCity={handleSelectCity}
|
onSelectCity={handleSelectCity}
|
||||||
currentCity={getCurrentCityCode()}
|
currentCity={getCurrentCityCode()}
|
||||||
forGroup
|
forGroup
|
||||||
offset={72}
|
offset={72}
|
||||||
banner="点击城市加入本地通告群,高薪工作早知道"
|
banner="点击城市加入本地主播招聘群,高薪职位早知道"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</HomePage>
|
</HomePage>
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
|
import { PageType } from '@/constants/app';
|
||||||
import { GroupType, GROUP_PAGE_TABS } from '@/constants/group';
|
import { GroupType, GROUP_PAGE_TABS } from '@/constants/group';
|
||||||
import GroupFragment from '@/fragments/group';
|
import GroupFragment from '@/fragments/group';
|
||||||
import useNavigation from '@/hooks/use-navigation';
|
import useNavigation from '@/hooks/use-navigation';
|
||||||
@ -19,10 +20,14 @@ export default function Group() {
|
|||||||
|
|
||||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => getCommonShareMessage());
|
useShareAppMessage(() => getCommonShareMessage());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.Group}>
|
||||||
<Tabs
|
<Tabs
|
||||||
swipeable
|
swipeable
|
||||||
value={tabType}
|
value={tabType}
|
||||||
|
|||||||
@ -1,34 +1,42 @@
|
|||||||
import { Map, MapProps, Text, Image, Button } from '@tarojs/components';
|
import { Button, Image, Map, MapProps, Text } from '@tarojs/components';
|
||||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Dialog } from '@taroify/core';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||||
import CommonDialog from '@/components/common-dialog';
|
import CommonDialog from '@/components/common-dialog';
|
||||||
import DevDiv from '@/components/dev-div';
|
import DevDiv from '@/components/dev-div';
|
||||||
import JobRecommendList from '@/components/job-recommend-list';
|
import JobRecommendList from '@/components/job-recommend-list';
|
||||||
|
import { JoinGroupHint } from '@/components/join-group-hint';
|
||||||
import LoginButton from '@/components/login-button';
|
import LoginButton from '@/components/login-button';
|
||||||
import MaterialGuide from '@/components/material-guide';
|
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
|
import { PrejobPopup } from '@/components/prejob-popup';
|
||||||
import ProductJobDialog from '@/components/product-dialog/job';
|
import ProductJobDialog from '@/components/product-dialog/job';
|
||||||
import { RoleType, EventName, PageUrl } from '@/constants/app';
|
import CompanyPublishJobBuy from '@/components/product-dialog/steps-ui/company-publish-job-buy';
|
||||||
|
import { EventName, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { CertificationStatusType } from '@/constants/company';
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName, ReportEventId } from '@/constants/event';
|
import { CollectEventName, ReportEventId } from '@/constants/event';
|
||||||
import { EMPLOY_TYPE_TITLE_MAP } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, GET_CONTACT_TYPE, JobManageStatus } from '@/constants/job';
|
||||||
|
import { ProductType } from '@/constants/product';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
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 { JobDetails } from '@/types/job';
|
import { JobDetails } from '@/types/job';
|
||||||
import { IMaterialMessage } from '@/types/message';
|
import { IMaterialMessage } from '@/types/message';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { copy, logWithPrefix } from '@/utils/common';
|
import { copy, logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent, reportEvent } from '@/utils/event';
|
import { collectEvent, reportEvent } from '@/utils/event';
|
||||||
import { getJobTitle, getJobSalary, postPublishJob, requestJobDetail } from '@/utils/job';
|
import { getJobSalary, getJobTitle, postPublishJob, requestJobDetail } from '@/utils/job';
|
||||||
import { calcDistance, isValidLocation } from '@/utils/location';
|
import { calcDistance, isValidLocation } from '@/utils/location';
|
||||||
import { requestProfileDetail } from '@/utils/material';
|
import { requestProfileDetail } from '@/utils/material';
|
||||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||||
|
import { requestProductBalance, requestProductUseRecord } from '@/utils/product';
|
||||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import { formatDate } from '@/utils/time';
|
import { formatDate } from '@/utils/time';
|
||||||
@ -74,9 +82,18 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
reportEvent(ReportEventId.CLICK_JOB_CONTACT);
|
||||||
try {
|
try {
|
||||||
const needCreateMaterial = await isNeedCreateMaterial();
|
const needCreateMaterial = await isNeedCreateMaterial();
|
||||||
if (needCreateMaterial) {
|
|
||||||
setShowMaterialGuide(true);
|
if (data.sourcePlat !== 'bl') {
|
||||||
return;
|
if (needCreateMaterial) {
|
||||||
|
const result = await requestProductUseRecord(ProductType.VIP, { jobId: data.id });
|
||||||
|
if (!result) {
|
||||||
|
const [time, isPaidVip] = await requestProductBalance(ProductType.VIP);
|
||||||
|
if (time <= 0 || !isPaidVip) {
|
||||||
|
setShowMaterialGuide(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (data.isAuthed) {
|
if (data.isAuthed) {
|
||||||
const toUserId = data.userId;
|
const toUserId = data.userId;
|
||||||
@ -84,19 +101,29 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
Toast.error('不能与自己聊天');
|
Toast.error('不能与自己聊天');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const profile = await requestProfileDetail();
|
|
||||||
const chat = await postCreateChat(toUserId);
|
const chat = await postCreateChat(toUserId);
|
||||||
const materialMessage: IMaterialMessage = {
|
let materialMessage: null | IMaterialMessage = null;
|
||||||
id: profile.id,
|
if (!needCreateMaterial) {
|
||||||
name: profile.name,
|
const profile = await requestProfileDetail();
|
||||||
age: profile.age,
|
if (profile) {
|
||||||
height: profile.height,
|
materialMessage = {
|
||||||
weight: profile.weight,
|
id: profile.id,
|
||||||
shoeSize: profile.shoeSize,
|
name: profile.name,
|
||||||
gender: profile.gender,
|
age: profile.age,
|
||||||
workedSecCategoryStr: profile.workedSecCategoryStr,
|
height: profile.height,
|
||||||
};
|
weight: profile.weight,
|
||||||
navigateTo(PageUrl.MessageChat, { chatId: chat.chatId, material: materialMessage, jobId: data.id });
|
shoeSize: profile.shoeSize,
|
||||||
|
gender: profile.gender,
|
||||||
|
workedSecCategoryStr: profile.workedSecCategoryStr,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
navigateTo(PageUrl.MessageChat, {
|
||||||
|
chatId: chat.chatId,
|
||||||
|
initText: !materialMessage,
|
||||||
|
material: materialMessage,
|
||||||
|
jobId: data.id,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setDialogVisible(true);
|
setDialogVisible(true);
|
||||||
}
|
}
|
||||||
@ -111,7 +138,15 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
const handleDialogHidden = useCallback(() => setDialogVisible(false), []);
|
const handleDialogHidden = useCallback(() => {
|
||||||
|
setDialogVisible(false);
|
||||||
|
}, []);
|
||||||
|
const handleConfirmPrejob = useCallback((type: GET_CONTACT_TYPE) => {
|
||||||
|
setShowMaterialGuide(false);
|
||||||
|
if (GET_CONTACT_TYPE.VIP === type) {
|
||||||
|
setDialogVisible(true);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
@ -124,7 +159,9 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{dialogVisible && <ProductJobDialog data={data} onClose={handleDialogHidden} />}
|
{dialogVisible && <ProductJobDialog data={data} onClose={handleDialogHidden} />}
|
||||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
{showMaterialGuide && (
|
||||||
|
<PrejobPopup onCancel={() => setShowMaterialGuide(false)} onConfirm={handleConfirmPrejob} />
|
||||||
|
)}
|
||||||
<CommonDialog
|
<CommonDialog
|
||||||
content={errorTips}
|
content={errorTips}
|
||||||
confirm="确定"
|
confirm="确定"
|
||||||
@ -139,25 +176,39 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
|||||||
|
|
||||||
const CompanyFooter = (props: { data: JobDetails }) => {
|
const CompanyFooter = (props: { data: JobDetails }) => {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
|
const [showBuy, setShowBuy] = useState(false);
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
|
||||||
const handleClickEdit = useCallback(() => navigateTo(PageUrl.JobPublish, { jobId: data.id }), [data]);
|
const handleClickEdit = useCallback(() => navigateTo(PageUrl.JobPublish, { jobId: data.id }), [data]);
|
||||||
|
|
||||||
const handlePublishJob = useCallback(async () => {
|
const handlePublishJob = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
|
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||||
|
store.dispatch(cacheJobId(data.id));
|
||||||
|
navigateTo(PageUrl.CertificationStart);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
await postPublishJob(data.id);
|
await postPublishJob(data.id);
|
||||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||||
|
setShowBuy(false);
|
||||||
Toast.success('发布成功');
|
Toast.success('发布成功');
|
||||||
Taro.hideLoading();
|
Taro.hideLoading();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.hideLoading();
|
Taro.hideLoading();
|
||||||
const e = error as HttpError;
|
const e = error as HttpError;
|
||||||
const errorCode = e.errorCode;
|
const errorCode = e.errorCode;
|
||||||
|
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.BOSS_VIP_EXPIRED) {
|
if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_FREE_BALANCE) {
|
||||||
|
setShowBuy(true);
|
||||||
|
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
||||||
|
Toast.info('您购买的产品已耗尽使用次数');
|
||||||
|
setShowBuy(true);
|
||||||
|
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
||||||
Toast.info('该通告已到期,请创建新通告', 3000);
|
Toast.info('该通告已到期,请创建新通告', 3000);
|
||||||
} else {
|
} else {
|
||||||
Toast.error(e.message || '发布失败请重试', 3000);
|
Toast.error(errorMsg || '发布失败请重试', 3000);
|
||||||
}
|
}
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
@ -169,10 +220,19 @@ const CompanyFooter = (props: { data: JobDetails }) => {
|
|||||||
<Button className={`${PREFIX}__share-button`} onClick={handleClickEdit}>
|
<Button className={`${PREFIX}__share-button`} onClick={handleClickEdit}>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
<Button className={`${PREFIX}__contact-publisher`} onClick={handlePublishJob}>
|
<Button
|
||||||
|
disabled={data.status === JobManageStatus.Open}
|
||||||
|
className={`${PREFIX}__contact-publisher`}
|
||||||
|
onClick={handlePublishJob}
|
||||||
|
>
|
||||||
发布通告
|
发布通告
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<Dialog open={showBuy} onClose={() => setShowBuy(false)}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<CompanyPublishJobBuy onNext={handlePublishJob} />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -218,12 +278,17 @@ export default function JobDetail() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string }>();
|
const query = getPageQuery<Pick<JobDetails, 'id'> & { c: string; share: string }>();
|
||||||
|
|
||||||
|
if (query?.share === 'true') {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
|
}
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
const jobId = query?.id;
|
const jobId = query?.id;
|
||||||
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);
|
||||||
@ -232,11 +297,14 @@ export default function JobDetail() {
|
|||||||
Toast.error('出错了,请重试');
|
Toast.error('出错了,请重试');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return getCommonShareMessage({ inviteCode });
|
return getCommonShareMessage({ inviteCode });
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: getJobTitle(data) || '',
|
title: getJobTitle(data) || '',
|
||||||
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true, c: inviteCode }),
|
path: getJumpUrl(PageUrl.JobDetail, { id: data.id, share: true, c: inviteCode }),
|
||||||
@ -278,6 +346,8 @@ export default function JobDetail() {
|
|||||||
{data.companyName && <div className={`${PREFIX}__company`}>{`公司:${data.companyName}`}</div>}
|
{data.companyName && <div className={`${PREFIX}__company`}>{`公司:${data.companyName}`}</div>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{!isOwner && <JoinGroupHint />}
|
||||||
|
|
||||||
<div className={`${PREFIX}__content`}>
|
<div className={`${PREFIX}__content`}>
|
||||||
<div className={`${PREFIX}__content-title`}>职位描述</div>
|
<div className={`${PREFIX}__content-title`}>职位描述</div>
|
||||||
<div className={`${PREFIX}__tags`}>
|
<div className={`${PREFIX}__tags`}>
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { BaseEventOrig, Button, InputProps } from '@tarojs/components';
|
import { BaseEventOrig, Button, InputProps } from '@tarojs/components';
|
||||||
import Taro, { useLoad } from '@tarojs/taro';
|
import Taro, { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Dialog } from '@taroify/core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import BlFormCell from '@/components/bl-form-cell';
|
import BlFormCell from '@/components/bl-form-cell';
|
||||||
import BlFormInput from '@/components/bl-form-input';
|
import BlFormInput from '@/components/bl-form-input';
|
||||||
@ -12,15 +13,30 @@ import BlFormSelect from '@/components/bl-form-select';
|
|||||||
import BlSalaryInput, { BlSalaryValue } from '@/components/bl-salary-input';
|
import BlSalaryInput, { BlSalaryValue } from '@/components/bl-salary-input';
|
||||||
import { CityPickerPopup } from '@/components/city-picker';
|
import { CityPickerPopup } from '@/components/city-picker';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
|
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, PageUrl } from '@/constants/app';
|
import { EventName, PageUrl } from '@/constants/app';
|
||||||
|
import { CertificationStatusType } from '@/constants/company';
|
||||||
import { CollectEventName } from '@/constants/event';
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { EMPLOY_TYPE_TITLE_MAP, EmployType, JOB_TYPE_SELECT_OPTIONS, JobType } from '@/constants/job';
|
import { EMPLOY_TYPE_TITLE_MAP, EmployType, JOB_TYPE_SELECT_OPTIONS, JobType } from '@/constants/job';
|
||||||
|
import { ProductType } from '@/constants/product';
|
||||||
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
|
import store from '@/store';
|
||||||
|
import { cacheJobId } from '@/store/actions';
|
||||||
import { CreateJobInfo, JobDetails } from '@/types/job';
|
import { CreateJobInfo, JobDetails } from '@/types/job';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { postCloseJob, postCreateJob, postUpdateJob, requestJobDetail, isFullTimePriceRequired, isPartTimePriceRequired } from '@/utils/job';
|
import {
|
||||||
|
postCloseJob,
|
||||||
|
postCreateJob,
|
||||||
|
postUpdateJob,
|
||||||
|
requestJobDetail,
|
||||||
|
isFullTimePriceRequired,
|
||||||
|
isPartTimePriceRequired,
|
||||||
|
postPublishJob,
|
||||||
|
} from '@/utils/job';
|
||||||
import { getCityValues } from '@/utils/location';
|
import { getCityValues } from '@/utils/location';
|
||||||
|
import { requestProductBalance } from '@/utils/product';
|
||||||
import { getPageQuery, navigateBack, navigateTo } from '@/utils/route';
|
import { getPageQuery, navigateBack, navigateTo } from '@/utils/route';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
@ -91,6 +107,9 @@ export default function JobPublish() {
|
|||||||
const [city, setCity] = useState<string[] | undefined>();
|
const [city, setCity] = useState<string[] | undefined>();
|
||||||
const [showCityPicker, setShowCityPicker] = useState(false);
|
const [showCityPicker, setShowCityPicker] = useState(false);
|
||||||
const [address, setAddress] = useState('');
|
const [address, setAddress] = useState('');
|
||||||
|
const [showBuy, setShowBuy] = useState(false);
|
||||||
|
const createdJobIdRef = useRef('');
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
|
||||||
const handleEmployTypeChange = useCallback((value: EmployType) => {
|
const handleEmployTypeChange = useCallback((value: EmployType) => {
|
||||||
setEmployType(value);
|
setEmployType(value);
|
||||||
@ -125,6 +144,13 @@ export default function JobPublish() {
|
|||||||
setAddress(value);
|
setAddress(value);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const refreshJobPublishList = useCallback(() => {
|
||||||
|
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||||
|
}, 300);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClose = useCallback(async () => {
|
const handleClose = useCallback(async () => {
|
||||||
if (!job) {
|
if (!job) {
|
||||||
Toast.error('数据出错请重试');
|
Toast.error('数据出错请重试');
|
||||||
@ -133,7 +159,7 @@ export default function JobPublish() {
|
|||||||
try {
|
try {
|
||||||
Taro.showLoading();
|
Taro.showLoading();
|
||||||
await postCloseJob(job.id);
|
await postCloseJob(job.id);
|
||||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
refreshJobPublishList();
|
||||||
navigateBack();
|
navigateBack();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('submit error', e);
|
console.error('submit error', e);
|
||||||
@ -142,9 +168,9 @@ export default function JobPublish() {
|
|||||||
} finally {
|
} finally {
|
||||||
Taro.hideLoading();
|
Taro.hideLoading();
|
||||||
}
|
}
|
||||||
}, [job]);
|
}, [job, refreshJobPublishList]);
|
||||||
|
|
||||||
const handleSubmit = useCallback(async () => {
|
const getCreateJobInfo = useCallback((): [CreateJobInfo, string[]] => {
|
||||||
const cityCodes = city || [];
|
const cityCodes = city || [];
|
||||||
const data: CreateJobInfo = {
|
const data: CreateJobInfo = {
|
||||||
title,
|
title,
|
||||||
@ -160,6 +186,11 @@ export default function JobPublish() {
|
|||||||
highPriceForPartyTime: !isPartTimePriceRequired(employType) ? 0 : salary[3],
|
highPriceForPartyTime: !isPartTimePriceRequired(employType) ? 0 : salary[3],
|
||||||
address: address,
|
address: address,
|
||||||
};
|
};
|
||||||
|
return [data, cityCodes];
|
||||||
|
}, [address, category, city, describe, employType, salary, title]);
|
||||||
|
|
||||||
|
const handleSubmit = useCallback(async () => {
|
||||||
|
const [data, cityCodes] = getCreateJobInfo();
|
||||||
const errMsg = isInvalidCreateJobInfo(data);
|
const errMsg = isInvalidCreateJobInfo(data);
|
||||||
if (errMsg) {
|
if (errMsg) {
|
||||||
Toast.info(errMsg);
|
Toast.info(errMsg);
|
||||||
@ -178,10 +209,48 @@ export default function JobPublish() {
|
|||||||
await postUpdateJob(data);
|
await postUpdateJob(data);
|
||||||
Taro.eventCenter.trigger(EventName.JOB_UPDATE, job!.id);
|
Taro.eventCenter.trigger(EventName.JOB_UPDATE, job!.id);
|
||||||
} else {
|
} else {
|
||||||
await postCreateJob(data);
|
const jobId = await postCreateJob(data);
|
||||||
|
createdJobIdRef.current = jobId;
|
||||||
|
refreshJobPublishList();
|
||||||
|
|
||||||
|
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||||
|
// 去认证
|
||||||
|
store.dispatch(cacheJobId(jobId));
|
||||||
|
navigateTo(PageUrl.CertificationStart);
|
||||||
|
Taro.hideLoading();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [time] = await requestProductBalance(ProductType.CompanyPublishJob);
|
||||||
|
if (time <= 0) {
|
||||||
|
// 付钱
|
||||||
|
setShowBuy(true);
|
||||||
|
Taro.hideLoading();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await postPublishJob(jobId);
|
||||||
}
|
}
|
||||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
refreshJobPublishList();
|
||||||
await Toast.success(isUpdateJob ? '更新成功' : '创建成功', 1500, true);
|
|
||||||
|
await Toast.success(isUpdateJob ? '更新成功' : '创建并发布成功', 1500, true);
|
||||||
|
navigateBack();
|
||||||
|
} catch (e) {
|
||||||
|
createdJobIdRef.current = '';
|
||||||
|
console.error('submit error', e);
|
||||||
|
Toast.error('审核失败请重试');
|
||||||
|
collectEvent(CollectEventName.PUBLISH_JOB_FAILED, e);
|
||||||
|
} finally {
|
||||||
|
Taro.hideLoading();
|
||||||
|
}
|
||||||
|
}, [getCreateJobInfo, isUpdate, job, userInfo.bossAuthStatus, refreshJobPublishList]);
|
||||||
|
|
||||||
|
const handleNext = useCallback(async () => {
|
||||||
|
Taro.showLoading();
|
||||||
|
try {
|
||||||
|
await postPublishJob(createdJobIdRef.current);
|
||||||
|
refreshJobPublishList();
|
||||||
|
await Toast.success('发布成功', 1500, true);
|
||||||
navigateBack();
|
navigateBack();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('submit error', e);
|
console.error('submit error', e);
|
||||||
@ -190,7 +259,12 @@ export default function JobPublish() {
|
|||||||
} finally {
|
} finally {
|
||||||
Taro.hideLoading();
|
Taro.hideLoading();
|
||||||
}
|
}
|
||||||
}, [isUpdate, job, title, employType, category, describe, city, salary, address]);
|
}, [refreshJobPublishList]);
|
||||||
|
|
||||||
|
const handleClosePublishJob = useCallback(() => {
|
||||||
|
setShowBuy(false);
|
||||||
|
navigateBack(-1);
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const callback = (d: string) => setDescribe(d);
|
const callback = (d: string) => setDescribe(d);
|
||||||
@ -283,7 +357,7 @@ export default function JobPublish() {
|
|||||||
<div className={`${PREFIX}__footer__buttons`}>
|
<div className={`${PREFIX}__footer__buttons`}>
|
||||||
{!isUpdate && (
|
{!isUpdate && (
|
||||||
<Button className={`${PREFIX}__footer__button`} onClick={handleSubmit}>
|
<Button className={`${PREFIX}__footer__button`} onClick={handleSubmit}>
|
||||||
创建
|
创建并发布
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{isUpdate && (
|
{isUpdate && (
|
||||||
@ -306,6 +380,11 @@ export default function JobPublish() {
|
|||||||
onConfirm={handleConfirmCityPicker}
|
onConfirm={handleConfirmCityPicker}
|
||||||
onCancel={() => setShowCityPicker(false)}
|
onCancel={() => setShowCityPicker(false)}
|
||||||
/>
|
/>
|
||||||
|
<Dialog open={showBuy} onClose={handleClosePublishJob}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<CompanyPublishJobBuy onNext={handleNext} />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -150,7 +150,7 @@ export default function JobSearch() {
|
|||||||
<SearchInput
|
<SearchInput
|
||||||
focus={focus}
|
focus={focus}
|
||||||
value={value}
|
value={value}
|
||||||
placeholder="你想搜什么"
|
placeholder="可以试试地区 品类"
|
||||||
searchAction={searchAction}
|
searchAction={searchAction}
|
||||||
className={`${PREFIX}__search`}
|
className={`${PREFIX}__search`}
|
||||||
onClear={handleSearchClear}
|
onClear={handleSearchClear}
|
||||||
|
|||||||
@ -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,7 +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 { JobManageStatus } from '@/constants/job';
|
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';
|
||||||
@ -16,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');
|
||||||
@ -34,7 +41,7 @@ export default function JobSelectMyPublish() {
|
|||||||
const query = getPageQuery<{ id: string; source: OpenSource }>();
|
const query = getPageQuery<{ id: string; source: OpenSource }>();
|
||||||
query?.id && setJobId(query.id);
|
query?.id && setJobId(query.id);
|
||||||
try {
|
try {
|
||||||
const res = await requestJobManageList({ status: JobManageStatus.Open });
|
const res = await requestJobManageList();
|
||||||
setList(res.jobResults);
|
setList(res.jobResults);
|
||||||
setSource(query.source);
|
setSource(query.source);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -58,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>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -23,5 +23,24 @@
|
|||||||
background-color: @blTabLineColor;
|
background-color: @blTabLineColor;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.taroify-dialog.taroify-popup {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
&__tab-icon {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(255, 80, 81, 0.16);
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 8px;
|
||||||
|
> image {
|
||||||
|
width: 14.4px;
|
||||||
|
height: 19.2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
|
import { Image } from '@tarojs/components';
|
||||||
import Taro, { useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import { AgreementPopup } from '@/components/agreement-popup';
|
||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import { LoginGuide } from '@/components/login-guide';
|
|
||||||
import MaterialGuide from '@/components/material-guide';
|
import MaterialGuide from '@/components/material-guide';
|
||||||
import { EventName, OpenSource, PageUrl } from '@/constants/app';
|
import { EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||||
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
import { EmployType, JOB_PAGE_TABS, JobSourceType, SortType } from '@/constants/job';
|
||||||
import JobFragment from '@/fragments/job/base';
|
import JobFragment from '@/fragments/job/base';
|
||||||
import useInviteCode from '@/hooks/use-invite-code';
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
import useLocation from '@/hooks/use-location';
|
import useLocation from '@/hooks/use-location';
|
||||||
import useNavigation from '@/hooks/use-navigation';
|
import useNavigation from '@/hooks/use-navigation';
|
||||||
import { Coordinate } from '@/types/location';
|
import { Coordinate } from '@/types/location';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
import { getWxLocation, isNotNeedAuthorizeLocation, requestLocation } from '@/utils/location';
|
import { getWxLocation, isNotNeedAuthorizeLocation, requestLocation } from '@/utils/location';
|
||||||
import { requestUnreadMessageCount } from '@/utils/message';
|
import { requestUnreadMessageCount } from '@/utils/message';
|
||||||
@ -20,8 +22,7 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
|||||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
import { isNeedCreateMaterial } from '@/utils/user';
|
import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'job';
|
const PREFIX = 'job';
|
||||||
@ -31,17 +32,28 @@ export default function Job() {
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { barHeight, statusBarHeight } = useNavigation();
|
const { barHeight, statusBarHeight } = useNavigation();
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
const [tabType, setTabType] = useState<EmployType>(EmployType.All);
|
const [tabType, setTabType] = useState<JobSourceType>(JobSourceType.All);
|
||||||
const [sortType, setSortType] = useState<SortType>(SortType.RECOMMEND);
|
const [employType, setEmployType] = useState<EmployType>(EmployType.All);
|
||||||
|
const [sortType, setSortType] = useState<SortType>(SortType.CREATE_TIME);
|
||||||
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
||||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||||
latitude: location.latitude,
|
latitude: location.latitude,
|
||||||
longitude: location.longitude,
|
longitude: location.longitude,
|
||||||
});
|
});
|
||||||
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
const [showMaterialGuide, setShowMaterialGuide] = useState(false);
|
||||||
const [showAuthorize, setShowAuthorize] = useState(false);
|
|
||||||
const cityValuesChangedRef = useRef(false);
|
const cityValuesChangedRef = useRef(false);
|
||||||
|
const [openAgreementPopup, setAgreementPopupOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
||||||
|
|
||||||
|
const getLocation = async () => {
|
||||||
|
if (await isNotNeedAuthorizeLocation()) {
|
||||||
|
log('not need authorize location');
|
||||||
|
requestLocation();
|
||||||
|
} else {
|
||||||
|
log('show authorize location dialog');
|
||||||
|
// setShowAuthorize(true);
|
||||||
|
requestLocation(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||||
|
|
||||||
const handleClickCity = useCallback(
|
const handleClickCity = useCallback(
|
||||||
@ -49,6 +61,10 @@ export default function Job() {
|
|||||||
[cityCode]
|
[cityCode]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleClickEmployType = useCallback(type => {
|
||||||
|
setEmployType(type);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleClickSortType = useCallback(
|
const handleClickSortType = useCallback(
|
||||||
async (type: SortType) => {
|
async (type: SortType) => {
|
||||||
if (type === SortType.DISTANCE && (!location.latitude || !location.longitude)) {
|
if (type === SortType.DISTANCE && (!location.latitude || !location.longitude)) {
|
||||||
@ -75,12 +91,19 @@ export default function Job() {
|
|||||||
setCityCode(code);
|
setCityCode(code);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleAfterBindPhone = useCallback(async () => {
|
const handleCancelAgreementPopup = () => {
|
||||||
if (await isNeedCreateMaterial()) {
|
setAgreementPopupOpen(false);
|
||||||
setShowMaterialGuide(true);
|
setAgreementSigned(false);
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
|
getLocation();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleConfirmAgreementPopup = () => {
|
||||||
|
setAgreementPopupOpen(false);
|
||||||
|
setAgreementSigned(true);
|
||||||
|
|
||||||
|
getLocation();
|
||||||
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
Taro.eventCenter.on(EventName.SELECT_CITY, handleCityChange);
|
||||||
return () => {
|
return () => {
|
||||||
@ -96,24 +119,24 @@ export default function Job() {
|
|||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Anchor);
|
||||||
const query = getPageQuery<{ sortType: SortType; c?: string; scene?: string }>();
|
const query = getPageQuery<{ sortType: SortType; c?: string; scene?: string }>();
|
||||||
const type = query.sortType;
|
const type = query.sortType;
|
||||||
if (type === SortType.CREATE_TIME) {
|
if (type === SortType.CREATE_TIME) {
|
||||||
setSortType(type);
|
setSortType(type);
|
||||||
}
|
}
|
||||||
getInviteCodeFromQueryAndUpdate(query);
|
getInviteCodeFromQueryAndUpdate(query);
|
||||||
if (await isNotNeedAuthorizeLocation()) {
|
if (!openAgreementPopup) {
|
||||||
log('not need authorize location');
|
getLocation();
|
||||||
requestLocation();
|
|
||||||
} else {
|
|
||||||
log('show authorize location dialog');
|
|
||||||
setShowAuthorize(true);
|
|
||||||
requestLocation(true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useDidShow(() => requestUnreadMessageCount());
|
useDidShow(() => requestUnreadMessageCount());
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(() => {
|
useShareAppMessage(() => {
|
||||||
if (sortType === SortType.CREATE_TIME) {
|
if (sortType === SortType.CREATE_TIME) {
|
||||||
return {
|
return {
|
||||||
@ -121,11 +144,11 @@ export default function Job() {
|
|||||||
path: getJumpUrl(PageUrl.Job, { sortType, c: inviteCode }),
|
path: getJumpUrl(PageUrl.Job, { sortType, c: inviteCode }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return getCommonShareMessage({ inviteCode });
|
return getCommonShareMessage({ inviteCode, path: PageUrl.Job });
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.JOB}>
|
||||||
<Tabs
|
<Tabs
|
||||||
swipeable
|
swipeable
|
||||||
value={tabType}
|
value={tabType}
|
||||||
@ -134,12 +157,27 @@ export default function Job() {
|
|||||||
style={{ height: barHeight.current, paddingTop: statusBarHeight.current }}
|
style={{ height: barHeight.current, paddingTop: statusBarHeight.current }}
|
||||||
>
|
>
|
||||||
{JOB_PAGE_TABS.map(tab => (
|
{JOB_PAGE_TABS.map(tab => (
|
||||||
<Tabs.TabPane value={tab.type} title={tab.title} key={tab.type}>
|
<Tabs.TabPane
|
||||||
|
value={tab.type}
|
||||||
|
title={
|
||||||
|
<>
|
||||||
|
{tab.type === JobSourceType.BL ? (
|
||||||
|
<div className={`${PREFIX}__tab-icon`}>
|
||||||
|
<Image src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
{tab.title}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
key={tab.type}
|
||||||
|
>
|
||||||
<JobFragment
|
<JobFragment
|
||||||
cityCode={cityCode}
|
cityCode={cityCode}
|
||||||
sortType={sortType}
|
sortType={sortType}
|
||||||
employType={tab.type}
|
sourceType={tab.type}
|
||||||
|
employType={employType}
|
||||||
coordinate={coordinate}
|
coordinate={coordinate}
|
||||||
|
onClickEmployType={handleClickEmployType}
|
||||||
onClickCity={handleClickCity}
|
onClickCity={handleClickCity}
|
||||||
onClickSort={handleClickSortType}
|
onClickSort={handleClickSortType}
|
||||||
/>
|
/>
|
||||||
@ -147,8 +185,12 @@ export default function Job() {
|
|||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
<div>
|
<div>
|
||||||
<LoginGuide disabled={showAuthorize} onAfterBind={handleAfterBindPhone} />
|
|
||||||
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
{showMaterialGuide && <MaterialGuide onClose={() => setShowMaterialGuide(false)} />}
|
||||||
|
<AgreementPopup
|
||||||
|
open={openAgreementPopup}
|
||||||
|
onCancel={handleCancelAgreementPopup}
|
||||||
|
onConfirm={handleConfirmAgreementPopup}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</HomePage>
|
</HomePage>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import { collectEvent } from '@/utils/event';
|
|||||||
import { getMaterialShareMessage, requestProfileDetail, updateProfileStatus } from '@/utils/material';
|
import { getMaterialShareMessage, requestProfileDetail, updateProfileStatus } from '@/utils/material';
|
||||||
import { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import Toast from '@/utils/toast';
|
import Toast from '@/utils/toast';
|
||||||
|
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-material-profile';
|
const PREFIX = 'page-material-profile';
|
||||||
|
|||||||
@ -190,7 +190,7 @@ export default function MaterialUploadVideo() {
|
|||||||
onTitleChange={(newTitle: string) => handleTitleChange(video, newTitle)}
|
onTitleChange={(newTitle: string) => handleTitleChange(video, newTitle)}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{videoList.length < 6 && <MaterialVideoCard videoInfo={TEMP_DATA} onClickUpload={handleClickUpload} isTemp />}
|
{videoList.length < 10 && <MaterialVideoCard videoInfo={TEMP_DATA} onClickUpload={handleClickUpload} isTemp />}
|
||||||
</div>
|
</div>
|
||||||
<SafeBottomPadding />
|
<SafeBottomPadding />
|
||||||
<div className={`${PREFIX}__footer`}>
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
|||||||
@ -1,24 +1,32 @@
|
|||||||
import { Button } from '@tarojs/components';
|
import { Button } from '@tarojs/components';
|
||||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { Dialog } from '@taroify/core';
|
||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import CommonDialog from '@/components/common-dialog';
|
import CommonDialog from '@/components/common-dialog';
|
||||||
import PageLoading from '@/components/page-loading';
|
import PageLoading from '@/components/page-loading';
|
||||||
|
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 } 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 { 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';
|
||||||
|
import { switchRoleType } from '@/utils/app';
|
||||||
import { copy } from '@/utils/common';
|
import { copy } from '@/utils/common';
|
||||||
import { collectEvent } from '@/utils/event';
|
import { collectEvent } from '@/utils/event';
|
||||||
import { requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
import { postPublishJob, requestHasPublishedJob, requestJobDetail } from '@/utils/job';
|
||||||
import { getMaterialShareMessage, requestReadProfile, requestShareProfile } from '@/utils/material';
|
import { getMaterialShareMessage, requestReadProfile, requestShareProfile } from '@/utils/material';
|
||||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||||
@ -66,15 +74,17 @@ export default function MaterialViewPage() {
|
|||||||
const [jobId, setJobId] = useState<string>();
|
const [jobId, setJobId] = useState<string>();
|
||||||
const [errorTips, setErrorTips] = useState<string>('');
|
const [errorTips, setErrorTips] = useState<string>('');
|
||||||
const [publishDialogVisible, setPublishDialogVisible] = useState(false);
|
const [publishDialogVisible, setPublishDialogVisible] = useState(false);
|
||||||
const [certificationDialogVisible, setCertificationDialogVisible] = useState(false);
|
|
||||||
const [noTimeDialogVisible, setNoTimeDialogVisible] = useState(false);
|
const [noTimeDialogVisible, setNoTimeDialogVisible] = useState(false);
|
||||||
const [noVipLimitVisible, setNoVipLimitVisible] = useState(false);
|
const [noVipLimitVisible, setNoVipLimitVisible] = useState(false);
|
||||||
const [vipExpiredVisible, setVipExpiredVisible] = useState(false);
|
const [vipExpiredVisible, setVipExpiredVisible] = useState(false);
|
||||||
const inviteCode = useInviteCode();
|
const inviteCode = useInviteCode();
|
||||||
|
const [showBuy, setShowBuy] = useState(false);
|
||||||
|
const userInfo = useUserInfo();
|
||||||
|
|
||||||
const onDev = useCallback(async () => profile && copy(profile.userId), [profile]);
|
const onDev = useCallback(async () => profile && copy(profile.userId), [profile]);
|
||||||
|
|
||||||
const handleClickContact = useCallback(async () => {
|
const handleClickContact = useCallback(async () => {
|
||||||
|
setShowBuy(false);
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -86,6 +96,16 @@ export default function MaterialViewPage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const jobDetail = await requestJobDetail(jobId);
|
const jobDetail = await requestJobDetail(jobId);
|
||||||
|
if (jobDetail.status !== JobManageStatus.Open) {
|
||||||
|
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||||
|
store.dispatch(cacheJobId(jobId));
|
||||||
|
navigateTo(PageUrl.CertificationStart);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setShowBuy(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const chat = await postCreateChat(toUserId);
|
const chat = await postCreateChat(toUserId);
|
||||||
const jobMessage: IJobMessage = {
|
const jobMessage: IJobMessage = {
|
||||||
id: jobDetail.id,
|
id: jobDetail.id,
|
||||||
@ -115,7 +135,16 @@ export default function MaterialViewPage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [profile, jobId]);
|
}, [profile, jobId]);
|
||||||
|
const handleNext = useCallback(async () => {
|
||||||
|
setShowBuy(false);
|
||||||
|
try {
|
||||||
|
await postPublishJob(jobId!);
|
||||||
|
await handleClickContact();
|
||||||
|
} catch (e) {
|
||||||
|
Toast.error('通告发布失败');
|
||||||
|
collectEvent(CollectEventName.PUBLISH_JOB_FAILED, e);
|
||||||
|
}
|
||||||
|
}, [handleClickContact, jobId]);
|
||||||
const handleClickNoViewTimes = useCallback(() => {
|
const handleClickNoViewTimes = useCallback(() => {
|
||||||
setNoTimeDialogVisible(false);
|
setNoTimeDialogVisible(false);
|
||||||
navigateBack();
|
navigateBack();
|
||||||
@ -126,11 +155,6 @@ export default function MaterialViewPage() {
|
|||||||
redirectTo(PageUrl.CertificationManage);
|
redirectTo(PageUrl.CertificationManage);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleClickGoCertification = useCallback(() => {
|
|
||||||
setCertificationDialogVisible(false);
|
|
||||||
redirectTo(PageUrl.CertificationStart);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const callback = (select: JobManageInfo, source: OpenSource) =>
|
const callback = (select: JobManageInfo, source: OpenSource) =>
|
||||||
source === OpenSource.MaterialViewPage && setJobId(select.id);
|
source === OpenSource.MaterialViewPage && setJobId(select.id);
|
||||||
@ -141,6 +165,8 @@ export default function MaterialViewPage() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
|
switchRoleType(RoleType.Company);
|
||||||
|
|
||||||
const context = getPageQuery<IViewContext | IShareContext>();
|
const context = getPageQuery<IViewContext | IShareContext>();
|
||||||
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
|
getInviteCodeFromQueryAndUpdate(context as BL.Anything);
|
||||||
try {
|
try {
|
||||||
@ -159,9 +185,7 @@ export default function MaterialViewPage() {
|
|||||||
const errorCode = e.errorCode;
|
const errorCode = e.errorCode;
|
||||||
collectEvent(CollectEventName.VIEW_MATERIAL_FAILED, { context, error: e.info?.() || e.message });
|
collectEvent(CollectEventName.VIEW_MATERIAL_FAILED, { context, error: e.info?.() || e.message });
|
||||||
console.error(e);
|
console.error(e);
|
||||||
if (errorCode === RESPONSE_ERROR_CODE.BOSS_NOT_AUTH) {
|
if (errorCode === RESPONSE_ERROR_CODE.NO_PUBLISHED_JOB) {
|
||||||
setCertificationDialogVisible(true);
|
|
||||||
} else if (errorCode === RESPONSE_ERROR_CODE.NO_PUBLISHED_JOB) {
|
|
||||||
setPublishDialogVisible(true);
|
setPublishDialogVisible(true);
|
||||||
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
||||||
setNoTimeDialogVisible(true);
|
setNoTimeDialogVisible(true);
|
||||||
@ -175,8 +199,12 @@ export default function MaterialViewPage() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
useShareAppMessage(async () => {
|
useShareAppMessage(async () => {
|
||||||
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode);
|
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode, jobId);
|
||||||
return shareMessage as BL.Anything;
|
return shareMessage as BL.Anything;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -184,13 +212,6 @@ export default function MaterialViewPage() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PageLoading />
|
<PageLoading />
|
||||||
<CommonDialog
|
|
||||||
content="要查看主播详情,请先完成实人认证"
|
|
||||||
confirm="去认证"
|
|
||||||
visible={certificationDialogVisible}
|
|
||||||
onClose={() => setCertificationDialogVisible(false)}
|
|
||||||
onClick={handleClickGoCertification}
|
|
||||||
/>
|
|
||||||
<CommonDialog
|
<CommonDialog
|
||||||
content="请先发布一个认证通告"
|
content="请先发布一个认证通告"
|
||||||
confirm="去发布"
|
confirm="去发布"
|
||||||
@ -257,6 +278,11 @@ export default function MaterialViewPage() {
|
|||||||
onClose={() => setErrorTips('')}
|
onClose={() => setErrorTips('')}
|
||||||
onClick={() => setErrorTips('')}
|
onClick={() => setErrorTips('')}
|
||||||
/>
|
/>
|
||||||
|
<Dialog open={showBuy} onClose={() => setShowBuy(false)}>
|
||||||
|
<Dialog.Content>
|
||||||
|
<CompanyPublishJobBuy onNext={handleNext} />
|
||||||
|
</Dialog.Content>
|
||||||
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -72,6 +72,7 @@ interface ILoadProps {
|
|||||||
chatId: string;
|
chatId: string;
|
||||||
jobId?: string;
|
jobId?: string;
|
||||||
job?: string;
|
job?: string;
|
||||||
|
initText?: boolean;
|
||||||
material?: string;
|
material?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ export default function MessageChat() {
|
|||||||
const [input, setInput] = useState('');
|
const [input, setInput] = useState('');
|
||||||
const [showMore, setShowMore] = useState(false);
|
const [showMore, setShowMore] = useState(false);
|
||||||
const [chat, setChat] = useState<IChatInfo | null>(null);
|
const [chat, setChat] = useState<IChatInfo | null>(null);
|
||||||
|
const [initText, setInitText] = useState('');
|
||||||
const [reject, setReject] = useState<boolean>(false);
|
const [reject, setReject] = useState<boolean>(false);
|
||||||
const [receiver, setReceiver] = useState<IChatUser | null>(null);
|
const [receiver, setReceiver] = useState<IChatUser | null>(null);
|
||||||
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
const [messages, setMessages] = useState<IChatMessage[]>([]);
|
||||||
@ -100,7 +102,7 @@ export default function MessageChat() {
|
|||||||
const [material, setMaterial] = useState<IMaterialMessage>();
|
const [material, setMaterial] = useState<IMaterialMessage>();
|
||||||
const [scrollItemId, setScrollItemId] = useState<string>();
|
const [scrollItemId, setScrollItemId] = useState<string>();
|
||||||
const scrollToLowerRef = useRef(false);
|
const scrollToLowerRef = useRef(false);
|
||||||
const autoSendRef = useRef({ sendJob: false, sendMaterial: false });
|
const autoSendRef = useRef({ sendJob: false, sendMaterial: false, sendText: false });
|
||||||
const loadMoreRef = useRef(async (chatId: string, currentMessages: IChatMessage[], forceScroll?: boolean) => {
|
const loadMoreRef = useRef(async (chatId: string, currentMessages: IChatMessage[], forceScroll?: boolean) => {
|
||||||
try {
|
try {
|
||||||
const lastMsgId = last(currentMessages)?.msgId;
|
const lastMsgId = last(currentMessages)?.msgId;
|
||||||
@ -167,6 +169,9 @@ export default function MessageChat() {
|
|||||||
) {
|
) {
|
||||||
tips = '今日申请交换联系方式次数已用完,当前每日限制为5次';
|
tips = '今日申请交换联系方式次数已用完,当前每日限制为5次';
|
||||||
duration = 3000;
|
duration = 3000;
|
||||||
|
} else if (errorCode === RESPONSE_ERROR_CODE.CHAT_MSG_SEND_NOT_ALLOW) {
|
||||||
|
tips = '账号已在另一台设备上切换身份,本条消息未发送成功,请在本设备重新切换身份后,再发送消息';
|
||||||
|
duration = 5000;
|
||||||
}
|
}
|
||||||
tips.length > 7 ? Toast.info(tips, duration) : Toast.error(tips, duration);
|
tips.length > 7 ? Toast.info(tips, duration) : Toast.error(tips, duration);
|
||||||
}
|
}
|
||||||
@ -175,6 +180,7 @@ export default function MessageChat() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleClickReject = useCallback(async () => {
|
const handleClickReject = useCallback(async () => {
|
||||||
|
await postAddMessageTimes('message_chat_page');
|
||||||
if (!chat || !receiver || reject) {
|
if (!chat || !receiver || reject) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -274,7 +280,11 @@ export default function MessageChat() {
|
|||||||
}
|
}
|
||||||
job && handleSendJobMessage();
|
job && handleSendJobMessage();
|
||||||
material && handleSendMaterialMessage();
|
material && handleSendMaterialMessage();
|
||||||
}, [chat, job, material, handleSendJobMessage, handleSendMaterialMessage]);
|
if (initText && !autoSendRef.current.sendText) {
|
||||||
|
autoSendRef.current.sendText = true;
|
||||||
|
handleSendMessage({ type: MessageType.Text, content: '你好,想了解下这个岗位' });
|
||||||
|
}
|
||||||
|
}, [chat, job, material, handleSendJobMessage, handleSendMaterialMessage, initText, handleSendMessage]);
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
const query = getPageQuery<ILoadProps>();
|
const query = getPageQuery<ILoadProps>();
|
||||||
@ -305,6 +315,9 @@ export default function MessageChat() {
|
|||||||
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
setScrollItemId(getScrollItemId(last(chatDetail.messages)?.msgId));
|
||||||
parseJob && setJob(parseJob);
|
parseJob && setJob(parseJob);
|
||||||
parseMaterial && setMaterial(parseMaterial);
|
parseMaterial && setMaterial(parseMaterial);
|
||||||
|
if (!parseMaterial && query.initText && watchType === ChatWatchType.AnchorReject) {
|
||||||
|
setInitText('你好,想了解下这个岗位');
|
||||||
|
}
|
||||||
Taro.setNavigationBarTitle({ title: toUserInfo.nickName });
|
Taro.setNavigationBarTitle({ title: toUserInfo.nickName });
|
||||||
setReceiver(toUserInfo);
|
setReceiver(toUserInfo);
|
||||||
setReject(!watchStatus);
|
setReject(!watchStatus);
|
||||||
|
|||||||
@ -7,19 +7,22 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||||||
import HomePage from '@/components/home-page';
|
import HomePage from '@/components/home-page';
|
||||||
import MessageCard from '@/components/message-card';
|
import MessageCard from '@/components/message-card';
|
||||||
import { MessageHelpDialog, MessageNoTimesDialog } from '@/components/message-dialog';
|
import { MessageHelpDialog, MessageNoTimesDialog } from '@/components/message-dialog';
|
||||||
import { APP_TAB_BAR_ID, EventName } from '@/constants/app';
|
import { APP_TAB_BAR_ID, EventName, PageType } from '@/constants/app';
|
||||||
|
import { CollectEventName } from '@/constants/event';
|
||||||
import { REFRESH_CHAT_LIST_TIME } from '@/constants/message';
|
import { REFRESH_CHAT_LIST_TIME } from '@/constants/message';
|
||||||
|
import { MessageSubscribeIds, SubscribeTempId } from '@/constants/subscribe';
|
||||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||||
import useRoleType from '@/hooks/user-role-type';
|
import useRoleType from '@/hooks/user-role-type';
|
||||||
import { MainMessage } from '@/types/message';
|
import { MainMessage } from '@/types/message';
|
||||||
import { logWithPrefix } from '@/utils/common';
|
import { logWithPrefix } from '@/utils/common';
|
||||||
|
import { collectEvent } from '@/utils/event';
|
||||||
import {
|
import {
|
||||||
postAddMessageTimes,
|
postAddMessageTimes,
|
||||||
requestMessageList,
|
requestMessageList,
|
||||||
requestRemainPushTime,
|
requestRemainPushTime,
|
||||||
requestUnreadMessageCount,
|
requestUnreadMessageCount,
|
||||||
} from '@/utils/message';
|
} from '@/utils/message';
|
||||||
|
import { isSubscribeRefused, postSubscribe } from '@/utils/subscribe';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-message';
|
const PREFIX = 'page-message';
|
||||||
@ -58,12 +61,52 @@ export default function Message() {
|
|||||||
|
|
||||||
const handleClickHelp = useCallback(() => setShowHelp(true), []);
|
const handleClickHelp = useCallback(() => setShowHelp(true), []);
|
||||||
|
|
||||||
const handleClickAddMessageTimes = useCallback(async () => {
|
const addMessageTimes = useCallback(async () => {
|
||||||
await postAddMessageTimes('message_page');
|
await postAddMessageTimes('message_page');
|
||||||
const remain = await requestRemainPushTime();
|
const remain = await requestRemainPushTime();
|
||||||
setTimes(remain);
|
setTimes(remain);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const handleClickAddMessageTimes = useCallback(async () => {
|
||||||
|
const [hasRefused, acceptIds] = await isSubscribeRefused(MessageSubscribeIds);
|
||||||
|
if (hasRefused) {
|
||||||
|
await Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content:
|
||||||
|
'您未订阅消息提醒,不能及时获得招聘消息,请前往“设置”,将“新聊天消息”、“未读消息”“面试邀请”均设置为“接收”',
|
||||||
|
showCancel: false,
|
||||||
|
confirmText: '打开设置',
|
||||||
|
});
|
||||||
|
await Taro.openSetting({
|
||||||
|
withSubscriptions: true,
|
||||||
|
});
|
||||||
|
const { subscriptionsSetting: { mainSwitch, itemSettings = {} } = {} } = await Taro.getSetting({
|
||||||
|
withSubscriptions: true,
|
||||||
|
});
|
||||||
|
console.log('subscriptionsSetting:', mainSwitch, itemSettings);
|
||||||
|
const successIds = mainSwitch
|
||||||
|
? MessageSubscribeIds.reduce<SubscribeTempId[]>((acc, id) => {
|
||||||
|
if ((!itemSettings[id] || itemSettings[id] === 'accept') && !acceptIds.includes(id)) {
|
||||||
|
acc.push(id);
|
||||||
|
}
|
||||||
|
return acc;
|
||||||
|
}, [])
|
||||||
|
: [];
|
||||||
|
if (!successIds.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log('successIds:', successIds);
|
||||||
|
collectEvent(CollectEventName.MESSAGE_DEV_LOG, {
|
||||||
|
action: 'subscribe_new_message_reminder',
|
||||||
|
source: 'message_page',
|
||||||
|
successIds,
|
||||||
|
});
|
||||||
|
await postSubscribe(MessageSubscribeIds, successIds);
|
||||||
|
} else {
|
||||||
|
await addMessageTimes();
|
||||||
|
}
|
||||||
|
}, [addMessageTimes]);
|
||||||
|
|
||||||
useDidHide(() => (pageVisibleRef.current = false));
|
useDidHide(() => (pageVisibleRef.current = false));
|
||||||
|
|
||||||
useDidShow(() => {
|
useDidShow(() => {
|
||||||
@ -101,7 +144,7 @@ export default function Message() {
|
|||||||
}, [roleType]);
|
}, [roleType]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HomePage>
|
<HomePage type={PageType.Message}>
|
||||||
<div className={PREFIX}>
|
<div className={PREFIX}>
|
||||||
<div className={HEADER_CLASS}>
|
<div className={HEADER_CLASS}>
|
||||||
<div className={`${HEADER_CLASS}__times`}>
|
<div className={`${HEADER_CLASS}__times`}>
|
||||||
|
|||||||
3
src/pages/partner-share-vip/index.config.ts
Normal file
3
src/pages/partner-share-vip/index.config.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '赠送会员',
|
||||||
|
});
|
||||||
182
src/pages/partner-share-vip/index.less
Normal file
182
src/pages/partner-share-vip/index.less
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
@import '@/styles/variables.less';
|
||||||
|
@import '@/styles/common.less';
|
||||||
|
|
||||||
|
.share-vip {
|
||||||
|
background: #eae5fb;
|
||||||
|
padding-top: 200px;
|
||||||
|
position: relative;
|
||||||
|
padding-bottom: calc(142px + constant(safe-area-inset-bottom));
|
||||||
|
padding-bottom: calc(142px + env(safe-area-inset-bottom));
|
||||||
|
|
||||||
|
&__bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 705px;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__slogan {
|
||||||
|
top: 66px;
|
||||||
|
left: 44px;
|
||||||
|
position: absolute;
|
||||||
|
font-family: 'Alimama ShuHeiTi';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 44px;
|
||||||
|
line-height: 62px;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-highlight {
|
||||||
|
display: inline-block;
|
||||||
|
padding-left: 12px;
|
||||||
|
padding-right: 9px;
|
||||||
|
font-size: 64px;
|
||||||
|
line-height: 62px;
|
||||||
|
background: linear-gradient(87.53deg, #683DE3 0.4%, #39227D 84.55%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
text-fill-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__main {
|
||||||
|
padding-left: 24px;
|
||||||
|
padding-right: 24px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__highlight {
|
||||||
|
color: @blHighlightColor;
|
||||||
|
font-family: 'DIN Alternate';
|
||||||
|
padding: 0 8px;
|
||||||
|
font-weight: 700;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__block {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
padding: 68px 32px 44px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__h1 {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #1d2129;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
margin-top: 32px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
background: #ffd236;
|
||||||
|
border-radius: 50%;
|
||||||
|
position: absolute;
|
||||||
|
left: -6px;
|
||||||
|
top: -3px;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__body {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 28px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: @blColor;
|
||||||
|
|
||||||
|
&.grey {
|
||||||
|
color: @blColorG2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__title {
|
||||||
|
margin-left: 48px;
|
||||||
|
margin-right: 48px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32px;
|
||||||
|
line-height: 80px;
|
||||||
|
height: 80px;
|
||||||
|
transform: translateY(50%);
|
||||||
|
background: #ffd236;
|
||||||
|
box-shadow: 0px 12px 0px #ffa35d;
|
||||||
|
border-radius: 60px;
|
||||||
|
color: #1d2129;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__service {
|
||||||
|
.button(@height: 72px; @width: 384px; @fontSize: 28px; @fontWeight: 400; @borderRadius: 44px; @highlight: 0);
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__tip {
|
||||||
|
margin-top: 24px;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
|
width: 100vw;
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 12px 32px;
|
||||||
|
padding-bottom: calc(constant(safe-area-inset-bottom) + 12px);
|
||||||
|
/* 兼容 iOS < 11.2 */
|
||||||
|
padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
|
||||||
|
/* 兼容 iOS >= 11.2 */
|
||||||
|
box-shadow: 0px -4px 20px 0px #00000014;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
box-sizing: border-box;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__download-button {
|
||||||
|
flex: 1 1;
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px; @highlight: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
&__share-button {
|
||||||
|
flex: 2 2;
|
||||||
|
width: 406px;
|
||||||
|
.button(@height: 88px; @fontSize: 32px; @fontWeight: 500; @borderRadius: 44px;);
|
||||||
|
margin-left: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#posterCanvas {
|
||||||
|
position: fixed;
|
||||||
|
bottom: -99999px;
|
||||||
|
left: -99999px;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
191
src/pages/partner-share-vip/index.tsx
Normal file
191
src/pages/partner-share-vip/index.tsx
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
import { Button, Canvas, Image } from '@tarojs/components';
|
||||||
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
|
import useInviteCode from '@/hooks/use-invite-code';
|
||||||
|
import { generateMembershipCoupon, getCouponQrCode } from '@/utils/coupon';
|
||||||
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
|
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const PREFIX = 'share-vip';
|
||||||
|
|
||||||
|
export default function PartnerShareVip() {
|
||||||
|
const inviteCode = useInviteCode();
|
||||||
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
useShareAppMessage(async () => {
|
||||||
|
console.log('Partner inviteCode', 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',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const getQrcode = async () => {
|
||||||
|
try {
|
||||||
|
const { code } = await generateMembershipCoupon();
|
||||||
|
const data = await getCouponQrCode(code);
|
||||||
|
const base64 = Taro.arrayBufferToBase64(data);
|
||||||
|
return `data:image/png;base64,${base64}`;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取二维码失败', error);
|
||||||
|
Taro.showToast({ title: '获取二维码失败', icon: 'none' });
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const saveCanvasToTempFile = (): Promise<string> => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
||||||
|
query.fields({ node: true }).exec(async res => {
|
||||||
|
const canvas = res[0].node;
|
||||||
|
const tempFilePath = await Taro.canvasToTempFilePath({
|
||||||
|
canvas,
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
width: 1500, // 实际绘制宽度
|
||||||
|
height: 2668, // 实际绘制高度
|
||||||
|
destWidth: 750, // 目标显示宽度
|
||||||
|
destHeight: 1334, // 目标显示高度
|
||||||
|
fileType: 'png',
|
||||||
|
});
|
||||||
|
|
||||||
|
resolve(tempFilePath.tempFilePath);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error('保存 Canvas 到临时文件失败', error);
|
||||||
|
Taro.showToast({ title: '保存 Canvas 失败', icon: 'none' });
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const drawCanvas = (qrCode: string): Promise<string> => {
|
||||||
|
const query = Taro.createSelectorQuery().select('#posterCanvas');
|
||||||
|
return new Promise(resolve => {
|
||||||
|
query.fields({ node: true, size: true }).exec(async res => {
|
||||||
|
const canvas = res[0].node;
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
|
canvas.width = 550 * 2;
|
||||||
|
canvas.height = 918 * 2;
|
||||||
|
ctx.scale(2, 2);
|
||||||
|
|
||||||
|
// 绘制背景图片
|
||||||
|
const bgImage = canvas.createImage();
|
||||||
|
const poster = 'https://publiccdn.neighbourhood.com.cn/img/share-coupon-poster2.png';
|
||||||
|
bgImage.src = poster;
|
||||||
|
bgImage.onload = () => {
|
||||||
|
ctx.drawImage(bgImage, 0, 0, 550, 918);
|
||||||
|
|
||||||
|
const qrCodeImage = canvas.createImage();
|
||||||
|
qrCodeImage.src = qrCode; // 假设 getQrcode() 返回的是二维码图片的路径
|
||||||
|
qrCodeImage.onload = () => {
|
||||||
|
ctx.drawImage(qrCodeImage, 196, 600, 180, 160); // 绘制二维码,位置和大小
|
||||||
|
saveCanvasToTempFile().then(tempPath => {
|
||||||
|
resolve(tempPath);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bgImage.onerror = err => {
|
||||||
|
console.error(err);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const savePoster = async () => {
|
||||||
|
Taro.showLoading({ title: '正在生成海报' });
|
||||||
|
const qrCode = await getQrcode();
|
||||||
|
const filePath = await drawCanvas(qrCode);
|
||||||
|
Taro.hideLoading();
|
||||||
|
|
||||||
|
const res = await Taro.getSetting();
|
||||||
|
const hasPermission = res.authSetting['scope.writePhotosAlbum'];
|
||||||
|
if (hasPermission === false) {
|
||||||
|
Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '需要访问相册权限才能保存图片,请前往设置开启权限',
|
||||||
|
showCancel: false,
|
||||||
|
success() {
|
||||||
|
Taro.openSetting();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
await Taro.authorize({ scope: 'scope.writePhotosAlbum' });
|
||||||
|
await Taro.saveImageToPhotosAlbum({ filePath });
|
||||||
|
Taro.showToast({ title: '保存成功', icon: 'success' });
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
Taro.showToast({ title: '保存失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={PREFIX}>
|
||||||
|
<Image
|
||||||
|
src="https://publiccdn.neighbourhood.com.cn/img/partner-share-vip-bg.png"
|
||||||
|
className={`${PREFIX}__bg`}
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<div className={`${PREFIX}__slogan`}>
|
||||||
|
<div>
|
||||||
|
会员可每日<div className={`${PREFIX}__slogan-highlight`}>免费查看</div>
|
||||||
|
</div>
|
||||||
|
<div>通告联系方式</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__main`}>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>赠送会员</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法一:</div>
|
||||||
|
<div className={`${PREFIX}__body`}>点击下方"立即赠送"即可分享赠送卡片,对方点击卡片即可领取</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>方法二:</div>
|
||||||
|
<div className={`${PREFIX}__body`}>点击"朋友圈海报"获得图片,分享到朋友圈,对方扫码即可领取</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>赠送规则</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>规则一:</div>
|
||||||
|
<div>每次分享的赠送链接或者图片在7天内有效</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>规则二:</div>
|
||||||
|
<div>每个用户一周最多只能领取一次会员</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={`${PREFIX}__block`}>
|
||||||
|
<div className={`${PREFIX}__title`}>分享建议</div>
|
||||||
|
<div className={`${PREFIX}__card`}>
|
||||||
|
<div className={`${PREFIX}__body`}>
|
||||||
|
<div className={`${PREFIX}__h1`}>建议一:</div>
|
||||||
|
<div>每周在朋友圈或者群中分享一次,效果最佳 可以写明:新会员来啦</div>
|
||||||
|
<div className={`${PREFIX}__h1`}>建议二:</div>
|
||||||
|
<div>分享得越多,邀请的人会越多,也会更活跃,更容易获得分成</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Canvas id="posterCanvas" canvas-id="posterCanvas" type="2d" style="width: 750px; height: 1334px;" />
|
||||||
|
|
||||||
|
<div className={`${PREFIX}__footer`}>
|
||||||
|
<Button className={`${PREFIX}__download-button`} onClick={savePoster}>
|
||||||
|
朋友圈海报
|
||||||
|
</Button>
|
||||||
|
<Button className={`${PREFIX}__share-button`} openType="share">
|
||||||
|
立即赠送
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { useShareAppMessage } from '@tarojs/taro';
|
import Taro, { useShareAppMessage } from '@tarojs/taro';
|
||||||
|
|
||||||
import { Tabs } from '@taroify/core';
|
import { Tabs } from '@taroify/core';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
@ -6,6 +6,7 @@ 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 { getCommonShareMessage } from '@/utils/share';
|
import { getCommonShareMessage } from '@/utils/share';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
@ -18,9 +19,29 @@ export default function Partner() {
|
|||||||
const handleChange = v => {
|
const handleChange = v => {
|
||||||
setTab(v);
|
setTab(v);
|
||||||
};
|
};
|
||||||
useShareAppMessage(() => {
|
|
||||||
|
Taro.showShareMenu({
|
||||||
|
withShareTicket: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
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 getCommonShareMessage({
|
||||||
|
useCapture: false,
|
||||||
|
inviteCode,
|
||||||
|
title: '播络专业主播招聘平台招募合伙人',
|
||||||
|
path: PageUrl.Partner,
|
||||||
|
imageUrl: 'https://publiccdn.neighbourhood.com.cn/img/share-partner.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('加载失败请重试')} />
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,88 +1,94 @@
|
|||||||
import { Image } from '@tarojs/components';
|
import { Image } from '@tarojs/components';
|
||||||
import { useLoad } from '@tarojs/taro';
|
import { useLoad } from '@tarojs/taro';
|
||||||
|
|
||||||
import { useState } from 'react';
|
// import { useEffect, useState } from 'react';
|
||||||
|
// import { AgreementPopup } from '@/components/agreement-popup';
|
||||||
import { AgreementPopup } from '@/components/agreement-popup';
|
// import Slogan from '@/components/slogan';
|
||||||
import Slogan from '@/components/slogan';
|
// import { PageUrl, RoleType } from '@/constants/app';
|
||||||
import { PageUrl, RoleType } from '@/constants/app';
|
// import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
||||||
import { ANCHOR_TAB_LIST, COMPANY_TAB_LIST } from '@/hooks/use-config';
|
// import store from '@/store';
|
||||||
import store from '@/store';
|
// import { changeHomePage } from '@/store/actions';
|
||||||
import { changeHomePage } from '@/store/actions';
|
import { RoleType } from '@/constants/app';
|
||||||
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
import { getRoleType, switchDefaultTab, switchRoleType } from '@/utils/app';
|
||||||
import { switchTab } from '@/utils/route';
|
// import { switchTab } from '@/utils/route';
|
||||||
import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
// import { getAgreementSigned, setAgreementSigned } from '@/utils/user';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const PREFIX = 'page-start';
|
const PREFIX = 'page-start';
|
||||||
|
|
||||||
export default function Start() {
|
export default function Start() {
|
||||||
const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
// const [open, setOpen] = useState(typeof getAgreementSigned() !== 'boolean');
|
||||||
const mode = getRoleType();
|
const mode = getRoleType();
|
||||||
useLoad(() => {
|
useLoad(() => {
|
||||||
switchDefaultTab();
|
if (!mode) {
|
||||||
|
switchRoleType(RoleType.Anchor).then(() => {
|
||||||
|
switchDefaultTab();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
switchDefaultTab();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const handleAnchor = async () => {
|
// const handleAnchor = async () => {
|
||||||
await switchRoleType(RoleType.Anchor);
|
// await switchRoleType(RoleType.Anchor);
|
||||||
store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type));
|
// store.dispatch(changeHomePage(ANCHOR_TAB_LIST[0].type));
|
||||||
await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl);
|
// await switchTab(ANCHOR_TAB_LIST[0].pagePath as PageUrl);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const handleCompany = async () => {
|
// const handleCompany = async () => {
|
||||||
await switchRoleType(RoleType.Company);
|
// await switchRoleType(RoleType.Company);
|
||||||
store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type));
|
// store.dispatch(changeHomePage(COMPANY_TAB_LIST[0].type));
|
||||||
await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
// await switchTab(COMPANY_TAB_LIST[0].pagePath as PageUrl);
|
||||||
};
|
// };
|
||||||
|
|
||||||
const handleCancel = () => {
|
// const handleCancel = () => {
|
||||||
setOpen(false);
|
// setOpen(false);
|
||||||
setAgreementSigned(false);
|
// setAgreementSigned(false);
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
const handleConfirm = () => {
|
// const handleConfirm = () => {
|
||||||
setOpen(false);
|
// setOpen(false);
|
||||||
setAgreementSigned(true);
|
// setAgreementSigned(true);
|
||||||
};
|
// };
|
||||||
return (
|
return (
|
||||||
<div className={`${PREFIX} ${mode ? '' : 'color-bg'}`}>
|
<div className={`${PREFIX}`}>
|
||||||
{mode && (
|
{/*{mode && (*/}
|
||||||
<div className={`${PREFIX}__app`}>
|
<div className={`${PREFIX}__app`}>
|
||||||
<Image className={`${PREFIX}__icon`} mode="aspectFit" src={require('@/statics/svg/slogan.svg')} />
|
<Image className={`${PREFIX}__icon`} mode="aspectFit" src={require('@/statics/svg/slogan.svg')} />
|
||||||
<div className={`${PREFIX}__text`}>每天推荐海量高薪通告 </div>
|
<div className={`${PREFIX}__text`}>每天推荐海量高薪通告 </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
{/*)}*/}
|
||||||
{!mode && (
|
{!mode && (
|
||||||
<>
|
<>
|
||||||
<div className={`${PREFIX}__role-app`}>
|
{/*<div className={`${PREFIX}__role-app`}>*/}
|
||||||
<div className={`${PREFIX}__greet`}>Hi,很高兴见到你</div>
|
{/* <div className={`${PREFIX}__greet`}>Hi,很高兴见到你</div>*/}
|
||||||
<div className={`${PREFIX}__title`}>请选择您的身份</div>
|
{/* <div className={`${PREFIX}__title`}>请选择您的身份</div>*/}
|
||||||
<div className={`${PREFIX}__card`} onClick={handleAnchor}>
|
{/* <div className={`${PREFIX}__card`} onClick={handleAnchor}>*/}
|
||||||
<Image
|
{/* <Image*/}
|
||||||
className={`${PREFIX}__avatar anchor`}
|
{/* className={`${PREFIX}__avatar anchor`}*/}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/avatar_f.png"
|
{/* src="https://publiccdn.neighbourhood.com.cn/img/avatar_f.png"*/}
|
||||||
mode="aspectFill"
|
{/* mode="aspectFill"*/}
|
||||||
/>
|
{/* />*/}
|
||||||
<div className={`${PREFIX}__content`}>
|
{/* <div className={`${PREFIX}__content`}>*/}
|
||||||
<div className="title">我是主播</div>
|
{/* <div className="title">我是主播</div>*/}
|
||||||
<div className="desc">我要找工作</div>
|
{/* <div className="desc">我要找工作</div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />
|
{/* <Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<div className={`${PREFIX}__card`} onClick={handleCompany}>
|
{/* <div className={`${PREFIX}__card`} onClick={handleCompany}>*/}
|
||||||
<Image
|
{/* <Image*/}
|
||||||
className={`${PREFIX}__avatar company`}
|
{/* className={`${PREFIX}__avatar company`}*/}
|
||||||
src="https://publiccdn.neighbourhood.com.cn/img/avatar_m.png"
|
{/* src="https://publiccdn.neighbourhood.com.cn/img/avatar_m.png"*/}
|
||||||
mode="aspectFill"
|
{/* mode="aspectFill"*/}
|
||||||
/>
|
{/* />*/}
|
||||||
<div className={`${PREFIX}__content`}>
|
{/* <div className={`${PREFIX}__content`}>*/}
|
||||||
<div className="title">我是企业</div>
|
{/* <div className="title">我是企业</div>*/}
|
||||||
<div className="desc">我要招主播</div>
|
{/* <div className="desc">我要招主播</div>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
<Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />
|
{/* <Image src={require('@/statics/svg/arrow-right.svg')} mode="aspectFill" className={`${PREFIX}__arrow`} />*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</div>
|
{/*</div>*/}
|
||||||
<Slogan />
|
{/*<Slogan />*/}
|
||||||
<AgreementPopup open={open} onCancel={handleCancel} onConfirm={handleConfirm} />
|
{/*<AgreementPopup open={open} onCancel={handleCancel} onConfirm={handleConfirm} />*/}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user