小程序提交

This commit is contained in:
2025-07-20 18:22:59 +08:00
parent a1d21c67b8
commit fa2a7b3499
61 changed files with 2505 additions and 944 deletions

View File

@ -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",

View File

@ -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;

View File

@ -1,79 +1,36 @@
<view class="flex-col page">
<view class="flex-col">
<!-- 背景图 -->
<view class="flex-col section">
<image class="background-image" src="https://img.picui.cn/free/2025/06/26/685cc80000461.png" />
</view>
<!-- 选项卡 -->
<view class="flex-col section_3">
<view class="flex-row justify-center group_2">
<text bindtap="selectTab" data-tab="intro" class="text-tab {{activeTab==='intro'?'tab-active':'tab-inactive'}}">课程简介</text>
<text bindtap="selectTab" data-tab="catalog" class="text-tab {{activeTab==='catalog'?'tab-active':'tab-inactive'}}">课程目录</text>
</view>
</view>
<!-- 标题+价格 -->
<view class="flex-col section_4">
<view class="flex-row items-center group_4">
<view class="shrink-0 group_5">
<text class="text_6">{{ courseObj.originPrice }}</text>
<text class="font_3 text_7">元券后价</text>
</view>
<view class="ml-4 flex-col justify-start items-start shrink-0 relative group_6">
<text class="font_2 text text_8">{{ courseObj.discountPrice }}元</text>
<view class="divider pos"></view>
</view>
</view>
<text class="group_4 text_9 mt-9">{{ courseObj.name }}</text>
</view>
<!-- 课程概述(仅当 activeTab==='intro' -->
<view wx:if="{{activeTab==='intro'}}" class="flex-col section_5">
<view class="flex-row items-center group_7">
<image class="image" src="./image/cal.png" />
<text class="ml-6 font_2 text_10">课程概述</text>
</view>
<rich-text class="section_6" nodes="{{richText}}"></rich-text>
</view>
<!-- 课程目录(仅当 activeTab==='catalog' -->
<view wx:if="{{activeTab==='catalog'}}" class="flex-col mt-35">
<view class="flex-col section_7">
<view class="flex-col list">
<view class="flex-col list-item mt-15" wx:for="{{chapterList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<!-- <view class="flex-col justify-start self-end text-wrapper_2">
<text class="font_4 text_11">全集试看</text>
</view> -->
<view class="flex-row self-start group_8 mt-1">
<text class="shrink-0 self-start font_5 text_12">{{ index + 1}}</text>
<text class="ml-16 flex-1 font_2 {{activeIndex === index ? 'active-title' : ''}}" bindtap="selectCourse" data-index="{{index}}">
{{ item.name }}
</text>
</view>
<view class="flex-row justify-between self-stretch group_9 mt-1">
<!-- <text class="self-start font_6 text_13" style="margin-top: 10rpx;">视频课·27分59秒</text> -->
<!-- <image class="image_2" src="./image/lock.png" /> -->
</view>
<view class="flex-col">
<image class="image" src="{{ globalImgUrl + courseObj.image }}" />
<view class="flex-col section">
<view class="flex-row items-center group">
<view class="shrink-0 group_2">
<text class="text">{{ courseObj.discountPrice }}</text>
<text class="font text_2">元券后价</text>
</view>
<view class="ml-4 flex-col justify-start items-start shrink-0 relative group_3">
<text class="font text_3">{{ courseObj.originPrice }}元</text>
<view class="divider pos"></view>
</view>
</view>
<text class="group text_4 mt-9">{{ courseObj.name }}</text>
</view>
</view>
<view class="mt-26 flex-col section_2">
<view class="flex-row items-center group_4">
<image class="image_2" src="./image/cal.png" />
<text class="ml-6 font text_5">课程概述</text>
</view>
<rich-text class="section_3" nodes="{{ richText }}"></rich-text>
</view>
</view>
<!-- 底部固定按钮栏 -->
<view class="flex-row items-center section_8 section_8_fixed">
<view class="flex-col items-center shrink-0" style="margin-left: 30rpx;">
<view class="flex-row justify-between items-center section_4 mt-37">
<view class="flex-col items-center">
<image class="image_3" src="./image/messge.png" />
<text class="font_6 text_16 mt-1">咨询</text>
<text class="text_7 mt-1">咨询</text>
</view>
<view class="ml-44 flex-row flex-1">
<view class="flex-col justify-start items-center text-wrapper_3" bind:tap="gotoApplyPromotion" data-id="{{ '1' }}">
<text class="font_7 text_14">申请推广</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_4 ml-15" bind:tap="gotoCourseOrder" data-id="{{ '1' }}">
<text class="font_7 text_15">立即购买</text>
</view>
<view class="flex-col justify-start items-center text-wrapper" bind:tap="gotoCourseOrder" data-id="{{ courseObj.id }}">
<text class="text_6">立即购买</text>
</view>
</view>
</view>
</view>

View File

@ -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;
}

View File

@ -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: '网络请求失败',
});
}
});
},
/**

View File

@ -1,35 +1,39 @@
<!--pages/course/courseList/courseList.wxml-->
<view class="flex-col page">
<text class="self-center text">{{ courseType }}</text>
<image
class="shrink-0 self-start image image_2"
src="./image/line.png"
/>
<image
class="shrink-0 self-end image image_3"
src="./image/line.png"
/>
<image class="shrink-0 self-start image image_2" src="./image/line.png" />
<image class="shrink-0 self-end image image_3" src="./image/line.png" />
<view class="flex-col self-stretch list">
<!-- 遍历接口返回的 items 数组 -->
<view
class="flex-col justify-start list-item"
wx:for="{{items}}"
class="flex-col list-item"
wx:for="{{courseList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="index"
wx:key="id"
>
<view class="flex-row items-center relative group" bind:tap="gotoCourseDetail" data-id="{{ '1' }}">
<view
class="flex-row items-center relative group"
bindtap="gotoCourseDetail"
data-id="{{item.id}}"
>
<!-- 课程封面 -->
<image
class="shrink-0 image_4"
src="https://ide.code.fun/api/image?token=6858ee4b4ae84d0012334127&name=9c2a22f14e2bd768cbd40d939693e4a8.png"
src="{{ globalImgUrl + item.image}}"
mode="aspectFill"
/>
<view class="flex-col flex-1 ml-12">
<text class="font">区块链和加密数字货币(随报随学认证班)</text>
<!-- 课程名称 -->
<text class="font">{{item.name}}</text>
<view class="flex-row justify-between items-baseline mt-17">
<text class="font_2">券后99元起</text>
<text class="font_3">18523人学习</text>
<!-- 卷后价格 -->
<text class="font_2">券后{{item.discountPrice}}元起</text>
<!-- 已有下单人数 -->
<text class="font_3">{{item.orderCount}}人学习</text>
</view>
</view>
</view>
</view>
</view>
</view>
</view>

View File

@ -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' });
},
});

View File

@ -1,21 +1,36 @@
<!-- pages/course/courseOrderList/courseOrderList.wxml -->
<view class="flex-col justify-start page">
<view class="flex-col group_1">
<view class="flex-col list-item mt-17" wx:for="{{items}}" wx:for-item="item" wx:for-index="index" wx:key="index">
<view
class="flex-col list-item mt-17"
wx:for="{{orderList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="item"
bind:tap="gotoOrderDetail"
data-id="{{ item.id }}"
>
<view class="flex-row self-stretch group">
<text class="font text">订单号:202506191307440406460485418</text>
<text class="font_2 ml-37">待支付</text>
<text class="font text">订单号:{{item.orderNumber}}</text>
<text class="font_2 ml-37">{{ item.orderStatus }}</text>
</view>
<text class="self-stretch font_3 text_2">区块链和加密数字货币(随报随学认证班)(随报随学认证班)</text>
<text class="self-end font_4 text_3">¥999.00</text>
<text class="self-end font_5 text_4">请在 {{countDownStr}} 内完成支付</text>
<text class="self-stretch font_3 text_2">{{ item.name }}</text>
<text class="self-end font_4 text_3">¥{{ item.totalAmount }}</text>
<!-- 倒计时,只在“待支付”时显示 -->
<text wx:if="{{ item.orderStatus === '待支付' }}" class="self-end font_5 text_4">
请在 {{ item.countDownStr }} 内完成支付
</text>
<view class="flex-row justify-between items-center self-stretch group_2">
<text class="font_6 text_5">2025-06-17 13:00:33</text>
<text class="font_6 text_5">{{ item.createTime }}</text>
<view class="flex-row">
<view class="flex-col justify-start items-center text-wrapper">
<!-- 仅待支付时可操作 -->
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper" catch:tap="cancelOrder">
<text class="font_7">取消订单</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_2 ml-11">
<view wx:if="{{ item.orderStatus === '待支付' }}" class="flex-col justify-start items-center text-wrapper_2 ml-11" catch:tap="payOrder">
<text class="font_8">支付</text>
</view>
</view>

View File

@ -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;

View File

@ -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()
},
/**

View File

@ -4,14 +4,14 @@
<view class="flex-row items-center section">
<image
class="shrink-0 image"
src="https://ide.code.fun/api/image?token=6859f7a14ae84d0012334fa9&name=9c2a22f14e2bd768cbd40d939693e4a8.png"
src="{{ globalImgUrl + courseObj.image }}"
/>
<view class="flex-col flex-1 ml-11">
<text class="self-start text">区块链和加密数字货币(随报随学认证班)(随报随学认证班)</text>
<text class="self-start text">{{ courseObj.name }}</text>
<view class="flex-row items-center self-stretch group mt-15">
<text class="text_2">¥999</text>
<text class="text_2">¥{{ courseObj.originPrice }}</text>
<view class="flex-col justify-start relative ml-1">
<text class="text_3">¥999</text>
<text class="text_3">¥{{ courseObj.discountPrice }}</text>
<view class="divider pos"></view>
</view>
</view>
@ -19,7 +19,7 @@
</view>
<view class="flex-row justify-between items-center section_2 mt-14">
<text class="font">商品价格</text>
<text class="font text_4">¥999</text>
<text class="font text_4">¥{{ courseObj.discountPrice }}</text>
</view>
<view class="flex-row justify-between items-center section_3 mt-14">
<view class="flex-row items-center">
@ -37,8 +37,8 @@
<!-- 固定在底部的区域 -->
<view class="footer">
<view class="flex-row justify-between items-center section_4">
<text class="font text_5">应付¥999</text>
<view class="flex-col justify-center items-center text-wrapper" bind:tap="createOrder" data-id="{{ '1' }}">
<text class="font text_5">应付¥{{ courseObj.discountPrice }}</text>
<view class="flex-col justify-center items-center text-wrapper" bind:tap="createOrder">
<text class="font text_6">立即支付</text>
</view>
</view>

View File

@ -6,7 +6,14 @@ Page({
data: {
// 初始时置空,待接口返回后再渲染
courseList: []
banners: [
'./image/banner.png',
'./image/banner.png',
'./image/banner.png',
'./image/banner.png'
],
courseList: [],
globalImgUrl
},
// 跳转课程列表页

View File

@ -1,47 +1,35 @@
<view class="flex-col page">
<view class="flex-col self-stretch group">
<view class="flex-row justify-center items-center section" bind:tap="gotoSearch">
<image
class="image"
src="./image/sousuo.png"
/>
<image class="image" src="./image/sousuo.png" />
<text class="text ml-3">搜索更多好课</text>
</view>
<swiper class="swiper" autoplay="true" circular="true"></swiper>
<swiper class="swiper" autoplay="true" circular="true" interval="3000" circular="true">
<block wx:for="{{banners}}" wx:for-item="img" wx:key="index">
<swiper-item>
<image src="{{img}}" class="swiper-image" mode="aspectFill" />
</swiper-item>
</block>
</swiper>
</view>
<view class="flex-row equal-division">
<view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考公考研' }}">
<image
class="image_3"
src="./image/kgky.png"
/>
<text class="font text_1 mt-12">考公考研</text>
<view class="flex-col items-center group_2 group_1" bind:tap="gotoCourseList" data-type="{{ '考研' }}">
<image class="image_3" src="./image/kgky.png" />
<text class="font text_1 mt-12">考研</text>
</view>
<view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '自媒体' }}">
<image
class="image_3"
src="./image/zmt.png"
/>
<text class="font text_3 mt-12">自媒体</text>
<view class="flex-col items-center group_2 group_3" bind:tap="gotoCourseList" data-type="{{ '考公' }}">
<image class="image_3" src="./image/zmt.png" />
<text class="font text_3 mt-12">考公</text>
</view>
<view class="flex-col items-center group_2 group_4" bind:tap="gotoCourseList" data-type="{{ '财经' }}">
<image
class="image_3"
src="./image/cj.png"
/>
<text class="font text_4 mt-12">财经</text>
<view class="flex-col items-center group_2 group_4" bind:tap="gotoCourseList" data-type="{{ '考证' }}">
<image class="image_3" src="./image/cj.png" />
<text class="font text_4 mt-12">考证</text>
</view>
</view>
<text class="self-start text_2">热门课程</text>
<view class="flex-col self-stretch list">
<!-- items 数组循环 -->
<view
class="flex-row relative group_5"
wx:for="{{courseList}}"
wx:for-item="item"
wx:for-index="index"
wx:key="item.id"
>
<view class="flex-row relative group_5" wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="item.id">
<view bind:tap="gotoCourseDetail" data-id="{{item.id}}">
<view class="list-divider pos_3"></view>
<!-- 绑定课程封面图 -->

View File

@ -134,4 +134,9 @@
width: 691.88rpx;
height: 324.38rpx;
margin-top: 22.5rpx;
}
/* 轮播图图片 */
.swiper-image {
width: 100%;
height: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

View File

@ -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' });
}
});

