Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
e844184d
Commit
e844184d
authored
Mar 30, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'选择班级逻辑修改'
parent
09953ae4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
40 deletions
+78
-40
chooseclass.js
business/pages/themeeditor/chooseclass.js
+49
-29
chooseclass.json
business/pages/themeeditor/chooseclass.json
+1
-1
chooseclass.wxml
business/pages/themeeditor/chooseclass.wxml
+13
-9
chooseclass.wxss
business/pages/themeeditor/chooseclass.wxss
+15
-1
No files found.
business/pages/themeeditor/chooseclass.js
View file @
e844184d
...
...
@@ -16,8 +16,11 @@ import {
deepCopy
}
from
'../../../utilities/index.js'
;
import
{
erpClassListGet
,
}
from
'../../../service/business/common.js'
;
getMemberMe
,
}
from
'../../../service/common.js'
;
import
{
courseList
}
from
'../../../service/business/coursemgt.js'
;
var
app
=
getApp
();
Page
({
data
:
{
...
...
@@ -28,7 +31,10 @@ Page({
classes
:
[],
chooseClasses
:
[],
classList
:
[],
courseList
:
[],
page
:
1
,
type
:
1
,
teacherId
:
0
},
onLoad
:
function
(
options
)
{
// Do some initialize when page load.
const
that
=
this
;
...
...
@@ -40,7 +46,7 @@ Page({
sid
,
classes
:
!
class_ids
?
[]
:
JSON
.
parse
(
decodeURIComponent
(
class_ids
)),
});
this
.
get
ClassList
();
this
.
get
MyRoleInfo
()
},
onReady
:
function
()
{
// Do something when page ready.
...
...
@@ -54,39 +60,53 @@ Page({
},
// 切换选择班级 start
getMyRoleInfo
()
{
getMemberMe
({
school_id
:
this
.
data
.
sid
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
this
.
setData
({
teacherId
:
data
.
schoolTeacher
.
id
,
})
this
.
getClassList
();
}
})
},
tabChange
(
e
)
{
const
{
type
}
=
e
.
currentTarget
.
dataset
;
if
(
type
==
this
.
data
.
type
)
{
return
;
}
this
.
setData
({
type
,
classes
:
[],
chooseClasses
:
[],
})
this
.
getClassList
();
},
getClassList
()
{
let
dakarole
=
LocalStorage
.
getItem
(
'dakarole'
);
erpClassListGet
({
page
:
this
.
data
.
page
,
// perPage: this.data.circlePerpage,
perPage
:
200
,
//重新选择问题,所以这里暂不分页了
let
extra
=
''
;
if
(
this
.
data
.
type
==
1
)
{
extra
=
'class'
;
}
else
if
(
this
.
data
.
type
==
2
)
{
extra
=
'class, my_class'
;
}
courseList
({
school_id
:
this
.
data
.
sid
,
// my: dakarole==2 ? 1: this.data.my
page
:
1
,
perPage
:
100
,
extra
,
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
!=
200
)
{
// 失败的处理
}
else
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
this
.
setData
({
classList
:
data
.
list
,
});
const
{
chooseClasses
}
=
this
.
data
;
this
.
data
.
classes
.
forEach
((
ele
)
=>
{
const
item
=
data
.
list
.
find
(
e
=>
e
.
id
==
ele
);
if
(
item
)
{
chooseClasses
.
push
({
title
:
item
.
title
,
id
:
item
.
id
})
}
})
this
.
setData
({
chooseClasses
courseList
:
data
.
list
})
}
else
{
}
}).
catch
((
e
)
=>
{
})
},
chooseClass
(
e
)
{
...
...
business/pages/themeeditor/chooseclass.json
View file @
e844184d
{
"navigationBarTitleText"
:
"
新建作业打卡
"
,
"navigationBarTitleText"
:
"
选择班级
"
,
"usingComponents"
:
{
"sjd-media-editor"
:
"../../../components/newsjdmediaeditor"
,
"sound-recording"
:
"../../../components/soundrecording"
,
...
...
business/pages/themeeditor/chooseclass.wxml
View file @
e844184d
...
...
@@ -2,18 +2,22 @@
<view class="container">
<view class="themetypebox">
<view class="themetab">
<view class="themetypeitem
activ
e">全部班级</view>
<view class="themetypeitem ">只看我的</view>
<view class="themetypeitem
{{type==1 ? 'active' : ''}}" data-type="1" bindtap="tabChang
e">全部班级</view>
<view class="themetypeitem
{{type==2 ? 'active' : ''}}" data-type="2" bindtap="tabChange
">只看我的</view>
</view>
</view>
<view class="listbox">
<view class="listitem" hover-class="none" hover-stop-propagation="false" wx:for="{{classList}}" wx:key="id" data-item="{{item}}" bindtap="chooseClass">
<view class="classtitle">{{item.title}}</view>
<view class="rightbox">
<view class="teachername">
<text wx:for="{{item.school_teachers}}" wx:key="id" wx:for-item="teacher">{{teacher.nickname}}</text>
<view class="courseitem" wx:for="{{courseList}}" wx:for-item="course" wx:key="id">
<view class="coursetitle">{{course.title}}</view>
<view class="listbox">
<view class="listitem" hover-class="none" hover-stop-propagation="false" wx:for="{{course.classes}}" wx:key="id" data-item="{{item}}" bindtap="chooseClass">
<view class="classtitle">{{item.title}}</view>
<view class="rightbox">
<view class="teachername">
<text wx:for="{{item.school_teachers}}" wx:key="id" wx:for-item="teacher" wx:if="{{teacherId == teacher.id}}" wx:for-index="tindex" class="{{teacherId == teacher.id ? 'my' : ''}}">{{teacher.nickname}}{{item.school_teachers.length > 1 ? '、': ''}}</text>
<text wx:for="{{item.school_teachers}}" wx:key="id" wx:for-item="teacher" wx:if="{{teacherId != teacher.id}}" wx:for-index="tindex" class="{{teacherId == teacher.id ? 'my' : ''}}">{{teacher.nickname}}{{item.school_teachers.length > 1 ? '、': ''}}</text>
</view>
<image class="selectedicon" src="{{imageRoot}}2b/common/{{filter.indexOf(classes, item.id) == -1 ? 'notselect' : 'select'}}.png"></image>
</view>
<image class="selectedicon" src="{{imageRoot}}2b/common/{{filter.indexOf(classes, item.id) == -1 ? 'notselect' : 'select'}}.png"></image>
</view>
</view>
</view>
...
...
business/pages/themeeditor/chooseclass.wxss
View file @
e844184d
.container {
padding-bottom: 150rpx;
}
.coursetitle {
color: #222222;
font-size: 26rpx;
font-weight: 600;
padding: 0 20rpx;
margin-top: 40rpx;
}
.themetypebox {
/* margin-bottom: 20px; */
background-color: #fff;
...
...
@@ -53,7 +63,7 @@
}
.listitem {
padding: 28rpx 0;
border-
top
: 1px solid #F1F2F3;
border-
bottom
: 1px solid #F1F2F3;
}
.teachername {
max-width: 230rpx;
...
...
@@ -61,6 +71,10 @@
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 10rpx;
color: #999999;
}
.teachername .my {
color: #FEA917;
}
.savebtn {
width:630rpx;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment