[上传]
This commit is contained in:
54
手太欠/优迪尔-小程序/api/err.js
Normal file
54
手太欠/优迪尔-小程序/api/err.js
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
/**
|
||||
* 处理错误信息
|
||||
* @property {Object} errInfo
|
||||
*/
|
||||
|
||||
const errInfo = (obj) =>{
|
||||
if(obj.status_code == 401){
|
||||
wx.showModal({
|
||||
title : "登录提示",
|
||||
content : "长时间未操作,登录已过期,请重新登录",
|
||||
showCancel : false,
|
||||
confirmColor: "#0b0041",
|
||||
confirmText : "确定",
|
||||
success : ()=>{
|
||||
// 清理客户端登录缓存
|
||||
wx.removeStorageSync("token")
|
||||
// 返回首页
|
||||
wx.redirectTo({
|
||||
url: "/pages/login/index"
|
||||
})
|
||||
}
|
||||
})
|
||||
}else if(obj.status_code == 422){
|
||||
wx.showToast({
|
||||
title: obj.message,
|
||||
icon : "none"
|
||||
})
|
||||
}else if(obj.status_code == 400 || obj.status_code == 0){
|
||||
wx.showToast({
|
||||
title: obj.message,
|
||||
icon : "none"
|
||||
})
|
||||
}else if(obj.status_code == 404){
|
||||
wx.showToast({
|
||||
title: "接口地址不存在,请联系系统管理员",
|
||||
icon : "none"
|
||||
})
|
||||
}else if(obj.status_code == 500){
|
||||
wx.showToast({
|
||||
title: "服务端:" + obj.message,
|
||||
icon : "none"
|
||||
})
|
||||
}else {
|
||||
wx.showToast({
|
||||
title: "code:" + obj.status_code + ", msg:" + obj.message,
|
||||
icon : "none"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
errInfo
|
||||
}
|
||||
24
手太欠/优迪尔-小程序/api/index.js
Normal file
24
手太欠/优迪尔-小程序/api/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
/*
|
||||
* 手太欠
|
||||
* U迪尔 v1.0.0 (2021-4-20 09:25:32)
|
||||
* https://www.lvmeimall.com
|
||||
*/
|
||||
|
||||
import auth from "./interfaces/auth"
|
||||
import stuIndex from "./interfaces/stuIndex"
|
||||
import teaIndex from "./interfaces/teaIndex"
|
||||
import stuUsers from "./interfaces/stuUsers"
|
||||
import teaUsers from "./interfaces/teaUsers"
|
||||
import address from "./interfaces/address"
|
||||
import file from "./interfaces/file"
|
||||
|
||||
export default{
|
||||
auth,
|
||||
stuIndex,
|
||||
teaIndex,
|
||||
stuUsers,
|
||||
teaUsers,
|
||||
address,
|
||||
file
|
||||
}
|
||||
6
手太欠/优迪尔-小程序/api/interfaces/address.js
Normal file
6
手太欠/优迪尔-小程序/api/interfaces/address.js
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
import {req} from "../request"
|
||||
const province = (area) => req({url: "areas", data:{area : area}}) //省市区选择
|
||||
export default({
|
||||
province
|
||||
})
|
||||
10
手太欠/优迪尔-小程序/api/interfaces/auth.js
Normal file
10
手太欠/优迪尔-小程序/api/interfaces/auth.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import {req} from "../request"
|
||||
const login = data => req({url: "auth/login", method: "POST", data: data}) //登录
|
||||
const register = (class_id,mobileNo,code,nickname,province_id,city_id,district_id,school) => req({url: "auth/register", method: "POST", data:{class_id:class_id, mobileNo:mobileNo, code:code, nickname:nickname, province_id:province_id,city_id:city_id, district_id:district_id, school:school}}) //注册
|
||||
const sms = (mobileNo) => req({url: "sms", method: "POST", data:{mobileNo : mobileNo}}) //验证码
|
||||
|
||||
export default({
|
||||
login,
|
||||
register,
|
||||
sms
|
||||
})
|
||||
11
手太欠/优迪尔-小程序/api/interfaces/file.js
Normal file
11
手太欠/优迪尔-小程序/api/interfaces/file.js
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
/*
|
||||
* 图图片上传公用接口
|
||||
*/
|
||||
import {upload} from "../request"
|
||||
|
||||
const uploadImg = (imgPaht) => upload({url: "storages", method: "POST", key: "image", path: imgPaht}) //上传图片
|
||||
|
||||
export default({
|
||||
uploadImg
|
||||
})
|
||||
13
手太欠/优迪尔-小程序/api/interfaces/stuIndex.js
Normal file
13
手太欠/优迪尔-小程序/api/interfaces/stuIndex.js
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
import {req} from "../request"
|
||||
const index = (page) => req({url: "student", data:{page : page}}) //首页列表
|
||||
const stuLevel = (level_id, page) => req({url: "student/" + level_id + '/courses', data:{page : page}}) //课程列表-二级
|
||||
const stuSections = (course_id, page) => req({url: "student/" + course_id + '/sections', data:{page : page}}) //课程列表-二级-章节列表
|
||||
const stuDet = (section_id) => req({url: "student/" + section_id + '/section'}) //课程列表-二级-章节详情
|
||||
|
||||
export default({
|
||||
index,
|
||||
stuLevel,
|
||||
stuSections,
|
||||
stuDet
|
||||
})
|
||||
10
手太欠/优迪尔-小程序/api/interfaces/stuUsers.js
Normal file
10
手太欠/优迪尔-小程序/api/interfaces/stuUsers.js
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
import {req} from "../request"
|
||||
const index = () => req({url: "student/user"}) //用户信息
|
||||
const cover = data => req({url: "user/setting/cover", method: "PUT", data: data}) //修改头像
|
||||
const mobile = (mobileNo,code) => req({url: "student/user/mobile", method: "PUT", data:{mobileNo : mobileNo,code:code}}) //更换手机号
|
||||
export default({
|
||||
index,
|
||||
cover,
|
||||
mobile
|
||||
})
|
||||
54
手太欠/优迪尔-小程序/api/interfaces/teaIndex.js
Normal file
54
手太欠/优迪尔-小程序/api/interfaces/teaIndex.js
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
import {req} from "../request"
|
||||
const index = (category_id, page) => req({url: "teacher/services", data:{category_id : category_id, page : page}}) //课程服务列表
|
||||
const activity = (category_id, page) => req({url: "teacher/services/" + category_id + '/list', data:{page : page}}) //课程服务活动列表
|
||||
const detailed = (active_id, page) => req({url: "teacher/services/" + active_id, data:{page : page}}) //课程服务活动详情
|
||||
const classList = (page) => req({url: "teacher", data:{page : page}}) //课程列表
|
||||
const courses = (learn_id, page) => req({url: "teacher/" + learn_id + '/courses', data:{page : page}}) //课程列表-二级页
|
||||
const coursedet = (course_id) => req({url: "teacher/course/" + course_id + '/detail'}) //课程详情
|
||||
const section = (learn_course_id, page) => req({url: "teacher/" + learn_course_id + '/sections', data:{page : page}}) //章节列表
|
||||
const detail = (teacher_learn_section_id) => req({url: "teacher/section/" + teacher_learn_section_id + '/detail'}) //章节列表
|
||||
const extralPlan= (section) => req({url: "teacher/section/" + section + '/extral/plan'}) //课程教案
|
||||
const extralArch= (section) => req({url: "teacher/section/" + section + '/extral/architecture'}) //课程搭建图
|
||||
const grades = (page) => req({url: "teacher/class", data:{page : page}}) //班级列表
|
||||
const gradesDet = (active_id) => req({url: "teacher/class/" + active_id}) //班级列表-详情
|
||||
const students = (class_id,page) => req({url: "teacher/class/" + class_id + '/students', data:{page : page}}) //学生列表
|
||||
const classPut = (class_id,title) => req({url: "teacher/class/" + class_id, method: "PUT", data:{title : title}}) //修改班级名称
|
||||
const gradesAdd = (title) => req({url: "teacher/class", method: "POST", data:{title : title}}) //新建班级名称
|
||||
const remove = (class_id) => req({url: "teacher/class/" + class_id, method: "delete"}) //班级删除
|
||||
const studentDet = (student_id) => req({url: "teacher/class/" + student_id + '/student'}) //学生详情
|
||||
const studentDel = (student_id) => req({url: "teacher/class/" + student_id + '/student', method: "delete"}) //学生删除
|
||||
|
||||
// 此部分为教师端-班级-课后复习
|
||||
const teach = (class_id,page) => req({url: "teacher/class/" + class_id + '/teach', data:{page : page}}) //课后复习
|
||||
const teachLevel = (class_id,level_id,page) => req({url: "teacher/class/" + class_id + '/teach/' + level_id + '/courses', data:{page : page}}) //课后复习-阶段列表
|
||||
const teachSection = (class_id,teach_course_id,page) => req({url: "teacher/class/" + class_id + '/teach/' + teach_course_id + '/sections', data:{page : page}}) //课后复习-阶段列表-章节列表
|
||||
const teachSecDet = (class_id,teacher_learn_section_id) => req({url: "teacher/class/" + class_id + '/teach/' + teacher_learn_section_id + '/section'}) //课后复习-阶段列表-章节详情
|
||||
const teachLock = (class_id,teacher_learn_section_id) => req({url: "teacher/class/" + class_id + '/teach/' + teacher_learn_section_id + '/sectionunlock', method: "POST"}) //课后复习-阶段列表-章节详情-解锁
|
||||
|
||||
|
||||
export default({
|
||||
index,
|
||||
activity,
|
||||
detailed,
|
||||
classList,
|
||||
courses,
|
||||
coursedet,
|
||||
section,
|
||||
detail,
|
||||
extralPlan,
|
||||
extralArch,
|
||||
grades,
|
||||
gradesDet,
|
||||
students,
|
||||
classPut,
|
||||
gradesAdd,
|
||||
remove,
|
||||
studentDet,
|
||||
studentDel,
|
||||
teach,
|
||||
teachLevel,
|
||||
teachSection,
|
||||
teachSecDet,
|
||||
teachLock
|
||||
})
|
||||
16
手太欠/优迪尔-小程序/api/interfaces/teaUsers.js
Normal file
16
手太欠/优迪尔-小程序/api/interfaces/teaUsers.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import {req} from "../request"
|
||||
const index = () => req({url: "teacher/user"}) //用户信息
|
||||
const suggest = (page) => req({url: "suggests/suggest", data:{page : page}}) //意见
|
||||
const complain = (page) => req({url: "suggests/complain", data:{page : page}}) //建议
|
||||
const suggestForm = (content) => req({url: "suggests/suggest", method: "POST", data:{content : content}}) //意见提交
|
||||
const complainForm = (content) => req({url: "suggests/complain", method: "POST", data:{content : content}}) //建议提交
|
||||
const students = (page) => req({url: "teacher/students", data:{page : page}}) //学生列表
|
||||
export default({
|
||||
index,
|
||||
suggest,
|
||||
complain,
|
||||
suggestForm,
|
||||
complainForm,
|
||||
students
|
||||
})
|
||||
130
手太欠/优迪尔-小程序/api/request.js
Normal file
130
手太欠/优迪尔-小程序/api/request.js
Normal file
@@ -0,0 +1,130 @@
|
||||
import {errInfo} from './err'
|
||||
import {updToken} from './updateToken'
|
||||
|
||||
// 请求方式配置
|
||||
const api = "https://sandbox.uideajg.cn/api/" //正式地址
|
||||
const header = {
|
||||
"Accept" : "application/json"
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求
|
||||
* @property {Object} req
|
||||
*/
|
||||
|
||||
const req = (obj) => {
|
||||
// 处理请求信息
|
||||
return new Promise((resolve, reject) => {
|
||||
// 组合header
|
||||
if(obj.header && obj.header['Authorization']){
|
||||
obj.header['Accept'] = "application/json"
|
||||
}else{
|
||||
obj.header = {
|
||||
"Accept" : "application/json",
|
||||
"Authorization" : wx.getStorageSync("token") || ""
|
||||
}
|
||||
}
|
||||
|
||||
// 处理数据请求
|
||||
wx.showLoading({
|
||||
title: "加载中..",
|
||||
mask : true
|
||||
})
|
||||
|
||||
wx.request({
|
||||
url : api + obj.url,
|
||||
header : obj.header || {},
|
||||
method : obj.method || 'GET',
|
||||
data : obj.data || {},
|
||||
success : res => {
|
||||
if(res.header.Authorization){
|
||||
// 更新全局存储器
|
||||
getApp().globalData.token = res.header.Authorization
|
||||
// 更新客户端登录缓存
|
||||
wx.setStorageSync('token', res.header.Authorization)
|
||||
}
|
||||
wx.hideLoading();
|
||||
if(res.data.status_code == 200){
|
||||
resolve(res.data)
|
||||
}else if(res.data.status_code == 401 || res.data.status_code == 0){
|
||||
errInfo(res.data)
|
||||
}else if(res.data.status_code == 400){
|
||||
errInfo(res.data)
|
||||
reject(res.data.message)
|
||||
}else if(res.data.status_code == 404){
|
||||
wx.showToast({
|
||||
title: "接口地址不存在,请联系系统管理员",
|
||||
icon : "none"
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: res.data.message,
|
||||
icon : "none"
|
||||
})
|
||||
}
|
||||
},
|
||||
fail : err => {
|
||||
wx.showToast({
|
||||
title: "服务端错误",
|
||||
icon : "none"
|
||||
})
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传
|
||||
* @property {Object} upload
|
||||
*/
|
||||
|
||||
const upload = (obj) => {
|
||||
// header
|
||||
header.Authorization = wx.getStorageSync("token") || ""
|
||||
// 处理上传信息
|
||||
return new Promise((resolve, reject) => {
|
||||
wx.showLoading({
|
||||
title: "上传中..",
|
||||
mask: true
|
||||
})
|
||||
wx.uploadFile({
|
||||
url : api + obj.url,
|
||||
header : header,
|
||||
name : obj.key || "",
|
||||
filePath: obj.path || "",
|
||||
formData: obj.data || {},
|
||||
success : res=>{
|
||||
wx.hideLoading();
|
||||
// 处理返回值
|
||||
let jsonData = JSON.parse(res.data)
|
||||
// 更新token
|
||||
if (res.header.Authorization) updToken(res.header.Authorization)
|
||||
// 处理信息
|
||||
if (jsonData.status_code == 200) {
|
||||
resolve(jsonData.data)
|
||||
} else {
|
||||
if (jsonData.status_code == 401) {
|
||||
reject({
|
||||
login: false
|
||||
})
|
||||
}
|
||||
errInfo(jsonData)
|
||||
}
|
||||
},
|
||||
fail : err=>{
|
||||
wx.showToast({
|
||||
title : err.errMsg,
|
||||
icon : "none"
|
||||
})
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
req,
|
||||
upload
|
||||
}
|
||||
17
手太欠/优迪尔-小程序/api/updateToken.js
Normal file
17
手太欠/优迪尔-小程序/api/updateToken.js
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
/**
|
||||
* 更新token
|
||||
* @property {String} updToken
|
||||
*/
|
||||
|
||||
const updToken = (token) =>{
|
||||
// 更新全局存储器
|
||||
getApp().globalData.token = token
|
||||
// 更新客户端登录缓存
|
||||
wx.setStorageSync('token', token)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updToken
|
||||
}
|
||||
|
||||
52
手太欠/优迪尔-小程序/app.js
Normal file
52
手太欠/优迪尔-小程序/app.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
import api from "api/index"
|
||||
|
||||
var QQMapWX = require('utils/qqmap-wx-jssdk.min.js');
|
||||
var qqmapsdk;
|
||||
|
||||
|
||||
App({
|
||||
onLaunch() {
|
||||
// 获取系统信息
|
||||
this.globalData.statusBarHeight = wx.getSystemInfoSync().statusBarHeight
|
||||
qqmapsdk = new QQMapWX({
|
||||
key: '2IQBZ-SJECS-D6OOS-6M63W-GYHG2-ZIFOX'
|
||||
})
|
||||
|
||||
// 检查用户登录状态
|
||||
const token = wx.getStorageSync("token")
|
||||
if(token){
|
||||
this.globalData.isUser = true
|
||||
}
|
||||
|
||||
// 获取系统信息
|
||||
wx.getSystemInfo({
|
||||
success: res=>{
|
||||
this.globalData.systInfo = {
|
||||
statusBarHeight: res.statusBarHeight,
|
||||
safeArea : res.safeArea
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 挂载api
|
||||
wx.$api = api
|
||||
wx.$qqmapsdk = qqmapsdk
|
||||
},
|
||||
|
||||
onShow(){
|
||||
wx.hideShareMenu();
|
||||
},
|
||||
|
||||
globalData: {
|
||||
isUser : false,
|
||||
userInfo : null,
|
||||
statusBarHeight : 0,
|
||||
token : "",
|
||||
list : [], // 存放自定义tabBar
|
||||
}
|
||||
})
|
||||
46
手太欠/优迪尔-小程序/app.json
Normal file
46
手太欠/优迪尔-小程序/app.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/login/index",
|
||||
"pages/stuIndex/index",
|
||||
"pages/stuUser/index",
|
||||
"pages/publicCourse/index",
|
||||
"pages/publicChapter/index",
|
||||
"pages/publicDetails/index",
|
||||
"pages/publicReview/index",
|
||||
"pages/userSetting/index",
|
||||
"pages/userHead/index",
|
||||
"pages/userTel/index",
|
||||
"pages/teaIndex/index",
|
||||
"pages/teaUser/index",
|
||||
"pages/teaClass/index",
|
||||
"pages/teaDetails/index",
|
||||
"pages/teaClass-details/index",
|
||||
"pages/teaSchool/index",
|
||||
"pages/teaClass-select/index",
|
||||
"pages/teaClass-build/index",
|
||||
"pages/teaActivity/index",
|
||||
"pages/teaActivity-list/index",
|
||||
"pages/teaActivity-details/index",
|
||||
"pages/teaStudent-list/index",
|
||||
"pages/teaStudent-details/index",
|
||||
"pages/teaClass-form/index",
|
||||
"pages/teaFeedback/index",
|
||||
"pages/register/index",
|
||||
"pages/teaFeedback-form/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarBackgroundColor": "#fff",
|
||||
"navigationBarTitleText": "优迪尔在线教育",
|
||||
"navigationBarTextStyle": "black"
|
||||
},
|
||||
"usingComponents": {
|
||||
"userTabBar": "/custom-tab-bar/index"
|
||||
},
|
||||
"style": "v2",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "你的位置信息将用于小程序位置接口的效果展示"
|
||||
}
|
||||
}
|
||||
}
|
||||
186
手太欠/优迪尔-小程序/app.wxss
Normal file
186
手太欠/优迪尔-小程序/app.wxss
Normal file
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
page {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
/*
|
||||
* 文字截取
|
||||
*/
|
||||
|
||||
.nowrap {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.nowrap-multi {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* 水平居中
|
||||
*/
|
||||
|
||||
.pack-center {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tabar距离
|
||||
*/
|
||||
.spaceTabar {
|
||||
border-bottom: 68px solid transparent;
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 页面信息提醒
|
||||
*/
|
||||
|
||||
.pages-hint,
|
||||
.pages-loding {
|
||||
text-align: center;
|
||||
color: #747788;
|
||||
font-size: 28rpx;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.pages-hint image {
|
||||
width: 188rpx;
|
||||
height: 188rpx;
|
||||
}
|
||||
|
||||
.pages-loding image {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
|
||||
/* 一像素下边框 */
|
||||
.uni-border-down,
|
||||
.uni-border-top {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uni-border-down::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: #f2f2f2;
|
||||
height: 2rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 一像素上边框 */
|
||||
.uni-border-top::before {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #f2f2f2;
|
||||
height: 2rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* 水平居中
|
||||
*/
|
||||
|
||||
.pack-center {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-pack: center;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* 页面信息提醒
|
||||
*/
|
||||
|
||||
.pages-hint {
|
||||
text-align: center;
|
||||
color: #747788;
|
||||
font-size: 28rpx;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.pages-hint image {
|
||||
width: 188rpx;
|
||||
height: 188rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* iphoneX footer
|
||||
*/
|
||||
|
||||
.iphoneX{
|
||||
padding-bottom: 68rpx;
|
||||
}
|
||||
|
||||
.loginBack {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - 45px);
|
||||
background: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loginIcon {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin: 40% auto 80rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.loginUrl {
|
||||
background: linear-gradient(to right, #fe4d4e, #ff2d8f);
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
padding: 0 30rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 26rpx;
|
||||
height: 68rpx;
|
||||
line-height: 68rpx;
|
||||
}
|
||||
|
||||
|
||||
/* 上拉加载 */
|
||||
.pagesLoding{
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
color: gray;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.pagesLoding-icon{
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
vertical-align: middle;
|
||||
margin-right: 10rpx;
|
||||
margin-bottom: 3rpx;
|
||||
}
|
||||
1120
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.js
Normal file
1120
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
24
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.wxml
Normal file
24
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.wxml
Normal file
@@ -0,0 +1,24 @@
|
||||
<view class='image-cropper' catchtouchmove='_preventTouchMove'>
|
||||
<view class='main' bindtouchend="_cutTouchEnd" bindtouchstart="_cutTouchStart" bindtouchmove="_cutTouchMove" bindtap="_click">
|
||||
<view class='content'>
|
||||
<view class='content_top bg_gray {{_flag_bright?"":"bg_black"}}' style="height:{{cut_top}}px;transition-property:{{_cut_animation?'':'background'}}"></view>
|
||||
<view class='content_middle' style="height:{{height}}px;">
|
||||
<view class='content_middle_left bg_gray {{_flag_bright?"":"bg_black"}}' style="width:{{cut_left}}px;transition-property:{{_cut_animation?'':'background'}}"></view>
|
||||
<view class='content_middle_middle' style="width:{{width}}px;height:{{height}}px;transition-duration: .3s;transition-property:{{_cut_animation?'':'background'}};">
|
||||
<view class="border border-top-left"></view>
|
||||
<view class="border border-top-right"></view>
|
||||
<view class="border border-right-top"></view>
|
||||
<view class="border border-right-bottom"></view>
|
||||
<view class="border border-bottom-right"></view>
|
||||
<view class="border border-bottom-left"></view>
|
||||
<view class="border border-left-bottom"></view>
|
||||
<view class="border border-left-top"></view>
|
||||
</view>
|
||||
<view class='content_middle_right bg_gray {{_flag_bright?"":"bg_black"}}' style="transition-property:{{_cut_animation?'':'background'}}"></view>
|
||||
</view>
|
||||
<view class='content_bottom bg_gray {{_flag_bright?"":"bg_black"}}' style="transition-property:{{_cut_animation?'':'background'}}"></view>
|
||||
</view>
|
||||
<image bindload="imageLoad" bindtouchstart="_start" bindtouchmove="_move" bindtouchend="_end" style="width:{{img_width ? img_width + 'px' : 'auto'}};height:{{img_height ? img_height + 'px' : 'auto'}};transform:translate3d({{_img_left-img_width/2}}px,{{_img_top-img_height/2}}px,0) scale({{scale}}) rotate({{angle}}deg);transition-duration:{{_cut_animation?.4:0}}s;" class='img' src='{{imgSrc}}'></image>
|
||||
</view>
|
||||
<canvas canvas-id='image-cropper' disable-scroll="true" style="width:{{_canvas_width * export_scale}}px;height:{{_canvas_height * export_scale}}px;left:{{canvas_left}}px;top:{{canvas_top}}px" class='image-cropper-canvas'></canvas>
|
||||
</view>
|
||||
123
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.wxss
Normal file
123
手太欠/优迪尔-小程序/commpent/image-cropper-master/image-cropper.wxss
Normal file
@@ -0,0 +1,123 @@
|
||||
.image-cropper{
|
||||
background:rgba(14, 13, 13,.8);
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
z-index: 1;
|
||||
}
|
||||
.main{
|
||||
position: absolute;
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.content{
|
||||
z-index: 9;
|
||||
position: absolute;
|
||||
width:100vw;
|
||||
height:100vh;
|
||||
display: flex;
|
||||
flex-direction:column;
|
||||
pointer-events:none;
|
||||
}
|
||||
.bg_black{
|
||||
background: rgba(0, 0, 0, 0.8)!important;
|
||||
}
|
||||
.bg_gray{
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
transition-duration: .35s;
|
||||
}
|
||||
.content>.content_top{
|
||||
pointer-events:none;
|
||||
}
|
||||
.content>.content_middle{
|
||||
display: flex;
|
||||
height: 200px;
|
||||
width:100%;
|
||||
}
|
||||
.content_middle_middle{
|
||||
width:200px;
|
||||
box-sizing:border-box;
|
||||
position: relative;
|
||||
transition-duration: .3s;
|
||||
}
|
||||
.content_middle_right{
|
||||
flex: auto;
|
||||
}
|
||||
.content>.content_bottom{
|
||||
flex: auto;
|
||||
}
|
||||
.image-cropper .img{
|
||||
z-index: 2;
|
||||
top:0;
|
||||
left:0;
|
||||
position: absolute;
|
||||
border:none;
|
||||
width:100%;
|
||||
backface-visibility: hidden;
|
||||
transform-origin:center;
|
||||
}
|
||||
.image-cropper-canvas{
|
||||
position: fixed;
|
||||
background: white;
|
||||
width:150px;
|
||||
height:150px;
|
||||
z-index: 10;
|
||||
top:-200%;
|
||||
pointer-events:none;
|
||||
}
|
||||
.border{
|
||||
background: white;
|
||||
pointer-events:auto;
|
||||
position:absolute;
|
||||
}
|
||||
.border-top-left{
|
||||
left:-2.5px;
|
||||
top:-2.5px;
|
||||
height:2.5px;
|
||||
width:33rpx;
|
||||
}
|
||||
.border-top-right{
|
||||
right:-2.5px;
|
||||
top:-2.5px;
|
||||
height:2.5px;
|
||||
width:33rpx;
|
||||
}
|
||||
.border-right-top{
|
||||
top:-1px;
|
||||
width:2.5px;
|
||||
height:30rpx;
|
||||
right:-2.5px;
|
||||
}
|
||||
.border-right-bottom{
|
||||
width:2.5px;
|
||||
height:30rpx;
|
||||
right:-2.5px;
|
||||
bottom:-1px;
|
||||
}
|
||||
.border-bottom-left{
|
||||
height:2.5px;
|
||||
width:33rpx;
|
||||
bottom:-2.5px;
|
||||
left:-2.5px;
|
||||
}
|
||||
.border-bottom-right{
|
||||
height:2.5px;
|
||||
width:33rpx;
|
||||
bottom:-2.5px;
|
||||
right:-2.5px;
|
||||
}
|
||||
.border-left-top{
|
||||
top:-1px;
|
||||
width:2.5px;
|
||||
height:30rpx;
|
||||
left:-2.5px;
|
||||
}
|
||||
.border-left-bottom{
|
||||
width:2.5px;
|
||||
height:30rpx;
|
||||
left:-2.5px;
|
||||
bottom:-1px;
|
||||
}
|
||||
69
手太欠/优迪尔-小程序/custom-tab-bar/index.js
Normal file
69
手太欠/优迪尔-小程序/custom-tab-bar/index.js
Normal file
@@ -0,0 +1,69 @@
|
||||
Component({
|
||||
data: {
|
||||
selected: 0,
|
||||
color: "#d7d7d7",
|
||||
roleId: '',
|
||||
selectedColor: "#2170f1",
|
||||
allList: {
|
||||
list1: [{
|
||||
"pagePath": "/pages/stuIndex/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/static/tabBarIcon/stuTabBar_00.png",
|
||||
"selectedIconPath": "/static/tabBarIcon/stuTabBar_00_active.png"
|
||||
},{
|
||||
"pagePath": "/pages/stuUser/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/tabBarIcon/stuTabBar_01.png",
|
||||
"selectedIconPath": "/static/tabBarIcon/stuTabBar_01_active.png"
|
||||
}],
|
||||
|
||||
list2: [{
|
||||
"pagePath": "/pages/teaIndex/index",
|
||||
"text": "首页",
|
||||
"iconPath": "/static/tabBarIcon/teaTabBar_00.png",
|
||||
"selectedIconPath": "/static/tabBarIcon/teaTabBar_00_active.png"
|
||||
},{
|
||||
"pagePath": "/pages/teaClass/index",
|
||||
"text": "班级",
|
||||
"iconPath": "/static/tabBarIcon/teaTabBar_01.png",
|
||||
"selectedIconPath": "/static/tabBarIcon/teaTabBar_01_active.png"
|
||||
},{
|
||||
"pagePath": "/pages/teaUser/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/static/tabBarIcon/teaTabBar_02.png",
|
||||
"selectedIconPath": "/static/tabBarIcon/teaTabBar_02_active.png"
|
||||
}]
|
||||
},
|
||||
list: []
|
||||
},
|
||||
properties: {
|
||||
atPagesUrl: {
|
||||
type: String,
|
||||
value: ""
|
||||
}
|
||||
},
|
||||
pageLifetimes: {
|
||||
show() {
|
||||
wx.getStorage({
|
||||
key: "status",
|
||||
success: res=> {
|
||||
let tabList = this.data.allList.list1
|
||||
if(res.data === 2) tabList = this.data.allList.list2
|
||||
this.setData({
|
||||
list: tabList
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
switchTab(e) {
|
||||
const data = e.currentTarget.dataset
|
||||
const url = data.path
|
||||
wx.redirectTo({ url })
|
||||
this.setData({
|
||||
selected: data.index
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
3
手太欠/优迪尔-小程序/custom-tab-bar/index.json
Normal file
3
手太欠/优迪尔-小程序/custom-tab-bar/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
10
手太欠/优迪尔-小程序/custom-tab-bar/index.wxml
Normal file
10
手太欠/优迪尔-小程序/custom-tab-bar/index.wxml
Normal file
@@ -0,0 +1,10 @@
|
||||
<cover-view class="tab-bar">
|
||||
<cover-view class="tab-bar-border"></cover-view>
|
||||
<cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}"
|
||||
data-index="{{index}}" bindtap="switchTab">
|
||||
<cover-image class="cover-image" src="{{item.pagePath === atPagesUrl ? item.selectedIconPath : item.iconPath}}">
|
||||
</cover-image>
|
||||
<cover-view class="cover-view" style="color: {{item.pagePath === atPagesUrl ? selectedColor : color}}">{{item.text}}
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
</cover-view>
|
||||
41
手太欠/优迪尔-小程序/custom-tab-bar/index.wxss
Normal file
41
手太欠/优迪尔-小程序/custom-tab-bar/index.wxss
Normal file
@@ -0,0 +1,41 @@
|
||||
.tab-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 58px;
|
||||
background: white;
|
||||
display: flex;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.tab-bar-border {
|
||||
box-shadow: 0.05rem 0.05rem 0.05rem 0 #f2f2f2;
|
||||
border-top: solid .05rem #f2f2f2;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
|
||||
.tab-bar-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tab-bar-item .cover-image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.tab-bar-item .cover-view {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
170
手太欠/优迪尔-小程序/pages/login/index.js
Normal file
170
手太欠/优迪尔-小程序/pages/login/index.js
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
loginShow: false, //手机号授权弹出层
|
||||
showUser : false, //微信用户信息授权弹出层
|
||||
loginCode: ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
wx.login({
|
||||
success: res => {
|
||||
this.setData({
|
||||
loginCode : res.code
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数-- 页面加载完成
|
||||
*/
|
||||
onReady() {
|
||||
this.setData({
|
||||
animation: true
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 授权登录弹出层
|
||||
*/
|
||||
loginTap() {
|
||||
this.setData({
|
||||
loginShow: !this.data.loginShow
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 微信授权手机号码
|
||||
*/
|
||||
userPhone(e){
|
||||
if(e.detail.errMsg == "getPhoneNumber:ok"){
|
||||
let enData = e.detail.encryptedData,
|
||||
iv = e.detail.iv
|
||||
// 检查用户登录Code是否过期
|
||||
wx.checkSession({
|
||||
success: ()=>{
|
||||
this.userLogin(iv,enData)
|
||||
},
|
||||
fail: err=>{
|
||||
// 登录过期重新获取code
|
||||
wx.login({
|
||||
success: res=>{
|
||||
this.setData({
|
||||
loginCode: res.code
|
||||
})
|
||||
// 登录
|
||||
this.userLogin(iv,enData)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
wx.showToast({
|
||||
title: '拒绝了登录授权',
|
||||
icon : 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户登录
|
||||
*/
|
||||
userLogin(iv,enData){
|
||||
wx.$api.auth.login({
|
||||
code : this.data.loginCode,
|
||||
encryptedData : enData,
|
||||
iv : iv
|
||||
}).then(res=>{
|
||||
// 存储登录信息
|
||||
wx.setStorageSync('token', res.data.access_token)
|
||||
// 更新全局状态
|
||||
getApp().globalData.token = res.data.access_token
|
||||
getApp().globalData.isUser = true
|
||||
|
||||
let userData = res.data
|
||||
|
||||
// 存储身份类型 type=1为学生 type=2为教师
|
||||
wx.setStorage({
|
||||
key: "status",
|
||||
data: userData.type,
|
||||
success: res=> {
|
||||
// 关闭教育介绍-授权页
|
||||
this.setData({
|
||||
loginShow: false
|
||||
})
|
||||
// has_cover为假的时,弹出用户信息授权
|
||||
if(!userData.has_cover) {
|
||||
this.setData({
|
||||
showUser: true
|
||||
})
|
||||
return
|
||||
}
|
||||
// 根据不同身份跳转相关页面
|
||||
if(userData.type == 1) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/stuIndex/index'
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '/pages/teaIndex/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}).catch(err=>{
|
||||
this.onShow()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 微信用户信息授权
|
||||
*/
|
||||
getuserInfo(){
|
||||
wx.getUserProfile({
|
||||
desc : "获取你的昵称、头像、地区及性别",
|
||||
success : res => {
|
||||
if(res.errMsg == "getUserProfile:ok"){
|
||||
wx.$api.stuUsers.cover({
|
||||
value: res.userInfo.avatarUrl
|
||||
}).then(res=>{
|
||||
// 用户信息存入缓存
|
||||
const roleId = wx.getStorageSync('status')
|
||||
if(roleId == 1) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/stuIndex/index'
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '/pages/teaIndex/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
//拒绝授权
|
||||
that.showErrorModal('您拒绝了请求');
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/login/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/login/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 登录"
|
||||
}
|
||||
51
手太欠/优迪尔-小程序/pages/login/index.wxml
Normal file
51
手太欠/优迪尔-小程序/pages/login/index.wxml
Normal file
@@ -0,0 +1,51 @@
|
||||
<!-- <view class="teacher" bindtap="teacherTap">
|
||||
点我登录教师端
|
||||
</view>
|
||||
|
||||
<view class="student" bindtap="studentTap">
|
||||
点我登录学生端
|
||||
</view> -->
|
||||
<image class="login-back" src="/static/img/login.png" mode="aspectFill"></image>
|
||||
<image class="login-star {{animation ? 'animation' : ''}}" src="/static/img/login_star.png" mode="widthFix"></image>
|
||||
<view class="login-center">
|
||||
<image class="login-center-title {{animation ? 'animation' : ''}}" mode="widthFix" src="/static/img/login_title.png"></image>
|
||||
</view>
|
||||
<view class="login-footer">
|
||||
<view class="login-footer-btns">
|
||||
<view class="login-footer-btn" bindtap="loginTap">立即登录</view>
|
||||
</view>
|
||||
<view class="login-footer-copy">优迪尔在线教育</view>
|
||||
</view>
|
||||
|
||||
<!-- 手机号授权 -->
|
||||
<view class="introduceBack {{loginShow ? 'active' : ''}}"></view>
|
||||
<view class="introducCont {{loginShow ? 'active' : ''}}">
|
||||
<view class="introducCont-title">
|
||||
优迪尔在线教育 · 介绍
|
||||
</view>
|
||||
<view class="introducCont-text">
|
||||
<text>欢迎来到优迪尔双师教学机器人教学平台,在人工智能高速发展的创新的时代,机器人教育也在基础教育 当中如火如荼地开展着。</text>
|
||||
<text>优迪尔专为3-12岁儿童开发机器人编程课程,以课程为载体,让学生了解与学 习人工智能的兴趣特点,培养学生的动手动脑能力、逻辑思维能力、解决问题能力、创意创造能力,同 时对未来学科学习奠定坚实的基础储备力量。</text>
|
||||
<text>为了进一步提升教学平台的服务力度,改善服务体验,优迪尔教学平台简化了登录、授课流程,使学习更加便捷。</text>
|
||||
</view>
|
||||
<view class="introducCont-login">
|
||||
<button class="login-footer-btn" size="default" open-type="getPhoneNumber" bindgetphonenumber="userPhone">授权登录</button>
|
||||
</view>
|
||||
<view class="introducCont-no" bindtap="loginTap">暂不登录</view>
|
||||
</view>
|
||||
|
||||
<!-- 微信用户信息授权 -->
|
||||
<view class="empowerBack" wx:if="{{showUser}}"></view>
|
||||
<view class="empowerCont" wx:if="{{showUser}}">
|
||||
<view class='headView'>
|
||||
<view class='headImageView'>
|
||||
<image class='headImage' src="/static/img/header-logo.png" mode='scaleToFill'></image>
|
||||
</view>
|
||||
<view class='titleText'>优迪尔申请获取以下权限</view>
|
||||
<view class='contentText'>{{needMobile ? '获得你的微信手机号' : '获得你的公开信息(昵称,头像)'}}</view>
|
||||
<view class="empowerBtn">
|
||||
<view class="empowerBtn-cancel" bindtap="cancelBtn">取消</view>
|
||||
<button hover-class="none" class="authBtn" bindtap="getuserInfo"> 授权获取头像昵称 </button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
247
手太欠/优迪尔-小程序/pages/login/index.wxss
Normal file
247
手太欠/优迪尔-小程序/pages/login/index.wxss
Normal file
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.login-back{
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.login-star{
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-star.animation{
|
||||
animation: star 5s infinite;
|
||||
}
|
||||
|
||||
@keyframes star{
|
||||
0%{
|
||||
opacity: 0;
|
||||
}
|
||||
50%{
|
||||
opacity: 1;
|
||||
}
|
||||
to{
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 文字层 */
|
||||
.login-center{
|
||||
position: absolute;
|
||||
top: 8vh;
|
||||
left: 0;
|
||||
z-index: 3;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-center-title{
|
||||
width: 73vw;
|
||||
opacity: 1;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.login-center-title.animation{
|
||||
animation: title 1.5s;
|
||||
}
|
||||
|
||||
.login-center-text{
|
||||
width: 45vw;
|
||||
margin-top: 10vh;
|
||||
}
|
||||
|
||||
@keyframes title {
|
||||
10%{
|
||||
opacity: 0;
|
||||
}
|
||||
to{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* footer */
|
||||
.login-footer{
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
padding: 50rpx 50rpx 80rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.login-footer-copy{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.login-footer-copy{
|
||||
line-height: 40rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.login-footer-btns{
|
||||
padding-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.login-footer-btn,
|
||||
.login-footer-btn[size="default"]{
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0;
|
||||
border-radius: 6rpx;
|
||||
font-size: 34rpx;
|
||||
color: #050d7c;
|
||||
background: #eec43a;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/* 介绍弹出 */
|
||||
.introduceBack {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
z-index: 99;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: rgba(0, 0, 0, .5);
|
||||
height: 100vh;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.introduceBack.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.introducCont {
|
||||
position: fixed;
|
||||
left: 80rpx;
|
||||
right: 80rpx;
|
||||
top: -100%;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
z-index: 100;
|
||||
padding: 40rpx 40rpx 60rpx;
|
||||
box-sizing: border-box;
|
||||
transition: .2s;
|
||||
height: 75vh;
|
||||
}
|
||||
|
||||
.introducCont.active {
|
||||
top: 12vh;
|
||||
}
|
||||
|
||||
.introducCont-title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin-bottom: 10rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #173e96;
|
||||
}
|
||||
|
||||
.introducCont-text {
|
||||
line-height: 50rpx;
|
||||
font-size: 30rpx;
|
||||
height: calc(100% - 260rpx);
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.introducCont-text text {
|
||||
margin-top: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.introducCont-login .login-footer-btn {
|
||||
background-color: #173e96;
|
||||
color: #fff;
|
||||
margin: 40rpx 0;
|
||||
border-radius: 10rpx;
|
||||
font-weight: normal;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.introducCont-no {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
/* 微信用户信息弹出 */
|
||||
.empowerBack {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background: rgba(0, 0, 0, .6);
|
||||
}
|
||||
|
||||
.empowerCont {
|
||||
position: fixed;
|
||||
left: 100rpx;
|
||||
right: 100rpx;
|
||||
background-color: #fff;
|
||||
z-index: 101;
|
||||
top: 25%;
|
||||
border-radius: 10rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.headView {
|
||||
color: #4e4e4e;
|
||||
}
|
||||
|
||||
.headImageView {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin: 0 auto 40rpx;
|
||||
}
|
||||
|
||||
.headImage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.contentText {
|
||||
margin: 20rpx 0 40rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.empowerBtn {
|
||||
display: flex;
|
||||
float: right;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.authBtn {
|
||||
width: auto !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
display: inline-block;
|
||||
height: auto;
|
||||
line-height: 40rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
color: #fd4c44;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.empowerBtn-cancel {
|
||||
font-size: 32rpx;
|
||||
display: inline-block;
|
||||
line-height: 40rpx;
|
||||
margin: 0 40rpx;
|
||||
}
|
||||
119
手太欠/优迪尔-小程序/pages/publicChapter/index.js
Normal file
119
手太欠/优迪尔-小程序/pages/publicChapter/index.js
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/*
|
||||
* 此页面教师端首页+教师端班级+学生端共用,由type名字判断
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //tea为教师端 stu为学生端 stuSee为学生观看--从课后复习进入
|
||||
chapterId : '', //章节id
|
||||
chapterText : '', //章节介绍
|
||||
chapterData : [], //章节列表
|
||||
classId : '', //来源--(班级-复习-阶段列表-章节)
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
dataType : options.type,
|
||||
chapterId : options.id,
|
||||
classId : options.classid
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 获取课程列表
|
||||
this.chapterInfo();
|
||||
|
||||
let pages = getCurrentPages(); //当前页面栈
|
||||
console.log(pages)
|
||||
},
|
||||
|
||||
/**
|
||||
* 课程列表
|
||||
*/
|
||||
chapterInfo(page) {
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
|
||||
// stuSee为学生观看-从课后复习进入
|
||||
if(this.data.dataType == 'stuSee') dataUrl = wx.$api.teaIndex.teachSection(this.data.classId, this.data.chapterId, page)
|
||||
|
||||
// tea为教师端-首页列表进入
|
||||
if(this.data.dataType == 'tea') dataUrl = wx.$api.teaIndex.section(this.data.chapterId, page)
|
||||
|
||||
// stu为学生端-首页列表进入
|
||||
if(this.data.dataType == 'stu') dataUrl = wx.$api.stuIndex.stuSections(this.data.chapterId, page)
|
||||
|
||||
dataUrl.then(res=>{
|
||||
let chapterArr = this.data.chapterData,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) chapterArr = []
|
||||
newData = chapterArr.concat(res.data.sections.data)
|
||||
|
||||
this.setData({
|
||||
chapterText : res.data,
|
||||
chapterData : newData,
|
||||
page : res.data.sections.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 章节详情跳转
|
||||
*/
|
||||
videoUrl(e) {
|
||||
let id = e.currentTarget.dataset.id || e.currentTarget.dataset.stuid,
|
||||
lock = e.currentTarget.dataset.lock,
|
||||
type = this.data.dataType
|
||||
if(lock == 1) {
|
||||
wx.showToast({
|
||||
title : '请先解锁',
|
||||
icon : 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 区分stuSee和(tea,stu)数据的层级关系
|
||||
if(this.data.dataType == 'stuSee') {
|
||||
wx.navigateTo({
|
||||
url: '/pages/publicReview/index?id=' + id + '&type=' + type + '&classid=' + this.data.classId
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: '/pages/publicReview/index?id=' + id + '&type=' + type
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.chapterInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/publicChapter/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/publicChapter/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 章节列表"
|
||||
}
|
||||
48
手太欠/优迪尔-小程序/pages/publicChapter/index.wxml
Normal file
48
手太欠/优迪尔-小程序/pages/publicChapter/index.wxml
Normal file
@@ -0,0 +1,48 @@
|
||||
<!-- 头部 -->
|
||||
<view class="chapterTop">
|
||||
<image class="chapterTop-back" src="/static/img/banner.png"></image>
|
||||
<view class="chapterTop-cont">
|
||||
<view class="chapterTop-img">
|
||||
<image src="{{chapterText.cover}}"></image>
|
||||
</view>
|
||||
<view class="chapterTop-text">
|
||||
<view class="nowrap chapterTop-name">{{chapterText.title}}</view>
|
||||
<navigator hover-class="none" url="/pages/publicDetails/index?id={{chapterText.course_id}}&type={{dataType}}" class="chapterTop-more">
|
||||
<text>共{{chapterText.sectionCount}}节</text>
|
||||
<image src="/static/img/stuChapter_row.png"></image>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 章节列表 -->
|
||||
<view class="chapterFoot" wx:if="{{chapterData.length > 0}}">
|
||||
<view class="chapterTitle">课程目录</view>
|
||||
<view class="uni-border-top chapterList" wx:for="{{chapterData}}" wx:key="chapterData" data-id="{{item.teacher_learn_section_id}}" data-stuId="{{item.section_id}}" data-lock="{{item.is_lock}}" bindtap="videoUrl">
|
||||
<image class="chapterList-icon" src="/static/img/chapterList_icon.png"></image>
|
||||
<view class="chapterList-cont" wx:if="{{dataType == 'tea'}}">
|
||||
<view class="nowrap chapterList-name">第{{item.order}}节 | {{item.title}}</view>
|
||||
<view class="chapterList-tips">{{dataType == 'tea' ? '时间' + item.times : '拱桥'}}</view>
|
||||
</view>
|
||||
<view class="chapterList-cont" wx:else>
|
||||
<view class="nowrap chapterList-name">第{{item.order}}节 | {{item.subtitle}}</view>
|
||||
<view class="chapterList-tips">{{item.title}}</view>
|
||||
</view>
|
||||
<image class="chapterList-more" src="{{item.is_lock == 0 || item.is_lock != '' ? '/static/img/stuList_row.png' : '/static/img/stuList_lock.png'}}"></image>
|
||||
</view>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
133
手太欠/优迪尔-小程序/pages/publicChapter/index.wxss
Normal file
133
手太欠/优迪尔-小程序/pages/publicChapter/index.wxss
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.chapterTop {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.chapterTop::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.chapterTop-back {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
filter: blur(15rpx);
|
||||
-webkit-filter: blur(15rpx);
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.chapterTop-cont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
padding: 40rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.chapterTop-img {
|
||||
border: 4rpx solid #fff;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.chapterTop-img image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.chapterTop-text {
|
||||
color: #fff;
|
||||
width: calc(100% - 220rpx);
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.chapterTop-name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.chapterTop-more {
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.chapterTop-more image {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
.chapterTop-more text {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* 章节列表 */
|
||||
.chapterTitle {
|
||||
padding: 30rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
font-weight: 600;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.chapterList {
|
||||
padding: 30rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.chapterList-icon {
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.chapterList-cont {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 30rpx 90rpx 30rpx 110rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.chapterList-name {
|
||||
color: #5e6ffb;
|
||||
}
|
||||
|
||||
.chapterList-tips {
|
||||
color: #999999;
|
||||
margin: 10rpx 0;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.chapterList-more {
|
||||
position: absolute;
|
||||
right: 30rpx;
|
||||
top: 60rpx;
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
opacity: .4;
|
||||
}
|
||||
120
手太欠/优迪尔-小程序/pages/publicCourse/index.js
Normal file
120
手太欠/优迪尔-小程序/pages/publicCourse/index.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/*
|
||||
* 此页面教师端首页+教师端班级+学生端共用,由type名字判断
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //tea为教师端 stu为学生端 stuSee为学生观看--从课后复习进入
|
||||
levelId : '', //学生端-课程列表id
|
||||
courseId : '', //教师端-课程列表id
|
||||
courseData : [], //课程列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
stuSee : {
|
||||
classId: '', //班级id--(从教师端-班级-课后复习进入)
|
||||
learnId: '' //阶段列表id--(从教师端-班级-课后复习进入)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
dataType : options.type, //进入来源的类型
|
||||
levelId : options.levelid, //stu为学生师端-首页进入
|
||||
courseId : options.courseid, //tea为教师端-首页进入
|
||||
['stuSee.classId'] : options.classid, //班级id
|
||||
['stuSee.learnId'] : options.learnid, //阶段列表id
|
||||
})
|
||||
|
||||
// 获取课程列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {},
|
||||
|
||||
|
||||
/**
|
||||
* 课程列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
|
||||
// stuSee为学生观看-从课后复习进入
|
||||
if(this.data.dataType == 'stuSee') dataUrl = wx.$api.teaIndex.teachLevel(this.data.stuSee.classId, this.data.stuSee.learnId, page)
|
||||
|
||||
// tea为教师端-首页列表进入
|
||||
if(this.data.dataType == 'tea') dataUrl = wx.$api.teaIndex.courses(this.data.courseId, page)
|
||||
|
||||
// stu为学生端-首页列表进入
|
||||
if(this.data.dataType == 'stu') dataUrl = wx.$api.stuIndex.stuLevel(this.data.levelId, page)
|
||||
|
||||
dataUrl.then(res=>{
|
||||
let courseArr = this.data.courseData,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) courseArr = []
|
||||
// 区分stuSee和(tea,stu)数据的层级关系
|
||||
newData = courseArr.concat(res.data.data)
|
||||
page = res.data.page
|
||||
if(this.data.dataType == 'stuSee') {
|
||||
newData = courseArr.concat(res.data.courses.data)
|
||||
page = res.data.courses.page
|
||||
}
|
||||
this.setData({
|
||||
classId : res.data.class_id,
|
||||
courseData : newData,
|
||||
page : page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转课程章节列表
|
||||
*/
|
||||
publicUrl(e) {
|
||||
//stuid为学生端 //id为教师端
|
||||
let id = e.currentTarget.dataset.id || e.currentTarget.dataset.stuid,
|
||||
type = this.data.dataType
|
||||
|
||||
// 区分stuSee和(tea,stu)数据的层级关系
|
||||
if(this.data.dataType == 'stuSee') {
|
||||
wx.navigateTo({
|
||||
url: '/pages/publicChapter/index?id=' + id + '&type=' + type + '&classid=' + this.data.stuSee.classId
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: '/pages/publicChapter/index?id=' + id + '&type=' + type
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.listInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/publicCourse/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/publicCourse/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 课程列表"
|
||||
}
|
||||
28
手太欠/优迪尔-小程序/pages/publicCourse/index.wxml
Normal file
28
手太欠/优迪尔-小程序/pages/publicCourse/index.wxml
Normal file
@@ -0,0 +1,28 @@
|
||||
<view class="stuFoot" wx:if="{{courseData.length > 0}}">
|
||||
<!-- 列表 -->
|
||||
<view class="uni-border-down stuList" wx:for="{{courseData}}" wx:key="courseData" bindtap="publicUrl" data-id="{{item.learn_course_id}}" data-stuId="{{item.course_id}}">
|
||||
<view class="stuList-icon">
|
||||
<image src="/static/img/stuList_icon_back.png"></image>
|
||||
</view>
|
||||
<view class="stuList-cont">
|
||||
<view class="nowrap stuList-name">{{item.title}}</view>
|
||||
<view class="stuList-more">查看课程<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
63
手太欠/优迪尔-小程序/pages/publicCourse/index.wxss
Normal file
63
手太欠/优迪尔-小程序/pages/publicCourse/index.wxss
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 列表 */
|
||||
.stuFoot {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.stuList {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.stuList .stuList-icon {
|
||||
background-color: #f13a26;
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stuList .stuList-icon image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-cont {
|
||||
position: absolute;
|
||||
padding: 30rpx 30rpx 30rpx 110rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.stuList .stuList-name {
|
||||
flex: 1;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-more {
|
||||
display: flex;
|
||||
color: #a5a5a5;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-more image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin: 12rpx 0 0 10rpx;
|
||||
}
|
||||
|
||||
.uni-border-down:last-child::after {
|
||||
display: none;
|
||||
}
|
||||
45
手太欠/优迪尔-小程序/pages/publicDetails/index.js
Normal file
45
手太欠/优迪尔-小程序/pages/publicDetails/index.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //tea为教师端 stu为学生端
|
||||
coursesId : '', //课程详情id
|
||||
chapterText : '', //课程数据
|
||||
content : '', //课程详情
|
||||
target : '', //课程详情
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
dataType : options.type,
|
||||
coursesId : options.id
|
||||
})
|
||||
|
||||
// 获取课程详情
|
||||
this.detailInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 课程详情
|
||||
*/
|
||||
detailInfo(page) {
|
||||
wx.$api.teaIndex.coursedet(this.data.coursesId).then(res=>{
|
||||
this.setData({
|
||||
chapterText : res.data,
|
||||
content : res.data.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'),
|
||||
target : res.data.target.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'),
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/publicDetails/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/publicDetails/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 详情"
|
||||
}
|
||||
25
手太欠/优迪尔-小程序/pages/publicDetails/index.wxml
Normal file
25
手太欠/优迪尔-小程序/pages/publicDetails/index.wxml
Normal file
@@ -0,0 +1,25 @@
|
||||
<!-- 头部 -->
|
||||
<view class="detailsTop">
|
||||
<image class="detailsTop-back" src="/static/img/banner.png"></image>
|
||||
<view class="detailsTop-cont">
|
||||
<view class="detailsTop-text">
|
||||
<view class="nowrap detailsTop-name">{{chapterText.title}}</view>
|
||||
<view class="detailsTop-time">日期:{{chapterText.created_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="detailsList">
|
||||
<view class="detailsList-title">课程目标</view>
|
||||
<view class="detailsList-text">
|
||||
<rich-text nodes="{{target}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="detailsList">
|
||||
<view class="detailsList-title">课程详情</view>
|
||||
<view class="detailsList-text">
|
||||
<rich-text nodes="{{content}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
106
手太欠/优迪尔-小程序/pages/publicDetails/index.wxss
Normal file
106
手太欠/优迪尔-小程序/pages/publicDetails/index.wxss
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.detailsTop {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 320rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.detailsTop::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgba(0, 0, 0, .6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.detailsTop-back {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.detailsTop-cont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 30rpx;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.detailsTop-img {
|
||||
border: 4rpx solid #fff;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.detailsTop-img image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.detailsTop-text {
|
||||
color: #fff;
|
||||
width: calc(100% - 220rpx);
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.detailsTop-name {
|
||||
font-size: 38rpx;
|
||||
font-weight: 600;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 详情 */
|
||||
.detailsList {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.detailsList-title {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 34rpx;
|
||||
color: #5572fe;
|
||||
margin-bottom: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.detailsList-title::after,
|
||||
.detailsList-title::before{
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 100rpx;
|
||||
height: 6rpx;
|
||||
top: calc(50% - 3rpx);
|
||||
}
|
||||
|
||||
.detailsList-title::after {
|
||||
background: linear-gradient(to left, #5572fe, #fafafa);
|
||||
left: calc(50% - 200rpx);
|
||||
}
|
||||
|
||||
.detailsList-title::before {
|
||||
background: linear-gradient(to right, #5572fe, #fafafa);
|
||||
right: calc(50% - 200rpx);
|
||||
}
|
||||
|
||||
|
||||
.detailsList-text {
|
||||
color: #999;
|
||||
line-height: 60rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
130
手太欠/优迪尔-小程序/pages/publicReview/index.js
Normal file
130
手太欠/优迪尔-小程序/pages/publicReview/index.js
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //tea为教师端 stu为学生端 stuSee为学生观看--从课后复习进入
|
||||
isShow : false, //视频展示
|
||||
videoCoverImg :'http://www.uideajg.cn/assets/index/img/video.jpg', // 视频封面图
|
||||
detailId : '', //复习课id
|
||||
detailData : '', //复习课数据
|
||||
classId : '', //班级id--(从教师端-班级-课后复习进入)
|
||||
content : '', //课程搭建图
|
||||
isStop : false, //是否为继续播放状态
|
||||
isLock : false, //是否解锁
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
dataType: options.type,
|
||||
detailId: options.id,
|
||||
classId : options.classid
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 获取复习课详情
|
||||
this.details();
|
||||
},
|
||||
|
||||
/**
|
||||
* 复习课详情
|
||||
*/
|
||||
details() {
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
|
||||
// stuSee为学生观看-从课后复习进入
|
||||
if(this.data.dataType == 'stuSee') dataUrl = wx.$api.teaIndex.teachSecDet(this.data.classId,this.data.detailId)
|
||||
|
||||
// tea为教师端-首页列表进入
|
||||
if(this.data.dataType == 'tea') dataUrl = wx.$api.teaIndex.detail(this.data.detailId)
|
||||
|
||||
// tea为教师端-首页列表进入
|
||||
if(this.data.dataType == 'stu') dataUrl = wx.$api.stuIndex.stuDet(this.data.detailId)
|
||||
|
||||
|
||||
dataUrl.then(res=>{
|
||||
let resData = ''
|
||||
if(this.data.dataType == 'stuSee'){
|
||||
resData = res.data.message
|
||||
} else {
|
||||
resData = res.data
|
||||
}
|
||||
this.setData({
|
||||
isLock : res.data.is_lock || '',
|
||||
detailData : resData,
|
||||
content : resData.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'),
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 播放
|
||||
*/
|
||||
videoPlay(){
|
||||
this.setData({
|
||||
isShow: true
|
||||
})
|
||||
let videoContext = wx.createVideoContext("video")
|
||||
videoContext.play()
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听视频播放进度
|
||||
*/
|
||||
bindtimeupdate(e) {
|
||||
let palyTimg = parseInt(e.detail.currentTime)
|
||||
let stopTime = this.data.detailData.video_pause
|
||||
let videoContext = wx.createVideoContext("video")
|
||||
stopTime.forEach(val => {
|
||||
if(palyTimg == val && !this.data.isStop) {
|
||||
videoContext.pause()
|
||||
this.setData({
|
||||
isStop: true
|
||||
})
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 再次按播放键触发
|
||||
*/
|
||||
bindplay() {
|
||||
let stopTime = setInterval( () => {
|
||||
this.setData({
|
||||
isStop: false
|
||||
})
|
||||
clearInterval(stopTime)
|
||||
}, 1000)
|
||||
},
|
||||
|
||||
/**
|
||||
* 解锁章节
|
||||
*/
|
||||
lockBind(e){
|
||||
let sectionId = e.currentTarget.dataset.id
|
||||
wx.$api.teaIndex.teachLock(this.data.classId,sectionId).then(res=>{
|
||||
wx.showToast({
|
||||
title : '解锁成功',
|
||||
icon : 'success',
|
||||
duration: 2000
|
||||
})
|
||||
this.setData({
|
||||
isLock: true
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/publicReview/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/publicReview/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 复习课"
|
||||
}
|
||||
68
手太欠/优迪尔-小程序/pages/publicReview/index.wxml
Normal file
68
手太欠/优迪尔-小程序/pages/publicReview/index.wxml
Normal file
@@ -0,0 +1,68 @@
|
||||
<view class="{{dataType == 'stuSee' ? 'classCont' : ''}}">
|
||||
<view class="reviewVideo">
|
||||
<view class='wrapper'>
|
||||
<video class='video-video' wx:if='{{isShow}}' bindtimeupdate="bindtimeupdate" autoplay="{{true}}" id='video'
|
||||
src='{{detailData.video}}' bindplay="bindplay"></video>
|
||||
<image class='video-cover' wx:if='{{!isShow}}' mode='aspectFill' src='{{videoCoverImg}}'></image>
|
||||
<view class="video_bg_black" wx:if='{{!isShow}}'></view>
|
||||
<image class='videoPlay' wx:if='{{!isShow}}' bindtap='videoPlay' src='/static/img/videoIcon.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 只有从教师端进入显示 -->
|
||||
<view class="reviewSort" wx:if="{{dataType == 'tea'}}">
|
||||
<navigator hover-class="none" url="/pages/teaClass-select/index" class="reviewSort-label">
|
||||
<image class="reviewSort-img" src="/static/img/reviewSort_00.png"></image>
|
||||
<view class="reviewSort-name">复习解锁</view>
|
||||
</navigator>
|
||||
<navigator hover-class="none" url="/pages/teaClass-build/index?id={{detailData.learn_id}}&type=build"
|
||||
class="reviewSort-label">
|
||||
<image class="reviewSort-img" src="/static/img/reviewSort_01.png"></image>
|
||||
<view class="reviewSort-name">搭建图</view>
|
||||
</navigator>
|
||||
<navigator hover-class="none" url="/pages/teaClass-build/index?id={{detailData.learn_id}}&type=lesson"
|
||||
class="reviewSort-label">
|
||||
<image class="reviewSort-img" src="/static/img/reviewSort_02.png"></image>
|
||||
<view class="reviewSort-name">课程教案</view>
|
||||
</navigator>
|
||||
<navigator hover-class="none" url="/pages/publicChapter/index?id={{detailData.learn_id}}&type=tea"
|
||||
class="reviewSort-label" open-type="navigateBack">
|
||||
<image class="reviewSort-img" src="/static/img/reviewSort_03.png"></image>
|
||||
<view class="reviewSort-name">课程目录</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view class="reviewCont">
|
||||
<view class="reviewLabel">
|
||||
<view class="reviewLabel-title">{{dataType == 'tea' ? detailData.course_title : detailData.subtitle}}
|
||||
</view>
|
||||
<view class="reviewLabel-chapter">第{{detailData.order}}节 {{detailData.title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="reviewCont">
|
||||
<view class="reviewLabel">
|
||||
<view class="reviewLabel-title">
|
||||
<image src="/static/img/sectiondetail_left.png"></image>
|
||||
<text>课程搭建图</text>
|
||||
<image src="/static/img/sectiondetail_right.png"></image>
|
||||
</view>
|
||||
<view class="reviewLabel-tips">
|
||||
<!-- 拱桥步骤图 -->
|
||||
</view>
|
||||
<view class="reviewLabel-img">
|
||||
<rich-text nodes="{{content}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 课后复习 -->
|
||||
<block wx:if="{{dataType == 'stuSee'}}">
|
||||
<view class="footer" wx:if="{{!isLock}}" bindtap="lockBind" data-id="{{detailData.teacher_learn_section_id}}">
|
||||
<text>解锁</text>
|
||||
</view>
|
||||
<view class="footer active" wx:else>
|
||||
<text>已解锁</text>
|
||||
</view>
|
||||
</block>
|
||||
144
手太欠/优迪尔-小程序/pages/publicReview/index.wxss
Normal file
144
手太欠/优迪尔-小程序/pages/publicReview/index.wxss
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.classCont {
|
||||
border-bottom: 110rpx solid transparent;
|
||||
}
|
||||
|
||||
/* 視頻 */
|
||||
.reviewVideo {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.video_bg_black {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width: 100%;
|
||||
padding-top: 60%;
|
||||
position: relative;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.videoPlay{
|
||||
position: absolute;
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
top: calc(50% - 54rpx);
|
||||
left: calc(50% - 54rpx);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.video-video,
|
||||
.video-cover{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 视频内容 */
|
||||
.reviewCont {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.reviewLabel {
|
||||
border: 4rpx solid #daca73;
|
||||
border-radius: 20rpx;
|
||||
padding: 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.reviewLabel-title {
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.reviewLabel-chapter {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.reviewLabel-tips {
|
||||
font-size: 46rpx;
|
||||
text-align: center;
|
||||
color: rgb(247, 150, 70);
|
||||
margin: 50rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.reviewLabel-title image {
|
||||
width: 70rpx;
|
||||
height: 38rpx;
|
||||
vertical-align: -8rpx
|
||||
}
|
||||
|
||||
.reviewLabel-title text {
|
||||
padding: 0 60rpx;
|
||||
}
|
||||
|
||||
/* 只有教师端显示 */
|
||||
.reviewSort {
|
||||
display: flex;
|
||||
padding: 30rpx 0;
|
||||
background-color: #fff;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.reviewSort-label {
|
||||
flex: 4;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.reviewSort-img {
|
||||
width: 94rpx;
|
||||
height: 94rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* footer */
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
background: white;
|
||||
z-index: 9;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.footer text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
line-height: 80rpx;
|
||||
height: 80rpx;
|
||||
margin: 15rpx 0;
|
||||
text-align: center;
|
||||
background: #5572fe;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
border-radius: 10rpx
|
||||
}
|
||||
|
||||
.footer.active text {
|
||||
background: #d2d2d2;
|
||||
}
|
||||
270
手太欠/优迪尔-小程序/pages/register/index.js
Normal file
270
手太欠/优迪尔-小程序/pages/register/index.js
Normal file
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
codename : '获取验证码',
|
||||
showUser : false, //微信用户信息授权弹出层
|
||||
class_id : '', //班级ID
|
||||
mobileNo : '', //手机号
|
||||
code : '', //验证码
|
||||
nickname : '', //用户姓名
|
||||
school : '', //所在学校
|
||||
|
||||
//省份选择
|
||||
areas : [],
|
||||
areaSn : '',
|
||||
areaIndex : 0,
|
||||
|
||||
//市级选择
|
||||
cityList : [],
|
||||
cityId : 0,
|
||||
cityIndex : 0,
|
||||
|
||||
//区域选择
|
||||
regiList : [],
|
||||
regiId : 0,
|
||||
regiIndex : 0,
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.getProvince()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取省信息
|
||||
*/
|
||||
getProvince() {
|
||||
wx.$api.address.province('').then(res=>{
|
||||
let areaArr = res.data,
|
||||
areaIndex = this.data.areaIndex
|
||||
this.citylist(areaArr[areaIndex].code)
|
||||
this.setData({
|
||||
areaSn : areaArr[areaIndex].code,
|
||||
areas : areaArr
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
areasChange(e) {
|
||||
let area = this.data.areas,
|
||||
index = e.detail.value,
|
||||
atcode = area[index].code
|
||||
if (index != this.data.areaIndex) {
|
||||
this.setData({
|
||||
areaIndex : index,
|
||||
areaSn : atcode
|
||||
})
|
||||
|
||||
// 获取市级列表
|
||||
this.citylist(atcode)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 市级列表
|
||||
*/
|
||||
citylist(code) {
|
||||
wx.$api.address.province(code).then(res=>{
|
||||
let cityArr = res.data
|
||||
this.regilist(cityArr[0].code)
|
||||
this.setData({
|
||||
cityId : cityArr[0].code,
|
||||
cityList : cityArr,
|
||||
cityIndex : 0
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 市级下拉筛选
|
||||
*/
|
||||
city(e) {
|
||||
let city = this.data.cityList,
|
||||
index = e.detail.value,
|
||||
citycode = city[index].code
|
||||
if (index != this.data.areaIndex) {
|
||||
this.setData({
|
||||
cityIndex: index,
|
||||
cityId : citycode
|
||||
})
|
||||
|
||||
// 获取市级列表
|
||||
this.regilist(citycode)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 区列表
|
||||
*/
|
||||
regilist(areaCode) {
|
||||
wx.$api.address.province(areaCode).then(res=>{
|
||||
this.setData({
|
||||
regiList : res.data,
|
||||
regiId : res.data[0].code,
|
||||
regiIndex : 0
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 区下拉筛选
|
||||
*/
|
||||
regi(e) {
|
||||
let newIndex = e.detail.value
|
||||
this.setData({
|
||||
regiIndex : newIndex,
|
||||
regiId : this.data.regiList[newIndex].code
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* mobileNo
|
||||
*/
|
||||
getNameValue(e) {
|
||||
this.setData({
|
||||
mobileNo: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取code
|
||||
*/
|
||||
getCode(){
|
||||
let mobileNo = this.data.mobileNo
|
||||
wx.$api.auth.sms(mobileNo).then(res=>{
|
||||
wx.showToast({
|
||||
title : '发送成功',
|
||||
icon : 'success',
|
||||
duration: 2000
|
||||
})
|
||||
this.setData({
|
||||
iscode: res.data.data
|
||||
})
|
||||
var num = 61;
|
||||
var timer = setInterval(function () {
|
||||
num--;
|
||||
if (num <= 0) {
|
||||
clearInterval(timer);
|
||||
_this.setData({
|
||||
codename : '重新发送',
|
||||
disabled : false
|
||||
})
|
||||
|
||||
} else {
|
||||
_this.setData({
|
||||
codename : num + "s后重新获取",
|
||||
disabled : true
|
||||
})
|
||||
}
|
||||
}, 1000)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取后输入code
|
||||
*/
|
||||
getCodeValue (e) {
|
||||
this.setData({
|
||||
code: e.detail.value
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* register
|
||||
*/
|
||||
registers(e){
|
||||
let class_id = '714',
|
||||
mobileNo = e.detail.value.mobileNo,
|
||||
code = this.data.code,
|
||||
nickname = e.detail.value.nickname,
|
||||
province_id = this.data.areaSn,
|
||||
city_id = this.data.cityId,
|
||||
district_id = this.data.regiId,
|
||||
school = e.detail.value.school
|
||||
wx.$api.auth.register(class_id, mobileNo, code, nickname, province_id, city_id, district_id, school).then(res=>{
|
||||
// 存储登录信息
|
||||
wx.setStorageSync('token', res.data.access_token)
|
||||
// 更新全局状态
|
||||
getApp().globalData.token = res.data.access_token
|
||||
getApp().globalData.isUser = true
|
||||
let userData = res.data
|
||||
// 存储身份类型 type=1为学生 type=2为教师
|
||||
wx.setStorage({
|
||||
key: "status",
|
||||
data: userData.type,
|
||||
success: ()=> {
|
||||
// 关闭教育介绍-授权页
|
||||
this.setData({
|
||||
loginShow: false
|
||||
})
|
||||
// has_cover为假的时,弹出用户信息授权
|
||||
if(!userData.has_cover) {
|
||||
this.setData({
|
||||
showUser: true
|
||||
})
|
||||
return
|
||||
}
|
||||
// 根据不同身份跳转相关页面
|
||||
if(userData.type == 1) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/stuIndex/index'
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '/pages/teaIndex/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 微信用户信息授权
|
||||
*/
|
||||
getuserInfo(){
|
||||
wx.getUserProfile({
|
||||
desc : "获取你的昵称、头像、地区及性别",
|
||||
success : res => {
|
||||
if(res.errMsg == "getUserProfile:ok"){
|
||||
wx.$api.stuUsers.cover({
|
||||
value: res.userInfo.avatarUrl
|
||||
}).then(res=>{
|
||||
// 用户信息存入缓存
|
||||
const roleId = wx.getStorageSync('status')
|
||||
if(roleId == 1) {
|
||||
wx.redirectTo({
|
||||
url: '/pages/stuIndex/index'
|
||||
})
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: '/pages/teaIndex/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
//拒绝授权
|
||||
that.showErrorModal('您拒绝了请求');
|
||||
return;
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/register/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/register/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 注册"
|
||||
}
|
||||
63
手太欠/优迪尔-小程序/pages/register/index.wxml
Normal file
63
手太欠/优迪尔-小程序/pages/register/index.wxml
Normal file
@@ -0,0 +1,63 @@
|
||||
<view class="header">
|
||||
<image src="/static/img/loginLogo.jpg"></image>
|
||||
</view>
|
||||
|
||||
<form class="login-form" bindsubmit="registers">
|
||||
<view class="inputs">
|
||||
<input class="inputs-input" placeholder="请输入手机号" bindinput="getNameValue" value="{{mobileNo}}"
|
||||
name="mobileNo"></input>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<view class="inputs-code">
|
||||
<input class="inputs-input" placeholder="请输入验证码" bindinput="getCodeValue" value="{{code}}"></input>
|
||||
<button bindtap="getCode" disabled="{{disabled}}" hover-class="none">{{codename}}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input class="inputs-input" placeholder="请输入真是姓名" name="nickname"></input>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<picker bindchange="areasChange" value="{{areaIndex}}" range="{{areas}}" range-key="name">
|
||||
<view class="picker">
|
||||
{{areas[areaIndex].name}}
|
||||
</view>
|
||||
</picker>
|
||||
<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<picker bindchange="city" value="{{cityIndex}}" range="{{cityList}}" range-key="name" class="conneColor">
|
||||
<view class="picker">
|
||||
{{cityList[cityIndex].name}}
|
||||
</view>
|
||||
</picker>
|
||||
<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<picker bindchange="regi" value="{{regiIndex}}" range="{{regiList}}" range-key="name" class="conneColor">
|
||||
<view class="picker">
|
||||
{{regiList[regiIndex].name}}
|
||||
</view>
|
||||
</picker>
|
||||
<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
<view class="inputs">
|
||||
<input class="inputs-input" placeholder="所在学校" name="school"></input>
|
||||
</view>
|
||||
<button class="login-btn" size="default" form-type="submit">立即注册</button>
|
||||
</form>
|
||||
|
||||
<!-- 微信用户信息授权 -->
|
||||
<view class="empowerBack" wx:if="{{showUser}}"></view>
|
||||
<view class="empowerCont" wx:if="{{showUser}}">
|
||||
<view class='headView'>
|
||||
<view class='headImageView'>
|
||||
<image class='headImage' src="/static/img/header-logo.png" mode='scaleToFill'></image>
|
||||
</view>
|
||||
<view class='titleText'>优迪尔申请获取以下权限</view>
|
||||
<view class='contentText'>{{needMobile ? '获得你的微信手机号' : '获得你的公开信息(昵称,头像)'}}</view>
|
||||
<view class="empowerBtn">
|
||||
<view class="empowerBtn-cancel" bindtap="cancelBtn">取消</view>
|
||||
<button hover-class="none" class="authBtn" bindtap="getuserInfo"> 授权获取头像昵称 </button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
210
手太欠/优迪尔-小程序/pages/register/index.wxss
Normal file
210
手太欠/优迪尔-小程序/pages/register/index.wxss
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin: 50px 0;
|
||||
}
|
||||
.header image {
|
||||
width: 180px;
|
||||
height: 68px;
|
||||
}
|
||||
|
||||
|
||||
/* form */
|
||||
.login-form {
|
||||
padding: 0 100rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
margin-bottom: 30rpx;
|
||||
border: solid 1rpx #eee;
|
||||
border-radius: 60rpx;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inputs-input,
|
||||
.inputs-view {
|
||||
line-height: 90rpx;
|
||||
height: 90rpx;
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.inputs image {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
top: calc(50% - 19rpx);
|
||||
}
|
||||
|
||||
.login-btn[size="default"] {
|
||||
background: #546fe3;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 45rpx;
|
||||
padding: 0;
|
||||
margin: 60rpx 0 20rpx;
|
||||
color: white;
|
||||
width: 100%;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.inputs-code {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.inputs-code button {
|
||||
text-align: right;
|
||||
background: transparent;
|
||||
font-size: 28rpx;
|
||||
line-height: 90rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
color: #ff9954;
|
||||
}
|
||||
|
||||
/* 地址选择 */
|
||||
|
||||
.pickerView-back {
|
||||
background: rgba(0, 0, 0, .3);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pickerView-back.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.pickerView-layer {
|
||||
position: fixed;
|
||||
bottom: -571rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: white;
|
||||
transition: all .3s;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.pickerView-layer.active {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.pickerView-btn {
|
||||
line-height: 90rpx;
|
||||
font-size: 30rpx;
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.pickerView {
|
||||
height: 480rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.pickerView-name {
|
||||
line-height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pickerView-mask {
|
||||
border-top: solid 1rpx #e4e6f2;
|
||||
}
|
||||
|
||||
.pickerView-indicator {
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.pickerView-determine {
|
||||
color: #3ec28e;
|
||||
}
|
||||
|
||||
.pickerView-cancel {
|
||||
color: #747788;
|
||||
}
|
||||
|
||||
|
||||
/* 微信用户信息弹出 */
|
||||
.empowerBack {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background: rgba(0, 0, 0, .6);
|
||||
}
|
||||
|
||||
.empowerCont {
|
||||
position: fixed;
|
||||
left: 100rpx;
|
||||
right: 100rpx;
|
||||
background-color: #fff;
|
||||
z-index: 101;
|
||||
top: 25%;
|
||||
border-radius: 10rpx;
|
||||
padding: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.headView {
|
||||
color: #4e4e4e;
|
||||
}
|
||||
|
||||
.headImageView {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin: 0 auto 40rpx;
|
||||
}
|
||||
|
||||
.headImage {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.contentText {
|
||||
margin: 20rpx 0 40rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.empowerBtn {
|
||||
display: flex;
|
||||
float: right;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.authBtn {
|
||||
width: auto !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
display: inline-block;
|
||||
height: auto;
|
||||
line-height: 40rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: normal;
|
||||
color: #fd4c44;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.empowerBtn-cancel {
|
||||
font-size: 32rpx;
|
||||
display: inline-block;
|
||||
line-height: 40rpx;
|
||||
margin: 0 40rpx;
|
||||
}
|
||||
79
手太欠/优迪尔-小程序/pages/stuIndex/index.js
Normal file
79
手太欠/优迪尔-小程序/pages/stuIndex/index.js
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
uesrData : '', //用户信息
|
||||
listArr : [], //课程服务列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 去掉home导航
|
||||
wx.hideHomeButton()
|
||||
|
||||
// 获取首页列表
|
||||
this.listInfo();
|
||||
|
||||
// 获取用户信息
|
||||
this.uesrInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 学生端-用户信息
|
||||
*/
|
||||
uesrInfo() {
|
||||
wx.$api.stuUsers.index().then(res=>{
|
||||
this.setData({
|
||||
uesrData: res.data
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 首页列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
wx.$api.stuIndex.index(page).then(res=>{
|
||||
let serviceArr = this.data.listArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) serviceArr = []
|
||||
newData = serviceArr.concat(res.data.data)
|
||||
this.setData({
|
||||
listArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.listInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
3
手太欠/优迪尔-小程序/pages/stuIndex/index.json
Normal file
3
手太欠/优迪尔-小程序/pages/stuIndex/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
45
手太欠/优迪尔-小程序/pages/stuIndex/index.wxml
Normal file
45
手太欠/优迪尔-小程序/pages/stuIndex/index.wxml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!-- 头部 -->
|
||||
<view class="stuTop">
|
||||
<image class="stuTop-back" src="/static/img/studentIndex.jpg"></image>
|
||||
<view class="stuTop-cont">
|
||||
<image class="stuTop-head" src="{{uesrData.cover}}"></image>
|
||||
<view class="stuTop-text">
|
||||
<view class="nowrap stuTop-name">{{uesrData.nickname}}</view>
|
||||
<view class="nowrap stuTop-tips">班主任:{{uesrData.parent}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view class="spaceTabar">
|
||||
<view class="stuFoot" wx:if="{{listArr.length > 0}}">
|
||||
<navigator hover-class="none" url="/pages/publicCourse/index?type=stu&levelid={{item.level_id}}"
|
||||
class="uni-border-down stuList" wx:for="{{listArr}}" wx:key="listArr">
|
||||
<view class="stuList-icon">
|
||||
<image src="/static/img/stuList_icon_play.png"></image>
|
||||
</view>
|
||||
<view class="stuList-cont">
|
||||
<view class="nowrap stuList-name">{{item.title}}</view>
|
||||
<view class="stuList-more">查看课程<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部菜单 -->
|
||||
<userTabBar atPagesUrl="/pages/stuIndex/index"></userTabBar>
|
||||
108
手太欠/优迪尔-小程序/pages/stuIndex/index.wxss
Normal file
108
手太欠/优迪尔-小程序/pages/stuIndex/index.wxss
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
|
||||
/* 头部 */
|
||||
.stuTop {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 260rpx;
|
||||
}
|
||||
|
||||
.stuTop-back {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.stuTop-cont {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
color: #fff;
|
||||
top: 70rpx;
|
||||
left: 0;
|
||||
padding-left: 40rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.stuTop-cont .stuTop-head {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
border: 6rpx solid #79aaf0;
|
||||
box-sizing: border-box;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.stuTop-text {
|
||||
width: calc(100% - 260rpx);
|
||||
}
|
||||
|
||||
.stuTop-text .stuTop-name {
|
||||
font-size: 38rpx;
|
||||
margin: 10rpx 0 15rpx;
|
||||
}
|
||||
|
||||
.stuTop-text .stuTop-tips {
|
||||
color: #c8d9ff;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.stuFoot {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.stuList {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.stuList .stuList-icon {
|
||||
background-color: #f13a26;
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.stuList .stuList-icon image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-cont {
|
||||
position: absolute;
|
||||
padding: 30rpx 30rpx 30rpx 110rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.stuList .stuList-name {
|
||||
flex: 1;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-more {
|
||||
display: flex;
|
||||
color: #a5a5a5;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.stuList .stuList-more image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin: 12rpx 0 0 10rpx;
|
||||
}
|
||||
66
手太欠/优迪尔-小程序/pages/stuUser/index.js
Normal file
66
手太欠/优迪尔-小程序/pages/stuUser/index.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
uesrData: '', //用户信息
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 去掉home导航
|
||||
wx.hideHomeButton()
|
||||
|
||||
// 获取用户信息
|
||||
this.uesrInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 学生端-用户信息
|
||||
*/
|
||||
uesrInfo() {
|
||||
wx.$api.stuUsers.index().then(res=>{
|
||||
this.setData({
|
||||
uesrData: res.data
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
login() {
|
||||
wx.showModal({
|
||||
title : '退出登录',
|
||||
content : '是否确定退出登录',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
// 更新全局状态
|
||||
getApp().globalData.token = ''
|
||||
getApp().globalData.isUser = false
|
||||
wx.clearStorage({
|
||||
success: res=>{
|
||||
// 返回登录
|
||||
wx.reLaunch({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/stuUser/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/stuUser/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 我的"
|
||||
}
|
||||
27
手太欠/优迪尔-小程序/pages/stuUser/index.wxml
Normal file
27
手太欠/优迪尔-小程序/pages/stuUser/index.wxml
Normal file
@@ -0,0 +1,27 @@
|
||||
<view class="uni-border-down userTop">
|
||||
<image class="userTop-img" src="{{uesrData.cover}}" mode="aspectFill"></image>
|
||||
<view class="userTop-cont">
|
||||
<view class="userTop-name">{{uesrData.nickname}}</view>
|
||||
<view class="userTop-teacher">班主任:{{uesrData.parent}}</view>
|
||||
<view class="userTop-class">班级:{{uesrData.classMate}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<navigator hover-class="none" url="/pages/userSetting/index" class="uni-border-down userTool">
|
||||
<image class="userTool-icon" src="/static/img/myIcon_00.png"></image>
|
||||
<view class="userTool-cont">
|
||||
<view class="userTool-name">个人设置</view>
|
||||
<image class="userTool-img" src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
<view class="userTool" bindtap="login">
|
||||
<image class="userTool-icon" src="/static/img/myIcon_05.png"></image>
|
||||
<view class="userTool-cont">
|
||||
<view class="userTool-name">退出登录</view>
|
||||
<image class="userTool-img" src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部菜单 -->
|
||||
<userTabBar atPagesUrl="/pages/stuUser/index"></userTabBar>
|
||||
72
手太欠/优迪尔-小程序/pages/stuUser/index.wxss
Normal file
72
手太欠/优迪尔-小程序/pages/stuUser/index.wxss
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.userTop {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.userTop-img {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
border: 2rpx solid #e4e4e4;
|
||||
}
|
||||
|
||||
.userTop-cont {
|
||||
width: calc(100% - 160rpx);
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.userTop-name {
|
||||
color: #000;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.userTop-teacher {
|
||||
margin: 15rpx 0;
|
||||
}
|
||||
|
||||
/* 工具 */
|
||||
.userTool {
|
||||
padding: 20rpx 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 90rpx;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.userTool-cont {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 20rpx 30rpx 20rpx 100rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.userTool-name {
|
||||
flex: 1;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.userTool-img {
|
||||
width: 34rpx;
|
||||
height: 34rpx;
|
||||
opacity: .5;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.userTool-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
61
手太欠/优迪尔-小程序/pages/teaActivity-details/index.js
Normal file
61
手太欠/优迪尔-小程序/pages/teaActivity-details/index.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
isShow : false, //视频展示
|
||||
detailData : '', //活动数据
|
||||
content : '', //活动详情
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
// 活动列表
|
||||
this.detailInfo(options.activeId);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
detailInfo(id) {
|
||||
wx.$api.teaIndex.detailed(id).then(res=>{
|
||||
this.setData({
|
||||
detailData : res.data,
|
||||
content : res.data.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"'),
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// bindplay() {
|
||||
// this.setData({
|
||||
// isShow: !this.data.isShow
|
||||
// })
|
||||
// },
|
||||
|
||||
/**
|
||||
* 播放
|
||||
*/
|
||||
videoPlay(){
|
||||
this.setData({
|
||||
isShow: true
|
||||
})
|
||||
let videoContext = wx.createVideoContext("video")
|
||||
videoContext.play()
|
||||
// videoContext.requestFullScreen()
|
||||
},
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaActivity-details/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaActivity-details/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 详情"
|
||||
}
|
||||
29
手太欠/优迪尔-小程序/pages/teaActivity-details/index.wxml
Normal file
29
手太欠/优迪尔-小程序/pages/teaActivity-details/index.wxml
Normal file
@@ -0,0 +1,29 @@
|
||||
<view class="reviewVideo">
|
||||
<view class='wrapper'>
|
||||
<video class='video-video' wx:if='{{isShow}}' autoplay="{{true}}" id='video' src='{{detailData.path}}'></video>
|
||||
<image class='video-cover' wx:if='{{!isShow}}' mode='aspectFill' src='{{detailData.cover}}'></image>
|
||||
<view class="video_bg_black" wx:if='{{!isShow}}'></view>
|
||||
<image class='videoPlay' wx:if='{{!isShow}}' bindtap='videoPlay' src='/static/img/videoIcon.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="activityDet">
|
||||
<view class="nowrap activityList-title">{{detailData.title}}</view>
|
||||
<view class="activityList-time">
|
||||
<image src="/static/img/activityTime.png"></image> {{detailData.startd_at}} - {{detailData.ended_at}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="activityDet" wx:if="{{detailData.description}}">
|
||||
<view class="activityList-title">活动简介</view>
|
||||
<view class="activityDet-des">
|
||||
{{detailData.description}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="activityDet">
|
||||
<view class="uni-border-down activityList-title">活动详情</view>
|
||||
<view class="activityDet-cont">
|
||||
<rich-text nodes="{{content}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
84
手太欠/优迪尔-小程序/pages/teaActivity-details/index.wxss
Normal file
84
手太欠/优迪尔-小程序/pages/teaActivity-details/index.wxss
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 視頻 */
|
||||
.reviewVideo {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.video_bg_black {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
.wrapper{
|
||||
width: 100%;
|
||||
padding-top: 60%;
|
||||
position: relative;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.videoPlay{
|
||||
position: absolute;
|
||||
width: 108rpx;
|
||||
height: 108rpx;
|
||||
top: calc(50% - 54rpx);
|
||||
left: calc(50% - 54rpx);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.video-video,
|
||||
.video-cover{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 详情 */
|
||||
.activityList-time {
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
line-height: 34rpx;
|
||||
padding: 0 30rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.activityList-time image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.activityDet {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.activityList-title,
|
||||
.activityDet-cont,
|
||||
.activityDet-des {
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.activityDet-des {
|
||||
font-size: 28rpx;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.activityList-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.activityDet-cont {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
69
手太欠/优迪尔-小程序/pages/teaActivity-list/index.js
Normal file
69
手太欠/优迪尔-小程序/pages/teaActivity-list/index.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
activityData: [], //活动列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
activityId : '', //活动列表id
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
activityId: options.categoryId
|
||||
})
|
||||
|
||||
// 活动列表
|
||||
this.listInfo();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {},
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
wx.$api.teaIndex.activity(this.data.activityId, page).then(res=>{
|
||||
let activityArr = this.data.activityData,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) activityArr = []
|
||||
newData = activityArr.concat(res.data.data)
|
||||
|
||||
this.setData({
|
||||
activityData: newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.listInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaActivity-list/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaActivity-list/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 活动列表"
|
||||
}
|
||||
23
手太欠/优迪尔-小程序/pages/teaActivity-list/index.wxml
Normal file
23
手太欠/优迪尔-小程序/pages/teaActivity-list/index.wxml
Normal file
@@ -0,0 +1,23 @@
|
||||
<view class="activity" wx:if="{{activityData.length > 0}}">
|
||||
<!-- 列表 -->
|
||||
<navigator wx:for="{{activityData}}" wx:key="activityData" hover-class="none" url="/pages/teaActivity-details/index?activeId={{item.active_id}}" class="activityList">
|
||||
<view class="nowrap activityList-title">{{item.title}}</view>
|
||||
<view class="activityList-time"><image src="/static/img/activityTime.png"></image> {{item.startd_at}} - {{item.ended_at}}</view>
|
||||
<view class="activityList-img"><image src="{{item.cover}}" mode="aspectFill"></image></view>
|
||||
</navigator>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
41
手太欠/优迪尔-小程序/pages/teaActivity-list/index.wxss
Normal file
41
手太欠/优迪尔-小程序/pages/teaActivity-list/index.wxss
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
.activityList {
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.activityList-time {
|
||||
margin: 20rpx 0;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
line-height: 34rpx;
|
||||
}
|
||||
|
||||
.activityList-time image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.activityList-img {
|
||||
width: 100%;
|
||||
padding-top: 50%;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.activityList-img image {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
69
手太欠/优迪尔-小程序/pages/teaActivity/index.js
Normal file
69
手太欠/优迪尔-小程序/pages/teaActivity/index.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
serviceData : [], //课程服务列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
listId : '', //列表id
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
listId: options.categoryId
|
||||
})
|
||||
|
||||
// 获取活动列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
wx.$api.teaIndex.index(this.data.listId, page).then(res=>{
|
||||
let serviceArr = this.data.serviceData,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) serviceArr = []
|
||||
newData = serviceArr.concat(res.data.data)
|
||||
|
||||
this.setData({
|
||||
serviceData : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.listInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaActivity/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaActivity/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 活动列表"
|
||||
}
|
||||
28
手太欠/优迪尔-小程序/pages/teaActivity/index.wxml
Normal file
28
手太欠/优迪尔-小程序/pages/teaActivity/index.wxml
Normal file
@@ -0,0 +1,28 @@
|
||||
<view class="teaActivity" wx:if="{{serviceData.length > 0}}">
|
||||
<!-- 列表 -->
|
||||
<navigator wx:for="{{serviceData}}" wx:key="serviceData" hover-class="none" url="/pages/teaActivity-list/index?categoryId={{item.category_id}}" class="uni-border-down activityList">
|
||||
<view class="activityList-icon {{stateType == 'class' ? '' : 'active'}}">
|
||||
<image src="{{stateType == 'class' ? '/static/img/stuList_icon_play.png' : '/static/img/stuList_icon_back.png'}}"></image>
|
||||
</view>
|
||||
<view class="activityList-cont">
|
||||
<view class="nowrap activityList-name">{{item.title}}</view>
|
||||
<view class="activityList-more">查看活动<image src="/static/img/stuList_row.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
59
手太欠/优迪尔-小程序/pages/teaActivity/index.wxss
Normal file
59
手太欠/优迪尔-小程序/pages/teaActivity/index.wxss
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 列表 */
|
||||
.teaActivity {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.activityList {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.activityList-icon {
|
||||
background-color: #3185fe;
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.activityList-icon image {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.activityList-cont {
|
||||
position: absolute;
|
||||
padding: 30rpx 30rpx 30rpx 110rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 54rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.activityList-name {
|
||||
flex: 1;
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
.activityList-more {
|
||||
display: flex;
|
||||
color: #a5a5a5;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.activityList-more image {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin: 12rpx 0 0 10rpx;
|
||||
}
|
||||
61
手太欠/优迪尔-小程序/pages/teaClass-build/index.js
Normal file
61
手太欠/优迪尔-小程序/pages/teaClass-build/index.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //build为搭建图 lesson为课程教案
|
||||
extralId : '', //详情id
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
console.log(options)
|
||||
if (options.type == 'build') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 搭建图'
|
||||
})
|
||||
} else if (options.type == 'lesson') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 课程教案'
|
||||
})
|
||||
}
|
||||
|
||||
this.setData({
|
||||
dataType: options.type,
|
||||
extralId: options.id
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 获取详情数据
|
||||
this.extralInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 详情数据
|
||||
*/
|
||||
extralInfo() {
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
// 课程教案接口
|
||||
if(this.data.dataType == 'lesson') dataUrl = wx.$api.teaIndex.extralPlan(this.data.extralId)
|
||||
// 搭建图接口
|
||||
if(this.data.dataType == 'build') dataUrl = wx.$api.teaIndex.extralArch(this.data.extralId)
|
||||
|
||||
dataUrl.then(res=>{
|
||||
this.setData({
|
||||
extralata : res.data.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block;"')
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaClass-build/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaClass-build/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
11
手太欠/优迪尔-小程序/pages/teaClass-build/index.wxml
Normal file
11
手太欠/优迪尔-小程序/pages/teaClass-build/index.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<view class="buildLabel">
|
||||
<view class="buildLabel-title">
|
||||
<view class="buildLabel-title-name">{{dataType == 'build' ? '搭建图' : '课程教案'}}</view>
|
||||
</view>
|
||||
<!-- <view class="buildLabel-tips" wx:if="{{dataType == 'build'}}">
|
||||
拱桥步骤图
|
||||
</view> -->
|
||||
<view class="buildLabel-img">
|
||||
<rich-text nodes="{{extralata}}"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
41
手太欠/优迪尔-小程序/pages/teaClass-build/index.wxss
Normal file
41
手太欠/优迪尔-小程序/pages/teaClass-build/index.wxss
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.buildLabel {
|
||||
padding: 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-weight: 600;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.buildLabel-tips {
|
||||
font-size: 46rpx;
|
||||
text-align: center;
|
||||
color: rgb(247, 150, 70);
|
||||
margin: 50rpx 0 30rpx;
|
||||
}
|
||||
|
||||
.buildLabel-title {
|
||||
display: flex;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.buildLabel-title-name {
|
||||
position: relative;
|
||||
padding-left: 25rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.buildLabel-title-name::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 8rpx;
|
||||
height: 30rpx;
|
||||
background-color: #2170f1;
|
||||
border-radius: 20rpx;
|
||||
left: 0;
|
||||
top: 7rpx;
|
||||
}
|
||||
43
手太欠/优迪尔-小程序/pages/teaClass-details/index.js
Normal file
43
手太欠/优迪尔-小程序/pages/teaClass-details/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
classId : '', //班级id
|
||||
classData :'', //班级详情
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
classId : options.id
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 获取班级详情
|
||||
this.classInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 班级详情
|
||||
*/
|
||||
classInfo() {
|
||||
wx.$api.teaIndex.gradesDet(this.data.classId).then(res=>{
|
||||
this.setData({
|
||||
classData: res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaClass-details/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaClass-details/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 班级详情"
|
||||
}
|
||||
65
手太欠/优迪尔-小程序/pages/teaClass-details/index.wxml
Normal file
65
手太欠/优迪尔-小程序/pages/teaClass-details/index.wxml
Normal file
@@ -0,0 +1,65 @@
|
||||
<view class="classDet">
|
||||
<image class="classBack" src="/static/img/classShow_back.png" mode="aspectFill"></image>
|
||||
<view class="classCont">
|
||||
<view class="classWhite">
|
||||
<view class="classOne-lable">
|
||||
<view class="classOne-lable-img">
|
||||
<image src="/static/img/teaCalss_00.png"></image>
|
||||
</view>
|
||||
<view class="classOne-lable-text">
|
||||
<view class="classOne-lable-name">班级名称</view>
|
||||
<view class="classOne-lable-tips">{{classData.base.title}}</view>
|
||||
</view>
|
||||
<navigator url="/pages/teaClass-form/index?type=edit&id={{classData.base.class_id}}&title={{classData.base.title}}"><image class="classOne-lable-edit" src="/static/img/class-edit.png"></image></navigator>
|
||||
</view>
|
||||
<view class="classOne-lable">
|
||||
<view class="classOne-lable-img">
|
||||
<image src="/static/img/teaCalss_01.png"></image>
|
||||
</view>
|
||||
<view class="classOne-lable-text">
|
||||
<view class="classOne-lable-name">主管教师</view>
|
||||
<view class="classOne-lable-tips">{{classData.base.teacherName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classOne-lable">
|
||||
<view class="classOne-lable-img">
|
||||
<image src="/static/img/teaCalss_02.png"></image>
|
||||
</view>
|
||||
<view class="classOne-lable-text">
|
||||
<view class="classOne-lable-name">学员总数</view>
|
||||
<view class="classOne-lable-tips">{{classData.base.studentCount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classOne-lable">
|
||||
<view class="classOne-lable-img">
|
||||
<image src="/static/img/teaCalss_03.png"></image>
|
||||
</view>
|
||||
<view class="classOne-lable-text">
|
||||
<view class="classOne-lable-name">创建时间</view>
|
||||
<view class="classOne-lable-tips">{{classData.base.created_at}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classWhite" wx:if="{{classData.students.length > 0}}">
|
||||
<view class="classTwo-title">
|
||||
<view class="classTwo-title-name">班级学生</view>
|
||||
<navigator hover-class="none" url="/pages/teaStudent-list/index?id={{classData.base.class_id}}" class="classTwo-title-more">查看更多</navigator>
|
||||
</view>
|
||||
<view class="classTwo-list">
|
||||
<navigator hover-class="none" url="/pages/teaStudent-details/index?id={{item.student_id}}" class="classTwo-list-label" wx:for="{{classData.students}}" wx:key="students" wx:if="{{index < 5}}">
|
||||
<image class="classTwo-list-head" src="{{item.cover}}" mode="aspectFill"></image>
|
||||
<view class="nowrap classTwo-list-name">{{item.nickname}}</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="classThree" wx:if="{{classData.is_close_qrcode != 1}}">
|
||||
<image class="classThree-back" src="/static/img/classShow_code.png"></image>
|
||||
<image class="classThree-code" src="{{classData.qrcode}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 课后复习 -->
|
||||
<view class="footer">
|
||||
<navigator url="/pages/teaSchool/index?id={{classData.base.class_id}}">课后复习</navigator>
|
||||
</view>
|
||||
192
手太欠/优迪尔-小程序/pages/teaClass-details/index.wxss
Normal file
192
手太欠/优迪尔-小程序/pages/teaClass-details/index.wxss
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.classDet {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.classBack {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.classCont {
|
||||
position: absolute;
|
||||
left: 40rpx;
|
||||
right: 40rpx;
|
||||
top: 400rpx;
|
||||
z-index: 9;
|
||||
border-bottom: 110rpx solid transparent;
|
||||
}
|
||||
|
||||
.classWhite {
|
||||
background-color: white;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 0 20rpx rgba(85, 114, 254,.2);
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.classOne-lable {
|
||||
position: relative;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.classOne-lable:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.classOne-lable-text {
|
||||
position: absolute;
|
||||
padding: 0 0 0 70rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.classOne-lable-name {
|
||||
width: 140rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.classOne-lable-tips {
|
||||
width: calc(100% - 140rpx);
|
||||
padding: 10rpx 60rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.classOne-lable-img {
|
||||
background: #effbf2;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
padding: 12rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.classOne-lable-img image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.classOne-lable-edit {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 8rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
/* 班级学生 */
|
||||
.classTwo-title {
|
||||
display: flex;
|
||||
line-height: 30rpx;
|
||||
}
|
||||
|
||||
.classTwo-title-name {
|
||||
position: relative;
|
||||
padding-left: 25rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.classTwo-title-name::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 8rpx;
|
||||
height: 30rpx;
|
||||
background-color: #2170f1;
|
||||
border-radius: 20rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.classTwo-title-more {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.classTwo-list {
|
||||
display: flex;
|
||||
font-size: 26rpx;
|
||||
text-align: center;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.classTwo-list-label {
|
||||
margin-right: 50rpx;
|
||||
color: #9c9c9c;
|
||||
}
|
||||
|
||||
.classTwo-list-head {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 50%;
|
||||
margin: 0 auto 10rpx;
|
||||
}
|
||||
|
||||
/* 二维码 */
|
||||
.classThree {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-top: 90%;
|
||||
margin-bottom: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 0 20rpx rgba(85, 114, 254,.2);
|
||||
}
|
||||
|
||||
.classThree-back {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 2;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.classThree-code {
|
||||
position: absolute;
|
||||
width: 50%;
|
||||
height: 50%;
|
||||
top: 28%;
|
||||
left: 25%;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
|
||||
/* footer */
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
background: white;
|
||||
z-index: 9;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.footer navigator {
|
||||
width: 100%;
|
||||
line-height: 80rpx;
|
||||
height: 80rpx;
|
||||
margin: 15rpx 0;
|
||||
text-align: center;
|
||||
background: #5572fe;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
border-radius: 10rpx
|
||||
}
|
||||
58
手太欠/优迪尔-小程序/pages/teaClass-form/index.js
Normal file
58
手太欠/优迪尔-小程序/pages/teaClass-form/index.js
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
dataType : '', //new为新开班 edit为修改班级名称
|
||||
class : {
|
||||
classname : '', //班级名称
|
||||
classId : '', //班级id
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
dataType : options.type,
|
||||
['class.classId'] : options.id,
|
||||
['class.classname'] : options.title
|
||||
})
|
||||
if (options.type == 'new') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 新开班'
|
||||
})
|
||||
} else if (options.type == 'edit') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 修改名称'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 班级名称修改提交
|
||||
*/
|
||||
uploadFile(e) {
|
||||
let state = this.data.dataType,
|
||||
title = e.detail.value.title,
|
||||
id = this.data.class.classId
|
||||
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
if(state == 'edit') dataUrl = wx.$api.teaIndex.classPut(id,title)// edit为修改班级名称
|
||||
if(state == 'new') dataUrl = wx.$api.teaIndex.gradesAdd(title)// new为新开班
|
||||
|
||||
dataUrl.then(res=>{
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
3
手太欠/优迪尔-小程序/pages/teaClass-form/index.json
Normal file
3
手太欠/优迪尔-小程序/pages/teaClass-form/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
13
手太欠/优迪尔-小程序/pages/teaClass-form/index.wxml
Normal file
13
手太欠/优迪尔-小程序/pages/teaClass-form/index.wxml
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- 表单 -->
|
||||
<form bindsubmit="uploadFile">
|
||||
<view class="form">
|
||||
<image class="form-img" src="/static/img/classForm-icon.png"></image>
|
||||
<view class="form-input">
|
||||
<label class="form-input-label">班级名称:</label>
|
||||
<input placeholder="班级名称" value="{{class.classname}}" name="title"></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class="form-btn">
|
||||
<button form-type="submit">保存</button>
|
||||
</view>
|
||||
</form>
|
||||
72
手太欠/优迪尔-小程序/pages/teaClass-form/index.wxss
Normal file
72
手太欠/优迪尔-小程序/pages/teaClass-form/index.wxss
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 表单 */
|
||||
.form {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
height: 130rpx;
|
||||
}
|
||||
|
||||
.form-img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 30rpx 30rpx 30rpx 90rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.form-input-label {
|
||||
width: 180rpx;
|
||||
}
|
||||
|
||||
.form-input input {
|
||||
border: 2rpx solid #d5d5d5;
|
||||
width: calc(100% - 180rpx);
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
height: 74rpx;
|
||||
line-height: 74rpx;
|
||||
}
|
||||
|
||||
/* footer */
|
||||
.form-btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
background: white;
|
||||
z-index: 9;
|
||||
height: 110rpx;
|
||||
}
|
||||
|
||||
.form-btn button {
|
||||
width: 100% !important;
|
||||
padding: 0;
|
||||
line-height: 80rpx;
|
||||
display: block;
|
||||
height: 80rpx;
|
||||
margin: 15rpx 0;
|
||||
text-align: center;
|
||||
background: #e53134;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
border-radius: 10rpx
|
||||
}
|
||||
70
手太欠/优迪尔-小程序/pages/teaClass-select/index.js
Normal file
70
手太欠/优迪尔-小程序/pages/teaClass-select/index.js
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaClass-select/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaClass-select/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 选择班级"
|
||||
}
|
||||
10
手太欠/优迪尔-小程序/pages/teaClass-select/index.wxml
Normal file
10
手太欠/优迪尔-小程序/pages/teaClass-select/index.wxml
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- 列表 -->
|
||||
<view class="selectFoot">
|
||||
<view class="uni-border-down selectList">
|
||||
<view class="selectList-icon">C</view>
|
||||
<view class="selectList-cont">
|
||||
<view class="nowrap selectList-name">23</view>
|
||||
<view class="selectList-more">已解锁</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
50
手太欠/优迪尔-小程序/pages/teaClass-select/index.wxss
Normal file
50
手太欠/优迪尔-小程序/pages/teaClass-select/index.wxss
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 列表 */
|
||||
.selectFoot {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.selectList {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.selectList-icon {
|
||||
background-color: #f13a26;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 8rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.selectList-cont {
|
||||
position: absolute;
|
||||
padding: 30rpx 30rpx 30rpx 90rpx;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 40rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.selectList-name {
|
||||
flex: 1;
|
||||
margin-right: 40rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.selectList-more {
|
||||
color: #3c90ce;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
97
手太欠/优迪尔-小程序/pages/teaClass/index.js
Normal file
97
手太欠/优迪尔-小程序/pages/teaClass/index.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
gradeData : [], //班级列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false, //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
// 去掉home导航
|
||||
wx.hideHomeButton()
|
||||
|
||||
// 获取班级列表
|
||||
this.gradeInfo();
|
||||
},
|
||||
/**
|
||||
* 班级列表
|
||||
*/
|
||||
gradeInfo(page) {
|
||||
wx.$api.teaIndex.grades(page).then(res=>{
|
||||
let courseArr = this.data.gradeData,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) courseArr = []
|
||||
newData = courseArr.concat(res.data.data)
|
||||
|
||||
this.setData({
|
||||
gradeData : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 班级删除
|
||||
*/
|
||||
gradeRemove(e){
|
||||
let id = e.target.dataset.id,
|
||||
index = e.target.dataset.index,
|
||||
list = this.data.gradeData
|
||||
|
||||
list.splice(index,1)
|
||||
|
||||
wx.showModal({
|
||||
title : '提示',
|
||||
content : '是否删除班级',
|
||||
success : res=> {
|
||||
if (res.confirm) {
|
||||
wx.showLoading({
|
||||
title: '删除中',
|
||||
})
|
||||
wx.$api.teaIndex.remove(id).then(res=>{
|
||||
this.setData({
|
||||
gradeData: list
|
||||
})
|
||||
wx.showToast({
|
||||
title: res.data,
|
||||
icon : "none"
|
||||
})
|
||||
wx.hideLoading()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.gradeInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaClass/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaClass/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 班级"
|
||||
}
|
||||
30
手太欠/优迪尔-小程序/pages/teaClass/index.wxml
Normal file
30
手太欠/优迪尔-小程序/pages/teaClass/index.wxml
Normal file
@@ -0,0 +1,30 @@
|
||||
<view class="spaceTabar">
|
||||
<view class="classCont" wx:if="{{gradeData.length > 0}}">
|
||||
<view class="classList" wx:for="{{gradeData}}" wx:key="gradeData" wx:for-index="gradeIndex">
|
||||
<navigator hover-class="none" url="/pages/teaClass-details/index?id={{item.class_id}}">
|
||||
<view class="classList-title"><text class="nowrap">{{item.title}}</text></view>
|
||||
<view class="classList-cont">
|
||||
<view class="nowrap classList-text">优迪尔教育 · 学生{{item.studentCount}}人</view>
|
||||
<view class="classList-tips">状态:{{item.state_text}}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="classList-del" data-id="{{item.class_id}}" data-index="{{gradeIndex}}" bindtap="gradeRemove">删除
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 下拉加载 -->
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/img/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<userTabBar atPagesUrl="/pages/teaClass/index"></userTabBar>
|
||||
71
手太欠/优迪尔-小程序/pages/teaClass/index.wxss
Normal file
71
手太欠/优迪尔-小程序/pages/teaClass/index.wxss
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
.classCont {
|
||||
margin: 30rpx;
|
||||
}
|
||||
|
||||
.classList {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 0 20rpx rgba(0,0,0,.15);
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.classList-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
position: relative;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.classList-title text {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.classList-title::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 80rpx;
|
||||
height: 12rpx;
|
||||
background: #f9dd58;
|
||||
}
|
||||
|
||||
.classList-cont {
|
||||
width: calc(100% - 200rpx);
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.classList-text {
|
||||
margin: 30rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.classList-tips {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.classList-del {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 90rpx;
|
||||
background-color: #f86b6b;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
width: 120rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
70
手太欠/优迪尔-小程序/pages/teaDetails/index.js
Normal file
70
手太欠/优迪尔-小程序/pages/teaDetails/index.js
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
3
手太欠/优迪尔-小程序/pages/teaDetails/index.json
Normal file
3
手太欠/优迪尔-小程序/pages/teaDetails/index.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
||||
2
手太欠/优迪尔-小程序/pages/teaDetails/index.wxml
Normal file
2
手太欠/优迪尔-小程序/pages/teaDetails/index.wxml
Normal file
@@ -0,0 +1,2 @@
|
||||
<!--pages/teaDetails/index.wxml-->
|
||||
<text>pages/teaDetails/index.wxml</text>
|
||||
4
手太欠/优迪尔-小程序/pages/teaDetails/index.wxss
Normal file
4
手太欠/优迪尔-小程序/pages/teaDetails/index.wxss
Normal file
@@ -0,0 +1,4 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
67
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.js
Normal file
67
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
|
||||
const app = getApp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
stateType : '', //suggest为意见记录 complain为我的建议
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.setData({
|
||||
stateType : options.type
|
||||
})
|
||||
|
||||
if (options.type == 'suggest') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 提点意见'
|
||||
})
|
||||
} else if (options.type == 'complain') {
|
||||
wx.setNavigationBarTitle({
|
||||
title: '优迪尔在线教育 提点建议'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 表单提交
|
||||
*/
|
||||
submitMake(e){
|
||||
let content = e.detail.value.remark
|
||||
let stateType = this.data.stateType
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
// suggest为意见记录
|
||||
if(stateType == 'suggest') dataUrl = wx.$api.teaUsers.suggestForm
|
||||
|
||||
// complain为我的建议
|
||||
if(stateType == 'complain') dataUrl = wx.$api.teaUsers.complainForm
|
||||
|
||||
dataUrl(content).then(res=>{
|
||||
let pages = getCurrentPages(),
|
||||
prepage = pages[pages.length-2]
|
||||
prepage.setData({
|
||||
stateType: this.data.stateType
|
||||
})
|
||||
// 返回上一页
|
||||
wx.navigateBack();
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
11
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.wxml
Normal file
11
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.wxml
Normal file
@@ -0,0 +1,11 @@
|
||||
<!-- 投诉表单 -->
|
||||
<form bindsubmit="submitMake" class="public-form">
|
||||
<view class="ce-white ce-radius ce-padding">
|
||||
<view class="public-label">
|
||||
<textarea name="remark" id="" cols="30" rows="10" placeholder="请输入内容..."></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="public-btn">
|
||||
<button form-type="submit" size="mini">提交</button>
|
||||
</view>
|
||||
</form>
|
||||
35
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.wxss
Normal file
35
手太欠/优迪尔-小程序/pages/teaFeedback-form/index.wxss
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
|
||||
/* 投诉表单 */
|
||||
.public-form {
|
||||
display: block;
|
||||
margin: 20rpx;
|
||||
}
|
||||
|
||||
.public-label textarea {
|
||||
border: 2rpx solid #ebebeb;
|
||||
border-radius: 10rpx;
|
||||
font-size: 30rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.public-label textarea {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.public-btn button[size="mini"]{
|
||||
width: 100%;
|
||||
background: #2170f1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
padding: 0;
|
||||
border-radius: 100rpx;
|
||||
margin: 40rpx 0;
|
||||
}
|
||||
89
手太欠/优迪尔-小程序/pages/teaFeedback/index.js
Normal file
89
手太欠/优迪尔-小程序/pages/teaFeedback/index.js
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
stateType : 'suggest', //suggest为意见记录 complain为我的建议
|
||||
listArr : [], //分类名称
|
||||
page : {}, //分页信息
|
||||
lodingStats : false //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
// 获取列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
let stateType = this.data.stateType
|
||||
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
//suggest为意见记录
|
||||
if(stateType == 'suggest') dataUrl = wx.$api.teaUsers.suggest
|
||||
|
||||
//complain为我的建议
|
||||
if(stateType == 'complain') dataUrl = wx.$api.teaUsers.complain
|
||||
|
||||
dataUrl(page).then(res=>{
|
||||
let listArr = this.data.listArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) listArr = []
|
||||
newData = listArr.concat(res.data.data)
|
||||
|
||||
this.setData({
|
||||
listArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 切换tab
|
||||
*/
|
||||
orderTab(e){
|
||||
let stateType = e.currentTarget.dataset.state
|
||||
if(this.data.stateType != stateType){
|
||||
this.setData({
|
||||
stateType : stateType || ""
|
||||
})
|
||||
// 获取列表
|
||||
this.listInfo();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
// 获取周边列表
|
||||
this.listInfo(pageNumber);
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaFeedback/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaFeedback/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 投诉反馈"
|
||||
}
|
||||
60
手太欠/优迪尔-小程序/pages/teaFeedback/index.wxml
Normal file
60
手太欠/优迪尔-小程序/pages/teaFeedback/index.wxml
Normal file
@@ -0,0 +1,60 @@
|
||||
<!-- 投诉反馈 -->
|
||||
<view class="periphery-tab">
|
||||
<view class="periphery-tab-item {{stateType == 'suggest' ? 'active':''}}" data-state="suggest" bindtap="orderTab">
|
||||
意见
|
||||
</view>
|
||||
<view class="periphery-tab-item {{stateType == 'complain' ? 'active':''}}" data-state="complain" bindtap="orderTab">
|
||||
建议
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="make" wx:if="{{listArr.length > 0}}">
|
||||
<!-- 投诉记录 -->
|
||||
<view class="ce-white ce-padding ce-radius makeLIst" wx:for="{{listArr}}" wx:key="listArr">
|
||||
<view class="makeLIst-top">
|
||||
<image class="makeLIst-img" src="{{item.user.cover}}" mode="aspectFill"></image>
|
||||
<view class="makeLIst-text">
|
||||
<view class="makeLIst-list">
|
||||
<text>{{item.user.nickname}}</text>
|
||||
{{item.created_at}}
|
||||
</view>
|
||||
<view class="makeLIst-tips">
|
||||
{{item.content}}
|
||||
</view>
|
||||
|
||||
<view class="community" wx:if="{{item.reply != ''}}">
|
||||
<view class="community-title">
|
||||
<text>社区回复</text>
|
||||
客服
|
||||
</view>
|
||||
<view class="community-text">{{item.reply}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pagesLoding" wx:if="{{lodingStats}}">
|
||||
<block wx:if="{{page.has_more}}">
|
||||
<image class="pagesLoding-icon" src="/static/icon/refresh_loding.gif" mode="widthFix"></image>加载中...
|
||||
</block>
|
||||
<block wx:else>
|
||||
没有更多了~
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 为空 -->
|
||||
<view class="pack-center pages-hint" wx:else>
|
||||
<image src="/static/img/null_icon.png"></image>
|
||||
<view>暂无内容</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部工具 -->
|
||||
<view class="release-btn">
|
||||
<navigator hover-class="none" url="/pages/teaFeedback-form/index?type=suggest" class="release-btn-make release-btn-border">
|
||||
意见
|
||||
</navigator>
|
||||
<navigator hover-class="none" url="/pages/teaFeedback-form/index?type=complain" class="release-btn-make">
|
||||
建议
|
||||
</navigator>
|
||||
</view>
|
||||
169
手太欠/优迪尔-小程序/pages/teaFeedback/index.wxss
Normal file
169
手太欠/优迪尔-小程序/pages/teaFeedback/index.wxss
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
/* 投诉tab */
|
||||
.header-classify {
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.periphery-tab {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
z-index: 9;
|
||||
background: white;
|
||||
border-bottom: 2rpx solid #e1e1e1;
|
||||
}
|
||||
|
||||
.periphery-tab-item {
|
||||
font-size: 30rpx;
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
background: white;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.periphery-tab-item.active {
|
||||
color: #2170f1;
|
||||
}
|
||||
|
||||
.periphery-tab-item::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: transparent;
|
||||
width: 50rpx;
|
||||
height: 6rpx;
|
||||
left: calc(50% - 25rpx);
|
||||
bottom: 2rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.periphery-tab-item.active::after {
|
||||
background-color: #2170f1;
|
||||
}
|
||||
|
||||
|
||||
/* 底部工具 */
|
||||
.release-btn {
|
||||
background-color: #f5f5f5;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 99;
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
padding: 15rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.release-btn-make {
|
||||
width: calc(50% - 20rpx);
|
||||
background: #2170f1;
|
||||
height: 84rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
color: white;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
border-radius: 50rpx;
|
||||
float: left;
|
||||
margin: 0 10rpx;
|
||||
border: transparent solid 2rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.release-btn-border {
|
||||
background-color: white;
|
||||
border-color: #2170f1;
|
||||
color: #2170f1;
|
||||
}
|
||||
|
||||
/* 列表 */
|
||||
.make {
|
||||
margin: 100rpx 20rpx 0;
|
||||
border-bottom: 110rpx solid transparent;
|
||||
}
|
||||
|
||||
.makeLIst {
|
||||
margin-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.makeLIst-top {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.makeLIst-img {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.makeLIst-text {
|
||||
width: calc(100% - 130rpx);
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.makeLIst-list {
|
||||
display: flex;
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
margin: 0 0 15rpx;
|
||||
}
|
||||
|
||||
.makeLIst-list text {
|
||||
color: #000;
|
||||
font-size: 30rpx;
|
||||
display: block;
|
||||
flex: 1;
|
||||
margin-right: 30rpx;
|
||||
margin-top: -2rpx;
|
||||
}
|
||||
|
||||
.makeLIst-tips {
|
||||
color: #818181;
|
||||
font-size: 28rpx;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
.makeLIst-reply {
|
||||
margin: 30rpx 0 0 130rpx;
|
||||
border-top: 2rpx solid #eee;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
/* 社区回复 */
|
||||
.community {
|
||||
margin-top: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
border-top: 1rpx solid #e1e1e1;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.community-title {
|
||||
display: flex;
|
||||
margin-bottom: 20rpx;
|
||||
color: #818181;
|
||||
}
|
||||
|
||||
.community-title text {
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
flex: 1;
|
||||
width: 80%;
|
||||
}
|
||||
130
手太欠/优迪尔-小程序/pages/teaIndex/index.js
Normal file
130
手太欠/优迪尔-小程序/pages/teaIndex/index.js
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
//用户信息
|
||||
userData : {
|
||||
nickname: '',
|
||||
cover : '',
|
||||
parent : ''
|
||||
},
|
||||
stateType : 'class', //默认课程选项卡 class为课程 service为服务
|
||||
listArr : [], //课程服务列表
|
||||
page : {}, //下一页
|
||||
lodingStats : false //加载状态
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
// 获取首页列表
|
||||
this.listInfo();
|
||||
|
||||
// 获取教师用户信息
|
||||
this.userInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow () {
|
||||
// 去掉home导航
|
||||
wx.hideHomeButton()
|
||||
},
|
||||
|
||||
/**
|
||||
* 教师用户信息
|
||||
*/
|
||||
userInfo() {
|
||||
wx.$api.teaUsers.index().then(res=>{
|
||||
this.setData({
|
||||
userData: {
|
||||
nickname: res.data.nickname,
|
||||
cover : res.data.cover,
|
||||
parent : res.data.parent
|
||||
}
|
||||
})
|
||||
}).catch(err=>{})
|
||||
},
|
||||
|
||||
/**
|
||||
* 首页列表
|
||||
*/
|
||||
listInfo(page) {
|
||||
let state = this.data.stateType
|
||||
let dataUrl = '' //定义接口来源名称
|
||||
// 课程列表接口
|
||||
if(state == 'class') dataUrl = wx.$api.teaIndex.classList
|
||||
|
||||
// 课程服务列表接口
|
||||
if(state == 'service') dataUrl = wx.$api.teaIndex.index
|
||||
|
||||
dataUrl("", page).then(res=>{
|
||||
let serviceArr = this.data.listArr,
|
||||
newData = []
|
||||
if(page == 1 || page == undefined) serviceArr = []
|
||||
newData = serviceArr.concat(res.data.data)
|
||||
|
||||
this.setData({
|
||||
listArr : newData,
|
||||
page : res.data.page,
|
||||
lodingStats : false
|
||||
})
|
||||
wx.stopPullDownRefresh()
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 选显卡选择
|
||||
*/
|
||||
orderTab(e){
|
||||
this.setData({
|
||||
stateType: e.currentTarget.dataset.state
|
||||
})
|
||||
// 获取首页列表
|
||||
this.listInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 跳转二级页面
|
||||
*/
|
||||
levelUrl(e){
|
||||
let id = e.currentTarget.dataset.categoryid || e.currentTarget.dataset.levelid,
|
||||
stateType = this.data.stateType
|
||||
|
||||
// 跳转课程列表
|
||||
if(stateType == 'class') {
|
||||
wx.navigateTo({
|
||||
url: '/pages/publicCourse/index?courseid=' + id + '&type=tea'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 跳转课程服务列表
|
||||
wx.navigateTo({
|
||||
url: '/pages/teaActivity/index?categoryId=' + id
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 上拉加载
|
||||
*/
|
||||
onReachBottom(){
|
||||
this.setData({
|
||||
lodingStats: true
|
||||
})
|
||||
let pageNumber = this.data.page.current
|
||||
if(this.data.page.has_more){
|
||||
pageNumber++
|
||||
this.listInfo(pageNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
4
手太欠/优迪尔-小程序/pages/teaIndex/index.json
Normal file
4
手太欠/优迪尔-小程序/pages/teaIndex/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "优迪尔在线教育 首页"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user