View File

@ -0,0 +1,87 @@
<view class="flex-col page">
<view class="flex-col group">
<view class="flex-col section">
<!-- 订单状态 + 倒计时 -->
<view class="flex-row justify-between self-stretch group_2">
<text class="font">订单状态</text>
<view class="flex-row group_3">
<text class="font_2 text" wx:if="{{ orderObj.orderStatus === '待支付' }}">请在{{countdown}}内完成支付</text>
<text class="font_2 text_2 ml-37">{{ orderObj.orderStatus }}</text>
</view>
</view>
<!-- 课程信息 -->
<view class="flex-row self-stretch group_4 mt-15">
<image
class="shrink-0 image"
src="{{ globalImgUrl + orderObj.image }}"
/>
<text class="flex-1 self-start font_3 text_3 ml-7">
{{ orderObj.name }}
</text>
</view>
<!-- 课程价格 -->
<text class="self-end font_3 text_4 mt-15">¥{{ orderObj.originPrice }}</text>
</view>
<!-- 订单详情 -->
<view class="mt-16 flex-col section_2">
<view class="self-start group_5">
<text class="font text_5">订单编号:</text>
<text class="font_4">{{ orderObj.orderNumber }}</text>
</view>
<view class="flex-row items-baseline self-start group_6">
<text class="shrink-0 font text_6">下单时间:</text>
<text class="flex-1 font_5 ml-3">{{ orderObj.createTime }}</text>
</view>
<view class="flex-col justify-start self-stretch relative group_7">
<view class="flex-col section_3">
<view class="self-stretch divider"></view>
<view class="flex-row self-stretch group_8 mt-17">
<text class="font text_7">支付方式:</text>
<text class="ml-8 font text_8">微信支付</text>
</view>
<view class="flex-row items-center self-stretch mt-17">
<text class="font text_9">交易号:</text>
<!-- TODO -->
<text class="font_4 ml-23">4002506191307440406460485418</text>
</view>
<text class="self-start font text_10 mt-17" wx:if="{{ orderObj.orderStatus === '交易成功' }}">交付时间:</text>
</view>
<text class="font_5 text_11 pos" wx:if="{{ orderObj.orderStatus === '交易成功' }}">{{ orderObj.updateTime }}</text>
</view>
</view>
<!-- 价格明细 -->
<view class="mt-16 flex-col section_4">
<view class="flex-row justify-between items-center">
<text class="font text_12">课程价格</text>
<text class="font_4">¥{{ orderObj.totalAmount }}</text>
</view>
<view class="flex-row justify-between items-center mt-11">
<text class="font text_13">价格折扣</text>
<text class="font_4 text_14">-¥{{ orderObj.totalAmount - orderObj.originPrice }}</text>
</view>
<view class="flex-row justify-between items-center group_9 mt-11">
<text class="font_2 text_15">订单金额</text>
<text class="font_4 text_16">¥{{ orderObj.originPrice }}</text>
</view>
</view>
</view>
<!-- 底部按钮:待支付 -->
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '待支付' }}">
<view class="flex-col justify-start items-center text-wrapper" bindtap="cancelOrder">
<text class="font_3 text_17">取消</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="goPay">
<text class="font_3 text_18">立即支付</text>
</view>
</view>
<!-- 底部按钮:已支付 -->
<view class="flex-row bottom-buttons" wx:if="{{ orderObj.orderStatus === '已支付' }}">
<view class="flex-col justify-start items-center text-wrapper_2" bindtap="refundOrder">
<text class="font_3 text_18">退款</text>
</view>
</view>
</view>

