From 35187f62bcc6e02b35f1758a8a44582ed2677d01 Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Thu, 6 Feb 2020 00:28:46 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=AD=A6?=
=?UTF-8?q?=E5=8F=B7=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cloudfunctions-aliyun/signIn/index.js | 102 +++---
pages.json | 122 +++----
pages/index/index.vue | 262 +++++++--------
pages/login/login.vue | 458 +++++++++++++-------------
pages/student/student_day.vue | 43 +--
pages/student_bind/student_bind.vue | 90 ++---
pages/teacher_bind/teacher_bind.vue | 3 +-
7 files changed, 529 insertions(+), 551 deletions(-)
diff --git a/cloudfunctions-aliyun/signIn/index.js b/cloudfunctions-aliyun/signIn/index.js
index d4c9241..959a19c 100644
--- a/cloudfunctions-aliyun/signIn/index.js
+++ b/cloudfunctions-aliyun/signIn/index.js
@@ -223,19 +223,19 @@ function base64urlEscape(str) {
var jwtSimple = jwt_1;
-const passSecret = ''; //用于用户数据库密码加密的密钥,使用一个比较长的随机字符串即可
-
-//上面三个字段非常重要!!!
+const passSecret = ''; //用于用户数据库密码加密的密钥,使用一个比较长的随机字符串即可
+
+//上面三个字段非常重要!!!
const tokenExp = 7200000;
-function encryptPassword(password) {
- const hmac = crypto.createHmac('sha1', passSecret.toString('ascii'));
- hmac.update(password);
- return hmac.digest('hex');
+function encryptPassword(password) {
+ const hmac = crypto.createHmac('sha1', passSecret.toString('ascii'));
+ hmac.update(password);
+ return hmac.digest('hex');
}
-function userTypeConfig(userType) {
+function userTypeConfig(userType) {
// 根据tab类型匹配对应用户表
// 0:老师
// 1:学生
@@ -250,59 +250,59 @@ function userTypeConfig(userType) {
return userOptionDB[userType];
}
-const db = uniCloud.database();
-
-async function signUp(event) {
- const {
+const db = uniCloud.database();
+
+async function signUp(event) {
+ const {
username,
password,
- userType,
- } = event;
-
- let userInfo = {
- username
+ userType,
+ } = event;
+
+ let userInfo = {
+ username
};
// 根据用户类型匹配表名称
- const userDBkye = userTypeConfig(userType);
- const userInDB = await db.collection(userDBkye).where({
+ const userDBkye = userTypeConfig(userType);
+ const userInDB = await db.collection(userDBkye).where({
username,
- //管理员不加密 使用明文
- password: userDBkye === 'admin_users' ? password : encryptPassword(password),
+ //管理员不加密 使用明文
+ password: userDBkye === 'admin_users' ? password : encryptPassword(password),
}).get();
- // 增加用户类型返回给前端
+ // 增加用户类型返回给前端
userInfo.userType = userType;
-
- let tokenSecret = crypto.randomBytes(16).toString('hex'),
- token = jwtSimple.encode(userInfo, tokenSecret);
- let userUpdateResult;
- if (userInDB.data && userInDB.data.length === 0) {
- return {
- status: -1,
- msg: '用户名或密码不正确'
- }
- } else {
- userUpdateResult = await db.collection(userDBkye).doc(userInDB.data[0]._id).update({
- tokenSecret,
- exp: Date.now() + tokenExp
- });
- }
-
- if (userUpdateResult.id || userUpdateResult.affectedDocs === 1) {
- return {
- status: 0,
- token,
+
+ let tokenSecret = crypto.randomBytes(16).toString('hex'),
+ token = jwtSimple.encode(userInfo, tokenSecret);
+ let userUpdateResult;
+ if (userInDB.data && userInDB.data.length === 0) {
+ return {
+ status: -1,
+ msg: '用户名或密码不正确'
+ }
+ } else {
+ userUpdateResult = await db.collection(userDBkye).doc(userInDB.data[0]._id).update({
+ tokenSecret,
+ exp: Date.now() + tokenExp
+ });
+ }
+
+ if (userUpdateResult.id || userUpdateResult.affectedDocs === 1) {
+ return {
+ status: 0,
+ token,
msg: '登录成功',
uid:userInDB.data[0]._id,
class_id:userType==0?userInDB.data[0].class_info:userInDB.data[0].class_id,
- stu_no:(userType==1 || userType==2)?userInDB.data[0].stu_no:'',
- stu_name:(userType==1 || userType==2)?userInDB.data[0].stu_name:''
- }
- }
-
- return {
- status: -1,
- msg: '登录失败'
- }
+ stu_num:(userType==1 || userType==2)?userInDB.data[0].stu_num:'',
+ stu_name:(userType==1 || userType==2)?userInDB.data[0].stu_name:''
+ }
+ }
+
+ return {
+ status: -1,
+ msg: '登录失败'
+ }
}
exports.main = signUp;
diff --git a/pages.json b/pages.json
index dd33329..9532e63 100644
--- a/pages.json
+++ b/pages.json
@@ -1,66 +1,66 @@
{
- "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
- {
- "path": "pages/index/index",
- "style": {
- "navigationBarTitleText": "首页"
- }
+ "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+ {
+ "path": "pages/index/index",
+ "style": {
+ "navigationBarTitleText": "首页"
+ }
},
- {
- "path" : "pages/register/register",
- "style" : {
- "navigationBarTitleText": "注册"
- }
- },
- {
- "path" : "pages/login/login",
- "style" : {
- "navigationBarTitleText": "登录"
- }
- },
- {
- "path" : "pages/weixinRegister/weixinRegister",
- "style" : {
- "navigationBarTitleText": "微信注册"
- }
- },
- {
- "path":"pages/student/student_day",
- "style":{
- "navigationBarTitleText":"健康报备"
- }
- },
- {
- "path":"pages/administrator/admin_grade",
- "style":{
- "navigationBarTitleText":"年级管理"
- }
- },
- {
- "path":"pages/administrator/admin_class",
- "style":{
- "navigationBarTitleText":"班级管理"
- }
- },
- {
- "path": "pages/list/list",
- "style": {
- "navigationBarTitleText": "健康统计汇总"
- }
- },
- {
- "path": "pages/teacher_bind/teacher_bind",
- "style": {
- "navigationBarTitleText": "绑定班级"
- }
- },
- {
- "path": "pages/student_bind/student_bind",
- "style": {
- "navigationBarTitleText": "绑定学生信息"
- }
- }
- ],
+ {
+ "path": "pages/register/register",
+ "style": {
+ "navigationBarTitleText": "注册"
+ }
+ },
+ {
+ "path": "pages/login/login",
+ "style": {
+ "navigationBarTitleText": "登录"
+ }
+ },
+ {
+ "path": "pages/weixinRegister/weixinRegister",
+ "style": {
+ "navigationBarTitleText": "微信注册"
+ }
+ },
+ {
+ "path": "pages/student/student_day",
+ "style": {
+ "navigationBarTitleText": "健康报备"
+ }
+ },
+ {
+ "path": "pages/administrator/admin_grade",
+ "style": {
+ "navigationBarTitleText": "年级管理"
+ }
+ },
+ {
+ "path": "pages/administrator/admin_class",
+ "style": {
+ "navigationBarTitleText": "班级管理"
+ }
+ },
+ {
+ "path": "pages/list/list",
+ "style": {
+ "navigationBarTitleText": "健康统计汇总"
+ }
+ },
+ {
+ "path": "pages/teacher_bind/teacher_bind",
+ "style": {
+ "navigationBarTitleText": "绑定班级"
+ }
+ },
+ {
+ "path": "pages/student_bind/student_bind",
+ "style": {
+ "navigationBarTitleText": "绑定学生信息"
+ }
+ }
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 84d21c5..d30c3f1 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,44 +1,44 @@
-
-
- {{school}}学生健康报备系统
-
-
+
+
+ {{school}}学生健康报备系统
+
+
-
-
-
-
-
- 今日健康报备
-
-
-
-
- 老师,您好
-
- 绑定管理班级
-
-
- 查看报备数据
-
-
-
-
-
- 年级管理
-
-
- 班级管理
-
-
-
-
+
+
+
+
+
+ 今日健康报备
+
+
+
+
+ 老师,您好
+
+ 绑定管理班级
+
+
+ 查看报备数据
+
+
+
+
+
+ 年级管理
+
+
+ 班级管理
+
+
+
+
@@ -47,74 +47,74 @@
export default {
data() {
return {
- school: '',
- userType:4,
+ school: '',
+ userType:4,
userText:'',
}
},
onShow() {
this.getUserInfo()
},
- methods: {
- logout(){
- //用户退出,清楚缓存信息
- uni.removeStorageSync('token')
- uni.removeStorageSync("userType")
- uni.removeStorageSync("uid")
- uni.removeStorageSync("class_id")
- uni.removeStorageSync("stu_no")
- uni.removeStorageSync("stu_name")
-
- uni.navigateTo({
- url: '/pages/login/login'
- });
- },
- setUserText(userType){
- const userOptionDB = {
- 0:'老师',
- 1:'学生',
- 2:'家长',
- 3:'管理员',
- }
- return userOptionDB[userType];
+ methods: {
+ logout(){
+ //用户退出,清楚缓存信息
+ uni.removeStorageSync('token')
+ uni.removeStorageSync("userType")
+ uni.removeStorageSync("uid")
+ uni.removeStorageSync("class_id")
+ uni.removeStorageSync("stu_num")
+ uni.removeStorageSync("stu_name")
+
+ uni.navigateTo({
+ url: '/pages/login/login'
+ });
},
- getUserInfo(){
- console.log("getUserInfo begin")
- uni.showLoading({
- title: '加载中...'
- });
-
- let token = uni.getStorageSync('token')
-
- if(token){
- uniCloud.callFunction({
- name: 'validateToken',
- data: {
- token: uni.getStorageSync('token')
- }
- }).then((res) => {
- console.log("validateToken",res.result.data)
- try{
- const { userType,school } = res.result.data;
- this.school = school;
- this.userType = userType;
- this.userText = this.setUserText(userType)
- }catch(e){
- throw new Error("参数错误请重新登录");
- }
- uni.hideLoading()
- }).catch((err) => {
- uni.hideLoading()
- uni.showModal({
- content: '请求云函数发生错误,' + err.message,
- showCancel: false
- })
- })
- }else{
- uni.navigateTo({
- url:"../login/login"
- })
- }
+ setUserText(userType){
+ const userOptionDB = {
+ 0:'老师',
+ 1:'学生',
+ 2:'家长',
+ 3:'管理员',
+ }
+ return userOptionDB[userType];
+ },
+ getUserInfo(){
+ console.log("getUserInfo begin")
+ uni.showLoading({
+ title: '加载中...'
+ });
+
+ let token = uni.getStorageSync('token')
+
+ if(token){
+ uniCloud.callFunction({
+ name: 'validateToken',
+ data: {
+ token: uni.getStorageSync('token')
+ }
+ }).then((res) => {
+ console.log("validateToken",res.result.data)
+ try{
+ const { userType,school } = res.result.data;
+ this.school = school;
+ this.userType = userType;
+ this.userText = this.setUserText(userType)
+ }catch(e){
+ throw new Error("参数错误请重新登录");
+ }
+ uni.hideLoading()
+ }).catch((err) => {
+ uni.hideLoading()
+ uni.showModal({
+ content: '请求云函数发生错误,' + err.message,
+ showCancel: false
+ })
+ })
+ }else{
+ uni.navigateTo({
+ url:"../login/login"
+ })
+ }
}
}
}
@@ -137,42 +137,42 @@
margin-bottom: 50rpx;
}
- .text-area {
+ .text-area {
text-align: center;
- }
- .tipText{
- text-align: left;
- margin: 40upx 0;
+ }
+ .tipText{
+ text-align: left;
+ margin: 40upx 0;
}
.title {
- font-size: 20px;
+ font-size: 20px;
text-align: center;
- font-weight: bold;
- margin-bottom: 30upx;
- padding: 20px 0px;
+ font-weight: bold;
+ margin-bottom: 30upx;
+ padding: 20px 0px;
- }
-
- .buttonGroup{ width: 100%; margin-bottom:40upx ;}
- .buttonGroup .linkBtn{
- font-size: 30upx;
- display: block;
- line-height: 80upx;
- margin: 0 auto;
- width:90%;
- text-align: center;
- margin-bottom: 20upx;
- border-radius: 40upx;
- box-shadow: 0 3px 5px rgba(5,26,180,0.35);
- font-weight: bold;
- background: linear-gradient(135deg, #576FEC 0%, #576FEC 76%, #536DEC 76%);
- color: #fff;
- }
- .logOutBtn{ flex: 1; width: 90%;margin-top: 20upx;}
-
- .welcome{
- padding-left: 22px;
- margin-bottom: 35px;
+ }
+
+ .buttonGroup{ width: 100%; margin-bottom:40upx ;}
+ .buttonGroup .linkBtn{
+ font-size: 30upx;
+ display: block;
+ line-height: 80upx;
+ margin: 0 auto;
+ width:90%;
+ text-align: center;
+ margin-bottom: 20upx;
+ border-radius: 40upx;
+ box-shadow: 0 3px 5px rgba(5,26,180,0.35);
+ font-weight: bold;
+ background: linear-gradient(135deg, #576FEC 0%, #576FEC 76%, #536DEC 76%);
+ color: #fff;
+ }
+ .logOutBtn{ flex: 1; width: 90%;margin-top: 20upx;}
+
+ .welcome{
+ padding-left: 22px;
+ margin-bottom: 35px;
}
-
+
diff --git a/pages/login/login.vue b/pages/login/login.vue
index b9f4198..6a72d79 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -1,41 +1,41 @@
-
-
-
-
-
- 学生健康报备系统
-
-
-
-
-
-
-
- 老师登录,查看自己班级的学生健康数据统计
-
+
+ -->
+
+
- 提示:老师可通过测试账号快速体验,用户名:teacher,密码:12345678
-
-
-
-
-
-
+ userType,
+ }
+ })
+ }).then((res) => {
+ uni.hideLoading()
+ console.log(res);
+ if (res.result.status !== 0) {
+ return Promise.reject(new Error(res.result.msg))
+ }
+ uni.setStorageSync('token', res.result.token)
+ uni.showModal({
+ content: '登录成功',
+ showCancel: false
+ })
+ }).catch((err) => {
+ uni.hideLoading()
+ uni.showModal({
+ content: '出现错误,请稍后再试.' + err.message,
+ showCancel: false
+ })
+ })
+ },
+ getCode() {
+ return new Promise((resolve, reject) => {
+ uni.login({
+ provider: 'weixin',
+ success(e) {
+ if (e.code) {
+ resolve(e.code)
+ } else {
+ reject(new Error('微信登录失败'))
+ }
+ },
+ fail(e) {
+ reject(new Error('微信登录失败'))
+ }
+ })
+ })
+ },
+ validateToken() {
+ uni.showLoading({
+ title: '加载中...'
+ });
+ uniCloud.callFunction({
+ name: 'validateToken',
+ data: {
+ token: uni.getStorageSync('token')
+ }
+ }).then((res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showModal({
+ content: res.result.msg,
+ showCancel: false
+ })
+ }).catch((err) => {
+ uni.hideLoading()
+ uni.showModal({
+ content: '请求云函数发生错误,' + err.message,
+ showCancel: false
+ })
+ })
+ },
+ },
+
+ onReady() {}
+ };
+
+
diff --git a/pages/student/student_day.vue b/pages/student/student_day.vue
index be53fbb..73a6eef 100644
--- a/pages/student/student_day.vue
+++ b/pages/student/student_day.vue
@@ -2,13 +2,17 @@
-
-
- 学号
-
-
-
-
-
- 姓名
-
-
-
+
+
+ 学号
+
+
+
+
+
+ 姓名
+
+
+
@@ -47,45 +47,45 @@
export default {
data() {
return {
- userType:1,
- teacher_id: '5e369bd594a3c6004d0524b7', // 老师的id
- classList: [], //所有班级列表
- gradeArr: [], // 年级
- gradeName:'',
- gradeIndex: "", //年级索引
- classArr: [], // 特定年级下的班级
- classIndex: "", //班级索引
- className:'',
- stu_no:"",
+ userType:1,
+ teacher_id: '5e369bd594a3c6004d0524b7', // 老师的id
+ classList: [], //所有班级列表
+ gradeArr: [], // 年级
+ gradeName:'',
+ gradeIndex: "", //年级索引
+ classArr: [], // 特定年级下的班级
+ classIndex: "", //班级索引
+ className:'',
+ stu_num:"",
stu_name:""//学生姓名
}
},
onLoad() {
- this.userType = uni.getStorageSync("userType")
- //获取班级列表
- uniCloud.callFunction({
- name: 'getClassList',
- })
- .then(res => {
- console.log(res);
- this.classList = res.result
- this.gradeArr = res.result.gradeList
- })
- .catch(err => {
- uni.hideLoading();
- console.error(err);
+ this.userType = uni.getStorageSync("userType")
+ //获取班级列表
+ uniCloud.callFunction({
+ name: 'getClassList',
+ })
+ .then(res => {
+ console.log(res);
+ this.classList = res.result
+ this.gradeArr = res.result.gradeList
+ })
+ .catch(err => {
+ uni.hideLoading();
+ console.error(err);
});
},
methods: {
bindPickerChange: function(e) {
console.log(e.target.value)
- this.gradeIndex = e.target.value
+ this.gradeIndex = e.target.value
this.gradeName = this.gradeArr[this.gradeIndex].name
this.classArr = this.classList[this.gradeArr[this.gradeIndex]._id]
},
bindClassChange: function(e) {
- this.classIndex = e.target.value
+ this.classIndex = e.target.value
this.className = this.classArr[this.classIndex].name
},
@@ -98,8 +98,8 @@
class_info: this.classArr[this.classIndex]._id,
token: uni.getStorageSync("token"),
uid: uni.getStorageSync("uid"),
- userType: uni.getStorageSync("userType"),
- stu_no:this.stu_no,
+ userType: uni.getStorageSync("userType"),
+ stu_num:this.stu_num,
stu_name:this.stu_name
}
})
@@ -108,11 +108,11 @@
console.log(res);
uni.showToast({
title: '绑定成功',
- duration: 2000,
- success() {
- uni.navigateTo({
- url:'/pages/index/index'
- })
+ duration: 2000,
+ success() {
+ uni.navigateTo({
+ url:'/pages/index/index'
+ })
}
});
})
@@ -127,4 +127,4 @@
+
diff --git a/pages/teacher_bind/teacher_bind.vue b/pages/teacher_bind/teacher_bind.vue
index 2d4bfab..9004748 100644
--- a/pages/teacher_bind/teacher_bind.vue
+++ b/pages/teacher_bind/teacher_bind.vue
@@ -109,8 +109,7 @@
\ No newline at end of file
+
--
Gitee
From 46736bc77c447939f5793f53b7f8f503f554bd7e Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Thu, 6 Feb 2020 03:13:13 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E4=BA=86=E5=B9=B4=E7=BA=A7=E7=AE=A1=E7=90=86=E9=A1=B5=E5=8F=8A?=
=?UTF-8?q?=E7=8F=AD=E7=BA=A7=E7=AE=A1=E7=90=86=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cloudfunctions-aliyun/addClassItem/index.js | 10 +
cloudfunctions-aliyun/addGradeItem/index.js | 9 +
cloudfunctions-aliyun/delClassItem/index.js | 11 +
cloudfunctions-aliyun/delGradeItem/index.js | 24 ++
cloudfunctions-aliyun/getClass/index.js | 17 +
cloudfunctions-aliyun/getGradeList/index.js | 13 +
cloudfunctions-aliyun/upClassItem/index.js | 8 +
cloudfunctions-aliyun/upGradeItem/index.js | 8 +
pages/administrator/admin_class.vue | 382 ++++++++++++--------
pages/administrator/admin_grade.vue | 340 ++++++++++-------
10 files changed, 546 insertions(+), 276 deletions(-)
create mode 100644 cloudfunctions-aliyun/addClassItem/index.js
create mode 100644 cloudfunctions-aliyun/addGradeItem/index.js
create mode 100644 cloudfunctions-aliyun/delClassItem/index.js
create mode 100644 cloudfunctions-aliyun/delGradeItem/index.js
create mode 100644 cloudfunctions-aliyun/getClass/index.js
create mode 100644 cloudfunctions-aliyun/getGradeList/index.js
create mode 100644 cloudfunctions-aliyun/upClassItem/index.js
create mode 100644 cloudfunctions-aliyun/upGradeItem/index.js
diff --git a/cloudfunctions-aliyun/addClassItem/index.js b/cloudfunctions-aliyun/addClassItem/index.js
new file mode 100644
index 0000000..8d52fbe
--- /dev/null
+++ b/cloudfunctions-aliyun/addClassItem/index.js
@@ -0,0 +1,10 @@
+// 添加班级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ console.log(11111111,event);
+ //event为客户端上传的参数
+ const collection = db.collection('class_list')
+ const res = await collection.add(event)
+ return res.data
+};
diff --git a/cloudfunctions-aliyun/addGradeItem/index.js b/cloudfunctions-aliyun/addGradeItem/index.js
new file mode 100644
index 0000000..632eb43
--- /dev/null
+++ b/cloudfunctions-aliyun/addGradeItem/index.js
@@ -0,0 +1,9 @@
+// 添加年级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ //event为客户端上传的参数
+ const collection = db.collection('grade_list')
+ const res = await collection.add(event)
+ return res.data
+};
diff --git a/cloudfunctions-aliyun/delClassItem/index.js b/cloudfunctions-aliyun/delClassItem/index.js
new file mode 100644
index 0000000..b406090
--- /dev/null
+++ b/cloudfunctions-aliyun/delClassItem/index.js
@@ -0,0 +1,11 @@
+// 删除班级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ //event为客户端上传的参数
+ const collection = db.collection('class_list')
+ const res = await collection.doc(event._id).remove() //删除
+ let resData = res.data
+ //返回数据给客户端
+ return resData
+};
diff --git a/cloudfunctions-aliyun/delGradeItem/index.js b/cloudfunctions-aliyun/delGradeItem/index.js
new file mode 100644
index 0000000..378cb3f
--- /dev/null
+++ b/cloudfunctions-aliyun/delGradeItem/index.js
@@ -0,0 +1,24 @@
+// 删除年级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ //event为客户端上传的参数
+ const collection = db.collection('grade_list')
+ const res = await collection.doc(event._id).remove() //删除
+ let resData = res.data
+ // 需要循环删除对应班级的数据
+ let classCol = db.collection("class_list")
+ classCol.where({
+ grade_id: event._id
+ }).get().then((res) => {
+ const promiseList = res.data.map(item => {
+ return classCol.doc(item.grade_id).remove(); //删除
+ });
+ Promise.all(promiseList);
+ })
+ .catch((e) => {
+
+ });
+ //返回数据给客户端
+ return resData
+};
diff --git a/cloudfunctions-aliyun/getClass/index.js b/cloudfunctions-aliyun/getClass/index.js
new file mode 100644
index 0000000..019a63d
--- /dev/null
+++ b/cloudfunctions-aliyun/getClass/index.js
@@ -0,0 +1,17 @@
+// 根据年级ID获取班级列表数据
+'use strict';
+
+const db = uniCloud.database()
+const dbCmd = db.command
+exports.main = async (event, context) => {
+ //event为客户端上传的参数
+ console.log('event : ' + event)
+ const collection = db.collection('class_list')
+ const res = await collection.orderBy("order", "asc").where({
+ grade_id: dbCmd.eq(event.grade_id)
+ }).get()
+ console.log("res:", res)
+ let resData = res.data
+ //返回数据给客户端
+ return resData
+};
diff --git a/cloudfunctions-aliyun/getGradeList/index.js b/cloudfunctions-aliyun/getGradeList/index.js
new file mode 100644
index 0000000..b34d818
--- /dev/null
+++ b/cloudfunctions-aliyun/getGradeList/index.js
@@ -0,0 +1,13 @@
+// 获取年级列表数据
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ //event为客户端上传的参数
+ console.log('event : ' + event)
+ const collection = db.collection('grade_list')
+ const res = await collection.orderBy("order", "asc").get()
+ console.log("res:", res)
+ let resData = res.data
+ //返回数据给客户端
+ return resData
+};
diff --git a/cloudfunctions-aliyun/upClassItem/index.js b/cloudfunctions-aliyun/upClassItem/index.js
new file mode 100644
index 0000000..b7280fc
--- /dev/null
+++ b/cloudfunctions-aliyun/upClassItem/index.js
@@ -0,0 +1,8 @@
+// 修改班级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ const collection = db.collection('class_list')
+ const res = await collection.doc(event.id).update(event.data);
+ return res.data
+};
diff --git a/cloudfunctions-aliyun/upGradeItem/index.js b/cloudfunctions-aliyun/upGradeItem/index.js
new file mode 100644
index 0000000..063db59
--- /dev/null
+++ b/cloudfunctions-aliyun/upGradeItem/index.js
@@ -0,0 +1,8 @@
+// 修改年级项
+'use strict';
+const db = uniCloud.database()
+exports.main = async (event, context) => {
+ const collection = db.collection('grade_list')
+ const res = await collection.doc(event.id).update(event.data);
+ return res.data
+};
diff --git a/pages/administrator/admin_class.vue b/pages/administrator/admin_class.vue
index 9f37681..9e9fc5a 100644
--- a/pages/administrator/admin_class.vue
+++ b/pages/administrator/admin_class.vue
@@ -1,157 +1,243 @@
-
- 管理班级信息
-
-
-
-
- 序号
- 班级
- 班级总人数
- 操作
-
-
- {{index + 1 }}
- {{ item.name }}
- {{ item.student_sum }}
-
-
-
-
-
-
-
-
+
+ 管理班级信息
+
+
+
+
+ 序号
+ 班级
+ 总人数
+ 操作
+
+
+ {{ item.order }}
+ {{ item.name }}
+ {{ item.student_sum }}
+
+
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/pages/administrator/admin_grade.vue b/pages/administrator/admin_grade.vue
index 9ed217b..6c3dd2e 100644
--- a/pages/administrator/admin_grade.vue
+++ b/pages/administrator/admin_grade.vue
@@ -1,138 +1,222 @@
-
- 管理年级信息
-
-
-
-
- 序号
- 年级
- 操作
-
-
- {{index + 1 }}
- {{ item.name }}
-
-
-
-
-
-
-
-
-
+
+ 管理年级信息
+
+
+
+
+ 序号
+ 年级
+ 操作
+
+
+ {{item.order }}
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
--
Gitee
From 0fdf96163337898673683c15fd6d55a861a2df47 Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Thu, 6 Feb 2020 04:17:52 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=8C=E5=96=84?=
=?UTF-8?q?=E4=BA=86=E5=B9=B4=E7=BA=A7=E7=AE=A1=E7=90=86=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/administrator/admin_grade.vue | 75 -----------------------------
1 file changed, 75 deletions(-)
diff --git a/pages/administrator/admin_grade.vue b/pages/administrator/admin_grade.vue
index 75531ef..6c3dd2e 100644
--- a/pages/administrator/admin_grade.vue
+++ b/pages/administrator/admin_grade.vue
@@ -75,10 +75,7 @@
},
methods: {
init() {
-<<<<<<< HEAD
this.tableList = []
-=======
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
//获取年级列表
uniCloud.callFunction({
name: 'getGradeList',
@@ -93,19 +90,13 @@
});
},
submit() {
-<<<<<<< HEAD
if (this.name == '') {
-=======
- let self = this
- if (self.name == '') {
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uni.showToast({
icon: "none",
title: "年级名称不允许为空!"
});
return false;
}
-<<<<<<< HEAD
//利用this.isedit为true时,提示为修改。之后,把this.isedit修改为默认值false
if (this.isedit == true) {
// 修改
@@ -116,26 +107,11 @@
delete this.list_item._id //删除ID,更新内容不能带上ID
this.list_item.name = this.name
form.data = this.list_item
-=======
- //利用self.isedit为true时,提示为修改。之后,把self.isedit修改为默认值false
- if (self.isedit == true) {
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uni.showModal({
title: '提示',
content: '是否提交对该年级的修改?',
success: (res) => {
if (res.confirm) {
-<<<<<<< HEAD
-=======
- // 修改
- let form = {
- id: self.list_item._id,
- data: {}
- }
- delete self.list_item._id //删除ID,更新内容不能带上ID
- self.list_item.name = self.name
- form.data = self.list_item
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uniCloud.callFunction({
name: 'upGradeItem',
data: form
@@ -143,12 +119,8 @@
.then(res => {
console.log(res);
// 重新获得列表
-<<<<<<< HEAD
this.init()
-=======
- self.init()
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
})
.catch(err => {
uni.hideLoading();
@@ -159,30 +131,16 @@
})
} else {
-<<<<<<< HEAD
// 添加
var info = {
name: this.name,
order: this.tableList.length + 1
}
-=======
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uni.showModal({
title: '提示',
content: '是否添加该年级?',
success: (res) => {
if (res.confirm) {
-<<<<<<< HEAD
-=======
- // 添加
- var info = {
- name: self.name,
- order: self.tableList.length + 1
- }
- // 把指定的元素追加到数组的末尾
- self.tableList.push(info)
- //添加年级中项
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uniCloud.callFunction({
name: 'addGradeItem',
data: info
@@ -190,11 +148,7 @@
.then(res => {
console.log(res);
// 重新获得列表
-<<<<<<< HEAD
this.init()
-=======
- self.init()
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
})
.catch(err => {
uni.hideLoading();
@@ -205,13 +159,8 @@
})
}
// 点击提交之后,恢复默认值
-<<<<<<< HEAD
this.isedit = false;
this.name = '';
-=======
- self.isedit = false;
- self.name = '';
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
},
navTo(url) {
uni.navigateTo({
@@ -230,32 +179,20 @@
},
del(list_item) {
// 此时的name是名字
-<<<<<<< HEAD
-=======
- let self = this
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
uni.showModal({
title: '警告',
content: '此操作会将该年级下关联的所有班级全部删除!!!',
success: (res) => {
if (res.confirm) {
// findIndex 遍历查找指定元素的数组下标。
-<<<<<<< HEAD
var idx = this.tableList.findIndex(item => {
-=======
- var idx = self.tableList.findIndex(item => {
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
return item.name == list_item.name;
/* 相当于
if(item.name == name){
return item;
}*/
})
-<<<<<<< HEAD
this.tableList.splice(idx, 1)
-=======
- self.tableList.splice(idx, 1)
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
//删除选中项
uniCloud.callFunction({
@@ -267,27 +204,15 @@
.then(res => {
console.log(res);
// 重新获得列表
-<<<<<<< HEAD
this.init()
-=======
- self.init()
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
})
.catch(err => {
uni.hideLoading();
console.error(err);
});
-<<<<<<< HEAD
}
}
})
-=======
-
- }
- }
- })
-
->>>>>>> 9d1b6b5d39a50bc49836870ffc05efd65199706a
},
}
};
--
Gitee
From facceda6065f9da694a9e99c55e079e4a37716f0 Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Fri, 7 Feb 2020 14:51:38 +0800
Subject: [PATCH 5/7] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E4=BA=86?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=B3=A8=E5=86=8C=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=202=E3=80=81=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E6=98=AF=E8=80=81=E5=B8=88=E8=AF=B7=E5=9C=A8=E7=94=A8=E6=88=B7?=
=?UTF-8?q?=E5=90=8D=E4=B8=AD=E6=B7=BB=E5=8A=A0ls=EF=BC=8C=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E5=91=98=E7=9A=84=E7=94=A8=E6=88=B7=E5=90=8D=E4=B8=AD?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0admin=EF=BC=8C=E5=90=A6=E5=88=99=E6=8F=90?=
=?UTF-8?q?=E7=A4=BA=E4=B8=8D=E8=83=BD=E6=B3=A8=E5=86=8C=203=E3=80=81?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=B8=80=E4=BA=9B=E7=BB=86=E8=8A=82?=
=?UTF-8?q?=E7=9A=84BUG=204=E3=80=81App.vue=E5=8F=AF=E4=BB=A5=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0=205=E3=80=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86colorUI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 2 +
cloudfunctions-aliyun/signIn/index.js | 3 +-
common/my.css | 3537 +++++++++++++++++++++++
pages/index/index.vue | 168 +-
pages/list/list.vue | 14 +-
pages/login/login.vue | 185 +-
pages/register/register.vue | 52 +-
pages/student/student_day.vue | 22 +-
pages/student_bind/student_bind.vue | 18 +-
pages/teacher_bind/teacher_bind.vue | 56 +-
pages/weixinRegister/weixinRegister.vue | 8 -
11 files changed, 3835 insertions(+), 230 deletions(-)
create mode 100644 common/my.css
diff --git a/App.vue b/App.vue
index a330696..b6f5aa2 100644
--- a/App.vue
+++ b/App.vue
@@ -2,6 +2,7 @@
export default {
onLaunch: function() {
console.log('App Launch')
+ uni.setStorageSync('school','执信小学')
},
onShow: function() {
console.log('App Show')
@@ -15,4 +16,5 @@
diff --git a/cloudfunctions-aliyun/signIn/index.js b/cloudfunctions-aliyun/signIn/index.js
index 959a19c..f361b8d 100644
--- a/cloudfunctions-aliyun/signIn/index.js
+++ b/cloudfunctions-aliyun/signIn/index.js
@@ -266,8 +266,7 @@ async function signUp(event) {
const userDBkye = userTypeConfig(userType);
const userInDB = await db.collection(userDBkye).where({
username,
- //管理员不加密 使用明文
- password: userDBkye === 'admin_users' ? password : encryptPassword(password),
+ password: encryptPassword(password),
}).get();
// 增加用户类型返回给前端
userInfo.userType = userType;
diff --git a/common/my.css b/common/my.css
new file mode 100644
index 0000000..49fd757
--- /dev/null
+++ b/common/my.css
@@ -0,0 +1,3537 @@
+/* ==================
+ colorUI初始化
+ ==================== */
+
+body {
+ /* background-color: #DDDDDD; */
+}
+
+.round {
+ border-radius: 5000rpx;
+}
+
+.radius {
+ border-radius: 6rpx;
+}
+
+/* ==================
+ 图片
+ ==================== */
+
+image {
+ max-width: 100%;
+ display: inline-block;
+ position: relative;
+ z-index: 0;
+}
+
+image.loading::before {
+ content: "";
+ background-color: #f5f5f5;
+ display: block;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ z-index: -2;
+}
+
+image.loading::after {
+ content: "\e7f1";
+ font-family: "cuIcon";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 32rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ right: 0;
+ bottom: 0;
+ z-index: -1;
+ font-size: 32rpx;
+ margin: auto;
+ color: #ccc;
+ -webkit-animation: cuIcon-spin 2s infinite linear;
+ animation: cuIcon-spin 2s infinite linear;
+ display: block;
+}
+
+.response {
+ width: 100%;
+}
+
+
+/* ==================
+ 边框
+ ==================== */
+
+/* -- 实线 -- */
+
+.solid,
+.solid-top,
+.solid-right,
+.solid-bottom,
+.solid-left,
+.solids,
+.solids-top,
+.solids-right,
+.solids-bottom,
+.solids-left,
+.dashed,
+.dashed-top,
+.dashed-right,
+.dashed-bottom,
+.dashed-left {
+ position: relative;
+}
+
+.solid::after,
+.solid-top::after,
+.solid-right::after,
+.solid-bottom::after,
+.solid-left::after,
+.solids::after,
+.solids-top::after,
+.solids-right::after,
+.solids-bottom::after,
+.solids-left::after,
+.dashed::after,
+.dashed-top::after,
+.dashed-right::after,
+.dashed-bottom::after,
+.dashed-left::after {
+ content: " ";
+ width: 200%;
+ height: 200%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ border-radius: inherit;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ pointer-events: none;
+ box-sizing: border-box;
+}
+
+.solid::after {
+ border: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.solid-top::after {
+ border-top: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.solid-right::after {
+ border-right: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.solid-bottom::after {
+ border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.solid-left::after {
+ border-left: 1rpx solid rgba(0, 0, 0, 0.1);
+}
+
+.solids::after {
+ border: 8rpx solid #eee;
+}
+
+.solids-top::after {
+ border-top: 8rpx solid #eee;
+}
+
+.solids-right::after {
+ border-right: 8rpx solid #eee;
+}
+
+.solids-bottom::after {
+ border-bottom: 8rpx solid #eee;
+}
+
+.solids-left::after {
+ border-left: 8rpx solid #eee;
+}
+
+/* -- 虚线 -- */
+
+.dashed::after {
+ border: 1rpx dashed #ddd;
+}
+
+.dashed-top::after {
+ border-top: 1rpx dashed #ddd;
+}
+
+.dashed-right::after {
+ border-right: 1rpx dashed #ddd;
+}
+
+.dashed-bottom::after {
+ border-bottom: 1rpx dashed #ddd;
+}
+
+.dashed-left::after {
+ border-left: 1rpx dashed #ddd;
+}
+
+/* -- 阴影 -- */
+
+.shadow[class*='white'] {
+ --ShadowSize: 0 1rpx 6rpx;
+}
+
+.shadow-lg {
+ --ShadowSize: 0rpx 40rpx 100rpx 0rpx;
+}
+
+.shadow-warp {
+ position: relative;
+ box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
+}
+
+.shadow-warp:before,
+.shadow-warp:after {
+ position: absolute;
+ content: "";
+ top: 20rpx;
+ bottom: 30rpx;
+ left: 20rpx;
+ width: 50%;
+ box-shadow: 0 30rpx 20rpx rgba(0, 0, 0, 0.2);
+ transform: rotate(-3deg);
+ z-index: -1;
+}
+
+.shadow-warp:after {
+ right: 20rpx;
+ left: auto;
+ transform: rotate(3deg);
+}
+
+.shadow-blur {
+ position: relative;
+}
+
+.shadow-blur::before {
+ content: "";
+ display: block;
+ background: inherit;
+ filter: blur(10rpx);
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 10rpx;
+ left: 10rpx;
+ z-index: -1;
+ opacity: 0.4;
+ transform-origin: 0 0;
+ border-radius: inherit;
+ transform: scale(1, 1);
+}
+
+/* ==================
+ 按钮
+ ==================== */
+
+.cu-btn {
+ position: relative;
+ border: 0rpx;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: 0 30rpx;
+ font-size: 28rpx;
+ height: 64rpx;
+ line-height: 1;
+ text-align: center;
+ text-decoration: none;
+ overflow: visible;
+ margin-left: initial;
+ transform: translate(0rpx, 0rpx);
+ margin-right: initial;
+}
+
+.cu-btn::after {
+ display: none;
+}
+
+.cu-btn:not([class*="bg-"]) {
+ background-color: #f0f0f0;
+}
+
+.cu-btn[class*="line"] {
+ background-color: transparent;
+}
+
+.cu-btn[class*="line"]::after {
+ content: " ";
+ display: block;
+ width: 200%;
+ height: 200%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ border: 1rpx solid currentColor;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ box-sizing: border-box;
+ border-radius: 12rpx;
+ z-index: 1;
+ pointer-events: none;
+}
+
+.cu-btn.round[class*="line"]::after {
+ border-radius: 1000rpx;
+}
+
+.cu-btn[class*="lines"]::after {
+ border: 6rpx solid currentColor;
+}
+
+.cu-btn[class*="bg-"]::after {
+ display: none;
+}
+
+.cu-btn.sm {
+ padding: 0 20rpx;
+ font-size: 20rpx;
+ height: 48rpx;
+}
+
+.cu-btn.lg {
+ padding: 0 40rpx;
+ font-size: 32rpx;
+ height: 80rpx;
+}
+
+.cu-btn.cuIcon.sm {
+ width: 48rpx;
+ height: 48rpx;
+}
+
+.cu-btn.cuIcon {
+ width: 64rpx;
+ height: 64rpx;
+ border-radius: 500rpx;
+ padding: 0;
+}
+
+button.cuIcon.lg {
+ width: 80rpx;
+ height: 80rpx;
+}
+
+.cu-btn.shadow-blur::before {
+ top: 4rpx;
+ left: 4rpx;
+ filter: blur(6rpx);
+ opacity: 0.6;
+}
+
+.cu-btn.button-hover {
+ transform: translate(1rpx, 1rpx);
+}
+
+.block {
+ display: block;
+}
+
+.cu-btn.block {
+ display: flex;
+}
+
+.cu-btn[disabled] {
+ opacity: 0.6;
+ color: #ffffff;
+}
+
+/* ==================
+ 徽章
+ ==================== */
+
+.cu-tag {
+ font-size: 24rpx;
+ vertical-align: middle;
+ position: relative;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ box-sizing: border-box;
+ padding: 0rpx 16rpx;
+ height: 48rpx;
+ font-family: Helvetica Neue, Helvetica, sans-serif;
+ white-space: nowrap;
+}
+
+.cu-tag:not([class*="bg"]):not([class*="line"]) {
+ background-color: #f1f1f1;
+}
+
+.cu-tag[class*="line-"]::after {
+ content: " ";
+ width: 200%;
+ height: 200%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ border: 1rpx solid currentColor;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ box-sizing: border-box;
+ border-radius: inherit;
+ z-index: 1;
+ pointer-events: none;
+}
+
+.cu-tag.radius[class*="line"]::after {
+ border-radius: 12rpx;
+}
+
+.cu-tag.round[class*="line"]::after {
+ border-radius: 1000rpx;
+}
+
+.cu-tag[class*="line-"]::after {
+ border-radius: 0;
+}
+
+.cu-tag+.cu-tag {
+ margin-left: 10rpx;
+}
+
+.cu-tag.sm {
+ font-size: 20rpx;
+ padding: 0rpx 12rpx;
+ height: 32rpx;
+}
+
+.cu-capsule {
+ display: inline-flex;
+ vertical-align: middle;
+}
+
+.cu-capsule+.cu-capsule {
+ margin-left: 10rpx;
+}
+
+.cu-capsule .cu-tag {
+ margin: 0;
+}
+
+.cu-capsule .cu-tag[class*="line-"]:last-child::after {
+ border-left: 0rpx solid transparent;
+}
+
+.cu-capsule .cu-tag[class*="line-"]:first-child::after {
+ border-right: 0rpx solid transparent;
+}
+
+.cu-capsule.radius .cu-tag:first-child {
+ border-top-left-radius: 6rpx;
+ border-bottom-left-radius: 6rpx;
+}
+
+.cu-capsule.radius .cu-tag:last-child::after,
+.cu-capsule.radius .cu-tag[class*="line-"] {
+ border-top-right-radius: 12rpx;
+ border-bottom-right-radius: 12rpx;
+}
+
+.cu-capsule.round .cu-tag:first-child {
+ border-top-left-radius: 200rpx;
+ border-bottom-left-radius: 200rpx;
+ text-indent: 4rpx;
+}
+
+.cu-capsule.round .cu-tag:last-child::after,
+.cu-capsule.round .cu-tag:last-child {
+ border-top-right-radius: 200rpx;
+ border-bottom-right-radius: 200rpx;
+ text-indent: -4rpx;
+}
+
+.cu-tag.badge {
+ border-radius: 200rpx;
+ position: absolute;
+ top: -10rpx;
+ right: -10rpx;
+ font-size: 20rpx;
+ padding: 0rpx 10rpx;
+ height: 28rpx;
+ color: #ffffff;
+}
+
+.cu-tag.badge:not([class*="bg-"]) {
+ background-color: #dd514c;
+}
+
+.cu-tag:empty:not([class*="cuIcon-"]) {
+ padding: 0rpx;
+ width: 16rpx;
+ height: 16rpx;
+ top: -4rpx;
+ right: -4rpx;
+}
+
+.cu-tag[class*="cuIcon-"] {
+ width: 32rpx;
+ height: 32rpx;
+ top: -4rpx;
+ right: -4rpx;
+}
+
+/* ==================
+ 头像
+ ==================== */
+
+.cu-avatar {
+ font-variant: small-caps;
+ margin: 0;
+ padding: 0;
+ display: inline-flex;
+ text-align: center;
+ justify-content: center;
+ align-items: center;
+ background-color: #ccc;
+ color: #ffffff;
+ white-space: nowrap;
+ position: relative;
+ width: 64rpx;
+ height: 64rpx;
+ background-size: cover;
+ background-position: center;
+ vertical-align: middle;
+ font-size: 1.5em;
+}
+
+.cu-avatar.sm {
+ width: 48rpx;
+ height: 48rpx;
+ font-size: 1em;
+}
+
+.cu-avatar.lg {
+ width: 96rpx;
+ height: 96rpx;
+ font-size: 2em;
+}
+
+.cu-avatar.xl {
+ width: 128rpx;
+ height: 128rpx;
+ font-size: 2.5em;
+}
+
+.cu-avatar .avatar-text {
+ font-size: 0.4em;
+}
+
+.cu-avatar-group {
+ direction: rtl;
+ unicode-bidi: bidi-override;
+ padding: 0 10rpx 0 40rpx;
+ display: inline-block;
+}
+
+.cu-avatar-group .cu-avatar {
+ margin-left: -30rpx;
+ border: 4rpx solid #f1f1f1;
+ vertical-align: middle;
+}
+
+.cu-avatar-group .cu-avatar.sm {
+ margin-left: -20rpx;
+ border: 1rpx solid #f1f1f1;
+}
+
+/* ==================
+ 进度条
+ ==================== */
+
+.cu-progress {
+ overflow: hidden;
+ height: 28rpx;
+ background-color: #ebeef5;
+ display: inline-flex;
+ align-items: center;
+ width: 100%;
+}
+
+.cu-progress+view,
+.cu-progress+text {
+ line-height: 1;
+}
+
+.cu-progress.xs {
+ height: 10rpx;
+}
+
+.cu-progress.sm {
+ height: 20rpx;
+}
+
+.cu-progress view {
+ width: 0;
+ height: 100%;
+ align-items: center;
+ display: flex;
+ justify-items: flex-end;
+ justify-content: space-around;
+ font-size: 20rpx;
+ color: #ffffff;
+ transition: width 0.6s ease;
+}
+
+.cu-progress text {
+ align-items: center;
+ display: flex;
+ font-size: 20rpx;
+ color: #333333;
+ text-indent: 10rpx;
+}
+
+.cu-progress.text-progress {
+ padding-right: 60rpx;
+}
+
+.cu-progress.striped view {
+ background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
+ background-size: 72rpx 72rpx;
+}
+
+.cu-progress.active view {
+ animation: progress-stripes 2s linear infinite;
+}
+
+@keyframes progress-stripes {
+ from {
+ background-position: 72rpx 0;
+ }
+
+ to {
+ background-position: 0 0;
+ }
+}
+
+/* ==================
+ 加载
+ ==================== */
+
+.cu-load {
+ display: block;
+ line-height: 3em;
+ text-align: center;
+}
+
+.cu-load::before {
+ font-family: "cuIcon";
+ display: inline-block;
+ margin-right: 6rpx;
+}
+
+.cu-load.loading::before {
+ content: "\e67a";
+ animation: cuIcon-spin 2s infinite linear;
+}
+
+.cu-load.loading::after {
+ content: "加载中...";
+}
+
+.cu-load.over::before {
+ content: "\e64a";
+}
+
+.cu-load.over::after {
+ content: "没有更多了";
+}
+
+.cu-load.erro::before {
+ content: "\e658";
+}
+
+.cu-load.erro::after {
+ content: "加载失败";
+}
+
+.cu-load.load-cuIcon::before {
+ font-size: 32rpx;
+}
+
+.cu-load.load-cuIcon::after {
+ display: none;
+}
+
+.cu-load.load-cuIcon.over {
+ display: none;
+}
+
+.cu-load.load-modal {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 140rpx;
+ left: 0;
+ margin: auto;
+ width: 260rpx;
+ height: 260rpx;
+ background-color: #ffffff;
+ border-radius: 10rpx;
+ box-shadow: 0 0 0rpx 2000rpx rgba(0, 0, 0, 0.5);
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+ justify-content: center;
+ font-size: 28rpx;
+ z-index: 9999;
+ line-height: 2.4em;
+}
+
+.cu-load.load-modal [class*="cuIcon-"] {
+ font-size: 60rpx;
+}
+
+.cu-load.load-modal image {
+ width: 70rpx;
+ height: 70rpx;
+}
+
+.cu-load.load-modal::after {
+ content: "";
+ position: absolute;
+ background-color: #ffffff;
+ border-radius: 50%;
+ width: 200rpx;
+ height: 200rpx;
+ font-size: 10px;
+ border-top: 6rpx solid rgba(0, 0, 0, 0.05);
+ border-right: 6rpx solid rgba(0, 0, 0, 0.05);
+ border-bottom: 6rpx solid rgba(0, 0, 0, 0.05);
+ border-left: 6rpx solid #f37b1d;
+ animation: cuIcon-spin 1s infinite linear;
+ z-index: -1;
+}
+
+.load-progress {
+ pointer-events: none;
+ top: 0;
+ position: fixed;
+ width: 100%;
+ left: 0;
+ z-index: 2000;
+}
+
+.load-progress.hide {
+ display: none;
+}
+
+.load-progress .load-progress-bar {
+ position: relative;
+ width: 100%;
+ height: 4rpx;
+ overflow: hidden;
+ transition: all 200ms ease 0s;
+}
+
+.load-progress .load-progress-spinner {
+ position: absolute;
+ top: 10rpx;
+ right: 10rpx;
+ z-index: 2000;
+ display: block;
+}
+
+.load-progress .load-progress-spinner::after {
+ content: "";
+ display: block;
+ width: 24rpx;
+ height: 24rpx;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ border: solid 4rpx transparent;
+ border-top-color: inherit;
+ border-left-color: inherit;
+ border-radius: 50%;
+ -webkit-animation: load-progress-spinner 0.4s linear infinite;
+ animation: load-progress-spinner 0.4s linear infinite;
+}
+
+@-webkit-keyframes load-progress-spinner {
+ 0% {
+ -webkit-transform: rotate(0);
+ transform: rotate(0);
+ }
+
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+@keyframes load-progress-spinner {
+ 0% {
+ -webkit-transform: rotate(0);
+ transform: rotate(0);
+ }
+
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+/* ==================
+ 列表
+ ==================== */
+.grayscale {
+ filter: grayscale(1);
+}
+
+.cu-list+.cu-list {
+ margin-top: 30rpx
+}
+
+.cu-list>.cu-item {
+ transition: all .6s ease-in-out 0s;
+ transform: translateX(0rpx)
+}
+
+.cu-list>.cu-item.move-cur {
+ transform: translateX(-260rpx)
+}
+
+.cu-list>.cu-item .move {
+ position: absolute;
+ right: 0;
+ display: flex;
+ width: 260rpx;
+ height: 100%;
+ transform: translateX(100%)
+}
+
+.cu-list>.cu-item .move view {
+ display: flex;
+ flex: 1;
+ justify-content: center;
+ align-items: center
+}
+
+.cu-list.menu-avatar {
+ overflow: hidden;
+}
+
+.cu-list.menu-avatar>.cu-item {
+ position: relative;
+ display: flex;
+ padding-right: 10rpx;
+ height: 140rpx;
+ background-color: #ffffff;
+ justify-content: flex-end;
+ align-items: center
+}
+
+.cu-list.menu-avatar>.cu-item>.cu-avatar {
+ position: absolute;
+ left: 30rpx
+}
+
+.cu-list.menu-avatar>.cu-item .flex .text-cut {
+ max-width: 510rpx
+}
+
+.cu-list.menu-avatar>.cu-item .content {
+ position: absolute;
+ left: 146rpx;
+ width: calc(100% - 96rpx - 60rpx - 120rpx - 20rpx);
+ line-height: 1.6em;
+}
+
+.cu-list.menu-avatar>.cu-item .content.flex-sub {
+ width: calc(100% - 96rpx - 60rpx - 20rpx);
+}
+
+.cu-list.menu-avatar>.cu-item .content>view:first-child {
+ font-size: 30rpx;
+ display: flex;
+ align-items: center
+}
+
+.cu-list.menu-avatar>.cu-item .content .cu-tag.sm {
+ display: inline-block;
+ margin-left: 10rpx;
+ height: 28rpx;
+ font-size: 16rpx;
+ line-height: 32rpx
+}
+
+.cu-list.menu-avatar>.cu-item .action {
+ width: 100rpx;
+ text-align: center
+}
+
+.cu-list.menu-avatar>.cu-item .action view+view {
+ margin-top: 10rpx
+}
+
+.cu-list.menu-avatar.comment>.cu-item .content {
+ position: relative;
+ left: 0;
+ width: auto;
+ flex: 1;
+}
+
+.cu-list.menu-avatar.comment>.cu-item {
+ padding: 30rpx 30rpx 30rpx 120rpx;
+ height: auto
+}
+
+.cu-list.menu-avatar.comment .cu-avatar {
+ align-self: flex-start
+}
+
+.cu-list.menu>.cu-item {
+ position: relative;
+ display: flex;
+ padding: 0 30rpx;
+ min-height: 100rpx;
+ background-color: #ffffff;
+ justify-content: space-between;
+ align-items: center
+}
+
+.cu-list.menu>.cu-item:last-child:after {
+ border: none
+}
+
+.cu-list.menu-avatar>.cu-item:after,
+.cu-list.menu>.cu-item:after {
+ position: absolute;
+ top: 0;
+ left: 0;
+ box-sizing: border-box;
+ width: 200%;
+ height: 200%;
+ border-bottom: 1rpx solid #ddd;
+ border-radius: inherit;
+ content: " ";
+ transform: scale(.5);
+ transform-origin: 0 0;
+ pointer-events: none
+}
+
+.cu-list.menu>.cu-item.grayscale {
+ background-color: #f5f5f5
+}
+
+.cu-list.menu>.cu-item.cur {
+ background-color: #fcf7e9
+}
+
+.cu-list.menu>.cu-item.arrow {
+ padding-right: 90rpx
+}
+
+.cu-list.menu>.cu-item.arrow:before {
+ position: absolute;
+ top: 0;
+ right: 30rpx;
+ bottom: 0;
+ display: block;
+ margin: auto;
+ width: 30rpx;
+ height: 30rpx;
+ color: #8799a3;
+ content: "\e6a3";
+ text-align: center;
+ font-size: 34rpx;
+ font-family: cuIcon;
+ line-height: 30rpx
+}
+
+.cu-list.menu>.cu-item button.content {
+ padding: 0;
+ background-color: transparent;
+ justify-content: flex-start
+}
+
+.cu-list.menu>.cu-item button.content:after {
+ display: none
+}
+
+.cu-list.menu>.cu-item .cu-avatar-group .cu-avatar {
+ border-color: #ffffff
+}
+
+.cu-list.menu>.cu-item .content>view:first-child {
+ display: flex;
+ align-items: center
+}
+
+.cu-list.menu>.cu-item .content>text[class*=cuIcon] {
+ display: inline-block;
+ margin-right: 10rpx;
+ width: 1.6em;
+ text-align: center
+}
+
+.cu-list.menu>.cu-item .content>image {
+ display: inline-block;
+ margin-right: 10rpx;
+ width: 1.6em;
+ height: 1.6em;
+ vertical-align: middle
+}
+
+.cu-list.menu>.cu-item .content {
+ font-size: 30rpx;
+ line-height: 1.6em;
+ flex: 1
+}
+
+.cu-list.menu>.cu-item .content .cu-tag.sm {
+ display: inline-block;
+ margin-left: 10rpx;
+ height: 28rpx;
+ font-size: 16rpx;
+ line-height: 32rpx
+}
+
+.cu-list.menu>.cu-item .action .cu-tag:empty {
+ right: 10rpx
+}
+
+.cu-list.menu {
+ display: block;
+ overflow: hidden
+}
+
+.cu-list.menu.sm-border>.cu-item:after {
+ left: 30rpx;
+ width: calc(200% - 120rpx)
+}
+
+.cu-list.grid>.cu-item {
+ position: relative;
+ display: flex;
+ padding: 20rpx 0 30rpx;
+ transition-duration: 0s;
+ flex-direction: column
+}
+
+.cu-list.grid>.cu-item:after {
+ position: absolute;
+ top: 0;
+ left: 0;
+ box-sizing: border-box;
+ width: 200%;
+ height: 200%;
+ border-right: 1px solid rgba(0, 0, 0, .1);
+ border-bottom: 1px solid rgba(0, 0, 0, .1);
+ border-radius: inherit;
+ content: " ";
+ transform: scale(.5);
+ transform-origin: 0 0;
+ pointer-events: none
+}
+
+.cu-list.grid>.cu-item text {
+ display: block;
+ margin-top: 10rpx;
+ color: #888;
+ font-size: 26rpx;
+ line-height: 40rpx
+}
+
+.cu-list.grid>.cu-item [class*=cuIcon] {
+ position: relative;
+ display: block;
+ margin-top: 20rpx;
+ width: 100%;
+ font-size: 48rpx
+}
+
+.cu-list.grid>.cu-item .cu-tag {
+ right: auto;
+ left: 50%;
+ margin-left: 20rpx
+}
+
+.cu-list.grid {
+ background-color: #ffffff;
+ text-align: center
+}
+
+.cu-list.grid.no-border>.cu-item {
+ padding-top: 10rpx;
+ padding-bottom: 20rpx
+}
+
+.cu-list.grid.no-border>.cu-item:after {
+ border: none
+}
+
+.cu-list.grid.no-border {
+ padding: 20rpx 10rpx
+}
+
+.cu-list.grid.col-3>.cu-item:nth-child(3n):after,
+.cu-list.grid.col-4>.cu-item:nth-child(4n):after,
+.cu-list.grid.col-5>.cu-item:nth-child(5n):after {
+ border-right-width: 0
+}
+
+.cu-list.card-menu {
+ overflow: hidden;
+ margin-right: 30rpx;
+ margin-left: 30rpx;
+ border-radius: 20rpx
+}
+
+
+/* ==================
+ 操作条
+ ==================== */
+
+.cu-bar {
+ display: flex;
+ position: relative;
+ align-items: center;
+ min-height: 100rpx;
+ justify-content: space-between;
+}
+
+.cu-bar .action {
+ display: flex;
+ align-items: center;
+ height: 100%;
+ justify-content: center;
+ max-width: 100%;
+}
+
+.cu-bar .action.border-title {
+ position: relative;
+ top: -10rpx;
+}
+
+.cu-bar .action.border-title text[class*="bg-"]:last-child {
+ position: absolute;
+ bottom: -0.5rem;
+ min-width: 2rem;
+ height: 6rpx;
+ left: 0;
+}
+
+.cu-bar .action.sub-title {
+ position: relative;
+ top: -0.2rem;
+}
+
+.cu-bar .action.sub-title text {
+ position: relative;
+ z-index: 1;
+}
+
+.cu-bar .action.sub-title text[class*="bg-"]:last-child {
+ position: absolute;
+ display: inline-block;
+ bottom: -0.2rem;
+ border-radius: 6rpx;
+ width: 100%;
+ height: 0.6rem;
+ left: 0.6rem;
+ opacity: 0.3;
+ z-index: 0;
+}
+
+.cu-bar .action.sub-title text[class*="text-"]:last-child {
+ position: absolute;
+ display: inline-block;
+ bottom: -0.7rem;
+ left: 0.5rem;
+ opacity: 0.2;
+ z-index: 0;
+ text-align: right;
+ font-weight: 900;
+ font-size: 36rpx;
+}
+
+.cu-bar.justify-center .action.border-title text:last-child,
+.cu-bar.justify-center .action.sub-title text:last-child {
+ left: 0;
+ right: 0;
+ margin: auto;
+ text-align: center;
+}
+
+.cu-bar .action:first-child {
+ margin-left: 30rpx;
+ font-size: 30rpx;
+}
+
+.cu-bar .action text.text-cut {
+ text-align: left;
+ width: 100%;
+}
+
+.cu-bar .cu-avatar:first-child {
+ margin-left: 20rpx;
+}
+
+.cu-bar .action:first-child>text[class*="cuIcon-"] {
+ margin-left: -0.3em;
+ margin-right: 0.3em;
+}
+
+.cu-bar .action:last-child {
+ margin-right: 30rpx;
+}
+
+.cu-bar .action>text[class*="cuIcon-"],
+.cu-bar .action>view[class*="cuIcon-"] {
+ font-size: 36rpx;
+}
+
+.cu-bar .action>text[class*="cuIcon-"]+text[class*="cuIcon-"] {
+ margin-left: 0.5em;
+}
+
+.cu-bar .content {
+ position: absolute;
+ text-align: center;
+ width: calc(100% - 340rpx);
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ margin: auto;
+ height: 60rpx;
+ font-size: 32rpx;
+ line-height: 60rpx;
+ cursor: none;
+ pointer-events: none;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.cu-bar.ios .content {
+ bottom: 7px;
+ height: 30px;
+ font-size: 32rpx;
+ line-height: 30px;
+}
+
+.cu-bar.btn-group {
+ justify-content: space-around;
+}
+
+.cu-bar.btn-group button {
+ padding: 20rpx 32rpx;
+}
+
+.cu-bar.btn-group button {
+ flex: 1;
+ margin: 0 20rpx;
+ max-width: 50%;
+}
+
+.cu-bar .search-form {
+ background-color: #f5f5f5;
+ line-height: 64rpx;
+ height: 64rpx;
+ font-size: 24rpx;
+ color: #333333;
+ flex: 1;
+ display: flex;
+ align-items: center;
+ margin: 0 30rpx;
+}
+
+.cu-bar .search-form+.action {
+ margin-right: 30rpx;
+}
+
+.cu-bar .search-form input {
+ flex: 1;
+ padding-right: 30rpx;
+ height: 64rpx;
+ line-height: 64rpx;
+ font-size: 26rpx;
+ background-color: transparent;
+}
+
+.cu-bar .search-form [class*="cuIcon-"] {
+ margin: 0 0.5em 0 0.8em;
+}
+
+.cu-bar .search-form [class*="cuIcon-"]::before {
+ top: 0rpx;
+}
+
+.cu-bar.fixed,
+.nav.fixed {
+ position: fixed;
+ width: 100%;
+ top: 0;
+ z-index: 1;
+ box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0.1);
+}
+
+.cu-bar.foot {
+ position: fixed;
+ width: 100%;
+ bottom: 0;
+ z-index: 1;
+ box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1);
+}
+
+.cu-bar.tabbar {
+ padding: 0;
+ height: calc(100rpx + env(safe-area-inset-bottom) / 2);
+ padding-bottom: calc(env(safe-area-inset-bottom) / 2);
+}
+
+.cu-tabbar-height {
+ min-height: 100rpx;
+ height: calc(100rpx + env(safe-area-inset-bottom) / 2);
+}
+
+.cu-bar.tabbar.shadow {
+ box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.1);
+}
+
+.cu-bar.tabbar .action {
+ font-size: 22rpx;
+ position: relative;
+ flex: 1;
+ text-align: center;
+ padding: 0;
+ display: block;
+ height: auto;
+ line-height: 1;
+ margin: 0;
+ background-color: inherit;
+ overflow: initial;
+}
+
+.cu-bar.tabbar.shop .action {
+ width: 140rpx;
+ flex: initial;
+}
+
+.cu-bar.tabbar .action.add-action {
+ position: relative;
+ z-index: 2;
+ padding-top: 50rpx;
+}
+
+.cu-bar.tabbar .action.add-action [class*="cuIcon-"] {
+ position: absolute;
+ width: 70rpx;
+ z-index: 2;
+ height: 70rpx;
+ border-radius: 50%;
+ line-height: 70rpx;
+ font-size: 50rpx;
+ top: -35rpx;
+ left: 0;
+ right: 0;
+ margin: auto;
+ padding: 0;
+}
+
+.cu-bar.tabbar .action.add-action::after {
+ content: "";
+ position: absolute;
+ width: 100rpx;
+ height: 100rpx;
+ top: -50rpx;
+ left: 0;
+ right: 0;
+ margin: auto;
+ box-shadow: 0 -3rpx 8rpx rgba(0, 0, 0, 0.08);
+ border-radius: 50rpx;
+ background-color: inherit;
+ z-index: 0;
+}
+
+.cu-bar.tabbar .action.add-action::before {
+ content: "";
+ position: absolute;
+ width: 100rpx;
+ height: 30rpx;
+ bottom: 30rpx;
+ left: 0;
+ right: 0;
+ margin: auto;
+ background-color: inherit;
+ z-index: 1;
+}
+
+.cu-bar.tabbar .btn-group {
+ flex: 1;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+ padding: 0 10rpx;
+}
+
+.cu-bar.tabbar button.action::after {
+ border: 0;
+}
+
+.cu-bar.tabbar .action [class*="cuIcon-"] {
+ width: 100rpx;
+ position: relative;
+ display: block;
+ height: auto;
+ margin: 0 auto 10rpx;
+ text-align: center;
+ font-size: 40rpx;
+}
+
+.cu-bar.tabbar .action .cuIcon-cu-image {
+ margin: 0 auto;
+}
+
+.cu-bar.tabbar .action .cuIcon-cu-image image {
+ width: 50rpx;
+ height: 50rpx;
+ display: inline-block;
+}
+
+.cu-bar.tabbar .submit {
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ text-align: center;
+ position: relative;
+ flex: 2;
+ align-self: stretch;
+}
+
+.cu-bar.tabbar .submit:last-child {
+ flex: 2.6;
+}
+
+.cu-bar.tabbar .submit+.submit {
+ flex: 2;
+}
+
+.cu-bar.tabbar.border .action::before {
+ content: " ";
+ width: 200%;
+ height: 200%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ border-right: 1rpx solid rgba(0, 0, 0, 0.1);
+ z-index: 3;
+}
+
+.cu-bar.tabbar.border .action:last-child:before {
+ display: none;
+}
+
+.cu-bar.input {
+ padding-right: 20rpx;
+ background-color: #ffffff;
+ width: 100%;
+}
+
+.cu-bar.input input {
+ overflow: initial;
+ line-height: 64rpx;
+ height: 64rpx;
+ min-height: 64rpx;
+ flex: 1;
+ font-size: 30rpx;
+ margin: 0 20rpx;
+}
+
+.cu-bar.input .action {
+ margin-left: 20rpx;
+}
+
+.cu-bar.input .action [class*="cuIcon-"] {
+ font-size: 48rpx;
+}
+
+.cu-bar.input input+.action {
+ margin-right: 20rpx;
+ margin-left: 0rpx;
+}
+
+.cu-bar.input .action:first-child [class*="cuIcon-"] {
+ margin-left: 0rpx;
+}
+
+.cu-custom {
+ display: block;
+ position: relative;
+}
+
+.cu-custom .cu-bar .content {
+ width: calc(100% - 440rpx);
+}
+
+/* #ifdef MP-ALIPAY */
+.cu-custom .cu-bar .action .cuIcon-back {
+ opacity: 0;
+}
+
+/* #endif */
+
+.cu-custom .cu-bar .content image {
+ height: 60rpx;
+ width: 240rpx;
+}
+
+.cu-custom .cu-bar {
+ min-height: 0px;
+ /* #ifdef MP-WEIXIN */
+ padding-right: 220rpx;
+ /* #endif */
+ /* #ifdef MP-ALIPAY */
+ padding-right: 150rpx;
+ /* #endif */
+ box-shadow: 0rpx 0rpx 0rpx;
+ z-index: 9999;
+}
+
+.cu-custom .cu-bar .border-custom {
+ position: relative;
+ background: rgba(0, 0, 0, 0.15);
+ border-radius: 1000rpx;
+ height: 30px;
+}
+
+.cu-custom .cu-bar .border-custom::after {
+ content: " ";
+ width: 200%;
+ height: 200%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ border-radius: inherit;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ pointer-events: none;
+ box-sizing: border-box;
+ border: 1rpx solid #ffffff;
+ opacity: 0.5;
+}
+
+.cu-custom .cu-bar .border-custom::before {
+ content: " ";
+ width: 1rpx;
+ height: 110%;
+ position: absolute;
+ top: 22.5%;
+ left: 0;
+ right: 0;
+ margin: auto;
+ transform: scale(0.5);
+ transform-origin: 0 0;
+ pointer-events: none;
+ box-sizing: border-box;
+ opacity: 0.6;
+ background-color: #ffffff;
+}
+
+.cu-custom .cu-bar .border-custom text {
+ display: block;
+ flex: 1;
+ margin: auto !important;
+ text-align: center;
+ font-size: 34rpx;
+}
+
+/* ==================
+ 导航栏
+ ==================== */
+
+.nav {
+ white-space: nowrap;
+}
+
+::-webkit-scrollbar {
+ display: none;
+}
+
+.nav .cu-item {
+ height: 90rpx;
+ display: inline-block;
+ line-height: 90rpx;
+ margin: 0 10rpx;
+ padding: 0 20rpx;
+}
+
+.nav .cu-item.cur {
+ border-bottom: 4rpx solid;
+}
+
+/* ==================
+ 时间轴
+ ==================== */
+
+.cu-timeline {
+ display: block;
+ background-color: #ffffff;
+}
+
+.cu-timeline .cu-time {
+ width: 120rpx;
+ text-align: center;
+ padding: 20rpx 0;
+ font-size: 26rpx;
+ color: #888;
+ display: block;
+}
+
+.cu-timeline>.cu-item {
+ padding: 30rpx 30rpx 30rpx 120rpx;
+ position: relative;
+ display: block;
+ z-index: 0;
+}
+
+.cu-timeline>.cu-item:not([class*="text-"]) {
+ color: #ccc;
+}
+
+.cu-timeline>.cu-item::after {
+ content: "";
+ display: block;
+ position: absolute;
+ width: 1rpx;
+ background-color: #ddd;
+ left: 60rpx;
+ height: 100%;
+ top: 0;
+ z-index: 8;
+}
+
+.cu-timeline>.cu-item::before {
+ font-family: "cuIcon";
+ display: block;
+ position: absolute;
+ top: 36rpx;
+ z-index: 9;
+ background-color: #ffffff;
+ width: 50rpx;
+ height: 50rpx;
+ text-align: center;
+ border: none;
+ line-height: 50rpx;
+ left: 36rpx;
+}
+
+.cu-timeline>.cu-item:not([class*="cuIcon-"])::before {
+ content: "\e763";
+}
+
+.cu-timeline>.cu-item[class*="cuIcon-"]::before {
+ background-color: #ffffff;
+ width: 50rpx;
+ height: 50rpx;
+ text-align: center;
+ border: none;
+ line-height: 50rpx;
+ left: 36rpx;
+}
+
+.cu-timeline>.cu-item>.content {
+ padding: 30rpx;
+ border-radius: 6rpx;
+ display: block;
+ line-height: 1.6;
+}
+
+.cu-timeline>.cu-item>.content:not([class*="bg-"]) {
+ background-color: #f1f1f1;
+ color: #333333;
+}
+
+.cu-timeline>.cu-item>.content+.content {
+ margin-top: 20rpx;
+}
+
+/* ==================
+ 聊天
+ ==================== */
+
+.cu-chat {
+ display: flex;
+ flex-direction: column;
+}
+
+.cu-chat .cu-item {
+ display: flex;
+ padding: 30rpx 30rpx 70rpx;
+ position: relative;
+}
+
+.cu-chat .cu-item>.cu-avatar {
+ width: 80rpx;
+ height: 80rpx;
+}
+
+.cu-chat .cu-item>.main {
+ max-width: calc(100% - 260rpx);
+ margin: 0 40rpx;
+ display: flex;
+ align-items: center;
+}
+
+.cu-chat .cu-item>image {
+ height: 320rpx;
+}
+
+.cu-chat .cu-item>.main .content {
+ padding: 20rpx;
+ border-radius: 6rpx;
+ display: inline-flex;
+ max-width: 100%;
+ align-items: center;
+ font-size: 30rpx;
+ position: relative;
+ min-height: 80rpx;
+ line-height: 40rpx;
+ text-align: left;
+}
+
+.cu-chat .cu-item>.main .content:not([class*="bg-"]) {
+ background-color: #ffffff;
+ color: #333333;
+}
+
+.cu-chat .cu-item .date {
+ position: absolute;
+ font-size: 24rpx;
+ color: #8799a3;
+ width: calc(100% - 320rpx);
+ bottom: 20rpx;
+ left: 160rpx;
+}
+
+.cu-chat .cu-item .action {
+ padding: 0 30rpx;
+ display: flex;
+ align-items: center;
+}
+
+.cu-chat .cu-item>.main .content::after {
+ content: "";
+ top: 27rpx;
+ transform: rotate(45deg);
+ position: absolute;
+ z-index: 100;
+ display: inline-block;
+ overflow: hidden;
+ width: 24rpx;
+ height: 24rpx;
+ left: -12rpx;
+ right: initial;
+ background-color: inherit;
+}
+
+.cu-chat .cu-item.self>.main .content::after {
+ left: auto;
+ right: -12rpx;
+}
+
+.cu-chat .cu-item>.main .content::before {
+ content: "";
+ top: 30rpx;
+ transform: rotate(45deg);
+ position: absolute;
+ z-index: -1;
+ display: inline-block;
+ overflow: hidden;
+ width: 24rpx;
+ height: 24rpx;
+ left: -12rpx;
+ right: initial;
+ background-color: inherit;
+ filter: blur(5rpx);
+ opacity: 0.3;
+}
+
+.cu-chat .cu-item>.main .content:not([class*="bg-"])::before {
+ background-color: #333333;
+ opacity: 0.1;
+}
+
+.cu-chat .cu-item.self>.main .content::before {
+ left: auto;
+ right: -12rpx;
+}
+
+.cu-chat .cu-item.self {
+ justify-content: flex-end;
+ text-align: right;
+}
+
+.cu-chat .cu-info {
+ display: inline-block;
+ margin: 20rpx auto;
+ font-size: 24rpx;
+ padding: 8rpx 12rpx;
+ background-color: rgba(0, 0, 0, 0.2);
+ border-radius: 6rpx;
+ color: #ffffff;
+ max-width: 400rpx;
+ line-height: 1.4;
+}
+
+/* ==================
+ 卡片
+ ==================== */
+
+.cu-card {
+ display: block;
+ overflow: hidden;
+}
+
+.cu-card>.cu-item {
+ display: block;
+ background-color: #ffffff;
+ overflow: hidden;
+ border-radius: 10rpx;
+ margin: 30rpx;
+}
+
+.cu-card>.cu-item.shadow-blur {
+ overflow: initial;
+}
+
+.cu-card.no-card>.cu-item {
+ margin: 0rpx;
+ border-radius: 0rpx;
+}
+
+.cu-card .grid.grid-square {
+ margin-bottom: -20rpx;
+}
+
+.cu-card.case .image {
+ position: relative;
+}
+
+.cu-card.case .image image {
+ width: 100%;
+}
+
+.cu-card.case .image .cu-tag {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.cu-card.case .image .cu-bar {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ background-color: transparent;
+ padding: 0rpx 30rpx;
+}
+
+.cu-card.case.no-card .image {
+ margin: 30rpx 30rpx 0;
+ overflow: hidden;
+ border-radius: 10rpx;
+}
+
+.cu-card.dynamic {
+ display: block;
+}
+
+.cu-card.dynamic>.cu-item {
+ display: block;
+ background-color: #ffffff;
+ overflow: hidden;
+}
+
+.cu-card.dynamic>.cu-item>.text-content {
+ padding: 0 30rpx 0;
+ max-height: 6.4em;
+ overflow: hidden;
+ font-size: 30rpx;
+ margin-bottom: 20rpx;
+}
+
+.cu-card.dynamic>.cu-item .square-img {
+ width: 100%;
+ height: 200rpx;
+ border-radius: 6rpx;
+}
+
+.cu-card.dynamic>.cu-item .only-img {
+ width: 100%;
+ height: 320rpx;
+ border-radius: 6rpx;
+}
+
+/* card.dynamic>.cu-item .comment {
+ padding: 20rpx;
+ background-color: #f1f1f1;
+ margin: 0 30rpx 30rpx;
+ border-radius: 6rpx;
+} */
+
+.cu-card.article {
+ display: block;
+}
+
+.cu-card.article>.cu-item {
+ padding-bottom: 30rpx;
+}
+
+.cu-card.article>.cu-item .title {
+ font-size: 30rpx;
+ font-weight: 900;
+ color: #333333;
+ line-height: 100rpx;
+ padding: 0 30rpx;
+}
+
+.cu-card.article>.cu-item .content {
+ display: flex;
+ padding: 0 30rpx;
+}
+
+.cu-card.article>.cu-item .content>image {
+ width: 240rpx;
+ height: 6.4em;
+ margin-right: 20rpx;
+ border-radius: 6rpx;
+}
+
+.cu-card.article>.cu-item .content .desc {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.cu-card.article>.cu-item .content .text-content {
+ font-size: 28rpx;
+ color: #888;
+ height: 4.8em;
+ overflow: hidden;
+}
+
+/* ==================
+ 表单
+ ==================== */
+
+.cu-form-group {
+ background-color: #ffffff;
+ padding: 1rpx 30rpx;
+ display: flex;
+ align-items: center;
+ min-height: 100rpx;
+ justify-content: space-between;
+}
+
+.cu-form-group+.cu-form-group {
+ border-top: 1rpx solid #eee;
+}
+
+.cu-form-group .title {
+ text-align: justify;
+ padding-right: 30rpx;
+ font-size: 30rpx;
+ position: relative;
+ height: 60rpx;
+ line-height: 60rpx;
+}
+
+.cu-form-group input {
+ flex: 1;
+ font-size: 30rpx;
+ color: #555;
+ padding-right: 20rpx;
+}
+
+.cu-form-group>text[class*="cuIcon-"] {
+ font-size: 36rpx;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+.cu-form-group textarea {
+ margin: 32rpx 0 30rpx;
+ height: 4.6em;
+ width: 100%;
+ line-height: 1.2em;
+ flex: 1;
+ font-size: 28rpx;
+ padding: 0;
+}
+
+.cu-form-group.align-start .title {
+ height: 1em;
+ margin-top: 32rpx;
+ line-height: 1em;
+}
+
+.cu-form-group picker {
+ flex: 1;
+ padding-right: 40rpx;
+ overflow: hidden;
+ position: relative;
+}
+
+.cu-form-group picker .picker {
+ line-height: 100rpx;
+ font-size: 28rpx;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+ width: 100%;
+ text-align: right;
+}
+
+.cu-form-group picker::after {
+ font-family: cuIcon;
+ display: block;
+ content: "\e6a3";
+ position: absolute;
+ font-size: 34rpx;
+ color: #8799a3;
+ line-height: 100rpx;
+ width: 60rpx;
+ text-align: center;
+ top: 0;
+ bottom: 0;
+ right: -20rpx;
+ margin: auto;
+}
+
+.cu-form-group textarea[disabled],
+.cu-form-group textarea[disabled] .placeholder {
+ color: transparent;
+}
+
+/* ==================
+ 模态窗口
+ ==================== */
+
+.cu-modal {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ z-index: 0;
+ opacity: 0;
+ outline: 0;
+ text-align: center;
+ -ms-transform: scale(1.185);
+ transform: scale(1.185);
+ backface-visibility: hidden;
+ perspective: 2000rpx;
+ background: rgba(0, 0, 0, 0.6);
+ transition: all 0.3s ease-in-out 0s;
+ pointer-events: none;
+}
+
+.cu-modal::before {
+ content: "\200B";
+ display: inline-block;
+ height: 100%;
+ vertical-align: middle;
+}
+
+.cu-modal.show {
+ opacity: 1;
+ transition-duration: 0.3s;
+ -ms-transform: scale(1);
+ transform: scale(1);
+ overflow-x: hidden;
+ overflow-y: auto;
+ pointer-events: auto;
+}
+
+.cu-dialog {
+ position: relative;
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: auto;
+ margin-right: auto;
+ width: 680rpx;
+ max-width: 100%;
+ background-color: #f8f8f8;
+ border-radius: 10rpx;
+ overflow: hidden;
+}
+
+.cu-modal.bottom-modal::before {
+ vertical-align: bottom;
+}
+
+.cu-modal.bottom-modal .cu-dialog {
+ width: 100%;
+ border-radius: 0;
+}
+
+.cu-modal.bottom-modal {
+ margin-bottom: -1000rpx;
+}
+
+.cu-modal.bottom-modal.show {
+ margin-bottom: 0;
+}
+
+.cu-modal.drawer-modal {
+ transform: scale(1);
+ display: flex;
+}
+
+.cu-modal.drawer-modal .cu-dialog {
+ height: 100%;
+ min-width: 200rpx;
+ border-radius: 0;
+ margin: initial;
+ transition-duration: 0.3s;
+}
+
+.cu-modal.drawer-modal.justify-start .cu-dialog {
+ transform: translateX(-100%);
+}
+
+.cu-modal.drawer-modal.justify-end .cu-dialog {
+ transform: translateX(100%);
+}
+
+.cu-modal.drawer-modal.show .cu-dialog {
+ transform: translateX(0%);
+}
+
+.cu-modal .cu-dialog>.cu-bar:first-child .action {
+ min-width: 100rpx;
+ margin-right: 0;
+ min-height: 100rpx;
+}
+
+/* ==================
+ 轮播
+ ==================== */
+swiper .a-swiper-dot {
+ display: inline-block;
+ width: 16rpx;
+ height: 16rpx;
+ background: rgba(0, 0, 0, .3);
+ border-radius: 50%;
+ vertical-align: middle;
+}
+
+swiper[class*="-dot"] .wx-swiper-dots,
+swiper[class*="-dot"] .a-swiper-dots,
+swiper[class*="-dot"] .uni-swiper-dots {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ justify-content: center;
+}
+
+swiper.square-dot .wx-swiper-dot,
+swiper.square-dot .a-swiper-dot,
+swiper.square-dot .uni-swiper-dot {
+ background-color: #ffffff;
+ opacity: 0.4;
+ width: 10rpx;
+ height: 10rpx;
+ border-radius: 20rpx;
+ margin: 0 8rpx !important;
+}
+
+swiper.square-dot .wx-swiper-dot.wx-swiper-dot-active,
+swiper.square-dot .a-swiper-dot.a-swiper-dot-active,
+swiper.square-dot .uni-swiper-dot.uni-swiper-dot-active {
+ opacity: 1;
+ width: 30rpx;
+}
+
+swiper.round-dot .wx-swiper-dot,
+swiper.round-dot .a-swiper-dot,
+swiper.round-dot .uni-swiper-dot {
+ width: 10rpx;
+ height: 10rpx;
+ position: relative;
+ margin: 4rpx 8rpx !important;
+}
+
+swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active::after,
+swiper.round-dot .a-swiper-dot.a-swiper-dot-active::after,
+swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active::after {
+ content: "";
+ position: absolute;
+ width: 10rpx;
+ height: 10rpx;
+ top: 0rpx;
+ left: 0rpx;
+ right: 0;
+ bottom: 0;
+ margin: auto;
+ background-color: #ffffff;
+ border-radius: 20rpx;
+}
+
+swiper.round-dot .wx-swiper-dot.wx-swiper-dot-active,
+swiper.round-dot .a-swiper-dot.a-swiper-dot-active,
+swiper.round-dot .uni-swiper-dot.uni-swiper-dot-active {
+ width: 18rpx;
+ height: 18rpx;
+}
+
+.screen-swiper {
+ min-height: 375rpx;
+}
+
+.screen-swiper image,
+.screen-swiper video,
+.swiper-item image,
+.swiper-item video {
+ width: 100%;
+ display: block;
+ height: 100%;
+ margin: 0;
+ pointer-events: none;
+}
+
+.card-swiper {
+ height: 420rpx !important;
+}
+
+.card-swiper swiper-item {
+ width: 610rpx !important;
+ left: 70rpx;
+ box-sizing: border-box;
+ padding: 40rpx 0rpx 70rpx;
+ overflow: initial;
+}
+
+.card-swiper swiper-item .swiper-item {
+ width: 100%;
+ display: block;
+ height: 100%;
+ border-radius: 10rpx;
+ transform: scale(0.9);
+ transition: all 0.2s ease-in 0s;
+ overflow: hidden;
+}
+
+.card-swiper swiper-item.cur .swiper-item {
+ transform: none;
+ transition: all 0.2s ease-in 0s;
+}
+
+
+.tower-swiper {
+ height: 420rpx;
+ position: relative;
+ max-width: 750rpx;
+ overflow: hidden;
+}
+
+.tower-swiper .tower-item {
+ position: absolute;
+ width: 300rpx;
+ height: 380rpx;
+ top: 0;
+ bottom: 0;
+ left: 50%;
+ margin: auto;
+ transition: all 0.2s ease-in 0s;
+ opacity: 1;
+}
+
+.tower-swiper .tower-item.none {
+ opacity: 0;
+}
+
+.tower-swiper .tower-item .swiper-item {
+ width: 100%;
+ height: 100%;
+ border-radius: 6rpx;
+ overflow: hidden;
+}
+
+/* ==================
+ 步骤条
+ ==================== */
+
+.cu-steps {
+ display: flex;
+}
+
+scroll-view.cu-steps {
+ display: block;
+ white-space: nowrap;
+}
+
+scroll-view.cu-steps .cu-item {
+ display: inline-block;
+}
+
+.cu-steps .cu-item {
+ flex: 1;
+ text-align: center;
+ position: relative;
+ min-width: 100rpx;
+}
+
+.cu-steps .cu-item:not([class*="text-"]) {
+ color: #8799a3;
+}
+
+.cu-steps .cu-item [class*="cuIcon-"],
+.cu-steps .cu-item .num {
+ display: block;
+ font-size: 40rpx;
+ line-height: 80rpx;
+}
+
+.cu-steps .cu-item::before,
+.cu-steps .cu-item::after,
+.cu-steps.steps-arrow .cu-item::before,
+.cu-steps.steps-arrow .cu-item::after {
+ content: "";
+ display: block;
+ position: absolute;
+ height: 0px;
+ width: calc(100% - 80rpx);
+ border-bottom: 1px solid #ccc;
+ left: calc(0px - (100% - 80rpx) / 2);
+ top: 40rpx;
+ z-index: 0;
+}
+
+.cu-steps.steps-arrow .cu-item::before,
+.cu-steps.steps-arrow .cu-item::after {
+ content: "\e6a3";
+ font-family: 'cuIcon';
+ height: 30rpx;
+ border-bottom-width: 0px;
+ line-height: 30rpx;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ color: #ccc;
+}
+
+.cu-steps.steps-bottom .cu-item::before,
+.cu-steps.steps-bottom .cu-item::after {
+ bottom: 40rpx;
+ top: initial;
+}
+
+.cu-steps .cu-item::after {
+ border-bottom: 1px solid currentColor;
+ width: 0px;
+ transition: all 0.3s ease-in-out 0s;
+}
+
+.cu-steps .cu-item[class*="text-"]::after {
+ width: calc(100% - 80rpx);
+ color: currentColor;
+}
+
+.cu-steps .cu-item:first-child::before,
+.cu-steps .cu-item:first-child::after {
+ display: none;
+}
+
+.cu-steps .cu-item .num {
+ width: 40rpx;
+ height: 40rpx;
+ border-radius: 50%;
+ line-height: 40rpx;
+ margin: 20rpx auto;
+ font-size: 24rpx;
+ border: 1px solid currentColor;
+ position: relative;
+ overflow: hidden;
+}
+
+.cu-steps .cu-item[class*="text-"] .num {
+ background-color: currentColor;
+}
+
+.cu-steps .cu-item .num::before,
+.cu-steps .cu-item .num::after {
+ content: attr(data-index);
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ transition: all 0.3s ease-in-out 0s;
+ transform: translateY(0rpx);
+}
+
+.cu-steps .cu-item[class*="text-"] .num::before {
+ transform: translateY(-40rpx);
+ color: #ffffff;
+}
+
+.cu-steps .cu-item .num::after {
+ transform: translateY(40rpx);
+ color: #ffffff;
+ transition: all 0.3s ease-in-out 0s;
+}
+
+.cu-steps .cu-item[class*="text-"] .num::after {
+ content: "\e645";
+ font-family: 'cuIcon';
+ color: #ffffff;
+ transform: translateY(0rpx);
+}
+
+.cu-steps .cu-item[class*="text-"] .num.err::after {
+ content: "\e646";
+}
+
+/* ==================
+ 布局
+ ==================== */
+
+/* -- flex弹性布局 -- */
+
+.flex {
+ display: flex;
+}
+
+.basis-xs {
+ flex-basis: 20%;
+}
+
+.basis-sm {
+ flex-basis: 40%;
+}
+
+.basis-df {
+ flex-basis: 50%;
+}
+
+.basis-lg {
+ flex-basis: 60%;
+}
+
+.basis-xl {
+ flex-basis: 80%;
+}
+
+.flex-sub {
+ flex: 1;
+}
+
+.flex-twice {
+ flex: 2;
+}
+
+.flex-treble {
+ flex: 3;
+}
+
+.flex-direction {
+ flex-direction: column;
+}
+
+.flex-wrap {
+ flex-wrap: wrap;
+}
+
+.align-start {
+ align-items: flex-start;
+}
+
+.align-end {
+ align-items: flex-end;
+}
+
+.align-center {
+ align-items: center;
+}
+
+.align-stretch {
+ align-items: stretch;
+}
+
+.self-start {
+ align-self: flex-start;
+}
+
+.self-center {
+ align-self: flex-center;
+}
+
+.self-end {
+ align-self: flex-end;
+}
+
+.self-stretch {
+ align-self: stretch;
+}
+
+.align-stretch {
+ align-items: stretch;
+}
+
+.justify-start {
+ justify-content: flex-start;
+}
+
+.justify-end {
+ justify-content: flex-end;
+}
+
+.justify-center {
+ justify-content: center;
+}
+
+.justify-between {
+ justify-content: space-between;
+}
+
+.justify-around {
+ justify-content: space-around;
+}
+
+/* grid布局 */
+
+.grid {
+ display: flex;
+ flex-wrap: wrap;
+}
+
+.grid.grid-square {
+ overflow: hidden;
+}
+
+.grid.grid-square .cu-tag {
+ position: absolute;
+ right: 0;
+ top: 0;
+ border-bottom-left-radius: 6rpx;
+ padding: 6rpx 12rpx;
+ height: auto;
+ background-color: rgba(0, 0, 0, 0.5);
+}
+
+.grid.grid-square>view>text[class*="cuIcon-"] {
+ font-size: 52rpx;
+ position: absolute;
+ color: #8799a3;
+ margin: auto;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+}
+
+.grid.grid-square>view {
+ margin-right: 20rpx;
+ margin-bottom: 20rpx;
+ border-radius: 6rpx;
+ position: relative;
+ overflow: hidden;
+}
+
+.grid.grid-square>view.bg-img image {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+}
+
+.grid.col-1.grid-square>view {
+ padding-bottom: 100%;
+ height: 0;
+ margin-right: 0;
+}
+
+.grid.col-2.grid-square>view {
+ padding-bottom: calc((100% - 20rpx)/2);
+ height: 0;
+ width: calc((100% - 20rpx)/2);
+}
+
+.grid.col-3.grid-square>view {
+ padding-bottom: calc((100% - 40rpx)/3);
+ height: 0;
+ width: calc((100% - 40rpx)/3);
+}
+
+.grid.col-4.grid-square>view {
+ padding-bottom: calc((100% - 60rpx)/4);
+ height: 0;
+ width: calc((100% - 60rpx)/4);
+}
+
+.grid.col-5.grid-square>view {
+ padding-bottom: calc((100% - 80rpx)/5);
+ height: 0;
+ width: calc((100% - 80rpx)/5);
+}
+
+.grid.col-2.grid-square>view:nth-child(2n),
+.grid.col-3.grid-square>view:nth-child(3n),
+.grid.col-4.grid-square>view:nth-child(4n),
+.grid.col-5.grid-square>view:nth-child(5n) {
+ margin-right: 0;
+}
+
+.grid.col-1>view {
+ width: 100%;
+}
+
+.grid.col-2>view {
+ width: 50%;
+}
+
+.grid.col-3>view {
+ width: 33.33%;
+}
+
+.grid.col-4>view {
+ width: 25%;
+}
+
+.grid.col-5>view {
+ width: 20%;
+}
+
+/* -- 内外边距 -- */
+
+.margin-0 {
+ margin: 0;
+}
+
+.margin-xs {
+ margin: 10rpx;
+}
+
+.margin-sm {
+ margin: 20rpx;
+}
+
+.margin {
+ margin: 30rpx;
+}
+
+.margin-lg {
+ margin: 40rpx;
+}
+
+.margin-xl {
+ margin: 50rpx;
+}
+
+.margin-top-xs {
+ margin-top: 10rpx;
+}
+
+.margin-top-sm {
+ margin-top: 20rpx;
+}
+
+.margin-top {
+ margin-top: 30rpx;
+}
+
+.margin-top-lg {
+ margin-top: 40rpx;
+}
+
+.margin-top-xl {
+ margin-top: 50rpx;
+}
+
+.margin-right-xs {
+ margin-right: 10rpx;
+}
+
+.margin-right-sm {
+ margin-right: 20rpx;
+}
+
+.margin-right {
+ margin-right: 30rpx;
+}
+
+.margin-right-lg {
+ margin-right: 40rpx;
+}
+
+.margin-right-xl {
+ margin-right: 50rpx;
+}
+
+.margin-bottom-xs {
+ margin-bottom: 10rpx;
+}
+
+.margin-bottom-sm {
+ margin-bottom: 20rpx;
+}
+
+.margin-bottom {
+ margin-bottom: 30rpx;
+}
+
+.margin-bottom-lg {
+ margin-bottom: 40rpx;
+}
+
+.margin-bottom-xl {
+ margin-bottom: 50rpx;
+}
+
+.margin-left-xs {
+ margin-left: 10rpx;
+}
+
+.margin-left-sm {
+ margin-left: 20rpx;
+}
+
+.margin-left {
+ margin-left: 30rpx;
+}
+
+.margin-left-lg {
+ margin-left: 40rpx;
+}
+
+.margin-left-xl {
+ margin-left: 50rpx;
+}
+
+.margin-lr-xs {
+ margin-left: 10rpx;
+ margin-right: 10rpx;
+}
+
+.margin-lr-sm {
+ margin-left: 20rpx;
+ margin-right: 20rpx;
+}
+
+.margin-lr {
+ margin-left: 30rpx;
+ margin-right: 30rpx;
+}
+
+.margin-lr-lg {
+ margin-left: 40rpx;
+ margin-right: 40rpx;
+}
+
+.margin-lr-xl {
+ margin-left: 50rpx;
+ margin-right: 50rpx;
+}
+
+.margin-tb-xs {
+ margin-top: 10rpx;
+ margin-bottom: 10rpx;
+}
+
+.margin-tb-sm {
+ margin-top: 20rpx;
+ margin-bottom: 20rpx;
+}
+
+.margin-tb {
+ margin-top: 30rpx;
+ margin-bottom: 30rpx;
+}
+
+.margin-tb-lg {
+ margin-top: 40rpx;
+ margin-bottom: 40rpx;
+}
+
+.margin-tb-xl {
+ margin-top: 50rpx;
+ margin-bottom: 50rpx;
+}
+
+.padding-0 {
+ padding: 0;
+}
+
+.padding-xs {
+ padding: 10rpx;
+}
+
+.padding-sm {
+ padding: 20rpx;
+}
+
+.padding {
+ padding: 30rpx;
+}
+
+.padding-lg {
+ padding: 40rpx;
+}
+
+.padding-xl {
+ padding: 50rpx;
+}
+
+.padding-top-xs {
+ padding-top: 10rpx;
+}
+
+.padding-top-sm {
+ padding-top: 20rpx;
+}
+
+.padding-top {
+ padding-top: 30rpx;
+}
+
+.padding-top-lg {
+ padding-top: 40rpx;
+}
+
+.padding-top-xl {
+ padding-top: 50rpx;
+}
+
+.padding-right-xs {
+ padding-right: 10rpx;
+}
+
+.padding-right-sm {
+ padding-right: 20rpx;
+}
+
+.padding-right {
+ padding-right: 30rpx;
+}
+
+.padding-right-lg {
+ padding-right: 40rpx;
+}
+
+.padding-right-xl {
+ padding-right: 50rpx;
+}
+
+.padding-bottom-xs {
+ padding-bottom: 10rpx;
+}
+
+.padding-bottom-sm {
+ padding-bottom: 20rpx;
+}
+
+.padding-bottom {
+ padding-bottom: 30rpx;
+}
+
+.padding-bottom-lg {
+ padding-bottom: 40rpx;
+}
+
+.padding-bottom-xl {
+ padding-bottom: 50rpx;
+}
+
+.padding-left-xs {
+ padding-left: 10rpx;
+}
+
+.padding-left-sm {
+ padding-left: 20rpx;
+}
+
+.padding-left {
+ padding-left: 30rpx;
+}
+
+.padding-left-lg {
+ padding-left: 40rpx;
+}
+
+.padding-left-xl {
+ padding-left: 50rpx;
+}
+
+.padding-lr-xs {
+ padding-left: 10rpx;
+ padding-right: 10rpx;
+}
+
+.padding-lr-sm {
+ padding-left: 20rpx;
+ padding-right: 20rpx;
+}
+
+.padding-lr {
+ padding-left: 30rpx;
+ padding-right: 30rpx;
+}
+
+.padding-lr-lg {
+ padding-left: 40rpx;
+ padding-right: 40rpx;
+}
+
+.padding-lr-xl {
+ padding-left: 50rpx;
+ padding-right: 50rpx;
+}
+
+.padding-tb-xs {
+ padding-top: 10rpx;
+ padding-bottom: 10rpx;
+}
+
+.padding-tb-sm {
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
+}
+
+.padding-tb {
+ padding-top: 30rpx;
+ padding-bottom: 30rpx;
+}
+
+.padding-tb-lg {
+ padding-top: 40rpx;
+ padding-bottom: 40rpx;
+}
+
+.padding-tb-xl {
+ padding-top: 50rpx;
+ padding-bottom: 50rpx;
+}
+
+/* -- 浮动 -- */
+
+.cf::after,
+.cf::before {
+ content: " ";
+ display: table;
+}
+
+.cf::after {
+ clear: both;
+}
+
+.fl {
+ float: left;
+}
+
+.fr {
+ float: right;
+}
+
+/* ==================
+ 背景
+ ==================== */
+
+.line-red::after,
+.lines-red::after {
+ border-color: #e54d42;
+}
+
+.line-orange::after,
+.lines-orange::after {
+ border-color: #f37b1d;
+}
+
+.line-yellow::after,
+.lines-yellow::after {
+ border-color: #fbbd08;
+}
+
+.line-olive::after,
+.lines-olive::after {
+ border-color: #8dc63f;
+}
+
+.line-green::after,
+.lines-green::after {
+ border-color: #39b54a;
+}
+
+.line-cyan::after,
+.lines-cyan::after {
+ border-color: #1cbbb4;
+}
+
+.line-blue::after,
+.lines-blue::after {
+ border-color: #0081ff;
+}
+
+.line-purple::after,
+.lines-purple::after {
+ border-color: #6739b6;
+}
+
+.line-mauve::after,
+.lines-mauve::after {
+ border-color: #9c26b0;
+}
+
+.line-pink::after,
+.lines-pink::after {
+ border-color: #e03997;
+}
+
+.line-brown::after,
+.lines-brown::after {
+ border-color: #a5673f;
+}
+
+.line-grey::after,
+.lines-grey::after {
+ border-color: #8799a3;
+}
+
+.line-gray::after,
+.lines-gray::after {
+ border-color: #aaaaaa;
+}
+
+.line-black::after,
+.lines-black::after {
+ border-color: #333333;
+}
+
+.line-white::after,
+.lines-white::after {
+ border-color: #ffffff;
+}
+
+.bg-red {
+ background-color: #e54d42;
+ color: #ffffff;
+}
+
+.bg-orange {
+ background-color: #f37b1d;
+ color: #ffffff;
+}
+
+.bg-yellow {
+ background-color: #fbbd08;
+ color: #333333;
+}
+
+.bg-olive {
+ background-color: #8dc63f;
+ color: #ffffff;
+}
+
+.bg-green {
+ background-color: #39b54a;
+ color: #ffffff;
+}
+
+.bg-cyan {
+ background-color: #1cbbb4;
+ color: #ffffff;
+}
+
+.bg-blue {
+ background-color: #0081ff;
+ color: #ffffff;
+}
+
+.bg-purple {
+ background-color: #6739b6;
+ color: #ffffff;
+}
+
+.bg-mauve {
+ background-color: #9c26b0;
+ color: #ffffff;
+}
+
+.bg-pink {
+ background-color: #e03997;
+ color: #ffffff;
+}
+
+.bg-brown {
+ background-color: #a5673f;
+ color: #ffffff;
+}
+
+.bg-grey {
+ background-color: #8799a3;
+ color: #ffffff;
+}
+
+.bg-gray {
+ background-color: #f0f0f0;
+ color: #333333;
+}
+
+.bg-black {
+ background-color: #333333;
+ color: #ffffff;
+}
+
+.bg-white {
+ background-color: #ffffff;
+ color: #666666;
+}
+
+.bg-shadeTop {
+ background-image: linear-gradient(rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.01));
+ color: #ffffff;
+}
+
+.bg-shadeBottom {
+ background-image: linear-gradient(rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 1));
+ color: #ffffff;
+}
+
+.bg-red.light {
+ color: #e54d42;
+ background-color: #fadbd9;
+}
+
+.bg-orange.light {
+ color: #f37b1d;
+ background-color: #fde6d2;
+}
+
+.bg-yellow.light {
+ color: #fbbd08;
+ background-color: #fef2ced2;
+}
+
+.bg-olive.light {
+ color: #8dc63f;
+ background-color: #e8f4d9;
+}
+
+.bg-green.light {
+ color: #39b54a;
+ background-color: #d7f0dbff;
+}
+
+.bg-cyan.light {
+ color: #1cbbb4;
+ background-color: #d2f1f0;
+}
+
+.bg-blue.light {
+ color: #0081ff;
+ background-color: #cce6ff;
+}
+
+.bg-purple.light {
+ color: #6739b6;
+ background-color: #e1d7f0;
+}
+
+.bg-mauve.light {
+ color: #9c26b0;
+ background-color: #ebd4ef;
+}
+
+.bg-pink.light {
+ color: #e03997;
+ background-color: #f9d7ea;
+}
+
+.bg-brown.light {
+ color: #a5673f;
+ background-color: #ede1d9;
+}
+
+.bg-grey.light {
+ color: #8799a3;
+ background-color: #e7ebed;
+}
+
+.bg-gradual-red {
+ background-image: linear-gradient(45deg, #f43f3b, #ec008c);
+ color: #ffffff;
+}
+
+.bg-gradual-orange {
+ background-image: linear-gradient(45deg, #ff9700, #ed1c24);
+ color: #ffffff;
+}
+
+.bg-gradual-green {
+ background-image: linear-gradient(45deg, #39b54a, #8dc63f);
+ color: #ffffff;
+}
+
+.bg-gradual-purple {
+ background-image: linear-gradient(45deg, #9000ff, #5e00ff);
+ color: #ffffff;
+}
+
+.bg-gradual-pink {
+ background-image: linear-gradient(45deg, #ec008c, #6739b6);
+ color: #ffffff;
+}
+
+.bg-gradual-blue {
+ background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
+ color: #ffffff;
+}
+
+.shadow[class*="-red"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(204, 69, 59, 0.2);
+}
+
+.shadow[class*="-orange"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(217, 109, 26, 0.2);
+}
+
+.shadow[class*="-yellow"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(224, 170, 7, 0.2);
+}
+
+.shadow[class*="-olive"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(124, 173, 55, 0.2);
+}
+
+.shadow[class*="-green"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(48, 156, 63, 0.2);
+}
+
+.shadow[class*="-cyan"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(28, 187, 180, 0.2);
+}
+
+.shadow[class*="-blue"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(0, 102, 204, 0.2);
+}
+
+.shadow[class*="-purple"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(88, 48, 156, 0.2);
+}
+
+.shadow[class*="-mauve"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(133, 33, 150, 0.2);
+}
+
+.shadow[class*="-pink"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(199, 50, 134, 0.2);
+}
+
+.shadow[class*="-brown"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(140, 88, 53, 0.2);
+}
+
+.shadow[class*="-grey"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(114, 130, 138, 0.2);
+}
+
+.shadow[class*="-gray"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(114, 130, 138, 0.2);
+}
+
+.shadow[class*="-black"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(26, 26, 26, 0.2);
+}
+
+.shadow[class*="-white"] {
+ box-shadow: 6rpx 6rpx 8rpx rgba(26, 26, 26, 0.2);
+}
+
+.text-shadow[class*="-red"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(204, 69, 59, 0.2);
+}
+
+.text-shadow[class*="-orange"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(217, 109, 26, 0.2);
+}
+
+.text-shadow[class*="-yellow"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(224, 170, 7, 0.2);
+}
+
+.text-shadow[class*="-olive"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(124, 173, 55, 0.2);
+}
+
+.text-shadow[class*="-green"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(48, 156, 63, 0.2);
+}
+
+.text-shadow[class*="-cyan"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(28, 187, 180, 0.2);
+}
+
+.text-shadow[class*="-blue"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(0, 102, 204, 0.2);
+}
+
+.text-shadow[class*="-purple"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(88, 48, 156, 0.2);
+}
+
+.text-shadow[class*="-mauve"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(133, 33, 150, 0.2);
+}
+
+.text-shadow[class*="-pink"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(199, 50, 134, 0.2);
+}
+
+.text-shadow[class*="-brown"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(140, 88, 53, 0.2);
+}
+
+.text-shadow[class*="-grey"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(114, 130, 138, 0.2);
+}
+
+.text-shadow[class*="-gray"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(114, 130, 138, 0.2);
+}
+
+.text-shadow[class*="-black"] {
+ text-shadow: 6rpx 6rpx 8rpx rgba(26, 26, 26, 0.2);
+}
+
+.bg-img {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+
+.bg-mask {
+ background-color: #333333;
+ position: relative;
+}
+
+.bg-mask::after {
+ content: "";
+ border-radius: inherit;
+ width: 100%;
+ height: 100%;
+ display: block;
+ background-color: rgba(0, 0, 0, 0.4);
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ top: 0;
+}
+
+.bg-mask view,
+.bg-mask cover-view {
+ z-index: 5;
+ position: relative;
+}
+
+.bg-video {
+ position: relative;
+}
+
+.bg-video video {
+ display: block;
+ height: 100%;
+ width: 100%;
+ -o-object-fit: cover;
+ object-fit: cover;
+ position: absolute;
+ top: 0;
+ z-index: 0;
+ pointer-events: none;
+}
+
+/* ==================
+ 文本
+ ==================== */
+
+.text-xs {
+ font-size: 20rpx;
+}
+
+.text-sm {
+ font-size: 24rpx;
+}
+
+.text-df {
+ font-size: 28rpx;
+}
+
+.text-lg {
+ font-size: 32rpx;
+}
+
+.text-xl {
+ font-size: 36rpx;
+}
+
+.text-xxl {
+ font-size: 44rpx;
+}
+
+.text-sl {
+ font-size: 80rpx;
+}
+
+.text-xsl {
+ font-size: 120rpx;
+}
+
+.text-Abc {
+ text-transform: Capitalize;
+}
+
+.text-ABC {
+ text-transform: Uppercase;
+}
+
+.text-abc {
+ text-transform: Lowercase;
+}
+
+.text-price::before {
+ content: "¥";
+ font-size: 80%;
+ margin-right: 4rpx;
+}
+
+.text-cut {
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.text-cut2 {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+.text-bold {
+ font-weight: bold;
+}
+
+.text-center {
+ text-align: center;
+}
+
+.text-content {
+ line-height: 1.6;
+}
+
+.text-left {
+ text-align: left;
+}
+
+.text-right {
+ text-align: right;
+}
+
+.text-red,
+.line-red,
+.lines-red {
+ color: #e54d42;
+}
+
+.text-orange,
+.line-orange,
+.lines-orange {
+ color: #f37b1d;
+}
+
+.text-yellow,
+.line-yellow,
+.lines-yellow {
+ color: #fbbd08;
+}
+
+.text-olive,
+.line-olive,
+.lines-olive {
+ color: #8dc63f;
+}
+
+.text-green,
+.line-green,
+.lines-green {
+ color: #39b54a;
+}
+
+.text-cyan,
+.line-cyan,
+.lines-cyan {
+ color: #1cbbb4;
+}
+
+.text-blue,
+.line-blue,
+.lines-blue {
+ color: #0081ff;
+}
+
+.text-purple,
+.line-purple,
+.lines-purple {
+ color: #6739b6;
+}
+
+.text-mauve,
+.line-mauve,
+.lines-mauve {
+ color: #9c26b0;
+}
+
+.text-pink,
+.line-pink,
+.lines-pink {
+ color: #e03997;
+}
+
+.text-brown,
+.line-brown,
+.lines-brown {
+ color: #a5673f;
+}
+
+.text-grey,
+.line-grey,
+.lines-grey {
+ color: #8799a3;
+}
+
+.text-gray,
+.line-gray,
+.lines-gray {
+ color: #aaaaaa;
+}
+
+.text-black,
+.line-black,
+.lines-black {
+ color: #333333;
+}
+
+.text-white,
+.line-white,
+.lines-white {
+ color: #ffffff;
+}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d30c3f1..47cd96d 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -7,38 +7,38 @@
-
+
-
+
今日健康报备
- 老师,您好
-
+ 老师,您好
+
绑定管理班级
-
+
查看报备数据
-
+
年级管理
-
+
班级管理
-
-
+
+
@@ -48,73 +48,85 @@
data() {
return {
school: '',
- userType:4,
- userText:'',
+ userType: 4,
+ userText: '',
}
},
+ onLoad:function(){
+ this.school = uni.getStorageSync('school')
+ },
onShow() {
- this.getUserInfo()
+ if (uni.getStorageSync('token')) {
+ this.getUserInfo()
+ } else {
+ uni.navigateTo({
+ url: '../login/login'
+ })
+ }
},
methods: {
- logout(){
- //用户退出,清楚缓存信息
+ logout() {
+ //用户退出,清楚缓存信息
uni.removeStorageSync('token')
- uni.removeStorageSync("userType")
- uni.removeStorageSync("uid")
- uni.removeStorageSync("class_id")
- uni.removeStorageSync("stu_num")
- uni.removeStorageSync("stu_name")
-
+ uni.removeStorageSync("userType")
+ uni.removeStorageSync("uid")
+ uni.removeStorageSync("class_id")
+ uni.removeStorageSync("stu_num")
+ uni.removeStorageSync("stu_name")
+
uni.navigateTo({
- url: '/pages/login/login'
+ url: '/pages/login/login'
});
},
- setUserText(userType){
+ setUserText(userType) {
const userOptionDB = {
- 0:'老师',
- 1:'学生',
- 2:'家长',
- 3:'管理员',
+ 0: '老师',
+ 1: '学生',
+ 2: '家长',
+ 3: '管理员',
}
return userOptionDB[userType];
},
- getUserInfo(){
- console.log("getUserInfo begin")
+ getUserInfo() {
+ console.log("getUserInfo begin")
uni.showLoading({
title: '加载中...'
});
-
- let token = uni.getStorageSync('token')
-
- if(token){
- uniCloud.callFunction({
- name: 'validateToken',
- data: {
- token: uni.getStorageSync('token')
- }
- }).then((res) => {
- console.log("validateToken",res.result.data)
- try{
- const { userType,school } = res.result.data;
- this.school = school;
- this.userType = userType;
- this.userText = this.setUserText(userType)
- }catch(e){
- throw new Error("参数错误请重新登录");
- }
- uni.hideLoading()
- }).catch((err) => {
- uni.hideLoading()
- uni.showModal({
- content: '请求云函数发生错误,' + err.message,
- showCancel: false
- })
- })
- }else{
- uni.navigateTo({
- url:"../login/login"
- })
- }
+
+ let token = uni.getStorageSync('token')
+
+ if (token) {
+ uniCloud.callFunction({
+ name: 'validateToken',
+ data: {
+ token: uni.getStorageSync('token')
+ }
+ }).then((res) => {
+ console.log("validateToken", res.result.data)
+ try {
+ const {
+ userType,
+ school
+ } = res.result.data;
+ this.school = school;
+ this.userType = userType;
+ this.userText = this.setUserText(userType)
+ } catch (e) {
+ throw new Error("参数错误请重新登录");
+ }
+ uni.hideLoading()
+ }).catch((err) => {
+ uni.hideLoading()
+ uni.showModal({
+ content: '请求云函数发生错误,' + err.message,
+ showCancel: false
+ })
+ })
+ } else {
+ uni.navigateTo({
+ url: "../login/login"
+ })
+ }
}
}
}
@@ -140,7 +152,8 @@
.text-area {
text-align: center;
}
- .tipText{
+
+ .tipText {
text-align: left;
margin: 40upx 0;
}
@@ -150,29 +163,32 @@
text-align: center;
font-weight: bold;
margin-bottom: 30upx;
- padding: 20px 0px;
+ padding: 20px 0px;
+
+ }
+ .buttonGroup {
+ width: 100%;
+ margin-bottom: 40upx;
}
-
- .buttonGroup{ width: 100%; margin-bottom:40upx ;}
- .buttonGroup .linkBtn{
+
+ .buttonGroup .linkBtn {
font-size: 30upx;
display: block;
line-height: 80upx;
margin: 0 auto;
- width:90%;
+ width: 90%;
text-align: center;
- margin-bottom: 20upx;
- border-radius: 40upx;
- box-shadow: 0 3px 5px rgba(5,26,180,0.35);
+ margin-bottom: 20upx;
+ border-radius: 40upx;
+ box-shadow: 0 3px 5px rgba(5, 26, 180, 0.35);
font-weight: bold;
background: linear-gradient(135deg, #576FEC 0%, #576FEC 76%, #536DEC 76%);
color: #fff;
}
- .logOutBtn{ flex: 1; width: 90%;margin-top: 20upx;}
-
- .welcome{
- padding-left: 22px;
- margin-bottom: 35px;
- }
-
+
+ .welcome {
+ padding-left: 22px;
+ margin-bottom: 35px;
+ }
+
diff --git a/pages/list/list.vue b/pages/list/list.vue
index 20096b9..2d08dee 100644
--- a/pages/list/list.vue
+++ b/pages/list/list.vue
@@ -17,7 +17,7 @@
class="list"
:class="{ listBgc: index % 2 == 0, listOne: index == 0, listFinally: index == stat - 1 }"
v-for="(item, index) in arr"
- :key="item"
+ :key="index"
>
学号:{{ item.stu_num }}
@@ -60,9 +60,15 @@ export default {
uniCalendar
},
onLoad(data) {
- this.class_id = uni.getStorageSync("class_id")
- this.time = myDate.getFullYear() + '/' + (myDate.getMonth() + 1) + '/' + myDate.getDate();
- this.http();
+ if (uni.getStorageSync('token')) {
+ this.class_id = uni.getStorageSync("class_id")
+ this.time = myDate.getFullYear() + '/' + (myDate.getMonth() + 1) + '/' + myDate.getDate();
+ this.http();
+ }else{
+ uni.navigateTo({
+ url:'../login/login'
+ })
+ }
},
methods: {
change(e) {
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 6a72d79..36f0d43 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -1,20 +1,13 @@
-
- 学生健康报备系统
+ {{school}}学生健康报备系统
-
+
@@ -23,7 +16,7 @@
老师登录,查看自己班级的学生健康数据统计
-
+
@@ -37,13 +30,13 @@
家长登录代替孩子填写每日健康状况
-
+
-
+
@@ -51,20 +44,12 @@
-
- 没有账号?前往注册
-
-
-
-
-
+
+
+ 没有账号?前往注册
+
+
-
- 提示:老师可通过测试账号快速体验,用户名:111,密码:111111
-
@@ -87,13 +72,14 @@
{
name: '家长',
icon: 'cuIcon-wifi'
+ },
+ {
+ name: '管理员',
+ icon: 'cuIcon-wifi'
}
- // {
- // name: '管理员',
- // icon: 'cuIcon-wifi'
- // }
],
userType: 0,
+ school:''
};
},
components: {
@@ -102,6 +88,7 @@
},
computed: {},
onLoad() {
+ this.school = uni.getStorageSync('school')
},
methods: {
tabChange(index) {
@@ -113,22 +100,6 @@
password,
userType,
} = this
-
- if (username.length < 3) {
- uni.showModal({
- content: '用户名长度均不能小于3',
- showCancel: false
- })
- return
- }
-
- if (password.length < 6) {
- uni.showModal({
- content: '密码长度均不能小于6',
- showCancel: false
- })
- return
- }
uni.showLoading({
title: '登录中...'
})
@@ -140,44 +111,57 @@
userType,
},
}).then((res) => {
- console.log('返回的',res);
+ console.log('返回的', res);
uni.hideLoading()
if (res.result.status !== 0) {
return Promise.reject(new Error(res.result.msg))
}
uni.setStorageSync('token', res.result.token)
- uni.setStorageSync('uid', res.result.uid)
- uni.setStorageSync("userType",this.userType)
+ uni.setStorageSync('uid', res.result.uid)
+ uni.setStorageSync("userType", this.userType)
uni.showModal({
content: '登录成功',
showCancel: false
})
-
- if(!res.result.class_id){
- if(this.userType==0){
- uni.navigateTo({
- url: '/pages/teacher_bind/teacher_bind'
- });
- }else if(this.userType==1 || this.userType==2){
- uni.navigateTo({
- url:'/pages/student_bind/student_bind'
- })
- }
- }else{
- uni.setStorageSync("class_id",res.result.class_id)
-
- if(this.userType==1 || this.userType==2){
- uni.setStorageSync("stu_num",res.result.stu_num)
- uni.setStorageSync("stu_name",res.result.stu_name)
- }
-
- uni.navigateTo({
- url: '/pages/index/index'
- });
- }
-
-
+
+ if (!res.result.class_id) {
+ switch (this.userType){
+ case 0:
+ uni.navigateTo({
+ url: '/pages/teacher_bind/teacher_bind'
+ });
+ break;
+ case 1:
+ uni.navigateTo({
+ url: '/pages/student_bind/student_bind'
+ })
+ break;
+ case 2:
+ uni.navigateTo({
+ url: '/pages/student_bind/student_bind'
+ })
+ break;
+ case 3:
+ uni.navigateTo({
+ url: '/pages/administrator/admin_grade'
+ })
+ break;
+ }
+ } else {
+ uni.setStorageSync("class_id", res.result.class_id)
+
+ if (this.userType == 1 || this.userType == 2) {
+ uni.setStorageSync("stu_num", res.result.stu_num)
+ uni.setStorageSync("stu_name", res.result.stu_name)
+ }
+
+ uni.navigateTo({
+ url: '/pages/index/index'
+ });
+ }
+
+
}).catch((err) => {
console.log(err);
uni.hideLoading()
@@ -191,10 +175,12 @@
uni.showLoading({
title: '登录中...'
})
-
+
this.getCode().then((code) => {
console.log('code', code);
- const { userType } = this;
+ const {
+ userType
+ } = this;
return uniCloud.callFunction({
name: 'login',
data: {
@@ -269,13 +255,42 @@
diff --git a/pages/register/register.vue b/pages/register/register.vue
index e1eaf7d..d298ad9 100644
--- a/pages/register/register.vue
+++ b/pages/register/register.vue
@@ -1,16 +1,9 @@
-
+
diff --git a/pages/teacher_bind/teacher_bind.vue b/pages/teacher_bind/teacher_bind.vue
index 9004748..1a73752 100644
--- a/pages/teacher_bind/teacher_bind.vue
+++ b/pages/teacher_bind/teacher_bind.vue
@@ -25,8 +25,9 @@
-
-
+
+
+
@@ -45,21 +46,31 @@
className:""
};
},
- onLoad(data) {
- this.teacher_id = uni.getStorageSync("uid")
- uniCloud.callFunction({
- name: 'getClassList',
- })
- .then(res => {
- console.log(res);
- this.classList = res.result
- this.gradeArr = res.result.gradeList
- })
- .catch(err => {
- uni.hideLoading();
- console.error(err);
- });
-
+ onLoad(data) {
+ this.teacher_id = uni.getStorageSync("uid")
+ uniCloud.callFunction({
+ name: 'getClassList',
+ })
+ .then(res => {
+ console.log(res);
+ this.classList = res.result
+ this.gradeArr = res.result.gradeList
+ if (uni.getStorageSync('class_id')) {
+ uni.showModal({
+ title:'提示',
+ content:'您已经设置过班级信息了,真的要重新绑定吗?',
+ success: (res) => {
+ if (res.cancel) {
+ this.go_back()
+ }
+ }
+ })
+ }
+ })
+ .catch(err => {
+ uni.hideLoading();
+ console.error(err);
+ });
},
methods: {
@@ -102,7 +113,16 @@
console.error(err);
});
- }
+ },
+ go_back: function() {
+ if (getCurrentPages().length > 1) {
+ uni.navigateBack();
+ } else {
+ uni.switchTab({
+ url: '../index/index'
+ })
+ }
+ },
}
};
diff --git a/pages/weixinRegister/weixinRegister.vue b/pages/weixinRegister/weixinRegister.vue
index ee709d4..f353e7a 100644
--- a/pages/weixinRegister/weixinRegister.vue
+++ b/pages/weixinRegister/weixinRegister.vue
@@ -1,14 +1,6 @@
-
学生报备系统
--
Gitee
From d294437e25ee414b68b9e85183e7a2530826cf12 Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Fri, 7 Feb 2020 17:20:32 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E8=A6=86?=
=?UTF-8?q?=E7=9B=96=E5=BD=93=E5=A4=A9=E6=8F=90=E4=BA=A4=E7=9A=84=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cloudfunctions-aliyun/studentDay/.keep | 0
cloudfunctions-aliyun/studentDay/index.js | 20 +-
pages/student/student_day.vue | 283 ++++++++++++----------
3 files changed, 168 insertions(+), 135 deletions(-)
delete mode 100644 cloudfunctions-aliyun/studentDay/.keep
diff --git a/cloudfunctions-aliyun/studentDay/.keep b/cloudfunctions-aliyun/studentDay/.keep
deleted file mode 100644
index e69de29..0000000
diff --git a/cloudfunctions-aliyun/studentDay/index.js b/cloudfunctions-aliyun/studentDay/index.js
index 8a58562..47cb7f5 100644
--- a/cloudfunctions-aliyun/studentDay/index.js
+++ b/cloudfunctions-aliyun/studentDay/index.js
@@ -1,7 +1,23 @@
'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
+ //event为客户端上传的参数
const collection = db.collection('daily_report_log')
- const res = await collection.add(event)
- return res
+ // 获取当前用户数据列表
+ const res = await collection.where({
+ class_id: event.class_id
+ }).get()
+
+ const new_time = new Date().getTime()
+ // 删除当天的记录
+ for (var i = 0; i < res.data.length; i++) {
+ // 判断是否当天
+ if (res.data[i].create_time.toString().substr(0, 6) === new_time.toString().substr(0, 6)) {
+ collection.doc(res.data[i]._id).remove() //删除
+ }
+ }
+
+ // 添加记录
+ const res_add = await collection.add(event)
+ return res_add
};
diff --git a/pages/student/student_day.vue b/pages/student/student_day.vue
index 6f41639..c6a6772 100644
--- a/pages/student/student_day.vue
+++ b/pages/student/student_day.vue
@@ -1,91 +1,91 @@
@@ -94,11 +94,11 @@
export default {
data() {
return {
- checked:false,
- checkeds:false,
- student:{
- stu_num:"",
- stu_name:""
+ checked: false,
+ checkeds: false,
+ student: {
+ stu_num: "",
+ stu_name: ""
},
items: [{
value: '良好',
@@ -116,70 +116,85 @@
value: '发热',
name: '发热'
}
- ]
+ ],
}
},
- onLoad:function(){
+ onLoad: function() {
if (uni.getStorageSync('token')) {
this.student.stu_name = uni.getStorageSync("stu_name")
this.student.stu_num = uni.getStorageSync("stu_num")
- }else{
+ } else {
uni.navigateTo({
- url:'../login/login'
+ url: '../login/login'
})
}
},
methods: {
- formSubmit: function(e) {
- //class_id需要动态读取
- var data ={
- stu_id:this.student.stu_num,
- class_id:uni.getStorageSync("class_id"),
- create_time:Date.now()
+ formSubmit: function(e) {
+ //class_id需要动态读取
+ var data = {
+ stu_id: this.student.stu_num,
+ class_id: uni.getStorageSync("class_id"),
+ create_time: Date.now()
}
- var formData = e.detail.value, data;
+ var formData = e.detail.value,
+ data;
formData.health = formData.health.join();
var submitData = Object.assign(formData, data);
-
- console.log(submitData);
- uni.showLoading({
- title:'正在提交,请稍后...'
- })
+
+ console.log(submitData);
+ uni.showLoading({
+ title: '正在提交,请稍后...'
+ })
uniCloud.callFunction({
- name: 'studentDay',
- data: submitData
+ name: 'studentDay',
+ data: submitData
}).then((res) => {
- uni.hideLoading()
- uni.navigateTo({
- url:"../index/index"
- })
- uni.showToast({
- title:"提交成功,请明天再来!"
- })
- }).catch((err) => {
- uni.hideLoading()
- uni.showModal({
- content: `提交数据失败,错误信息为:${err.message}`,
- showCancel: false
- })
- console.error(err)
+ uni.hideLoading()
+ // 添加成功返回ID
+ if (res) {
+ uni.showModal({
+ title: '提示',
+ content: '提交成功!',
+ showCancel: false,
+ success: (res) => {
+ uni.navigateTo({
+ url: "../index/index"
+ })
+ }
+ })
+ }else{
+ uni.showModal({
+ title: '提示',
+ content: '提交失败!请通知管理员',
+ showCancel: false,
+
+ })
+ }
+ }).catch((err) => {
+ uni.hideLoading()
+ uni.showModal({
+ content: `提交数据失败,错误信息为:${err.message}`,
+ showCancel: false
+ })
+ console.error(err)
})
console.log(submitData)
},
- checkboxChange: function (e) {
+ checkboxChange: function(e) {
var items = this.items,
values = e.detail.value;
for (var i = 1, lenI = items.length; i < lenI; ++i) {
const item = items[i]
- if(values.indexOf(item.value) >= 0){
- this.$set(item,'checked',true)
- }else{
- this.$set(item,'checked',false)
- this.$set(item,'disabled',false)
+ if (values.indexOf(item.value) >= 0) {
+ this.$set(item, 'checked', true)
+ } else {
+ this.$set(item, 'checked', false)
+ this.$set(item, 'disabled', false)
}
- if(values.indexOf(items[0].value) >= 0){
- this.$set(item,'checked',false)
- this.$set(item,'disabled',true)
+ if (values.indexOf(items[0].value) >= 0) {
+ this.$set(item, 'checked', false)
+ this.$set(item, 'disabled', true)
}
}
}
@@ -191,13 +206,15 @@
.uni-list-cell {
justify-content: flex-start
}
+
.k_left {
margin-left: 16rpx;
}
-
+
/* #ifdef H5 */
.K_botton {
margin-bottom: 100rpx;
}
+
/* #endif */
-
+
--
Gitee
From f4908462b30399240072592919a93f24c35fac17 Mon Sep 17 00:00:00 2001
From: q326066766 <326066766@qq.com>
Date: Fri, 7 Feb 2020 17:35:56 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=AD=A6?=
=?UTF-8?q?=E7=94=9F=E8=87=AA=E5=8A=A8=E5=88=A4=E6=96=AD=E5=BD=93=E5=A4=A9?=
=?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=EF=BC=8C?=
=?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=B0=B1=E5=88=A0=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
cloudfunctions-aliyun/addClassItem/index.js | 1 -
pages/administrator/admin_class.vue | 19 +++++++++++++------
pages/administrator/admin_grade.vue | 17 ++++++++++++-----
3 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/cloudfunctions-aliyun/addClassItem/index.js b/cloudfunctions-aliyun/addClassItem/index.js
index 8d52fbe..e28631a 100644
--- a/cloudfunctions-aliyun/addClassItem/index.js
+++ b/cloudfunctions-aliyun/addClassItem/index.js
@@ -2,7 +2,6 @@
'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
- console.log(11111111,event);
//event为客户端上传的参数
const collection = db.collection('class_list')
const res = await collection.add(event)
diff --git a/pages/administrator/admin_class.vue b/pages/administrator/admin_class.vue
index 9e9fc5a..350efe8 100644
--- a/pages/administrator/admin_class.vue
+++ b/pages/administrator/admin_class.vue
@@ -4,14 +4,14 @@
管理班级信息
@@ -87,6 +87,9 @@
},
methods: {
init() {
+ uni.showLoading({
+ title: '查询中,请稍等!'
+ })
this.tableList = []
//获取班级列表
uniCloud.callFunction({
@@ -96,6 +99,7 @@
}
})
.then(res => {
+ uni.hideLoading()
console.log(res);
this.tableList = res.result
})
@@ -105,6 +109,7 @@
});
},
submit() {
+
if (this.name == '') {
uni.showToast({
icon: "none",
@@ -119,6 +124,9 @@
});
return false;
}
+ uni.showLoading({
+ title: '提交中..'
+ })
//利用this.isedit为true时,提示为修改。之后,把this.isedit修改为默认值false
if (this.isedit == true) {
// 修改
@@ -130,7 +138,6 @@
this.list_item.name = this.name
this.list_item.student_sum = this.student_sum,
form.data = this.list_item
- console.log(2222,form);
uni.showModal({
title: '提示',
content: '是否提交对该班级的修改?',
@@ -141,7 +148,7 @@
data: form
})
.then(res => {
- console.log(res);
+ uni.hideLoading();
// 重新获得列表
this.init()
})
@@ -171,7 +178,7 @@
data: info
})
.then(res => {
- console.log(res);
+ uni.hideLoading();
// 重新获得列表
this.init()
})
diff --git a/pages/administrator/admin_grade.vue b/pages/administrator/admin_grade.vue
index 6c3dd2e..27f6438 100644
--- a/pages/administrator/admin_grade.vue
+++ b/pages/administrator/admin_grade.vue
@@ -4,10 +4,10 @@
管理年级信息
@@ -75,12 +75,16 @@
},
methods: {
init() {
+ uni.showLoading({
+ title: '查询中,请稍等!'
+ })
this.tableList = []
//获取年级列表
uniCloud.callFunction({
name: 'getGradeList',
})
.then(res => {
+ uni.hideLoading()
console.log(res);
this.tableList = res.result
})
@@ -97,6 +101,9 @@
});
return false;
}
+ uni.showLoading({
+ title: '提交中..'
+ })
//利用this.isedit为true时,提示为修改。之后,把this.isedit修改为默认值false
if (this.isedit == true) {
// 修改
@@ -117,10 +124,10 @@
data: form
})
.then(res => {
- console.log(res);
+ uni.hideLoading();
// 重新获得列表
this.init()
-
+
})
.catch(err => {
uni.hideLoading();
@@ -146,7 +153,7 @@
data: info
})
.then(res => {
- console.log(res);
+ uni.hideLoading();
// 重新获得列表
this.init()
})
--
Gitee