parent
8bc73d7bd8
commit
37b6d4edc3
@ -1,4 +1,6 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"usingComponents": {
|
||||
"iconfont":"/components/iconfont/iconfont"
|
||||
},
|
||||
"navigationBarTitleText": "账号"
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
import {accountManager} from "../../../js/utils";
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
data: {
|
||||
eduImgDir: global.config.eduImgDir
|
||||
},
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
onShow(){
|
||||
this.refresh();
|
||||
},
|
||||
navBack(){
|
||||
wx.navigateBack({
|
||||
delta:1
|
||||
});
|
||||
},
|
||||
refresh(){
|
||||
this.setData({loading:1});
|
||||
app.syncUser()
|
||||
.then(res=>{
|
||||
if (this.oldNum!=null && accountManager.getAccounts().length>this.oldNum && !this.data.currentAccountSaved && this.data.currentAccount) {
|
||||
console.error("add current")
|
||||
console.log(this.data.currentAccount);
|
||||
accountManager.addAccount(this.data.currentAccount);
|
||||
this.setData({ currentAccountSaved: 1 });
|
||||
}
|
||||
let addedAccounts = accountManager.getAccounts();
|
||||
var currentAccount = accountManager.getCurrentAccount();
|
||||
var currentAccountSaved = 0;
|
||||
if(res.user.user_id&&res.user.user_id!=2){
|
||||
if(!currentAccount){
|
||||
var currentAccount = { login: res.user.phone || res.user.email, password: "", save_password: 0, image_url: res.user.image_url, name: res.user.real_name||res.user.name, user_id: res.user.user_id};
|
||||
console.log("currentAccount", currentAccount);
|
||||
accountManager.setCurrentAccount(currentAccount);
|
||||
}
|
||||
for (var account of addedAccounts){
|
||||
if(account.user_id==currentAccount.user_id)
|
||||
currentAccountSaved = 1;
|
||||
}
|
||||
if(!currentAccountSaved)
|
||||
var accounts = [...addedAccounts, currentAccount];
|
||||
else
|
||||
var accounts = addedAccounts;
|
||||
|
||||
}else{
|
||||
var accounts = addedAccounts;
|
||||
}
|
||||
this.setData({ accounts, user: res.user, currentAccountSaved, currentAccount,loading:0});
|
||||
})
|
||||
},
|
||||
removeAccount(e){
|
||||
console.log(e);
|
||||
let { currentTarget: { dataset: { id: user_id } } } = e;
|
||||
var info = this.data.user.user_id == user_id?'退出登录并移除':"移除此账号";
|
||||
wx.showActionSheet({
|
||||
itemList: [info],
|
||||
success:res=>{
|
||||
if(res.tapIndex==0){
|
||||
console.log(user_id);
|
||||
accountManager.removeAccount({user_id});
|
||||
if(this.data.user.user_id==user_id){
|
||||
accountManager.clearCurrentAccount();
|
||||
app.client.session.cookies = "";
|
||||
app.client.synch = 0;
|
||||
}
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
switchAccount(e){
|
||||
console.log(e);
|
||||
let { currentTarget: {dataset: {id: user_id}}} = e;
|
||||
if (user_id==this.data.user.user_id) return;
|
||||
if (accountManager.getAccounts().length<5&&!this.data.currentAccountSaved&&this.data.currentAccount){
|
||||
accountManager.addAccount(this.data.currentAccount);
|
||||
this.setData({currentAccountSaved:1});
|
||||
}
|
||||
let account = this.data.accounts.filter(i=>i.user_id == user_id) [0];
|
||||
if(!account.save_password){
|
||||
wx.navigateTo({ url: "../account/account?nostorage=1&error=账号过期,需重新登录; 密码将加密保存至本地&save_password=1&addaccount=1&login_disabled=1&login="+account.login});
|
||||
}else{
|
||||
app.api("accounts.login")(account)
|
||||
.then(res=>{
|
||||
wx.showToast({
|
||||
title: '切换成功'
|
||||
});
|
||||
accountManager.setCurrentAccount(account);
|
||||
this.refresh();
|
||||
}).catch(e=>{
|
||||
wx.navigateTo({ url: "../account/account?nostorage=1&error=账号过期,需重新登录;密码将加密保存至本地&save_password=1&addaccount=1&login_disabled=1&login=" + account.login });
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
addAccount(){
|
||||
this.oldNum = accountManager.getAccounts().length
|
||||
if(this.oldNum>=5)
|
||||
return wx.showToast({
|
||||
title: '已达数量上限,无法添加',icon:"none"
|
||||
})
|
||||
wx.navigateTo({ url:"../account/account?nostorage=1&error=密码将加密保存至本地&save_password=1&addaccount=1"});
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "切换账号"
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<page-meta>
|
||||
<navigation-bar loading="{{loading}}"/>
|
||||
</page-meta>
|
||||
|
||||
<view>
|
||||
<view wx:for="{{accounts}}" class="account" data-id="{{item.user_id}}" bindtap="switchAccount" bindlongpress="removeAccount" wx:key="user_id">
|
||||
<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>
|
||||
<view class="empty" wx:if="{{accounts.length==0}}">
|
||||
<text>暂无账号</text>
|
||||
</view>
|
||||
<button class="addAccount" type="main" bindtap="addAccount">添加账号</button>
|
||||
<button class="nav-back" type="main" plain="1" bindtap="navBack">返回</button>
|
||||
<view class="tip">长按移除</view>
|
||||
</view>
|
@ -0,0 +1,41 @@
|
||||
.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 8px;
|
||||
}
|
||||
|
||||
.info{
|
||||
flex: auto;
|
||||
}
|
||||
.info>.login{
|
||||
font-size: 12px;
|
||||
color: dimgray;
|
||||
}
|
||||
|
||||
.addAccount{
|
||||
margin-top: 24px;
|
||||
}
|
||||
.nav-back{
|
||||
margin-top: 8px;
|
||||
}
|
||||
.tip{
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
margin-top: 8px;
|
||||
color: dimgray;
|
||||
}
|
||||
.empty{
|
||||
text-align: center;
|
||||
color: dimgray;
|
||||
font-size: 13px;
|
||||
margin: 8px 0;
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"rich-md":"/components/rich-md/rich-md",
|
||||
"iconfont":"/components/iconfont/iconfont"
|
||||
},
|
||||
"navigationBarTitleText": "实名认证"
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
@import "../form-item-common.wxss";
|
||||
|
||||
|
||||
.idcard-wrap{
|
||||
margin-top: 12px;
|
||||
margin-bottom: 4px;
|
||||
background: white;
|
||||
padding: 12px;
|
||||
}
|
||||
.idcard-wrap>.key{
|
||||
margin: 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.idcards{
|
||||
margin: 12px 0;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.idcard{
|
||||
width: 40vw;
|
||||
height: 30vw;
|
||||
}
|
||||
.idcard.upload{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #f4fcff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.idcard>.photo{
|
||||
background: #00b0f0;
|
||||
border-radius: 50%;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tips{
|
||||
display: flex;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
color: #555555;
|
||||
}
|
||||
.tips>view{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.submit{
|
||||
margin-top: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.footer-tip{
|
||||
font-size: 12px;
|
||||
color: dimgray;
|
||||
text-align: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
.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);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"rich-md": "/components/rich-md/rich-md",
|
||||
"iconfont": "/components/iconfont/iconfont"
|
||||
},
|
||||
"navigationBarTitleText": "职业认证"
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
@import "../form-item-common.wxss";
|
||||
|
||||
|
||||
.idcard-wrap{
|
||||
margin-top: 12px;
|
||||
margin-bottom: 4px;
|
||||
background: white;
|
||||
padding: 12px;
|
||||
}
|
||||
.idcard-wrap>.key{
|
||||
margin: 2px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.idcards{
|
||||
margin: 12px 0;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.idcard{
|
||||
width: 40vw;
|
||||
height: 30vw;
|
||||
}
|
||||
.idcard.upload{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #f4fcff;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.idcard>.photo{
|
||||
background: #00b0f0;
|
||||
border-radius: 50%;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tips{
|
||||
display: flex;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
color: #555555;
|
||||
}
|
||||
.tips>view{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.submit{
|
||||
margin-top: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.footer-tip{
|
||||
font-size: 12px;
|
||||
color: dimgray;
|
||||
text-align: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": ""
|
||||
"navigationBarTitleText": "基本信息"
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {},
|
||||
"usingComponents": {
|
||||
"iconfont":"../iconfont/iconfont"
|
||||
},
|
||||
"navigationBarBackgroundColor": "#00b0f0",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
@ -1,11 +1,21 @@
|
||||
<navigator class="bg{{data.id%7}} course" url="/course/pages/course/course?course_id={{data.id}}" bindlongpress="showAction">
|
||||
<view wx:if="{{data.sticky}}" class="sticky"></view>
|
||||
<view class="header"><image class="action" mode="aspectFit" catchtap="showAction" src="./more.png"/></view>
|
||||
<view class="header">
|
||||
<image class="action" mode="aspectFit" catchtap="showAction" src="./more.png" />
|
||||
</view>
|
||||
<view class="body">
|
||||
<image class="avatar" src="{{eduImgDir}}{{data.avatar_url}}"/>
|
||||
<image class="avatar" src="{{eduImgDir}}{{data.avatar_url}}" />
|
||||
<view class="course-info">
|
||||
<view class="course-name">{{data.name}}</view>
|
||||
<view><text class="school">{{data.school}}</text> <text>{{data.creator}}</text> </view>
|
||||
<view class="info">
|
||||
<text class="school">{{data.school}}</text>
|
||||
<text>{{data.creator}}</text> </view>
|
||||
<view class="detail">
|
||||
<iconfont type="member-count" size="14"/>
|
||||
<text class="detail-num">{{data.course_members_count}}</text>
|
||||
<iconfont type="visit-num" size="14"/>
|
||||
<text class="detail-num">{{data.visits}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
@ -0,0 +1,57 @@
|
||||
Component({
|
||||
externalClasses: ['class'],
|
||||
|
||||
properties: {
|
||||
info: String,
|
||||
type: String,
|
||||
size: {
|
||||
type:Number,
|
||||
value: 23
|
||||
},
|
||||
fontsize:{
|
||||
type:Number
|
||||
},
|
||||
color: {
|
||||
type:String,
|
||||
value:"inherit"
|
||||
},
|
||||
showtype:{
|
||||
type:String,
|
||||
value:"default"
|
||||
},
|
||||
duration:{
|
||||
type:Number,
|
||||
value:1500
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTap() {
|
||||
let {info, showtype, duration} = this.data;
|
||||
if(info){
|
||||
if(showtype=='toast')
|
||||
wx.showToast({
|
||||
title: info,icon:"none", duration
|
||||
})
|
||||
else if(showtype=='modal')
|
||||
wx.showToast({
|
||||
title: info, showCancel:false,duration
|
||||
})
|
||||
else
|
||||
this.showInfo()
|
||||
}
|
||||
},
|
||||
showInfo(){
|
||||
if (this.timeid)
|
||||
clearTimeout(this.timeid);
|
||||
this.setData({showInfo:1});
|
||||
this.timeid = setTimeout(() => {
|
||||
this.hideInfo();
|
||||
},this.data.duration);
|
||||
},
|
||||
hideInfo(){
|
||||
this.setData({showInfo:0});
|
||||
this.timeid = null;
|
||||
}
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<view class="class iconfont icon-{{type}}" style="color:{{color}};font-size:{{fontsize||size}}px;height:{{size}}px;width:{{size}}px" bindtap="onTap">
|
||||
<view wx:if="{{info}}" hidden="{{!showInfo}}" class="info-wrap">
|
||||
<view class="triangle"></view>
|
||||
<view class="info">{{info}}</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,109 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* project id 1656783 */
|
||||
src: url('//at.alicdn.com/t/font_1656783_u55yruw45f.eot');
|
||||
src: url('//at.alicdn.com/t/font_1656783_u55yruw45f.eot?#iefix') format('embedded-opentype'),
|
||||
url('//at.alicdn.com/t/font_1656783_u55yruw45f.woff2') format('woff2'),
|
||||
url('//at.alicdn.com/t/font_1656783_u55yruw45f.woff') format('woff'),
|
||||
url('//at.alicdn.com/t/font_1656783_u55yruw45f.ttf') format('truetype'),
|
||||
url('//at.alicdn.com/t/font_1656783_u55yruw45f.svg#iconfont') format('svg');
|
||||
}
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
font-family: "iconfont" !important;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.info {
|
||||
text-align: center;
|
||||
min-width: 3.2em;
|
||||
background-color: #555555;
|
||||
padding:3px 5px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
.triangle{
|
||||
height: 0px;
|
||||
width: 0px;
|
||||
border-bottom: solid 5px #555555;
|
||||
border-right: solid 4px transparent;
|
||||
border-left: solid 4px transparent;
|
||||
}
|
||||
.info-wrap {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
font-size: 0.54em;
|
||||
color: #fff;
|
||||
font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
|
||||
.icon-xiugaimima:before {
|
||||
content: "\e68b";
|
||||
}
|
||||
|
||||
.icon-guanyu:before {
|
||||
content: "\e693";
|
||||
}
|
||||
|
||||
.icon-kefu:before {
|
||||
content: "\e630";
|
||||
}
|
||||
|
||||
.icon-wode-zhiyerenzheng:before {
|
||||
content: "\e6a7";
|
||||
}
|
||||
|
||||
.icon-shimingrenzheng:before {
|
||||
content: "\e637";
|
||||
}
|
||||
|
||||
.icon-fankui:before {
|
||||
content: "\e694";
|
||||
}
|
||||
|
||||
.icon-banben:before {
|
||||
content: "\e687";
|
||||
}
|
||||
|
||||
.icon-paizhao:before {
|
||||
content: "\e63d";
|
||||
}
|
||||
|
||||
.icon-visit-num:before {
|
||||
content: "\e629";
|
||||
}
|
||||
|
||||
.icon-member-count:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
|
||||
.icon-certification:before {
|
||||
content: "\e624";
|
||||
}
|
||||
|
||||
.icon-authentication:before {
|
||||
content: "\e713";
|
||||
}
|
||||
|
||||
.icon-filter:before {
|
||||
content: "\e6c7";
|
||||
}
|
||||
.icon-saoma:before{
|
||||
content: "\e7f3"
|
||||
}
|
||||
.icon-jinru:before{
|
||||
content: "\e657"
|
||||
}
|
||||
.icon-qiehuanzhanghao:before{
|
||||
content: "\e688";
|
||||
}
|
||||
.icon-yiwen:before{
|
||||
content: "\e600";
|
||||
}
|
@ -1,3 +1 @@
|
||||
<navigator wx:if="{{user_id==2}}" class="nav" style="background:{{bg}}" url="/account/pages/account/account?action=login">
|
||||
点击登录,获取更多内容
|
||||
</navigator>
|
||||
<navigator wx:if="{{user_id==2}}" class="nav" style="background:{{bg}}" url="/account/pages/account/account?action=login">{{message}}</navigator>
|
@ -1,4 +1,4 @@
|
||||
<view class="my-class">
|
||||
<view class="my-class class">
|
||||
<rich-text wx:if="{{type=='rich-text'}}" space="nbsp" nodes="{{nodes}}"/>
|
||||
<towxml wx:elif="{{type=='markdown'||type=='html'}}" nodes="{{_nodes}}"/>
|
||||
<text wx:elif="{{type=='plain'}}">{{nodes}}</text>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<scroll-view class="activities" scroll-y="1" lower-threshold="120" bindscrolltolower="onReachBottom">
|
||||
<view wx:for="{{activityGroups}}">
|
||||
<activity-group date="{{index}}" activities="{{item}}"/>
|
||||
<activity-group date="{{index}}" activities="{{item}}" course_identity="{{course_identity}}" course_id="{{course_id}}"/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<view class="activity-group">
|
||||
<view class="date">{{_date}}</view>
|
||||
<view class="activity-wrap" wx:for="{{activities}}" wx:key="">
|
||||
<activity-item data="{{item}}"/>
|
||||
<view class="activity-wrap" wx:for="{{activities}}">
|
||||
<activity-item data="{{item}}" course_identity="{{course_identity}}" course_id="{{course_id}}"/>
|
||||
</view>
|
||||
</view>
|
@ -1,10 +1,13 @@
|
||||
<view class="attendance" bindtap="onTap">
|
||||
<view class="header">
|
||||
<text class="title">{{data.name}}</text>
|
||||
<text class="attendance-button" catchtap="onTapButton">签到</text>
|
||||
<button wx:if="{{course_identity==5}}" type="main" size="mini" plain="{{data.attendance_status=='NORMAL'}}" class="attendance-button" disabled="{{data.attendance_status=='NORMAL'}}" catchtap="onButtonTap">{{data.attendance_status=='NORMAL'?'已签到':'签到'}}</button>
|
||||
</view>
|
||||
<view wx:if="{{course_identity<5}}">
|
||||
<progress percent="{{data.normal_count/data.all_count*100}}" activeColor="#00b0f0" border-radius="6" backgroundColor="lightgrey"><text class="percent-text">已签到:{{data.normal_count}}/{{data.all_count}}</text></progress>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<text>签到时间:{{data.start_time}}-{{data.end_time}}</text>
|
||||
<text>{{data.mode=='QUICK'?'快捷签到':data.mode=='QRCODE'?'扫码签到':'数字签到'}}</text>
|
||||
<text>{{data.mode=='QUICK'?'快捷签到':data.mode=='QRCODE'?'扫码签到':data.mode=='NUMBER'?'数字签到':''}}</text>
|
||||
</view>
|
||||
</view>
|
@ -1,19 +1,44 @@
|
||||
<view class="module">
|
||||
<view class="info-display">
|
||||
<view class="info-display" wx:if="{{course_identity<5}}">
|
||||
<view class="info nomal">
|
||||
正常签到:{{normal_count}}
|
||||
<text class="key">平均到课率</text>
|
||||
<text class="value">{{avg_normal_percent}}%</text>
|
||||
</view>
|
||||
<view class="info leave">
|
||||
请假:{{leave_count}}
|
||||
<text class="key">平均请假率</text>
|
||||
<text class="value">{{avg_leave_percent}}%</text>
|
||||
</view>
|
||||
<view class="info absence">
|
||||
旷课:{{absence_count}}
|
||||
<text class="key">平均旷课率</text>
|
||||
<text class="value">{{avg_absence_percent}}%</text>
|
||||
</view>
|
||||
</view>
|
||||
<nav-bar type="line" list="{{list}}"/>
|
||||
<scroll-view scroll-y="1">
|
||||
<view class="info-display" wx:else>
|
||||
<view class="info nomal">
|
||||
<text class="key">正常签到</text>
|
||||
<text class="value">{{normal_count}}</text>
|
||||
</view>
|
||||
<view class="info leave">
|
||||
<text class="key">请假</text>
|
||||
<text class="value">{{leave_count}}</text>
|
||||
</view>
|
||||
<view class="info absence">
|
||||
<text class="key">旷课</text>
|
||||
<text class="value">{{absence_count}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cate-header">
|
||||
<text>正在签到:</text>
|
||||
</view>
|
||||
<scroll-view class="scroll-body" scroll-y="1" bindrefresh="refresh">
|
||||
<view class="attendance-wrap" wx:for="{{current_attendance}}">
|
||||
<attendance-item data="{{item}}"/>
|
||||
<attendance-item data="{{item}}" course_identity="{{course_identity}}" course_id="{{course_id}}"/>
|
||||
</view>
|
||||
<view class="empty" wx:if="{{current_attendance.length==0}}">
|
||||
暂无签到
|
||||
</view>
|
||||
</scroll-view>
|
||||
<navigator url="/course/pages/">
|
||||
|
||||
</navigator>
|
||||
</view>
|
@ -0,0 +1,114 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
properties: {
|
||||
course_id:Number,
|
||||
course_identity:Number,
|
||||
attendance_id:Number,
|
||||
mode:String,
|
||||
code:String
|
||||
},
|
||||
data:{
|
||||
|
||||
},
|
||||
methods:{
|
||||
onLoad(){
|
||||
this.refresh();
|
||||
},
|
||||
attendance(e){
|
||||
|
||||
|
||||
},
|
||||
navBack(){
|
||||
if(getCurrentPages().length<=1)
|
||||
app.reLaunch({url:"{main}"})
|
||||
else
|
||||
wx.navigateBack({
|
||||
delta:1
|
||||
});
|
||||
},
|
||||
onSubmit(e){
|
||||
let { detail: { value } } = e;
|
||||
let { scaned_code, mode } = this.data;
|
||||
console.log(e, value);
|
||||
if(!value.code&&mode!="QUICK") return;
|
||||
value.attendance_mode = mode;
|
||||
if(mode=='QRCODE'){
|
||||
if(value.code!=scaned_code){
|
||||
value.attendance_mode="NUMBER";
|
||||
return wx.showToast({
|
||||
title: '只支持扫二维码签到',icon:"none"
|
||||
});
|
||||
}
|
||||
}
|
||||
if(mode=="QUICK")
|
||||
delete value.code;
|
||||
if(this.data.code&&this.data.code!='undefined'&&value.code!=this.data.code&&mode!="QUICK")
|
||||
return wx.showToast({
|
||||
title: '签到码不正确', icon: "none"
|
||||
});
|
||||
app.api("weapps.course_member_attendances")(value)
|
||||
.then(res => {
|
||||
res.message = "签到成功";
|
||||
app.showMsg(res);
|
||||
setTimeout(()=>{wx.navigateBack({
|
||||
delta:1
|
||||
})},800);
|
||||
}).catch(e => {
|
||||
app.showError(e);
|
||||
});
|
||||
},
|
||||
scanCode(){
|
||||
wx.scanCode({
|
||||
success:res=>{
|
||||
if (res.scanType == "QR_CODE")
|
||||
this.setData({ scaned_code: res.result});
|
||||
}
|
||||
})
|
||||
},
|
||||
refresh(){
|
||||
let {course_identity} = this.data;
|
||||
if(course_identity){
|
||||
let {attendance_id} = this.data;
|
||||
app.api("weapps.attendances")({attendance_id})
|
||||
.then(res=>{
|
||||
this.setData(res);
|
||||
})
|
||||
}else{
|
||||
this.refreshIdentity();
|
||||
}
|
||||
},
|
||||
refreshIdentity(){
|
||||
let {course_id} = this.data;
|
||||
app.api("courses.top_banner")({course_id})
|
||||
.then(res=>{
|
||||
console.log(res);
|
||||
this.setData({});
|
||||
|
||||
})
|
||||
},
|
||||
checkInfo(){
|
||||
let { course_identity,attendance_id,mode,code} = this.data;
|
||||
if(course_identity<5){
|
||||
return false;
|
||||
}else if(course_identity==5){
|
||||
if(!mode)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}else{
|
||||
|
||||
}
|
||||
},
|
||||
analyseWxaCode(){
|
||||
|
||||
},
|
||||
onShareAppMessage(){
|
||||
let {attendance_id, mode, code, course_id} = this.data;
|
||||
return app.shareApp({
|
||||
imageUrl: global.config.attachDir + "753481",
|
||||
path:"/" + this.route+`?course_identity=5&attendance_id=${attendance_id}&code=${code||''}&mode=${mode}&course_id=${course_id}`,
|
||||
title:"课堂签到-"+this.data.name
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"iconfont":"/components/iconfont/iconfont"
|
||||
},
|
||||
"navigationBarTitleText": "课堂签到"
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<page-meta>
|
||||
<navigation-bar title="{{name?'签到-'+name:'签到'}}"/>
|
||||
</page-meta>
|
||||
<block wx:if="{{course_identity&&course_identity<5}}">
|
||||
|
||||
|
||||
</block>
|
||||
<block wx:elif="{{course_identity==5}}">
|
||||
<view class="stu-attendance">
|
||||
<form bindsubmit="onSubmit">
|
||||
<view class="stu-title"></view>
|
||||
<view class="stu-tip"></view>
|
||||
<view class="stu-detail"></view>
|
||||
<view class="input-wrap">
|
||||
<input name="code" value="{{scaned_code}}"/>
|
||||
<iconfont type="saoma" color="dimgrey" bindtap="scanCode"/>
|
||||
</view>
|
||||
<input hidden="1" name="attendance_id" value="{{attendance_id}}"></input>
|
||||
<view class="tip">{{mode=='QRCODE'?'请扫二维码签到':mode=='NUMBER'?'请输入签到码签到':mode=='QUICK'?'点击签到按钮,快速签到':''}}</view>
|
||||
<view>
|
||||
<button form-type="submit" type="main">签到</button>
|
||||
<button class="nav-back" type="main" plain="1" bindtap="navBack">返回</button>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</block>
|
@ -0,0 +1,19 @@
|
||||
.input-wrap{
|
||||
display: flex;
|
||||
padding: 4px 12px;
|
||||
border-radius: 4px;
|
||||
border: 1px #00b0f0 solid;
|
||||
margin: 12px 36px;
|
||||
}
|
||||
.input-wrap>input{
|
||||
flex: auto;
|
||||
}
|
||||
.tip{
|
||||
text-align: center;
|
||||
margin: 4px;
|
||||
color: dimgray;
|
||||
font-size: 15px;
|
||||
}
|
||||
.nav-back{
|
||||
margin-top: 4px;
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
// miniprogram/course/pages/attendances/attendances.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
<!--miniprogram/course/pages/attendances/attendances.wxml-->
|
||||
<text>miniprogram/course/pages/attendances/attendances.wxml</text>
|
@ -0,0 +1 @@
|
||||
/* miniprogram/course/pages/attendances/attendances.wxss */
|
@ -0,0 +1,66 @@
|
||||
// miniprogram/dev/pages/dev/dev.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<!--miniprogram/dev/pages/dev/dev.wxml-->
|
||||
<text>miniprogram/dev/pages/dev/dev.wxml</text>
|
||||
<text class="iconfont icon_back"></text>
|
@ -0,0 +1,52 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont';
|
||||
/* project id 706535 */
|
||||
src: url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.eot');
|
||||
src: url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.woff') format('woff'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.ttf') format('truetype'), url('//at.alicdn.com/t/font_706535_gcxl9md3eyj.svg#iconfont') format('svg');
|
||||
}
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon_back::before {
|
||||
content: "\e62c";
|
||||
}
|
||||
|
||||
.icon_close::before {
|
||||
content: "\e628";
|
||||
}
|
||||
|
||||
.icon_refresh::before {
|
||||
content: "\e732";
|
||||
}
|
||||
|
||||
.icon_jiantou_bottom::before {
|
||||
content: "\e605"
|
||||
}
|
||||
|
||||
.icon_jiantou_top::before {
|
||||
content: "\e733"
|
||||
}
|
||||
|
||||
.icon_bill::before {
|
||||
content: "\e627";
|
||||
}
|
||||
|
||||
.icon_edit::before {
|
||||
content: "\e63b";
|
||||
}
|
||||
|
||||
.icon_edit_pen::before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.icon_right_jiantou::before {
|
||||
content: "\e7a5"
|
||||
}
|
||||
.icon_back::before {
|
||||
content: "\e7a5"
|
||||
}
|
After Width: | Height: | Size: 236 B |
@ -1,7 +1,17 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
"rules": [
|
||||
{
|
||||
"action": "allow",
|
||||
"page": "shixun/pages/shixun/shixun",
|
||||
"params": [
|
||||
"identifier"
|
||||
],
|
||||
"matching": "inclusive"
|
||||
},
|
||||
{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in new issue