View File

@ -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; /* 可以根据需要设置背景色 */
}

View File

@ -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() {
}
})

View File

@ -1,79 +1,2 @@
<view class="flex-col page">
<view class="flex-col group">
<view class="flex-col section">
<!-- 订单状态 + 倒计时 -->
<view class="flex-row justify-between self-stretch group_2">
<text class="font">订单状态</text>
<view class="flex-row group_3">
<text class="font_2 text">请在{{countdown}}内完成支付</text>
<text class="font_2 text_2 ml-37">待支付</text>
</view>
</view>
<!-- 课程信息 -->
<view class="flex-row self-stretch group_4 mt-15">
<image
class="shrink-0 image"
src="https://ide.code.fun/api/image?token=6859f7a14ae84d0012334fa9&name=9c2a22f14e2bd768cbd40d939693e4a8.png"
/>
<text class="flex-1 self-start font_3 text_3 ml-7">
区块链和加密数字货币(随报随学认证班)(随报随学认证班)
</text>
</view>
<!-- 课程价格 -->
<text class="self-end font_3 text_4 mt-15">¥999.00</text>
</view>
<!-- 订单详情 -->
<view class="mt-16 flex-col section_2">
<view class="self-start group_5">
<text class="font text_5">订单编号:</text>
<text class="font_4">202506191307440406460485418</text>
</view>
<view class="flex-row items-baseline self-start group_6">
<text class="shrink-0 font text_6">下单时间:</text>
<text class="flex-1 font_5 ml-3">2025-06-19 16:08:15</text>
</view>
<view class="flex-col justify-start self-stretch relative group_7">
<view class="flex-col section_3">
<view class="self-stretch divider"></view>
<view class="flex-row self-stretch group_8 mt-17">
<text class="font text_7">支付方式:</text>
<text class="ml-8 font text_8">微信支付</text>
</view>
<view class="flex-row items-center self-stretch mt-17">
<text class="font text_9">交易号:</text>
<text class="font_4 ml-23">4002506191307440406460485418</text>
</view>
<text class="self-start font text_10 mt-17">交付时间:</text>
</view>
<text class="font_5 text_11 pos">2025-06-19 08:48:35</text>
</view>
</view>
<!-- 价格明细 -->
<view class="mt-16 flex-col section_4">
<view class="flex-row justify-between items-center">
<text class="font text_12">课程价格</text>
<text class="font_4">¥1999.9</text>
</view>
<view class="flex-row justify-between items-center mt-11">
<text class="font text_13">价格折扣</text>
<text class="font_4 text_14">-¥10</text>
</view>
<view class="flex-row justify-between items-center group_9 mt-11">
<text class="font_2 text_15">订单金额</text>
<text class="font_4 text_16">¥999</text>
</view>
</view>
</view>
<!-- 底部按钮 -->
<view class="flex-row mt-389">
<view class="flex-col justify-start items-center text-wrapper">
<text class="font_3 text_17">取消</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_2">
<text class="font_3 text_18">立即支付</text>
</view>
</view>
</view>
<!--pages/course/waitPayOrder/waitPayOrder.wxml-->
<text>pages/course/waitPayOrder/waitPayOrder.wxml</text>

