commit 9f287fa67ed7148cf7f7b071d5584b734a5ee41e Author: jiangAB Date: Fri Nov 14 19:53:07 2025 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2561bb4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules/ +unpackage/ +dist/ + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.project +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..b169d07 --- /dev/null +++ b/App.vue @@ -0,0 +1,23 @@ + + + diff --git a/api/httpSetting.js b/api/httpSetting.js new file mode 100644 index 0000000..c1110f4 --- /dev/null +++ b/api/httpSetting.js @@ -0,0 +1,91 @@ +// api.js + +// 基础URL,可以根据环境来设置 +// uEnvDev +const accountInfo = wx.getAccountInfoSync(); +// env类型 develop:开发版、trial:体验版、release:正式版 +export const env = accountInfo.miniProgram.envVersion; +if (!env) { + console.error("获取运行环境失败!"); +} +const baseApi = { + // 开发版 + develop: "http://110.40.156.216:30005/api", + // 体验版 + trial: "http://110.40.156.216:30005/api", + // 正式版 + release: "http://110.40.156.216:30005/api" +}; +console.log(env, 'env') +// request请求baseURL +const BASE_URL = baseApi[env] || 'http://110.40.156.216:30005/api'; + + +function request(url, method, data = {}) { + const userInfo = uni.getStorageSync('loginInfo') || {}; + const UTCOffset = new Date().getTimezoneOffset(); + return new Promise((resolve, reject) => { + uni.request({ + url: BASE_URL + url, // 完整的URL + method: method, + data: data, + header: { + 'AccessToken': userInfo.accessToken || '-1', // 请求头,可根据需要调整 + 'UserId': userInfo.userId || '1', // 请求头,可根据需要调整 + 'LanguageType': 0, + 'LoginName': userInfo.loginName || '', + 'CompanyId': userInfo.companyId || '', + 'UTCOffset': UTCOffset, + }, + success: (res) => { + if (res.statusCode === 200) { + console.log(res) + if (res.data.code === 200 | res.data.code === 0) { + resolve(res.data) + } else { + reject(res.data) + } + /* if (res.data.code === 500) { + uni.showToast({ + title: '系统错误', // 提示的文本内容 + icon: 'none', // 提示的图标,可选值:'success' | 'loading' | 'none' + duration: 2000 // 提示框的显示时间,单位为毫秒,默认1500ms + }); + } + if (res.data.code === 401) { + uni.showToast({ + title: '登录过期,重新登录中', // 提示的文本内容 + icon: 'none', // 提示的图标,可选值:'success' | 'loading' | 'none' + duration: 2000 // 提示框的显示时间,单位为毫秒,默认1500ms + }); + } + if (res.data.code === 20001) { + reject(res.data); + } + resolve(res.data) */ + } else { + reject(res); + } + + }, + fail: (err) => { + uni.showToast({ + title: '请求错误', // 提示的文本内容 + icon: 'none', // 提示的图标,可选值:'success' | 'loading' | 'none' + duration: 2000 // 提示框的显示时间,单位为毫秒,默认1500ms + }); + reject(err); // 请求失败 + } + }); + }); +} + +// GET 请求 +export function get(url, params = {}) { + return request(url, 'GET', params); +} + +// POST 请求 +export function post(url, data = {}) { + return request(url, 'POST', data); +} \ No newline at end of file diff --git a/api/index.js b/api/index.js new file mode 100644 index 0000000..37fc018 --- /dev/null +++ b/api/index.js @@ -0,0 +1,8 @@ +import { get, post } from "./httpSetting"; + +/** + * 登录 + */ +export const userLogin = (params ={}) => post('/app/auth/login', params); + +export const getAppJobVO = (params ={}) => get('/app/job/getAppJobVO', params); diff --git a/components/recruitment/recruitment.vue b/components/recruitment/recruitment.vue new file mode 100644 index 0000000..e0c922f --- /dev/null +++ b/components/recruitment/recruitment.vue @@ -0,0 +1,246 @@ + + + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..b5d330d --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..a906811 --- /dev/null +++ b/main.js @@ -0,0 +1,25 @@ +import App from './App' +import * as Pinia from 'pinia'; + +// #ifndef VUE3 +import Vue from 'vue' +import './uni.promisify.adaptor' +Vue.config.productionTip = false +App.mpType = 'app' +const app = new Vue({ + ...App +}) +app.$mount() +// #endif + +// #ifdef VUE3 +import { createSSRApp } from 'vue' +export function createApp() { + const app = createSSRApp(App) + app.use(Pinia.createPinia()); + return { + app, + Pinia + } +} +// #endif \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..3b506fe --- /dev/null +++ b/manifest.json @@ -0,0 +1,78 @@ +{ + "name" : "laowumap", + "appid" : "__UNI__3F7EFE0", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wx6b37987f8de3af0f", + "setting" : { + "urlCheck" : false + }, + "usingComponents" : true, + "permission" : { + "scope.userLocation" : { + "desc" : "您的位置信息将用于地图定位和附近地点展示" + } + }, + "lazyCodeLoading" : "requiredComponents" + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3" +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..6548280 --- /dev/null +++ b/pages.json @@ -0,0 +1,73 @@ +{ + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "挑好厂|找周边工作" + } + }, + { + "path": "pages/searchPositions/searchPositions", + "style": { + "navigationBarTitleText": "岗位搜索" + } + }, + { + "path": "pages/my/my", + "style": { + "navigationBarTitleText": "个人中心" + } + }, + { + "path" : "pages/map/map", + "style" : + { + "navigationBarTitleText" : "地图" + } + }, + { + "path" : "pages/positionDetail/positionDetail", + "style" : + { + "navigationBarTitleText" : "岗位详情" + } + }, + { + "path" : "pages/login/login", + "style" : + { + "navigationBarTitleText" : "登录" + } + } + + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + }, + "tabBar": { + "list": [ + { + "text": "首页", + "pagePath": "pages/index/index", + "iconPath": "/static/tabbarIcon/home.png", + "selectedIconPath": "/static/tabbarIcon/home-select.png" + }, + { + "text": "搜岗位", + "pagePath": "pages/searchPositions/searchPositions", + "iconPath": "/static/tabbarIcon/searchPositions.png", + "selectedIconPath": "/static/tabbarIcon/searchPositions-select.png" + }, + { + "text": "我的", + "pagePath": "pages/my/my", + "iconPath": "/static/tabbarIcon/my.png", + "selectedIconPath": "/static/tabbarIcon/my-select.png" + } + ] + }, + "uniIdRouter": {} +} diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..57c291e --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,111 @@ + + + + + \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 0000000..55ad5f1 --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,275 @@ + + + + + diff --git a/pages/map/map.vue b/pages/map/map.vue new file mode 100644 index 0000000..3e9d193 --- /dev/null +++ b/pages/map/map.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/pages/my/my.vue b/pages/my/my.vue new file mode 100644 index 0000000..306b264 --- /dev/null +++ b/pages/my/my.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/pages/positionDetail/positionDetail.vue b/pages/positionDetail/positionDetail.vue new file mode 100644 index 0000000..0faa0e0 --- /dev/null +++ b/pages/positionDetail/positionDetail.vue @@ -0,0 +1,419 @@ + + + + + diff --git a/pages/searchPositions/searchPositions.vue b/pages/searchPositions/searchPositions.vue new file mode 100644 index 0000000..b2a6bfd --- /dev/null +++ b/pages/searchPositions/searchPositions.vue @@ -0,0 +1,262 @@ + + + + + \ No newline at end of file diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..b5771e2 Binary files /dev/null and b/static/logo.png differ diff --git a/static/position-icon.png b/static/position-icon.png new file mode 100644 index 0000000..b3a0b45 Binary files /dev/null and b/static/position-icon.png differ diff --git a/static/tabbarIcon/home-select.png b/static/tabbarIcon/home-select.png new file mode 100644 index 0000000..62af1bc Binary files /dev/null and b/static/tabbarIcon/home-select.png differ diff --git a/static/tabbarIcon/home.png b/static/tabbarIcon/home.png new file mode 100644 index 0000000..5b4cc46 Binary files /dev/null and b/static/tabbarIcon/home.png differ diff --git a/static/tabbarIcon/my-select.png b/static/tabbarIcon/my-select.png new file mode 100644 index 0000000..254807a Binary files /dev/null and b/static/tabbarIcon/my-select.png differ diff --git a/static/tabbarIcon/my.png b/static/tabbarIcon/my.png new file mode 100644 index 0000000..1296003 Binary files /dev/null and b/static/tabbarIcon/my.png differ diff --git a/static/tabbarIcon/searchPositions-select.png b/static/tabbarIcon/searchPositions-select.png new file mode 100644 index 0000000..97063d7 Binary files /dev/null and b/static/tabbarIcon/searchPositions-select.png differ diff --git a/static/tabbarIcon/searchPositions.png b/static/tabbarIcon/searchPositions.png new file mode 100644 index 0000000..77625b2 Binary files /dev/null and b/static/tabbarIcon/searchPositions.png differ diff --git a/static/wechat-icon.png b/static/wechat-icon.png new file mode 100644 index 0000000..b6bfdd2 Binary files /dev/null and b/static/wechat-icon.png differ diff --git a/stores/user.js b/stores/user.js new file mode 100644 index 0000000..b2d33d8 --- /dev/null +++ b/stores/user.js @@ -0,0 +1,64 @@ +import { defineStore } from 'pinia'; + +export const useUserStore = defineStore('user', { + state: () => ({ + loginRes: uni.getStorageSync('loginRes') || null, // 存储登录响应数据 + userInfo: uni.getStorageSync('userInfo') || null, // 用户信息 + token: uni.getStorageSync('token') || null // 认证令牌 + }), + + getters: { + isLoggedIn: (state) => !!state.token, + userId: (state) => state.userInfo?.userId || null + }, + + actions: { + /** + * 设置登录响应数据 + * @param {Object} data - 登录响应数据 + */ + setLoginRes(data) { + this.loginRes = data; + uni.setStorageSync('loginRes', data); + }, + + /** + * 设置用户信息 + * @param {Object} userInfo - 用户信息 + */ + setUserInfo(userInfo) { + this.userInfo = userInfo; + uni.setStorageSync('userInfo', userInfo); + }, + + /** + * 设置认证令牌 + * @param {String} token - 认证令牌 + */ + setToken(token) { + this.token = token; + uni.setStorageSync('token', token); + }, + + /** + * 清除所有用户数据 + */ + clearUserData() { + this.loginRes = null; + this.userInfo = null; + this.token = null; + uni.removeStorageSync('loginRes'); + uni.removeStorageSync('userInfo'); + uni.removeStorageSync('token'); + }, + + /** + * 更新用户信息 + * @param {Object} updates - 要更新的用户信息字段 + */ + updateUserInfo(updates) { + this.userInfo = { ...this.userInfo, ...updates }; + uni.setStorageSync('userInfo', this.userInfo); + } + } +}); \ No newline at end of file diff --git a/uni.promisify.adaptor.js b/uni.promisify.adaptor.js new file mode 100644 index 0000000..5fec4f3 --- /dev/null +++ b/uni.promisify.adaptor.js @@ -0,0 +1,13 @@ +uni.addInterceptor({ + returnValue (res) { + if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) { + return res; + } + return new Promise((resolve, reject) => { + res.then((res) => { + if (!res) return resolve(res) + return res[0] ? reject(res[0]) : resolve(res[1]) + }); + }); + }, +}); \ No newline at end of file diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..20ed99f --- /dev/null +++ b/uni.scss @@ -0,0 +1,76 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ + +/* 行为相关颜色 */ +$uni-color-primary: #6DC2AA; +$uni-color-success: #4cd964; +$uni-color-warning: #f0ad4e; +$uni-color-error: #dd524d; + +/* 文字基本颜色 */ +$uni-text-color:#333;//基本色 +$uni-text-color-inverse:#fff;//反色 +$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 +$uni-text-color-placeholder: #808080; +$uni-text-color-disable:#c0c0c0; + +/* 背景颜色 */ +$uni-bg-color:#ffffff; +$uni-bg-color-grey:#f8f8f8; +$uni-bg-color-hover:#f1f1f1;//点击状态颜色 +$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 + +/* 边框颜色 */ +$uni-border-color:#c8c7cc; + +/* 尺寸变量 */ + +/* 文字尺寸 */ +$uni-font-size-sm:12px; +$uni-font-size-base:14px; +$uni-font-size-lg:16px; + +/* 图片尺寸 */ +$uni-img-size-sm:20px; +$uni-img-size-base:26px; +$uni-img-size-lg:40px; + +/* Border Radius */ +$uni-border-radius-sm: 2px; +$uni-border-radius-base: 3px; +$uni-border-radius-lg: 6px; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 5px; +$uni-spacing-row-base: 10px; +$uni-spacing-row-lg: 15px; + +/* 垂直间距 */ +$uni-spacing-col-sm: 4px; +$uni-spacing-col-base: 8px; +$uni-spacing-col-lg: 12px; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2C405A; // 文章标题颜色 +$uni-font-size-title:20px; +$uni-color-subtitle: #555555; // 二级标题颜色 +$uni-font-size-subtitle:26px; +$uni-color-paragraph: #3F536E; // 文章段落颜色 +$uni-font-size-paragraph:15px;