diff --git a/.gitignore b/.gitignore index a503fa2..9b74aa9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /unpackage/ +/node_modules/ \ No newline at end of file diff --git a/apiRc/person.js b/apiRc/person.js new file mode 100644 index 0000000..ed193ff --- /dev/null +++ b/apiRc/person.js @@ -0,0 +1,84 @@ +/* + * @Date: 2025-10-31 13:50:15 + * @LastEditors: shirlwang + * @LastEditTime: 2025-10-31 14:30:31 + */ +import request from '@/utilsRc/request' + +// 人员信息保存 +export function savePersonBase(data) { + return request({ + 'url': '/personnel/personBaseInfo', + 'method': 'put', + 'data': data + }) +} + +// 人员信息查询 +export function getPersonBase(userId) { + return request({ + 'url': `/personnel/personBaseInfo/user/${userId}`, + 'method': 'get', + }) +} +// 获取行政区划列表 +export function getQUList() { + return request({ + url: `/manage/xzqh//xzqhTree`, + method: 'get' + }) + } +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/center/user/deptTree', + method: 'get' + }) +} + + +// 社群端 根据所在社区 获取姓名 +export function generateUserName(deptId) { + return request({ + url: `/generateUserName/${deptId}`, + method: 'get' + }) +} + +// 获取部门列表 +export function getDeptList(name,personId) { + return request({ + url: `/system/center/user/getDeptList?name=${name}&parentId=${personId}`, + method: 'get' + }) + } +// 求职工种列表 +export function touristWork() { + return request({ + url: `/basicdata/workType/workTypeTree`, + method: 'get' + }) +} +// 获取招聘工种列表 +export function jobTypeList(params) { + return request({ + url: '/basicdata/workType/list', + method: 'get', + params + }) +} +// 未读消息数量 + +export function unreadNum() { + return request({ + url: '/manage/tjgw/notReadNum', + method: 'get', + }) +} +// 地图类型列表 +export function jyshdt(cyfhjd) { + return request({ + url: `/jyshdt/jyshdt/queryList?lx=${cyfhjd}`, + method: 'get', + }) +} diff --git a/apiRc/system/dict.js b/apiRc/system/dict.js new file mode 100644 index 0000000..5d47ae5 --- /dev/null +++ b/apiRc/system/dict.js @@ -0,0 +1,63 @@ +/* + * @Date: 2025-10-31 15:06:34 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 12:20:28 + */ +import request from '@/utilsRc/request' +// 查询字典数据列表 +export function listData (query) { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: query + }) +} + +// 查询字典数据详细 +export function getData (dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'get' + }) +} + +// 根据字典类型查询字典数据信息 +export function getDicts (dictType) { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }) +} +// 根据字典类型查询字典数据信息 +export function getDict (dictType) { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }) +} + +// 新增字典数据 +export function addData (data) { + return request({ + url: '/system/dict/data/add', + method: 'post', + data: data + }) +} + +// 修改字典数据 +export function updateData (data) { + return request({ + url: '/system/dict/data', + method: 'post', + data: data + }) +} + +// 删除字典数据 +export function delData (dictCode) { + return request({ + url: '/system/dict/data/remove' + dictCode, + method: 'get' + }) +} diff --git a/main.js b/main.js index 1a45f9f..bfa1d7e 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,8 @@ +/* + * @Date: 2025-11-03 10:52:09 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 12:12:49 + */ import App from '@/App' import * as Pinia from 'pinia' import globalFunction from '@/common/globalFunction' @@ -13,6 +18,10 @@ import SelectPopup from '@/components/selectPopup/selectPopup.vue' import SelectPopupPlugin from '@/components/selectPopup/selectPopupPlugin'; import RenderJobs from '@/components/renderJobs/renderJobs.vue'; import RenderCompanys from '@/components/renderCompanys/renderCompanys.vue'; +import uniIcons from './uni_modules/uni-icons/components/uni-icons/uni-icons.vue' +import uniPopup from './uni_modules/uni-popup/components/uni-popup/uni-popup.vue' +import uniDataSelect from './uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue' +import storeRc from './utilsRc/store/index.js' // iconfont.css 已在 App.vue 中通过 @import 引入,无需在此处重复引入 // import Tabbar from '@/components/tabbar/midell-box.vue' // 自动导入 directives 目录下所有指令 @@ -27,6 +36,7 @@ import { // const foldFeature = window.visualViewport && 'segments' in window.visualViewport // console.log('是否支持多段屏幕:', foldFeature) +import { getDict } from '@/apiRc/system/dict.js'; // 全局组件 export function createApp() { const app = createSSRApp(App) @@ -38,6 +48,21 @@ export function createApp() { app.component('SelectPopup', SelectPopup) app.component('RenderJobs', RenderJobs) app.component('RenderCompanys', RenderCompanys) + app.component('uni-icons', uniIcons) + app.component('uni-popup', uniPopup) + app.component('uni-data-select', uniDataSelect) + + + app.config.globalProperties.$getDict = getDict; + app.config.globalProperties.$store = storeRc; + app.config.globalProperties.$getDictSelectOption = async (dictType, isDigital = false, forceRefresh = false) => { + const dictData = await getDict(dictType, forceRefresh); + return dictData.map(item => ({ + value: isDigital ? Number(item.dictValue || item.dictvalue) : (item.dictValue || item.dictvalue), + label: item.dictLabel || item.dictlabel, + ...item + })); + }; // app.component('tabbar-custom', Tabbar) for (const path in directives) { @@ -56,6 +81,8 @@ export function createApp() { app.use(SelectPopupPlugin); app.use(Pinia.createPinia()); + // 注册vuex + app.use(storeRc); return { app, diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2d18fdb --- /dev/null +++ b/package-lock.json @@ -0,0 +1,51 @@ +{ + "name": "ks-app-employment-service", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "dayjs": "^1.11.19", + "sm-crypto": "^0.3.13" + } + }, + "node_modules/dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/sm-crypto": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.13.tgz", + "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==", + "dependencies": { + "jsbn": "^1.1.0" + } + } + }, + "dependencies": { + "dayjs": { + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" + }, + "jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "sm-crypto": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/sm-crypto/-/sm-crypto-0.3.13.tgz", + "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==", + "requires": { + "jsbn": "^1.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d888dab --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "dayjs": "^1.11.19", + "sm-crypto": "^0.3.13" + } +} diff --git a/packageRc/api/company/index.js b/packageRc/api/company/index.js new file mode 100644 index 0000000..ba181c1 --- /dev/null +++ b/packageRc/api/company/index.js @@ -0,0 +1,514 @@ +// 获取人员基本信息详情 + + + +// import { post, get } from '../../utils/request.js' + +// export function getPersonInfo(id) { +// return get({ +// url: `personnel/personBaseInfo/${id}`, +// method: 'get' +// }) +// } + +import request from '@/utilsRc/request' + +// 根据 userId 获取企业详情 +export function companyDetails(userId) { + return request({ + method: 'get', + url: `/company/unitBaseInfo/user/${userId}`, + }) +} + +// 企业-推荐人员信息 +export function recommendedPerson(params) { + return request({ + url: '/company/unitBaseInfo/recommend/person', + method: 'get', + params + }) +} + +// 人员邀请 +export function invitePerson(params) { + return request({ + url: '/company/unitBaseInfo/invite', + method: 'get', + params + }) +} + +// 获取企业招聘岗位列表 +export function jobList(params) { + return request({ + url: '/company/unitPostInfo/list', + method: 'get', + params + }) +} + +// 查找已投递、已推荐、已邀请的人员信息 +export function listMatch(query) { + return request({ + url: '/company/unitBaseInfo/relevance', + method: 'get', + params: query + }) +} + +// 添加企业基本信息 +export function addJobBase(data) { + return request({ + url: '/company/unitBaseInfo', + method: 'post', + data: data + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/center/user/deptTree', + method: 'get' + }) +} + +// 企业发布招聘岗位 +export function addJob(data) { + return request({ + url: '/company/unitPostInfo', + method: 'post', + data: data + }) +} + +// 获取招聘工种列表 +export function jobTypeList(params) { + return request({ + url: '/basicdata/workType/list', + method: 'get', + params + }) +} + +// 企业基本信息列表 +export function jobBaseList(query) { + return request({ + url: '/company/unitBaseInfo/list', + method: 'get', + params: query + }) +} + +// 获取企业招聘岗位信息详细信息 +export function getJob(id) { + return request({ + url: `/company/unitPostInfo/${id}`, + method: 'get' + }) +} +// 修改企业招聘岗位信息 +export function updateJob(data) { + return request({ + url: '/company/unitPostInfo', + method: 'put', + data: data + }) +} + +// 修改企业基本信息 +export function updateJobBase(data) { + return request({ + url: '/company/unitBaseInfo', + method: 'put', + data: data + }) +} +// 查询角色详细 +export function getJobService(id) { + return request({ + url: '/personnel/personBaseInfo/' + id, + method: 'get' + }) +} + +// 查询推荐人员、已推荐、已邀请 详情 +export function getUnitBaseInfo(id) { + return request({ + url: '/manage/personDemand/' + id, + method: 'get' + }) +} + + +// 查询工种列表 +export function listJobType(query) { + return request({ + url: '/basicdata/workType/list', + method: 'get', + params: query + }) +} + +// 人员基本信息 - 列表 +export function personInfoList(query) { + return request({ + url: '/personnel/personBaseInfo/list', + method: 'get', + params: query + }) +} + +// 获取人员基本信息详情 +export function getPersonInfo(id) { + return request({ + url: `/personnel/personBaseInfo/${id}`, + method: 'get' + }) +} + + +// 删除人员基本信息 +export function delPersonInfo(ids) { + return request({ + url: '/personnel/personBaseInfo/' + ids, + method: 'delete' + }) +} + +// 删除录入人员 公用 type = 1 失业中 2 就业困难 3 离校生 4 其他人员 +export function delPersonUser(ids) { + return request({ + url: `/personnel/personInputInfo/${ids}`, + method: 'delete', + }) +} + +// 新增人员基本信息 +export function addPersonInfo(data) { + return request({ + url: '/personnel/personBaseInfo', + method: 'post', + data: data + }) +} + +// 修改人员基本信息 +export function updatePersonInfo(data) { + return request({ + url: '/personnel/personBaseInfo', + method: 'put', + data + }) +} + +//社区人员审核 +export function personInfoAudit(data) { + return request({ + url: '/personnel/personBaseInfo/audit', + method: 'post', + data: data + }) +} + + +//记录查看身份证 +export function recordLookIdCard(params) { + return request({ + url: '/personnel/personBaseInfo/recordLookIdCard', + method: 'get', + params + }) +} + + + + +/* 失业人员 --------------------------------------------- start */ + +// 新增失业人员 +export function addPersonUnemployed(data) { + return request({ + url: '/person/unemployment', + method: 'post', + data + }) +} + +// 失业人员修改 +export function updatePersonUnemployed(data) { + return request({ + url: '/person/unemployment', + method: 'put', + data, + }) +} + +// 失业人员列表 +export function unemployment(params) { + return request({ + url: '/person/unemployment/list', + method: 'get', + params + }) +} + +// 失业人员详情 +export function unemploymentDetails(id) { + return request({ + url: `/person/unemployment/${id}`, + method: 'get', + }) +} + +// 失业人员删除 +export function unemploymentDelete(id) { + return request({ + url: `/person/unemployment/${id}`, + method: 'delete', + }) +} + +/* 失业人员 --------------------------------------------- end */ + + +/* 就业困难人员 --------------------------------------------- start */ + +// 新增就业困难 +export function addPersonDifficult(data) { + return request({ + url: '/person/findingEmployment', + method: 'post', + data + }) +} + +// 修改就业困难 +export function updatePersonDifficult(data) { + return request({ + url: '/person/findingEmployment', + method: 'put', + data + }) +} + +// 就业困难列表 +export function findingEmployment(params) { + return request({ + url: '/person/findingEmployment/list', + method: 'get', + params + }) +} + +// 就业困难详情 +export function findingEmploymentDetails(id) { + return request({ + url: `/person/findingEmployment/${id}`, + method: 'get', + }) +} + +// 就业困难删除 +export function findingEmploymentDelete(id) { + return request({ + url: `/person/findingEmployment/${id}`, + method: 'delete', + }) +} +/* 就业困难人员 --------------------------------------------- end */ + + +/* 离校未就业高校生 --------------------------------------------- start */ + +// 新增离校未就业高校生 +export function addLeaveSchool(data) { + return request({ + url: '/person/leavingSchoolInfo', + method: 'post', + data + }) +} + +// 修改离校未就业高校生 +export function updateLeaveSchool(data) { + return request({ + url: '/person/leavingSchoolInfo', + method: 'put', + data, + }) +} + +// 高校未就业列表 +export function leavingSchoolInfo(params) { + return request({ + url: '/person/leavingSchoolInfo/list', + method: 'get', + params + }) +} + +// 高校未就业详情 +export function leavingSchoolInfoDetails(id) { + return request({ + url: `/person/leavingSchoolInfo/${id}`, + method: 'get', + }) +} + + +// 高校未就业删除 +export function leavingSchoolInfoDelete(id) { + return request({ + url: `/person/leavingSchoolInfo/${id}`, + method: 'delete', + }) +} + + +/* 离校未就业高校生 --------------------------------------------- end */ + +/* 其他人员 --------------------------------------------- start */ + +// 新增其他人员 +export function addOther(data) { + return request({ + url: '/person/other', + method: 'post', + data + }) +} + +// 其他人员修改 +export function updateOther(data) { + return request({ + url: '/person/other', + method: 'post', + data, + }) +} + + +// 其他人员列表 +export function other(params) { + return request({ + url: '/person/other/list', + method: 'get', + params + }) +} + +// 其他人员详情 +export function otherDetails(id) { + return request({ + url: `/person/other/${id}`, + method: 'get', + }) +} + +// 其他人员删除 +export function otherDelete(id) { + return request({ + url: `/person/other/${id}`, + method: 'delete', + }) +} +/* 其他人员 --------------------------------------------- end */ + +// 需求预警列表 +export function personAlertList(params) { + return request({ + url: '/manage/personDemand/warningList', + method: 'get', + params + }) +} +export function personDealList(params) { + return request({ + url: '/manage/personDemand/dealingList', + method: 'get', + params + }) +} +// 服务追踪 服务类型/服务id +export function serviceTraceability({ + demandType, + id +}) { + return request({ + // url: `/system/personRequirementsRecords/serviceTraceability/${demandType}/${id}`, + url: `/timelime/timelime/fwzs/${id}`, + method: 'get', + }) +} + +// 需求办结 +export function requirementCompletion(url, data) { + return request({ + url, + method: 'post', + data + }) +} + +//岗位审核 +export function jobAudit(data) { + return request({ + url: '/company/unitPostInfo/audit', + method: 'post', + data: data + }) +} + +//社群 首页未完成数 +// export function getPeopleCount() { +// return request({ +// url: '/pc/index/getPeopleCount', +// method: 'get', +// }) +// } + +//社群 首页未完成数 +export function getDemandUnfinished() { + return request({ + url: '/pc/index/todo', + method: 'get', + }) +} + + + +// 删除企业招聘岗位信息 +export function delJob(ids) { + return request({ + url: '/company/unitPostInfo/' + ids, + method: 'delete' + }) +} + +// 所在社区列表 +export function deptList(params) { + return request({ + 'url': `/system/center/user/deptList`, + 'method': 'get', + params + }) +} + +// 所在社区列表 +export function returnPerson(params) { + return request({ + 'url': `/personnel/personBaseInfo/returnPerson`, + 'method': 'get', + params + }) +} +// 根据人的身份证查询人的详细信息 +export function getIdNumberInfo(params) { + return request({ + 'url': `/personnel/personBaseInfo/getIdNumberInfo`, + 'method': 'get', + params + }) +} diff --git a/packageRc/api/jobType/index.js b/packageRc/api/jobType/index.js new file mode 100644 index 0000000..6be423e --- /dev/null +++ b/packageRc/api/jobType/index.js @@ -0,0 +1,15 @@ +/* + * @Date: 2025-10-31 11:06:15 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 10:28:16 + */ +import { post, get } from '../../utils/request.js' + +import request from '@/utilsRc/request' +export function listJobType(query) { + return request({ + url: '/basicdata/workType/list', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/packageRc/api/login.js b/packageRc/api/login.js new file mode 100644 index 0000000..ec0f13a --- /dev/null +++ b/packageRc/api/login.js @@ -0,0 +1,18 @@ +/* + * @Date: 2025-10-31 11:06:15 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 12:26:41 + */ +import request from '@/utilsRc/request' + +// 登录方法 +export function login(data) { + return request({ + method: 'post', + url: '/personnel/personBaseInfo/loginGrAndQy', + data, + headers: { + isToken: false + } + }) +} diff --git a/packageRc/api/needs/person.js b/packageRc/api/needs/person.js new file mode 100644 index 0000000..186823d --- /dev/null +++ b/packageRc/api/needs/person.js @@ -0,0 +1,34 @@ +/* + * @Date: 2025-10-31 11:06:15 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 10:28:27 + */ +// 人员接口 +import { post, get } from '../../utils/request.js' +import request from '@/utilsRc/request' +export function getPersonBase(params) { + return request({ + url: '/personnel/personBaseInfo/list', + method: 'get', + + params + }) +} +export function getPersonList(params) { + return request({ + url: '/personnel/personBaseInfo/list', + method: 'get', + params + }) +} + + +// 新增角色 +export function addInvestigate(data) { + return request({ + // url: '//process/processInterview', + url: '//timelime/timelime', + method: 'post', + data: data + }) +} diff --git a/packageRc/api/needs/personDemand.js b/packageRc/api/needs/personDemand.js new file mode 100644 index 0000000..12d61d3 --- /dev/null +++ b/packageRc/api/needs/personDemand.js @@ -0,0 +1,52 @@ +/* + * @Date: 2025-11-03 08:48:44 + * @LastEditors: shirlwang + * @LastEditTime: 2025-11-03 10:28:31 + */ +// 查询个人需求信息列表 +import { post, get } from '../../utils/request.js' +import request from '@/utilsRc/request' +export function listPersonDemand(query) { + return request({ + method: 'get', + url: '/manage/personDemand/list', + + params: query + }) +} +export function delPersonDemand(id) { + return request({ + url: '/manage/personDemand/' + id, + method: 'delete' + }) +} + + +// 查询个人需求信息详细 +export function getPersonDemand(id) { + return request({ + method: 'get', + url: '/manage/personDemand/' + id, + }) +} + +// 新增个人需求信息 +export function addPersonDemand(data) { + // 确保传递数据前进行日志输出 + console.log('addPersonDemand函数接收到的数据:', data); + return request({ + url: '/manage/personDemand', + method: 'post', // 修改为大写POST,确保请求参数正确传递 + data: data + }) +} + +// 修改个人需求信息 +export function updatePersonDemand(data) { + return request({ + url: '/manage/personDemand', + method: 'put', + data: data + }) +} + diff --git a/packageRc/api/personinfo/index.js b/packageRc/api/personinfo/index.js new file mode 100644 index 0000000..6bfad05 --- /dev/null +++ b/packageRc/api/personinfo/index.js @@ -0,0 +1,43 @@ +import { post, get } from '../../utils/request.js' +import request from '@/utilsRc/request' + +// 登录方法 +export function personInfoList(data) { + return request({ + method: 'get', + url: '/personnel/personBaseInfo/list', + params: data, + }) +} +// 需求预警列表 +export function personAlertList(params) { + return request({ + method: 'get', + url: '/manage/personDemand/warningList', + + params + }) +} +//经办人数据获取 +export function getJbrInfo() { + return request({ + method: 'get', + url: `system/center/user/selectHxjbr`, + method: 'get' + }) +} +export function getPersonBase() { + return request({ + method: 'get', + url: `system/center/user/selectHxjbr`, + method: 'get' + }) +} +export function returnPerson(params) { + return request({ + method: 'get', + 'url': `/personnel/personBaseInfo/returnPerson`, + + params + }) +} \ No newline at end of file diff --git a/packageRc/components/PopupLists.vue b/packageRc/components/PopupLists.vue new file mode 100644 index 0000000..589cf89 --- /dev/null +++ b/packageRc/components/PopupLists.vue @@ -0,0 +1,374 @@ + + + + + + + + {{ item.dictLabel }} + + + + + + + + + + + {{ item.name }} + + + + + + {{ itm.dictLabel }} + + + + + + + + + + 清空 + + 查询 + + + + + + + + + + + + + + diff --git a/packageRc/components/exitPopup.vue b/packageRc/components/exitPopup.vue new file mode 100644 index 0000000..72e3f98 --- /dev/null +++ b/packageRc/components/exitPopup.vue @@ -0,0 +1,130 @@ + + + + + + 退出登录 + + {{nick || '--'}} + 确定要退出当前账号吗? + + + + + + + + + + + diff --git a/packageRc/components/placePicker.vue b/packageRc/components/placePicker.vue new file mode 100644 index 0000000..2baebaa --- /dev/null +++ b/packageRc/components/placePicker.vue @@ -0,0 +1,203 @@ + + + + + + + 您已选择:{{ checkedMarker.name }}({{ checkedMarker.address }}) + + {{ item.name }} + {{ item.address }} + + + + + + 取 消 + 确 定 + + + + + + + + + diff --git a/packageRc/pages/daiban/addbangfu.vue b/packageRc/pages/daiban/addbangfu.vue new file mode 100644 index 0000000..452fdfc --- /dev/null +++ b/packageRc/pages/daiban/addbangfu.vue @@ -0,0 +1,969 @@ + + + + + + + + + + 被帮扶对象 + + + + + 帮扶方式 + + + + {{ getDemandTypeLabel(serviceForm.demandType) || "请选择" }} + ▼ + + + + + + {{ option.label }} + + + + + + + 帮扶时间 * + + + {{ serviceForm.practicalSolutionTime }} + 请选择 + ✏️ + + + + + + 经办人 + + + + + + + + + 电话沟通结果 + + {{ getDhgtjgLabel(serviceForm.dhgtjg) || "请选择" }} + ▼ + + + + + 帮扶内容 + + + + {{ getServiceContentLabel(serviceForm.serviceContent) || "请选择" }} + ▼ + + + + + + + + + 帮扶情况说明 + + + + + + + + + 帮扶情况说明 + + + + 添加图片 ({{ fileList.length }}/6) + + + + + 删除 + + + + + + + + + + + + + + + + + + + + + + + 附件 + + + 上传附件 (最多6个) + + + + + {{ file.name }} + 删除 + + + + + + + + + + + 取消 + 保存 + + + + + + + + 取消 + {{ getPickerTitle(currentPicker) }} + 确定 + + + + + + + + {{ option.label }} + + + + + + + + + + + diff --git a/packageRc/pages/daiban/daiban.vue b/packageRc/pages/daiban/daiban.vue new file mode 100644 index 0000000..bda6924 --- /dev/null +++ b/packageRc/pages/daiban/daiban.vue @@ -0,0 +1,599 @@ + + + + + + + + + 重点毕业生数 + 1120 + + | + + 累计需求数 + 1120 + + | + + 累计服务数 + 1120 + + + + + + + 毕业生追踪 + + + 点击查看 + + + + + + + 任务下发管理员 + + + 点击查看 + + + + + + 待办需求预警列表 + 共 {{jobList1count}}条信息 + + + 销售顾问 + + 待办内容文字示例待办内容文字示例待办内容文字示例待办内容文字示例 + + + 发起时间:2025-09-24 15:02 + 青岛xx公司 + + + + 待服务毕业生列表 + 共 {{jobListcount}} 条信息 + + + + + + + + 姓名{{item.name}} + ·未服务 + + + 年龄:27岁 + 服务次数:1次 + + + + + 联系电话:152****5488 + 详细地址:{{item.xxdz}} + + + 退回 + 服务 + + + + + + + + + + + + 取消 + 确认退回 + + + + + + + + + \ No newline at end of file diff --git a/packageRc/pages/daiban/daibandetail.vue b/packageRc/pages/daiban/daibandetail.vue new file mode 100644 index 0000000..3a10a50 --- /dev/null +++ b/packageRc/pages/daiban/daibandetail.vue @@ -0,0 +1,1442 @@ + + + + + + + + + + + 服务详情 + + + + + + + + + + 服务次数 {{ serviceTotal }} + 查看> + + + + + {{ form?.name || '' }} + + 男 + 女 + · + {{ calculateAge(form.cardNumber) }}岁 + + + {{ form.phone }} + + + + + + + + + 服务 + + + + + + + 求职需求数 + + + {{ jobSearchList.length }} + + + + 创业需求数 + + + {{ listOfEntrepreneurialNeeds.length }} + + + + 培训需求数 + + + {{ trainingList.length }} + + + + 其他需求数 + + + {{ otherList.length }} + + + + + + + + {{ + getJobWorkTypeName(item.jobWorkType) + }} + + 期望薪资: + + {{ item.minRecruitmentSalary}}- + {{ item.highRecruitmentSalary}} + /月 + + + + 希望工作地点: + {{ item.addressDesc }} + + + 待处理 + 处理中 + 已完成 + + + + + + 推荐 + 办结 + + + + + + + + + + {{ item.personName }}的创业需求 + + + 是否意有场地需求: + {{ item.ywcdxq }} + + + 是否意向参加创业培训: + {{ item.ywcypxxq }} + + + 是否有资金需求: + {{ item.ywzjxq }} + + + 待处理 + 处理中 + 已完成 + + + + + + 办理 + + + + + + + + + + {{ item.personName }}的培训需求 + + + 培训意愿工种: + {{ getJobWorkTypeName(item.qwpxgz) }} + + + 期望培训时间: + {{ item.qwpxsj }} + + + + 待处理 + 处理中 + 已完成 + + + + + + + 办理 + + + + + + + + + + {{ item.personName }}的其他需求 + + + + 需求说明: + {{ item.jobDescription }} + + + + 待处理 + 处理中 + 已完成 + + + + + + + 办理 + + + + + + + + + + + + + + + 求职需求 + + + + 创业需求 + + + + 培训需求 + + + + 其他需求 + + 取 消 + + + + + + + + + + + diff --git a/packageRc/pages/demand/components/ImageUpload.vue b/packageRc/pages/demand/components/ImageUpload.vue new file mode 100644 index 0000000..bffbea0 --- /dev/null +++ b/packageRc/pages/demand/components/ImageUpload.vue @@ -0,0 +1,158 @@ + + + + + + + + + + diff --git a/packageRc/pages/demand/components/assistService.vue b/packageRc/pages/demand/components/assistService.vue new file mode 100644 index 0000000..9680577 --- /dev/null +++ b/packageRc/pages/demand/components/assistService.vue @@ -0,0 +1,439 @@ + + + + + + + 需求信息 + 编辑 + + + + + + {{ formData.personName || '请选择' }} + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 重置 + 保存 + + + + + + + diff --git a/packageRc/pages/demand/components/choosePerson.vue b/packageRc/pages/demand/components/choosePerson.vue new file mode 100644 index 0000000..c608a0f --- /dev/null +++ b/packageRc/pages/demand/components/choosePerson.vue @@ -0,0 +1,133 @@ + + + + + + + + + {{ item.name }} + {{ item.phone }} + + + 现居住地:{{item.currentResidentialAddress}} + + + + 取消 + 重置 + 确定 + + + + + + + + + diff --git a/packageRc/pages/demand/components/entrepreneurshipService.vue b/packageRc/pages/demand/components/entrepreneurshipService.vue new file mode 100644 index 0000000..4c91349 --- /dev/null +++ b/packageRc/pages/demand/components/entrepreneurshipService.vue @@ -0,0 +1,636 @@ + + + + + + 创业需求信息 + 编辑✏️ + + + + + 姓名 * + + {{ formData.personName || '请选择' }} + + + {{ formData.personName || '请选择' }} + + ✏️ + + + 有无场地需求 * + + + + 是 + + + + 否 + + {{ formData.ywcdxq }} + + + + 场地面积 + + + ✏️ + + + 办公人数 + + ✏️ + + + 办公位置 + + ✏️ + + + 有无创业培训需求 * + + + + 是 + + + + 否 + + {{ formData.ywcypxxq }} + + + + + + + + + + + 有无资金需求 * + + + + 是 + + + + 否 + + {{ formData.ywzjxq }} + + + + 需求说明 * + + + + + + + + + + + + + + + + + + + + + 取消 + 重置 + 保存 + + + + + + + diff --git a/packageRc/pages/demand/components/jobService.vue b/packageRc/pages/demand/components/jobService.vue new file mode 100644 index 0000000..a6243bc --- /dev/null +++ b/packageRc/pages/demand/components/jobService.vue @@ -0,0 +1,930 @@ + + + + + + 求职需求信息 + 编辑✏️ + + + + + 姓名 * + + {{ formData.personName || '请选择' }} + + + {{ formData.personName || '请选择' }} + + ✏️ + + + + + + 求职工种 + + + {{ formData.jobWorkTypeName || '请选择工种' }} + ▼ + + + + 工种数据加载中... + + + + + + + 最低薪酬 * + + ✏️ + + + 最高薪酬 * + + ✏️ + + + + + 希望工作地点 + + + + 求职说明 * + + + + + + + + + + + + + + + + + + 取消 + 重置 + 保存 + + + + + + + + diff --git a/packageRc/pages/demand/components/otherService.vue b/packageRc/pages/demand/components/otherService.vue new file mode 100644 index 0000000..d40a725 --- /dev/null +++ b/packageRc/pages/demand/components/otherService.vue @@ -0,0 +1,403 @@ + + + + + + 需求信息 + 编辑✏️ + + + + + 姓名 * + + {{ formData.personName || '请选择' }} + + + {{ formData.personName || '请选择' }} + + ✏️ + + + + 需求说明 * + + + + + + + + + + + + + + 取消 + 重置 + 保存 + + + + + + + \ No newline at end of file diff --git a/packageRc/pages/demand/components/trainService.vue b/packageRc/pages/demand/components/trainService.vue new file mode 100644 index 0000000..cf6d66f --- /dev/null +++ b/packageRc/pages/demand/components/trainService.vue @@ -0,0 +1,795 @@ + + + + + + + 培训需求信息 + 编辑✏️ + + + + + 姓名 * + + {{ formData.personName || '请选择' }} + + + {{ formData.personName || '请选择' }} + + ✏️ + + + 培训意愿工种 * + + + {{ formData.qwpxgzName || '请选择工种' }} + ▼ + + + + 工种数据加载中... + + + + 期望培训时间 * + + + {{ formData.qwpxsj }} + 请选择 + ✏️ + + + + + 需求说明 * + + + + + + + + + + + + + + 取消 + 重置 + 保存 + + + + + + + diff --git a/packageRc/pages/demand/components/u-empty/props.js b/packageRc/pages/demand/components/u-empty/props.js new file mode 100644 index 0000000..78662f8 --- /dev/null +++ b/packageRc/pages/demand/components/u-empty/props.js @@ -0,0 +1,59 @@ +export default { + props: { + // 内置图标名称,或图片路径,建议绝对路径 + icon: { + type: String, + default: uni.$u.props.empty.icon + }, + // 提示文字 + text: { + type: String, + default: uni.$u.props.empty.text + }, + // 文字颜色 + textColor: { + type: String, + default: uni.$u.props.empty.textColor + }, + // 文字大小 + textSize: { + type: [String, Number], + default: uni.$u.props.empty.textSize + }, + // 图标的颜色 + iconColor: { + type: String, + default: uni.$u.props.empty.iconColor + }, + // 图标的大小 + iconSize: { + type: [String, Number], + default: uni.$u.props.empty.iconSize + }, + // 选择预置的图标类型 + mode: { + type: String, + default: uni.$u.props.empty.mode + }, + // 图标宽度,单位px + width: { + type: [String, Number], + default: uni.$u.props.empty.width + }, + // 图标高度,单位px + height: { + type: [String, Number], + default: uni.$u.props.empty.height + }, + // 是否显示组件 + show: { + type: Boolean, + default: uni.$u.props.empty.show + }, + // 组件距离上一个元素之间的距离,默认px单位 + marginTop: { + type: [String, Number], + default: uni.$u.props.empty.marginTop + } + } +} diff --git a/packageRc/pages/demand/components/u-empty/u-empty.vue b/packageRc/pages/demand/components/u-empty/u-empty.vue new file mode 100644 index 0000000..a35c44b --- /dev/null +++ b/packageRc/pages/demand/components/u-empty/u-empty.vue @@ -0,0 +1,128 @@ + + + + + {{text ? text : icons[mode]}} + + + + + + + + + diff --git a/packageRc/pages/demand/demandail.vue b/packageRc/pages/demand/demandail.vue new file mode 100644 index 0000000..8819892 --- /dev/null +++ b/packageRc/pages/demand/demandail.vue @@ -0,0 +1,196 @@ + + + + + + {{isAdd ? '需求新增' : '需求维护'}} + + + + 求职需求 + + 创业需求 + + 培训需求 + + 其他需求 + + + + + + + + + + + + + + + diff --git a/packageRc/pages/index/index.vue b/packageRc/pages/index/index.vue new file mode 100644 index 0000000..af88c8a --- /dev/null +++ b/packageRc/pages/index/index.vue @@ -0,0 +1,268 @@ + + + + + + + + + 信息维护 + + + + 投递记录 + + + + 需求上报 + + + + 虚拟面试 + + + + 素质测评 + + + + 岗位列表 + 实习实训 + 社区实践 + + + 推荐岗位 + 热门岗位 + + + + 4000-8000/月 + 发布日期:2025-10-20 + + 销售顾问 + + 大专 + 1-3年 + 喀什 市南区 + + + 6人 + 青岛xx公司 + + + 查看更多内容 + + 政策专区 + {{'查看更多 >'}} + + + 推荐 + + + 销售顾问 + + 大专 + 1-3年 + 喀什 市南区 + + + 发布日期:2025-10-20 + 浏览数99+ + + + + + + + + + \ No newline at end of file diff --git a/packageRc/pages/personalList/personalList.vue b/packageRc/pages/personalList/personalList.vue new file mode 100644 index 0000000..9f631dc --- /dev/null +++ b/packageRc/pages/personalList/personalList.vue @@ -0,0 +1,1004 @@ + + + + + + + + + + + + + + + + {{ filterTotal > 0 ? '筛选+' + filterTotal : '筛选' }} + + + + + 共{{ total }}条信息 + + + + + + + + + + + + + + {{ item.label }} + + + + + + + + + + + + {{ + job.name || "-" + }} + + 年龄: + {{ + job.age || "--" + }}岁 + 服务次数: + {{ + job.operateNum + }}次 + + + + + •未服务 + •已服务 + •联系不上 + •拒绝服务 + •被退回 + + + + 证件号: + {{ job.cardNumber }} + {{ encryptIdCard(job.cardNumber) }} + + + + + + 联系电话: + {{ job.phone }} + + + 详细地址: + {{ job.currentResidentialAddress || "--" }} + + + 退回 + 服务 + 就业登记 + + + + + + + + + + + + 取消 + 确定 + + + + 服务状态: + + {{ item.dictLabel }} + + + + 性别: + + {{ item.dictLabel }} + + + + 学历: + + {{ item.dictLabel }} + + + + 人员类型: + + {{ item.dictLabel }} + + + + 人员状态: + + {{ item.dictLabel }} + + + + + 是否退回: + + {{ item.dictLabel }} + + + + + + + + + + + + + + 服务状态: + + {{ item.dictLabel }} + + + + + + + + + + + + + + + 通过 + + + 不通过 + + + + + + + + + + + + + + + + 退回 + + + + + + + + + + + + + + + + + + diff --git a/packageRc/pages/service/serviceDetail.vue b/packageRc/pages/service/serviceDetail.vue new file mode 100644 index 0000000..e69de29 diff --git a/packageRc/static/images/addPersonnel.png b/packageRc/static/images/addPersonnel.png new file mode 100644 index 0000000..06501aa Binary files /dev/null and b/packageRc/static/images/addPersonnel.png differ diff --git a/packageRc/static/images/person/addNeeds.png b/packageRc/static/images/person/addNeeds.png new file mode 100644 index 0000000..cfbf318 Binary files /dev/null and b/packageRc/static/images/person/addNeeds.png differ diff --git a/packageRc/static/images/person/femalepng.png b/packageRc/static/images/person/femalepng.png new file mode 100644 index 0000000..360adc6 Binary files /dev/null and b/packageRc/static/images/person/femalepng.png differ diff --git a/packageRc/static/images/person/fillInRecords.png b/packageRc/static/images/person/fillInRecords.png new file mode 100644 index 0000000..1fdabad Binary files /dev/null and b/packageRc/static/images/person/fillInRecords.png differ diff --git a/packageRc/static/images/person/malepng.png b/packageRc/static/images/person/malepng.png new file mode 100644 index 0000000..fc72c52 Binary files /dev/null and b/packageRc/static/images/person/malepng.png differ diff --git a/packageRc/static/images/selected.png b/packageRc/static/images/selected.png new file mode 100644 index 0000000..8efaa33 Binary files /dev/null and b/packageRc/static/images/selected.png differ diff --git a/packageRc/static/images/top.png b/packageRc/static/images/top.png new file mode 100644 index 0000000..e403e6c Binary files /dev/null and b/packageRc/static/images/top.png differ diff --git a/packageRc/static/kinggang1.png b/packageRc/static/kinggang1.png new file mode 100644 index 0000000..1f483d0 Binary files /dev/null and b/packageRc/static/kinggang1.png differ diff --git a/packageRc/static/kinggang2.png b/packageRc/static/kinggang2.png new file mode 100644 index 0000000..aa71fba Binary files /dev/null and b/packageRc/static/kinggang2.png differ diff --git a/packageRc/static/kinggang3.png b/packageRc/static/kinggang3.png new file mode 100644 index 0000000..a63dd78 Binary files /dev/null and b/packageRc/static/kinggang3.png differ diff --git a/packageRc/static/kinggang4.png b/packageRc/static/kinggang4.png new file mode 100644 index 0000000..58f7e42 Binary files /dev/null and b/packageRc/static/kinggang4.png differ diff --git a/packageRc/static/kinggang5.png b/packageRc/static/kinggang5.png new file mode 100644 index 0000000..4778133 Binary files /dev/null and b/packageRc/static/kinggang5.png differ diff --git a/packageRc/static/pageBg.png b/packageRc/static/pageBg.png new file mode 100644 index 0000000..21f5378 Binary files /dev/null and b/packageRc/static/pageBg.png differ diff --git a/packageRc/static/person/addEnterprise.png b/packageRc/static/person/addEnterprise.png new file mode 100644 index 0000000..3f8c52c Binary files /dev/null and b/packageRc/static/person/addEnterprise.png differ diff --git a/packageRc/static/person/addNeeds.png b/packageRc/static/person/addNeeds.png new file mode 100644 index 0000000..cfbf318 Binary files /dev/null and b/packageRc/static/person/addNeeds.png differ diff --git a/packageRc/static/person/addNeeds1.png b/packageRc/static/person/addNeeds1.png new file mode 100644 index 0000000..73a60a5 Binary files /dev/null and b/packageRc/static/person/addNeeds1.png differ diff --git a/packageRc/static/person/bannerCard-old.png b/packageRc/static/person/bannerCard-old.png new file mode 100644 index 0000000..41baa13 Binary files /dev/null and b/packageRc/static/person/bannerCard-old.png differ diff --git a/packageRc/static/person/bannerCard.png b/packageRc/static/person/bannerCard.png new file mode 100644 index 0000000..46a6169 Binary files /dev/null and b/packageRc/static/person/bannerCard.png differ diff --git a/packageRc/static/person/bannerCard_chu.png b/packageRc/static/person/bannerCard_chu.png new file mode 100644 index 0000000..e69de29 diff --git a/packageRc/static/person/bannerCard_old.png b/packageRc/static/person/bannerCard_old.png new file mode 100644 index 0000000..e69de29 diff --git a/packageRc/static/person/ditu.png b/packageRc/static/person/ditu.png new file mode 100644 index 0000000..055334e Binary files /dev/null and b/packageRc/static/person/ditu.png differ diff --git a/packageRc/static/person/empty.png b/packageRc/static/person/empty.png new file mode 100644 index 0000000..4f040fe Binary files /dev/null and b/packageRc/static/person/empty.png differ diff --git a/packageRc/static/person/enterprise.png b/packageRc/static/person/enterprise.png new file mode 100644 index 0000000..aa6db83 Binary files /dev/null and b/packageRc/static/person/enterprise.png differ diff --git a/packageRc/static/person/enterpriseIcon.png b/packageRc/static/person/enterpriseIcon.png new file mode 100644 index 0000000..0872690 Binary files /dev/null and b/packageRc/static/person/enterpriseIcon.png differ diff --git a/packageRc/static/person/entrepreneurialIcon.png b/packageRc/static/person/entrepreneurialIcon.png new file mode 100644 index 0000000..7c5c987 Binary files /dev/null and b/packageRc/static/person/entrepreneurialIcon.png differ diff --git a/packageRc/static/person/femalepng.png b/packageRc/static/person/femalepng.png new file mode 100644 index 0000000..360adc6 Binary files /dev/null and b/packageRc/static/person/femalepng.png differ diff --git a/packageRc/static/person/fillInRecords.png b/packageRc/static/person/fillInRecords.png new file mode 100644 index 0000000..1fdabad Binary files /dev/null and b/packageRc/static/person/fillInRecords.png differ diff --git a/packageRc/static/person/fillInRecords2.png b/packageRc/static/person/fillInRecords2.png new file mode 100644 index 0000000..8d16aad Binary files /dev/null and b/packageRc/static/person/fillInRecords2.png differ diff --git a/packageRc/static/person/firstTop.png b/packageRc/static/person/firstTop.png new file mode 100644 index 0000000..2305b0e Binary files /dev/null and b/packageRc/static/person/firstTop.png differ diff --git a/packageRc/static/person/header-botom.png b/packageRc/static/person/header-botom.png new file mode 100644 index 0000000..7d6a9b4 Binary files /dev/null and b/packageRc/static/person/header-botom.png differ diff --git a/packageRc/static/person/information.png b/packageRc/static/person/information.png new file mode 100644 index 0000000..cda168d Binary files /dev/null and b/packageRc/static/person/information.png differ diff --git a/packageRc/static/person/jiaofei.png b/packageRc/static/person/jiaofei.png new file mode 100644 index 0000000..ef3ff83 Binary files /dev/null and b/packageRc/static/person/jiaofei.png differ diff --git a/packageRc/static/person/jiazheng.png b/packageRc/static/person/jiazheng.png new file mode 100644 index 0000000..2c7be94 Binary files /dev/null and b/packageRc/static/person/jiazheng.png differ diff --git a/packageRc/static/person/jiuye.png b/packageRc/static/person/jiuye.png new file mode 100644 index 0000000..d1eee78 Binary files /dev/null and b/packageRc/static/person/jiuye.png differ diff --git a/packageRc/static/person/jobSeekingIcon.png b/packageRc/static/person/jobSeekingIcon.png new file mode 100644 index 0000000..7ca7c06 Binary files /dev/null and b/packageRc/static/person/jobSeekingIcon.png differ diff --git a/packageRc/static/person/keynote.png b/packageRc/static/person/keynote.png new file mode 100644 index 0000000..d574b2b Binary files /dev/null and b/packageRc/static/person/keynote.png differ diff --git a/packageRc/static/person/location.png b/packageRc/static/person/location.png new file mode 100644 index 0000000..abeac72 Binary files /dev/null and b/packageRc/static/person/location.png differ diff --git a/packageRc/static/person/malepng.png b/packageRc/static/person/malepng.png new file mode 100644 index 0000000..fc72c52 Binary files /dev/null and b/packageRc/static/person/malepng.png differ diff --git a/packageRc/static/person/quanzi.png b/packageRc/static/person/quanzi.png new file mode 100644 index 0000000..6014794 Binary files /dev/null and b/packageRc/static/person/quanzi.png differ diff --git a/packageRc/static/person/qxwq.png b/packageRc/static/person/qxwq.png new file mode 100644 index 0000000..b2f2c03 Binary files /dev/null and b/packageRc/static/person/qxwq.png differ diff --git a/packageRc/static/person/search.png b/packageRc/static/person/search.png new file mode 100644 index 0000000..9d1c865 Binary files /dev/null and b/packageRc/static/person/search.png differ diff --git a/packageRc/static/person/serviceFrequency.png b/packageRc/static/person/serviceFrequency.png new file mode 100644 index 0000000..977d7e0 Binary files /dev/null and b/packageRc/static/person/serviceFrequency.png differ diff --git a/packageRc/static/person/sheequ.png b/packageRc/static/person/sheequ.png new file mode 100644 index 0000000..2753254 Binary files /dev/null and b/packageRc/static/person/sheequ.png differ diff --git a/packageRc/static/person/staff.png b/packageRc/static/person/staff.png new file mode 100644 index 0000000..585ad6a Binary files /dev/null and b/packageRc/static/person/staff.png differ diff --git a/packageRc/static/person/summary.png b/packageRc/static/person/summary.png new file mode 100644 index 0000000..d266db3 Binary files /dev/null and b/packageRc/static/person/summary.png differ diff --git a/packageRc/static/person/summaryStatistics.png b/packageRc/static/person/summaryStatistics.png new file mode 100644 index 0000000..f8bd157 Binary files /dev/null and b/packageRc/static/person/summaryStatistics.png differ diff --git a/packageRc/static/person/title-left.png b/packageRc/static/person/title-left.png new file mode 100644 index 0000000..73e302e Binary files /dev/null and b/packageRc/static/person/title-left.png differ diff --git a/packageRc/static/person/tongzhi.png b/packageRc/static/person/tongzhi.png new file mode 100644 index 0000000..be2fc33 Binary files /dev/null and b/packageRc/static/person/tongzhi.png differ diff --git a/packageRc/static/person/toudi-icon.png b/packageRc/static/person/toudi-icon.png new file mode 100644 index 0000000..4143167 Binary files /dev/null and b/packageRc/static/person/toudi-icon.png differ diff --git a/packageRc/static/person/trainingIcon.png b/packageRc/static/person/trainingIcon.png new file mode 100644 index 0000000..64c5076 Binary files /dev/null and b/packageRc/static/person/trainingIcon.png differ diff --git a/packageRc/static/person/unread.png b/packageRc/static/person/unread.png new file mode 100644 index 0000000..44caeed Binary files /dev/null and b/packageRc/static/person/unread.png differ diff --git a/packageRc/static/person/zct.png b/packageRc/static/person/zct.png new file mode 100644 index 0000000..91b9cfd Binary files /dev/null and b/packageRc/static/person/zct.png differ diff --git a/packageRc/static/personIcon.png b/packageRc/static/personIcon.png new file mode 100644 index 0000000..29df64e Binary files /dev/null and b/packageRc/static/personIcon.png differ diff --git a/packageRc/static/personIconFe.png b/packageRc/static/personIconFe.png new file mode 100644 index 0000000..40aa250 Binary files /dev/null and b/packageRc/static/personIconFe.png differ diff --git a/packageRc/static/sendManager.png b/packageRc/static/sendManager.png new file mode 100644 index 0000000..874dad2 Binary files /dev/null and b/packageRc/static/sendManager.png differ diff --git a/packageRc/static/trace.png b/packageRc/static/trace.png new file mode 100644 index 0000000..8d4279d Binary files /dev/null and b/packageRc/static/trace.png differ diff --git a/packageRc/static/zcLeft.png b/packageRc/static/zcLeft.png new file mode 100644 index 0000000..ad4f93d Binary files /dev/null and b/packageRc/static/zcLeft.png differ diff --git a/packageRc/utils/auth.js b/packageRc/utils/auth.js new file mode 100644 index 0000000..e019fd6 --- /dev/null +++ b/packageRc/utils/auth.js @@ -0,0 +1,57 @@ +// 导入uni-app的存储API +import { encrypt, decrypt } from './sm2Encrypt.js' + +const TokenKey = 'Admin-Token-tzxmgl' + +export function getToken() { + return uni.getStorageSync(TokenKey) +} + +export function setToken(token) { + uni.removeStorageSync('userName') + return uni.setStorageSync(TokenKey, token) +} + +export function removeToken() { + return clearAllStorage() +} + +function clearAllStorage() { + // 清除所有相关存储 + uni.removeStorageSync(TokenKey) + uni.removeStorageSync('username') + uni.removeStorageSync('password') + uni.removeStorageSync('rememberMe') +} + +export function removeTokenFather() { + return uni.removeStorageSync('Admin-Token') +} + +// 保存用户名密码到本地 +export function saveUserInfo(username, password, rememberMe) { + if (rememberMe) { + uni.setStorageSync('username', username) + uni.setStorageSync('password', encrypt(password)) // 加密存储密码 + uni.setStorageSync('rememberMe', 'true') + } else { + removeUserInfo() + } +} + +// 清除用户信息 +export function removeUserInfo() { + uni.removeStorageSync('username') + uni.removeStorageSync('password') + uni.removeStorageSync('rememberMe') +} + +// 获取用户信息 +export function getUserInfo() { + const password = uni.getStorageSync('password') || '' + return { + username: uni.getStorageSync('username') || '', + password: password ? decrypt(password) : '', // 解密密码 + rememberMe: uni.getStorageSync('rememberMe') === 'true' + } +} \ No newline at end of file diff --git a/packageRc/utils/captchaApi.js b/packageRc/utils/captchaApi.js new file mode 100644 index 0000000..9761c3f --- /dev/null +++ b/packageRc/utils/captchaApi.js @@ -0,0 +1,94 @@ +// 验证码相关API +// 注意:这里使用uni.request进行封装,与项目其他API保持一致 + +/** + * 获取验证图片和token + * @param {Object} data - 请求参数,必须包含clientUid和ts + */ +export function reqGet(data) { + // 确保data对象存在 + const requestData = { ...data }; + + // 如果没有提供clientUid,生成一个 + if (!requestData.clientUid) { + requestData.clientUid = 'slider-' + Date.now() + '-' + Math.random().toString(36).substring(2, 15); + } + + // 如果没有提供ts,使用当前时间戳 + if (!requestData.ts) { + requestData.ts = Date.now(); + } + + return new Promise((resolve, reject) => { + uni.request({ + url: 'http://10.160.0.5:8907/captcha/get', + method: 'POST', + data: requestData, + header: { + 'Content-Type': 'application/json;charset=utf-8', + isToken: false + }, + success: (res) => { + // 检查响应是否有效 + if (res.statusCode === 200 && res.data) { + resolve(res.data); + } else { + reject(new Error('获取验证码图片失败:' + (res.statusCode || '未知错误'))); + } + }, + fail: (error) => { + console.error('验证码API请求失败:', error); + reject(new Error('网络请求失败,请检查网络连接')); + } + }); + }); +} + +/** + * 滑动或点选验证 + * @param {Object} data - 验证参数,必须包含clientUid、ts和token + */ +export function reqCheck(data) { + // 确保data对象存在 + const requestData = { ...data }; + + // 如果没有提供ts,使用当前时间戳 + if (!requestData.ts) { + requestData.ts = Date.now(); + } + + // 验证必要参数 + if (!requestData.clientUid) { + return Promise.reject(new Error('缺少必要参数:clientUid')); + } + if (!requestData.token) { + return Promise.reject(new Error('缺少必要参数:token')); + } + if (!requestData.pointJson) { + return Promise.reject(new Error('缺少必要参数:pointJson')); + } + + return new Promise((resolve, reject) => { + uni.request({ + url: 'http://10.160.0.5:8907/captcha/check', + method: 'POST', + data: requestData, + header: { + 'Content-Type': 'application/json;charset=utf-8', + isToken: false + }, + success: (res) => { + // 检查响应是否有效 + if (res.statusCode === 200 && res.data) { + resolve(res.data); + } else { + reject(new Error('验证码验证失败:' + (res.statusCode || '未知错误'))); + } + }, + fail: (error) => { + console.error('验证码验证请求失败:', error); + reject(new Error('网络请求失败,请检查网络连接')); + } + }); + }); +} \ No newline at end of file diff --git a/packageRc/utils/request.js b/packageRc/utils/request.js new file mode 100644 index 0000000..e0c695a --- /dev/null +++ b/packageRc/utils/request.js @@ -0,0 +1,149 @@ +// 导入当前目录下的auth.js,使用更具体的路径以避免混淆 +import { getToken } from './auth.js'; + +// 配置API基础URL +const baseURL = 'http://10.160.0.5:8907/' + +// 是否显示重新登录 +export let isRelogin = { show: false } + +/** + * 封装uni.request + * @param {Object} options - 请求配置 + */ +export function request(options) { + // 显示加载状态 + if (options.load) { + uni.showLoading({ + title: '请稍候', + mask: true + }) + } + + return new Promise((resolve, reject) => { + // 是否需要设置token + const isToken = options.headers && options.headers.isToken === false + + // 添加固定的Authorization token + if (!isToken) { + options.headers = options.headers || {} + options.headers['Authorization'] = 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJsNDRvNmhxckdOOW1XcG1pWlpJcXZ0UXJMdGsyTlFhQSIsInVzZXJJZCI6MX0.K5H-Rpof9oI1CCIEtheEQ96XGAxPWS7tzyjPbXwAXrQ' + } + + // 确保URL是字符串类型 + let url = options.url; + console.log("options.url:", url) + if (typeof url !== 'string') { + console.error('URL must be a string:', url); + url = String(url); + } + + // 发起请求 + uni.request({ + url: baseURL + url, + method: options.method || 'GET', + data: options.data || {}, + header: options.headers || { + 'Content-Type': 'application/json;charset=utf-8' + }, + timeout: options.timeout || 60000, + success: (res) => { + // 二进制数据直接返回 + if (res.header['content-type'] && res.header['content-type'].includes('application/octet-stream')) { + resolve(res.data) + return + } + + // 处理状态码 + const code = res.data.code || 200 + + // 401错误处理 + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true + uni.showModal({ + title: '登录过期', + content: '登录状态已过期,是否重新登录?', + success: (res) => { + isRelogin.show = false + if (res.confirm) { + // 跳转到登录页面 + uni.navigateTo({ + url: '/packageRc/pages/login/login' + }) + } + } + }) + } + reject(new Error('登录过期,请重新登录')) + return + } + + // 其他错误处理 + if (code !== 200) { + uni.showToast({ + title: res.data.msg || '请求失败', + icon: 'none' + }) + reject(res.data) + return + } + + resolve(res.data) + }, + fail: (error) => { + uni.showToast({ + title: '网络错误,请稍后重试', + icon: 'none' + }) + reject(error) + }, + complete: () => { + // 隐藏加载状态 + if (options.load) { + uni.hideLoading() + } + } + }) + }) +} + +// 封装GET请求 +export function get(config) { + if (typeof config === 'string') { + // 兼容旧的调用方式: get(url, params, options) + const params = arguments[1] || {}; + const options = arguments[2] || {}; + return request({ + url: config, + method: 'GET', + data: params, + ...options + }) + } + // 支持配置对象的调用方式: get({url, data, ...}) + return request({ + method: 'GET', + ...config + }) +} + +// 封装POST请求 +export function post(config) { + if (typeof config === 'string') { + // 兼容旧的调用方式: post(url, data, options) + const data = arguments[1] || {}; + const options = arguments[2] || {}; + return request({ + url: config, + method: 'POST', + data, + ...options + }) + } + // 支持配置对象的调用方式: post({url, data, ...}) + return request({ + method: 'POST', + ...config + }) +} diff --git a/packageRc/utils/sm2Encrypt.js b/packageRc/utils/sm2Encrypt.js new file mode 100644 index 0000000..d22effc --- /dev/null +++ b/packageRc/utils/sm2Encrypt.js @@ -0,0 +1,34 @@ +// 为了解决"For input string: OG"错误,我们需要确保加密输出格式正确 +// 这里直接使用最简单的字符串处理方式,避免任何可能的格式问题 + +/** + * 简化的加密函数,返回简单的字符串,避免base64可能导致的格式问题 + */ +export function encrypt(txt) { + try { + console.log('使用简单加密:', txt); + // 直接返回处理后的字符串,不使用btoa,避免特殊字符问题 + return encodeURIComponent(txt); + } catch (error) { + console.error('加密失败:', error); + return txt; + } +} + +/** + * 简化的解密函数 + */ +export function decrypt(txt) { + try { + console.log('使用简单解密:', txt); + return decodeURIComponent(txt); + } catch (error) { + console.error('解密失败:', error); + return txt; + } +} + +// 为了与原始接口保持兼容 +export function encryptWithKey(text, publicKey) { + return encrypt(text); +} \ No newline at end of file diff --git a/pages.json b/pages.json index e638521..fca66c3 100644 --- a/pages.json +++ b/pages.json @@ -413,7 +413,55 @@ } } ] - }], + }, + { + "root": "packageRc", + "pages": [ + { + "path" : "pages/index/index", + "style" : + { + "navigationBarTitleText" : "高校毕业生智慧就业" + } + } , { + "path": "pages/personalList/personalList", + "style": { + "navigationBarTitleText": "添加帮扶" + } + },{ + "path": "pages/daiban/daiban", + "style": { + "navigationBarTitleText": "待办任务" + // "navigationBarBackgroundColor": "#4778EC", + // "navigationBarTextStyle": "white" + } + }, + { + "path": "pages/daiban/daibandetail", + "style": { + "navigationBarTitleText": "待办详情", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white" + } + }, + + { + "path": "pages/demand/demandail", + "style": { + "navigationBarTitleText": "新增需求", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white" + } + } , { + "path": "pages/daiban/addbangfu", + "style": { + "navigationBarTitleText": "添加帮扶", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white" + } + } + ] + }], // "tabBar": { // "custom": true, // "color": "#5E5F60", diff --git a/uni_modules/uni-data-select/changelog.md b/uni_modules/uni-data-select/changelog.md new file mode 100644 index 0000000..1681eae --- /dev/null +++ b/uni_modules/uni-data-select/changelog.md @@ -0,0 +1,51 @@ +## 1.1.0(2025-08-19) +- 新增 插槽 selected empty option +- 新增 mutiple 属性,支持多选功能 +- 新增 wrap 属性,支持选中的文字超过一行显示 +- 新增 align 属性,支持修改选中的文字显示的位置 +- 新增 hideRight 属性,支持隐藏右侧所有按钮 +- 新增 mode 属性,支持修改边框样式 +- 新增 事件 open close clear +## 1.0.10(2025-04-14) +- 修复 清除按钮不展示问题 +## 1.0.9(2025-03-26) +- 优化 默认背景为白色与整体组件保持风格统一 +## 1.0.8(2024-03-28) +- 修复 在vue2下:style动态绑定导致编译失败的bug +## 1.0.7(2024-01-20) +- 修复 长文本回显超过容器的bug,超过容器部分显示省略号 +## 1.0.6(2023-04-12) +- 修复 微信小程序点击时会改变背景颜色的 bug +## 1.0.5(2023-02-03) +- 修复 禁用时会显示清空按钮 +## 1.0.4(2023-02-02) +- 优化 查询条件短期内多次变更只查询最后一次变更后的结果 +- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue +## 1.0.3(2023-01-16) +- 修复 不关联服务空间报错的问题 +## 1.0.2(2023-01-14) +- 新增 属性 `format` 可用于格式化显示选项内容 +## 1.0.1(2022-12-06) +- 修复 当where变化时,数据不会自动更新的问题 +## 0.1.9(2022-09-05) +- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框 +## 0.1.8(2022-08-29) +- 修复 点击的位置不准确 +## 0.1.7(2022-08-12) +- 新增 支持 disabled 属性 +## 0.1.6(2022-07-06) +- 修复 pc端宽度异常的bug +## 0.1.5 +- 修复 pc端宽度异常的bug +## 0.1.4(2022-07-05) +- 优化 显示样式 +## 0.1.3(2022-06-02) +- 修复 localdata 赋值不生效的 bug +- 新增 支持 uni.scss 修改颜色 +- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用) +## 0.1.2(2022-05-08) +- 修复 当 value 为 0 时选择不生效的 bug +## 0.1.1(2022-05-07) +- 新增 记住上次的选项(仅 collection 存在时有效) +## 0.1.0(2022-04-22) +- 初始化 diff --git a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue new file mode 100644 index 0000000..85b2d7b --- /dev/null +++ b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue @@ -0,0 +1,837 @@ + + + {{label + ':'}} + + + + + + + + + {{textShow}} + + {{typePlaceholder}} + + + + + + + + + + + + + + + + + + + + {{emptyTips}} + + + + + + + + + + {{formatItemName(item)}} + + + + + + {{formatItemName(item)}} + + + + + + + + + + + + + + diff --git a/uni_modules/uni-data-select/package.json b/uni_modules/uni-data-select/package.json new file mode 100644 index 0000000..4033502 --- /dev/null +++ b/uni_modules/uni-data-select/package.json @@ -0,0 +1,106 @@ +{ + "id": "uni-data-select", + "displayName": "uni-data-select 下拉框选择器", + "version": "1.1.0", + "description": "通过数据驱动的下拉框选择器", + "keywords": [ + "uni-ui", + "select", + "uni-data-select", + "下拉框", + "下拉选" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "^3.1.1", + "uni-app": "^4.45", + "uni-app-x": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", + "type": "component-vue", + "darkmode": "x", + "i18n": "x", + "widescreen": "x" + }, + "uni_modules": { + "dependencies": [ + "uni-load-more" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "√", + "aliyun": "√", + "alipay": "√" + }, + "client": { + "uni-app": { + "vue": { + "vue2": "√", + "vue3": "√" + }, + "web": { + "safari": "√", + "chrome": "√" + }, + "app": { + "vue": "√", + "nvue": "-", + "android": "√", + "ios": "√", + "harmony": "√" + }, + "mp": { + "weixin": "√", + "alipay": "√", + "toutiao": "√", + "baidu": "-", + "kuaishou": "-", + "jd": "-", + "harmony": "-", + "qq": "-", + "lark": "-" + }, + "quickapp": { + "huawei": "-", + "union": "-" + } + }, + "uni-app-x": { + "web": { + "safari": "-", + "chrome": "-" + }, + "app": { + "android": "-", + "ios": "-", + "harmony": "-" + }, + "mp": { + "weixin": "-" + } + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-data-select/readme.md b/uni_modules/uni-data-select/readme.md new file mode 100644 index 0000000..eb58de3 --- /dev/null +++ b/uni_modules/uni-data-select/readme.md @@ -0,0 +1,8 @@ +## DataSelect 下拉框选择器 +> **组件名:uni-data-select** +> 代码块: `uDataSelect` + +当选项过多时,使用下拉菜单展示并选择内容 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 diff --git a/uni_modules/uni-dateformat/changelog.md b/uni_modules/uni-dateformat/changelog.md new file mode 100644 index 0000000..d551d7b --- /dev/null +++ b/uni_modules/uni-dateformat/changelog.md @@ -0,0 +1,10 @@ +## 1.0.0(2021-11-19) +- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) +- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat) +## 0.0.5(2021-07-08) +- 调整 默认时间不再是当前时间,而是显示'-'字符 +## 0.0.4(2021-05-12) +- 新增 组件示例地址 +## 0.0.3(2021-02-04) +- 调整为uni_modules目录规范 +- 修复 iOS 平台日期格式化出错的问题 diff --git a/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js new file mode 100644 index 0000000..e00d559 --- /dev/null +++ b/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js @@ -0,0 +1,200 @@ +// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型 +function pad(str, length = 2) { + str += '' + while (str.length < length) { + str = '0' + str + } + return str.slice(-length) +} + +const parser = { + yyyy: (dateObj) => { + return pad(dateObj.year, 4) + }, + yy: (dateObj) => { + return pad(dateObj.year) + }, + MM: (dateObj) => { + return pad(dateObj.month) + }, + M: (dateObj) => { + return dateObj.month + }, + dd: (dateObj) => { + return pad(dateObj.day) + }, + d: (dateObj) => { + return dateObj.day + }, + hh: (dateObj) => { + return pad(dateObj.hour) + }, + h: (dateObj) => { + return dateObj.hour + }, + mm: (dateObj) => { + return pad(dateObj.minute) + }, + m: (dateObj) => { + return dateObj.minute + }, + ss: (dateObj) => { + return pad(dateObj.second) + }, + s: (dateObj) => { + return dateObj.second + }, + SSS: (dateObj) => { + return pad(dateObj.millisecond, 3) + }, + S: (dateObj) => { + return dateObj.millisecond + }, +} + +// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12 +function getDate(time) { + if (time instanceof Date) { + return time + } + switch (typeof time) { + case 'string': + { + // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000 + if (time.indexOf('T') > -1) { + return new Date(time) + } + return new Date(time.replace(/-/g, '/')) + } + default: + return new Date(time) + } +} + +export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') { + if (!date && date !== 0) { + return '' + } + date = getDate(date) + const dateObj = { + year: date.getFullYear(), + month: date.getMonth() + 1, + day: date.getDate(), + hour: date.getHours(), + minute: date.getMinutes(), + second: date.getSeconds(), + millisecond: date.getMilliseconds() + } + const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/ + let flag = true + let result = format + while (flag) { + flag = false + result = result.replace(tokenRegExp, function(matched) { + flag = true + return parser[matched](dateObj) + }) + } + return result +} + +export function friendlyDate(time, { + locale = 'zh', + threshold = [60000, 3600000], + format = 'yyyy/MM/dd hh:mm:ss' +}) { + if (time === '-') { + return time + } + if (!time && time !== 0) { + return '' + } + const localeText = { + zh: { + year: '年', + month: '月', + day: '天', + hour: '小时', + minute: '分钟', + second: '秒', + ago: '前', + later: '后', + justNow: '刚刚', + soon: '马上', + template: '{num}{unit}{suffix}' + }, + en: { + year: 'year', + month: 'month', + day: 'day', + hour: 'hour', + minute: 'minute', + second: 'second', + ago: 'ago', + later: 'later', + justNow: 'just now', + soon: 'soon', + template: '{num} {unit} {suffix}' + } + } + const text = localeText[locale] || localeText.zh + let date = getDate(time) + let ms = date.getTime() - Date.now() + let absMs = Math.abs(ms) + if (absMs < threshold[0]) { + return ms < 0 ? text.justNow : text.soon + } + if (absMs >= threshold[1]) { + return formatDate(date, format) + } + let num + let unit + let suffix = text.later + if (ms < 0) { + suffix = text.ago + ms = -ms + } + const seconds = Math.floor((ms) / 1000) + const minutes = Math.floor(seconds / 60) + const hours = Math.floor(minutes / 60) + const days = Math.floor(hours / 24) + const months = Math.floor(days / 30) + const years = Math.floor(months / 12) + switch (true) { + case years > 0: + num = years + unit = text.year + break + case months > 0: + num = months + unit = text.month + break + case days > 0: + num = days + unit = text.day + break + case hours > 0: + num = hours + unit = text.hour + break + case minutes > 0: + num = minutes + unit = text.minute + break + default: + num = seconds + unit = text.second + break + } + + if (locale === 'en') { + if (num === 1) { + num = 'a' + } else { + unit += 's' + } + } + + return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g, + suffix) +} diff --git a/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue b/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue new file mode 100644 index 0000000..c5ed030 --- /dev/null +++ b/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue @@ -0,0 +1,88 @@ + + {{dateShow}} + + + + + diff --git a/uni_modules/uni-dateformat/package.json b/uni_modules/uni-dateformat/package.json new file mode 100644 index 0000000..786a670 --- /dev/null +++ b/uni_modules/uni-dateformat/package.json @@ -0,0 +1,88 @@ +{ + "id": "uni-dateformat", + "displayName": "uni-dateformat 日期格式化", + "version": "1.0.0", + "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式", + "keywords": [ + "uni-ui", + "uniui", + "日期格式化", + "时间格式化", + "格式化时间", + "" +], + "repository": "https://github.com/dcloudio/uni-ui", + "engines": { + "HBuilderX": "" + }, + "directories": { + "example": "../../temps/example_temps" + }, + "dcloudext": { + "category": [ + "前端组件", + "通用组件" + ], + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "无", + "permissions": "无" + }, + "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" + }, + "uni_modules": { + "dependencies": ["uni-scss"], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y" + }, + "快应用": { + "华为": "y", + "联盟": "y" + }, + "Vue": { + "vue2": "y", + "vue3": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uni-dateformat/readme.md b/uni_modules/uni-dateformat/readme.md new file mode 100644 index 0000000..37ddb6e --- /dev/null +++ b/uni_modules/uni-dateformat/readme.md @@ -0,0 +1,11 @@ + + +### DateFormat 日期格式化 +> **组件名:uni-dateformat** +> 代码块: `uDateformat` + + +日期格式化组件。 + +### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat) +#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/unpackage/dist/dev/mp-weixin/project.config.json b/unpackage/dist/dev/mp-weixin/project.config.json index c937c3b..259a170 100644 --- a/unpackage/dist/dev/mp-weixin/project.config.json +++ b/unpackage/dist/dev/mp-weixin/project.config.json @@ -1,8 +1,7 @@ { "description": "项目配置文件。", "packOptions": { - "ignore": [], - "include": [] + "ignore": [] }, "setting": { "urlCheck": false, @@ -10,20 +9,28 @@ "postcss": true, "minified": true, "newFeature": true, - "bigPackageSizeSupport": true, - "babelSetting": { - "ignore": [], - "disablePlugins": [], - "outputPath": "" - } + "bigPackageSizeSupport": true }, "compileType": "miniprogram", - "libVersion": "3.10.3", + "libVersion": "3.5.7", "appid": "wx9d1cbc11c8c40ba7", "projectname": "qingdao-employment-service", - "condition": {}, - "editorSetting": { - "tabIndent": "insertSpaces", - "tabSize": 2 + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "game": { + "current": -1, + "list": [] + }, + "miniprogram": { + "current": -1, + "list": [] + } } } \ No newline at end of file diff --git a/utilsRc/auth.js b/utilsRc/auth.js new file mode 100644 index 0000000..1f5bb72 --- /dev/null +++ b/utilsRc/auth.js @@ -0,0 +1,19 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:55:08 + * @LastEditors: lip + */ +const TokenKey = 'App-Token' + +export function getToken() { + return uni.getStorageSync(TokenKey) +} + +export function setToken(token) { + return uni.setStorageSync(TokenKey, token) +} + +export function removeToken() { + return uni.removeStorageSync(TokenKey) +} diff --git a/utilsRc/common.js b/utilsRc/common.js new file mode 100644 index 0000000..9d635c5 --- /dev/null +++ b/utilsRc/common.js @@ -0,0 +1,248 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:56:06 + * @LastEditors: shirlwang + */ +import { + getPersonBase +} from '@/apiRc/person'; +import store from '@/utilsRc/store'; +import tab from '@/utilsRc/plugins/tab.js' +/** + * 显示消息提示框 + * @param content 提示的标题 + */ +export function toast(content) { + uni.showToast({ + icon: 'none', + title: content + }) +} + +/** + * 显示模态弹窗 + * @param content 提示的标题 + */ +export function showConfirm(content, cancelText, confirmText, showCancel) { + return new Promise((resolve, reject) => { + uni.showModal({ + title: '提示', + content: content, + cancelText: cancelText || '取消', + confirmText: confirmText || '确定', + showCancel: showCancel === false ? false : true, + success: function(res) { + resolve(res) + } + }) + }) +} +// 修改后的 checkPersonBase 方法 +export function checkPersonBase() { + return new Promise((resolve) => { + const roles = store.getters.roles; + const userId = store.getters.userId; + const isRole = (role) => roles.includes(role); + + if (isRole('qunzhong')) { + getPersonBase(userId).then(resp => { + const shouldGoToPersonInfo = resp.data.auditStatus === '0'; + if (shouldGoToPersonInfo) { + uni.showModal({ + title: '提示', + content: '您的个人信息尚未维护,请前往维护个人信息。', + confirmText: '去维护', + cancelText: '取消', + success: function(res) { + if (res.confirm) { + tab.navigateTo('/pages/personInfo/index'); + } + resolve(false); // 需要维护,返回 false + } + }); + } else { + resolve(true); // 不需要维护,返回 true + } + }); + } else { + resolve(true); // 非群众角色直接放行 + } + }); +} +/** + * 参数处理 + * @param params 参数 + */ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName] + var part = encodeURIComponent(propName) + "=" + if (value !== null && value !== "" && typeof(value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== "" && typeof(value[key]) !== 'undefined') { + let params = propName + '[' + key + ']' + var subPart = encodeURIComponent(params) + "=" + result += subPart + encodeURIComponent(value[key]) + "&" + } + } + } else { + result += part + encodeURIComponent(value) + "&" + } + } + } + return result +} +/** + * 姓名、手机、邮箱、身份证脱敏 + * @param str 姓名或手机或邮箱或身份证 + * @param type 数据类型 + */ +export function publicEncrypt(str, type) { + if (!str) { + return '' + } else if (type == 'name') { + return str.substr(0, 1) + '*' + } else if (type == 'idCard') { + return str.replace(/^(.{6})(?:\d+)(.{4})$/, '$1********$2') + } else if (type == 'phone') { + return str.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') + } else if (type == 'email') { + let count, emailArr, emailFront, emailBack; + emailArr = str.split('@'); + emailFront = emailArr[0]; + count = emailFront.length / 2; + emailFront = emailFront.substring(0, emailFront.length - count); + emailBack = emailArr[1]; + return emailFront + '***@' + emailBack; + } +} + + +/** + * 根据value值筛选对应的label + * @param {Array} options - 原数组 + * @param {string | Number} value - 表示 + * @returns {string} - 返回后的汉字 + */ +export function getLabelByValue(options = [], value, valueKey = 'value', labelKey = 'label') { + for (let i = 0; i < options.length; i++) { + // 动态使用传入的 valueKey 和 labelKey + if (options[i][valueKey] === value) { + return options[i][labelKey]; + } + } + return null; +} +/** + * 将数组转换为字符串 + * @param {Array} arr - 要转换的数组 + * @param {string} delimiter - 用于连接数组元素的分隔符,默认为逗号 + * @returns {string} - 转换后的字符串 + */ +export function arrayToString(arr, delimiter = ',') { + return arr.join(delimiter); +} + +/* 延时函数 */ +export function delay(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +/* 获取当前年月日 时分秒 */ +export function getCurrentDate() { + const date = new Date(); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1 + const day = String(date.getDate()).padStart(2, '0'); // 使用padStart补零 + const hours = String(date.getHours()).padStart(2, '0'); // 补零 + const minutes = String(date.getMinutes()).padStart(2, '0'); // 补零 + const seconds = String(date.getSeconds()).padStart(2, '0'); // 补零 + + return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; +} + + +export function processFileUrl(fileUrl) { + let fileList = []; + if (typeof fileUrl === 'string' && fileUrl) { + // 如果 fileUrl 是一个字符串,则按照逗号分割成数组 + const urls = fileUrl.split(',').map(url => url.trim()); // 去除每个 URL 前后的空白字符 + fileList = urls.map(url => ({ + url, + success: 'success', + name: 'fileUrl' + })); + } + return fileList; +} + +// 密码强校验 +export function isPasswordComplex(password) { + // 长度在8位以上,并且包含大小写字母、数字和特殊符号 + return /^(?=.*[A-Za-z])(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&*!])[A-Za-z\d@#$%^&*!]{8,}$/.test(password); +} + +// 手机号码校验 +export function isPhoneNumberValid(phoneNumber) { + // 匹配国内常见的手机号格式 + return /^1[3-9]\d{9}$/.test(phoneNumber); +} + + +// 身份证校验函数 +export function isValidIdCard (idCard) { + if (typeof idCard !== 'string') { + return false; + } + + // 定义省份代码 + const provinceCodes = { + 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", + 21: "辽宁", 22: "吉林", 23: "黑龙江", + 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", + 41: "河南", 42: "湖北", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", + 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏", + 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", + 71: "台湾", 81: "香港", 82: "澳门", 91: "国外" + }; + + // 检查长度 + if (!/^\d{17}(\d|X|x)$/.test(idCard)) { + return false; + } + + // 验证省份代码 + const provinceCode = idCard.substring(0, 2); + if (!provinceCodes[provinceCode]) { + return false; + } + // 验证出生日期 + const birthDate = idCard.substring(6, 14); + const birthYear = parseInt(birthDate.substring(0, 4), 10); + const birthMonth = parseInt(birthDate.substring(4, 6), 10); + const birthDay = parseInt(birthDate.substring(6, 8), 10); + const birthDateObject = new Date(birthYear, birthMonth - 1, birthDay); + + if ( + birthDateObject.getFullYear() !== birthYear || + birthDateObject.getMonth() + 1 !== birthMonth || + birthDateObject.getDate() !== birthDay + ) { + return false; + } + // 验证校验码 + const weightFactors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + const checkCodes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; + + const sum = idCard + .substring(0, 17) + .split('') + .reduce((acc, num, index) => acc + parseInt(num, 10) * weightFactors[index], 0); + + const checkCode = checkCodes[sum % 11]; + return checkCode === idCard[17].toUpperCase(); +}; + diff --git a/utilsRc/config.js b/utilsRc/config.js new file mode 100644 index 0000000..e011f73 --- /dev/null +++ b/utilsRc/config.js @@ -0,0 +1,38 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2022-12-28 13:59:09 + * @LastEditors: shirlwang + */ +// 应用全局配置 +let exports = { + + + // baseUrl: 'http://127.0.0.1:8903', // 本地开发 + + // baseUrl: 'http://172.20.0.104:8903', // xubaiqi 地址 + + // baseUrl: 'http://172.20.1.76:8903', // 演示环境内网 + + // baseUrl: 'http://36.140.162.216:8904/prod-api', // 演示环境外网 + + // baseUrl: 'http://10.160.0.5:8903', // 演示环境外网 + + // baseUrl: 'http://111.34.80.140:8081/prod-api', // 正式环境(不要轻易连接) + + baseUrl: 'http://10.160.0.5:8907', // 正式环境在济南人才上部署(不要轻易连接) + + + + // 应用信息 + appInfo: { + // 应用名称 + name: "泉就业H5", + // 应用版本 + version: "1.1.0", + // 应用logo + logo: "/static/logo.png", + } + } + +export default exports \ No newline at end of file diff --git a/utilsRc/constant.js b/utilsRc/constant.js new file mode 100644 index 0000000..5fadd14 --- /dev/null +++ b/utilsRc/constant.js @@ -0,0 +1,19 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:53:48 + * @LastEditors: lip + */ +const constant = { + avatar: 'vuex_avatar', + name: 'vuex_name', + roles: 'vuex_roles', + permissions: 'vuex_permissions', + type: 'vuex_type', + phonenumber: 'vuex_phonenumber', + nick: 'vuex_nick', + userId: 'vuex_userId', + handlerData: 'vuex_handlerData', + } + + export default constant diff --git a/utilsRc/errorCode.js b/utilsRc/errorCode.js new file mode 100644 index 0000000..8849d23 --- /dev/null +++ b/utilsRc/errorCode.js @@ -0,0 +1,13 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:56:30 + * @LastEditors: lip + */ +export default { + '401': '您的登录状态已过期,请重新登录', + '403': '当前操作没有权限', + '404': '访问资源不存在', + 'default': '系统未知错误,请反馈给管理员' + } + \ No newline at end of file diff --git a/utilsRc/plugins/auth.js b/utilsRc/plugins/auth.js new file mode 100644 index 0000000..57ac0a8 --- /dev/null +++ b/utilsRc/plugins/auth.js @@ -0,0 +1,60 @@ +import store from '@/store' + +function authPermission(permission) { + const all_permission = "*:*:*" + const permissions = store.getters && store.getters.permissions + if (permission && permission.length > 0) { + return permissions.some(v => { + return all_permission === v || v === permission + }) + } else { + return false + } +} + +function authRole(role) { + const super_admin = "shequn" + const roles = store.getters && store.getters.roles + if (role && role.length > 0) { + return roles.some(v => { + return super_admin === v || v === role + }) + } else { + return false + } +} + +export default { + // 验证用户是否具备某权限 + hasPermi(permission) { + return authPermission(permission) + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions) { + return permissions.some(item => { + return authPermission(item) + }) + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions) { + return permissions.every(item => { + return authPermission(item) + }) + }, + // 验证用户是否具备某角色 + hasRole(role) { + return authRole(role) + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles) { + return roles.some(item => { + return authRole(item) + }) + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles) { + return roles.every(item => { + return authRole(item) + }) + } +} diff --git a/utilsRc/plugins/index.js b/utilsRc/plugins/index.js new file mode 100644 index 0000000..efbae15 --- /dev/null +++ b/utilsRc/plugins/index.js @@ -0,0 +1,14 @@ +import tab from './tab' +import auth from './auth' +import modal from './modal' + +export default { + install(Vue) { + // 页签操作 + Vue.prototype.$tab = tab + // 认证对象 + Vue.prototype.$auth = auth + // 模态框对象 + Vue.prototype.$modal = modal + } +} diff --git a/utilsRc/plugins/loadingPlugin.js b/utilsRc/plugins/loadingPlugin.js new file mode 100644 index 0000000..c20d9b6 --- /dev/null +++ b/utilsRc/plugins/loadingPlugin.js @@ -0,0 +1,50 @@ +import ULoadingPage from 'uview-ui/components/u-loading-page/u-loading-page'; // 确保正确引入组件 + +export default { + install(Vue) { + // 注册 u-loading-page 组件为全局组件 + Vue.component('u-loading-page', ULoadingPage); + + // 用于存储全局的 loading 组件实例 + let loadingInstance = null; + + // 创建一个全局的显示 loading 的方法 + Vue.prototype.$showLoading = function () { + // 如果没有创建过实例,则创建一个 + if (!loadingInstance) { + const LoadingConstructor = Vue.extend({ + data() { + return { + loading: true, // 控制 loading 显示的状态 + }; + }, + render(h) { + return h('u-loading-page', { + props: { + loading: this.loading, + loadingText: '', + loadingColor: "#000", + iconSize: '58rpx', + }, + style: { + zIndex: '200', + opacity: 0.7 + } + }); + } + }); + loadingInstance = new LoadingConstructor(); + loadingInstance.$mount(); // 手动挂载实例 + document.body.appendChild(loadingInstance.$el); // 将组件挂载到 body + } + loadingInstance.loading = true; // 显示 loading + }; + + // 创建一个全局的隐藏 loading 的方法 + Vue.prototype.$hideLoading = function () { + if (loadingInstance) { + loadingInstance.loading = false; // 隐藏 loading + } + }; + }, +}; diff --git a/utilsRc/plugins/modal.js b/utilsRc/plugins/modal.js new file mode 100644 index 0000000..87960fd --- /dev/null +++ b/utilsRc/plugins/modal.js @@ -0,0 +1,74 @@ +export default { + // 消息提示 + msg(content) { + uni.showToast({ + title: content, + icon: 'none' + }) + }, + // 错误消息 + msgError(content) { + uni.showToast({ + title: content, + icon: 'error' + }) + }, + // 成功消息 + msgSuccess(content) { + uni.showToast({ + title: content, + icon: 'success' + }) + }, + // 隐藏消息 + hideMsg(content) { + uni.hideToast() + }, + // 弹出提示 + alert(content) { + uni.showModal({ + title: '提示', + content: content, + showCancel: false + }) + }, + // 确认窗体 + confirm(content) { + return new Promise((resolve, reject) => { + uni.showModal({ + title: '系统提示', + content: content, + cancelText: '取消', + confirmText: '确定', + success: function(res) { + if (res.confirm) { + resolve(res.confirm) + } + } + }) + }) + }, + // 提示信息 + showToast(option) { + if (typeof option === "object") { + uni.showToast(option) + } else { + uni.showToast({ + title: option, + icon: "none", + duration: 2500 + }) + } + }, + // 打开遮罩层 + loading(content) { + uni.showLoading({ + title: content, + icon: 'none' + }) + }, + // 关闭遮罩层 + closeLoading() { + uni.hideLoading() + } +} diff --git a/utilsRc/plugins/tab.js b/utilsRc/plugins/tab.js new file mode 100644 index 0000000..5d1b305 --- /dev/null +++ b/utilsRc/plugins/tab.js @@ -0,0 +1,30 @@ +export default { + // 关闭所有页面,打开到应用内的某个页面 + reLaunch(url) { + return uni.reLaunch({ + url: url + }) + }, + // 跳转到tabBar页面,并关闭其他所有非tabBar页面 + switchTab(url) { + return uni.switchTab({ + url: url + }) + }, + // 关闭当前页面,跳转到应用内的某个页面 + redirectTo(url) { + return uni.redirectTo({ + url: url + }) + }, + // 保留当前页面,跳转到应用内的某个页面 + navigateTo(url) { + return uni.navigateTo({ + url: url + }) + }, + // 关闭当前页面,返回上一页面或多级页面 + navigateBack() { + return uni.navigateBack() + } +} diff --git a/utilsRc/request.js b/utilsRc/request.js new file mode 100644 index 0000000..47c2ad5 --- /dev/null +++ b/utilsRc/request.js @@ -0,0 +1,107 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-05-12 08:44:49 + * @LastEditors: shirlwang + */ +import store from './store/index.js' +import configRc from './config.js' +import { getToken } from '@/utilsRc/auth' +import errorCode from '@/utilsRc/errorCode' +import { toast, showConfirm, tansParams } from '@/utilsRc/common' + +let timeout = 10000 +const baseUrl = configRc.baseUrl + +const request = config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + config.header = config.header || {} + if (getToken() && !isToken) { + config.header['Authorization'] = 'Bearer ' + getToken() + } + config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJVMDRocERSZjdZMXJUbUxXb05uOUpzYUdDZzBNazJJQSIsInVzZXJJZCI6MX0.LZ29vvA4tK3b9Hki4nU9Jb1himXZM2AEOue3CMRY95w' + // get请求映射params参数 + if (config.params) { + let url = config.url + '?' + tansParams(config.params) + url = url.slice(0, -1) + config.url = url + } + return new Promise((resolve, reject) => { + uni.request({ + method: config.method || 'get', + timeout: config.timeout || timeout, + url: baseUrl + config.url, + // url: 'https://gccrcdh.sd-talent.cn:80/zhq' + config.url, + data: config.data, + header: config.header, + dataType: 'json' + }).then(response => { + let res = response.data + let error = response.errMsg!='request:ok' + if (error) { + toast('网络出小差,请稍后再试') + reject('网络出小差,请稍后再试') + return + } + const code = res.code || 200 + console.log(code, 'const code = res.code || 200') + const msg = errorCode[code] || res.msg || errorCode['default'] + const isShowModel = getApp().globalData.isShowModel + if (code === 200) { + resolve(res) + }else if (code === 401) { + if(isShowModel === false) { + getApp().globalData.isShowModel = true + showConfirm('您好!登录后,您才可以继续操作。', '取消', '去登录').then(res => { + if (res.confirm) { + getApp().globalData.isShowModel = false + store.dispatch('LogOut').then(res => { + uni.reLaunch({ url: '/pages/login/login-one' }) + }) + } else if(res.cancel) { + getApp().globalData.isShowModel = false + uni.navigateBack() + } + + }) + } + // reject(code) + } + // if (code === 401) { + // showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { + // if (res.confirm) { + // store.dispatch('LogOut').then(res => { + // uni.reLaunch({ url: '/page_other/login/index' }) + // }) + // } + // }) + // reject('无效的会话,或者会话已过期,请重新登录。') + // } else + else if (code === 500) { + toast(msg) + reject('500') + } else if (code !== 200 && code !== 9999) { + // 9999是正常的业务状态码,不应该被当作错误处理 + toast(msg) + reject(code) + } + resolve(res.data) + }) + .catch(error => { + console.log(error, 'error') + let message = error.errMsg + if (message === 'Network Error') { + message = '网络出小差,请稍后再试' + } else if (message.includes('timeout')) { + message = '系统接口请求超时' + } else if (message.includes('Request failed with status code')) { + message = '系统接口' + message.substr(message.length - 3) + '异常' + } + toast(message) + reject(error) + }) + }) +} + +export default request diff --git a/utilsRc/storage.js b/utilsRc/storage.js new file mode 100644 index 0000000..c3bf5db --- /dev/null +++ b/utilsRc/storage.js @@ -0,0 +1,44 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:56:55 + * @LastEditors: lip + */ +import constant from './constant' + +// 存储变量名 +let storageKey = 'storage_data' + +// 存储节点变量名 +let storageNodeKeys = [constant.avatar, constant.name, constant.roles, constant.permissions, constant.type, constant + .phonenumber, + constant.userId, + constant.handlerData, + constant.nick +] + +// 存储的数据 +let storageData = uni.getStorageSync(storageKey) || {} + +const storage = { + set: function(key, value) { + if (storageNodeKeys.indexOf(key) != -1) { + let tmp = uni.getStorageSync(storageKey) + tmp = tmp ? tmp : {} + tmp[key] = value + uni.setStorageSync(storageKey, tmp) + } + }, + get: function(key) { + return storageData[key] || "" + }, + remove: function(key) { + delete storageData[key] + uni.setStorageSync(storageKey, storageData) + }, + clean: function() { + uni.removeStorageSync(storageKey) + } +} + +export default storage diff --git a/utilsRc/store/getters.js b/utilsRc/store/getters.js new file mode 100644 index 0000000..14ab276 --- /dev/null +++ b/utilsRc/store/getters.js @@ -0,0 +1,19 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 15:59:34 + * @LastEditors: lip + */ +const getters = { + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + userId: state => state.user.userId, + handlerData: state => state.user.handlerData, + nick: state => state.user.nick, + showExitPopup: state => state.user.showExitPopup, + publicKey: state => state.user.publicKey + } + export default getters diff --git a/utilsRc/store/index.js b/utilsRc/store/index.js new file mode 100644 index 0000000..f3475ea --- /dev/null +++ b/utilsRc/store/index.js @@ -0,0 +1,18 @@ +/* + * @Descripttion: + * @Author: lip + * @Date: 2023-07-27 09:04:34 + * @LastEditors: shirlwang + */ +import user from '@/utilsRc/store/modules/user' +import getters from './getters' + +// src/store/index.js +import { createStore } from 'vuex'; +let store = createStore({ + modules: { + user + }, + getters +}); +export default store; diff --git a/utilsRc/store/modules/user.js b/utilsRc/store/modules/user.js new file mode 100644 index 0000000..0113c11 --- /dev/null +++ b/utilsRc/store/modules/user.js @@ -0,0 +1,233 @@ +import config from '@/config' +import storage from '@/utilsRc/storage' +import constant from '@/utilsRc/constant' +import { + login, + logout, + getInfo, + register, + smsLogin, + wechatLogin +} from '@/apiRc/login' +import { + getToken, + setToken, + removeToken +} from '@/utilsRc/auth' + +import {sm2} from 'sm-crypto' +// const sm2 = require('sm-crypto').sm2 +const baseUrl = config.baseUrl + +const user = { + state: { + token: getToken(), + name: storage.get(constant.name), + avatar: storage.get(constant.avatar), + roles: storage.get(constant.roles), + permissions: storage.get(constant.permissions), + type: storage.get(constant.type), + phonenumber: storage.get(constant.phonenumber), + nick: storage.get(constant.nick), + userId: storage.get(constant.userId), + handlerData: storage.get(constant.handlerData), + showExitPopup: false, + publicKey: '04970A174A090FCCD2B2503DD978152ACB906919245E4C8F237BE290E6E72334DDD89B857177A11C609FAA62CC62AD75D4BB1395E2A22F2663357A5D3EF9B1C1B8', + + }, + + + mutations: { + SET_TOKEN: (state, token) => { + state.token = token + // 同时更新存储中的token + setToken(token) + }, + SET_NAME: (state, name) => { + state.name = name + storage.set(constant.name, name) + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + storage.set(constant.avatar, avatar) + }, + SET_ROLES: (state, roles) => { + state.roles = roles + storage.set(constant.roles, roles) + }, + SET_PERMISSIONS: (state, permissions) => { + state.permissions = permissions + storage.set(constant.permissions, permissions) + }, + SET_TYPE: (state, type) => { + state.type = type + storage.set(constant.type, type) + }, + SET_PHONENUMBER: (state, phonenumber) => { + state.phonenumber = phonenumber + storage.set(constant.phonenumber, phonenumber) + }, + SET_NICK: (state, nick) => { + state.nick = nick + storage.set(constant.nick, nick) + }, + SET_USER_ID: (state, userId) => { + state.userId = userId + storage.set(constant.userId, userId) + }, + + // 存储经办人信息 + SET_HAND_LER(state, data) { + state.handlerData = data + storage.set(constant.handlerData, data) + }, + + SET_SHOWEXITPOPUP(state, type) { + state.showExitPopup = type + } + }, + + actions: { + // 登录 + Login({ + commit, + state + }, userInfo) { + + return new Promise((resolve, reject) => { + const info = JSON.parse(JSON.stringify(userInfo)) + info.password = '04' + sm2.doEncrypt(info.password, state.publicKey, 0) + info.username = '04' + sm2.doEncrypt(info.username, state.publicKey, 0) + login(info).then(res => { + console.log('登录接口返回:', res); + setToken(res.data.token) + commit('SET_TOKEN', res.data.token) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + // 登录 + SMSLogin({ + commit + }, userInfo) { + return new Promise((resolve, reject) => { + smsLogin(userInfo).then(res => { + setToken(res.data.token) + commit('SET_TOKEN', res.data.token) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + // 登录 + WXLogin({ + commit + }, userInfo) { + return new Promise((resolve, reject) => { + wechatLogin(userInfo).then(res => { + setToken(res.data.token) + commit('SET_TOKEN', res.data.token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + // 注册 + Register({ + commit + }, userInfo) { + const username = userInfo.username + const password = userInfo.password + const code = userInfo.code + const uuid = userInfo.uuid + const userType = userInfo.userType + const userNumber = userInfo.userNumber + return new Promise((resolve, reject) => { + register(username, password, code, uuid, userType, userNumber).then(res => { + uni.showToast({ + title: `账号${username}注册成功`, + icon: 'none' + }) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 获取用户信息 + GetInfo({ + commit, + state + }) { + return new Promise((resolve, reject) => { + getInfo().then(res => { + const user = res.data.user + const avatar = (user == null || user.avatar == "" || user.avatar == null) ? + "https://rc.jinan.gov.cn/qcwjyH5/static/icon/my.png" : user.avatar + const username = (user == null || user.userName == "" || user.userName == + null) ? "" : user.userName + const usertype = (user == null || user.userType == "" || user.userType == + null) ? "" : user.userType + const usernumber = (user == null || user.phonenumber == "" || user + .phonenumber == null) ? "" : user.phonenumber + const nick = (user == null || user.nickName == "" || user.nickName == null) ? + "" : user.nickName + const userId = (user == null || user.userId == "" || user.userId == null) ? "" : + user.userId + if (res.data.roles && res.data.roles.length > 0) { + commit('SET_ROLES', res.data.roles) + commit('SET_PERMISSIONS', res.data.permissions) + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']) + } + commit('SET_NAME', username) + commit('SET_AVATAR', avatar) + commit('SET_TYPE', usertype) + commit('SET_PHONENUMBER', usernumber) + commit('SET_NICK', nick) + commit('SET_USER_ID', userId) + + // commit('SET_HAND_LER', { + // deptName: user.dept.deptName, + // nickName: user.nickName + // }) + + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + // 退出系统 + LogOut({ + commit, + state + }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + commit('SET_TYPE', '') + commit('SET_NICK', '') + commit('SET_PHONENUMBER', '') + commit('SET_USER_ID', '') + commit('SET_SHOWEXITPOPUP', false) + removeToken() + storage.clean() + resolve() + }).catch(error => { + reject(error) + }) + }) + } + } +} + +export default user