View File

@ -0,0 +1,66 @@
// pages/dashboardModule/overviewPerformance/overviewPerformance.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,2 @@
<!--pages/dashboardModule/overviewPerformance/overviewPerformance.wxml-->
<text>pages/dashboardModule/overviewPerformance/overviewPerformance.wxml</text>

View File

@ -0,0 +1 @@
/* pages/dashboardModule/overviewPerformance/overviewPerformance.wxss */

View File

@ -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',
})
},
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,103 @@
<view class="flex-col page">
<!-- 遮罩层(上传时显示) -->
<view wx:if="{{isUploading}}" class="mask">
<text class="loading-text">上传中...</text>
</view>
<image
class="self-center image"
src="./images/logo.png"
/>
<text class="self-center text">欢迎登陆—青橙校园</text>
<view class="flex-col self-stretch group">
<view class="flex-col">
<view class="flex-row justify-between group_1">
<text class="font text_2">员工账号申请</text>
<view class="flex-row items-center group_2" bind:tap="gotoNotice">
<image
class="shrink-0 image_2 image_3"
src="./images/right.png"
/>
<text class="font_2 text_3">员工账号申请须知</text>
</view>
</view>
<view class="flex-col mt-15">
<!-- 姓名输入 -->
<view class="flex-col justify-start section">
<input
class="flex-col justify-start items-start text-wrapper view input"
placeholder="请输入姓名"
maxlength="8"
bindinput="onInput"
data-field="name"
value="{{name}}"
/>
</view>
<!-- 手机号输入 -->
<view class="flex-col justify-start section_1 mt-21">
<input
class="flex-col justify-start items-start text-wrapper text-wrapper_1 input_1"
placeholder="请输入手机号"
maxlength="11"
type="number"
bindinput="onInput"
data-field="phone"
value="{{phone}}"
/>
</view>
<!-- 验证码输入 + 发送按钮 -->
<view class="flex-row items-center section_3 mt-21">
<input
class="flex-col justify-start items-start text-wrapper_2 view_3 input_2"
placeholder="请输入验证码"
type="number"
bindinput="onInput"
data-field="code"
value="{{code}}"
/>
<view
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-16"
bindtap="getSmsCode"
>
<text class="text_8">
{{ codeButtonText }}
</text>
</view>
</view>
<!-- 身份证号输入 -->
<view class="flex-col justify-start items-start section_2 mt-21">
<input
class="flex-col justify-start items-start text-wrapper_4 view_4 input_3"
placeholder="请输入身份证号"
type="idcard"
bindinput="onInput"
data-field="idcard"
maxlength="18"
value="{{idcard}}"
/>
</view>
<!-- 上传简历 -->
<view class="flex-col items-center section_4 mt-21" bindtap="chooseResume">
<image
class="image_4"
src="./images/resume.png"
/>
<text class="{{resumeUploaded?'upload-success-text':'font_2 text_10 mt-12'}}">
{{ resumeUploaded ? '简历上传成功!' : '点击上传简历' }}
</text>
</view>
<!-- 提交按钮 -->
<view class="flex-col justify-start items-center text-wrapper_5 mt-21" bindtap="handleSubmit">
<text class="text_11">提交申请</text>
</view>
</view>
</view>
<view class="flex-row justify-center items-center relative group_4 mt-28" bind:tap="gotoQuery">
<image
class="image_2 pos"
src="./images/right.png"
/>
<text class="font_2 text_12">我的申请记录</text>
</view>
</view>
</view>

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

