Compare commits
2 Commits
master
...
smart_clas
Author | SHA1 | Date |
---|---|---|
|
2ed4cd9f72 | 5 years ago |
|
1b721ff92e | 5 years ago |
@ -0,0 +1,62 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/my_courses/my_courses",
|
||||
"pages/findmore/findmore",
|
||||
"pages/exercise_setting/exercise_setting",
|
||||
"pages/login/login",
|
||||
"pages/course_setting/course_setting",
|
||||
"pages/exercises/exercises",
|
||||
"pages/courses/courses",
|
||||
"pages/exercise/exercise",
|
||||
"pages/setting/setting",
|
||||
"pages/classroom/classroom",
|
||||
"pages/about/about",
|
||||
"pages/course/course",
|
||||
"pages/files/files",
|
||||
"pages/mark_detail/mark_detail",
|
||||
"pages/reset_password/reset_password",
|
||||
"pages/image_crop/image_crop",
|
||||
"pages/question_setting/question_setting",
|
||||
"pages/exercise_grade/exercise_grade",
|
||||
"pages/course_invite/course_invite",
|
||||
"pages/exercise_result/exercise_result"
|
||||
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "dark",
|
||||
"navigationBarTitleText": "积分教室",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#f2f2f2",
|
||||
"navigationBarBackgroundColor": "#fbfbfb"
|
||||
},
|
||||
"tabBar": {
|
||||
"selectedColor": "#00C7B7",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/my_courses/my_courses",
|
||||
"text": "我的课堂",
|
||||
"iconPath": "images/tabbar-icon/tabbar_study_default.png",
|
||||
"selectedIconPath": "images/tabbar-icon/tabbar_study_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/courses/courses",
|
||||
"text": "课程列表",
|
||||
"iconPath": "images/tabbar-icon/tabbar_contact_default.png",
|
||||
"selectedIconPath": "images/tabbar-icon/tabbar_contact_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/findmore/findmore",
|
||||
"text": "发现",
|
||||
"iconPath": "images/tabbar-icon/tabbar_findmore_default.png",
|
||||
"selectedIconPath": "images/tabbar-icon/tabbar_findmore_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/setting/setting",
|
||||
"iconPath": "images/tabbar-icon/tabbar_settings_default.png",
|
||||
"selectedIconPath": "images/tabbar-icon/tabbar_settings_pressed.png",
|
||||
"text": "设置"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
@import './components/weui-miniprogram/weui-wxss/dist/style/weui.wxss';
|
||||
|
||||
page {
|
||||
height: 100%;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.flex-wrap{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.form-wrap {
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 12px 0;
|
||||
}
|
||||
.tappable{
|
||||
color: #1aad19;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.tappable:hover {
|
||||
opacity: .6;
|
||||
}
|
||||
.container {
|
||||
padding: 4px 12px;
|
||||
}
|
||||
.hint,
|
||||
.error
|
||||
.warning {
|
||||
display: block;
|
||||
margin: 7px 0;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
}
|
||||
.error{
|
||||
color:red;
|
||||
}
|
||||
.warning{
|
||||
color: orange;
|
||||
}
|
@ -1,203 +0,0 @@
|
||||
## v0.19.3
|
||||
* U 列表界面的图片懒加载
|
||||
* F 修复带Cookie请求的bug
|
||||
|
||||
## v0.19.2
|
||||
* F 课堂邀请页面小程序码获取失败
|
||||
* F 每日签到完后按钮没有变灰
|
||||
|
||||
## v0.19.1
|
||||
* U 个人中心界面优化
|
||||
* U 主题色加深
|
||||
|
||||
## v0.19.0
|
||||
* A 增加教学案例模块
|
||||
* D 个人中心的EduCoder云网入口
|
||||
|
||||
## v0.18.1
|
||||
* U 页面访问记录扩大页面范围
|
||||
* U 分享图片封面
|
||||
|
||||
## v0.18.0
|
||||
* A 添加在线竞赛模块
|
||||
* A 添加省流模式
|
||||
* A 增加设置界面
|
||||
* U 完善markdown网址解析功能
|
||||
|
||||
## v0.17.1
|
||||
* A 增加分享朋友圈
|
||||
* A 添加收藏时的封面图
|
||||
* A 配置代码懒注入
|
||||
|
||||
## v0.17.0
|
||||
* A 增加开源版本库查看
|
||||
|
||||
## v0.16.10
|
||||
* U 登录界面优化
|
||||
* U 优化登录注册的信息校验
|
||||
* U 优化分享
|
||||
|
||||
## v0.16.9
|
||||
* A 管理界面浏览历史查看
|
||||
* A 使用一些功能时登录校验
|
||||
|
||||
## v0.16.8
|
||||
* A 支持填入微信个人信息
|
||||
* F 使用用户名登录时账号判断错误而无法登录
|
||||
|
||||
## v0.16.7
|
||||
* F 用户信息未完善时加入课堂bug
|
||||
|
||||
## v0.16.6
|
||||
* A 支持选用微信头像
|
||||
* F 兼容Promise.finally
|
||||
* F 爬虫访问处理
|
||||
|
||||
## v0.16.5
|
||||
* A 头像安全检查
|
||||
* U 信息安全检查速度
|
||||
|
||||
## v0.16.4
|
||||
* A 试卷答题时网络不好情况处理
|
||||
* A 课堂界面兼容iphone X
|
||||
|
||||
## v0.16.3
|
||||
* U 优化项目结构,主包压缩一半
|
||||
|
||||
## v0.16.2
|
||||
* A 支持选用实践课程
|
||||
* A 网络请求缓存
|
||||
|
||||
## v0.16.1
|
||||
* A 发送单个实训至课堂
|
||||
* A 探索的实训界面支持多选
|
||||
|
||||
## v0.16.0
|
||||
* A 探索界面
|
||||
* A 我的实践课程模块
|
||||
|
||||
## v0.15.1
|
||||
* A 教师加入课堂审批
|
||||
* A 熬夜睡觉提醒
|
||||
* A markdown中URL链接解析与跳转
|
||||
* F index-list滑动与窗口滚动冲突
|
||||
* F 加入课堂时多身份bug
|
||||
|
||||
## v0.15.0
|
||||
* A 实训关卡黑暗模式
|
||||
* A 学生管理模块
|
||||
* A 教师管理模块
|
||||
|
||||
## v0.14.5
|
||||
* A 接入内容安全接口
|
||||
* A 添加EduCoder云网推荐链接
|
||||
* U 代码编辑器改用editor
|
||||
* U 代码编辑器增加简单自动缩进
|
||||
* F 学校没有子单位时无法选择单位
|
||||
|
||||
## v0.14.4
|
||||
* A 使用we-ui扩展库
|
||||
* U 课堂界面优化更改
|
||||
* U 加入课堂对话框界面优化
|
||||
|
||||
## v0.14.3
|
||||
* F 实训文件内容获取失败(文件path错误)
|
||||
* F 个人信息性别设置bug
|
||||
* D 删除实名认证界面
|
||||
|
||||
## v0.14.2
|
||||
* F 签到界面无权限访问提示
|
||||
* F 更改头像界面图片初次加载失败
|
||||
* F 电脑端用户界面图标及文字位置不正确
|
||||
|
||||
## v0.14.1
|
||||
* A 试卷体验升级,增加分数查看、答题卡
|
||||
* A 签到界面增加教师的分享,以及二维码签到码查看
|
||||
* U 切换账号提示更新,防止遮挡操作
|
||||
|
||||
## v0.14.0
|
||||
* A 职业认证页面
|
||||
* A 学生课堂签到模块
|
||||
* A 切换账号功能
|
||||
* U 个人中心增加图标
|
||||
* U iconfont增加modal与toast提示方式
|
||||
* U 图片资源转移服务器
|
||||
* F 实名认证证件上传判断bug
|
||||
|
||||
## v0.13.3
|
||||
* A 增加实名认证界面
|
||||
* A 增加数据异常监测上报
|
||||
* U iconfont组件优化
|
||||
* F 登录Cookies解析失败
|
||||
|
||||
## v0.13.2
|
||||
* A iconfont
|
||||
* A 首页根据身份提供创建课程选项
|
||||
* A 显示身份认证的状态
|
||||
* F cookies失效登录失败时用户界面显示错误
|
||||
* F 实训测试集解析错误
|
||||
|
||||
## v0.13.1
|
||||
* A 修改个人信息界面
|
||||
* F 头像更改界面高度异常
|
||||
* F 我的实训初次显示不加载
|
||||
|
||||
## v0.13.0
|
||||
* A 菜单的删除课堂
|
||||
* A 课堂动态模块
|
||||
* A 实训作业模块
|
||||
* A 试卷封面,通知栏进入试卷
|
||||
* A 体验版开发版可以切换切换开发环境与发布环境
|
||||
* F 课堂邀请界面登录按钮bug
|
||||
* F 微信灰度API promise化产生的bug
|
||||
* F 使用style:v2后样式问题
|
||||
* F 登录界面bug
|
||||
|
||||
## v0.12.2
|
||||
* A 剪切板邀请码自动读取
|
||||
* A 首页点击搜索自动进入所在模块相应类目
|
||||
* U 登录界面、用户界面优化
|
||||
* U 更新机制优化
|
||||
* F 进入搜索页面nav标题错误
|
||||
* F 登录后我的实训不自动刷新
|
||||
|
||||
## v0.12.1
|
||||
* A 新通知红点标注,点击后跳转
|
||||
* A 长段代码预览
|
||||
* U 部分分包预加载
|
||||
* U 优化分享
|
||||
* U 优化体验
|
||||
* F toast提示失效
|
||||
* F 优化latex部分显示异常
|
||||
* D 删除普通作业模块、新建试卷界面(审核不过)
|
||||
|
||||
## v0.12.0
|
||||
* A 实训模块
|
||||
* A 我参与的实训
|
||||
* A 搜索模块
|
||||
* A 修改密码模块
|
||||
* A 消息中心分类
|
||||
* A 加入课堂对话框增加扫码功能
|
||||
* U 部分按钮样式更新
|
||||
* U 我的课堂上拉加载更多
|
||||
* F 加入课堂后Toast提示不消失
|
||||
* F 进入app未登录时获取消息通知报错
|
||||
|
||||
## v0.11.1
|
||||
* U error-page多按钮操作
|
||||
* U 课堂错误处理界面返回主页操作
|
||||
* F 非课程成员进入时弹出弹窗
|
||||
* F 试卷填空题答题bug修补
|
||||
|
||||
## v0.11.0
|
||||
* A 课程-普通作业模块
|
||||
* A 页面不存在时进入主页
|
||||
* A referrerInfo 分析
|
||||
* A 主页课堂菜单操作
|
||||
* A error-page组件错误处理界面
|
||||
* U 加入课堂对话框功能升级
|
||||
* U 课堂页面错误处理
|
||||
* U 课程邀请界面改进,增加已停用时的图标
|
||||
* U 改变小程序码生成接口为getWXACodeUnlimited
|
||||
* F 试卷题目富文本显示异常
|
||||
* D 隐藏发现页入口
|
@ -1 +0,0 @@
|
||||
trigger_function/
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": [
|
||||
"subscribeMessage.send"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "cloudapi",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wx-server-sdk": "~2.0.2"
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": []
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
|
||||
const cloud = require('wx-server-sdk')
|
||||
|
||||
cloud.init({
|
||||
|
||||
env: cloud.DYNAMIC_CURRENT_ENV
|
||||
})
|
||||
|
||||
|
||||
exports.main = async (event, context) => {
|
||||
|
||||
|
||||
|
||||
const wxContext = cloud.getWXContext()
|
||||
console.log("call api login", event);
|
||||
return {
|
||||
openid: wxContext.OPENID,
|
||||
appid: wxContext.APPID,
|
||||
unionid: wxContext.UNIONID,
|
||||
env: wxContext.ENV,
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "login",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wx-server-sdk": "latest"
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": [
|
||||
"wxacode.get",
|
||||
"wxacode.getUnlimited",
|
||||
"security.msgSecCheck",
|
||||
"security.imgSecCheck",
|
||||
"search.siteSearch",
|
||||
"search.submitPages"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "openapi",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wx-server-sdk": "latest"
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"openapi": [
|
||||
"search.submitPages"
|
||||
]
|
||||
},
|
||||
"triggers": [
|
||||
{
|
||||
|
||||
"name": "submitPages",
|
||||
"type": "timer",
|
||||
"config": "0 0 2 * * * *"
|
||||
},
|
||||
{
|
||||
"name": "clearPageHistory",
|
||||
"type":"timer",
|
||||
"config":"0 0 1 1 * * *"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
const cloud = require('wx-server-sdk');
|
||||
//const got = require("got");
|
||||
//const rp = require("request-promise")
|
||||
|
||||
cloud.init({
|
||||
env: cloud.DYNAMIC_CURRENT_ENV
|
||||
})
|
||||
|
||||
const config = {
|
||||
submitPagesGapDay: 1,
|
||||
clearPageHistoryGapDay: 30
|
||||
};
|
||||
|
||||
const milliSecondsPerDay = 24*60*60*1000;
|
||||
|
||||
const collectionNameMap = {
|
||||
pageHistory: "pageHistory"
|
||||
}
|
||||
|
||||
const PagePathMap = {
|
||||
shixun:"markdown/shixun/shixun/shixun",
|
||||
path:"markdown/path/path/path",
|
||||
mooc_case:"markdown/mooc_case/mooc_case/mooc_case",
|
||||
competition:"markdown/competition/competition/competition"
|
||||
}
|
||||
|
||||
|
||||
exports.main = async (event, context) => {
|
||||
const wxContext = cloud.getWXContext();
|
||||
console.log(event);
|
||||
let {TriggerName, Time} = event;
|
||||
switch(TriggerName){
|
||||
case "submitPages":{
|
||||
return submitPages({Time});
|
||||
}
|
||||
case "clearPageHistory":{
|
||||
return clearPageHistory({Time});
|
||||
}
|
||||
case "attandance":{
|
||||
return attandance({Time});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function submitPage({route, timeStart, timeEnd}){
|
||||
const db = cloud.database();
|
||||
const _ = db.command;
|
||||
const pageHistoryCollection = db.collection(collectionNameMap.pageHistory);
|
||||
|
||||
let data = await pageHistoryCollection.aggregate()
|
||||
.match({
|
||||
page: route,
|
||||
status: 200,
|
||||
isCrawl: false,
|
||||
time: _.lt(timeEnd).and(_.gte(timeStart))
|
||||
})
|
||||
.group({
|
||||
_id:"$options"
|
||||
})
|
||||
.end();
|
||||
|
||||
if(data.list.length==0)
|
||||
return "empty history: " + route;
|
||||
let pages = data.list.map(i=>{
|
||||
let query = Object.keys(i._id).map(k=>`${k}=${i._id[k]}`).join("&");
|
||||
return {
|
||||
path: route,
|
||||
query
|
||||
}
|
||||
})
|
||||
let res = await cloud.openapi.search.submitPages({pages});
|
||||
console.log("submit pages success", route, pages.length, res, pages);
|
||||
return "submit success: " + route + " " + pages.length;
|
||||
}
|
||||
|
||||
async function submitPages({Time}){
|
||||
let timeEnd = new Date(Time);
|
||||
let timeStart = new Date(timeEnd.getTime() - config.submitPagesGapDay*milliSecondsPerDay);
|
||||
// pages to be submitted
|
||||
let routes = [
|
||||
"shixun", "path", "mooc_case", "competition"
|
||||
]
|
||||
let promises = routes.map(i=>{
|
||||
return submitPage({route: PagePathMap[i], timeStart, timeEnd})
|
||||
})
|
||||
return Promise.all(promises)
|
||||
}
|
||||
|
||||
async function clearPageHistory({Time}){
|
||||
console.log("clearPageHistory", Time);
|
||||
|
||||
let now = new Date(Time);
|
||||
let timeEnd = new Date(now.getTime() - config.clearPageHistoryGapDay*milliSecondsPerDay);
|
||||
|
||||
const db = cloud.database();
|
||||
const _ = cloud.command;
|
||||
const pageHistoryCollection = db.collection(collectionNameMap.pageHistory);
|
||||
|
||||
let res = await pageHistoryCollection.where({
|
||||
time: _.lt(timeEnd)
|
||||
}).remove();
|
||||
|
||||
console.log("remove page History result: ", res);
|
||||
return {code: 0, message:"success", data:res};
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "trigger",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wx-server-sdk": "~2.0.2"
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// components/icon/myicon.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
addGlobalClass: true
|
||||
},
|
||||
|
||||
|
||||
externalClasses: ['custom-class'],
|
||||
|
||||
properties: {
|
||||
info: null,
|
||||
type: String,
|
||||
size: String,
|
||||
color: String
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onClick() {
|
||||
this.triggerEvent('click');
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,7 @@
|
||||
<!--components/icon/myicon.wxml-->
|
||||
<view
|
||||
class="custom-class iconfont myicon-{{ type }}"
|
||||
style="{{ color ? 'color: ' + color + ';' : '' }}{{ size ? 'font-size: ' + size + 'px;' : '' }}"
|
||||
bind:tap="onClick">
|
||||
<view wx:if="{{ info !== null }}" class="myicon__info">{{ info }}</view>
|
||||
</view>
|
@ -0,0 +1,60 @@
|
||||
@font-face {font-family: "iconfont";
|
||||
src: url('iconfont.eot?t=1572072148156'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1572072148156#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAc4AAsAAAAADRQAAAbrAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDbAqMLIofATYCJAMgCxIABCAFhG0HgQEbKgvIHodxLLIq1Ks3F1L/P27690UoTUggNTpnZlWlot9osYmlEFpWpAfCRGHzyrSUqQnyxb0EwOXuf7dMsmgTrwGSP0ZZnE1fFOEGrAECREQfrbX6qqG8zz806+XE1jC3BolM0kQkJFGPlAopETIlRTTCs6m0V4mbfTNAACh9jYJ6la/qQIrAMMKAqbWRB2kjFzHhR6QZkoET42a0CkjScDn2CABWZj+PfpCWFABDRsAO1PQrzKB+wufzcW+3FyYkOpA2VwwA9mkAOIBRAAiAisHSBYAXaFRGqKH3EQwAWFIYyRM+Zz7P/Dz78+rP53d30zRVTWWVCMv/yVMAiELAIDgJEqAUQGSG2dwWBT4HKVaUQTYQoJnIBgw0G9mAQKuQDThoNbJBAjofo4AEACBNTlAA6AvQH2AbYKwgQxgvJuFyKA2rynoOiqOMQ1EqLZPjssTE/gShYli59kEs18dp0NUbDVq9sU6nHx9u1wUX6EMdxshCezhsiESM6EkYpSn1kZDeG3wVQn+jYHDWnaAuFHrND+BdFxcM9t4c0kci/baEDV0bEPIpn0ZQODybPfWsN7b5eSbDI/rsy374lhdZLXsO+A627ffuG8QUxWg2tbPip5GBSdLWoG576LXg8E4A//62gwgdxCX8ypD+uV7Wuc+7n2baDvoOWEib+CJtIQgGrYrWTRQrOb/zEabWhK6e+MaD8bzfGzelczxmdEn88VxAGdWVoOicSXjjqLwr8lFUaxx4OtkwMqCU+0UU2GB3AH88HUDQ083eOLar+QCqQ/rrqR7fn73+sn2Zq73oQECJ0MmyiDEcnkAhGsmNjZdSKGQM+Lpa43QGNbLTG68H6lx0Y7/5c7aZd1zgoBJ1HWjdF3c8h+j8dJsysDGhtGvPrnXxVC7R1oPvWWOvMrDBXu/u0HWui/fvnt3PGNi4YY8zo3F9LePUnevjN5RVFoi77Jr9ItwaZDZvyNYW2dIXHkNB577WAwhRZ6eEptGFLokH+nw3xbWEXG4jy+BONJfigS1Fk9nncaQJn8OTpuBjQN48DO9YMA2o1xPmxZBtJa0a4lRg1lh8DL5uFn5KU9LaRg5xwx+D1LjmHQv1suFXtxFfD+UND/cmlyr76ZibnV+GjTpbuwatRknWKKzRzc0e+0mWOvaIPE8Fvt5thIz9vezZJaaMufQhw0TetF17FB7z6Fpd2ZT3kt5P+j7puylswQG9B/RdR8CDAIzLDdNYQ/OSugFcdhODCcuXC5ilvQPMtfizON1A2wpmHI5Hy+L6pbOY3NS+xBL100dmoqbia66u/4/lqnLFe4rkim/3rkYNDai6WjCvFEw1qIbnffLAYM6PAcKzwXqVmv7EZmM//TXywlcD3xx5dVECL326qId+GLWtaRulf2j6jxUZpEZUE0qJRCRJJan5VU1kEOpfNd3nMkjyV4mEI9SihuRIUqxwxtgXQHchYEuXYgLU19WaT1BH9KNVvRK5nmxPLrHXqkfRHegTTZoa6kNh6dI+E1YNXDVIHvJGR8Gz8vYmq06+n9Xx7AI6dr+83GptL39WsKgU1dlsdUpDFodtSq+Nf8YxrzFcb/zGe8mbFfTifbmzHs9a68ydPeBAdcLN5uVnblUr1SRF5xae2fxmJ5RXcOZhrw1unSnIoylSXa0sAsubJy3AN/sfUJhLG7nHs3L3LaYVmx/NznWuhfSf/39byUnRde7c0m0nSremRdtKTyJr3txSO4lNNyReuSrjenHM1Sus4WSv6Bg9U3cN5mOPwldYN903fDPeCACA77G/QfeO3Iwbs/Adv44DukyhErQ/8Et4/nd3JwiXnqqZLC/4TUr/nBe99TYd1MXVSxsBvoAUyNI3dVJmBAAgt47CkDSeBVIgqU3pK4/AKT8C9Nu3GIDi8wC+oZUx3t8kiycT+Dtg8RVgovQBnNQgPWEeBSRaBkhIFQNlpKrTabFccCiOBoARFmuAKBwFDOsq4BQec+Bgfg9ICb4DCUU4UAxB7AVpQ7JSZS6BFwWzqmGmympyOiyiQKTygfVCo8fGu+pKFjIILre1QZWalNLuqBIcgmsTh7inNaaJokVlcTntqkrtdoLN5lS1uJxTBZOY1CSKLXnJyZahQ5NMTjtQyrgIeGKS3Eylwcz0ViZODpaFRVTn++sJGnnY8FwTM4bpDQQubtb1q6RKkkLQVxEHacZDGe42TaM0ol5soZLjXZzsVCr1YoGNtzqptAxvN5XARJSkaYXmFnmS9bksVJK0e2a/p1cBQGFXlwYYwhGBSCRBUUiKokE2FO28LfMmvC41l7FZZ1h55wyPMNPDO8gmj9XMM82CyDsau9nM9KrM5nEGiLS2nmGV8mbzaIvVZgMA') format('woff2'),
|
||||
url('iconfont.woff?t=1572072148156') format('woff'),
|
||||
url('iconfont.ttf?t=1572072148156') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
|
||||
url('iconfont.svg?t=1572072148156#iconfont') format('svg'); /* iOS 4.1- */
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.myicon-absent_student:before {
|
||||
content: "\e635";
|
||||
}
|
||||
|
||||
.myicon-present_student:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
.myicon-answer:before {
|
||||
content: "\e647";
|
||||
}
|
||||
.myicon-question:before {
|
||||
content: "\e648";
|
||||
}
|
||||
|
||||
.myicon-internet_class:before {
|
||||
content: "\e67f";
|
||||
}
|
||||
|
||||
.myicon-close:before {
|
||||
content: "\e637";
|
||||
}
|
||||
|
||||
.myicon-add:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.myicon__info {
|
||||
color: #fff;
|
||||
left: 100%;
|
||||
top: -.5em;
|
||||
font-size: 0.5em;
|
||||
padding: 0 0.3em;
|
||||
text-align: center;
|
||||
min-width: 1.2em;
|
||||
line-height: 1.2;
|
||||
position: absolute;
|
||||
border-radius: 0.6em;
|
||||
box-sizing: border-box;
|
||||
background-color: #f44;
|
||||
-webkit-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
|
||||
/**
|
||||
* @todo: Error类, to be finished
|
||||
*/
|
||||
|
||||
export default class EduError extends Error{
|
||||
constructor({message=null, code=-1}){
|
||||
super(message);
|
||||
this.code = code;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 416 B |
After Width: | Height: | Size: 222 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 943 B |
After Width: | Height: | Size: 773 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 89 KiB |
Before Width: | Height: | Size: 74 KiB |
@ -0,0 +1,28 @@
|
||||
module.exports = (subscription, initialStats, onChange) => {
|
||||
console.log("query_bingding");
|
||||
let stats = [...initialStats]
|
||||
const remove = value => {
|
||||
console.log("remove");
|
||||
stats = stats.filter(target => target.id !== value.id)
|
||||
return onChange(stats)
|
||||
}
|
||||
const upsert = value => {
|
||||
console.log("upsert");
|
||||
let existed = false;
|
||||
stats = stats.map(target => (target.id === value.id ? ((existed = true), value) : target))
|
||||
if (!existed) stats = [...stats,value]
|
||||
return onChange(stats)
|
||||
}
|
||||
subscription.on('create', upsert)
|
||||
subscription.on('update', upsert)
|
||||
subscription.on('enter', upsert)
|
||||
subscription.on('leave', remove)
|
||||
subscription.on('delete', remove)
|
||||
return () => {
|
||||
subscription.off('create', upsert)
|
||||
subscription.off('update', upsert)
|
||||
subscription.off('enter', upsert)
|
||||
subscription.off('leave', remove)
|
||||
subscription.off('delete', remove)
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
|
||||
# Windows
|
||||
[Dd]esktop.ini
|
||||
Thumbs.db
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
|
||||
# Node.js
|
||||
node_modules/
|
@ -1,255 +0,0 @@
|
||||
import apiConfig from "../../apiConfig";
|
||||
import {accountManager} from "../../../js/utils";
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
attachDir: global.config.attachDir,
|
||||
action:"login",
|
||||
msgType: "info",
|
||||
code_button_text:"获取验证码",
|
||||
action_text:{login:"登录",register:"注册", reset:"找回密码"},
|
||||
pos:{login:1, register:2, reset:3}
|
||||
},
|
||||
cache:{},
|
||||
showMsg({message, type="info", duration=2000}){
|
||||
if(!message) return;
|
||||
this.setData({
|
||||
message,
|
||||
msgType: type,
|
||||
msgDuration: duration,
|
||||
showMsg: false
|
||||
});
|
||||
wx.nextTick(()=>{
|
||||
this.setData({showMsg: true});
|
||||
})
|
||||
},
|
||||
hideMsg(){
|
||||
this.setData({showMsg: false});
|
||||
},
|
||||
showError({message, duration}){
|
||||
if(!message)
|
||||
return
|
||||
this.showMsg({message, duration, type:"error"});
|
||||
},
|
||||
onLogoLoad(){
|
||||
this.setData({ logoLoaded: 1});
|
||||
},
|
||||
onLoginBlur({detail:{value:login}}){
|
||||
this.validLogin(login);
|
||||
},
|
||||
validPhoneEmail: function ({login}) {
|
||||
// a simple pre-check for input
|
||||
let phoneReg = /^[1][0-9]{10}$/;
|
||||
let emailReg = /.+@.+\..+/;
|
||||
if(!phoneReg.test(login)&&!emailReg.test(login)){
|
||||
return false;
|
||||
}else
|
||||
return true;
|
||||
},
|
||||
validLogin(login){
|
||||
if(!login) {
|
||||
return this.setData({showMsg:0, hasError:0});
|
||||
}
|
||||
let {action} = this.data;
|
||||
if(this.cache.login==login&&this.cache.action==action)
|
||||
return;
|
||||
if(action=="login"){
|
||||
// some use login to login, this case judge can be wrong
|
||||
this.cache.action = action;
|
||||
this.cache.login = login;
|
||||
var api_name = 'weapps.check_account';
|
||||
var type = 'login';
|
||||
}else if(action=='register'){
|
||||
var api_name = "weapps.check_account";
|
||||
var type = "register";
|
||||
if(!this.validPhoneEmail({login})){
|
||||
this.cache.action = action;
|
||||
this.cache.login = login;
|
||||
this.showError({message:"请输入正确的邮箱或手机号", duration:0});
|
||||
this.setData({hasError:0});
|
||||
return;
|
||||
}
|
||||
}else if(action=='reset'){
|
||||
var api_name = "accounts.valid_email_and_phone";
|
||||
var type = 2;
|
||||
if(!this.validPhoneEmail({login})){
|
||||
this.cache.action = action;
|
||||
this.cache.login = login;
|
||||
this.showError({message:"请输入正确的手机号或邮箱", duration:0});
|
||||
this.setData({hasError:0});
|
||||
return;
|
||||
}
|
||||
}
|
||||
app.api(api_name)({
|
||||
login, type,
|
||||
complete: res => {
|
||||
this.cache.action = action;
|
||||
this.cache.login = login;
|
||||
}
|
||||
})
|
||||
.then(res=>{
|
||||
this.setData({hasError:0});
|
||||
this.hideMsg();
|
||||
})
|
||||
.catch(e=>{
|
||||
var hasError = e.message.indexOf("网络")!=-1?2:1;
|
||||
if(action=='login'){
|
||||
hasError = e.message.indexOf('尚未注册')!=-1?1:0;
|
||||
}
|
||||
this.setData({ hasError});
|
||||
if(hasError){
|
||||
this.showError({message: e.message.replace(/\n/g," "), duration: 0});
|
||||
}else{
|
||||
this.hideMsg();
|
||||
}
|
||||
})
|
||||
},
|
||||
login_test(){
|
||||
var data = global.accountManager.testAccount;
|
||||
data.save_password = 1;
|
||||
this.setData(data);
|
||||
this.login(data);
|
||||
// this.setStorage({...data,save_password:1});
|
||||
},
|
||||
login({ login, password, save_password, showToast=1}){
|
||||
if(login==accountManager.testAccount.login)
|
||||
password = accountManager.testAccount.password;
|
||||
app.api("accounts.login")({login,password})
|
||||
.then(res=>{
|
||||
res.message="登录成功";
|
||||
if (showToast)
|
||||
this.showMsg(res);
|
||||
let account = { ...res, login, password, save_password };
|
||||
if(this.data.addaccount)
|
||||
accountManager.addAccount(account,0);
|
||||
accountManager.setCurrentAccount(account);
|
||||
this.navBack();
|
||||
})
|
||||
.catch(e=>{
|
||||
if (showToast){
|
||||
this.showError(e);
|
||||
}
|
||||
})
|
||||
},
|
||||
register({login, password, code}){
|
||||
app.api("accounts.register")({login, password, code})
|
||||
.then(res=>{
|
||||
this.showMsg(res);
|
||||
this.navBack();
|
||||
}).catch(e=>{
|
||||
this.showError(e);
|
||||
})
|
||||
},
|
||||
reset({ login, password: new_password, password_confirmation: new_password_confirmation, save_password ,code, no_login}){
|
||||
app.api("accounts.reset_password")({login, new_password, new_password_confirmation, code})
|
||||
.then(res=>{
|
||||
res.message = "重置成功";
|
||||
this.showMsg(res);
|
||||
if(!no_login)
|
||||
this.login({ login, password: new_password, save_password, showToast:0});
|
||||
})
|
||||
.catch(e=>{
|
||||
this.showError(e);
|
||||
})
|
||||
},
|
||||
getCode({login}){
|
||||
if(this.data.action=="register")
|
||||
var type = 1;
|
||||
else if(this.data.action=="reset")
|
||||
var type = 2;
|
||||
else
|
||||
return;
|
||||
this.setData({code_status:2, code_button_text:"发送中"});
|
||||
app.api("accounts.get_verification_code")({login, type})
|
||||
.then(res=>{
|
||||
res.message = "发送成功";
|
||||
this.countDown();
|
||||
this.showMsg(res);
|
||||
}).catch(e=>{
|
||||
this.showError(e);
|
||||
this.setData({code_status:0, code_button_text:"获取验证码"})
|
||||
})
|
||||
},
|
||||
clearCount(id){
|
||||
clearInterval(id);
|
||||
this.setData({code_status:0, code_button_text:"获取验证码"});
|
||||
},
|
||||
countDown(){
|
||||
var count = 60;
|
||||
this.setData({code_status: 1, code_button_text: count-- + "秒后重试"});
|
||||
var id = setInterval(()=>{
|
||||
if (count <= 0)
|
||||
return this.clearCount(id);
|
||||
this.setData({code_button_text:count-- + "秒后重试"})
|
||||
}, 1000);
|
||||
return id;
|
||||
},
|
||||
onSubmit({detail:{value, target}}){
|
||||
if(!this.checkInput({value, action:target.id}))
|
||||
return;
|
||||
if (target.id == "code")
|
||||
return this.getCode(value);
|
||||
if (target.id != this.data.action){
|
||||
this.setAction(target.id);
|
||||
return this.validLogin(value.login);
|
||||
}
|
||||
this[target.id](value);
|
||||
},
|
||||
checkInput({value, action}){
|
||||
if(action!=this.data.action && action!="code")
|
||||
return true;
|
||||
if (!value.login)
|
||||
return this.showError({message: '请输入邮箱或手机号'}) && false;
|
||||
if(action=="code")
|
||||
return true;
|
||||
if (!value.password)
|
||||
return this.showError({message: '请输入密码'}) && false;
|
||||
if(action=="login")
|
||||
return true;
|
||||
if(!value.code)
|
||||
return this.showError({message: '请输入验证码' }) && false;
|
||||
if(action=="register")
|
||||
return true;
|
||||
if(!value.password_confirmation)
|
||||
return this.showError({message: '请再次输入密码'}) && false;
|
||||
return true;
|
||||
},
|
||||
setAction(action){
|
||||
let {pos} = this.data;
|
||||
if(!(action in pos)||action==this.data.action)
|
||||
return;
|
||||
let tmp = pos[action];
|
||||
pos[action] = pos[this.data.action];
|
||||
pos[this.data.action] = tmp;
|
||||
/*if(Math.random()>0.5){
|
||||
for(var k in pos){
|
||||
if(pos[k]!=1)
|
||||
pos[k] = pos[k]==2?3:2;
|
||||
}
|
||||
}*/
|
||||
this.setData({pos, action});
|
||||
},
|
||||
onLoad: function (options) {
|
||||
let {action="login"} = options;
|
||||
this.setAction(action);
|
||||
this.setData(options);
|
||||
if(!options.nostorage)
|
||||
this.getStorage();
|
||||
},
|
||||
getStorage(){
|
||||
let account = accountManager.getCurrentAccount();
|
||||
if(account){
|
||||
let {login, password, save_password=0} = account;
|
||||
password = save_password?password:'';
|
||||
this.setData({login, password, save_password});
|
||||
}
|
||||
},
|
||||
navBack(){
|
||||
setTimeout(()=>{
|
||||
wx.navigateBack({
|
||||
delta:1
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
})
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"iconfont":"/components/iconfont/iconfont",
|
||||
"mp-toptips":"/weui-miniprogram/toptips/toptips"
|
||||
},
|
||||
"navigationBarTitleText": "账号",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<page-meta>
|
||||
<navigation-bar title="{{action_text[action]}}" />
|
||||
</page-meta>
|
||||
<mp-toptips msg="{{message}}" type="{{msgType}}" show="{{showMsg}}" delay="{{msgDuration}}"/>
|
||||
<view class="container">
|
||||
<image class="logo {{logoLoaded?'':'hidden'}}" bindlongpress="login_test" src="{{attachDir}}751571" mode="aspectFit" bindload="onLogoLoad"></image>
|
||||
<form class="account-form" bindsubmit="onSubmit">
|
||||
<view class="inputs">
|
||||
<view class="input-wrap">
|
||||
<input name="login" bindblur="onLoginBlur" disabled="{{login_disabled}}" value="{{login}}" placeholder="{{action=='login'?'邮箱、手机号或用户名':'邮箱或手机号'}}">
|
||||
</input>
|
||||
</view>
|
||||
<view class="input-wrap {{action!='login'?'':'hidden'}}">
|
||||
<input name="code" placeholder="验证码">
|
||||
</input>
|
||||
<button id="code" type="secondary" size="mini" form-type="submit" loading="{{code_status==2}}" disabled="{{code_status||hasError==1}}" class="obtain-code">
|
||||
{{code_button_text}}
|
||||
</button>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<input password name="password" value="{{password}}" placeholder="请输入密码">
|
||||
</input>
|
||||
</view>
|
||||
<view class="input-wrap {{action=='reset'?'':'hidden'}}">
|
||||
<input password name="password_confirmation" placeholder="请再次输入密码">
|
||||
</input>
|
||||
</view>
|
||||
<view class="checkbox-wrap">
|
||||
<switch type="checkbox" name="save_password" color="#00b0f0" hidden="{{hide_save}}" checked="{{save_password}}">保存密码<iconfont type="yiwen" info="密码将在本地加密保存" color="dimgrey" size="20" showtype="toast"/></switch>
|
||||
<switch type="checkbox" class="no-login {{action=='reset'?'':'hidden'}}" name="no_login" color="#00b0f0">重置后不登录</switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="actions">
|
||||
<view class="pos{{pos.login}}">
|
||||
<button id="login" disabled="{{hasError==1&&pos.login==1}}" form-type="submit">登录</button>
|
||||
</view>
|
||||
<view class="pos{{pos.register}}">
|
||||
<button id="register" disabled="{{hasError==1&&pos.register==1}}" form-type="submit">注册</button>
|
||||
</view>
|
||||
<view class="pos{{pos.reset}}">
|
||||
<button id="reset" disabled="{{hasError==1&&pos.reset==1}}" form-type="submit">{{pos.reset==1?'重置密码':'忘记密码?'}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
<view class="foot">
|
||||
<navigator class="agreement" hover-class="none" url="/markdown/account/agreement/agreement">
|
||||
登录或注册即代表您同意 <text class="color-main agreement">用户协议</text>
|
||||
</navigator>
|
||||
</view>
|
@ -1,118 +0,0 @@
|
||||
page{
|
||||
position: relative;
|
||||
background: white;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.logo{
|
||||
width:54px;
|
||||
height: 54px;
|
||||
display: block;
|
||||
padding: 48px 0 4px 0;
|
||||
margin: 0 auto;
|
||||
transition: 1s all ease;
|
||||
}
|
||||
.checkbox-wrap,.input-wrap{
|
||||
transition: 1s all ease;
|
||||
max-height: 50px;
|
||||
display: flex;
|
||||
margin: 5px 26px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.checkbox-wrap{
|
||||
font-size: 14px;
|
||||
margin: 0px 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.checkbox-wrap switch{
|
||||
transform: scale(0.82);
|
||||
}
|
||||
.input-wrap>input{
|
||||
padding: 8px 10px;
|
||||
border-radius: 4px;
|
||||
border: 1px #00b0f0 solid;
|
||||
flex:auto;
|
||||
}
|
||||
.input-wrap>input[disabled]{
|
||||
background: #dfdfdf;
|
||||
}
|
||||
.obtain-code{
|
||||
margin-left: 12px!important;
|
||||
white-space: nowrap;
|
||||
display: flex!important;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: none;
|
||||
}
|
||||
.input-wrap.hidden{
|
||||
max-height: 0px;
|
||||
}
|
||||
image.hidden,switch.no-login.hidden{
|
||||
opacity: 0;
|
||||
}
|
||||
switch.no-login{
|
||||
float: left;
|
||||
transition: 1s all ease;
|
||||
}
|
||||
.actions{
|
||||
position: relative;
|
||||
margin: 0 26px;
|
||||
height: 160px;
|
||||
}
|
||||
.actions button{
|
||||
transition: 1s all ease;
|
||||
}
|
||||
.actions>view{
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
transition: 1s all ease;
|
||||
}
|
||||
.actions>.pos1{
|
||||
top: 26px;
|
||||
}
|
||||
.pos1>button{
|
||||
background: #00b0f0;
|
||||
color:white;
|
||||
}
|
||||
.pos1>button[disabled]{
|
||||
background-color: #00b0f096!important;
|
||||
color: white!important;
|
||||
}
|
||||
.actions>.pos2{
|
||||
top:74px;
|
||||
}
|
||||
.pos2>button{
|
||||
color: #00b0f0;
|
||||
border:#00b0f0 1px solid;
|
||||
background: white;
|
||||
}
|
||||
.actions>.pos3{
|
||||
top: 0px;
|
||||
}
|
||||
.pos3>button{
|
||||
font-size: 14px;
|
||||
color: #00b0f0;
|
||||
background: transparent;
|
||||
transform: translateX(240rpx);
|
||||
padding: 0px;
|
||||
}
|
||||
.pos3>button::after{
|
||||
border: none!important;
|
||||
}
|
||||
.foot{
|
||||
position: absolute;
|
||||
bottom:0px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
}
|
||||
navigator.agreement{
|
||||
margin: 10px auto;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
color: dimgray;
|
||||
}
|
||||
text.agreement{
|
||||
text-decoration: underline;
|
||||
font-weight: bold;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"mp-slideview": "/weui-miniprogram/slideview/slideview",
|
||||
"mp-toptips":"/weui-miniprogram/toptips/toptips"
|
||||
},
|
||||
"navigationBarTitleText": "切换账号"
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
<page-meta>
|
||||
<navigation-bar loading="{{loading}}" />
|
||||
</page-meta>
|
||||
|
||||
<view>
|
||||
<mp-toptips msg="{{message}}" type="info" show="{{message&&showMessage}}" delay="0"/>
|
||||
|
||||
<!--view class="message single-line {{showMessage&&message?'':'hidden'}}">
|
||||
{{message}}
|
||||
</view-->
|
||||
<view class="empty" wx:if="{{accounts.length==0}}">
|
||||
<text>暂无账号</text>
|
||||
</view>
|
||||
<view wx:else class="empty">
|
||||
轻触切换账号
|
||||
</view>
|
||||
<mp-slideview wx:for="{{accounts}}" data-id="{{item.user_id}}" buttons="{{buttons}}"
|
||||
bindtap="switchAccount" bindlongpress="removeAccount1" bindbuttontap="removeAccount2"
|
||||
wx:key="user_id">
|
||||
<view class="account" >
|
||||
<image src="{{eduImgDir}}{{item.image_url}}" class="avatar"></image>
|
||||
<view class="info">
|
||||
<view class="name">{{item.name}}</view>
|
||||
<view class="login">{{item.login}}</view>
|
||||
</view>
|
||||
<view class="status" wx:if="{{item.user_id==user.user_id}}">
|
||||
<icon type="success_no_circle" color="#00b0f0"></icon>
|
||||
</view>
|
||||
</view>
|
||||
</mp-slideview>
|
||||
|
||||
<button class="addAccount" type="main" bindtap="addAccount">添加账号</button>
|
||||
<button class="nav-back" type="main" plain="1" bindtap="navBack">返回</button>
|
||||
</view>
|
@ -1,54 +0,0 @@
|
||||
.message{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 28px;
|
||||
transition: all 0.26s ease;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
z-index: 100;
|
||||
font-size: 14px;
|
||||
}
|
||||
.message.hidden{
|
||||
transform: translateY(-32px);
|
||||
}
|
||||
|
||||
.account{
|
||||
display: flex;
|
||||
padding: 12px;
|
||||
margin-bottom: 1px;
|
||||
background: white;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.avatar{
|
||||
border-radius: 50%;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
margin: 0 12px 0 4px;
|
||||
}
|
||||
|
||||
.info{
|
||||
flex: auto;
|
||||
}
|
||||
.login{
|
||||
font-size: 12px;
|
||||
color: dimgray;
|
||||
}
|
||||
|
||||
.addAccount{
|
||||
margin-top: 24px;
|
||||
}
|
||||
.nav-back{
|
||||
margin-top: 8px;
|
||||
}
|
||||
.empty{
|
||||
text-align: center;
|
||||
color: dimgray;
|
||||
font-size: 13px;
|
||||
margin: 8px 0;
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
login: "***"
|
||||
},
|
||||
|
||||
onFormReset(){
|
||||
wx.navigateBack({
|
||||
delta:1
|
||||
});
|
||||
},
|
||||
changePassword({detail:{value}}){
|
||||
if(app.user().user_id==2)
|
||||
return wx.showToast({
|
||||
title: '请登陆后操作哦', icon: "none"
|
||||
});
|
||||
if(!value.password||!value.old_password||!value.password_confirmation)
|
||||
return wx.showToast({
|
||||
title: '请输入完整哦', icon: "none"
|
||||
});
|
||||
if(value.password_confirmation!=value.password)
|
||||
return wx.showToast({
|
||||
title: '两次输入的新密码不一致哦',icon:"none"
|
||||
});
|
||||
if(value.old_password==value.password)
|
||||
return wx.showToast({
|
||||
title: '输入的新旧密码是一样的哦', icon: "none"
|
||||
});
|
||||
app.api("users.accounts.password")(value)
|
||||
.then(res=>{
|
||||
if(res.status==0)
|
||||
res.message="修改成功";
|
||||
app.showMsg(res);
|
||||
setTimeout(()=>{
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},1000);
|
||||
|
||||
})
|
||||
.catch(e=>{
|
||||
app.showError(e);
|
||||
})
|
||||
},
|
||||
onLoad: function (options) {
|
||||
app.checkLogin();
|
||||
let {login} = global.accountManager.getCurrentAccount();
|
||||
this.setData({login});
|
||||
}
|
||||
})
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
<view class="container">
|
||||
<view class="tip">
|
||||
您正在修改账号{{login}}的密码
|
||||
</view>
|
||||
<form bindsubmit="changePassword" bindreset="onFormReset">
|
||||
<view class="input-wrap">
|
||||
<input password auto-focus name="old_password" placeholder="原密码"/>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<input password name="password" placeholder="新密码"/>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<input password name="password_confirmation" placeholder="请再次输入新密码"/>
|
||||
</view>
|
||||
<view class="buttons">
|
||||
<button form-type="submit" type="main">确认</button>
|
||||
<button form-type="reset" type="main" plain>返回</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
@ -1,24 +0,0 @@
|
||||
page{
|
||||
background: white;
|
||||
}
|
||||
.container{
|
||||
padding-top: 20px;
|
||||
}
|
||||
.tip{
|
||||
color: dimgray;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.input-wrap{
|
||||
border-radius: 4px;
|
||||
border: 1px solid #00b0f0;
|
||||
margin: 16px 18px;
|
||||
}
|
||||
.input-wrap>input{
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.buttons>button{
|
||||
margin-top: 10px;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
.form-item {
|
||||
background: #fefefe;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 14px 12px;
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
||||
.form-item>.value {
|
||||
text-align: right;
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.form-item>.key {
|
||||
display: inline-block;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.form-item .tip {
|
||||
font-size: 12px;
|
||||
color: dimgray;
|
||||
}
|
||||
|
||||
.form-item>switch {
|
||||
transform: scale(0.8);
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
const app = getApp();
|
||||
import {throttle} from "../../../../js/utils";
|
||||
const risk_message = "检测到内容含有敏感词汇";
|
||||
|
||||
function msgSecCheck({name="", remarks=""}){
|
||||
let content = name+","+ remarks;
|
||||
console.log("msgsecCheck", content);
|
||||
if(this.tmp_promise&&this.tmp_content==content)
|
||||
return this.tmp_promise;
|
||||
this.tmp_promise = app.openapi("security.msgSecCheck")({content});
|
||||
this.tmp_content = content;
|
||||
this.tmp_promise.then(res=>{
|
||||
if(res.errCode==87014){
|
||||
wx.showToast({
|
||||
title: risk_message,icon:"none",duration:2600
|
||||
})
|
||||
}
|
||||
})
|
||||
return this.tmp_promise;
|
||||
}
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
show:{
|
||||
type:Boolean,
|
||||
value:false
|
||||
},
|
||||
school_name:String,
|
||||
school_id:Number
|
||||
},
|
||||
data: {
|
||||
buttons:[
|
||||
{text:"取消"},
|
||||
{text:"提交"}
|
||||
],
|
||||
name: "",
|
||||
remarks:""
|
||||
},
|
||||
methods: {
|
||||
cancel(){
|
||||
this.setData({show:false});
|
||||
},
|
||||
updateName({detail:{value}}){
|
||||
this.setData({name:value});
|
||||
this.throttledMsgSecCheck(this.data);
|
||||
},
|
||||
updateRemarks({detail:{value}}){
|
||||
this.setData({remarks:value});
|
||||
this.throttledMsgSecCheck(this.data);
|
||||
},
|
||||
checkInput(){
|
||||
if(!this.data.name)
|
||||
return wx.showToast({
|
||||
title: '请输入子单位名称',icon:"none"
|
||||
})&&false;
|
||||
return true;
|
||||
},
|
||||
throttledMsgSecCheck:throttle(msgSecCheck, 1000, {}),
|
||||
msgSecCheck,
|
||||
submit(){
|
||||
if(!this.checkInput())
|
||||
return;
|
||||
let {remarks, name, school_id} = this.data;
|
||||
wx.showLoading({
|
||||
title: '检查内容中...'
|
||||
})
|
||||
this.msgSecCheck({name, remarks}).then(res=>{
|
||||
if(res.errCode==0){
|
||||
wx.showLoading({
|
||||
title: '正在添加'
|
||||
})
|
||||
app.api("add_department_applies")({school_id, name, remarks})
|
||||
.then(res=>{
|
||||
this.triggerEvent("success",res);
|
||||
wx.hideLoading();
|
||||
wx.showToast({
|
||||
title: '添加成功'
|
||||
})
|
||||
this.setData({show:false});
|
||||
}).catch(e=>{
|
||||
app.showError(e);
|
||||
})
|
||||
|
||||
}else{
|
||||
wx.hideLoading();
|
||||
wx.showModal({
|
||||
content:risk_message,
|
||||
showCancel:false
|
||||
})
|
||||
}
|
||||
}).catch(e=>{
|
||||
//app.showError(e);
|
||||
wx.showToast({
|
||||
title: '出错了\n>_<',icon:"none"
|
||||
})
|
||||
throw e;
|
||||
})
|
||||
},
|
||||
onTapButton({detail}){
|
||||
if(detail.index==0)
|
||||
this.cancel()
|
||||
else if(detail.index==1)
|
||||
this.submit()
|
||||
}
|
||||
}
|
||||
})
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"mp-dialog": "/weui-miniprogram/dialog/dialog"
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<mp-dialog show="{{show}}" title="添加子单位" bindbuttontap="onTapButton" buttons="{{buttons}}">
|
||||
<view wx:if="{{show}}">
|
||||
<view class="input-wrap">
|
||||
<text class="key">所属单位</text>
|
||||
<input class="value disable" disabled="1" value="{{school_name}}"></input>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<text class="key require">子单位名称</text>
|
||||
<input class="value" bindinput="updateName"></input>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<text class="key">说明</text>
|
||||
<input class="value" bindinput="updateRemarks"></input>
|
||||
</view>
|
||||
</view>
|
||||
</mp-dialog>
|
@ -1,24 +0,0 @@
|
||||
.input-wrap{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.key{
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
}
|
||||
.key.require::before{
|
||||
content: "*";
|
||||
color: red;
|
||||
}
|
||||
.value.disable{
|
||||
background: #eeeeee;
|
||||
}
|
||||
.value{
|
||||
flex: 2;
|
||||
border-radius: 4px;
|
||||
padding: 4px 8px;
|
||||
border: 1px lightgrey solid;
|
||||
margin:4px;
|
||||
text-align: left;
|
||||
color: black;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"add-department":"./add-department/add-department"
|
||||
},
|
||||
"navigationBarTitleText": "个人信息"
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
@import "../form-item-common.wxss";
|
||||
.form-item>.value.none{
|
||||
color: dimgray;
|
||||
}
|
||||
.profile, page {
|
||||
height: 100%;
|
||||
}
|
||||
.sticky{
|
||||
top: 0;
|
||||
position: sticky;
|
||||
z-index: 10000;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
padding: 0 8px 0 16px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header>.error {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
transition: 0.72s all ease;
|
||||
background: #fa5151;
|
||||
color: white;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: -1;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.error.show {
|
||||
opacity: 1;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.header>button {
|
||||
margin: 2px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.gap {
|
||||
height: 3px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
border-radius: 50%;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
margin: 0 14px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
font-size: 24rpx;
|
||||
text-align: center;
|
||||
margin: 12px 0;
|
||||
color: grey;
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
const app = getApp();
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
_id: Number,
|
||||
name: String
|
||||
},
|
||||
data: {
|
||||
departments: []
|
||||
},
|
||||
methods: {
|
||||
addDepartment(){
|
||||
this.setData({showAddDepartment:true});
|
||||
},
|
||||
onTapHeader() {
|
||||
if (!this.data.departments || this.data.departments.length == 0) {
|
||||
this.getDepartments();
|
||||
}
|
||||
this.setData({ showDepartments: !this.data.showDepartments });
|
||||
},
|
||||
getDepartments(){
|
||||
app.api("schools.departments.for_option")({ school_id: this.data._id})
|
||||
.then(res => {
|
||||
let { departments } = res;
|
||||
if(departments.length==0)
|
||||
var no_department = true;
|
||||
else
|
||||
var no_department = false
|
||||
this.setData({departments, no_department});
|
||||
});
|
||||
},
|
||||
onTapDepartment(e) {
|
||||
;
|
||||
let { target: { dataset: { name: department_name, id: department_id } } } = e;
|
||||
if (!department_id) return;
|
||||
let { _id: school_id, name: school_name } = this.data;
|
||||
let data = { school_id, school_name, department_id, department_name };
|
||||
wx.setStorageSync("SET-SCHOOL-DEPARTMENT-KEY", data);
|
||||
wx.navigateBack({
|
||||
delta:1
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"add-department":"../../add-department/add-department"
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<view class="school">
|
||||
<view class="header" bindtap="onTapHeader">
|
||||
<view class="triangle {{showDepartments?'rotate':''}}"></view>
|
||||
<view>{{name}}</view>
|
||||
</view>
|
||||
<view class="departments {{showDepartments?'':'hidden'}}" bindtap="onTapDepartment">
|
||||
<view class="department" wx:for="{{departments}}" data-id="{{item.id}}" data-name="{{item.name}}">{{item.name}}</view>
|
||||
<block wx:if="{{departments.length==0&&no_department}}">
|
||||
<view class="department" data-id="-1" data-name="" bindlongpress="addDepartment">暂无子单位,长按申请新增</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<add-department show="{{showAddDepartment}}" school_id="{{_id}}" school_name="{{name}}" bindsuccess="getDepartments" wx:if="{{departments.length==0&&no_department}}"/>
|
@ -1,36 +0,0 @@
|
||||
.school{
|
||||
background: white;
|
||||
border-radius: 4px;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
.header{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
.triangle{
|
||||
height: 0px;
|
||||
width: 0px;
|
||||
border-top: solid 4px transparent;
|
||||
border-bottom: solid 4px transparent;
|
||||
border-left: solid 5px #222222;
|
||||
transition: 1s ease all;
|
||||
margin: 2px 7px 2px 5px;
|
||||
}
|
||||
.rotate{
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.departments{
|
||||
overflow: scroll;
|
||||
max-height: 210px;
|
||||
transition: 1px all ease;
|
||||
}
|
||||
.departments.hidden{
|
||||
max-height: 0px;
|
||||
}
|
||||
.department{
|
||||
padding: 4px;
|
||||
padding-left: 22px;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
schools:[]
|
||||
},
|
||||
onConfirm({detail:{value}}){
|
||||
;
|
||||
if(!value) return;
|
||||
this.search({keyword:value});
|
||||
},
|
||||
onSubmit({detail:{value}}){
|
||||
;
|
||||
if(!value.keyword) return;
|
||||
this.search({keyword:value.keyword});
|
||||
},
|
||||
search({keyword}){
|
||||
return app.api("schools.for_option")({keyword})
|
||||
.then(res => {
|
||||
let { schools } = res;
|
||||
if (schools.length > 100) {
|
||||
schools = schools.slice(0, 100);
|
||||
}
|
||||
this.setData({ schools });
|
||||
if(schools.length==0)
|
||||
wx.showToast({
|
||||
title:"没有相关单位",icon:"none"
|
||||
})
|
||||
})
|
||||
},
|
||||
clearKeyword(){
|
||||
this.setData({schools:[],_keyword:'',keyword:''});
|
||||
},
|
||||
onInput({detail:{value}}){
|
||||
this.setData({_keyword: value})
|
||||
},
|
||||
onLoad: function (options) {
|
||||
let {keyword} = options;
|
||||
if(keyword){
|
||||
this.setData({keyword, _keyword: keyword});
|
||||
this.search({keyword})
|
||||
}
|
||||
}
|
||||
})
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"school-item": "./school-item/school-item"
|
||||
},
|
||||
"navigationBarTitleText": "选择单位"
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<view class="body">
|
||||
<form bindsubmit="onSubmit">
|
||||
<view class="search">
|
||||
<view class="search-bar">
|
||||
<icon type="search"></icon>
|
||||
<input placeholder="学校/单位" auto-focus="1" name="keyword" bindinput="onInput" value="{{keyword}}" bindconfirm="onConfirm"></input>
|
||||
<icon wx:if="{{_keyword}}" type="clear" bindtap="clearKeyword"></icon>
|
||||
</view>
|
||||
<button form-type="submit" size="mini" type="main">搜索</button>
|
||||
</view>
|
||||
</form>
|
||||
<scroll-view class="schools" scroll-y="1">
|
||||
<view class="school-wrap" wx:for="{{schools}}" wx:key="id">
|
||||
<school-item _id="{{item.id}}" name="{{item.name}}"/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
@ -1,34 +0,0 @@
|
||||
.body{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
}
|
||||
.search{
|
||||
display: flex;
|
||||
padding: 0 12px 2px 12px;
|
||||
background: white;
|
||||
flex: none;
|
||||
}
|
||||
.search-bar{
|
||||
display: flex;
|
||||
padding: 0 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #00b0f0;
|
||||
flex: auto;
|
||||
align-items: center;
|
||||
margin-right: 16px;
|
||||
}
|
||||
.search-bar>input{
|
||||
flex: auto;
|
||||
padding: 3px;
|
||||
}
|
||||
.search>button{
|
||||
flex: none;
|
||||
}
|
||||
.schools{
|
||||
flex: 1 1 1px;
|
||||
height: 1px;
|
||||
}
|
||||
.school-wrap{
|
||||
margin-bottom: 1px;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
info:'获取中...'
|
||||
},
|
||||
|
||||
onLoad: function (options) {
|
||||
this.setData({info:"获取中"})
|
||||
wx.cloud.callFunction({name:"login"})
|
||||
.then(res=>{
|
||||
this.setData(res.result);
|
||||
}).catch(e=>{
|
||||
this.setData({info:"获取失败"});
|
||||
})
|
||||
},
|
||||
copy(){
|
||||
if(this.data.openid)
|
||||
wx.setClipboardData({data: "openid: " + this.data.openid});
|
||||
else
|
||||
this.onLoad();
|
||||
}
|
||||
})
|
@ -1,6 +0,0 @@
|
||||
<view>
|
||||
<view>
|
||||
openid: {{openid||info}}
|
||||
</view>
|
||||
<button class="copy" bindtap="copy" type="main" size="mini">{{openid?'复制':'重新获取'}}</button>
|
||||
</view>
|
@ -1,3 +0,0 @@
|
||||
button.copy{
|
||||
margin: 20px 12px;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
|
||||
Component({
|
||||
properties: {
|
||||
data:Object
|
||||
},
|
||||
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTapBody(){
|
||||
let {options, page} = this.data.data;
|
||||
let query = Object.keys(options).map(i=>`${i}=${options[i]}`).join("&");
|
||||
let url = "/"+page + "?" + query;
|
||||
console.log(url)
|
||||
wx.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
onTapKey(e){
|
||||
let {currentTarget:{dataset:{key}}} = e;
|
||||
console.log(e);
|
||||
let data = this.data.data[key];
|
||||
let detail = {[key]: data};
|
||||
console.log(detail);
|
||||
this.triggerEvent("condition", detail, {bubbles: true});
|
||||
}
|
||||
}
|
||||
})
|
@ -1,16 +0,0 @@
|
||||
|
||||
<view class="history {{data.isCrawl?'crawl':''}}" bindtap="onTapBody">
|
||||
<view class="header" >
|
||||
<text>{{data.time_show}} </text> {{data.isCrawl?'爬虫访问':""}}
|
||||
</view>
|
||||
<view class="body">
|
||||
<text data-key="page" catchtap="onTapKey">{{data.page_show}} </text>
|
||||
<text data-key="options" catchtap="onTapKey"> {{data.options_show}}</text>
|
||||
</view>
|
||||
<view class="single-line" data-key="scene" catchtap="onTapKey">
|
||||
{{data.scene}} {{data.sceneDesc}}
|
||||
</view>
|
||||
<view class="detail" data-key="openid" catchtap="onTapKey">
|
||||
{{data.openid}}
|
||||
</view>
|
||||
</view>
|
@ -1,19 +0,0 @@
|
||||
|
||||
.history{
|
||||
background: white;
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.history.crawl{
|
||||
border: 2px green solid;
|
||||
}
|
||||
.header,
|
||||
.detail{
|
||||
color: dimgray;
|
||||
font-size: 12px;
|
||||
}
|
||||
.single-line{
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
@ -1,147 +0,0 @@
|
||||
import {checkAuth} from "../../utils";
|
||||
import {getFormatDatetime} from "../../../js/utils"
|
||||
const app = getApp();
|
||||
const db = wx.cloud.database();
|
||||
const pageHistoryCollection = db.collection("pageHistory");
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
data: {
|
||||
data:[]
|
||||
},
|
||||
subscribe(){
|
||||
wx.requestSubscribeMessage({
|
||||
tmplIds: ["atZ4ZFfGIPxTiFGTCtkwvnfqjBA-fM7o1p5OiJQA_0Y"],
|
||||
fail:console.error
|
||||
})
|
||||
},
|
||||
onLoad: function (options) {
|
||||
this.options = {page:1, limit:20};
|
||||
if(checkAuth()){
|
||||
this.refresh({refresh:1});
|
||||
pageHistoryCollection.count()
|
||||
.then(res=>{
|
||||
console.log(res);
|
||||
this.setData({total: res.total});
|
||||
})
|
||||
}else{
|
||||
wx.showModal({
|
||||
title:"提示",
|
||||
content:"您没有权限访问",
|
||||
success: res=>{
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
async refresh({refresh=0}={}){
|
||||
if(!checkAuth())
|
||||
return;
|
||||
if(refresh){
|
||||
this.options.page = 1;
|
||||
}else{
|
||||
this.options.page ++
|
||||
}
|
||||
let {page,limit} = this.options;
|
||||
let skip = (page-1)*limit;
|
||||
console.log(skip, limit);
|
||||
let query = pageHistoryCollection;
|
||||
if(this.data.conditions){
|
||||
query = query.where(this.data.conditions);
|
||||
}
|
||||
if(refresh){
|
||||
query.count().then(res=>{
|
||||
console.log(res);
|
||||
this.setData({total: res.total});
|
||||
})
|
||||
}
|
||||
let res = await query.orderBy("time", "desc").skip(skip).limit(limit).get();
|
||||
let data = res.data.map(i=>{
|
||||
i.time_show = getFormatDatetime(i.time);
|
||||
i.options_show = JSON.stringify(i.options);
|
||||
i.page_show = i.page.match(/\/([^\/]*$)/)[1];
|
||||
return i;
|
||||
});
|
||||
console.log(data);
|
||||
if(!refresh){
|
||||
data = this.data.data.concat(data)
|
||||
}
|
||||
this.setData({data});
|
||||
},
|
||||
deleteMine(){
|
||||
app.cloudapi("clearPageHistory")({
|
||||
openid: app.globalData.openid
|
||||
}).then(res=>{
|
||||
console.log(res);
|
||||
wx.showToast({
|
||||
title: res.errMsg,
|
||||
})
|
||||
this.refresh({refresh:1});
|
||||
}).catch(e=>{
|
||||
wx.showToast({
|
||||
title: e.errMsg,icon:"none"
|
||||
})
|
||||
})
|
||||
},
|
||||
onConditionChange(e){
|
||||
let {detail} = e;
|
||||
console.log(e);
|
||||
console.log(detail);
|
||||
let conditions = {...this.data.conditions, ...detail};
|
||||
this.setData({conditions});
|
||||
this.refresh({refresh:1})
|
||||
.then(res=>{
|
||||
wx.showToast({
|
||||
title:"筛选成功"
|
||||
})
|
||||
})
|
||||
},
|
||||
deleteCondition(e){
|
||||
console.log(e);
|
||||
let {currentTarget:{dataset:{key}}} = e;
|
||||
let conditions = this.data.conditions;
|
||||
delete conditions[key];
|
||||
this.setData({conditions});
|
||||
this.refresh({refresh:1}).then(res=>{
|
||||
wx.showToast({
|
||||
title: '删除筛选成功'
|
||||
})
|
||||
})
|
||||
},
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
onPullDownRefresh: function () {
|
||||
this.setData({conditions:""});
|
||||
this.refresh({refresh:1}).then(res=>{
|
||||
wx.showToast({
|
||||
title: '刷新成功'
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onReachBottom: function () {
|
||||
this.refresh({refresh:0});
|
||||
},
|
||||
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"history-item":"./history-item/history-item"
|
||||
},
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 260,
|
||||
"navigationBarTitleText": "访问记录"
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
<view class="top-sticky flex-row">
|
||||
<view class="item" wx:for="{{conditions}}" data-key="{{index}}" bindtap="deleteCondition">
|
||||
{{index}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="history-item-wrp" wx:for="{{data}}" bindcondition="onConditionChange">
|
||||
<history-item data="{{item}}"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<button wx:if="{{false}}" type="main" bindtap="subscribe">订阅({{total}})</button>
|
||||
<button type="main" bindtap="onPullDownRefresh">刷新({{total}})</button>
|
||||
<button type="secondary" bindtap="deleteMine">删除我的</button>
|
||||
</view>
|
@ -1,33 +0,0 @@
|
||||
|
||||
.top-sticky{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
overflow-x: scroll;
|
||||
background: white;
|
||||
}
|
||||
.top-sticky>.item{
|
||||
margin: 4px;
|
||||
padding: 4px 8px;
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
border-radius: 50px;
|
||||
}
|
||||
.list{
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
.history-item-wrp{
|
||||
margin: 3px 12px 7px 12px;
|
||||
}
|
||||
.footer{
|
||||
display: flex;
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
.footer>button{
|
||||
flex: 1;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
export function checkAuth(){
|
||||
return getApp().globalData.openid == "oqugK431bepFwW6TGrHpQTerPkI0"
|
||||
}
|
@ -1,314 +0,0 @@
|
||||
import config from "./config";
|
||||
import { client } from "./js/client";
|
||||
|
||||
wx.cloud.init({
|
||||
traceUser: true,
|
||||
env: "educoder",
|
||||
success:console.log,
|
||||
fail: console.error
|
||||
});
|
||||
|
||||
App({
|
||||
globalData: {
|
||||
openid:wx.getStorageSync('openid'),
|
||||
isCrawl: false, //是否是爬虫
|
||||
scene: -1
|
||||
},
|
||||
client,
|
||||
openapi(name){
|
||||
return ({success, fail, complete, ...data}={})=>{
|
||||
return this.callOpenapi({name, data, success,fail, complete});
|
||||
}
|
||||
},
|
||||
cloudapi(name){
|
||||
return ({success, fail, complete, ...data}={})=>{
|
||||
return this.callCloudfunction({
|
||||
name:"cloudapi", data:{name, data}, success, fail, complete
|
||||
});
|
||||
}
|
||||
},
|
||||
callOpenapi({name, data, success, fail, complete}){
|
||||
return this.callCloudfunction({name:"openapi", data:{name, data}, success, fail, complete});
|
||||
},
|
||||
cloudfunction(name){
|
||||
return ({success, fail, complete, ...data}={})=>{
|
||||
return this.callCloudfunction({name, data, success, fail, complete});
|
||||
}
|
||||
},
|
||||
callCloudfunction({name, data, success, fail, complete}){
|
||||
return new Promise((resolve, reject)=>{
|
||||
return wx.cloud.callFunction({name, data,
|
||||
success:res=>{
|
||||
success&&success(res.result);
|
||||
resolve(res.result);
|
||||
complete&&complete(res.result);
|
||||
}, fail:e=>{
|
||||
fail&&fail(e);
|
||||
reject(e);
|
||||
complete&&complete(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
reportPageHistory:function({page, route, scene, status, options}={}){
|
||||
let data = {}
|
||||
page = page||getCurrentPages()[getCurrentPages().length-1];
|
||||
if(page){
|
||||
Object.assign(data,
|
||||
{
|
||||
route: page.route,
|
||||
page: page.route, //@desprate
|
||||
scene: this.globalData.scene,
|
||||
status: 200,
|
||||
options: page.options
|
||||
})
|
||||
}
|
||||
if(route){
|
||||
data.page = data.route = route;
|
||||
}
|
||||
if(scene)
|
||||
data.scene = scene;
|
||||
if(status)
|
||||
data.status = status;
|
||||
if(options)
|
||||
data.options = options;
|
||||
|
||||
this.cloudapi("reportPageHistory")(data).catch(e=>{
|
||||
global.realTimeLog.error("report history error", e);
|
||||
wx.reportMonitor('2', 1);
|
||||
})
|
||||
},
|
||||
realTimeLog:global.realTimeLog,
|
||||
api(name, config) { return client.api(name, config) },
|
||||
callApi(options) { return client.callApi(options) },
|
||||
user() { return client.user },
|
||||
syncUser(options) { return client.syncUser(options) },
|
||||
updateUserInfo(info){return client.updateUserInfo(info)},
|
||||
onLaunch: function (options) {
|
||||
this.globalData.scene = options.scene;
|
||||
if(options.scene==1129){
|
||||
this.globalData.isCrawl = true;
|
||||
// this.cloudfunction("login")({mpcrawl: true});
|
||||
this.api("accounts.login")(global.accountManager.testAccount)
|
||||
.then(res=>{
|
||||
let account = { ...res, ...global.accountManager.testAccount};
|
||||
global.accountManager.setCurrentAccount(account);
|
||||
});
|
||||
/* 爬虫访问时运行这些没有用
|
||||
wx.reportMonitor('1', 1);
|
||||
global.realTimeLog.info("爬虫访问", options);
|
||||
global.realTimeLog.setFilterMsg("mpcrawl");
|
||||
*/
|
||||
}else if(!this.globalData.openid){
|
||||
this.cloudfunction("login")()
|
||||
.then(res=>{
|
||||
this.globalData.openid = res.openid;
|
||||
wx.setStorage({
|
||||
data: res.openid,
|
||||
key: 'openid',
|
||||
})
|
||||
})
|
||||
}
|
||||
if (options.referrerInfo && options.referrerInfo.appId) {
|
||||
var db = wx.cloud.database();
|
||||
let { appId, extraData } = options.referrerInfo;
|
||||
let { scene, path } = options;
|
||||
db.collection("referrer_info")
|
||||
.add({
|
||||
data: {
|
||||
appId, extraData, scene, path,
|
||||
createdAt: db.serverDate()
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 系统升级提醒
|
||||
this.api("users.system_update")().then(res => {
|
||||
if (res.system_update) {
|
||||
let { subject = "升级服务通知", system_score} = res;
|
||||
if(!system_score){
|
||||
let {end_time} = res;
|
||||
if(end_time){
|
||||
const {getFormatDatetime} = require('./js/utils');
|
||||
system_score = "为了给大家提供更优质的体验,平台正在对系统进行升级,期间系统响应会有一定延迟。系统将于"+getFormatDatetime(new Date(end_time))+"恢复正常。敬请谅解";
|
||||
}else{
|
||||
system_score = "为了给大家提供更优质的体验,平台正在对系统进行升级,期间系统响应会有一定延迟,敬请谅解";
|
||||
}
|
||||
}
|
||||
wx.showModal({
|
||||
title: subject,
|
||||
content: system_score,
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
}).catch(e=>{});
|
||||
*/
|
||||
if(global.config.saveFlow){
|
||||
wx.showToast({
|
||||
title: '省流模式已开启,默认不加载图片',icon:"none",duration:2600
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if (client.user_id && client.user_id != 2)
|
||||
client.getTidingInfo();
|
||||
},
|
||||
onPageNotFound(res) {
|
||||
this.realTimeLog.error("page not find!! redirect", res);
|
||||
this.reLaunch({ url: "{main}" });
|
||||
},
|
||||
showError(e, duration = 1500) {
|
||||
wx.showToast({
|
||||
title: e.message,
|
||||
icon: "none",
|
||||
duration
|
||||
})
|
||||
},
|
||||
showMsg({message=""}, duration = 1500) {
|
||||
wx.showToast({
|
||||
title: message, duration
|
||||
})
|
||||
},
|
||||
getPageUrl(url, root = "/") {
|
||||
return url.replace(/{(.*)}/, function (match, name) {
|
||||
for (var u of __wxConfig.pages) {
|
||||
if (u.endsWith("/" + name))
|
||||
return root + u;
|
||||
}
|
||||
for (var u of config.pages) {
|
||||
if (u.endsWith("/" + name))
|
||||
return root + u;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
},
|
||||
reLaunch({ url, success, fail, complete }) {
|
||||
wx.reLaunch({ url: this.getPageUrl(url), success, fail, complete })
|
||||
},
|
||||
redirectTo({ url, success, fail, complete }) {
|
||||
wx.redirectTo({ url: this.getPageUrl(url), success, fail, complete })
|
||||
},
|
||||
navigateTo({ url, success, fail, complete }) {
|
||||
wx.navigateTo({ url: this.getPageUrl(url), success, fail, complete })
|
||||
},
|
||||
checkLogin({showModal=1, content="您需要登陆后才能使用该功能"}={}){
|
||||
if(client.user.user_id==2){
|
||||
if(showModal){
|
||||
wx.showModal({
|
||||
confirmText:"现在登录",
|
||||
title:"提示",
|
||||
content,
|
||||
success:res=>{
|
||||
if(res.confirm)
|
||||
this.navigateTo({url:"{account}"})
|
||||
}
|
||||
})
|
||||
}
|
||||
return false;
|
||||
}else
|
||||
return true;
|
||||
},
|
||||
addToFavorites({title, query, imageUrl}={}){
|
||||
let db = wx.cloud.database();
|
||||
let data = {
|
||||
type:"addToFavorites",
|
||||
title,
|
||||
imageUrl,
|
||||
query,
|
||||
scene: this.globalData.scene,
|
||||
version: config.version,
|
||||
time: db.serverDate()
|
||||
}
|
||||
db.collection("shareInfo").add({
|
||||
|
||||
data
|
||||
});
|
||||
return {
|
||||
title, query, imageUrl
|
||||
}
|
||||
},
|
||||
shareTimeline({title, query, imageUrl}={}){
|
||||
let db = wx.cloud.database();
|
||||
let data = {
|
||||
type:"shareTimeline",
|
||||
title,
|
||||
imageUrl,
|
||||
query,
|
||||
scene: this.globalData.scene,
|
||||
version: config.version,
|
||||
time: db.serverDate()
|
||||
}
|
||||
db.collection("shareInfo").add({
|
||||
data
|
||||
});
|
||||
return {
|
||||
title, query, imageUrl
|
||||
}
|
||||
},
|
||||
shareApp({ imageUrl, path, title="EduCoder教学"}={}) {
|
||||
let db = wx.cloud.database();
|
||||
let shareInfo = {
|
||||
title,
|
||||
imageUrl,
|
||||
path
|
||||
}
|
||||
if (config.envVersion == 'release'&&!this.globalData.isCrawl) {
|
||||
if (!path) {
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
let options = page.options;
|
||||
let route = page.route;
|
||||
let query = Object.keys(options).map(i => `${i}=${options[i]}`).join("&");
|
||||
path = "/" + route + (query ? ('?' + query) : '');
|
||||
}
|
||||
let data = {
|
||||
type:"shareAppMessage",
|
||||
title,
|
||||
imageUrl,
|
||||
path,
|
||||
scene: this.globalData.scene,
|
||||
version: config.version,
|
||||
time: db.serverDate()
|
||||
}
|
||||
console.log("upload", data);
|
||||
db.collection("shareInfo").add({
|
||||
|
||||
data
|
||||
});
|
||||
}
|
||||
return shareInfo;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 兼容Promise.finally
|
||||
if(!Promise.prototype.finally){
|
||||
Promise.prototype.finally = function (callback) {
|
||||
let P =this.constructor;
|
||||
return this.then(
|
||||
value => P.resolve(callback()).then(() => value),
|
||||
reason => P.resolve(callback()).then(() => {throw reason })
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
function getCurrentPath() {
|
||||
let pages = getCurrentPages();
|
||||
return pages[pages.length - 1].route;
|
||||
}
|
||||
function toAbsPath(current, path) {
|
||||
if (path.startsWith("/"))
|
||||
current = ".";
|
||||
else
|
||||
current = current + "/../";
|
||||
path = current + path;
|
||||
while (path.indexOf("..") != -1) {
|
||||
path = path.replace(/[^\/]*\/\.\.\//g, "")
|
||||
}
|
||||
while (path.indexOf(".") != -1) {
|
||||
path = path.replace(/\.\//, "");
|
||||
}
|
||||
return path;
|
||||
}
|
||||
*/
|
@ -1,203 +0,0 @@
|
||||
{
|
||||
"window": {
|
||||
"backgroundTextStyle": "dark",
|
||||
"navigationBarBackgroundColor": "#fbfbfb",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "EduCoder",
|
||||
"backgroundColor": "#f5f5f5"
|
||||
},
|
||||
"usingComponents": {
|
||||
"iconfont": "/components/iconfont/iconfont",
|
||||
"require-login": "/components/require-login/require-login",
|
||||
"mp-icon": "/weui-miniprogram/icon/icon"
|
||||
},
|
||||
"pages": [
|
||||
"pages/main/main",
|
||||
"pages/findmore/findmore",
|
||||
"pages/home/home",
|
||||
"pages/tidings/tidings"
|
||||
],
|
||||
"subpackages": [
|
||||
{
|
||||
"root": "mooc_case",
|
||||
"pages": [
|
||||
"pages/mooc_cases/mooc_cases"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "competition",
|
||||
"pages": [
|
||||
"pages/competitions/competitions"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "project",
|
||||
"pages": [
|
||||
"pages/project/project"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "admin",
|
||||
"pages": [
|
||||
"pages/page_history/page_history"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "markdown",
|
||||
"pages": [
|
||||
"task/task/task",
|
||||
"components/rich-md/rich-md",
|
||||
"account/about/about",
|
||||
"account/agreement/agreement",
|
||||
"account/pro_authentication/pro_authentication",
|
||||
"competition/competition/competition",
|
||||
"exercise/exercise/exercise",
|
||||
"path/path/path",
|
||||
"path/path_send/path_send",
|
||||
"shixun/shixun/shixun",
|
||||
"admin/git_repo/git_repo",
|
||||
"mooc_case/mooc_case/mooc_case"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "account",
|
||||
"pages": [
|
||||
"pages/change_password/change_password",
|
||||
"pages/profile/profile",
|
||||
"pages/account/account",
|
||||
"pages/profile/school_select/school_select",
|
||||
"pages/accounts/accounts",
|
||||
"pages/user_info/user_info"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "setting",
|
||||
"pages": [
|
||||
"pages/image_crop/image_crop",
|
||||
"pages/setting/setting"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "course",
|
||||
"pages": [
|
||||
"pages/course/course",
|
||||
"pages/course_invite/course_invite",
|
||||
"pages/attendance_detail/attendance_detail",
|
||||
"modules/attendance/attendance",
|
||||
"modules/students/students",
|
||||
"pages/attendances/attendances",
|
||||
"pages/teacher_apply/teacher_apply"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "exercise",
|
||||
"pages": [
|
||||
"pages/exercise/exercise",
|
||||
"pages/exercise_cover/exercise_cover"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "shixun_homework",
|
||||
"pages": [
|
||||
"pages/shixun_homework/shixun_homework"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "shixun",
|
||||
"pages": [
|
||||
"pages/shixun/shixun"
|
||||
]
|
||||
},
|
||||
{
|
||||
"root": "task",
|
||||
"pages": [
|
||||
"pages/task/task"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "search",
|
||||
"root": "pages/search",
|
||||
"pages": [
|
||||
"search"
|
||||
]
|
||||
}
|
||||
],
|
||||
"preloadRule": {
|
||||
"pages/findmore/findmore": {
|
||||
"network": "all",
|
||||
"packages": [
|
||||
"shixun",
|
||||
"search",
|
||||
"markdown"
|
||||
]
|
||||
},
|
||||
"pages/home/home": {
|
||||
"network": "all",
|
||||
"packages": [
|
||||
"setting",
|
||||
"account",
|
||||
"markdown"
|
||||
]
|
||||
},
|
||||
"pages/main/main": {
|
||||
"network": "all",
|
||||
"packages": [
|
||||
"course",
|
||||
"account",
|
||||
"shixun",
|
||||
"markdown"
|
||||
]
|
||||
},
|
||||
"course/pages/course/course": {
|
||||
"network": "all",
|
||||
"packages": [
|
||||
"markdown",
|
||||
"exercise",
|
||||
"account"
|
||||
]
|
||||
},
|
||||
"account/pages/account/account": {
|
||||
"network": "all",
|
||||
"packages": [
|
||||
"markdown"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tabBar": {
|
||||
"selectedColor": "#00b0f0",
|
||||
"color": "#8a8a8a",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/main/main",
|
||||
"text": "我的",
|
||||
"iconPath": "images/tab_study_default.png",
|
||||
"selectedIconPath": "images/tab_study_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/findmore/findmore",
|
||||
"text": "探索",
|
||||
"iconPath": "images/tab_findmore_default.png",
|
||||
"selectedIconPath": "images/tab_findmore_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/tidings/tidings",
|
||||
"text": "消息",
|
||||
"iconPath": "images/tab_tiding_default.png",
|
||||
"selectedIconPath": "images/tab_tiding_pressed.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/home/home",
|
||||
"iconPath": "images/tab_my_default.png",
|
||||
"selectedIconPath": "images/tab_my_pressed.png",
|
||||
"text": "个人中心"
|
||||
}
|
||||
]
|
||||
},
|
||||
"useExtendedLib": {
|
||||
"weui": true
|
||||
},
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"themeLocation": "theme.json",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"style": "v2"
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
page {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.flex-wrap{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.form-wrap {
|
||||
margin: 12px 0;
|
||||
}
|
||||
.tappable{
|
||||
color: #0080f0;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.tappable:hover {
|
||||
opacity: .6;
|
||||
}
|
||||
.container {
|
||||
padding: 0 12px;
|
||||
}
|
||||
.hint,
|
||||
.error
|
||||
.warning {
|
||||
display: block;
|
||||
margin: 7px 0;
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
}
|
||||
.error{color:red;}
|
||||
.warning{color: orange;}
|
||||
.bg-main{background-color:#0590f0}
|
||||
.color-main{color:#0590f0}
|
||||
.color-light-main{color: #00b0f0;}
|
||||
.color-dark-main{color:#0080f0}
|
||||
button.button-main{background:#00b0f0}
|
||||
.border-main{border-color:#00b0f0}
|
||||
.flex-col,.flex-row{display: flex}
|
||||
.flex-col{flex-direction: column}
|
||||
.fl{float:left}
|
||||
.fr{float:right}
|
||||
.p4{padding:4px}
|
||||
.p8{padding:8px}
|
||||
.p12{padding:12px}
|
||||
.m4{margin:4px}
|
||||
.m8{margin:8px}
|
||||
.m12{margin:12px}
|
||||
.color-white{color: white}
|
||||
.single-line{
|
||||
overflow: hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.round{
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
radio .wx-radio-input.wx-radio-input-checked{
|
||||
background: #00b0f0;
|
||||
border-color: #00b0f0;
|
||||
}
|
||||
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||
color: #00b0f0!important;
|
||||
}
|
||||
.checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||
color: #00b0f0;
|
||||
}
|
||||
*/
|
||||
button[type=main][plain],button[type=cap][plain]{
|
||||
color: #00b0f0;
|
||||
border: 1px solid #00b0f0;
|
||||
background-color: transparent;
|
||||
}
|
||||
button[type=cap],button[type=main]{
|
||||
background: #00b0f0;
|
||||
color: white;
|
||||
}
|
||||
button[type=cap]{
|
||||
border-radius: 30px;
|
||||
}
|
||||
button[type=cap][disabled],button[type=main][disabled]{
|
||||
background: #00b0f0aa;
|
||||
}
|
||||
button[plain][disabled]{
|
||||
background: transparent;
|
||||
}
|
||||
button[type=secondary]{
|
||||
color: #00b0f0;
|
||||
background: #f1f1f1;
|
||||
}
|
||||
button[type=error]{
|
||||
background: #fa5151;
|
||||
color: white;
|
||||
}
|
||||
button[type=error][plain]{
|
||||
color: #fa5151;
|
||||
border: 1px solid #fa5151;
|
||||
background-color: transparent;
|
||||
}
|