Commit 01b827bf authored by wangxuelai's avatar wangxuelai

'ss'

parent f39bfc69
......@@ -361,7 +361,8 @@
"index",
"setting",
"chooseclass",
"subjecteditor"
"subjecteditor",
"lockthemelist"
]
},
{
......
/*
time: 2018-10-31
author: wxl
*/
import {
themeEditor
} from '../../../service/business/themeeditor.js';
import {
themeDetail
} from '../../../service/business/themeindex.js';
import {
audioorigin,
formatDate,
getDateInfo,
LocalStorage,
deepCopy
} from '../../../utilities/index.js';
import {
erpClassListGet,
} from '../../../service/business/common.js';
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
classes: [],
chooseClasses: [],
classList: [],
page: 1,
},
onLoad: function(options) { // Do some initialize when page load.
const that = this;
const {
sid,
class_ids,
} = options;
this.setData({
sid,
classes: !class_ids ? [] : JSON.parse(decodeURIComponent(class_ids)),
});
this.getClassList();
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
},
onHide: function() { // Do something when page hide.
},
onUnload: function() { // Do something when page close.
},
// 切换选择班级 start
getClassList() {
let dakarole = LocalStorage.getItem('dakarole');
erpClassListGet({
page: this.data.page,
// perPage: this.data.circlePerpage,
perPage: 200,//重新选择问题,所以这里暂不分页了
school_id: this.data.sid,
// my: dakarole==2 ? 1: this.data.my
}).then((res) => {
const {
code,
data
} = res;
if (code != 200) { // 失败的处理
} else {
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
})
}
}).catch((e) => {
})
},
chooseClass (e) {
const { item } = e.currentTarget.dataset;
const { classes, chooseClasses } = this.data;
const classesIndex = classes.indexOf(item.id);
const chooseClassesIndex = chooseClasses.findIndex(ele => ele.id == item.id);
if (classesIndex == -1) {
classes.push(item.id);
} else {
classes.splice(classesIndex, 1);
}
if (chooseClassesIndex == -1) {
chooseClasses.push({
title: item.title,
id: item.id,
});
} else {
chooseClasses.splice(classesIndex, 1);
}
this.setData({
classes,
chooseClasses,
});
},
saveClass () {
const curPages = getCurrentPages();
let currPage = null; //当前页面
let prevPage = null; //上一个页面
if (curPages.length >= 2) {
currPage = curPages[curPages.length - 1]; //当前页面
prevPage = curPages[curPages.length - 2]; //上一个页面
}
prevPage.setData({
classes: this.data.chooseClasses
});
wx.navigateBack({
delta: 1
})
}
})
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="themetypebox">
<view class="themetab">
<view class="themetypeitem active">全部班级</view>
<view class="themetypeitem ">只看我的</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>
<image class="selectedicon" src="{{imageRoot}}2b/common/{{filter.indexOf(classes, item.id) == -1 ? 'notselect' : 'select'}}.png"></image>
</view>
</view>
</view>
<view class="savebtn" hover-class="none" hover-stop-propagation="false" bindtap="saveClass">保存</view>
</view>
.themetypebox {
/* margin-bottom: 20px; */
background-color: #fff;
padding: 20rpx 0;
}
.themetab {
display: flex;
align-items: center;
justify-content: center;
/* margin-bottom: 34rpx; */
/* border: 1px solid #16B0FD; */
}
.themetab .themetypeitem {
width: 210rpx;
height: 60rpx;
/* border-bottom: 1px solid #16B0FD;
border-top: 1px solid #16B0FD; */
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
color: #16B0FD;
text-align: center;
border: 1px solid #16B0FD;
}
.themetab .themetypeitem.active {
background-color: #16B0FD;
color: #FFFFFF;
}
.selectedicon {
width: 38rpx;
height: 38rpx;
display: block;
}
.listitem {
display: flex;
align-items: center;
justify-content: space-between;
}
.classtitle {
max-width: 370rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rightbox {
display: flex;
align-items: center;
justify-content: center;
}
.listbox {
padding: 0 20rpx;
}
.listitem {
padding: 28rpx 0;
border-top: 1px solid #F1F2F3;
}
.teachername {
max-width: 230rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 10rpx;
}
.savebtn {
width:630rpx;
height:90rpx;
background:rgba(22,176,253,1);
border-radius:49rpx;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
letter-spacing: 2rpx;
position: fixed;
bottom: 20rpx;
left: 60rpx;
}
\ No newline at end of file
/*
time: 2018-10-31
author: wxl
*/
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
sid: 0,
classes: [],
chooseClasses: [],
classList: [],
page: 1,
},
onLoad: function(options) { // Do some initialize when page load.
},
onReady: function() { // Do something when page ready.
},
onShow: function() { // Do something when page show.
},
onHide: function() { // Do something when page hide.
},
onUnload: function() { // Do something when page close.
},
})
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="titlebox">
<view class="miantitle">的撒旦法萨芬的的撒旦法萨芬的的撒旦法萨芬的的撒旦法萨芬的的撒旦法萨芬的</view>
<view class="teacherdesc">李老师 2020年3月2日 15:36发布</view>
</view>
<view>
<view class="themesorttitle">第1关</view>
<view class="themeitembox">
<view class="themeitetitle">大道发生的嗒嗒嗒</view>
<view class="staticbox">
<view class="staticitem">已打卡人数: 100人</view>
<view class="staticitem">待点评: <text class="em">20</text></view>
</view>
</view>
</view>
<view>
<view class="themesorttitle">第1关</view>
<view class="themeitembox">
<view class="themeitetitle">大道发生的嗒嗒嗒</view>
<view class="staticbox">
<view class="staticitem">已打卡人数: 100人</view>
<view class="staticitem">待点评: <text class="em">20</text></view>
</view>
</view>
</view>
<view>
<view class="themesorttitle">第1关</view>
<view class="themeitembox">
<view class="themeitetitle">大道发生的嗒嗒嗒</view>
<view class="staticbox">
<view class="staticitem">已打卡人数: 100人</view>
<view class="staticitem">待点评: <text class="em">20</text></view>
</view>
</view>
</view>
<view>
<view class="themesorttitle">第1关</view>
<view class="themeitembox empty">
待完善
</view>
</view>
</view>
.container {
min-height: 100vh;
background-color: #F5F5F7;
}
.titlebox {
background-color: #fff;
padding: 18rpx 24rpx;
}
.miantitle {
color: #222222;
font-size: 30rpx;
word-break: break-all;
margin-bottom: 8px;
}
.teacherdesc {
color: #999999;
font-size: 22rpx;
}
.themesorttitle {
padding: 26rpx 24rpx 10rpx;
line-height: 1;
color: #999999;
font-size: 26rpx;
}
.themeitembox {
background-color: #fff;
padding: 26rpx 32rpx 26rpx 24rpx;
position: relative;
}
.themeitembox.empty {
display: flex;
align-items: center;
justify-content: center;
color: #16B0FD;
font-size: 30rpx;
height: 132rpx;
}
.themeitetitle {
font-size: 26rpx;
color: #222222;
word-break: break-all;
margin-bottom: 12rpx;
}
.staticbox {
color: #999999;
font-size: 22rpx;
display: flex;
}
.staticbox .staticitem {
color: #999999;
font-size: 22rpx;
padding-right: 30rpx;
}
.staticbox .staticitem.em {
color: #16B0FD;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment