Compare commits
11 Commits
260e543fe6
...
trunk
| Author | SHA1 | Date | |
|---|---|---|---|
| f2e7fd9d85 | |||
| 285db3f445 | |||
| 763a6245d2 | |||
| 2cb532c3d7 | |||
| 6a2c94c7cf | |||
| 34f9c8d0e6 | |||
| 943f921e56 | |||
| 33ef940d6e | |||
| 61336b5282 | |||
| 10e7f39c92 | |||
| 1c1bb146fc |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
dist/
|
||||
dist-dev/
|
||||
deploy_versions/
|
||||
.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-辅助函数
|
||||
export default defineConfig(async (merge, _env: ConfigEnv) => {
|
||||
const baseConfig: UserConfigExport = {
|
||||
@ -25,13 +39,15 @@ export default defineConfig(async (merge, _env: ConfigEnv) => {
|
||||
828: 1.81 / 2
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: ['@tarojs/plugin-html'],
|
||||
outputRoot: process.env.OUTPUT_ROOT || 'dist',
|
||||
plugins: [['@tarojs/plugin-mini-ci', CIPluginOpt()], '@tarojs/plugin-html'],
|
||||
// plugins: ['@tarojs/plugin-html', MockPlugin],
|
||||
defineConstants: {
|
||||
'process.env.BRAND': JSON.stringify(process.env.BRAND),
|
||||
},
|
||||
copy: {
|
||||
patterns: [
|
||||
{from: 'project.config.dev.json',to: 'dist-dev/project.config.json'},
|
||||
],
|
||||
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"
|
||||
},
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"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}'"
|
||||
"build:weapp": "BRAND=prod taro build --type weapp",
|
||||
"build:dev:weapp": "BRAND=dev OUTPUT_ROOT=dist-dev taro build --type weapp --upload",
|
||||
"dev:weapp": "BRAND=prod npm run build:weapp -- --watch",
|
||||
"dev:dev:weapp": "BRAND=dev OUTPUT_ROOT=dist-dev taro build --type weapp --watch"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 3 versions",
|
||||
@ -76,6 +57,7 @@
|
||||
"@babel/core": "^7.8.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
|
||||
"@tarojs/cli": "4.0.9",
|
||||
"@tarojs/plugin-mini-ci": "^4.1.5",
|
||||
"@tarojs/plugin-mock": "^0.0.9",
|
||||
"@tarojs/taro-loader": "4.0.9",
|
||||
"@tarojs/test-utils-react": "^0.1.1",
|
||||
@ -95,6 +77,7 @@
|
||||
"eslint-plugin-react-hooks": "^4.2.0",
|
||||
"jest": "^29.3.1",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"miniprogram-ci": "^2.1.14",
|
||||
"postcss": "^8.4.18",
|
||||
"prettier": "^3.3.1",
|
||||
"react-refresh": "^0.11.0",
|
||||
@ -110,5 +93,5 @@
|
||||
"@tarojs/binding"
|
||||
]
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
|
||||
}
|
||||
|
||||
5985
pnpm-lock.yaml
generated
5985
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": {}
|
||||
}
|
||||
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;
|
||||
@ -1,6 +1,6 @@
|
||||
@import '@/styles/common.less';
|
||||
@import '@/styles/variables.less';
|
||||
|
||||
|
||||
.job-card {
|
||||
&__container {
|
||||
width: 100%;
|
||||
@ -11,6 +11,16 @@
|
||||
border-radius: 16px;
|
||||
background: #FFFFFF;
|
||||
margin-bottom: 24px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
&__mask {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
&__header {
|
||||
@ -160,4 +170,4 @@
|
||||
color: @blColorG2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,13 +5,13 @@ import React, { useCallback } from 'react';
|
||||
|
||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||
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 { EMPLOY_TYPE_TITLE_MAP, EmployType } from '@/constants/job';
|
||||
import { JobInfo } from '@/types/job';
|
||||
import { LocationInfo } from '@/types/location';
|
||||
// import { LocationInfo } from '@/types/location';
|
||||
import { getJobSalary, getJobTitle } from '@/utils/job';
|
||||
import { calcDistance } from '@/utils/location';
|
||||
// import { calcDistance } from '@/utils/location';
|
||||
import { navigateTo, redirectTo } from '@/utils/route';
|
||||
|
||||
import './index.less';
|
||||
@ -23,16 +23,16 @@ interface IProps {
|
||||
}
|
||||
|
||||
const PREFIX = 'job-card';
|
||||
const getCityDes = (location: LocationInfo) => {
|
||||
if (!location) {
|
||||
return '';
|
||||
}
|
||||
let des = CITY_CODE_TO_NAME_MAP.get(location.cityCode);
|
||||
if (location.countyCode) {
|
||||
des += `-${COUNTY_CODE_TO_NAME_MAP.get(location.countyCode)}`;
|
||||
}
|
||||
return des;
|
||||
};
|
||||
// const getCityDes = (location: LocationInfo) => {
|
||||
// if (!location) {
|
||||
// return '';
|
||||
// }
|
||||
// let des = CITY_CODE_TO_NAME_MAP.get(location.cityCode);
|
||||
// if (location.countyCode) {
|
||||
// des += `-${COUNTY_CODE_TO_NAME_MAP.get(location.countyCode)}`;
|
||||
// }
|
||||
// return des;
|
||||
// };
|
||||
|
||||
function JobCard(props: IProps) {
|
||||
const { className, data, redirectOpen } = props;
|
||||
@ -45,7 +45,7 @@ function JobCard(props: IProps) {
|
||||
publisher,
|
||||
publisherAvatar,
|
||||
jobLocation,
|
||||
distance,
|
||||
// distance,
|
||||
isAuthed = false,
|
||||
} = data;
|
||||
|
||||
@ -84,12 +84,12 @@ function JobCard(props: IProps) {
|
||||
<div className={`${PREFIX}__summary`}>{jobDescription || sourceText}</div>
|
||||
<div className={`${PREFIX}__distance-wrapper`}>
|
||||
<div className={`${PREFIX}__detailed-address`}>{jobLocation?.address}</div>
|
||||
{distance && (
|
||||
<>
|
||||
<Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />
|
||||
<div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>
|
||||
</>
|
||||
)}
|
||||
{/*{distance && (*/}
|
||||
{/* <>*/}
|
||||
{/* <Image className={`${PREFIX}__distance-icon`} src={require('@/statics/svg/location.svg')} />*/}
|
||||
{/* <div className={`${PREFIX}__distance`}>{calcDistance(distance)}</div>*/}
|
||||
{/* </>*/}
|
||||
{/*)}*/}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__divider`} />
|
||||
@ -102,8 +102,9 @@ function JobCard(props: IProps) {
|
||||
/>
|
||||
<div className={`${PREFIX}__publisher-name`}>{publisher}</div>
|
||||
</div>
|
||||
<div className={`${PREFIX}__city`}>{getCityDes(jobLocation)}</div>
|
||||
{/*<div className={`${PREFIX}__city`}>{getCityDes(jobLocation)}</div>*/}
|
||||
</div>
|
||||
{data.isRead && <div className={`${PREFIX}__mask`} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
import { List, PullRefresh } from '@taroify/core';
|
||||
import classNames from 'classnames';
|
||||
import { isEqual } from 'lodash-es';
|
||||
@ -5,6 +7,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
|
||||
import JobCard from '@/components/job-card';
|
||||
import ListPlaceholder from '@/components/list-placeholder';
|
||||
import { EventName } from '@/constants/app';
|
||||
import { JobType, EmployType, SortType } from '@/constants/job';
|
||||
import { JobInfo, GetJobsRequest } from '@/types/job';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
@ -35,6 +38,7 @@ function JobList(props: IJobListProps) {
|
||||
visible = true,
|
||||
cityCode = 'ALL',
|
||||
category = JobType.All,
|
||||
sourceType,
|
||||
employType = EmployType.All,
|
||||
sortType = SortType.RECOMMEND,
|
||||
isFollow = false,
|
||||
@ -57,6 +61,23 @@ function JobList(props: IJobListProps) {
|
||||
const prevRequestProps = useRef<IRequestProps>({});
|
||||
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 () => {
|
||||
log('start pull refresh');
|
||||
try {
|
||||
@ -108,12 +129,20 @@ function JobList(props: IJobListProps) {
|
||||
onListEmptyRef.current = onListEmpty;
|
||||
}, [onListEmpty]);
|
||||
|
||||
useEffect(() => {
|
||||
Taro.eventCenter.on(EventName.VIEW_JOB_SUCCESS, handleReadJob);
|
||||
return () => {
|
||||
Taro.eventCenter.off(EventName.VIEW_JOB_SUCCESS, handleReadJob);
|
||||
};
|
||||
}, [handleReadJob]);
|
||||
|
||||
useEffect(() => {
|
||||
log('request params changed');
|
||||
requestProps.current = {
|
||||
category,
|
||||
cityCode,
|
||||
employType,
|
||||
sourceType,
|
||||
sortType,
|
||||
isFollow,
|
||||
isOwner,
|
||||
@ -128,6 +157,7 @@ function JobList(props: IJobListProps) {
|
||||
}, [
|
||||
category,
|
||||
cityCode,
|
||||
sourceType,
|
||||
employType,
|
||||
sortType,
|
||||
isFollow,
|
||||
@ -176,7 +206,7 @@ function JobList(props: IJobListProps) {
|
||||
}
|
||||
};
|
||||
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}`);
|
||||
|
||||
|
||||
@ -39,9 +39,7 @@ function JoinEntry({ onBindSuccess }: JoinEntryProps) {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
{visible && (
|
||||
<LoginDialog disableCheck onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />
|
||||
)}
|
||||
{visible && <LoginDialog onCancel={() => setVisible(false)} onSuccess={onBindSuccess} needPhone={needPhone} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@ -8,7 +8,51 @@
|
||||
background: #6d3df5;
|
||||
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 {
|
||||
@ -28,20 +72,7 @@
|
||||
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 {
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
|
||||
@ -144,24 +144,37 @@ export default function PartnerKanban({ simple }: PartnerKanbanProps) {
|
||||
useEffect(() => {
|
||||
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 (
|
||||
<div className={`${PREFIX} ${simple ? `${PREFIX}__simple` : ''}`}>
|
||||
<div className={PREFIX}>
|
||||
<Image
|
||||
className={`${PREFIX}__bg`}
|
||||
src="https://publiccdn.neighbourhood.com.cn/img/partner_bg.png"
|
||||
mode="aspectFill"
|
||||
/>
|
||||
<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}__title`}>总收益(元)</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>
|
||||
</div>
|
||||
{!simple && (
|
||||
<div className={`${PREFIX}__buttons`}>
|
||||
<Button className={`${PREFIX}__withdraw`} onClick={handleViewWithdraw}>
|
||||
提现
|
||||
</Button>
|
||||
<Button className={`${PREFIX}__record`} onClick={handleNavigateRecord}>
|
||||
提现记录
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<div className={`${PREFIX}__buttons`}>
|
||||
<Button className={`${PREFIX}__withdraw`} onClick={handleViewWithdraw}>
|
||||
提现
|
||||
</Button>
|
||||
<Button className={`${PREFIX}__record`} onClick={handleNavigateRecord}>
|
||||
提现记录
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
{!simple && <TipDialog open={tipOpen} onClose={handleTipClose} />}
|
||||
{!simple && (
|
||||
<WithdrawDialog
|
||||
count={Math.min(Number(formatMoney(stats.availableBalance)), 200)}
|
||||
open={withdrawOpen}
|
||||
onClose={handleWithdrawClose}
|
||||
/>
|
||||
)}
|
||||
<TipDialog open={tipOpen} onClose={handleTipClose} />
|
||||
<WithdrawDialog
|
||||
count={Math.min(Number(formatMoney(stats.availableBalance)), 200)}
|
||||
open={withdrawOpen}
|
||||
onClose={handleWithdrawClose}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -226,6 +226,20 @@
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
&__hint {
|
||||
font-size: 24px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
color: @blColorG1;
|
||||
margin-top: 24px;
|
||||
|
||||
.highlight {
|
||||
color: @blHighlightColor;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ============================================= 群 ================================================= //
|
||||
@ -654,6 +668,11 @@
|
||||
&.highlight {
|
||||
color: @blHighlightColor;
|
||||
}
|
||||
|
||||
.highlight-span {
|
||||
color: @blHighlightColor;
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
&__button {
|
||||
|
||||
@ -99,12 +99,8 @@ export function CompanyPublishJobDialog(props: IProps) {
|
||||
|
||||
const handleNext = useCallback(async () => {
|
||||
onClose(true);
|
||||
if (userInfo.bossAuthStatus) {
|
||||
navigateTo(PageUrl.JobPublish);
|
||||
} else {
|
||||
navigateTo(PageUrl.CertificationStart);
|
||||
}
|
||||
}, [userInfo, onClose]);
|
||||
navigateTo(PageUrl.JobPublish);
|
||||
}, [onClose]);
|
||||
|
||||
useEffect(() => {
|
||||
initRef.current = async () => {
|
||||
|
||||
@ -26,53 +26,51 @@ interface Item {
|
||||
title: string;
|
||||
price: string;
|
||||
amt: number;
|
||||
contents: { content: string; highlight?: boolean }[];
|
||||
contents: { content: string; highlight?: boolean; inlineHighlight?: string }[];
|
||||
badge?: string;
|
||||
}
|
||||
|
||||
const LIST: Item[] = [
|
||||
// {
|
||||
// id: ProductSpecId.BOSS_VIP_NEW_1,
|
||||
// title: '展示一周',
|
||||
// price: '480播豆',
|
||||
// amt: 48,
|
||||
// badge: '限时体验',
|
||||
// contents: [
|
||||
// { content: '-通告每日优先展示' },
|
||||
// { content: '-每天可查看20个主播详情' },
|
||||
// { content: '-每天可主动联系10个主播' },
|
||||
// // { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
||||
// { content: '-有效期一周' },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
id: ProductSpecId.BOSS_VIP_NEW_1,
|
||||
title: '展示一周',
|
||||
id: ProductSpecId.BOSS_VIP_NEW_2,
|
||||
title: '推荐一月',
|
||||
price: '480播豆',
|
||||
amt: 48,
|
||||
badge: '限时体验',
|
||||
contents: [
|
||||
{ content: '-1个通告' },
|
||||
{ content: '-每天可查看20个主播详情' },
|
||||
{ content: '-每天可自主联系10个主播' },
|
||||
// { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
||||
{ content: '-有效期一周' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: ProductSpecId.BOSS_VIP_NEW_2,
|
||||
title: '展示一月',
|
||||
price: '960播豆',
|
||||
amt: 96,
|
||||
badge: '五折',
|
||||
contents: [
|
||||
{ content: '-1个通告' },
|
||||
{ content: '-每天可查看20个主播详情' },
|
||||
{ content: '-每天可自主联系10个主播' },
|
||||
{ content: '-通告每日优先展示', highlight: true },
|
||||
{ content: '-每天可查看20个主播详情,', inlineHighlight: '可主动联系10个' },
|
||||
// { content: '-播络可代为联系20个主播(高成功率)', highlight: true },
|
||||
{ content: '-有效期一个月' },
|
||||
],
|
||||
},
|
||||
// {
|
||||
// id: ProductSpecId.BOSS_VIP_NEW_3,
|
||||
// title: '季会员',
|
||||
// price: '2680播豆',
|
||||
// amt: 268,
|
||||
// badge: '7折',
|
||||
// contents: [
|
||||
// { content: '-1个通告' },
|
||||
// { content: '-每天可查看20个主播详情' },
|
||||
// { content: '-每天可自主联系10个主播' },
|
||||
// { content: '-播络可代为联系60个主播(高成功率)', highlight: true },
|
||||
// { content: '-有效期3个月' },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
id: ProductSpecId.BOSS_VIP_NEW_3,
|
||||
title: '推荐一季',
|
||||
price: '960播豆',
|
||||
amt: 96,
|
||||
badge: '6.7折',
|
||||
contents: [
|
||||
{ content: '-通告每日优先展示', highlight: true },
|
||||
{ content: '-每天可查看20个主播详情', inlineHighlight: '可主动联系10个' },
|
||||
// { content: '-播络可代为联系60个主播(高成功率)', highlight: true },
|
||||
{ content: '-有效期一个季度' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const subscribe = async () => {
|
||||
@ -161,6 +159,7 @@ export default function CompanyPublishJobBuy(props: IProps) {
|
||||
key={i.content}
|
||||
>
|
||||
{i.content}
|
||||
{i.inlineHighlight && <div className="highlight-span">{i.inlineHighlight}</div>}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@ -152,6 +152,9 @@ export default function JobBuy(props: IProps) {
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className={`${PREFIX}__job-buy__hint`}>
|
||||
注:日会员有效期为 <div className="highlight">支付后24小时</div>
|
||||
</div>
|
||||
<Button className={`${PREFIX}__job-buy__button`} onClick={handleBuy}>
|
||||
{`支付 ${selectItem.amt} 元`}
|
||||
</Button>
|
||||
|
||||
@ -36,7 +36,7 @@ interface CityOption extends ISelectOption<CityValue> {
|
||||
const PREFIX = 'user-batch-publish';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
const SERVICE_ILLUSTRATE = `服务方式:帮您把招聘需求发到众多同城合作主播群
|
||||
群发次数:每日1次,连发3天
|
||||
群发次数:杭州、广州发3次,其他城市1次
|
||||
内容要求:仅限带货主播招聘需求,其他不发
|
||||
主播联系:内容中留招聘方联系方式,主播直接联系`;
|
||||
const cityValues: CityValue[] = [
|
||||
|
||||
@ -24,6 +24,7 @@ export enum EventName {
|
||||
SELECT_MY_PUBLISH_JOB = 'select_my_publish_job',
|
||||
EXIT_CHAT_PAGE = 'exit_chat_page',
|
||||
VIEW_MATERIAL_SUCCESS = 'view_material_success',
|
||||
VIEW_JOB_SUCCESS = 'view_job_success',
|
||||
}
|
||||
|
||||
export enum OpenSource {
|
||||
@ -75,6 +76,7 @@ export enum PageUrl {
|
||||
Partner = 'pages/partner/index',
|
||||
WithdrawRecord = 'pages/withdraw-record/index',
|
||||
GroupDelegatePublish = 'pages/group-delegate-publish/index',
|
||||
GiveVip = 'pages/give-vip/index',
|
||||
}
|
||||
|
||||
export enum PluginUrl {
|
||||
|
||||
@ -5934,6 +5934,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
||||
cityName: '杭州',
|
||||
keyword: 'HANGZHOU杭州',
|
||||
},
|
||||
{
|
||||
cityCode: '230100',
|
||||
cityName: '哈尔滨',
|
||||
keyword: 'HAERBIN哈尔滨',
|
||||
},
|
||||
{
|
||||
cityCode: '340100',
|
||||
cityName: '合肥',
|
||||
@ -5941,6 +5946,16 @@ export const GROUP_CITY_INDEXES_LIST = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
letter: 'J',
|
||||
data: [
|
||||
{
|
||||
cityCode: '370100',
|
||||
cityName: '济南',
|
||||
keyword: 'JINAN济南',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
letter: 'K',
|
||||
data: [
|
||||
@ -5984,11 +5999,21 @@ export const GROUP_CITY_INDEXES_LIST = [
|
||||
cityName: '上海',
|
||||
keyword: 'SHANGHAI上海',
|
||||
},
|
||||
{
|
||||
cityCode: '210100',
|
||||
cityName: '沈阳',
|
||||
keyword: 'SHENYANG沈阳',
|
||||
},
|
||||
{
|
||||
cityCode: '440300',
|
||||
cityName: '深圳',
|
||||
keyword: 'SHENZHEN深圳',
|
||||
},
|
||||
{
|
||||
cityCode: '130100',
|
||||
cityName: '石家庄',
|
||||
keyword: 'SHIJIAZHUANG石家庄',
|
||||
},
|
||||
{
|
||||
cityCode: '320500',
|
||||
cityName: '苏州',
|
||||
@ -6004,6 +6029,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
||||
cityName: '天津',
|
||||
keyword: 'TIANJIN天津',
|
||||
},
|
||||
{
|
||||
cityCode: '140100',
|
||||
cityName: '太原',
|
||||
keyword: 'TAIYUAN太原',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@ -6044,6 +6074,11 @@ export const GROUP_CITY_INDEXES_LIST = [
|
||||
cityName: '郑州',
|
||||
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: 120100, serviceUrl: 'https://work.weixin.qq.com/kfid/kfcda46c23dade6f6a3' },
|
||||
{ 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' },
|
||||
];
|
||||
|
||||
@ -21,6 +21,12 @@ export enum EmployType {
|
||||
Part = 'PARTY_TIME',
|
||||
}
|
||||
|
||||
export enum JobSourceType {
|
||||
All = 'All',
|
||||
VX = 'vx',
|
||||
BL = 'bl',
|
||||
}
|
||||
|
||||
export enum SortType {
|
||||
RECOMMEND = 'RECOMMEND',
|
||||
DISTANCE = 'DISTANCE',
|
||||
@ -66,6 +72,12 @@ export const EMPLOY_TYPE_TITLE_MAP = {
|
||||
[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 } = {
|
||||
[JobType.All]: '全部',
|
||||
[JobType.Finery]: '服饰',
|
||||
@ -101,16 +113,31 @@ export const JOB_MANAGE_STATUS_TITLE_MAP = {
|
||||
|
||||
export const JOB_PAGE_TABS = [
|
||||
{
|
||||
type: EmployType.All,
|
||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.All],
|
||||
type: JobSourceType.All,
|
||||
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.All],
|
||||
},
|
||||
{
|
||||
type: EmployType.Part,
|
||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.Part],
|
||||
type: JobSourceType.BL,
|
||||
title: JOB_SOURCE_TYPE_TITLE_MAP[JobSourceType.BL],
|
||||
},
|
||||
{
|
||||
type: EmployType.Full,
|
||||
title: EMPLOY_TYPE_TITLE_MAP[EmployType.Full],
|
||||
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],
|
||||
},
|
||||
{
|
||||
value: EmployType.Part,
|
||||
label: EMPLOY_TYPE_TITLE_MAP[EmployType.Part],
|
||||
},
|
||||
{
|
||||
value: EmployType.Full,
|
||||
label: EMPLOY_TYPE_TITLE_MAP[EmployType.Full],
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
flex: 1 0;
|
||||
}
|
||||
|
||||
&__employType-select,
|
||||
&__salary-select,
|
||||
&__search-city {
|
||||
display: flex;
|
||||
|
||||
@ -2,10 +2,11 @@ import { Image } from '@tarojs/components';
|
||||
import { NodesRef, useDidHide } from '@tarojs/taro';
|
||||
|
||||
import { Tabs } from '@taroify/core';
|
||||
import { ArrowUp, ArrowDown } from '@taroify/icons';
|
||||
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||
import classNames from 'classnames';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import EmployTypeSelect from '@/components/employ-type-select';
|
||||
import JobList, { IJobListProps } from '@/components/job-list';
|
||||
import Overlay from '@/components/overlay';
|
||||
import PartnerBanner from '@/components/partner-banner';
|
||||
@ -13,7 +14,16 @@ import SalarySelect from '@/components/salary-select';
|
||||
import SearchInput from '@/components/search';
|
||||
import { APP_TAB_BAR_ID, PageUrl } from '@/constants/app';
|
||||
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 { SalaryRange } from '@/types/job';
|
||||
import { Coordinate } from '@/types/location';
|
||||
@ -24,9 +34,11 @@ import './index.less';
|
||||
interface IProps {
|
||||
cityCode: string;
|
||||
sortType: SortType;
|
||||
sourceType: JobSourceType;
|
||||
employType: EmployType;
|
||||
coordinate: Coordinate;
|
||||
onClickCity: () => void;
|
||||
onClickEmployType: (type: EmployType) => void;
|
||||
onClickSort: (type: SortType) => void;
|
||||
}
|
||||
|
||||
@ -74,20 +86,35 @@ function ListWrapper(props: IJobListProps) {
|
||||
}
|
||||
|
||||
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 [tabType, setTabType] = useState<JobType>(JobType.All);
|
||||
const [salaryRange, setSalaryRange] = useState<SalaryRange | undefined>();
|
||||
const [showSalarySelect, setShowSalarySelect] = useState<boolean>(false);
|
||||
const [showEmployTypeSelect, setShowEmployTypeSelect] = useState<boolean>(false);
|
||||
const { latitude, longitude } = coordinate;
|
||||
|
||||
const handleClickSearch = useCallback(() => navigateTo(PageUrl.JobSearch, { city: cityCode }), [cityCode]);
|
||||
|
||||
const handleClickSalarySelect = useCallback(() => {
|
||||
setShowSalarySelect(!showSalarySelect);
|
||||
}, [showSalarySelect]);
|
||||
setShowSalarySelect(s => !s);
|
||||
}, []);
|
||||
|
||||
const handleClickEmployTypeSelect = useCallback(() => {
|
||||
setShowEmployTypeSelect(s => !s);
|
||||
}, []);
|
||||
|
||||
const handleHideSalarySelect = useCallback(() => setShowSalarySelect(false), []);
|
||||
const handleHideEmployTypeSelect = useCallback(() => setShowEmployTypeSelect(false), []);
|
||||
|
||||
const handleSelectSalary = useCallback((value?: SalaryRange) => {
|
||||
log('handleSelectSalary', value);
|
||||
@ -95,6 +122,15 @@ function JobFragment(props: IProps) {
|
||||
setShowSalarySelect(false);
|
||||
}, []);
|
||||
|
||||
const handleSelectEmployType = useCallback(
|
||||
(value?: EmployType) => {
|
||||
console.log('哈哈哈', value);
|
||||
setShowEmployTypeSelect(false);
|
||||
onClickEmployType(value!);
|
||||
},
|
||||
[onClickEmployType]
|
||||
);
|
||||
|
||||
const onTypeChange = useCallback(
|
||||
value => {
|
||||
log('onTypeChange', value);
|
||||
@ -109,6 +145,12 @@ function JobFragment(props: IProps) {
|
||||
<div className={`${PREFIX}__container`}>
|
||||
<div className={`${PREFIX}__top-search-bar`}>
|
||||
<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="title">{CITY_CODE_TO_NAME_MAP.get(cityCode)}</div>
|
||||
<ArrowDown />
|
||||
@ -139,6 +181,7 @@ function JobFragment(props: IProps) {
|
||||
sortType={sortType}
|
||||
latitude={latitude}
|
||||
longitude={longitude}
|
||||
sourceType={sourceType}
|
||||
employType={employType}
|
||||
minSalary={salaryRange?.minSalary}
|
||||
maxSalary={salaryRange?.maxSalary}
|
||||
@ -157,6 +200,15 @@ function JobFragment(props: IProps) {
|
||||
>
|
||||
<SalarySelect type={employType} value={salaryRange} onSelect={handleSelectSalary} />
|
||||
</Overlay>
|
||||
|
||||
<Overlay
|
||||
visible={showEmployTypeSelect}
|
||||
onClickOuter={handleHideEmployTypeSelect}
|
||||
outerClassName={`${PREFIX}__overlay-outer`}
|
||||
innerClassName={`${PREFIX}__overlay-inner`}
|
||||
>
|
||||
<EmployTypeSelect value={employType} onSelect={handleSelectEmployType} />
|
||||
</Overlay>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ const log = logWithPrefix(PREFIX);
|
||||
const realtimeLogger = Taro.getRealtimeLogManager();
|
||||
realtimeLogger.tag(PREFIX);
|
||||
const calcInitCityCodes = (codeString: string = '') => {
|
||||
const codes = codeString.split('、');
|
||||
const codes = (codeString || '').split('、');
|
||||
return codes.filter(code => !!CITY_CODE_TO_NAME_MAP.get(code));
|
||||
};
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ const log = logWithPrefix(PREFIX);
|
||||
const DEFAULT_TEXT = '未填写';
|
||||
|
||||
const getIndentCity = (codeString: string = '') => {
|
||||
const codes = codeString.split('、');
|
||||
const codes = (codeString||'').split('、');
|
||||
const cityNames: string[] = [];
|
||||
codes.forEach(code => {
|
||||
const cityName = CITY_CODE_TO_NAME_MAP.get(code);
|
||||
|
||||
@ -5,7 +5,6 @@ import { useCallback } from 'react';
|
||||
import CertificationStatus from '@/components/certification-status';
|
||||
import WechatCell from '@/components/wx-cell';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
|
||||
@ -18,10 +17,6 @@ export default function CompanyFragment() {
|
||||
// const [showPublish, setShowPublish] = useState(false);
|
||||
|
||||
const handlePublishJob = useCallback(async () => {
|
||||
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||
navigateTo(PageUrl.CertificationStart);
|
||||
return;
|
||||
}
|
||||
navigateTo(PageUrl.CertificationManage);
|
||||
}, [userInfo]);
|
||||
|
||||
|
||||
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;
|
||||
@ -98,6 +98,7 @@ export const APP_CONFIG: AppConfigType = {
|
||||
PageUrl.Partner,
|
||||
PageUrl.WithdrawRecord,
|
||||
PageUrl.GroupDelegatePublish,
|
||||
PageUrl.GiveVip,
|
||||
// PageUrl.DevDebug,
|
||||
],
|
||||
window: {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
// export const DOMAIN = 'http://192.168.60.148:8082';
|
||||
export const DOMAIN = 'https://neighbourhood.cn';
|
||||
// export const DOMAIN = 'http://192.168.60.191:8082';
|
||||
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 enum API {
|
||||
|
||||
@ -90,4 +90,25 @@
|
||||
color: @blColor;
|
||||
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,6 +1,7 @@
|
||||
import { Image } from '@tarojs/components';
|
||||
import { Button, Image } from '@tarojs/components';
|
||||
import Taro, { NodesRef, useDidShow, useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { Popup } from '@taroify/core';
|
||||
import { ArrowDown, ArrowUp } from '@taroify/icons';
|
||||
import classNames from 'classnames';
|
||||
import { isEqual } from 'lodash-es';
|
||||
@ -13,9 +14,10 @@ import HomePage from '@/components/home-page';
|
||||
import Overlay from '@/components/overlay';
|
||||
import PageLoading from '@/components/page-loading';
|
||||
import PartnerBanner from '@/components/partner-banner';
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import SwitchBar from '@/components/switch-bar';
|
||||
import { APP_TAB_BAR_ID, EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||
import { EmployType, JobManageStatus } from '@/constants/job';
|
||||
import { EmployType } from '@/constants/job';
|
||||
import { ALL_ANCHOR_SORT_TYPES, ANCHOR_SORT_TYPE_TITLE_MAP, AnchorSortType } from '@/constants/material';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
@ -32,6 +34,7 @@ import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getPageQuery, navigateTo } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'page-anchor';
|
||||
@ -82,6 +85,7 @@ export default function AnchorPage() {
|
||||
const [filters, setFilters] = useState<IAnchorFilters>({ employType: EmployType.All });
|
||||
const [showFilter, setShowFilter] = useState<boolean>(false);
|
||||
const [sortType, setSortType] = useState<AnchorSortType>(AnchorSortType.Active);
|
||||
const [openPopup, setOpenPopup] = useState<boolean>(false);
|
||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||
latitude: location.latitude,
|
||||
longitude: location.longitude,
|
||||
@ -92,6 +96,8 @@ export default function AnchorPage() {
|
||||
const handleChangeSelectJob = useCallback((select?: JobManageInfo) => {
|
||||
log('select job change', select);
|
||||
setSelectJob(select);
|
||||
console.log('哈哈哈', !select);
|
||||
setOpenPopup(!select);
|
||||
setLastSelectMyJobId(select?.id || '');
|
||||
}, []);
|
||||
|
||||
@ -125,7 +131,7 @@ export default function AnchorPage() {
|
||||
);
|
||||
|
||||
const handlePublishJobChange = useCallback(async () => {
|
||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||
const { jobResults = [] } = await requestJobManageList();
|
||||
if (!selectJob) {
|
||||
// 之前没有开发中的通告,自动选中第一个开放中的通告
|
||||
handleChangeSelectJob(jobResults[0]);
|
||||
@ -141,6 +147,10 @@ export default function AnchorPage() {
|
||||
}
|
||||
}, [selectJob, handleChangeSelectJob]);
|
||||
|
||||
const handleGoCreate = useCallback(() => {
|
||||
navigateTo(PageUrl.JobPublish);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
Taro.eventCenter.on(EventName.SELECT_MY_PUBLISH_JOB, handleJobChange);
|
||||
Taro.eventCenter.on(EventName.COMPANY_JOB_PUBLISH_CHANGED, handlePublishJobChange);
|
||||
@ -172,9 +182,10 @@ export default function AnchorPage() {
|
||||
getInviteCodeFromQueryAndUpdate(query);
|
||||
|
||||
try {
|
||||
const { jobResults = [] } = await requestJobManageList({ status: JobManageStatus.Open });
|
||||
const { jobResults = [] } = await requestJobManageList();
|
||||
if (!jobResults.length) {
|
||||
Toast.info('当前是根据定位为您展示主播');
|
||||
setOpenPopup(true);
|
||||
// Toast.info('当前是根据定位为您展示主播');
|
||||
return;
|
||||
}
|
||||
const lastSelectJobId = getLastSelectMyJobId();
|
||||
@ -240,6 +251,21 @@ export default function AnchorPage() {
|
||||
<AnchorPicker value={filters} onConfirm={handleFilterChange} />
|
||||
</Overlay>
|
||||
</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>
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,14 +6,15 @@ import classNames from 'classnames';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import JobManageList, { IJobManageListProps } from '@/components/job-manage-list';
|
||||
import { CompanyPublishJobDialog } from '@/components/product-dialog/publish-job';
|
||||
import SafeBottomPadding from '@/components/safe-bottom-padding';
|
||||
import { PageUrl } from '@/constants/app';
|
||||
import { ReportEventId } from '@/constants/event';
|
||||
import { JOB_MANAGE_TABS, JobManageStatus, JobManageType } from '@/constants/job';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { reportEvent } from '@/utils/event';
|
||||
import { navigateTo } from '@/utils/route';
|
||||
import { ensureUserInfo } from '@/utils/user';
|
||||
|
||||
import './index.less';
|
||||
@ -91,7 +92,6 @@ export default function CertificationManage() {
|
||||
const userInfo = useUserInfo();
|
||||
const listHeight = useListHeight(CALC_LIST_PROPS);
|
||||
const [tabType, setTabType] = useState<JobManageType>(JobManageType.All);
|
||||
const [showPublish, setShowPublish] = useState(false);
|
||||
|
||||
const handleTypeChange = useCallback(value => setTabType(value), []);
|
||||
|
||||
@ -101,7 +101,7 @@ export default function CertificationManage() {
|
||||
if (!(await ensureUserInfo(userInfo))) {
|
||||
return;
|
||||
}
|
||||
setShowPublish(true);
|
||||
navigateTo(PageUrl.JobPublish);
|
||||
}, [userInfo]);
|
||||
|
||||
return (
|
||||
@ -124,7 +124,6 @@ export default function CertificationManage() {
|
||||
</Button>
|
||||
</div>
|
||||
<SafeBottomPadding className={SAFE_BOTTOM_PADDING_CLASS} />
|
||||
<div>{showPublish && <CompanyPublishJobDialog userInfo={userInfo} onClose={() => setShowPublish(false)} />}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,21 +1,29 @@
|
||||
import { BaseEventOrig, Button, ButtonProps, Image, InputProps } from '@tarojs/components';
|
||||
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 BlFormItem from '@/components/bl-form-item';
|
||||
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 { PageUrl } from '@/constants/app';
|
||||
import { EventName, PageUrl } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
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 store from '@/store';
|
||||
import { clearCachedJobId } from '@/store/actions';
|
||||
import { ICertificationRequest } from '@/types/company';
|
||||
import { isValidIdCard, isValidPhone, logWithPrefix } from '@/utils/common';
|
||||
import { postCertification, getPhone } from '@/utils/company';
|
||||
import { collectEvent, reportEvent } from '@/utils/event';
|
||||
import { postPublishJob } from '@/utils/job';
|
||||
import { chooseMedia } from '@/utils/material';
|
||||
import { requestProductBalance } from '@/utils/product';
|
||||
import { redirectTo } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
import { dispatchUpdateUser, requestUserInfo } from '@/utils/user';
|
||||
@ -23,6 +31,7 @@ import { uploadVideo } from '@/utils/video';
|
||||
|
||||
import './index.less';
|
||||
|
||||
|
||||
const PREFIX = 'page-certification';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
const needIdCard = false;
|
||||
@ -100,6 +109,8 @@ export default function Certification() {
|
||||
// const [code, setCode] = useState('');
|
||||
const [company, setCompany] = useState('');
|
||||
const [open, setOpen] = useState(false);
|
||||
const [showBuy, setShowBuy] = useState(false);
|
||||
const cachedJobId = useCachedJobId();
|
||||
|
||||
const handleClickIdCardLeft = useCallback(async () => {
|
||||
reportEvent(ReportEventId.CLICK_UPLOAD_ID_CARD, { type: 'left' });
|
||||
@ -133,6 +144,29 @@ export default function Certification() {
|
||||
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 () => {
|
||||
reportEvent(ReportEventId.CLICK_CERTIFICATION_SUBMIT);
|
||||
const data: ICertificationRequest = {
|
||||
@ -157,7 +191,14 @@ export default function Certification() {
|
||||
return;
|
||||
}
|
||||
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) {
|
||||
console.error('submit error', e);
|
||||
Toast.error('认证失败请重试');
|
||||
@ -173,6 +214,7 @@ export default function Certification() {
|
||||
try {
|
||||
const { phoneNumber } = await getPhone(e.detail.code);
|
||||
setRevisedPhone(phoneNumber);
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
} catch (e) {
|
||||
Toast.error('获取手机号失败');
|
||||
}
|
||||
@ -262,6 +304,11 @@ export default function Certification() {
|
||||
<div>
|
||||
<LoadingDialog open={open} text="认证中" />
|
||||
</div>
|
||||
<Dialog open={showBuy} onClose={handleCloseBuy}>
|
||||
<Dialog.Content>
|
||||
<CompanyPublishJobBuy onNext={handlePublishJob} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
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: '赠送会员',
|
||||
});
|
||||
1
src/pages/give-vip/index.less
Normal file
1
src/pages/give-vip/index.less
Normal file
@ -0,0 +1 @@
|
||||
.give-vip {}
|
||||
12
src/pages/give-vip/index.tsx
Normal file
12
src/pages/give-vip/index.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import { Button } from '@taroify/core';
|
||||
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
|
||||
import './index.less';
|
||||
|
||||
const PREFIX = 'give-vip';
|
||||
const log = logWithPrefix(PREFIX);
|
||||
|
||||
export default function GiveVip() {
|
||||
return <div className={PREFIX}></div>;
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
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 { Dialog } from '@taroify/core';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { CertificationStatusIcon } from '@/components/certification-status';
|
||||
@ -12,25 +13,30 @@ import LoginButton from '@/components/login-button';
|
||||
import PageLoading from '@/components/page-loading';
|
||||
import { PrejobPopup } from '@/components/prejob-popup';
|
||||
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 { CollectEventName, ReportEventId } from '@/constants/event';
|
||||
import { EMPLOY_TYPE_TITLE_MAP, GET_CONTACT_TYPE } 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 useUserInfo from '@/hooks/use-user-info';
|
||||
import useRoleType from '@/hooks/user-role-type';
|
||||
import { RESPONSE_ERROR_CODE } from '@/http/constant';
|
||||
import { HttpError } from '@/http/error';
|
||||
import store from '@/store';
|
||||
import { cacheJobId } from '@/store/actions';
|
||||
import { JobDetails } from '@/types/job';
|
||||
import { IMaterialMessage } from '@/types/message';
|
||||
import { switchRoleType } from '@/utils/app';
|
||||
import { copy, logWithPrefix } from '@/utils/common';
|
||||
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 { requestProfileDetail } from '@/utils/material';
|
||||
import { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { requestProductBalance, requestProductUseRecord } from '@/utils/product';
|
||||
import { getJumpUrl, getPageQuery, navigateTo } from '@/utils/route';
|
||||
import { getCommonShareMessage } from '@/utils/share';
|
||||
import { formatDate } from '@/utils/time';
|
||||
@ -79,8 +85,14 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
|
||||
if (data.sourcePlat !== 'bl') {
|
||||
if (needCreateMaterial) {
|
||||
setShowMaterialGuide(true);
|
||||
return;
|
||||
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) {
|
||||
@ -93,16 +105,18 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
let materialMessage: null | IMaterialMessage = null;
|
||||
if (!needCreateMaterial) {
|
||||
const profile = await requestProfileDetail();
|
||||
materialMessage = {
|
||||
id: profile.id,
|
||||
name: profile.name,
|
||||
age: profile.age,
|
||||
height: profile.height,
|
||||
weight: profile.weight,
|
||||
shoeSize: profile.shoeSize,
|
||||
gender: profile.gender,
|
||||
workedSecCategoryStr: profile.workedSecCategoryStr,
|
||||
};
|
||||
if (profile) {
|
||||
materialMessage = {
|
||||
id: profile.id,
|
||||
name: profile.name,
|
||||
age: profile.age,
|
||||
height: profile.height,
|
||||
weight: profile.weight,
|
||||
shoeSize: profile.shoeSize,
|
||||
gender: profile.gender,
|
||||
workedSecCategoryStr: profile.workedSecCategoryStr,
|
||||
};
|
||||
}
|
||||
}
|
||||
navigateTo(PageUrl.MessageChat, {
|
||||
chatId: chat.chatId,
|
||||
@ -162,25 +176,37 @@ const AnchorFooter = (props: { data: JobDetails }) => {
|
||||
|
||||
const CompanyFooter = (props: { data: JobDetails }) => {
|
||||
const { data } = props;
|
||||
const [showBuy, setShowBuy] = useState(false);
|
||||
const userInfo = useUserInfo();
|
||||
|
||||
const handleClickEdit = useCallback(() => navigateTo(PageUrl.JobPublish, { jobId: data.id }), [data]);
|
||||
|
||||
const handlePublishJob = useCallback(async () => {
|
||||
try {
|
||||
if (userInfo.bossAuthStatus !== CertificationStatusType.Success) {
|
||||
store.dispatch(cacheJobId(data.id));
|
||||
navigateTo(PageUrl.CertificationStart);
|
||||
return;
|
||||
}
|
||||
Taro.showLoading();
|
||||
await postPublishJob(data.id);
|
||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||
setShowBuy(false);
|
||||
Toast.success('发布成功');
|
||||
Taro.hideLoading();
|
||||
} catch (error) {
|
||||
Taro.hideLoading();
|
||||
const e = error as HttpError;
|
||||
const errorCode = e.errorCode;
|
||||
const errorMsg = 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_BALANCE) {
|
||||
Toast.info('您购买的产品已耗尽使用次数');
|
||||
setShowBuy(true);
|
||||
} else if (errorCode === RESPONSE_ERROR_CODE.BOSS_VIP_EXPIRED) {
|
||||
Toast.info('该通告已到期,请创建新通告', 3000);
|
||||
} else {
|
||||
Toast.error(e.message || '发布失败请重试', 3000);
|
||||
Toast.error(errorMsg || '发布失败请重试', 3000);
|
||||
}
|
||||
console.error(e);
|
||||
}
|
||||
@ -192,10 +218,19 @@ const CompanyFooter = (props: { data: JobDetails }) => {
|
||||
<Button className={`${PREFIX}__share-button`} onClick={handleClickEdit}>
|
||||
编辑
|
||||
</Button>
|
||||
<Button className={`${PREFIX}__contact-publisher`} onClick={handlePublishJob}>
|
||||
<Button
|
||||
disabled={data.status === JobManageStatus.Open}
|
||||
className={`${PREFIX}__contact-publisher`}
|
||||
onClick={handlePublishJob}
|
||||
>
|
||||
发布通告
|
||||
</Button>
|
||||
</div>
|
||||
<Dialog open={showBuy} onClose={() => setShowBuy(false)}>
|
||||
<Dialog.Content>
|
||||
<CompanyPublishJobBuy onNext={handlePublishJob} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@ -251,6 +286,7 @@ export default function JobDetail() {
|
||||
if (!jobId) {
|
||||
return;
|
||||
}
|
||||
Taro.eventCenter.trigger(EventName.VIEW_JOB_SUCCESS, jobId);
|
||||
try {
|
||||
const res = await requestJobDetail(jobId);
|
||||
setData(res);
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
import { BaseEventOrig, Button, InputProps } from '@tarojs/components';
|
||||
import Taro, { useLoad } from '@tarojs/taro';
|
||||
|
||||
import { Dialog } from '@taroify/core';
|
||||
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 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 { CityPickerPopup } from '@/components/city-picker';
|
||||
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 { EventName, PageUrl } from '@/constants/app';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
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 { logWithPrefix } from '@/utils/common';
|
||||
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 { requestProductBalance } from '@/utils/product';
|
||||
import { getPageQuery, navigateBack, navigateTo } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
|
||||
@ -91,6 +107,9 @@ export default function JobPublish() {
|
||||
const [city, setCity] = useState<string[] | undefined>();
|
||||
const [showCityPicker, setShowCityPicker] = useState(false);
|
||||
const [address, setAddress] = useState('');
|
||||
const [showBuy, setShowBuy] = useState(false);
|
||||
const createdJobIdRef = useRef('');
|
||||
const userInfo = useUserInfo();
|
||||
|
||||
const handleEmployTypeChange = useCallback((value: EmployType) => {
|
||||
setEmployType(value);
|
||||
@ -125,6 +144,13 @@ export default function JobPublish() {
|
||||
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 () => {
|
||||
if (!job) {
|
||||
Toast.error('数据出错请重试');
|
||||
@ -133,7 +159,7 @@ export default function JobPublish() {
|
||||
try {
|
||||
Taro.showLoading();
|
||||
await postCloseJob(job.id);
|
||||
Taro.eventCenter.trigger(EventName.COMPANY_JOB_PUBLISH_CHANGED);
|
||||
refreshJobPublishList();
|
||||
navigateBack();
|
||||
} catch (e) {
|
||||
console.error('submit error', e);
|
||||
@ -142,9 +168,9 @@ export default function JobPublish() {
|
||||
} finally {
|
||||
Taro.hideLoading();
|
||||
}
|
||||
}, [job]);
|
||||
}, [job, refreshJobPublishList]);
|
||||
|
||||
const handleSubmit = useCallback(async () => {
|
||||
const getCreateJobInfo = useCallback((): [CreateJobInfo, string[]] => {
|
||||
const cityCodes = city || [];
|
||||
const data: CreateJobInfo = {
|
||||
title,
|
||||
@ -160,6 +186,11 @@ export default function JobPublish() {
|
||||
highPriceForPartyTime: !isPartTimePriceRequired(employType) ? 0 : salary[3],
|
||||
address: address,
|
||||
};
|
||||
return [data, cityCodes];
|
||||
}, [address, category, city, describe, employType, salary, title]);
|
||||
|
||||
const handleSubmit = useCallback(async () => {
|
||||
const [data, cityCodes] = getCreateJobInfo();
|
||||
const errMsg = isInvalidCreateJobInfo(data);
|
||||
if (errMsg) {
|
||||
Toast.info(errMsg);
|
||||
@ -178,10 +209,48 @@ export default function JobPublish() {
|
||||
await postUpdateJob(data);
|
||||
Taro.eventCenter.trigger(EventName.JOB_UPDATE, job!.id);
|
||||
} 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);
|
||||
await Toast.success(isUpdateJob ? '更新成功' : '创建成功', 1500, true);
|
||||
refreshJobPublishList();
|
||||
|
||||
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();
|
||||
} catch (e) {
|
||||
console.error('submit error', e);
|
||||
@ -190,7 +259,12 @@ export default function JobPublish() {
|
||||
} finally {
|
||||
Taro.hideLoading();
|
||||
}
|
||||
}, [isUpdate, job, title, employType, category, describe, city, salary, address]);
|
||||
}, [refreshJobPublishList]);
|
||||
|
||||
const handleClosePublishJob = useCallback(() => {
|
||||
setShowBuy(false);
|
||||
navigateBack(-1);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const callback = (d: string) => setDescribe(d);
|
||||
@ -283,7 +357,7 @@ export default function JobPublish() {
|
||||
<div className={`${PREFIX}__footer__buttons`}>
|
||||
{!isUpdate && (
|
||||
<Button className={`${PREFIX}__footer__button`} onClick={handleSubmit}>
|
||||
创建
|
||||
创建并发布
|
||||
</Button>
|
||||
)}
|
||||
{isUpdate && (
|
||||
@ -306,6 +380,11 @@ export default function JobPublish() {
|
||||
onConfirm={handleConfirmCityPicker}
|
||||
onCancel={() => setShowCityPicker(false)}
|
||||
/>
|
||||
<Dialog open={showBuy} onClose={handleClosePublishJob}>
|
||||
<Dialog.Content>
|
||||
<CompanyPublishJobBuy onNext={handleNext} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -150,7 +150,7 @@ export default function JobSearch() {
|
||||
<SearchInput
|
||||
focus={focus}
|
||||
value={value}
|
||||
placeholder="你想搜什么"
|
||||
placeholder="可以试试地区 品类"
|
||||
searchAction={searchAction}
|
||||
className={`${PREFIX}__search`}
|
||||
onClear={handleSearchClear}
|
||||
|
||||
@ -56,7 +56,27 @@
|
||||
&__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
&__block {
|
||||
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 { 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 { getJobLocation, requestJobManageList } from '@/utils/job';
|
||||
import { getPageQuery, navigateBack } from '@/utils/route';
|
||||
@ -16,7 +16,14 @@ import Toast from '@/utils/toast';
|
||||
import './index.less';
|
||||
|
||||
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() {
|
||||
const [list, setList] = useState<JobManageInfo[]>([]);
|
||||
const [jobId, setJobId] = useState<string | null>('1');
|
||||
@ -34,7 +41,7 @@ export default function JobSelectMyPublish() {
|
||||
const query = getPageQuery<{ id: string; source: OpenSource }>();
|
||||
query?.id && setJobId(query.id);
|
||||
try {
|
||||
const res = await requestJobManageList({ status: JobManageStatus.Open });
|
||||
const res = await requestJobManageList();
|
||||
setList(res.jobResults);
|
||||
setSource(query.source);
|
||||
} catch (e) {
|
||||
@ -58,13 +65,18 @@ export default function JobSelectMyPublish() {
|
||||
</div>
|
||||
<div className={`${PREFIX}__right`}>
|
||||
<div className={`${PREFIX}__right__time`}>{formatTime(item.updated)}</div>
|
||||
{item.id === jobId && (
|
||||
<Image
|
||||
mode="aspectFit"
|
||||
className={`${PREFIX}__right__icon`}
|
||||
src={require('@/statics/svg/success.svg')}
|
||||
/>
|
||||
)}
|
||||
<div className={`${PREFIX}__right__block`}>
|
||||
<div className={classNames(`${PREFIX}__right__status`, { [STATUS_CLASS_MAP[item.status]]: true })}>
|
||||
{JOB_MANAGE_STATUS_TITLE_MAP[item.status]}
|
||||
</div>
|
||||
{item.id === jobId && (
|
||||
<Image
|
||||
mode="aspectFit"
|
||||
className={`${PREFIX}__right__icon`}
|
||||
src={require('@/statics/svg/success.svg')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@ -7,7 +7,7 @@ import { AgreementPopup } from '@/components/agreement-popup';
|
||||
import HomePage from '@/components/home-page';
|
||||
import MaterialGuide from '@/components/material-guide';
|
||||
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 useInviteCode from '@/hooks/use-invite-code';
|
||||
import useLocation from '@/hooks/use-location';
|
||||
@ -31,8 +31,9 @@ export default function Job() {
|
||||
const location = useLocation();
|
||||
const { barHeight, statusBarHeight } = useNavigation();
|
||||
const inviteCode = useInviteCode();
|
||||
const [tabType, setTabType] = useState<EmployType>(EmployType.All);
|
||||
const [sortType, setSortType] = useState<SortType>(SortType.RECOMMEND);
|
||||
const [tabType, setTabType] = useState<JobSourceType>(JobSourceType.All);
|
||||
const [employType, setEmployType] = useState<EmployType>(EmployType.All);
|
||||
const [sortType, setSortType] = useState<SortType>(SortType.CREATE_TIME);
|
||||
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||
latitude: location.latitude,
|
||||
@ -59,6 +60,10 @@ export default function Job() {
|
||||
[cityCode]
|
||||
);
|
||||
|
||||
const handleClickEmployType = useCallback(type => {
|
||||
setEmployType(type);
|
||||
}, []);
|
||||
|
||||
const handleClickSortType = useCallback(
|
||||
async (type: SortType) => {
|
||||
if (type === SortType.DISTANCE && (!location.latitude || !location.longitude)) {
|
||||
@ -151,8 +156,10 @@ export default function Job() {
|
||||
<JobFragment
|
||||
cityCode={cityCode}
|
||||
sortType={sortType}
|
||||
employType={tab.type}
|
||||
sourceType={tab.type}
|
||||
employType={employType}
|
||||
coordinate={coordinate}
|
||||
onClickEmployType={handleClickEmployType}
|
||||
onClickCity={handleClickCity}
|
||||
onClickSort={handleClickSortType}
|
||||
/>
|
||||
|
||||
@ -190,7 +190,7 @@ export default function MaterialUploadVideo() {
|
||||
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>
|
||||
<SafeBottomPadding />
|
||||
<div className={`${PREFIX}__footer`}>
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
import { Button } from '@tarojs/components';
|
||||
import Taro, { useLoad, useShareAppMessage } from '@tarojs/taro';
|
||||
|
||||
import { Dialog } from '@taroify/core';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import CommonDialog from '@/components/common-dialog';
|
||||
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 { EventName, OpenSource, PageUrl, RoleType } from '@/constants/app';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
import { JobManageStatus } from '@/constants/job';
|
||||
import { MaterialViewSource } from '@/constants/material';
|
||||
import ProfileViewFragment from '@/fragments/profile/view';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
@ -19,13 +22,17 @@ import { IJobMessage } from '@/types/message';
|
||||
import { switchRoleType } from '@/utils/app';
|
||||
import { copy } from '@/utils/common';
|
||||
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 { isChatWithSelf, postCreateChat } from '@/utils/message';
|
||||
import { getInviteCodeFromQueryAndUpdate } from '@/utils/partner';
|
||||
import { getPageQuery, navigateBack, navigateTo, redirectTo } from '@/utils/route';
|
||||
import Toast from '@/utils/toast';
|
||||
import './index.less';
|
||||
import useUserInfo from '@/hooks/use-user-info';
|
||||
import { CertificationStatusType } from '@/constants/company';
|
||||
import store from '@/store';
|
||||
import { cacheJobId } from '@/store/actions';
|
||||
|
||||
const PREFIX = 'page-material-view';
|
||||
|
||||
@ -67,15 +74,17 @@ export default function MaterialViewPage() {
|
||||
const [jobId, setJobId] = useState<string>();
|
||||
const [errorTips, setErrorTips] = useState<string>('');
|
||||
const [publishDialogVisible, setPublishDialogVisible] = useState(false);
|
||||
const [certificationDialogVisible, setCertificationDialogVisible] = useState(false);
|
||||
const [noTimeDialogVisible, setNoTimeDialogVisible] = useState(false);
|
||||
const [noVipLimitVisible, setNoVipLimitVisible] = useState(false);
|
||||
const [vipExpiredVisible, setVipExpiredVisible] = useState(false);
|
||||
const inviteCode = useInviteCode();
|
||||
const [showBuy, setShowBuy] = useState(false);
|
||||
const userInfo = useUserInfo();
|
||||
|
||||
const onDev = useCallback(async () => profile && copy(profile.userId), [profile]);
|
||||
|
||||
const handleClickContact = useCallback(async () => {
|
||||
setShowBuy(false);
|
||||
if (!profile) {
|
||||
return;
|
||||
}
|
||||
@ -87,6 +96,16 @@ export default function MaterialViewPage() {
|
||||
return;
|
||||
}
|
||||
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 jobMessage: IJobMessage = {
|
||||
id: jobDetail.id,
|
||||
@ -116,7 +135,16 @@ export default function MaterialViewPage() {
|
||||
}
|
||||
}
|
||||
}, [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(() => {
|
||||
setNoTimeDialogVisible(false);
|
||||
navigateBack();
|
||||
@ -127,11 +155,6 @@ export default function MaterialViewPage() {
|
||||
redirectTo(PageUrl.CertificationManage);
|
||||
}, []);
|
||||
|
||||
const handleClickGoCertification = useCallback(() => {
|
||||
setCertificationDialogVisible(false);
|
||||
redirectTo(PageUrl.CertificationStart);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const callback = (select: JobManageInfo, source: OpenSource) =>
|
||||
source === OpenSource.MaterialViewPage && setJobId(select.id);
|
||||
@ -162,9 +185,7 @@ export default function MaterialViewPage() {
|
||||
const errorCode = e.errorCode;
|
||||
collectEvent(CollectEventName.VIEW_MATERIAL_FAILED, { context, error: e.info?.() || e.message });
|
||||
console.error(e);
|
||||
if (errorCode === RESPONSE_ERROR_CODE.BOSS_NOT_AUTH) {
|
||||
setCertificationDialogVisible(true);
|
||||
} else if (errorCode === RESPONSE_ERROR_CODE.NO_PUBLISHED_JOB) {
|
||||
if (errorCode === RESPONSE_ERROR_CODE.NO_PUBLISHED_JOB) {
|
||||
setPublishDialogVisible(true);
|
||||
} else if (errorCode === RESPONSE_ERROR_CODE.INSUFFICIENT_BALANCE) {
|
||||
setNoTimeDialogVisible(true);
|
||||
@ -179,7 +200,7 @@ export default function MaterialViewPage() {
|
||||
});
|
||||
|
||||
useShareAppMessage(async () => {
|
||||
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode);
|
||||
const shareMessage = await getMaterialShareMessage(profile, true, inviteCode, jobId);
|
||||
return shareMessage as BL.Anything;
|
||||
});
|
||||
|
||||
@ -187,13 +208,6 @@ export default function MaterialViewPage() {
|
||||
return (
|
||||
<>
|
||||
<PageLoading />
|
||||
<CommonDialog
|
||||
content="要查看主播详情,请先完成实人认证"
|
||||
confirm="去认证"
|
||||
visible={certificationDialogVisible}
|
||||
onClose={() => setCertificationDialogVisible(false)}
|
||||
onClick={handleClickGoCertification}
|
||||
/>
|
||||
<CommonDialog
|
||||
content="请先发布一个认证通告"
|
||||
confirm="去发布"
|
||||
@ -260,6 +274,11 @@ export default function MaterialViewPage() {
|
||||
onClose={() => setErrorTips('')}
|
||||
onClick={() => setErrorTips('')}
|
||||
/>
|
||||
<Dialog open={showBuy} onClose={() => setShowBuy(false)}>
|
||||
<Dialog.Content>
|
||||
<CompanyPublishJobBuy onNext={handleNext} />
|
||||
</Dialog.Content>
|
||||
</Dialog>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -8,23 +8,22 @@ import HomePage from '@/components/home-page';
|
||||
import MessageCard from '@/components/message-card';
|
||||
import { MessageHelpDialog, MessageNoTimesDialog } from '@/components/message-dialog';
|
||||
import { APP_TAB_BAR_ID, EventName, PageType } from '@/constants/app';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
import { REFRESH_CHAT_LIST_TIME } from '@/constants/message';
|
||||
import { MessageSubscribeIds, SubscribeTempId } from '@/constants/subscribe';
|
||||
import useListHeight, { IUseListHeightProps } from '@/hooks/use-list-height';
|
||||
import useRoleType from '@/hooks/user-role-type';
|
||||
import { MainMessage } from '@/types/message';
|
||||
import { logWithPrefix } from '@/utils/common';
|
||||
import { collectEvent } from '@/utils/event';
|
||||
import {
|
||||
postAddMessageTimes,
|
||||
requestMessageList,
|
||||
requestRemainPushTime,
|
||||
requestUnreadMessageCount,
|
||||
} from '@/utils/message';
|
||||
|
||||
import { isSubscribeRefused, postSubscribe } from '@/utils/subscribe';
|
||||
import './index.less';
|
||||
import { collectEvent } from '@/utils/event';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
|
||||
const PREFIX = 'page-message';
|
||||
const HEADER_CLASS = `${PREFIX}__header`;
|
||||
|
||||
@ -82,7 +82,7 @@ export default function BizService() {
|
||||
<div className={`${PREFIX}__delegate-h5`}>服务说明</div>
|
||||
<div className={`${PREFIX}__delegate-card`}>
|
||||
<div className={`${PREFIX}__delegate-body`}>服务方式:帮您把招聘需求发到众多同城合作主播群</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>群发次数:每日1次,连发3天</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>群发次数:杭州、广州发3次,其他城市1次</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>内容要求:仅限带货主播招聘需求,其他不发</div>
|
||||
<div className={`${PREFIX}__delegate-body`}>主播联系:内容中留招聘方联系方式,主播直接联系</div>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
export * from './app';
|
||||
export * from './user';
|
||||
export * from './message';
|
||||
export * from './job';
|
||||
|
||||
5
src/store/actions/job.ts
Normal file
5
src/store/actions/job.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { SET_JOB_ID } from '../constants';
|
||||
|
||||
export const cacheJobId = (value: string) => ({ type: SET_JOB_ID, value });
|
||||
|
||||
export const clearCachedJobId = () => ({ type: SET_JOB_ID, value: null });
|
||||
@ -5,3 +5,4 @@ export const SET_USER_INFO = 'SET_USER_INFO';
|
||||
export const SET_BIND_PHONE = 'SET_BIND_PHONE';
|
||||
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
|
||||
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
|
||||
export const SET_JOB_ID = 'SET_JOB_ID';
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { combineReducers } from 'redux';
|
||||
|
||||
import appState from './app';
|
||||
import jobInfo from './job';
|
||||
import message from './message';
|
||||
import partnerInfo from './partner';
|
||||
import userInfo from './user';
|
||||
@ -10,4 +11,5 @@ export default combineReducers({
|
||||
userInfo,
|
||||
message,
|
||||
partnerInfo,
|
||||
jobInfo,
|
||||
});
|
||||
|
||||
15
src/store/reducers/job.ts
Normal file
15
src/store/reducers/job.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Action } from 'redux';
|
||||
|
||||
import { SET_JOB_ID } from '../constants';
|
||||
|
||||
const jobInfo = (state: Partial<string | null> = null, action: Action): Partial<string | null> => {
|
||||
const { type, value } = action as BL.Anything;
|
||||
switch (type) {
|
||||
case SET_JOB_ID:
|
||||
return value;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default jobInfo;
|
||||
3
src/store/selector/job.ts
Normal file
3
src/store/selector/job.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { IState } from '@/types/store';
|
||||
|
||||
export const selectCreatedJob = (state: IState) => state.jobInfo;
|
||||
@ -1,4 +1,4 @@
|
||||
import { JobType, EmployType, SortType, UserJobType, JobManageStatus } from '@/constants/job';
|
||||
import { JobType, EmployType, SortType, UserJobType, JobManageStatus, JobSourceType } from '@/constants/job';
|
||||
import { DeclarationType } from '@/constants/product';
|
||||
import type { IPaginationRequest, IPaginationResponse } from '@/types/common';
|
||||
import { LocationInfo } from '@/types/location';
|
||||
@ -17,6 +17,7 @@ export interface JobInfo {
|
||||
distance?: number; // 距离。一期没有
|
||||
isAuthed?: boolean; // 是否认证
|
||||
companyName?: string;
|
||||
isRead?: boolean;
|
||||
}
|
||||
|
||||
export interface CreateJobInfo extends Pick<JobInfo, 'title' | 'employType' | 'jobDescription'> {
|
||||
@ -50,6 +51,7 @@ export type JobDetails = JobInfo &
|
||||
userId: string; // 发布人的 userId
|
||||
verifyFailReason?: string; // 审核不通过的原因
|
||||
sourcePlat?: string;
|
||||
status: JobManageStatus
|
||||
};
|
||||
|
||||
export interface JobManageInfo {
|
||||
@ -83,6 +85,7 @@ export interface GetJobsRequest extends IPaginationRequest {
|
||||
minSalary?: number;
|
||||
maxSalary?: number;
|
||||
blGroupId?: string; // 播络群 id
|
||||
sourceType?: JobSourceType;
|
||||
}
|
||||
|
||||
// 获取通告列表响应接口
|
||||
|
||||
@ -10,6 +10,7 @@ export interface IState {
|
||||
userInfo: UserInfo;
|
||||
message: UserMessage;
|
||||
partnerInfo: PartnerInfo;
|
||||
jobInfo: string | null;
|
||||
}
|
||||
|
||||
export interface AppState {
|
||||
|
||||
@ -2,7 +2,7 @@ import Taro from '@tarojs/taro';
|
||||
|
||||
import { CacheKey } from '@/constants/cache-key';
|
||||
import { CollectEventName } from '@/constants/event';
|
||||
import { EmployType, JobManageStatus, UserJobType } from '@/constants/job';
|
||||
import { EmployType, JobManageStatus, JobSourceType, UserJobType } from '@/constants/job';
|
||||
import http from '@/http';
|
||||
import { API } from '@/http/api';
|
||||
import store from '@/store';
|
||||
@ -80,6 +80,7 @@ async function requestMyBrowsedJobList(data: GetUserJobRequest) {
|
||||
|
||||
export async function requestJobList(data: GetJobsRequest = {}) {
|
||||
const isGetMyJob = data.isOwner || data.isFollow;
|
||||
data.sourceType = data.sourceType === JobSourceType.All ? undefined : data.sourceType;
|
||||
const url = isGetMyJob ? API.GET_MY_JOB_LIST_V2 : API.GET_JOB_LIST;
|
||||
return await http.post<GetJobsResponse>(url, { data });
|
||||
}
|
||||
@ -116,8 +117,9 @@ export async function requestHasPublishedJob() {
|
||||
return data.jobResults.length > 0;
|
||||
}
|
||||
|
||||
export function postCreateJob(data: CreateJobInfo) {
|
||||
return http.post(API.CREATE_JOB, { data });
|
||||
export async function postCreateJob(data: CreateJobInfo): Promise<string> {
|
||||
const jobId = await http.post(API.CREATE_JOB, { data });
|
||||
return jobId;
|
||||
}
|
||||
|
||||
export function postUpdateJob(data: CreateJobInfo) {
|
||||
|
||||
@ -89,9 +89,9 @@ export const requestReadProfile = async (data: GetReadProfileRequest) => {
|
||||
return http.post<MaterialProfile>(API.READ_PROFILE, { data });
|
||||
};
|
||||
|
||||
export const requestProfileShareCode = async (resumeId: string) => {
|
||||
export const requestProfileShareCode = async (resumeId: string, jobId?: string) => {
|
||||
return http.post<MaterialProfile>(API.GET_PROFILE_SHARE_CODE, {
|
||||
data: { resumeId },
|
||||
data: { resumeId, jobId },
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
});
|
||||
};
|
||||
@ -142,14 +142,15 @@ export const requestAnchorList = async (data: GetAnchorListRequest) => {
|
||||
export const getMaterialShareMessage = async (
|
||||
profile?: MaterialProfile | null,
|
||||
needShareCode: boolean = true,
|
||||
inviteCode?: string
|
||||
inviteCode?: string,
|
||||
jobId?: string
|
||||
) => {
|
||||
if (!profile) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const { id, name = '', workedSecCategoryStr } = profile;
|
||||
const shareCode = needShareCode ? await requestProfileShareCode(id) : undefined;
|
||||
const shareCode = needShareCode ? await requestProfileShareCode(id, jobId) : undefined;
|
||||
const title = `${name} ${workedSecCategoryStr ? `播过 ${workedSecCategoryStr}` : ''}`.trim();
|
||||
return {
|
||||
title,
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
GetProductIsUnlockRequest,
|
||||
PostUseProductRequest,
|
||||
GetProductIsUnlockResponse,
|
||||
CustomerServiceInfo,
|
||||
// CustomerServiceInfo,
|
||||
CreatePayInfoRequest,
|
||||
CreatePayInfoResponse,
|
||||
CreatePayOrderParams,
|
||||
@ -74,7 +74,7 @@ export async function requestAllBuyProduct(productCode: ProductType) {
|
||||
}
|
||||
|
||||
export async function requestCsQrCode(_type: QrCodeType) {
|
||||
const result = await http.post<CustomerServiceInfo>(API.CS_QR_CODE);
|
||||
// const result = await http.post<CustomerServiceInfo>(API.CS_QR_CODE);
|
||||
return 'https://publiccdn.neighbourhood.com.cn/img/bzQrcode.jpg';
|
||||
// return `${DOMAIN}/${result.vxQrCode}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user