View File

@ -0,0 +1,66 @@
// pages/loginModule/employeeAccountNotice/employeeAccountNotice.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<!--pages/loginModule/employeeAccountNotice/employeeAccountNotice.wxml-->
<view class="flex-col page">
<text class="self-center text">员工账号申请须知</text>
<rich-text class="section view mt-20"></rich-text>
</view>

View File

@ -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;
}

View File

@ -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'
});
}
});
}
});

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,98 @@
<view class="flex-col page">
<!-- 身份证输入框 -->
<view class="flex-row items-center section">
<image class="image" src="./images/find.png" />
<input class="font text ml-5" maxlength="18" placeholder="请输入身份证查询凭证" bindinput="onInput" bindconfirm="onSearch" />
</view>
<!-- 显示查询结果 -->
<view class="flex-col mt-18">
<!-- 审核失败 -->
<view wx:if="{{status === '审核失败'}}" class="flex-col section_2">
<view class="flex-row justify-center self-start section_3">
<image class="image_2" src="./images/flase.png" />
<text class="font text_2 ml-8">审核失败</text>
</view>
<text class="self-start font_2 text_3">姓名</text>
<text class="self-start font_3 text_4">{{result.name}}</text>
<text class="self-start font_2 text_5">手机号</text>
<text class="self-start font_4 text_6">{{result.phone}}</text>
<view class="flex-col self-stretch relative group">
<view class="self-start section_4"></view>
<view class="flex-col justify-start items-center self-stretch text-wrapper" bind:tap="reapply">
<text class="font text_9">重新申请</text>
</view>
<view class="flex-col items-start section_5 pos">
<text class="font_5 text_7">原因:</text>
<text class="font_5 text_8 mt-11">{{result.failureReason}}</text>
</view>
</view>
</view>
<!-- 审核通过 -->
<view wx:if="{{status === '已通过'}}" class="flex-col section_6 mt-18">
<view class="flex-col group_2">
<view class="flex-row justify-between group_3">
<view class="flex-row items-center section_7">
<image class="shrink-0 image_3" src="./images/current.png" />
<text class="font text_11 ml-6">审核通过</text>
</view>
<view class="flex-col justify-start items-center self-start text-wrapper_2">
<text class="text_10">员工</text>
</view>
</view>
<view class="flex-col relative mt-21">
<view class="flex-row self-stretch section_8">
<text class="font_2 text_12">姓名</text>
<text class="font_3 ml-39">{{result.name}}</text>
</view>
<view class="flex-row self-stretch section_9">
<text class="font_2">手机号</text>
<text class="font_4 text_13 ml-23">{{result.phone}}</text>
</view>
<view class="self-start section_10"></view>
<view class="flex-row justify-between items-center section_11 pos_2">
<view class="flex-row items-center">
<text class="font_2 text_14">密码</text>
<text class="font_3 text_15 ml-37">{{result.password}}</text>
</view>
<text class="font_2 text_16" bind:tap="copyPassword">复制</text>
</view>
</view>
<view class="group_4 mt-21">
<text class="font_6 text_17">温馨提示:</text>
<text class="font_6">恭喜成为本公司的推广员工,请保存以上账号密码,用于登录员工端小程序。</text>
</view>
</view>
<view class="flex-col justify-start items-center text-wrapper_3" bind:tap="gotoLogin"><text class="font text_18">去登录</text></view>
</view>
<!-- 审核中 -->
<view wx:if="{{status === '待审核'}}" class="flex-col section_12 mt-18">
<view class="flex-row justify-center items-center self-start section_13">
<image class="image" src="./images/wait.png" />
<text class="font text_19 ml-6">审核中</text>
</view>
<text class="self-start font_2 text_20">姓名</text>
<text class="self-start font_3 text_21">{{result.name}}</text>
<text class="self-start font_2 text_22">手机号</text>
<text class="self-start font_4 text_23">{{result.phone}}</text>
<!-- <text class="self-start font_2 text_24">身份证号</text>
<view class="flex-row self-stretch group_5">
<view class="shrink-0 section_14"></view>
<view class="flex-col justify-start items-start flex-1 text-wrapper_4">
<text class="text_25">{{result.idCard}}</text>
</view>
</view> -->
<view class="flex-col self-stretch group_6">
<view class="group_7">
<text class="font_6 text_26">注:</text>
<text class="font_6">每次必须通过身份证来查看申请状态。</text>
</view>
<view class="flex-col justify-start items-center text-wrapper_5 mt-14" bind:tap="revokeApplication">
<text class="font text_27">撤销申请</text>
</view>
</view>
</view>
</view>
</view>

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

