diff --git a/app.json b/app.json index f7a4f4d..787c7fd 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,6 @@ { "pages": [ + "pages/welcome/homePage/homePage", "pages/loginModule/pwdLogin/pwdLogin", "pages/personCenter/mine/mine", "pages/loginModule/agreement/agreement", @@ -30,11 +31,15 @@ "pages/course/courseList/courseList", "pages/course/courseDetail/courseDetail", "pages/course/createCourseOrder/createCourseOrder", - "pages/course/waitPayOrder/waitPayOrder", + "pages/course/orderDetail/orderDetail", "pages/course/applyPromotion/applyPromotion", "pages/course/recommendUser/recommendUser", "pages/course/courseOrderList/courseOrderList", - "pages/course/courseSettlementRecord/courseSettlementRecord" + "pages/course/courseSettlementRecord/courseSettlementRecord", + "pages/loginModule/employeeAccountApply/employeeAccountApply", + "pages/loginModule/employeeAccountNotice/employeeAccountNotice", + "pages/loginModule/employeeApplyQuery/employeeApplyQuery", + "pages/dashboardModule/overviewPerformance/overviewPerformance" ], "window": { "navigationBarTextStyle": "black", diff --git a/pages/course/courseDetail/courseDetail.js b/pages/course/courseDetail/courseDetail.js index fd0ee18..f1f4720 100644 --- a/pages/course/courseDetail/courseDetail.js +++ b/pages/course/courseDetail/courseDetail.js @@ -1,15 +1,15 @@ -import { baseUrl } from "../../../request"; +import { baseUrl, globalImgUrl } from "../../../request"; import { decodeBase64 } from "../../../utils/decodebase64"; // pages/course/courseDetail/courseDetail.js Page({ data: { - chapterList: [null, null, null,null, null, null], // 章节目录 activeTab: 'intro', // 默认选中“课程简介” activeIndex: null, // 默认没有任何标题被选中 cid: 0, // 课程ID courseObj: '', // 课程对象 richText: '', // 课程概述富文本 + globalImgUrl, }, // 获取课程详情 @@ -29,7 +29,6 @@ Page({ if (res.data.code === 1) { this.setData({ courseObj: res.data.data, - chapterList: res.data.data.courseChapters, richText: decodeBase64(res.data.data.detail) }) } @@ -59,6 +58,7 @@ Page({ }) }, + // 好像不要了 // 跳转申请推广页面 gotoApplyPromotion(e) { const courseId = e.currentTarget.dataset.id; diff --git a/pages/course/courseDetail/courseDetail.wxml b/pages/course/courseDetail/courseDetail.wxml index 1d3cd37..662118d 100644 --- a/pages/course/courseDetail/courseDetail.wxml +++ b/pages/course/courseDetail/courseDetail.wxml @@ -1,79 +1,36 @@ - - - - - - - - - 课程简介 - 课程目录 - - - - - - - - {{ courseObj.originPrice }} - 元券后价 - - - {{ courseObj.discountPrice }}元 - - - - {{ courseObj.name }} - - - - - - - 课程概述 - - - - - - - - - - - - {{ index + 1}} - - {{ item.name }} - - - - - - + + + + + + {{ courseObj.discountPrice }} + 元券后价 + + + {{ courseObj.originPrice }}元 + + {{ courseObj.name }} + + + + 课程概述 + + + - - - - + + - 咨询 + 咨询 - - - 申请推广 - - - 立即购买 - + + 立即购买 - + \ No newline at end of file diff --git a/pages/course/courseDetail/courseDetail.wxss b/pages/course/courseDetail/courseDetail.wxss index f92a208..5de41bd 100644 --- a/pages/course/courseDetail/courseDetail.wxss +++ b/pages/course/courseDetail/courseDetail.wxss @@ -1,123 +1,43 @@ -/* pages/course/courseDetail/courseDetail.wxss */ - -/* 通用间距 */ .mt-9 { margin-top: 16.88rpx; } -/* .mt-35 { - margin-top: 65.63rpx; -} */ -.mt-15 { - margin-top: 28.13rpx; -} -.mt-7 { - margin-top: 13.13rpx; +.mt-37 { + margin-top: 69.38rpx; } .mt-1 { margin-top: 1.88rpx; } -.ml-15 { - margin-left: 28.13rpx; -} - -/* 背景图样式移至 WXML */ -.background-image { - width: 100%; - height: 300rpx; /* 给图片设置固定高度,或者你可以设置为100% */ - object-fit: cover; -} - -/* 页面样式保持不变 */ .page { background-color: #f6f7f9; + padding-bottom: 100rpx; width: 100%; overflow-y: auto; overflow-x: hidden; height: 100%; - padding-bottom: 100rpx; /* 为底部固定栏预留空间 */ } - -/* 背景图 */ +.image { + width: 100vw; + height: 54.75vw; +} .section { - background-size: 100% 100%; - background-repeat: no-repeat; + padding: 37.5rpx 11.25rpx 30rpx 18.75rpx; + background-color: #ffffff; } - -/* 顶部遮罩 */ -.section_2 { - padding: 131.25rpx 176.25rpx 101.25rpx; - background-color: #00000063; - backdrop-filter: blur(9.38rpx); -} - -/* 宽度组 */ .group { - width: 344.34rpx; -} - -/* 白色文字 */ -.font { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 31.88rpx; - color: #ffffff; -} - -/* 橙色按钮 */ -.text-wrapper { - padding: 15rpx 0; - background-color: #ff8d1a; - border-radius: 187.5rpx; - width: 208.13rpx; -} - -/* 橙色小字体 */ -.font_3 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 24.6rpx; - color: #ff8d1a; -} -.text_3 { - color: #ffffff; -} - -/* 选项卡容器 */ -.section_3 { - padding: 0 135rpx 7.5rpx 142.5rpx; - background-color: #ffffff; - border-bottom: solid 1.88rpx #9c9c9c; -} -.group_2 { - padding: 22.5rpx 0 11.25rpx; - display: flex; - justify-content: center; /* 增加选项卡间隔 */ -} - -/* 标题+价格 */ -.section_4 { - padding: 37.5rpx 7.5rpx 30rpx 22.5rpx; - background-color: #ffffff; -} -.group_4 { padding: 0 3.75rpx; } -.group_5 { +.group_2 { line-height: 28.8rpx; height: 30.58rpx; } -.text_6 { +.text { color: #f84947; font-size: 37.5rpx; font-family: SourceHanSansCN; font-weight: 700; line-height: 28.8rpx; } -.text_7 { - color: #f84947; - line-height: 24.43rpx; -} -.group_6 { +.group_3 { margin-right: 453.75rpx; width: 75.02rpx; } @@ -133,212 +53,78 @@ top: 50%; transform: translateY(-50%); } -.text_9 { +.text_4 { color: #000000; font-size: 33.75rpx; font-family: SourceHanSansCN; line-height: 41.25rpx; } - -/* 课程概述 */ -.section_5 { - margin-top: 28.13rpx; +.section_2 { padding: 0 30rpx 52.5rpx; background-color: #ffffff; } -.group_7 { +.group_4 { padding: 26.25rpx 0; } -.image { +.image_2 { width: 39.38rpx; height: 39.38rpx; } - -/* 概述内容区 */ -.section_6 { - background-color: #ffffff00; - height: 791.25rpx; - /* border-left: solid 1.88rpx #000000; - border-right: solid 1.88rpx #000000; - border-top: solid 1.88rpx #000000; - border-bottom: solid 1.88rpx #000000; */ -} - -/* 目录列表 */ -.section_7 { - padding: 31.88rpx 0; - background-color: #ffffff; -} -.list { - margin: 0 22.5rpx; -} -.group_8 { - width: 590.81rpx; - display: flex; - align-items: center; /* 序号垂直居中 */ - margin-top: 3rpx !important; /* 视频标题与上方内容的间距 */ -} -.list-item { - padding-left: 37.5rpx; - padding-bottom: 25.75rpx; - background-color: #f6f7f9; - border-radius: 10.63rpx; -} -.list-item:first-child { - margin-top: 0; -} - -/* 全局试看按钮 */ -.text-wrapper_2 { - padding: 3.75rpx 0; - background-color: #ff8d1a; - border-radius: 0rpx 9.38rpx 0rpx 9.38rpx; -} -.font_4 { - font-size: 24rpx; /* 放大字体 */ - font-family: SourceHanSansCN; - line-height: 28rpx; /* 放大行高 */ - color: #ffffff; -} -.text_11 { - margin: 0 7.5rpx; - line-height: 28rpx; /* 放大行高 */ -} - -/* 列表文本 */ -.font_5 { +.font { font-size: 26.25rpx; font-family: SourceHanSansCN; - line-height: 19.24rpx; - color: #8f8f8f; + line-height: 25.97rpx; } -.text_12 { - margin-top: 0; /* 垂直居中序号 */ - align-self: center !important; - padding-top: 32rpx; -} -.font_2 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; +.text_3 { + width: 100rpx; + color: #8c8c8c; line-height: 31.88rpx; - color: #000000; -} - -/* 其他文本 */ -.text { word-break: break-all; } -.text_8 { - color: #8c8c8c; - width: 100rpx; -} .text_2 { - color: #ff8d1a; + color: #f84947; + line-height: 24.43rpx; } -.group_9 { - padding-left: 41.25rpx; - padding-right: 20.63rpx; +.text_5 { + color: #000000; + font-size: 28.13rpx; } -.font_6 { - font-size: 22.5rpx; - font-family: SourceHanSansCN; - line-height: 19.24rpx; - color: #8f8f8f; +.section_3 { + height: 791.25rpx; + /* 以下是新增 */ + white-space: normal; /* 允许换行 */ + word-break: break-all; /* 在任意字符处断行,数字也会换行 */ } -.text_13 { - line-height: 20.79rpx; -} -.image_2 { - width: 30rpx; - height: 30rpx; -} - -/* 底部原有按钮组 */ -.section_8 { +.section_4 { padding: 15rpx 26.25rpx; background-color: #ffffff; -} -.image_3 { - width: 52.5rpx; - height: 52.5rpx; -} -.text_16 { - color: #000000; - line-height: 20.94rpx; -} -.text-wrapper_3 { - padding: 22.5rpx 0; - flex: 1 1 268.13rpx; - background-color: #a5d63f; - border-radius: 75rpx; - height: 71.25rpx; -} -.font_7 { - font-size: 30rpx; - font-family: SourceHanSansCN; - line-height: 28.8rpx; - color: #ffffff; -} -.text_14 { - line-height: 28.29rpx; -} -.text-wrapper_4 { - padding: 22.5rpx 0; - flex: 1 1 268.13rpx; - background-color: #ff8d1a; - border-radius: 75rpx; - height: 71.25rpx; -} -.text_15 { - line-height: 28.11rpx; -} - -/* 新增:选项卡文字基础样式 */ -.text-tab { - font-size: 32rpx; - font-family: SourceHanSansCN; - line-height: 38rpx; - padding-bottom: 8rpx; /* 文字与下划线之间留白 */ - margin: 0 80rpx; /* 增大间距 */ -} - -/* 新增:选中/未选中状态 */ -.tab-active { - color: #ff8d1a; - border-bottom: 2rpx solid #ff8d1a; -} -.tab-inactive { - color: #000000; - border-bottom: none; -} - -/* 覆盖:让 .group_2 居中其子元素,增强间距控制 */ -.group_2 { - justify-content: center !important; -} - -/* 新增:底部固定按钮栏 */ -.section_8_fixed { position: fixed; bottom: 0; left: 0; width: 100%; - z-index: 999; - background-color: #ffffff; + z-index: 999; /* 确保它在最上层 */ } -/* 禁止容器内元素换行 */ -.no-wrap { - flex-wrap: nowrap !important; + +.image_3 { + width: 52.5rpx; + height: 52.5rpx; } -/* 强制所有 text 不换行 */ -.no-wrap text { - white-space: nowrap; +.text_7 { + color: #000000; + font-size: 22.5rpx; + font-family: SourceHanSansCN; + line-height: 20.94rpx; } -.mx-15 { - margin-left: 15rpx; - margin-right: 15rpx; -} -/* 课程目录的点击状态 */ -.active-title { - color: #ff8d1a; /* 点击后的颜色:橙色 */ +.text-wrapper { + padding: 22.5rpx 0 18.75rpx; + background-color: #ff8d1a; + border-radius: 75rpx; + width: 268.13rpx; + height: 71.25rpx; } +.text_6 { + color: #ffffff; + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 28.11rpx; +} \ No newline at end of file diff --git a/pages/course/courseList/courseList.js b/pages/course/courseList/courseList.js index 053ef3a..31f175f 100644 --- a/pages/course/courseList/courseList.js +++ b/pages/course/courseList/courseList.js @@ -1,3 +1,5 @@ +import { baseUrl, globalImgUrl } from "../../../request"; + // pages/course/courseList/courseList.js Page({ @@ -5,8 +7,9 @@ Page({ * 页面的初始数据 */ data: { - items:[null,null,null,null,null,null,null,null,null], + courseList:[], // 课程列表 courseType: '', // 课程类别 + globalImgUrl, }, // 跳转课程详情页面 @@ -23,10 +26,45 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - // console.log('option--->',options); - this.setData({ - courseType: options.type - }) + // 接收路由参数 type 作为搜索关键字 + const courseType = options.type || ''; + this.setData({ courseType }, () => { + this.fetchCourseList(); + }); + }, + + // 从后端拉取课程列表 + fetchCourseList() { + wx.request({ + url: baseUrl + '/course/query/type', + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + data: { + templateString: this.data.courseType + }, + success: res => { + console.log('课程列表',res.data.data); + if (res.data.code === 1) { + this.setData({ + courseList: res.data.data + }); + } else { + wx.showToast({ + icon: 'none', + title: res.data.message || '获取课程失败', + }); + } + }, + fail: err => { + console.error('request failed', err); + wx.showToast({ + icon: 'none', + title: '网络请求失败', + }); + } + }); }, /** diff --git a/pages/course/courseList/courseList.wxml b/pages/course/courseList/courseList.wxml index d617040..207de98 100644 --- a/pages/course/courseList/courseList.wxml +++ b/pages/course/courseList/courseList.wxml @@ -1,35 +1,39 @@ - {{ courseType }} - - + + + + - + + - 区块链和加密数字货币(随报随学认证班) + + {{item.name}} - 券后99元起 - 18523人学习 + + 券后{{item.discountPrice}}元起 + + {{item.orderCount}}人学习 - \ No newline at end of file + diff --git a/pages/course/courseOrderList/courseOrderList.js b/pages/course/courseOrderList/courseOrderList.js index abec682..b9efdab 100644 --- a/pages/course/courseOrderList/courseOrderList.js +++ b/pages/course/courseOrderList/courseOrderList.js @@ -1,88 +1,143 @@ +import { baseUrl } from "../../../request"; + // pages/course/courseOrderList/courseOrderList.js Page({ - /** - * 页面的初始数据 - */ data: { - items: [null, null, null], - countDown: 30 * 60 , // 初始倒计时 - countDownStr: '' // 用于在视图中渲染的倒计时文本 + orderList: [], // 后端返回的订单列表 + hasModalShown: false, // 弹框只显示一次 }, - /** - * 生命周期函数--监听页面加载 - */ onLoad(options) { - this.startCountDown(); + this.fetchOrders(); }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() {}, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() {}, - - /** - * 生命周期函数--监听页面隐藏 - */ onHide() { - clearInterval(this.intervalId); + clearInterval(this._timer); }, - - /** - * 生命周期函数--监听页面卸载 - */ onUnload() { - clearInterval(this.intervalId); + clearInterval(this._timer); + }, + onShow() { + this.fetchOrders() }, - /** - * 启动倒计时 - */ - startCountDown() { - this.updateCountDownStr(); - this.intervalId = setInterval(() => { - let cd = this.data.countDown; - if (cd <= 1) { - clearInterval(this.intervalId); - this.setData({ - countDown: 0, - countDownStr: '00分00秒' - }); - } else { - cd--; - this.setData({ countDown: cd }); - this.updateCountDownStr(); + // 拉取后端接口 + fetchOrders() { + wx.request({ + url: baseUrl + '/courseOrder/query/list', // 替换为真实接口 + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + success: res => { + console.log('课程订单列表---->',res.data.data); + if (res.data.code === 1) { + const now = Date.now(); + let list = res.data.data.map(item => { + // 计算从 createTime 到 now 剩余秒数 + const createMs = new Date(item.createTime.replace(/-/g,'/')).getTime(); + let diff = Math.floor((createMs + 30*60*1000 - now) / 1000); + + // 只有“待支付”才需要倒计时、过期置“交易取消” + if (item.orderStatus === '待支付') { + if (diff <= 0) { + item.orderStatus = '交易取消'; + diff = 0; + // 首次检测到过期就弹框 + if (!this.data.hasModalShown) { + wx.showModal({ + title: '提示', + content: '订单超时未支付,已取消', + showCancel: false + }); + this.setData({ hasModalShown: true }); + } + } + item.countDown = diff; + const m = Math.floor(diff / 60); + const s = diff % 60; + item.countDownStr = `${m}分${s < 10 ? '0'+s : s}秒`; + } else { + item.countDown = 0; + item.countDownStr = ''; + } + return item; + }); + + this.setData({ orderList: list }, () => { + // 初始处理完后启动全局定时器 + this.startTimer(); + }); + + } else { + wx.showToast({ title: res.data.message || '获取失败', icon: 'none' }); + } + }, + fail: () => { + wx.showToast({ title: '网络错误', icon: 'none' }); } + }); + }, + + // 每秒更新所有待支付订单的倒计时 + startTimer() { + this._timer = setInterval(() => { + const updated = this.data.orderList.map(item => { + if (item.orderStatus === '待支付' && item.countDown > 0) { + const cd = item.countDown - 1; + item.countDown = cd; + const m = Math.floor(cd / 60); + const s = cd % 60; + item.countDownStr = `${m}分${s < 10 ? '0'+s : s}秒`; + + if (cd <= 0) { + item.orderStatus = '交易取消'; + item.countDownStr = ''; + if (!this.data.hasModalShown) { + wx.showModal({ + title: '提示', + content: '订单超时未支付,已取消', + showCancel: false + }); + this.setData({ hasModalShown: true }); + } + } + } + return item; + }); + this.setData({ orderList: updated }); }, 1000); }, - /** - * 更新倒计时显示字符串 - */ - updateCountDownStr() { - const minutes = Math.floor(this.data.countDown / 60); - const seconds = this.data.countDown % 60; - const str = `${minutes}分${seconds < 10 ? '0' + seconds : seconds}秒`; - this.setData({ countDownStr: str }); + // 跳转订单详情 + gotoOrderDetail(e) { + const orderId = e.currentTarget.dataset.id; + wx.navigateTo({ + url: `/pages/course/orderDetail/orderDetail?id=${orderId}`, + }) }, - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() {}, + // 取消订单 + cancelOrder() { + wx.showModal({ + title: '取消订单', + content: '是否要取消订单?', + success: res => { + if (res.confirm) { + wx.request({ + url: baseUrl + "/courseOrder/cancel", + method: 'POST', + data: { courseId: this.data.orderId }, + header: { Authorization: wx.getStorageSync('token') }, + success: () => this.getOrderDetail() + }); + } + } + }); + }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() {}, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() {} + // 支付订单 + payOrder() { + // wx.navigateTo({ url: `/pages/pay/pay?orderId=${this.data.orderId}` }); + wx.showToast({ title: '支付功能稍后开放', icon: 'none' }); + }, }); diff --git a/pages/course/courseOrderList/courseOrderList.wxml b/pages/course/courseOrderList/courseOrderList.wxml index 8c9ceb1..2e369c5 100644 --- a/pages/course/courseOrderList/courseOrderList.wxml +++ b/pages/course/courseOrderList/courseOrderList.wxml @@ -1,21 +1,36 @@ - + - 订单号:202506191307440406460485418 - 待支付 + 订单号:{{item.orderNumber}} + {{ item.orderStatus }} - 区块链和加密数字货币(随报随学认证班)(随报随学认证班) - ¥999.00 - 请在 {{countDownStr}} 内完成支付 + + {{ item.name }} + ¥{{ item.totalAmount }} + + + + 请在 {{ item.countDownStr }} 内完成支付 + + - 2025-06-17 13:00:33 + {{ item.createTime }} - + + 取消订单 - + 支付 diff --git a/pages/course/courseOrderList/courseOrderList.wxss b/pages/course/courseOrderList/courseOrderList.wxss index 54b2a3c..2ca186a 100644 --- a/pages/course/courseOrderList/courseOrderList.wxss +++ b/pages/course/courseOrderList/courseOrderList.wxss @@ -4,13 +4,13 @@ margin-top: 31.88rpx; } .ml-37 { - margin-left: 69.38rpx; + margin-left: 92.38rpx; } .ml-11 { margin-left: 20.63rpx; } .page { - padding: 26.25rpx 0 350.63rpx; + padding: 26.25rpx 0 50.63rpx; background-color: #f8f8f8; width: 100%; overflow-y: auto; @@ -68,7 +68,7 @@ .text_3 { margin-top: 58.09rpx; line-height: 22.76rpx; - margin-right: 50rpx; /* 向左移动:增加右侧间距 */ + margin-right: 22rpx; /* 向左移动:增加右侧间距 */ } .font_5 { font-size: 26.25rpx; @@ -93,9 +93,9 @@ line-height: 26.25rpx; color: #a1a1a1; } -.text_5 { +/* .text_5 { width: 206.25rpx; -} +} */ .text-wrapper { padding: 10.8rpx 0 8.16rpx; background-color: #ffffff; diff --git a/pages/course/createCourseOrder/createCourseOrder.js b/pages/course/createCourseOrder/createCourseOrder.js index 564a65b..e6677ec 100644 --- a/pages/course/createCourseOrder/createCourseOrder.js +++ b/pages/course/createCourseOrder/createCourseOrder.js @@ -1,3 +1,4 @@ +import { baseUrl, globalImgUrl } from "../../../request"; // pages/course/createCourseOrder/createCourseOrder.js Page({ @@ -6,13 +7,56 @@ Page({ */ data: { courseId: 0, // 课程id + courseObj: '', // 课程对象 + globalImgUrl, // 全局图片 }, // 创建订单方法 - createOrder(e) { - const courseId = e.currentTarget.dataset.id; - wx.navigateTo({ - url: `/pages/course/waitPayOrder/waitPayOrder?id=${courseId}`, + createOrder() { + const { courseId } = this.data; + let orderId ; + wx.request({ + url: baseUrl + '/courseOrder/add', + method: 'POST', + data: { + courseId: courseId + }, + header: { + Authorization :wx.getStorageSync('token'), + }, + success : res => { + console.log(res); + this.setData({ + orderId: res.data.data + }) + wx.navigateTo({ + url: `/pages/course/orderDetail/orderDetail?id=${this.data.orderId}`, + }) + } + }) + + }, + + // 获取课程详情 + getCourseDetail() { + const cid = this.data.courseId; + wx.request({ + url: baseUrl + '/course/detail/id', + method: 'POST', + data: { + id: cid + }, + header: { + Authorization :wx.getStorageSync('token'), + }, + success : res => { + console.log(res); + if (res.data.code === 1) { + this.setData({ + courseObj: res.data.data, + }) + } + } }) }, @@ -24,6 +68,7 @@ Page({ this.setData({ courseId: options.id, }) + this.getCourseDetail() }, /** diff --git a/pages/course/createCourseOrder/createCourseOrder.wxml b/pages/course/createCourseOrder/createCourseOrder.wxml index ff1fdd3..ab57440 100644 --- a/pages/course/createCourseOrder/createCourseOrder.wxml +++ b/pages/course/createCourseOrder/createCourseOrder.wxml @@ -4,14 +4,14 @@ - 区块链和加密数字货币(随报随学认证班)(随报随学认证班) + {{ courseObj.name }} - ¥999 + ¥{{ courseObj.originPrice }} - ¥999 + ¥{{ courseObj.discountPrice }} @@ -19,7 +19,7 @@ 商品价格 - ¥999 + ¥{{ courseObj.discountPrice }} @@ -37,8 +37,8 @@ - 应付¥999 - + 应付¥{{ courseObj.discountPrice }} + 立即支付 diff --git a/pages/course/homepage/homepage.js b/pages/course/homepage/homepage.js index c643891..8dc87b6 100644 --- a/pages/course/homepage/homepage.js +++ b/pages/course/homepage/homepage.js @@ -6,7 +6,14 @@ Page({ data: { // 初始时置空,待接口返回后再渲染 - courseList: [] + banners: [ + './image/banner.png', + './image/banner.png', + './image/banner.png', + './image/banner.png' + ], + courseList: [], + globalImgUrl }, // 跳转课程列表页 diff --git a/pages/course/homepage/homepage.wxml b/pages/course/homepage/homepage.wxml index 99ff8bb..68c856c 100644 --- a/pages/course/homepage/homepage.wxml +++ b/pages/course/homepage/homepage.wxml @@ -1,47 +1,35 @@ - + 搜索更多好课 - + + + + + + + - - - 考公考研 + + + 考研 - - - 自媒体 + + + 考公 - - - 财经 + + + 考证 热门课程 - + diff --git a/pages/course/homepage/homepage.wxss b/pages/course/homepage/homepage.wxss index 8bdec29..b3ac159 100644 --- a/pages/course/homepage/homepage.wxss +++ b/pages/course/homepage/homepage.wxss @@ -134,4 +134,9 @@ width: 691.88rpx; height: 324.38rpx; margin-top: 22.5rpx; +} +/* 轮播图图片 */ +.swiper-image { + width: 100%; + height: 100%; } \ No newline at end of file diff --git a/pages/course/homepage/image/banner.png b/pages/course/homepage/image/banner.png new file mode 100644 index 0000000..627bfc8 Binary files /dev/null and b/pages/course/homepage/image/banner.png differ diff --git a/pages/course/orderDetail/orderDetail.js b/pages/course/orderDetail/orderDetail.js new file mode 100644 index 0000000..31b46ce --- /dev/null +++ b/pages/course/orderDetail/orderDetail.js @@ -0,0 +1,139 @@ +import { baseUrl, globalImgUrl } from "../../../request"; + +Page({ + data: { + countdown: '', + orderId: 0, + orderObj: {}, // 订单详情对象 + _secondsRemaining: 0, // 内部倒计时秒数 + _hasShownTimeout: false, // 是否已弹过“超时未支付”弹窗 + globalImgUrl, + }, + + onLoad(options) { + console.log('options---->',options); + this.setData({ orderId: options.id }); + this.getOrderDetail(); + }, + + onUnload() { + clearInterval(this._timer); + }, + + // 拉取订单详情并初始化倒计时 + getOrderDetail() { + wx.request({ + url: baseUrl + '/courseOrder/query/detail', + method: 'POST', + data: { id: this.data.orderId }, + header: { Authorization: wx.getStorageSync('token') }, + success: res => { + console.log('订单详情--->',res.data.data); + if (res.data.code !== 1) return wx.showToast({ title: res.data.message, icon: 'none' }); + + const order = res.data.data; + this.setData({ orderObj: order }); + + // 仅“待支付”需要倒计时 + if (order.orderStatus === '待支付') { + this._initFromCreateTime(order.createTime); + } + }, + fail: () => wx.showToast({ title: '网络错误', icon: 'none' }) + }); + }, + + // 计算剩余秒数并启动定时器 + _initFromCreateTime(createTime) { + // 将 "2025-07-13 12:38:17" → 时间戳 + const createMs = new Date(createTime.replace(/-/g, '/')).getTime(); + const now = Date.now(); + let diff = Math.floor((createMs + 30 * 60 * 1000 - now) / 1000); + + if (diff <= 0) { + // 已超时 + this._handleTimeout(); + } else { + // 未超时,初始化秒数并启动倒计时 + this.setData({ + _secondsRemaining: diff, + countdown: this._format(diff) + }); + this._startTimer(); + } + }, + + // 每秒递减 + _startTimer() { + this._timer = setInterval(() => { + let sec = this.data._secondsRemaining - 1; + if (sec <= 0) { + clearInterval(this._timer); + this._handleTimeout(); + } else { + this.setData({ + _secondsRemaining: sec, + countdown: this._format(sec) + }); + } + }, 1000); + }, + + // 超时处理:弹窗 + 改状态 + _handleTimeout() { + if (!this.data._hasShownTimeout) { + wx.showModal({ + title: '提示', + content: '订单超时未支付,已取消', + showCancel: false + }); + this.setData({ _hasShownTimeout: true }); + } + // 更新状态并隐藏倒计时 + const o = this.data.orderObj; + o.orderStatus = '交易取消'; + this.setData({ + orderObj: o, + countdown: '00分00秒' + }); + }, + + // 秒数 → "MM分SS秒" + _format(sec) { + const m = Math.floor(sec / 60); + const s = sec % 60; + const mm = m < 10 ? '0' + m : m; + const ss = s < 10 ? '0' + s : s; + return `${mm}分${ss}秒`; + }, + + // 取消订单 + cancelOrder() { + wx.showModal({ + title: '取消订单', + content: '是否要取消订单?', + success: res => { + if (res.confirm) { + wx.request({ + url: baseUrl + "/courseOrder/cancel", + method: 'POST', + data: { courseId: this.data.orderId }, + header: { Authorization: wx.getStorageSync('token') }, + success: () => this.getOrderDetail() + }); + } + } + }); + }, + + // 去支付(示例跳转) + goPay() { + // wx.navigateTo({ url: `/pages/pay/pay?orderId=${this.data.orderId}` }); + wx.showToast({ title: '支付功能稍后开放', icon: 'none' }); + }, + + // 退款(示例弹窗) + refundOrder() { + wx.showToast({ title: '退款功能稍后开放', icon: 'none' }); + } +}); diff --git a/pages/course/waitPayOrder/waitPayOrder.json b/pages/course/orderDetail/orderDetail.json similarity index 100% rename from pages/course/waitPayOrder/waitPayOrder.json rename to pages/course/orderDetail/orderDetail.json diff --git a/pages/course/orderDetail/orderDetail.wxml b/pages/course/orderDetail/orderDetail.wxml new file mode 100644 index 0000000..b672e6a --- /dev/null +++ b/pages/course/orderDetail/orderDetail.wxml @@ -0,0 +1,87 @@ + + + + + + 订单状态 + + 请在{{countdown}}内完成支付 + {{ orderObj.orderStatus }} + + + + + + + {{ orderObj.name }} + + + + ¥{{ orderObj.originPrice }} + + + + + + 订单编号: + {{ orderObj.orderNumber }} + + + 下单时间: + {{ orderObj.createTime }} + + + + + + 支付方式: + 微信支付 + + + 交易号: + + 4002506191307440406460485418 + + 交付时间: + + {{ orderObj.updateTime }} + + + + + + + 课程价格 + ¥{{ orderObj.totalAmount }} + + + 价格折扣 + -¥{{ orderObj.totalAmount - orderObj.originPrice }} + + + 订单金额 + ¥{{ orderObj.originPrice }} + + + + + + + + 取消 + + + 立即支付 + + + + + + + 退款 + + + diff --git a/pages/course/waitPayOrder/waitPayOrder.wxss b/pages/course/orderDetail/orderDetail.wxss similarity index 93% rename from pages/course/waitPayOrder/waitPayOrder.wxss rename to pages/course/orderDetail/orderDetail.wxss index ef70b2c..0dd34d5 100644 --- a/pages/course/waitPayOrder/waitPayOrder.wxss +++ b/pages/course/orderDetail/orderDetail.wxss @@ -173,7 +173,7 @@ line-height: 24.41rpx; } .text_14 { - margin-right: 15rpx; + /* margin-right: 15rpx; */ } .group_9 { padding: 22.5rpx 0 18.75rpx; @@ -206,3 +206,12 @@ color: #ffffff; line-height: 27.81rpx; } +.bottom-buttons { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + display: flex; + justify-content: space-between; + background-color: #ffffff; /* 可以根据需要设置背景色 */ +} diff --git a/pages/course/waitPayOrder/waitPayOrder.js b/pages/course/waitPayOrder/waitPayOrder.js index 823d878..773ea94 100644 --- a/pages/course/waitPayOrder/waitPayOrder.js +++ b/pages/course/waitPayOrder/waitPayOrder.js @@ -1,38 +1,66 @@ +// pages/course/waitPayOrder/waitPayOrder.js Page({ - data: { - // 初始倒计时字符串 - countdown: '30分00秒' - }, - - onLoad(options) { - // 启动倒计时(总秒数 = 29*60 + 17) - this.initCountdown(30 * 60 ); - }, - /** - * 初始化倒计时 - * @param {number} totalSeconds 初始总秒数 + * 页面的初始数据 */ - initCountdown(totalSeconds) { - this.countdownTimer = setInterval(() => { - if (totalSeconds <= 0) { - clearInterval(this.countdownTimer); - this.setData({ countdown: '00分00秒' }); - return; - } - totalSeconds--; - const m = Math.floor(totalSeconds / 60); - const s = totalSeconds % 60; - const mm = m < 10 ? '0' + m : '' + m; - const ss = s < 10 ? '0' + s : '' + s; - this.setData({ countdown: `${mm}分${ss}秒` }); - }, 1000); + data: { + }, - onUnload() { - // 页面卸载时清除定时器 - clearInterval(this.countdownTimer); - } + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { -}); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/course/waitPayOrder/waitPayOrder.wxml b/pages/course/waitPayOrder/waitPayOrder.wxml index a771208..fe75013 100644 --- a/pages/course/waitPayOrder/waitPayOrder.wxml +++ b/pages/course/waitPayOrder/waitPayOrder.wxml @@ -1,79 +1,2 @@ - - - - - - 订单状态 - - 请在{{countdown}}内完成支付 - 待支付 - - - - - - - 区块链和加密数字货币(随报随学认证班)(随报随学认证班) - - - - ¥999.00 - - - - - - 订单编号: - 202506191307440406460485418 - - - 下单时间: - 2025-06-19 16:08:15 - - - - - - 支付方式: - 微信支付 - - - 交易号: - 4002506191307440406460485418 - - 交付时间: - - 2025-06-19 08:48:35 - - - - - - - 课程价格 - ¥1999.9 - - - 价格折扣 - -¥10 - - - 订单金额 - ¥999 - - - - - - - - 取消 - - - 立即支付 - - - + +pages/course/waitPayOrder/waitPayOrder.wxml \ No newline at end of file diff --git a/pages/dashboardModule/overviewPerformance/overviewPerformance.js b/pages/dashboardModule/overviewPerformance/overviewPerformance.js new file mode 100644 index 0000000..965fa19 --- /dev/null +++ b/pages/dashboardModule/overviewPerformance/overviewPerformance.js @@ -0,0 +1,66 @@ +// pages/dashboardModule/overviewPerformance/overviewPerformance.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/dashboardModule/overviewPerformance/overviewPerformance.json b/pages/dashboardModule/overviewPerformance/overviewPerformance.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/dashboardModule/overviewPerformance/overviewPerformance.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/dashboardModule/overviewPerformance/overviewPerformance.wxml b/pages/dashboardModule/overviewPerformance/overviewPerformance.wxml new file mode 100644 index 0000000..6907ce0 --- /dev/null +++ b/pages/dashboardModule/overviewPerformance/overviewPerformance.wxml @@ -0,0 +1,2 @@ + +pages/dashboardModule/overviewPerformance/overviewPerformance.wxml \ No newline at end of file diff --git a/pages/dashboardModule/overviewPerformance/overviewPerformance.wxss b/pages/dashboardModule/overviewPerformance/overviewPerformance.wxss new file mode 100644 index 0000000..b5fde00 --- /dev/null +++ b/pages/dashboardModule/overviewPerformance/overviewPerformance.wxss @@ -0,0 +1 @@ +/* pages/dashboardModule/overviewPerformance/overviewPerformance.wxss */ \ No newline at end of file diff --git a/pages/loginModule/employeeAccountApply/employeeAccountApply.js b/pages/loginModule/employeeAccountApply/employeeAccountApply.js new file mode 100644 index 0000000..7b764da --- /dev/null +++ b/pages/loginModule/employeeAccountApply/employeeAccountApply.js @@ -0,0 +1,211 @@ +const { baseUrl } = require('../../../request'); +const { validate } = require('../../../utils/validate'); + +Page({ + data: { + name: '', + phone: '', + code: '', // 验证码 + idcard: '', // 身份证号 + codeSent: false, + countdown: 0, // 剩余秒数 + codeButtonText: '获取验证码', + _timer: null, + isUploading: false, + resumeUploaded: false, + resumeFilePath: '', + fileCode: '', // 上传文件后端返回的码 + credential: '', // 用户申请后的唯一凭证,用于查询用户是否审核通过 + }, + + onInput(e) { + const field = e.currentTarget.dataset.field; + this.setData({ + [field]: e.detail.value + }); + }, + + // 获取验证码(仅校验手机号) + getSmsCode() { + const { phone } = this.data; + + // 1. 非空校验 + if (!validate(this.data, { phone: '请输入手机号' })) { + return; + } + // 2. 格式校验 + if (!/^1\d{10}$/.test(phone)) { + return wx.showToast({ title: '手机号格式不正确', icon: 'none' }); + } + + // 3. 发送验证码请求 + wx.request({ + url: baseUrl + '/userInfo/code/pwd', + method: 'POST', + data: { templateString: phone }, + success: (res) => { + console.log('验证码发送--->',res.data); + if (res.data.code === 1) { + wx.showToast({ title: '验证码已发送', icon: 'none' }); + this._startCountdown(60); + } else { + wx.showToast({ title: res.data.message, icon: 'none' }); + } + }, + fail: () => { + wx.showToast({ title: '发送失败,请重试', icon: 'none' }); + } + }); + }, + + // 开始倒计时 + _startCountdown(seconds) { + this.setData({ + countdown: seconds, + codeButtonText: `${seconds}s后重试` + }); + // 如果已有定时器,不重复创建 + if (this.data._timer) return; + this.data._timer = setInterval(() => { + const cd = this.data.countdown - 1; + if (cd <= 0) { + this._clearTimer(); + this.setData({ + countdown: 0, + codeButtonText: '获取验证码' + }); + } else { + this.setData({ + countdown: cd, + codeButtonText: `${cd}s后重试` + }); + } + }, 1000); + }, + + // 清除倒计时定时器 + _clearTimer() { + if (this.data._timer) { + clearInterval(this.data._timer); + this.data._timer = null; + } + }, + + // 选择并上传简历 + chooseResume() { + if (this.data.resumeUploaded) return; + wx.chooseMessageFile({ + count: 1, + type: 'file', + success: res => { + const file = res.tempFiles[0]; + this.uploadResume(file); + } + }); + }, + + // 上传简历 + uploadResume(file) { + this.setData({ isUploading: true }); + wx.uploadFile({ + url: baseUrl + '/file/upload', + method: 'POST', + name: 'file', + header : { + Authorization: wx.getStorageSync('token'), + }, + formData: { + biz: 'default', // 传 biz 文本字段 + }, + filePath: file.path, + success: res => { + console.log('简历上传后端返回--->',JSON.parse(res.data)); + const data = JSON.parse(res.data); + console.log('后端返回文件码--->',data.data); + if (data.code === 1) { + wx.showToast({ title: '上传成功', icon: 'success' }); + this.setData({ + isUploading: false, + resumeUploaded: true, + resumeFilePath: file.path, + fileCode: data.data + }); + } else { + wx.showToast({ title: data.message || '上传失败', icon: 'none' }); + this.setData({ isUploading: false }); + } + }, + fail: () => { + wx.showToast({ title: '上传失败,请重试', icon: 'none' }); + this.setData({ isUploading: false }); + } + }); + }, + + // 提交表单 + handleSubmit() { + const { name, phone, code, idcard, fileCode } = this.data; + + // 校验用户是否填写所有必要信息 + if (!name || !phone || !code || !idcard || !fileCode) { + wx.showToast({ title: '请填写所有信息', icon: 'none' }); + return; + } + + // 姓名只能中文或英文 + if (!/^[\u4e00-\u9fa5A-Za-z]+$/.test(name)) { + wx.showToast({ title: '姓名只能为中英文', icon: 'none' }); + return; + } + + // 提交表单数据到后端 + wx.request({ + url: baseUrl + '/advancementApply/add', + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + data: { + name: name, + phone: phone, + verificationCode: code, + idCard: idcard, + resume: fileCode + }, + success: res => { + console.log('后端返回的申请---->', res); + if (res.data.code === 1) { + wx.showToast({ title: '验证通过,提交成功', icon: 'success' }); + + // 清空表单内容 + this.setData({ + name: '', + phone: '', + code: '', + idcard: '', + fileCode: '', + resumeUploaded: false, // 重置简历上传状态 + resumeFilePath: '', // 清空简历文件路径 + credential: '' // 清空凭证 + }); + } else { + wx.showToast({ title: '系统错误', icon: 'error' }); + } + } + }); + }, + + // 跳转申请须知 + gotoNotice() { + wx.navigateTo({ + url: '/pages/loginModule/employeeAccountNotice/employeeAccountNotice', + }) + }, + + // 跳转我的申请记录 + gotoQuery() { + wx.navigateTo({ + url: '/pages/loginModule/employeeApplyQuery/employeeApplyQuery', + }) + }, +}); diff --git a/pages/loginModule/employeeAccountApply/employeeAccountApply.json b/pages/loginModule/employeeAccountApply/employeeAccountApply.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/loginModule/employeeAccountApply/employeeAccountApply.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/loginModule/employeeAccountApply/employeeAccountApply.wxml b/pages/loginModule/employeeAccountApply/employeeAccountApply.wxml new file mode 100644 index 0000000..10c7a21 --- /dev/null +++ b/pages/loginModule/employeeAccountApply/employeeAccountApply.wxml @@ -0,0 +1,103 @@ + + + + 上传中... + + + + 欢迎登陆—青橙校园 + + + + 员工账号申请 + + + 员工账号申请须知 + + + + + + + + + + + + + + + + + {{ codeButtonText }} + + + + + + + + + + + + {{ resumeUploaded ? '简历上传成功!' : '点击上传简历' }} + + + + + 提交申请 + + + + + + 我的申请记录 + + + diff --git a/pages/loginModule/employeeAccountApply/employeeAccountApply.wxss b/pages/loginModule/employeeAccountApply/employeeAccountApply.wxss new file mode 100644 index 0000000..bd6ec45 --- /dev/null +++ b/pages/loginModule/employeeAccountApply/employeeAccountApply.wxss @@ -0,0 +1,203 @@ +/* pages/loginModule/employeeAccountApply/employeeAccountApply.wxss */ +.mt-15 { + margin-top: 28.13rpx; +} +.mt-21 { + margin-top: 39.38rpx; +} +.page { + padding: 67.5rpx 49.69rpx 84.38rpx 51.56rpx; + background-color: #ffffff; + width: 100%; + overflow-y: auto; + overflow-x: hidden; + height: 100%; +} +.image { + width: 232.5rpx; + height: 232.5rpx; +} +.text { + margin-top: 35.14rpx; + color: #1c2023; + font-size: 37.5rpx; + font-family: AlibabaPuHuiTi; + line-height: 35.21rpx; +} +.group { + margin-top: 62.77rpx; +} +.group_1 { + padding-left: 2.77rpx; +} +.font { + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 27.79rpx; + color: #b3b3b3; +} +.text_2 { + color: #1c2023; + line-height: 28.01rpx; +} +.group_2 { + width: 236.4rpx; +} +.image_2 { + width: 30rpx; + height: 30rpx; +} +.image_3 { + margin-left: 206.4rpx; +} +.font_2 { + font-size: 26.25rpx; + font-family: SourceHanSansCN; + line-height: 24.3rpx; + color: #ff8d1a; +} +.text_3 { + margin-left: -236.4rpx; +} +.section { + padding: 20.63rpx 0 18.75rpx; + background-color: #ffffff; + border-radius: 9.38rpx; + box-shadow: 0rpx 3.75rpx 11.25rpx #00000040; +} +.text-wrapper { + margin-left: 16.88rpx; + margin-right: 16.88rpx; +} +.view { + padding: 15.92rpx 0 12.67rpx; + background-color: #ffffff00; +} +.section_1 { + padding: 20.16rpx 0 19.22rpx; + background-color: #ffffff; + border-radius: 9.38rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.text-wrapper_1 { + padding: 12.64rpx 0 15.92rpx; + background-color: #ffffff00; +} +.section_3 { + padding: 19.69rpx 16.88rpx; + background-color: #ffffff; + border-radius: 9.38rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.text-wrapper_2 { + flex: 1 1 0; +} +.view_3 { + padding: 16.73rpx 0 11.74rpx; + background-color: #ffffff00; + height: 56.25rpx; +} +.text-wrapper_3 { + margin-right: 15rpx; + /* padding: 13.16rpx 0 10.93rpx; */ + background-color: #ff8d1a; + border-radius: 9.38rpx; + width: 157.5rpx; + height: 45rpx; +} +.text_8 { + color: #ffffff; + font-size: 22.5rpx; + font-family: AlibabaPuHuiTi; + line-height: 15.91rpx; +} +.section_2 { + padding: 19.69rpx 0; + background-color: #ffffff; + border-radius: 9.38rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.text-wrapper_4 { + margin-left: 16.88rpx; +} +.view_4 { + padding: 16.86rpx 0 11.46rpx; + background-color: #ffffff00; + width: 510.63rpx; +} +.section_4 { + padding: 30.81rpx 0 38.16rpx; + background-color: #ff8d1a1a; + border-radius: 9.38rpx; + border: dotted 1.88rpx #ff8d1a; +} +.image_4 { + width: 127.5rpx; + height: 127.5rpx; +} +.text_10 { + color: #000000; + line-height: 24.23rpx; +} +.text-wrapper_5 { + padding: 36.43rpx 0 33.58rpx; + background-color: #ff8d1a; + border-radius: 9.38rpx; +} +.text_11 { + color: #ffffff; + font-size: 30rpx; + font-family: AlibabaPuHuiTi; + line-height: 27.49rpx; +} +.group_4 { + padding: 2.66rpx 0 3rpx; +} +.pos { + position: absolute; + left: 402.19rpx; + top: 50%; + transform: translateY(-50%); +} +.text_12 { + line-height: 24.34rpx; +} +.input { + padding: 15rpx 16.26rpx 13.13rpx 16.26rpx; +} +.input_1 { + padding: 13.13rpx 16.26rpx 15rpx 16.26rpx; +} +.input_2 { + padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx; +} +.input_3 { + padding: 16.88rpx 16.26rpx 11.25rpx 16.26rpx; +} +/* 遮罩层 */ +.mask { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + z-index: 9999; + display: flex; + justify-content: center; + align-items: center; +} + +/* 加载中文本 */ +.loading-text { + color: #ffffff; + font-size: 34rpx; + font-family: AlibabaPuHuiTi; +} + +/* 上传成功文字样式 */ +.upload-success-text { + font-size: 30rpx; + font-weight: bold; + color: #ff8d1a; +} diff --git a/pages/loginModule/employeeAccountApply/images/logo.png b/pages/loginModule/employeeAccountApply/images/logo.png new file mode 100644 index 0000000..29e99d3 Binary files /dev/null and b/pages/loginModule/employeeAccountApply/images/logo.png differ diff --git a/pages/loginModule/employeeAccountApply/images/resume.png b/pages/loginModule/employeeAccountApply/images/resume.png new file mode 100644 index 0000000..86e0b3d Binary files /dev/null and b/pages/loginModule/employeeAccountApply/images/resume.png differ diff --git a/pages/loginModule/employeeAccountApply/images/right.png b/pages/loginModule/employeeAccountApply/images/right.png new file mode 100644 index 0000000..fedc222 Binary files /dev/null and b/pages/loginModule/employeeAccountApply/images/right.png differ diff --git a/pages/loginModule/employeeAccountNotice/employeeAccountNotice.js b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.js new file mode 100644 index 0000000..9e51e18 --- /dev/null +++ b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.js @@ -0,0 +1,66 @@ +// pages/loginModule/employeeAccountNotice/employeeAccountNotice.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/loginModule/employeeAccountNotice/employeeAccountNotice.json b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxml b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxml new file mode 100644 index 0000000..78e0c3c --- /dev/null +++ b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxml @@ -0,0 +1,5 @@ + + + 员工账号申请须知 + + \ No newline at end of file diff --git a/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxss b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxss new file mode 100644 index 0000000..27e5187 --- /dev/null +++ b/pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxss @@ -0,0 +1,23 @@ +/* pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxss */ +.page { + padding: 65.08rpx 42.19rpx 145.31rpx 44.06rpx; + background-color: #ffffff; + width: 100%; + overflow-y: auto; + overflow-x: hidden; + height: 100%; +} +.text { + color: #000000; + font-size: 33.75rpx; + font-family: SourceHanSansCN; + line-height: 31.26rpx; +} +.section { + align-self: stretch; +} +.view { + background-color: #ffffff; + height: 1301.25rpx; + border: solid 1.88rpx #000000; +} \ No newline at end of file diff --git a/pages/loginModule/employeeApplyQuery/employeeApplyQuery.js b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.js new file mode 100644 index 0000000..d6773f8 --- /dev/null +++ b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.js @@ -0,0 +1,146 @@ +import { baseUrl } from "../../../request"; + +Page({ + data: { + status: '', // 审核状态: 审核中、审核通过、审核失败 + result: {} // 查询结果数据 + }, + + // 输入框事件 + onInput(e) { + this.setData({ + inputIdCard: e.detail.value // 获取身份证输入 + }); + }, + + // 查询操作 + onSearch() { + const inputIdCard = this.data.inputIdCard; + if (!inputIdCard) { + wx.showToast({ + title: '请输入身份证', + icon: 'none' + }); + return; + } + + // 查询的接口 + wx.request({ + url: baseUrl + '/advancementApply/query/credential', // 替换为你的后端查询接口 + method: 'POST', + data: { templateString: inputIdCard }, + success: (res) => { + console.log('后端返回---->',res.data); + if (res.data.code === 1) { + // 假设返回的查询结果是以下格式 + const result = res.data.data; // 获取返回的数据 + + // 更新审核状态和查询结果 + this.setData({ + status: result.reviewStatus, // 审核状态 + result: { + name: result.name, // 姓名 + phone: result.phone, // 手机号 + idCard: result.idCard, // 身份证号 + failureReason: result.rejectReason, // 失败原因 + password: result.userPassword, // 密码(如果有的话) + userRole: result.userRole, // 用户级别 + id: result.id + } + }); + } else { + wx.showToast({ + title: res.data.message, + icon: 'none' + }); + } + }, + fail: () => { + wx.showToast({ + title: '请求失败,请重试', + icon: 'none' + }); + } + }); + }, + + // 重新申请操作 + onReapply() { + wx.showToast({ + title: '重新申请中...', + icon: 'none' + }); + }, + + // 用户撤销申请 + revokeApplication() { + const { id } = this.data.result + console.log('id--->',id); + wx.showModal({ + title: '确认', + content: '是否撤销申请', + complete: (res) => { + if (res.cancel) { + + } + if (res.confirm) { + wx.request({ + url: baseUrl + '/advancementApply/modify/status', + method: 'POST', + header: { + Authorization: wx.getStorageSync('token') + }, + data: { + id: id + }, + success: res => { + console.log('后端返回11---->',res.data); + if (res.data.code === 1 ) { + this.setData({ + status: '' + }) + } else { + wx.showToast({ + title: '系统错误', + }) + } + } + }) + } + } + }) + }, + + // 用户去登录 + gotoLogin() { + wx.navigateBack({ + delta: 2 + }) + }, + + // 用户重新申请 + reapply() { + wx.navigateBack({ + delta: 1 + }) + }, + + copyPassword() { + const { password } = this.data.result + wx.setClipboardData({ + data: password, // 要复制的内容 + success(res) { + wx.showToast({ + title: '已复制到剪贴板', + icon: 'success' + }); + }, + fail() { + wx.showToast({ + title: '复制失败', + icon: 'none' + }); + } + }); + } +}); diff --git a/pages/loginModule/employeeApplyQuery/employeeApplyQuery.json b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxml b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxml new file mode 100644 index 0000000..7c52ab5 --- /dev/null +++ b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxml @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + 审核失败 + + 姓名 + {{result.name}} + 手机号 + {{result.phone}} + + + + 重新申请 + + + 原因: + {{result.failureReason}} + + + + + + + + + + + 审核通过 + + + 员工 + + + + + 姓名 + {{result.name}} + + + 手机号 + {{result.phone}} + + + + + 密码 + {{result.password}} + + 复制 + + + + 温馨提示: + 恭喜成为本公司的推广员工,请保存以上账号密码,用于登录员工端小程序。 + + + 去登录 + + + + + + + 审核中 + + 姓名 + {{result.name}} + 手机号 + {{result.phone}} + + + + 注: + 每次必须通过身份证来查看申请状态。 + + + 撤销申请 + + + + + diff --git a/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxss b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxss new file mode 100644 index 0000000..10db47a --- /dev/null +++ b/pages/loginModule/employeeApplyQuery/employeeApplyQuery.wxss @@ -0,0 +1,329 @@ +.ml-5 { + margin-left: 9.38rpx; +} +.mt-11 { + margin-top: 20.63rpx; +} +.ml-39 { + margin-left: 73.13rpx; +} +.ml-23 { + margin-left: 43.13rpx; +} +.ml-37 { + margin-left: 69.38rpx; +} +.mt-21 { + margin-top: 39.38rpx; +} +.page { + padding: 45.94rpx 38.44rpx 140.91rpx; + background-color: #fafafa; + width: 100%; + overflow-y: auto; + overflow-x: hidden; + height: 100%; +} +.section { + padding: 15.81rpx 13.93rpx 14.19rpx; + background-color: #ffffff; + border-radius: 93.75rpx; + border: solid 1.88rpx #e0e0e0; +} +.image { + width: 33.75rpx; + height: 33.75rpx; +} +.font { + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 27.84rpx; + color: #ffffff; +} +.text { + color: #919191; + line-height: 27.75rpx; +} +.section_2 { + padding: 33.75rpx 28.13rpx 35.63rpx; + background-color: #ffffff; + border-radius: 18.43rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.section_3 { + padding: 15rpx 0 13.13rpx; + background-color: #e53935; + border-radius: 18.75rpx; + width: 211.88rpx; +} +.image_2 { + width: 30rpx; + height: 30rpx; +} +.text_2 { + margin-right: 3.28rpx; + line-height: 28.16rpx; +} +.font_2 { + font-size: 26.25rpx; + font-family: SourceHanSansCN; + line-height: 24.15rpx; + color: #999999; +} +.text_3 { + margin-left: 2.81rpx; + margin-top: 39rpx; + line-height: 24.21rpx; +} +.font_3 { + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 27.84rpx; + color: #333333; +} +.text_4 { + margin-left: 4.24rpx; + margin-top: 21rpx; +} +.text_5 { + margin-left: 3.19rpx; + margin-top: 41.4rpx; +} +.font_4 { + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 24.15rpx; + color: #333333; +} +.text_6 { + margin-left: 4.52rpx; + margin-top: 24.04rpx; + line-height: 22.76rpx; +} +.group { + margin-top: 43.73rpx; +} +.section_4 { + background-color: #d32f2f; + border-radius: 9.38rpx 0rpx 0rpx 9.38rpx; + width: 13.13rpx; + height: 120rpx; +} +.text-wrapper { + margin-top: 35.63rpx; + padding: 35.57rpx 0 30.49rpx; + background-color: #e53935; + border-radius: 9.38rpx; +} +.text_9 { + line-height: 27.69rpx; +} +.section_5 { + padding: 27.81rpx 21.47rpx 24.26rpx; + background-color: #fdecea; + border-radius: 8.01rpx; +} +.pos { + position: absolute; + left: 7.5rpx; + right: 0; + top: 0; +} +.font_5 { + font-size: 26.25rpx; + font-family: AlibabaPuHuiTi; + line-height: 24.15rpx; +} +.text_7 { + color: #d32f2f; + line-height: 23.25rpx; +} +.text_8 { + color: #555555; + line-height: 24.26rpx; +} +.section_6 { + padding: 0 28.13rpx 56.25rpx; + background-color: #ffffff; + border-radius: 22.24rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.group_2 { + padding: 31.88rpx 0 54.17rpx; +} +.group_3 { + padding-left: 7.5rpx; +} +.section_7 { + padding: 11.25rpx 18.75rpx 9.38rpx; + background-color: #66bb6a; + border-radius: 18.75rpx; + height: 58.13rpx; +} +.image_3 { + width: 37.5rpx; + height: 37.5rpx; +} +.text_11 { + margin-right: 3.28rpx; + line-height: 28.16rpx; +} +.text-wrapper_2 { + padding: 11.47rpx 0 9.73rpx; + background-color: #66bb6a; + border-radius: 29.46rpx; + width: 99.38rpx; + height: 41.25rpx; +} +.text_10 { + color: #ffffff; + font-size: 22.5rpx; + font-family: SourceHanSansCN; + line-height: 20.04rpx; +} +.section_8 { + padding: 33.58rpx 27.19rpx 30.45rpx; + background-color: #f8f9fa; + border-radius: 9.38rpx; +} +.text_12 { + line-height: 24.21rpx; +} +.section_9 { + margin-top: 28.74rpx; + padding: 35.33rpx 27.56rpx 32.4rpx; + background-color: #f8f9fa; + border-radius: 9.38rpx; +} +.text_13 { + line-height: 22.76rpx; +} +.section_10 { + margin-top: 31.26rpx; + background-color: #66bb6a; + border-radius: 9.38rpx 0rpx 0rpx 9.38rpx; + width: 13.13rpx; + height: 91.88rpx; +} +.section_11 { + padding: 34.74rpx 21.62rpx 25.59rpx; + background-color: #e8f5e9; + border-radius: 9.38rpx; +} +.pos_2 { + position: absolute; + left: 5.63rpx; + right: 0; + top: 235.75rpx; +} +.text_14 { + line-height: 24.36rpx; +} +.text_15 { + line-height: 31.54rpx; +} +.text_16 { + margin-right: 7.52rpx; + color: #66bb6a; +} +.group_4 { + line-height: 31.88rpx; +} +.font_6 { + font-size: 26.25rpx; + font-family: SourceHanSansCN; + line-height: 31.88rpx; + color: #999999; +} +.text_17 { + color: #66bb6a; +} +.text-wrapper_3 { + padding: 35.66rpx 0 30.39rpx; + background-color: #66bb6a; + border-radius: 9.38rpx; +} +.text_18 { + line-height: 27.69rpx; +} +.section_12 { + padding: 33.75rpx 28.13rpx 54.38rpx; + background-color: #ffffff; + border-radius: 22.24rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.section_13 { + margin-left: 7.5rpx; + padding: 13.13rpx 0 11.25rpx; + background-color: #ff8d1a; + border-radius: 18.75rpx; + width: 183.75rpx; +} +.text_19 { + line-height: 28.16rpx; +} +.text_20 { + margin-left: 2.81rpx; + margin-top: 39rpx; + line-height: 24.21rpx; +} +.text_21 { + margin-left: 4.24rpx; + margin-top: 21rpx; +} +.text_22 { + margin-left: 3.19rpx; + margin-top: 41.4rpx; +} +.text_23 { + margin-left: 4.52rpx; + margin-top: 24.04rpx; + line-height: 22.76rpx; +} +.text_24 { + margin-left: 2.98rpx; + margin-top: 39.6rpx; + line-height: 24.43rpx; +} +.group_5 { + margin-top: 20.94rpx; +} +.section_14 { + background-color: #ff8d1a; + border-radius: 9.38rpx 0rpx 0rpx 9.38rpx; + width: 13.13rpx; + height: 91.88rpx; +} +.text-wrapper_4 { + margin-left: -7.5rpx; + padding: 38.04rpx 0 32.04rpx; + background-color: #fff4e5; + border-radius: 9.19rpx; + height: 91.88rpx; +} +.text_25 { + margin-left: 25.71rpx; + color: #ff8d1a; + font-size: 30rpx; + font-family: AlimamaShuHeiTi; + line-height: 21.79rpx; +} +.group_6 { + margin-top: 40.97rpx; +} +.group_7 { + margin-left: 2.74rpx; + margin-right: 10.33rpx; + line-height: 31.88rpx; +} +.text_26 { + color: #ff8d1a; +} +.text-wrapper_5 { + padding: 35.48rpx 0 30.41rpx; + background-color: #ff8d1a; + border-radius: 9.38rpx; +} +.text_27 { + line-height: 27.86rpx; +} \ No newline at end of file diff --git a/pages/loginModule/employeeApplyQuery/images/current.png b/pages/loginModule/employeeApplyQuery/images/current.png new file mode 100644 index 0000000..24806d2 Binary files /dev/null and b/pages/loginModule/employeeApplyQuery/images/current.png differ diff --git a/pages/loginModule/employeeApplyQuery/images/find.png b/pages/loginModule/employeeApplyQuery/images/find.png new file mode 100644 index 0000000..cce7317 Binary files /dev/null and b/pages/loginModule/employeeApplyQuery/images/find.png differ diff --git a/pages/loginModule/employeeApplyQuery/images/flase.png b/pages/loginModule/employeeApplyQuery/images/flase.png new file mode 100644 index 0000000..45ad4d7 Binary files /dev/null and b/pages/loginModule/employeeApplyQuery/images/flase.png differ diff --git a/pages/loginModule/employeeApplyQuery/images/wait.png b/pages/loginModule/employeeApplyQuery/images/wait.png new file mode 100644 index 0000000..6bc72c8 Binary files /dev/null and b/pages/loginModule/employeeApplyQuery/images/wait.png differ diff --git a/pages/loginModule/forgetPwd/forgetPwd.js b/pages/loginModule/forgetPwd/forgetPwd.js index c79b790..35e9427 100644 --- a/pages/loginModule/forgetPwd/forgetPwd.js +++ b/pages/loginModule/forgetPwd/forgetPwd.js @@ -139,7 +139,7 @@ Page({ // 点击“登录账号”回登录页 gotoLogin() { - wx.navigateTo({ url: '/pages/loginModule/pwdLogin/pwdLogin' }); + wx.navigateBack(); }, onUnload() { diff --git a/pages/loginModule/pwdLogin/images/joinus.png b/pages/loginModule/pwdLogin/images/joinus.png new file mode 100644 index 0000000..928304b Binary files /dev/null and b/pages/loginModule/pwdLogin/images/joinus.png differ diff --git a/pages/loginModule/pwdLogin/pwdLogin.js b/pages/loginModule/pwdLogin/pwdLogin.js index fa5c41c..7e9daec 100644 --- a/pages/loginModule/pwdLogin/pwdLogin.js +++ b/pages/loginModule/pwdLogin/pwdLogin.js @@ -1,6 +1,12 @@ // pages/login/login.js const { baseUrl } = require('../../../request'); const { validate } = require('../../../utils/validate'); +const roleMap = new Map([ + ['manager', '经理'], + ['supervisor', '主管'], + ['staff', '员工'], + ['user', '用户'], +]); Page({ data: { @@ -12,7 +18,15 @@ Page({ codeButtonText: '获取验证码', _timer: null, defaultType: true, // - passwordType: true + passwordType: true, + role: '', // 登录角色 + showRole: '', + }, + + onLoad(options) { + const role = options.role || '' + const showRole = roleMap.get(role) || '' + this.setData({ role, showRole }) }, // 切换到“密码登录”,只清空表单字段 @@ -69,6 +83,7 @@ Page({ method: 'POST', data: { templateString: phone }, success: (res) => { + console.log('验证码发送--->',res.data); if (res.data.code === 1) { wx.showToast({ title: '验证码已发送', icon: 'none' }); this._startCountdown(60); @@ -139,12 +154,13 @@ Page({ return; } + const { role } = this.data // 组装请求 const url = loginType === 'password' ? baseUrl + '/userInfo/mini/pwd/login' : baseUrl + '/userInfo/mini/vcd/login'; const payload = loginType === 'password' - ? { phoneNumber: phone, userPassword: credential } + ? { phoneNumber: phone, userPassword: credential, userRole: role } : { phoneNumber: phone, verificationCode: credential }; wx.request({ @@ -183,15 +199,20 @@ Page({ }); }, + // 跳转忘记密码 gotoForgetPwd() { wx.navigateTo({ url: '/pages/loginModule/forgetPwd/forgetPwd', }) }, + // 去注册 gotoRegister() { + + const { role } = this.data; + wx.navigateTo({ - url: '/pages/loginModule/register/register', + url: `/pages/loginModule/register/register?role=${ role }`, }) }, @@ -200,15 +221,25 @@ Page({ this._clearTimer(); }, + // 跳转用户协议 gotoAgreement() { wx.navigateTo({ url: '/pages/loginModule/agreement/agreement', }) }, + // 跳转隐私协议 gotoPolicy() { wx.navigateTo({ url: '/pages/loginModule/privacyPolicy/privacyPolicy', }) }, + + // 跳转职工账号页面 + joinUs() { + wx.navigateTo({ + url: '/pages/loginModule/employeeAccountApply/employeeAccountApply', + }) + }, + }); diff --git a/pages/loginModule/pwdLogin/pwdLogin.wxml b/pages/loginModule/pwdLogin/pwdLogin.wxml index dc5e12c..5c95537 100644 --- a/pages/loginModule/pwdLogin/pwdLogin.wxml +++ b/pages/loginModule/pwdLogin/pwdLogin.wxml @@ -1,88 +1,106 @@ - - 欢迎登陆—青橙校园 - + - + + + 欢迎登陆—青橙校园 + ({{ showRole }}端) + + + + 密码登录 + + 验证码登录 - - + - - - - - {{ codeButtonText }} - - 忘记密码 + + + + + + + {{ codeButtonText }} + + + + + 忘记密码 - - - - - + + + + - - 登录代表您已同意 - 《用户协议》 + + 登录代表您已同意 + 《用户协议》 & - 《隐私协议》 + 《隐私协议》 - - 没有账号? - 去注册→ + + + 没有账号? + 去注册→ + + + 加入我们 + + diff --git a/pages/loginModule/pwdLogin/pwdLogin.wxss b/pages/loginModule/pwdLogin/pwdLogin.wxss index 782ca79..0498814 100644 --- a/pages/loginModule/pwdLogin/pwdLogin.wxss +++ b/pages/loginModule/pwdLogin/pwdLogin.wxss @@ -1,43 +1,34 @@ -/* 切换按钮样式 */ -.switch { - font-size: 30rpx; /* 基础字体大小 */ - font-family: SourceHanSansCN; -} -.switch.active { - font-size: 36rpx; /* 激活时更大 */ - font-weight: bold; /* 加粗 */ - color: #1c2023; -} -.switch.inactive { - color: #888888; /* 不活跃时灰色 */ -} - -/* 其它原来样式保持不变 */ -.mt-21 { +.mt-21 { margin-top: 39.38rpx; } .page { - padding: 105rpx 45.69rpx 381.68rpx 49.76rpx; + padding: 105rpx 36.56rpx 40.31rpx 49.76rpx; background-color: #ffffff; width: 100%; - overflow: hidden; + overflow-y: auto; + overflow-x: hidden; height: 100%; } .image { width: 232.5rpx; height: 232.5rpx; } -.text { - margin-top: 35.14rpx; - color: #1c2023; - font-size: 37.5rpx; - font-family: AlibabaPuHuiTi; - line-height: 35.21rpx; -} .group { - margin-top: 145.01rpx; + margin-top: 35.14rpx; } .font { + font-size: 37.5rpx; + font-family: AlibabaPuHuiTi; + line-height: 34.73rpx; + color: #1c2023; +} +.text { + line-height: 35.21rpx; +} +.group_2 { + margin-top: 87.15rpx; +} +.font_2 { font-size: 30rpx; font-family: SourceHanSansCN; line-height: 27.69rpx; @@ -51,10 +42,11 @@ } .group_1 { padding-left: 2.74rpx; + padding-right: 2.74rpx; } .section { - margin-right: 4.93rpx; - padding: 20.63rpx 0 18.75rpx; + margin-right: 11.32rpx; + padding: 20.63rpx 16.88rpx 18.75rpx; background-color: #ffffff; border-radius: 9.38rpx; box-shadow: 0rpx 3.75rpx 11.25rpx #00000040; @@ -62,48 +54,57 @@ .text-wrapper { margin-left: 16.88rpx; margin-right: 16.88rpx; -} -.view { padding: 15.92rpx 0 12.64rpx; background-color: #ffffff00; + margin-right: 100rpx; +} +.font_3 { + font-size: 30rpx; + font-family: SourceHanSansCN; + line-height: 27.69rpx; + color: #b3b3b3; +} +.text_4 { + margin-left: 16.26rpx; } .section_2 { - margin-right: 4.93rpx; + margin-right: 11.32rpx; padding: 20.63rpx 16.88rpx 18.75rpx; background-color: #ffffff; border-radius: 9.38rpx; box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; } -.text-wrapper_2 { - flex: 1 1 0; +.text_5 { + margin-left: 16.26rpx; + line-height: 27.86rpx; } -.view_2 { - padding: 11.96rpx 0 16.43rpx; - background-color: #ffffff00; - height: 76.25rpx; +.text-wrapper_3 { + margin-right: 5.63rpx; + padding: 13.16rpx 0 10.93rpx; + background-color: #ff8d1a; + border-radius: 9.38rpx; + width: 157.5rpx; + height: 45rpx; } .text_6 { - margin-right: 14.72rpx; - color: #f7810a; - font-size: 26.25rpx; + color: #ffffff; + font-size: 22.5rpx; font-family: AlibabaPuHuiTi; - line-height: 23.94rpx; + line-height: 20.91rpx; } -.get-code { - /* 可根据需求再调样式 */ -} -.font_3 { +.font_4 { font-size: 26.25rpx; font-family: SourceHanSansCN; line-height: 24.49rpx; color: #383838; } .text_7 { + margin-right: 6.39rpx; margin-top: 28.76rpx; line-height: 24.36rpx; } -.text-wrapper_3 { - margin-right: 4.93rpx; +.text-wrapper_4 { + margin-right: 11.32rpx; margin-top: 46.26rpx; padding: 36.73rpx 0 34.16rpx; background-color: #ff8d1a; @@ -115,14 +116,21 @@ font-family: AlibabaPuHuiTi; line-height: 26.61rpx; } -.group_2 { +.group_3 { margin-top: 48.75rpx; } -.group_3 { +.image_2 { + flex-shrink: 0; +} +.image_1 { + width: 37.5rpx; + height: 37.5rpx; +} +.group_4 { line-height: 24.49rpx; height: 24.56rpx; } -.font_4 { +.font_5 { font-size: 26.25rpx; font-family: SourceHanSansCN; line-height: 24.49rpx; @@ -138,7 +146,7 @@ font-family: SourceHanSansCN; line-height: 19.93rpx; } -.group_4 { +.group_5 { margin-top: 43.91rpx; line-height: 24.41rpx; } @@ -148,16 +156,35 @@ .text_12 { line-height: 24.41rpx; } -.input { - padding: 15rpx 16.26rpx 13.13rpx 16.26rpx; +.section_3 { + margin-top: 100.11rpx; + padding: 12.06rpx 21.69rpx 12.32rpx 24.15rpx; + background-color: #ffffff; + border-radius: 9.38rpx; + width: 215.63rpx; + border: solid 1.88rpx #ff8d1a; } -.input_1 { - padding: 15rpx 16.26rpx 13.13rpx 16.26rpx; +.text_13 { + color: #ff8d1a; + line-height: 27.66rpx; } -.checkbox { - flex-shrink: 0; +.image_3 { + width: 41.25rpx; + height: 41.25rpx; +} + +/* 欢迎文本加粗 */ +.bold-text { + font-weight: bold; +} + +/* 切换按钮默认样式,保持原 font_2 大小;active 时放大加粗 */ +.toggle-text { + font-size: 28rpx; + font-weight: normal; + transition: font-size 0.2s; +} +.toggle-text.active { + font-size: 36rpx; + font-weight: bold; } -.checkbox .wx-checkbox-input { - width: 37.5rpx; - height: 37.5rpx; -} \ No newline at end of file diff --git a/pages/loginModule/register/register.js b/pages/loginModule/register/register.js index 0f26104..bc2d23a 100644 --- a/pages/loginModule/register/register.js +++ b/pages/loginModule/register/register.js @@ -5,10 +5,28 @@ import { validate } from "../../../utils/validate"; // pages/loginModule/register/register.js Page({ + data: { + role: '', // 用户角色 + placeholder: '', // 输入框显示文本 + }, + /** * 生命周期函数--监听页面加载 */ onLoad(options) { + console.log('options--->',options); + this.setData({ + role: options.role + }) + if (options.role === 'supervisor') { + this.setData({ + placeholder: '请输入学校名称' + }) + } else { + this.setData({ + placeholder : '请输入昵称' + }) + } const scene = decodeURIComponent(options.scene) let [key, value] = scene.split('='); this.setData({inviteCode: value}) @@ -136,6 +154,9 @@ Page({ title: '加载中', mask: true }) + + const { role } = this.data; + const res = await requestAsync({ url: baseUrl + '/userInfo/register', method: 'POST', @@ -145,7 +166,8 @@ Page({ phoneNumber: phone, verificationCode: captcha, invitationCode: inviteCode, - userPassword: password + userPassword: password, + userRole: role } }); console.log('注册信息---->',res.data); @@ -157,8 +179,8 @@ Page({ }); wx.hideLoading() setTimeout(() => { - wx.navigateTo({ - url: '/pages/loginModule/pwdLogin/pwdLogin', + wx.navigateBack()({ + // url: '/pages/loginModule/pwdLogin/pwdLogin', success: () => { this.setData({ nickname:'', phone:'', captcha:'', inviteCode:'', password:'', agree:false }); } diff --git a/pages/loginModule/register/register.wxml b/pages/loginModule/register/register.wxml index ee9b6b1..8d63706 100644 --- a/pages/loginModule/register/register.wxml +++ b/pages/loginModule/register/register.wxml @@ -11,8 +11,8 @@ diff --git a/pages/personCenter/accountSetting/accountSetting.js b/pages/personCenter/accountSetting/accountSetting.js index f2b2a08..7d8262f 100644 --- a/pages/personCenter/accountSetting/accountSetting.js +++ b/pages/personCenter/accountSetting/accountSetting.js @@ -33,7 +33,7 @@ Page({ }) setTimeout(() => { wx.reLaunch({ - url: '/pages/loginModule/pwdLogin/pwdLogin', + url: '/pages/welcome/homePage/homePage', }) }, 1000); // 1000ms = 1秒 } else { diff --git a/pages/personCenter/mine/mine.js b/pages/personCenter/mine/mine.js index 735bc3a..83e4c34 100644 --- a/pages/personCenter/mine/mine.js +++ b/pages/personCenter/mine/mine.js @@ -8,18 +8,15 @@ Page({ * 页面的初始数据 */ data: { - items: [null], + items: [null,null,null], nickName: "", userAvatar: "", phoneNumber: "", userAccount: "", invitationCode: "", - currentBalance: "", // 当前余额 - withdrawalingBalance: 0, // 提现中的余额 - withdrawaledAmount: "", // 已提现的余额 - totalIncome:"", // 累计收入 showPopup: false, // 控制弹窗显示与否 qrcode: "https://img.picui.cn/free/2025/05/29/6837c53582068.gif", // 设置二维码图片的路径 + userRole: "", }, // 跳转课程订单页面 @@ -114,11 +111,7 @@ Page({ if (res.data.code === 1) { let result = res.data.data this.setData({ - currentBalance: result.currentBalance, // 当前余额 - withdrawalingBalance: result.withdrawalAmount, // 提现中的余额 - withdrawaledAmount: result.withdrawnAmount, // 已提现的余额 - totalIncome: result.totalIncome, // 累计收入 - qrcode: globalImgUrl + result.inviteQrCode + // qrcode: globalImgUrl + result.inviteQrCode }) } else { wx.showToast({ @@ -140,6 +133,7 @@ Page({ Authorization: token }, success: res => { + console.log('用户信息---->',res.data); if (res.data.code === 1) { this.setData({ nickName: res.data.data.nickName, @@ -147,7 +141,8 @@ Page({ userAvatar: res.data.data.userAvatar, phoneNumber: res.data.data.phoneNumber, userAccount: res.data.data.userAccount, - invitationCode: res.data.data.invitationCode + invitationCode: res.data.data.invitationCode, + userRole: res.data.data.userRole, }) } } diff --git a/pages/personCenter/mine/mine.wxml b/pages/personCenter/mine/mine.wxml index cf18308..225a32c 100644 --- a/pages/personCenter/mine/mine.wxml +++ b/pages/personCenter/mine/mine.wxml @@ -1,4 +1,4 @@ - + - - --> + - + --> + + + + + + + {{ nickName }} + + + {{ phoneNumber }} + + + + 邀请码:{{ invitationCode }} + + + + + + 二维码邀请 + + + + + + + 查看绩效 + + + + 主管排名 + + + + 员工排名 + + + + + + + 我的订单 + + + + + + + 仪表盘 + + + + + + + 账号设置 + + + + + diff --git a/pages/personCenter/mine/mine.wxss b/pages/personCenter/mine/mine.wxss index 7cd622a..6a5cc9f 100644 --- a/pages/personCenter/mine/mine.wxss +++ b/pages/personCenter/mine/mine.wxss @@ -4,9 +4,6 @@ .mt-9 { margin-top: 16.88rpx; } -.mt-15 { - margin-top: 28.13rpx; -} .mt-11 { margin-top: 20.63rpx; } @@ -14,26 +11,26 @@ margin-left: 9.38rpx; } .page { - padding: 65.63rpx 28.13rpx 331.88rpx; + padding: 65.63rpx 28.13rpx 780rpx; background-image: linear-gradient(180deg, #ff8d1a -7.3%, #ffffff00 92.1%); width: 100%; - overflow: hidden; + overflow-y: auto; + overflow-x: hidden; height: 100%; } .section { - padding-left: 31.88rpx; - padding-right: 31.74rpx; + padding: 15rpx 13.13rpx 26.25rpx; background-color: #ffffff; - border-radius: 18.75rpx; + border-radius: 8.33rpx; } -.group { - padding: 45.9rpx 30.73rpx 33.75rpx 153.75rpx; - border-bottom: solid 1.88rpx #ededed; +.image { + width: 161.25rpx; + height: 161.25rpx; } .font { font-size: 26.25rpx; font-family: SourceHanSansCN; - line-height: 24.39rpx; + line-height: 24.34rpx; color: #000000; } .text { @@ -49,246 +46,104 @@ .font_2 { font-size: 22.5rpx; font-family: SourceHanSansCN; - line-height: 19.93rpx; - color: #000000; + line-height: 20.68rpx; + color: #ff8d1a; } .text_2 { color: #808080; line-height: 17.08rpx; } .section_2 { - padding: 10.5rpx 14.03rpx 10.5rpx 14.03rpx; + padding: 7.5rpx 13.13rpx 5.63rpx 14.03rpx; background-color: #fff6de; border-radius: 31.26rpx; } .image_4 { + margin-left: 169.72rpx; width: 24.38rpx; height: 24.38rpx; - margin-left: 10rpx; -} -.font_3 { - font-size: 22.5rpx; - font-family: SourceHanSansCN; - line-height: 19.93rpx; - color: #ff8d1a; } .text_3 { - line-height: 20.68rpx; + margin-left: -194.1rpx; + margin-right: 21.6rpx; +} +.group { + margin-top: 33.75rpx; + width: 163.72rpx; } .image_2 { + margin-left: 17.48rpx; width: 76.88rpx; height: 76.88rpx; } .text_4 { line-height: 20.72rpx; } -.group_3 { - padding-bottom: 28.13rpx; -} -.group_4 { - padding: 29.06rpx 0 32.81rpx 2.59rpx; -} -.group_5 { - line-height: 25.78rpx; - height: 27.21rpx; -} -.text_6 { - line-height: 21rpx; -} -.text_5 { - color: #ff8d1a; - font-size: 33.75rpx; - font-family: SourceHanSansCN; - line-height: 25.78rpx; -} -.section_3 { - padding: 6.43rpx 10.44rpx 6.69rpx 20.77rpx; - background-color: #ffffff; - border-radius: 37.5rpx; - width: 151.88rpx; - height: 46.88rpx; - border: solid 1.88rpx #ff8d1a; -} -.image_5 { - width: 30rpx; - height: 30rpx; -} -.image_6 { - margin-left: 86.91rpx; -} -.text_7 { - margin-left: -116.91rpx; - line-height: 20.91rpx; -} .equal-division { position: relative; } -.equal-division:first-child { - margin-top: 0; +.section_3 { + padding: 6.88rpx 0 13.59rpx; + background-color: #ffffff; + border-radius: 18.75rpx; } -.section_4 { - padding: 15.96rpx 0 17.32rpx; - background-color: #f7f7f7; - border-radius: 9.38rpx; +.equal-division-item_1 { + margin-left: 8.06rpx; } -.text_8 { - line-height: 20.77rpx; +.group_3 { + padding: 11.76rpx 0 10.01rpx; + width: 224.59rpx; } -.font_4 { - font-size: 26.25rpx; - font-family: SourceHanSansCN; - line-height: 19.93rpx; - color: #000000; +.image_5 { + width: 63.99rpx; + height: 63.99rpx; } -.group_6 { +.text_5 { + line-height: 24.26rpx; +} +.equal-division-item_2 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } .equal-division-item { - padding: 10.01rpx 0 9.99rpx; - width: 208.74rpx; + padding: 11.76rpx 0 10.09rpx; + width: 224.59rpx; } -.text_9 { - line-height: 20.74rpx; -} -.group_7 { - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); -} -.equal-division-item_8 { - padding: 9.99rpx 0 9.99rpx; - width: 208.74rpx; -} -.text_10 { - line-height: 20.72rpx; -} -.image { - width: 131.25rpx; - height: 131.25rpx; -} -.pos { - position: absolute; - left: 30.13rpx; - top: 32rpx; - border-radius: 20rpx; -} -.equal-division_2 { - position: relative; - margin-top: 24.38rpx; -} -.section_5 { - padding: 6.88rpx 0 13.52rpx; - background-color: #ffffff; - border-radius: 18.75rpx; -} -.equal-division-item_1 { - margin-left: 8.85rpx; -} -.equal-division-item_2 { - padding: 11.76rpx 0 10.01rpx; - width: 224.06rpx; -} -.image_7 { - width: 63.99rpx; - height: 63.99rpx; -} -.text_11 { - line-height: 24.56rpx; -} -.group_1 { - padding: 11.76rpx 0 10.03rpx; - width: 224.06rpx; -} -.text_12 { - line-height: 24.43rpx; -} -.group_9 { - position: absolute; - right: 10.84rpx; - top: 50%; - transform: translateY(-50%); -} -.group_10 { - padding: 11.76rpx 0 10.11rpx; - width: 224.06rpx; -} -.text_13 { - line-height: 24.21rpx; -} -.list { - padding: 28.13rpx 0 33.75rpx; -} -.equal-division_3 { - padding: 12.51rpx 10.14rpx 17.23rpx; - background-color: #ffffff; - border-radius: 18.75rpx; -} -.image_8 { - border-radius: 9.38rpx; - width: 63.99rpx; - height: 63.99rpx; -} -.text_14 { - line-height: 24.34rpx; -} -.equal-division-item_6 { - padding: 11.76rpx 0 10.18rpx; - width: 167.4rpx; -} -.text_15 { - line-height: 24.3rpx; -} -.group_11 { - position: absolute; - right: 179.53rpx; - top: 50%; - transform: translateY(-50%); +.text_6 { + line-height: 24.28rpx; } .equal-division-item_3 { - padding: 11.76rpx 0 10.14rpx; - width: 167.4rpx; -} -.text_16 { - line-height: 24.23rpx; -} -.group_12 { position: absolute; - right: 12.13rpx; + right: 10.03rpx; top: 50%; transform: translateY(-50%); } -.equal-division-item_7 { +.group_5 { padding: 11.76rpx 0 9.99rpx; - width: 167.4rpx; + width: 224.59rpx; } -.list_2 { +.list { + padding-top: 39.38rpx; +} +.section_4 { + padding: 31.88rpx 31.88rpx 30rpx 33.75rpx; background-color: #ffffff; - border-radius: 17.72rpx; + border-radius: 9.47rpx; } -.group_13 { - padding: 30rpx 30rpx 28.13rpx 35.63rpx; -} -.image_9 { +.image_6 { border-radius: 9.38rpx; width: 41.25rpx; height: 41.25rpx; } -.text_17 { +.image_7 { + width: 30rpx; + height: 30rpx; +} +.text_7 { + line-height: 24.47rpx; +} +.text_8 { line-height: 23.81rpx; -} -.list-divider { - margin-right: 39.43rpx; - background-color: #d4d4d4; - width: 566.17rpx; - height: 1.88rpx; -} -.group_14 { - padding: 22.5rpx 30rpx 28.13rpx 35.63rpx; -} -.text_18 { - line-height: 24.6rpx; } \ No newline at end of file diff --git a/pages/welcome/homePage/homePage.js b/pages/welcome/homePage/homePage.js new file mode 100644 index 0000000..1f515de --- /dev/null +++ b/pages/welcome/homePage/homePage.js @@ -0,0 +1,74 @@ +// pages/welcome/homePage/homePage.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + // 跳转用户登录 + userLogin(e) { + const role = e.currentTarget.dataset.role; + wx.navigateTo({ + url: `/pages/loginModule/pwdLogin/pwdLogin?role=${role}`, + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/welcome/homePage/homePage.json b/pages/welcome/homePage/homePage.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/welcome/homePage/homePage.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/welcome/homePage/homePage.wxml b/pages/welcome/homePage/homePage.wxml new file mode 100644 index 0000000..004f5fc --- /dev/null +++ b/pages/welcome/homePage/homePage.wxml @@ -0,0 +1,18 @@ + + + + + 欢迎进入青橙校园 + + + 我是用户 + 我是主管 + + 我是员工 + + + + \ No newline at end of file diff --git a/pages/welcome/homePage/homePage.wxss b/pages/welcome/homePage/homePage.wxss new file mode 100644 index 0000000..1500e62 --- /dev/null +++ b/pages/welcome/homePage/homePage.wxss @@ -0,0 +1,57 @@ +.mt-9 { + margin-top: 16.88rpx; +} +.page { + padding: 255rpx 0 566.25rpx; + background-image: linear-gradient(180deg, #ffeed9 0%, #f5f5f500 125%); + width: 100%; + overflow-y: auto; + overflow-x: hidden; + height: 100%; +} +.section { + padding: 39.38rpx 52.5rpx 18.75rpx; + background-color: #ffffff; + border-radius: 35.16rpx; + box-shadow: 0rpx 3.75rpx 7.5rpx #00000040; +} +.image { + width: 232.5rpx; + height: 232.5rpx; +} +.text { + color: #1c2023; + font-size: 45rpx; + font-family: AlibabaPuHuiTi; + line-height: 41.53rpx; +} +.text-wrapper { + padding: 37.5rpx 0 30rpx; + background-color: #ff8d1a; + border-radius: 18.75rpx; + width: 498.75rpx; +} +.font { + font-size: 33.75rpx; + font-family: SourceHanSansCN; + line-height: 32.06rpx; + font-weight: 700; + color: #ff8d1a; +} +.text_2 { + color: #ffffff; + line-height: 32.14rpx; +} +.text-wrapper_2 { + padding: 37.5rpx 0 30rpx; + background-color: #ffffff; + border-radius: 18.75rpx; + width: 500.63rpx; + border-left: solid 1.88rpx #ff8d1a; + border-right: solid 1.88rpx #ff8d1a; + border-top: solid 1.88rpx #ff8d1a; + border-bottom: solid 1.88rpx #ff8d1a; +} +.text_3 { + line-height: 31.8rpx; +} \ No newline at end of file diff --git a/pages/welcome/homePage/images/logo.png b/pages/welcome/homePage/images/logo.png new file mode 100644 index 0000000..1edef77 Binary files /dev/null and b/pages/welcome/homePage/images/logo.png differ diff --git a/request.js b/request.js index e117e91..019e7e3 100644 --- a/request.js +++ b/request.js @@ -1,7 +1,7 @@ export const local='http://localhost:9091'; -export const ip = 'http://27.30.77.229:9091'; -export const test = 'http://27.30.77.229:9092'; +export const dev = 'http://160.202.242.36:9091'; +export const test = 'http://160.202.242.36:9092'; export const localTest = 'http://localhost:9092'; -export const baseUrl = test; +export const baseUrl = dev; export const globalImgUrl = baseUrl + '/file/download/' \ No newline at end of file