commit bf3a62d426b60d116d14f42e29fdda2857cc8426 Author: wangsiyuan <2392948297@qq.com> Date: Sat Jan 6 10:35:41 2024 +0800 first commit diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..a7518a4 Binary files /dev/null and b/.DS_Store differ diff --git a/.cloudbase/container/debug.json b/.cloudbase/container/debug.json new file mode 100644 index 0000000..0d44458 --- /dev/null +++ b/.cloudbase/container/debug.json @@ -0,0 +1 @@ +{"containers":[],"config":{}} \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true, + }, + ecmaFeatures: { + modules: true, + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module', + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true, + }, + // extends: 'eslint:recommended', + rules: {}, +} diff --git a/app.js b/app.js new file mode 100644 index 0000000..fda6f35 --- /dev/null +++ b/app.js @@ -0,0 +1,27 @@ +// app.js +App({ + onLaunch() { + // 展示本地存储能力 + const logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + + }, + globalData: { + userInfo: null + } +}) + +function newDir(){ + const fs = wx.getFileSystemManager(); + fs.mkdir({ + dirPath: `${wx.env.USER_DATA_PATH}/images`, + recursive: true, + success(res) { + console.log('Folder created successfully!'); + }, + fail(err) { + console.log(err); + } + }); +} diff --git a/app.json b/app.json new file mode 100644 index 0000000..141ecc9 --- /dev/null +++ b/app.json @@ -0,0 +1,43 @@ +{ + "pages": [ + "pages/login/login", + "pages/home/home", + "pages/personal/personal", + "pages/policy/policy", + "pages/qa/qa", + "pages/assist/assist", + "pages/recruit/recruit", + "pages/messageEdit/messageEdit" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarTitleText": "万名群众进城镇", + "navigationBarBackgroundColor": "#2b4b6b" + }, + "tabBar": { + "list": [{ + "pagePath": "pages/home/home", + "text": "首页", + "iconPath": "/assets/images/icon/home-off.png", + "selectedIconPath": "/assets/images/icon/home-on.png" + }, + { + "pagePath": "pages/personal/personal", + "text": "个人", + "iconPath": "/assets/images/icon/personal-off.png", + "selectedIconPath": "/assets/images/icon/personal-on.png" + }] + }, + "style": "v2", + "rendererOptions": { + "skyline": { + "defaultDisplayBlock": true, + "disableABTest": true, + "sdkVersionBegin": "3.0.0", + "sdkVersionEnd": "15.255.255" + } + }, + "componentFramework": "glass-easel", + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents" +} diff --git a/app.wxss b/app.wxss new file mode 100644 index 0000000..06c6fc9 --- /dev/null +++ b/app.wxss @@ -0,0 +1,10 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; +} diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..4bbeb63 Binary files /dev/null and b/assets/.DS_Store differ diff --git a/assets/images/.DS_Store b/assets/images/.DS_Store new file mode 100644 index 0000000..41f9627 Binary files /dev/null and b/assets/images/.DS_Store differ diff --git a/assets/images/icon/.DS_Store b/assets/images/icon/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/assets/images/icon/.DS_Store differ diff --git a/assets/images/icon/Phone.svg b/assets/images/icon/Phone.svg new file mode 100644 index 0000000..262b15a --- /dev/null +++ b/assets/images/icon/Phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/icon/eye.svg b/assets/images/icon/eye.svg new file mode 100644 index 0000000..dad70d0 --- /dev/null +++ b/assets/images/icon/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/icon/home-off.png b/assets/images/icon/home-off.png new file mode 100644 index 0000000..b2376d6 Binary files /dev/null and b/assets/images/icon/home-off.png differ diff --git a/assets/images/icon/home-on.png b/assets/images/icon/home-on.png new file mode 100644 index 0000000..be05a02 Binary files /dev/null and b/assets/images/icon/home-on.png differ diff --git a/assets/images/icon/password.svg b/assets/images/icon/password.svg new file mode 100644 index 0000000..9794a34 --- /dev/null +++ b/assets/images/icon/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/icon/personal-off.png b/assets/images/icon/personal-off.png new file mode 100644 index 0000000..463447a Binary files /dev/null and b/assets/images/icon/personal-off.png differ diff --git a/assets/images/icon/personal-on.png b/assets/images/icon/personal-on.png new file mode 100644 index 0000000..0270329 Binary files /dev/null and b/assets/images/icon/personal-on.png differ diff --git a/assets/images/icon/weixin.svg b/assets/images/icon/weixin.svg new file mode 100644 index 0000000..3adc187 --- /dev/null +++ b/assets/images/icon/weixin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/icon/招聘 (1).png b/assets/images/icon/招聘 (1).png new file mode 100644 index 0000000..911ef68 Binary files /dev/null and b/assets/images/icon/招聘 (1).png differ diff --git a/assets/images/icon/招聘.png b/assets/images/icon/招聘.png new file mode 100644 index 0000000..9db4d61 Binary files /dev/null and b/assets/images/icon/招聘.png differ diff --git a/assets/images/icon/政策解读.png b/assets/images/icon/政策解读.png new file mode 100644 index 0000000..8bdfe3b Binary files /dev/null and b/assets/images/icon/政策解读.png differ diff --git a/assets/images/icon/群众信息管理.png b/assets/images/icon/群众信息管理.png new file mode 100644 index 0000000..680e048 Binary files /dev/null and b/assets/images/icon/群众信息管理.png differ diff --git a/assets/images/icon/问答3 (1).png b/assets/images/icon/问答3 (1).png new file mode 100644 index 0000000..86357c8 Binary files /dev/null and b/assets/images/icon/问答3 (1).png differ diff --git a/assets/images/icon/问答3.png b/assets/images/icon/问答3.png new file mode 100644 index 0000000..1f2b465 Binary files /dev/null and b/assets/images/icon/问答3.png differ diff --git a/assets/pictures/.DS_Store b/assets/pictures/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/assets/pictures/.DS_Store differ diff --git a/pages/assist/assist.js b/pages/assist/assist.js new file mode 100644 index 0000000..3325c88 --- /dev/null +++ b/pages/assist/assist.js @@ -0,0 +1,66 @@ +// pages/assist/assist.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/assist/assist.json b/pages/assist/assist.json new file mode 100644 index 0000000..806c96b --- /dev/null +++ b/pages/assist/assist.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white", + "navigationBarTitleText": "帮扶信息" +} \ No newline at end of file diff --git a/pages/assist/assist.wxml b/pages/assist/assist.wxml new file mode 100644 index 0000000..f44093f --- /dev/null +++ b/pages/assist/assist.wxml @@ -0,0 +1,2 @@ + +pages/assist/assist.wxml \ No newline at end of file diff --git a/pages/assist/assist.wxss b/pages/assist/assist.wxss new file mode 100644 index 0000000..07d1214 --- /dev/null +++ b/pages/assist/assist.wxss @@ -0,0 +1 @@ +/* pages/assist/assist.wxss */ \ No newline at end of file diff --git a/pages/home/home.js b/pages/home/home.js new file mode 100644 index 0000000..2de50f7 --- /dev/null +++ b/pages/home/home.js @@ -0,0 +1,100 @@ +// pages/personal/personal.js +import { requestUrl } from '../../utils/config.js'; +Page({ + + /** + * 页面的初始数据 + */ + data: { + menuItems: [], + swiperList:[] + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getMenu(); + this.getSwiperList(); + }, + getMenu(){ + wx.request({ + url: requestUrl + '/api/get-menu', // 更改为你的实际API地址 + success: (res) => { + console.log(res.data) + this.setData({ menuItems: res.data.data }); + } + }); + }, + getSwiperList(){ + let that = this; // 在回调中使用this,所以需要先保存它的引用 + wx.request({ + url: requestUrl + '/api/get-swiper-list', // 确保requestUrl已定义且正确 + method: "GET", + success(res) { + console.log(res.data); // 打印响应内容 + // 假设返回的数据结构是{ image_ids: [...] } + if(res.data.code == 0 && res.data.msg == "ok"){ + console.log("请求成功") + that.setData({swiperList:res.data.data}) + } else { + // 处理错误或空数据的情况 + console.log("Received empty or incorrect format data"); + } + }, + fail(error) { + // 请求失败的处理 + console.error("Request failed", error); + } + }); + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/home/home.json b/pages/home/home.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/home/home.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/home/home.wxml b/pages/home/home.wxml new file mode 100644 index 0000000..0e93349 --- /dev/null +++ b/pages/home/home.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + {{item.menu_name}} + + + + \ No newline at end of file diff --git a/pages/home/home.wxss b/pages/home/home.wxss new file mode 100644 index 0000000..fef5195 --- /dev/null +++ b/pages/home/home.wxss @@ -0,0 +1,43 @@ +.page-body { + display: flex; + flex-direction: column; +} + +.slide-image { + width: 100%; + height: 100%; +} + +/* 四宫格布局样式 */ +.grid-container { + display: flex; + justify-content: center; +} + +.card { + width: 96%; /* 根据实际情况调整 */ + height: 290rpx; + border-radius: 30rpx; /* 圆角大小 */ + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* 阴影效果,根据需要调整 */ + display: flex; + flex-wrap: wrap; + justify-content: space-around; /* 子项在主轴线上的对齐方式 */ + margin: 20px 0; /* 卡片外边距 */ +} + +.grid-item { + width: 48%; /* 每个项目占据一行的48%,两列布局 */ + text-align: center; /* 文本居中 */ + margin-bottom: 20px; /* 底部外边距 */ + margin-top: 20rpx; +} + +.grid-item image { + width: 40rpx; /* 图像大小,根据需要调整 */ + height: 40rpx; + margin-bottom: 5rpx; /* 图像与文本之间的间距,根据需要调整 */ +} + +.grid-item text { + display: block; /* 让文本独占一行 */ +} diff --git a/pages/login/login.js b/pages/login/login.js new file mode 100644 index 0000000..2507fd4 --- /dev/null +++ b/pages/login/login.js @@ -0,0 +1,111 @@ +import { requestUrl } from '../../utils/config.js'; +function showTost(title){ + wx.showToast({ + title: title, + icon: "none", + duration: 2000 + }); +} + +Page({ + + /** + * 页面的初始数据 + */ + data: { + phoneNumber: '', // 手机号 + password: '' // 密码 + }, + handlePhoneInput(event) { + this.setData({ phoneNumber: event.detail.value }); + }, + handlePasswordInput(event) { + this.setData({ password: event.detail.value }); + }, + handleLogin() { + wx.request({ + url: requestUrl + '/user/login', // 你的接口地址 + method: 'POST', + data: { + username: this.data.phoneNumber, + password: this.data.password + }, + header: { + 'Content-Type': 'application/json' + }, + success(res) { + if (res.data.code == 0 && res.data.msg == "ok"){ + console.log("登录成功",res.data.code) + showTost("登录成功") + // wx.redirectTo({ + // url: 'pages/home/home', + // }) + wx.switchTab({ + url: 'pages/home/home' + }) + } else { + showTost(res.data.msg) + console.log("登录失败",res.data) + } + }, + fail(error) { + console.log('登录失败', error); + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/login/login.json b/pages/login/login.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/pages/login/login.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/pages/login/login.wxml b/pages/login/login.wxml new file mode 100644 index 0000000..e8895b7 --- /dev/null +++ b/pages/login/login.wxml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + 忘记密码? + + + + + + + + + 同意小程序的《使用协议》 + + + + + + + 您还可以使用以下方式登录 + + + + + + + + \ No newline at end of file diff --git a/pages/login/login.wxss b/pages/login/login.wxss new file mode 100644 index 0000000..8f694d2 --- /dev/null +++ b/pages/login/login.wxss @@ -0,0 +1,167 @@ +/* 最大的父元素 */ +.login{ + display: block; + position:absolute; + height: 100%; + width: 100%; + background:#778899; + /* 换图片 */ + +} +/* 白色区域 */ +.login .login-card{ + position: relative; + margin-top: 150rpx; + left: 100rpx; + width: 545rpx; + height: 750rpx; + background: #FFFFFF; + border-radius: 50rpx; +} +/* 白色区域内的登录文本 */ +.login .login-card .login-text{ + margin-top: 50rpx; + position: absolute; + margin-left:80rpx; + width: 150rpx; + height: 100rpx; + font-size: 60rpx; + font-family: Helvetica; + color: #000000; + line-height: 100rpx; + letter-spacing: 2rpx; +} +/* 手机图片+输入框+下划线的父容器view */ +.login .login-card .phone{ + margin-top: 200rpx; + margin-left: 35rpx; + position: absolute; + display: flex; + width:450rpx ; + height: 80rpx ; + border-bottom: 3rpx solid rgb(58, 57, 57); +} +/* 手机图标 */ +.login .login-card .phone .phone-icon{ + margin-top: 5rpx; + margin-left: 30rpx; + width: 55rpx; + height: 55rpx; +} +/* 手机号输入框 */ +.login .login-card .phone input{ + width: 200rpx; + font-size: 25rpx ; + margin-top: 15rpx; + margin-left: 30rpx; +} +/* 密码图标+输入框+小眼睛图标+下划线父容器view */ +.login .login-card .password{ + margin-top: 400rpx; + margin-left: 35rpx; + position: absolute; + display: flex; + width:450rpx ; + height: 80rpx ; + border-bottom: 3rpx solid rgb(58, 57, 57); +} +/* 密码图标 */ +.login .login-card .password .password-icon{ + margin-top: 5rpx; + margin-left: 30rpx; + width: 55rpx; + height: 55rpx; +} +/* 眼睛 图标*/ +.login .login-card .password .eye-icon{ + margin-top: 5rpx; + margin-left: 65rpx; + width: 55rpx; + height: 55rpx; +} +/* 密码输入框 */ +.login .login-card .password input{ + width: 200rpx; + font-size: 25rpx ; + margin-top: 15rpx; + margin-left: 30rpx; +} +/* 注册+忘记密码父容器 */ +.login .login-card .forget-password{ + font-size: 25rpx; + margin-left: 85rpx; + width: 370rpx; + margin-top: 540rpx; + position: absolute; + display: flex; + justify-content: space-between; +} +/* 登录按钮容器view */ +.login .login-card .login-btn{ + width: 350rpx; + height: 50rpx; + position: absolute; + margin-top: 600rpx; + margin-left: 85rpx; + +} +/* 登录按钮 */ +.login .login-card .login-btn button{ + padding: 0rpx; + line-height: 50rpx; + font-size: 25rpx; + width: 100%; + height: 100%; + border-radius: 30rpx; +} +/* 复选框+协议文字容器view */ +.login .login-card .agreement-area{ + margin-left: 10rpx; + margin-top: 680rpx; + width: 400rpx; + display: flex; + position: absolute; +} +/* 复选框 */ +.login .login-card .agreement-area .agreement{ + margin-left: 85rpx; + /* 修改复选框的大小 */ + transform:scale(.6); +} +/* 协议文本 */ +.login .login-card .agreement-area .agreement-text{ + margin-left: 10rpx; + margin-top: 10rpx; + color: #000000; + font-size:20rpx; +} +/* 提示文本 */ +.prompt-box{ + padding-left: 100rpx; + display: flex; + position: relative; + width: 100%; + height: 60rpx; + padding-top: 50rpx; +} +.prompt-box .line{ + margin-left: 5rpx; + margin-top: 18rpx; + width: 120rpx; + height: 3rpx; + background-color:#FFFFFF; +} +.prompt-box .lText{ + color: #FFFFFF; + font-size: 25rpx; +} +.other-login { + display: flex; /* 启用flex布局 */ + justify-content: center; /* 水平居中 */ + align-items: center; /* 垂直居中 */ +} +.other-login image{ + + width: 80rpx; + height: 80rpx; +} \ No newline at end of file diff --git a/pages/messageEdit/messageEdit.js b/pages/messageEdit/messageEdit.js new file mode 100644 index 0000000..e59fa17 --- /dev/null +++ b/pages/messageEdit/messageEdit.js @@ -0,0 +1,66 @@ +// pages/messageEdit/messageEdit.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/messageEdit/messageEdit.json b/pages/messageEdit/messageEdit.json new file mode 100644 index 0000000..b73efb1 --- /dev/null +++ b/pages/messageEdit/messageEdit.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white", + "navigationBarTitleText": "问答" +} \ No newline at end of file diff --git a/pages/messageEdit/messageEdit.wxml b/pages/messageEdit/messageEdit.wxml new file mode 100644 index 0000000..293288c --- /dev/null +++ b/pages/messageEdit/messageEdit.wxml @@ -0,0 +1,16 @@ + + + + 留言标题 + + + + + + 留言内容 + + + + + + diff --git a/pages/messageEdit/messageEdit.wxss b/pages/messageEdit/messageEdit.wxss new file mode 100644 index 0000000..f90f636 --- /dev/null +++ b/pages/messageEdit/messageEdit.wxss @@ -0,0 +1,40 @@ +.leave-message-page { + padding: 20px; + background-color: #f0f0f0; /* 页面背景色 */ +} + +.input-group { + margin-bottom: 20px; /* 间距 */ + background-color: white; /* 输入区域背景色 */ + padding: 10px; + border-radius: 10px; /* 圆角 */ +} + +.label { + font-size: 16px; + color: #333; + margin-bottom: 5px; +} + +.input, +.textarea { + width: 100%; + padding: 10px; + border: 1px solid #ddd; /* 边框 */ + border-radius: 5px; /* 圆角 */ +} + +.textarea { + height: 150px; /* 文本区域高度 */ +} + +.submit-btn { + width: calc(100% - 40px); /* 减去padding */ + margin: 0 auto; /* 水平居中 */ + padding: 10px; + background-color: #1aad19; /* 微信绿 */ + color: white; + border-radius: 5px; /* 圆角 */ + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 轻微阴影 */ + font-size: 18px; /* 字号 */ +} diff --git a/pages/personal/personal.js b/pages/personal/personal.js new file mode 100644 index 0000000..74b5804 --- /dev/null +++ b/pages/personal/personal.js @@ -0,0 +1,66 @@ +// pages/personal/personal.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/personal/personal.json b/pages/personal/personal.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/personal/personal.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/personal/personal.wxml b/pages/personal/personal.wxml new file mode 100644 index 0000000..dfe0524 --- /dev/null +++ b/pages/personal/personal.wxml @@ -0,0 +1,2 @@ + +pages/personal/personal.wxml \ No newline at end of file diff --git a/pages/personal/personal.wxss b/pages/personal/personal.wxss new file mode 100644 index 0000000..565c5ad --- /dev/null +++ b/pages/personal/personal.wxss @@ -0,0 +1 @@ +/* pages/personal/personal.wxss */ \ No newline at end of file diff --git a/pages/policy/policy.js b/pages/policy/policy.js new file mode 100644 index 0000000..e40343d --- /dev/null +++ b/pages/policy/policy.js @@ -0,0 +1,86 @@ +// pages/policy/policy.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + policies: [ + { title: "政策标题1", date: "2024-01-01" }, + { title: "政策标题2", date: "2023-01-02" }, + { title: "政策标题3", date: "2022-01-02" }, + { title: "政策标题4", date: "2023-01-02" }, + { title: "政策标题5", date: "2022-01-02" }, + { title: "政策标题6", date: "2023-01-02" }, + { title: "政策标题7", date: "2021-01-02" }, + { title: "政策标题8", date: "2021-01-02" }, + { title: "政策标题9", date: "2024-02-02" }, + { title: "政策标题10", date: "2024-03-02" }, + { title: "政策标题11", date: "2024-04-02" }, + { title: "政策标题12", date: "2024-01-02" }, + { title: "政策标题13", date: "2024-01-02" }, + { title: "政策标题14", date: "2024-01-02" }, + { title: "政策标题15", date: "2024-01-02" }, + { title: "政策标题16", date: "2024-01-02" }, + { title: "政策标题17", date: "2024-01-02" }, + // 更多政策数据... + ] + // 更多数据... + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/policy/policy.json b/pages/policy/policy.json new file mode 100644 index 0000000..20b1119 --- /dev/null +++ b/pages/policy/policy.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white", + "navigationBarTitleText": "政策查询" +} \ No newline at end of file diff --git a/pages/policy/policy.wxml b/pages/policy/policy.wxml new file mode 100644 index 0000000..4c99005 --- /dev/null +++ b/pages/policy/policy.wxml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + {{item.title}} + + 发布时间:{{item.date}} + + + + + \ No newline at end of file diff --git a/pages/policy/policy.wxss b/pages/policy/policy.wxss new file mode 100644 index 0000000..536f711 --- /dev/null +++ b/pages/policy/policy.wxss @@ -0,0 +1,36 @@ +.policy-page { + display: flex; + flex-direction: column; +} + +.search-bar input { + width: 90%; + padding: 10px; + border: 1px solid #ccc; /* 轻微边框 */ + border-radius: 5px; /* 圆角 */ + margin:0 auto; /* 上下保持0,左右自动,实现水平居中 */ +} + + +.policy-list .policy-item { + padding: 10px; +} + + +.policy-item .title { + font-size: 18px; + color: #333; +} + +.policy-item .date { + font-size: 14px; /* 日期字体大小 */ + color: #666; /* 日期颜色 */ + margin-top: 5px; +} +.policy-card { + background-color: white; /* 卡片背景色 */ + border-radius: 10px; /* 圆角 */ + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */ + margin: 10px; /* 外边距,根据需要调整 */ + padding: 15px; /* 内边距,根据需要调整 */ +} diff --git a/pages/qa/qa.js b/pages/qa/qa.js new file mode 100644 index 0000000..83aaa82 --- /dev/null +++ b/pages/qa/qa.js @@ -0,0 +1,104 @@ +// pages/messageEdit/messageEdit.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + messages: [ + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + { + id: 1, // unique identifier for each message + title: "留言标题1", + date: "2024-01-01" + }, + // 更多留言... + ] + }, + + goToMessageEdit: function () { + wx.navigateTo({ + url: '/pages/messageEdit/messageEdit' + }); + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/qa/qa.json b/pages/qa/qa.json new file mode 100644 index 0000000..b73efb1 --- /dev/null +++ b/pages/qa/qa.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white", + "navigationBarTitleText": "问答" +} \ No newline at end of file diff --git a/pages/qa/qa.wxml b/pages/qa/qa.wxml new file mode 100644 index 0000000..03cb9c5 --- /dev/null +++ b/pages/qa/qa.wxml @@ -0,0 +1,14 @@ + + + + + + {{item.title}} + {{item.date}} + + + + + + + diff --git a/pages/qa/qa.wxss b/pages/qa/qa.wxss new file mode 100644 index 0000000..2dfc8d4 --- /dev/null +++ b/pages/qa/qa.wxss @@ -0,0 +1,38 @@ +.messages-page { + position: relative; /* 为子元素绝对定位提供参考 */ + padding: 20rpx; + padding-bottom: 100rpx; /* 留出足够的空间给底部的按钮 */ +} + +.message-list .message-card { + background-color: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + margin: 10px 0; + padding: 20px; +} + +.message-title { + font-size: 18px; + font-weight: bold; + margin-bottom: 5px; +} + +.message-date { + font-size: 14px; + color: #666; +} + +.leave-message-btn { + position: fixed; /* 固定位置 */ + bottom: 20px; /* 距离底部20px */ + left: 50%; /* 水平居中 */ + transform: translateX(-50%); /* 与left配合使其完全居中 */ + width: 90%; + padding: 10px; + border-radius: 20px; /* 增加圆角 */ + font-size: 16px; + color: black; /* 字体颜色为红色 */ + background-color: white; /* 按钮背景色,可以根据需要调整 */ + border: 1px solid #ccc; /* 轻微边框,可以根据需要调整 */ +} diff --git a/pages/recruit/recruit.js b/pages/recruit/recruit.js new file mode 100644 index 0000000..d5d8fb0 --- /dev/null +++ b/pages/recruit/recruit.js @@ -0,0 +1,78 @@ +// pages/recruit/recruit.js +Page({ + + /** + * 页面的初始数据 + */ +data: { + jobs: [ + { + title: "软件工程师", + salary: "10k-15k", + date: "2024-01-01", + detail: "技术栈JAVA、Golang" + }, + { + title: "产品经理", + salary: "12k-20k", + date: "2024-01-02", + detail: "产品经理" + }, + ] + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/recruit/recruit.json b/pages/recruit/recruit.json new file mode 100644 index 0000000..ad648d8 --- /dev/null +++ b/pages/recruit/recruit.json @@ -0,0 +1,5 @@ +{ + "usingComponents": {}, + "navigationBarTextStyle": "white", + "navigationBarTitleText": "招聘" +} \ No newline at end of file diff --git a/pages/recruit/recruit.wxml b/pages/recruit/recruit.wxml new file mode 100644 index 0000000..b415f3f --- /dev/null +++ b/pages/recruit/recruit.wxml @@ -0,0 +1,18 @@ + + + + + + + + {{item.title}} + {{item.salary}} + + + 发布日期:{{item.date}} + 概述:{{item.detail}} + + + + + diff --git a/pages/recruit/recruit.wxss b/pages/recruit/recruit.wxss new file mode 100644 index 0000000..1c5b62b --- /dev/null +++ b/pages/recruit/recruit.wxss @@ -0,0 +1,39 @@ +.jobs-page { + padding: 20rpx; +} + +.job-list .job-card { + background-color: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + margin: 10px 0; + padding: 20px; +} + +.job-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; +} + +.job-title { + font-size: 18px; + font-weight: bold; +} + +.job-salary { + font-size: 16px; + color: #ff5722; +} + +.job-info .job-date { + font-size: 14px; + color: #999; +} + +.job-info .job-detail { + font-size: 14px; + color: #666; + margin-top: 5px; +} diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..e39d9ed --- /dev/null +++ b/project.config.json @@ -0,0 +1,28 @@ +{ + "appid": "wxd0724e4918da9826", + "compileType": "miniprogram", + "libVersion": "3.2.1", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "auto", + "tabSize": 2 + } +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..e9483e7 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,34 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "govService", + "setting": { + "compileHotReLoad": true, + "urlCheck": false + }, + "condition": { + "miniprogram": { + "list": [ + { + "name": "pages/login/login", + "pathName": "pages/login/login", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "pages/home/home", + "pathName": "pages/home/home", + "query": "", + "launchMode": "default", + "scene": null, + "partialCompile": { + "enabled": false, + "pages": [ + "pages/login/login" + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/sitemap.json b/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/utils/config.js b/utils/config.js new file mode 100644 index 0000000..79ca8a3 --- /dev/null +++ b/utils/config.js @@ -0,0 +1,3 @@ +// 在config.js +const requestUrl = "http://127.0.0.1:8000"; +export { requestUrl }; diff --git a/utils/util.js b/utils/util.js new file mode 100644 index 0000000..3564a92 --- /dev/null +++ b/utils/util.js @@ -0,0 +1,61 @@ +const formatTime = date => { + const year = date.getFullYear() + const month = date.getMonth() + 1 + const day = date.getDate() + const hour = date.getHours() + const minute = date.getMinutes() + const second = date.getSeconds() + + return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}` +} + +const formatNumber = n => { + n = n.toString() + return n[1] ? n : `0${n}` +} + +function checkFile(path) { + let fs = wx.getFileSystemManager(); + fs.access({ + path: `${wx.env.USER_DATA_PATH}/usr/images/1.png`, + success(res) { + // 文件存在 + console.log("存在") + }, + fail(res) { + // 文件不存在或其他错误 + console.error(res) + } + }) +} + +function checkDir() { + let fs = wx.getFileSystemManager() + fs.access({ + path: `${wx.env.USER_DATA_PATH}/images`, + success(res) { + // 文件存在 + console.log(res) + return; + }, + fail(res) { + console.log(res) + // 文件不存在或其他错误 + fs.mkdir({ + dirPath: `${wx.env.USER_DATA_PATH}/images`, + recursive: false, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } + }) + } + }) +} +module.exports = { + formatTime, + checkFile, + checkDir +}