View File

@ -139,7 +139,7 @@ Page({
// 点击“登录账号”回登录页
gotoLogin() {
wx.navigateTo({ url: '/pages/loginModule/pwdLogin/pwdLogin' });
wx.navigateBack();
},
onUnload() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -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',
})
},
});

View File

@ -1,88 +1,106 @@
<view class="flex-col page">
<image
class="self-center image"
src="./images/logo.png"
/>
<text class="self-center text">欢迎登陆—青橙校园</text>
<view class="flex-col self-stretch group">
<image class="self-center image" src="./images/logo.png" />
<!-- 切换登录方式 -->
<view class="flex-col items-center self-stretch group">
<!-- 加上 bold-text -->
<text class="font text bold-text">欢迎登陆—青橙校园</text>
<text class="font mt-12">{{ showRole }}端)</text>
</view>
<view class="flex-col self-stretch group_2">
<view class="flex-row">
<!-- 密码登录 -->
<text
class="font switch {{loginType==='password'?'active':'inactive'}} text_2"
class="font_2 toggle-text {{loginType==='password'?'active':''}}"
bindtap="switchToPassword"
>密码登录</text>
<!-- 验证码登录 -->
<text
class="font switch {{loginType==='sms'?'active':'inactive'}} text_3 ml-8"
bindtap="switchToSms"
class="font_2 ml-8 toggle-text {{loginType==='sms'?'active':''}}"
bindtap="switchToSms" wx:if="{{ role === 'user' }}"
>验证码登录</text>
</view>
<view class="flex-col group_1 mt-20">
<!-- 手机号输入 -->
<!-- 手机号 输入框,保持原 .text-wrapper 样式 -->
<view class="flex-col self-stretch">
<view class="flex-col justify-start relative section">
<input
class="flex-col justify-start items-start text-wrapper view input"
class="text-wrapper"
placeholder="请输入手机号"
value="{{phone}}"
bindinput="onPhoneInput"
maxlength="11"
type="number"
model:value="{{phone}}"
bindinput="onPhoneInput"
/>
</view>
<!-- 密码 / 验证码 输入 + 获取验证码按钮 -->
<view class="flex-row items-center section_2 mt-21">
<input
class="flex-col justify-start items-start text-wrapper_2 view_2 input_1"
placeholder="{{ loginType==='password' ? '请输入密码' : '请输入验证码' }}"
password="{{ loginType==='password' }}"
model:value="{{credential}}"
bindinput="onCredentialInput"
/>
<text
wx:if="{{loginType==='sms'}}"
class="text_6 ml-10 get-code {{ countdown>0 ? 'disabled' : '' }}"
bindtap="{{ countdown>0 ? '' : 'getSmsCode' }}"
>{{ codeButtonText }}</text>
</view>
</view>
<text class="self-end font_3 text_7" bindtap="gotoForgetPwd">忘记密码</text>
<!-- 密码/验证码 输入框,保持原 .text-wrapper_2 样式 -->
<view class="flex-row items-center section_2 mt-21">
<input
class="text-wrapper"
placeholder="{{ loginType==='password' ? '请输入密码' : '请输入验证码' }}"
value="{{credential}}"
bindinput="onCredentialInput"
password="{{ loginType==='password' }}"
type="{{ loginType==='sms' ? 'number' : 'text' }}"
/>
<!-- 仅验证码登录时显示倒计时按钮 -->
<view
class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-2"
bindtap="getSmsCode"
wx:if="{{ loginType==='sms' }}"
>
<text class="text_6">{{ codeButtonText }}</text>
</view>
</view>
<!-- 忘记密码,仅密码登录时显示 -->
<text
class="self-end font_4 text_7"
bindtap="gotoForgetPwd"
wx:if="{{ loginType==='password' }}"
>忘记密码</text>
<!-- 登录按钮 -->
<view
class="flex-col justify-start items-center self-stretch text-wrapper_3 login-button"
<view
class="flex-col justify-start items-center self-stretch text-wrapper_4"
bindtap="onLogin"
>
<text class="text_8">登录</text>
</view>
<!-- 用户协议勾选 -->
<view class="flex-row items-center self-stretch group_2">
<checkbox-group bindchange="onAgreeChange">
<checkbox
class="checkbox"
value="agree"
checked="{{isAgree}}"
bindchange="onAgreeChange"
color="#FF8D1A"
/>
<!-- 协议勾选 -->
<view class="flex-row items-center self-stretch group_3">
<checkbox-group bindchange="onAgreeChange">
<checkbox
class="checkbox"
value="agree"
checked="{{ isAgree }}"
color="#FF8D1A"
/>
</checkbox-group>
<view class="group_3 ml-12">
<text class="font_4 text_9">登录代表您已同意</text>
<text class="font_4" bind:tap="gotoAgreement">《用户协议》</text>
<view class="group_4 ml-12">
<text class="font_5 text_9">登录代表您已同意</text>
<text class="font_5" bindtap="gotoAgreement">《用户协议》</text>
<text class="text_10">&</text>
<text class="font_4" bind:tap="gotoPolicy">《隐私协议》</text>
<text class="font_5" bindtap="gotoPolicy">《隐私协议》</text>
</view>
</view>
<view class="self-center group_4">
<text class="font_3 text_11">没有账号?</text>
<text class="font_4 text_12" bindtap="gotoRegister">去注册→</text>
<!-- 去注册 -->
<view class="self-center group_5">
<text class="font_4 text_11">没有账号?</text>
<text class="font_5 text_12" bindtap="gotoRegister">去注册→</text>
</view>
</view>
</view>
<view class="flex-row justify-evenly items-center self-end section_3" bind:tap="joinUs" wx:if="{{ role === 'user' }}">
<text class="font_2 text_13">加入我们</text>
<image class="image_3" src="./images/joinus.png" />
</view>
</view>

View File

@ -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;
}

View File

@ -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 });
}

View File

@ -11,8 +11,8 @@
<view class="flex-col">
<view class="flex-col justify-start relative section">
<input class="flex-col justify-start items-start text-wrapper_5 view input"
placeholder="请输入昵称"
maxlength="6"
placeholder="{{ placeholder }}"
maxlength="18"
bindinput="onInput" data-field="nickname" value="{{nickname}}"
/>
</view>

View File

@ -33,7 +33,7 @@ Page({
})
setTimeout(() => {
wx.reLaunch({
url: '/pages/loginModule/pwdLogin/pwdLogin',
url: '/pages/welcome/homePage/homePage',
})
}, 1000); // 1000ms = 1秒
} else {

View File

@ -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,
})
}
}

View File

@ -1,4 +1,4 @@
<view class="flex-col page">
<!-- <view class="flex-col page">
<view class="flex-col relative section">
<view class="flex-row justify-between items-center group">
<view class="flex-col">
@ -89,10 +89,10 @@
/>
<text class="font text_13 mt-6">提现记录</text>
</view>
</view>
</view> -->
<!-- 接单相关 -->
<view class="flex-col list">
<view
<!-- <view class="flex-col list"> -->
<!-- <view
class="flex-row equal-division equal-division_3 mt-15"
wx:for="{{items}}"
wx:for-item="item"
@ -131,9 +131,9 @@
/>
<text class="font mt-11">联系上级</text>
</view>
</view>
</view> -->
<!-- 课程相关 -->
<view
<!-- <view
class="flex-row equal-division equal-division_3 mt-15"
wx:for="{{items}}"
wx:for-item="item"
@ -207,6 +207,111 @@
/>
</view>
</view>
</view> -->
<view class="flex-col page">
<view class="flex-row justify-between section">
<view class="flex-row items-center self-center">
<image
class="image"
src="./images/logo.png"
/>
<view class="flex-col ml-6">
<text class="self-start font text">{{ nickName }}</text>
<view class="flex-row items-center self-stretch group_2 mt-9" bind:tap="gotoCall">
<image
class="image_3"
src="./images/dianhua.png"
mode="aspectFill"
/>
<text class="font_2 text_2 ml-7">{{ phoneNumber }}</text>
</view>
<view class="flex-row items-center self-stretch section_2 mt-9" bind:tap="copyInvitationCode">
<image
class="shrink-0 image_4"
src="./images/fuzhi.png"
mode="aspectFill"
/>
<text class="font_2 text_3">邀请码:{{ invitationCode }}</text>
</view>
</view>
</view>
<view class="flex-col items-start self-start group">
<image
class="image_2"
src="./images/erweima.png"
mode="aspectFill"
bind:tap="showPromoPopup"
/>
<text class="font_2 text_4 mt-6">二维码邀请</text>
</view>
</view>
<view class="flex-col mt-22">
<view class="flex-row items-start equal-division section_3">
<view class="flex-col items-center equal-division-item_1 group_3" >
<image
class="image_5"
src="./images/zhijinxiangqing.png"
/>
<text class="font text_5 mt-6">查看绩效</text>
</view>
<view class="flex-col items-center equal-division-item_2 equal-division-item">
<image
class="image_5"
src="./images/tixianzhanghu.png"
/>
<text class="font text_6 mt-6">主管排名</text>
</view>
<view class="flex-col items-center equal-division-item_3 group_5">
<image
class="image_5"
src="./images/tixianjilu.png"
/>
<text class="font mt-6">员工排名</text>
</view>
</view>
<view class="flex-col list">
<view class="flex-row justify-between items-center section_4">
<view class="flex-row items-center" bind:tap="courseOrder">
<image
class="shrink-0 image_6"
src="./images/zhanghaoshezhi.png"
/>
<text class="font ml-5">我的订单</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view>
<view class="flex-row justify-between items-center section_4 mt-11">
<view class="flex-row items-center">
<image
class="shrink-0 image_6"
src="./images/zhanghaoshezhi.png"
/>
<text class="font text_7 ml-5">仪表盘</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view>
<view class="flex-row justify-between items-center section_4 mt-11" bind:tap="zhshezhi">
<view class="flex-row items-center">
<image
class="shrink-0 image_6"
src="./images/zhanghaoshezhi.png"
/>
<text class="font text_8 ml-5">账号设置</text>
</view>
<image
class="image_7"
src="./images/xiajiantou.png"
/>
</view>
</view>
</view>
</view>
<!-- 调用弹窗组件 -->

View File

@ -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;
}

View File

@ -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() {
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,18 @@
<view class="flex-col justify-start items-center page">
<view class="flex-col section">
<view class="flex-col items-center">
<image
class="image"
src="./images/logo.png"
/>
<text class="mt-12 text">欢迎进入青橙校园</text>
</view>
<view class="mt-38 flex-col">
<view class="flex-col justify-start items-center text-wrapper" bind:tap="userLogin" data-role="{{ 'user' }}"><text class="font text_2">我是用户</text></view>
<view class="flex-col justify-start items-center text-wrapper_2 mt-9" bind:tap="userLogin" data-role="{{ 'supervisor' }}"><text class="font">我是主管</text></view>
<view class="flex-col justify-start items-center text-wrapper_2 mt-9" bind:tap="userLogin" data-role="{{ 'staff' }}">
<text class="font text_3">我是员工</text>
</view>
</view>
</view>
</view>

View File

@ -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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -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/'