Commit a373d9bb authored by ltz's avatar ltz

闯关优化部分

parent 2452452d
......@@ -620,7 +620,8 @@
"root": "business/pages/morethemeindex",
"name": "businessmorethemeindex",
"pages": [
"index"
"index",
"studentact"
]
},
{
......
......@@ -1061,7 +1061,7 @@ Page({
})
}
},
// 参与概况
// 参与概况 成员管理
goclockm() {
wx.navigateTo({
url: `/business/pages/unlockclocksituation/index?id=${this.data.id}&tid=${this.data.tid}&sid=${this.data.sid}`
......@@ -1400,5 +1400,6 @@ Page({
this.setData({
'remindTips.show': false
})
}
},
true(){}
})
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<btn-drag bind:btnDragEvent='goindex' tobottomDis='88' width='60' height="60" catchtouchmove="ture">
<view class="gohome gohome-b" bindtap="goindex" slot="dragcontent">
<form report-submit="true" bindsubmit="formIdCreate" class="createidform">
<button form-type="submit" class="createidbutton">生成form</button>
</form>
<view class="gohome gohome-b" slot="dragcontent">
<view class="home-text">首页</view>
</view>
</btn-drag>
......@@ -42,6 +39,13 @@
</view>
<view class="text">参与概况</view>
</view> -->
<view class="btn-box joinstatic"
bindtap="goclockm">
<view class="icon">
<image class="btn" src="{{imageRoot}}2b/themeindex/student-icon.png"></image>
</view>
<view class="text">成员管理</view>
</view>
</view>
</view>
......
import {
studentDetailGet,
studentremovePost,
studentsListGet,
erpstudentAdd,
studentRenewal
} from '../../../service/business/studentmgt'
import {
clockList,
newLikeIndex,
newCommentIndex
} from '../../../service/customer/circleindex.js';
import {
LocalStorage,
audioorigin,
} from '../../../utilities/index.js';
import {
modeStudentDetail
} from '../../../service/business/morethemeindex'
function compare(property) {
return function (a, b) {
var value1 = new Date(a[property]);
var value2 = new Date(b[property]);
return value2 - value1;
}
}
var app = getApp();
Page({
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/',
studentInfo: '', // 学员详情
clockhasmore: true,
clockListLoading: false,
clockList: [],
clockTotal: 0,
page: 1,
perPage: 10,
emptyClockPage: false,
commenteditor: false, // 评论input框
commentclock: '', //回复的clock
listindex: '',
index: '',
goCommentEditorInfo: {
show: false,
info: {
id: 0,
tid: 0,
cid: 0,
}
},
audioStorage: {},
videostatus: {
preSrc: '',
currentSrc: '',
videoShow: false,
videoId: '',
src: ''
},
},
onLoad: function (options) {
this.innerAudioContext = wx.createInnerAudioContext(); // 当前页面唯一的一个音频容器
const {
sid,
studentId,
modeid
} = options;
this.setData({
sid: sid || 0,
studentId: studentId || 0,
modeid: modeid || 0
})
this.studentInfoGet()
},
onReady: function () {
},
onShow: function () {
if (this.data.needRefresh) {
}
},
onHide: function () {
this.innerAudioContext.pause();
this.resetAudiosPlayStatus()
clearInterval(this.data.voiceInterval);
this.data.needRefresh = false;
},
onUnload: function () {
this.innerAudioContext.pause();
this.setData({
audioStorage: {}
})
clearInterval(this.data.voiceInterval);
},
onPullDownRefresh: function () {
},
onReachBottom: function () {
this.clockListGet('up');
},
studentInfoGet() {
modeStudentDetail({
student_id: this.data.studentId,
mode_id: this.data.modeid,
school_id: this.data.sid
}).then((res) => {
const {
data,
code
} = res;
if (code == 200) {
this.setData({
studentInfo: data
})
this.clockListGet('init')
}
}).catch(() => {
})
},
newLikeIndex(clockRecordIds, callback) {
let LikesAndCommentObj = {}
if (clockRecordIds != '') {
newLikeIndex({
clock_record_id: clockRecordIds,
}).then((res) => {
callback && callback(res);
})
}
},
newCommentIndex(clockRecordIds, callback) {
if (clockRecordIds != '') {
newCommentIndex({
clock_record_id: clockRecordIds,
page: 1,
perPage: 3,
sort: 'desc',
type: 1
}).then((res) => {
callback && callback(res);
})
}
},
clockListGet(type) {
const that = this;
// const consumer_id = this.data.studentInfo.consumer_id;
const consumer_id = this.data.studentId;
if (!consumer_id) {
this.setData({
emptyClockPage: true
})
return;
}
if (!this.data.clockhasmore) {
return;
}
if (this.data.clockListLoading) {
return;
}
this.setData({
clockListLoading: true
})
clockList({
student_id: consumer_id,
page: this.data.page,
perPage: this.data.perPage,
school_id: this.data.sid,
subject_id: this.data.modeid,
mode_id: this.data.modeid
}).then((res) => {
const {
code,
data
} = res;
wx.hideLoading();
this.setData({
clockListLoading: false
})
if (code != 200) { // 失败的处理
} else {
if (data.total) {
this.setData({
clockTotal: data.total || 0,
})
}
let clockRecordIds = data.list.map((ele) => {
return ele.id
}).join(',');
data.list.map((ele) => {
ele.audio_parse = JSON.parse(ele.audio);
ele.video_parse = JSON.parse(ele.video);
ele.imageCount = ele.video_parse.filter(ele => ele.type == 'image').length;
ele.videoCount = ele.video_parse.length - ele.imageCount;
ele.commentsExpand = false;
ele.likesExpand = false;
ele.commentsLoading = false;
ele.content_100 = ele.content.length > 100 ? ele.content.substr(0, 100) + '...' : ele.content;
ele.contentexpand = false;
return ele;
})
switch (type) {
case 'init': //页面进来第一次加载
that.setData({
clockList: [data.list]
})
if (that.data.clockTotal > that.caculateArrLength(that.data.clockList)) {
that.data.page = that.data.page + 1;
} else { // 没有更多了
that.setData({
clockhasmore: false
})
}
break;
case 'down': // 页面下拉刷新
that.setData({
clockList: [data.list]
})
if (that.data.clockTotal > that.caculateArrLength(that.data.clockList)) {
that.data.page = that.data.page + 1;
} else { // 没有更多了
that.setData({
clockhasmore: false
})
}
wx.stopPullDownRefresh();
break;
case 'up': // 页面上拉加载
that.setData({
[`clockList[${this.data.page - 1}]`]: data.list
})
if (that.data.clockTotal > that.caculateArrLength(that.data.clockList)) {
that.data.page = that.data.page + 1;
} else { // 没有更多了
that.setData({
clockhasmore: false
})
}
break;
default:
break;
}
if (that.caculateArrLength(that.data.clockList) == 0) {
that.setData({
emptyClockPage: true
})
} else {
that.setData({
emptyClockPage: false
})
}
this.newLikeIndex(clockRecordIds, function (likeRes) {
const curIndex = that.data.clockhasmore ? that.data.page - 2 : that.data.page - 1;
const curPageClockList = that.data.clockList[curIndex] || []
if (curPageClockList.length > 0) {
curPageClockList.forEach((ele) => {
if (likeRes.data.list && likeRes.data.list[ele.id]) {
ele.likes = likeRes.data.list[ele.id];
}
})
}
that.setData({
[`clockList[${curIndex}]`]: curPageClockList
})
})
this.newCommentIndex(clockRecordIds, function (commentRes) {
const curIndex = that.data.clockhasmore ? that.data.page - 2 : that.data.page - 1;
const curPageClockList = that.data.clockList[curIndex] || [];
if (curPageClockList.length > 0) {
curPageClockList.forEach((ele) => {
if (commentRes.data.list[ele.id]) {
ele.comments = commentRes.data.list[ele.id];
} else {
ele.comments = {
list: [],
total: 0
}
}
})
}
that.setData({
[`clockList[${curIndex}]`]: curPageClockList
})
})
}
}).catch((e) => {
this.setData({
clockListLoading: false
})
})
},
circleClick(e) {
const {
circle
} = e.currentTarget.dataset;
this.setData({
actStudentClass: circle || '',
circleSelecting: false,
page: 1,
clockhasmore: true,
clockListLoading: false
}, () => {
this.clockListGet('init');
})
},
// 打卡组件相关的
clocksplacetop(e) {
const {
cid,
clock,
datetime
} = e.detail;
const { listindex, index } = e.currentTarget.dataset;
const _clockList = this.data.clockList;
_clockList[listindex][index].place_top_at = clock.place_top_at ? '' : datetime;
_clockList[0].push(_clockList[listindex][index]);
_clockList[listindex].splice(index, 1);
_clockList[0].sort(compare('place_top_at'));
this.setData({
clockList: _clockList
})
},
expandContent(e) {
const {
clock
} = e.detail;
const { listindex, index } = e.currentTarget.dataset;
const _clockList = this.data.clockList;
_clockList[listindex][index].contentexpand = !clock.contentexpand;
this.setData({
[`clockList[${listindex}][${index}]`]: _clockList[listindex][index]
})
},
delClock(e) {
const {
cid,
clock
} = e.detail;
const { listindex, index } = e.currentTarget.dataset;
const _clockList = this.data.clockList;
_clockList[listindex].splice(index, 1);
this.setData({
[`clockList[${listindex}]`]: _clockList[listindex]
})
},
expandAccessment(e) {
const {
cid,
comments,
commentsExpand
} = e.detail;
const { listindex, index } = e.currentTarget.dataset;
const _clockList = this.data.clockList;
_clockList[listindex][index].comments = comments;
_clockList[listindex][index].commentsExpand = commentsExpand;
this.setData({
[`clockList[${listindex}][${index}]`]: _clockList[listindex][index]
})
},
delComments(e) {
const {
cid,
eid,
role,
clock,
type,
roottype
} = e.detail;
const { listindex, index } = e.currentTarget.dataset;
const _clockList = this.data.clockList;
if (role == 'teacher') { // 删除老师点评
if (type == 'open') {
_clockList[listindex][index].review[1] = null;
} else if (type == 'private') {
_clockList[listindex][index].review[2] = null;
}
} else if (role == 'student') {
if (roottype) {
_clockList[listindex][index].review[Number(roottype)].comments = _clockList[listindex][index].review[Number(roottype)].comments.filter(ele => ele.id != eid)
}
_clockList[listindex][index].comments.list = _clockList[listindex][index].comments.list.filter(ele => ele.id != eid);
_clockList[listindex][index].comments.total--;
}
this.setData({
[`clockList[${listindex}][${index}]`]: _clockList[listindex][index]
})
},
// 跟录音相关的操作
// 跟录音相关的操作
// 播放录音的相关操作
// 格式是以录音名字为key value为{play: true || false, currentTime: 0}的一个对象
voiceIntervalPlay(value) { // 初始化录音的状态
let voiceInterval = setInterval(() => {
let audioStorage = this.data.audioStorage;
let currentTime = ++audioStorage[value].currentTime;
this.setData({
audioStorage
})
if (currentTime >= this.data.audioStorage[value].duration) {
audioStorage[value].play = false;
audioStorage[value].currentTime = 0;
this.setData({
audioStorage
})
clearInterval(this.data.voiceInterval);
}
}, 1000);
this.setData({
voiceInterval
})
},
playvoice(e) {
const { value, duration } = e.detail;
this.innerAudioContext.src = audioorigin(value);
this.innerAudioContext.obeyMuteSwitch = false;
this.resetAudiosPlayStatus();
clearInterval(this.data.voiceInterval);
let audioStorage = this.data.audioStorage;
if (!audioStorage[value]) {
audioStorage[value] = {
play: true,
currentTime: 0,
duration
}
} else {
if (audioStorage[value].currentTime == audioStorage[value].duration) {
audioStorage[value].currentTime = 0;
audioStorage[value].play = true;
} else {
audioStorage[value].play = true;
}
}
this.innerAudioContext.seek(audioStorage[value].currentTime)
this.innerAudioContext.play();
this.voiceIntervalPlay(value);
this.setData({
audioStorage,
})
},
pausevoice(e) {
const { value } = e.detail;
let audioStorage = this.data.audioStorage;
audioStorage[value].play = false;
this.setData({
audioStorage,
})
this.innerAudioContext.pause();
clearInterval(this.data.voiceInterval);
},
voiceslide(e) {
const { value, slide, duration } = e.detail;
let audioStorage = this.data.audioStorage;
if (!audioStorage[value]) {
audioStorage[value] = {
play: false,
currentTime: slide,
duration
}
} else {
audioStorage[value].currentTime = slide;
}
this.innerAudioContext.seek(slide);
this.setData({
audioStorage,
})
},
slidestart(e) {
const { value, slide } = e.detail;
let audioStorage = this.data.audioStorage;
if (audioStorage[value] && audioStorage[value].play) { // 如果当前是播放状态 则先暂停音乐盒计时器 播放按钮状态不需要改
this.innerAudioContext.pause();
clearInterval(this.data.voiceInterval);
} else { // 如果当前不是播放状态 则该干嘛干嘛
}
},
slideend(e) {
const { value, slide } = e.detail;
let audioStorage = this.data.audioStorage;
if (audioStorage[value] && audioStorage[value].play) { // 如果当前是播放状态 则启用定时器 播放按钮状态不需要改
// clearInterval(this.data.voiceInterval);
this.innerAudioContext.play();
this.voiceIntervalPlay(value);
} else { // 如果当前不是播放状态 则该干嘛干嘛
}
},
resetAudiosPlayStatus() { // 点击一个录音的时候把其他的录音状态改成暂停状态
let audioStorage = this.data.audioStorage;
Object.keys(audioStorage).forEach((key) => {
audioStorage[key].play = false
});
this.setData({
audioStorage,
})
},
delvoice(e) {
const { value } = e.detail;
let audioStorage = this.data.audioStorage;
if (audioStorage[value] && audioStorage[value].play) { // 如果当前是播放状态 删除录音的操作要把录音销毁掉
delete audioStorage[value]
this.innerAudioContext.pause();
clearInterval(this.data.voiceInterval);
}
this.setData({
audioStorage,
})
},
// 跟录音相关的操作
// 视频播放相关代码
playvideo(e) {
const that = this;
const { src, from, mode } = e.detail;
this.setData({
'videostatus.videoId': src,
'videostatus.videoShow': true,
'videostatus.src': src,
'videostatus.mode': mode || 'mp4',
})
setTimeout(() => {
that.videoContext = wx.createVideoContext(src);
that.videoContext.play();
that.videoContext.requestFullScreen();
}, 500)
},
screenchange(e) {
const { fullScreen } = e.detail;
if (!fullScreen) { // 退出全屏时的操作
this.setData({
'videostatus.videoId': '',
'videostatus.videoShow': false,
'videostatus.src': '',
})
}
},
closeVideo() {
this.setData({
'videostatus.videoId': '',
'videostatus.videoShow': false,
'videostatus.src': '',
})
},
// 视频播放相关代码
showcommenteditor(e) {
const { listindex, index } = e.currentTarget.dataset;
Object.assign(this.data, {
listindex,
index
})
this.setData({
commentclock: e.detail,
commenteditor: true
})
},
hidecommenteditor(e) {
const _clockList = this.data.clockList
const { listindex, index } = this.data;
const curclockList = _clockList[listindex][index];
if (e.detail && e.detail.comment) {
const comment = e.detail.comment;
curclockList.comments.list.unshift(comment);
curclockList.comments.list = curclockList.comments.list.slice(0, 3);
curclockList.comments.total += 1;
}
this.setData({
commenteditor: false,
[`clockList[${listindex}][${index}]`]: curclockList
})
},
//操作
handeloperate(e) {
const that = this;
let mySystem = wx.getSystemInfoSync();
let needIosWarn = LocalStorage.getItem('needIosWarn');
let itemList = [];
if (mySystem.system && mySystem.system.toLowerCase().indexOf('ios') != -1 && !needIosWarn) {
itemList = ['退班'];
} else {
itemList = ['退班', '取消'];
}
wx.showActionSheet({
itemList: itemList,
success(res) {
const {
tapIndex
} = res;
if (tapIndex == 0) {
wx.showModal({
title: '提示',
content: '是否退出该班级',
confirmColor: '#65B8F4',
success(res) {
if (res.confirm) {
const {
courseitem,
item
} = e.currentTarget.dataset;
that.studentremovePost(item.id, courseitem.id)
} else if (res.cancel) {
}
}
})
}
if (tapIndex == 1) {
// that.delClock()
}
}
})
},
// 退班
studentremovePost(class_id, id) {
studentremovePost({
student_ids: this.data.studentInfo.id,
school_id: this.data.sid,
class_id: class_id
}).then(res => {
if (res.code == 200) {
wx.showToast({
title: '退班成功',
icon: 'success',
duration: 2000
})
this.data.courselist.find(ele => ele.id == id).classes = this.data.courselist.find(ele => ele.id == id).classes.filter(ele => ele.id != class_id);
this.setData({
courselist: this.data.courselist
})
}
}).catch(res => {
})
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
})
return _length;
},
// 选择点评类型的代码
goCommentEditor(e) {
const { clock } = e.detail;
console.log(Number(clock.class_id), 'clock');
this.setData({
goCommentEditorInfo: {
show: true,
info: {
id: Number(clock.class_id),
tid: Number(clock.subject_id),
cid: Number(clock.id),
sid: Number(clock.school_id),
}
}
})
},
hideChooseTypeDia() {
this.setData({
goCommentEditorInfo: {
show: false,
info: {
id: 0,
tid: 0,
cid: 0,
sid: 0,
}
}
})
},
// 选择点评类型的代码
callPhone(e) {
const { mobile } = e.currentTarget.dataset;
wx.makePhoneCall({
phoneNumber: mobile
})
},
toCourseeliminate(e) {
const { item } = e.currentTarget.dataset;
if (item.course_mode == 3) {
wx.showModal({
title: '提示',
content: '当前购课模式不支持消课哦',
showCancel: false,
confirmColor: '#65B8F4'
})
return
}
wx.navigateTo({
url: `/business/pages/studentcenter/courseeliminate?studentId=${this.data.studentId}&courseid=${item.id}`
})
},
bindBuyCourse(e) {
const { item } = e.currentTarget.dataset;
let url = item ? `sid=${this.data.sid}&studentId=${this.data.studentId}&id=${item.id || 0}` : `sid=${this.data.sid}&studentId=${this.data.studentId}`
wx.navigateTo({
url: `/business/pages/studentcenter/buycourse?${url}`
})
}
})
\ No newline at end of file
{
"navigationBarTitleText": "个人动态",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#35BAFD",
"navigationBarTextStyle": "white",
"usingComponents": {
"empty-content": "../../../components/emptycontent",
"clock-item": "../../components/clockitem",
"comment-editor": "../../../components/commenteditor",
"expiredTip": "../../components/expiredTip",
"comment-editor-type-choose": "../../components/commentEditorTypeChoose"
}
}
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="header-box">
<view class="student-info">
<view class="left">
<image class="avatar" src="{{filter.imagify(studentInfo.avatar, 'image/resize,w_160/format,jpg')}}" wx:if="{{studentInfo.avatar}}"/>
<image class="avatar" src="{{imageRoot}}common/empty/avatar_user.png?{{imageVersion}}" wx:else></image>
</view>
<view class="right">
<view class="line-box nickname-box">
<view class="nickname">{{studentInfo.name}}</view>
<view class="num">已闯{{studentInfo.unlock_subject_count}}关 共{{studentInfo.subject_count}}关</view>
</view>
<view class="line-box wxnickname">微信昵称:{{studentInfo.wechat_user.nickname}}</view>
<view class="line-box mobile">手机号:{{studentInfo.mobile}}</view>
</view>
</view>
<view class="opt-box" wx:if="{{studentInfo.is_formal_student && studentInfo.is_formal_student}}">
<view class="btn btn-exchange" bindtap="bindBuyCourse">转化为在读学员</view>
<view class="btn btn-out">踢出</view>
</view>
</view>
<view class="content-box">
<view class="clock-list" wx:if="{{!emptyClockPage}}">
<block wx:for="{{clockList}}" wx:for-index="idx" wx:for-item="listItem" wx:key="idx">
<view class="clock-item" wx:for="{{listItem}}" wx:key="index">
<clock-item
clock="{{item}}"
bind:clocksplacetop="clocksplacetop"
bind:delClock="delClock"
bind:expandAccessment="expandAccessment"
bind:fingureUp="fingureUp"
cindex="{{index}}"
tid="{{tid}}"
cid="{{id}}"
bind:expandLikes="expandLikes"
bind:expandContent="expandContent"
bind:delComments="delComments"
bind:playvoice="playvoice"
bind:pausevoice="pausevoice"
bind:voiceslide="voiceslide"
audioStorage="{{audioStorage}}"
bind:slidestart="slidestart"
bind:slideend="slideend"
bind:playvideo="playvideo"
bind:showcommenteditor="showcommenteditor"
data-listindex="{{idx}}"
data-index="{{index}}"
bind:goCommentEditor="goCommentEditor"
>
</clock-item>
</view>
</block>
<list-loading loading="{{clockListLoading}}"></list-loading>
</view>
<view class="empty-content-box" wx:if="{{emptyClockPage}}">
<empty-content text="{{params.searchName?'没有找到该学员':'暂无数据'}}"></empty-content>
</view>
</view>
<view class="videodialog" wx:if="{{videostatus.videoShow}}">
<view class="videodialogmask" bindtap="closeVideo"></view>
<video class="" src="{{filter.transformOssVideofy(videostatus.src,videostatus.mode)}}" id="{{videostatus.videoId}}" initial-time="0" autoplay="false" loop="false" direction="0" bindplay="" bindpause="" bindended="" bindtimeupdate="" bindwaiting="" binderror="" bindfullscreenchange="screenchange"></video>
</view>
<view class="" data-editor="commenteditor">
<comment-editor wx:if="{{commenteditor}}" prams="{{commentclock}}" bind:hidecommenteditor="hidecommenteditor" type="2b"></comment-editor>
</view>
</view>
<expiredTip/>
<comment-editor-type-choose
show="{{goCommentEditorInfo.show}}"
classid="{{goCommentEditorInfo.info.id}}"
tid="{{goCommentEditorInfo.info.tid}}"
cid="{{goCommentEditorInfo.info.cid}}"
sid="{{goCommentEditorInfo.info.sid}}"
bind:hideChooseTypeDia="hideChooseTypeDia"
/>
\ No newline at end of file
/* business/pages/studentdetail/index.wxss */
@import "../../../style/commonlist.wxss";
.container{}
.header-box {
background:#35BAFD;
padding: 33rpx 24rpx 50rpx;
}
.header-box .student-info{
display: flex;
align-items: center;
justify-content: space-between;
}
.header-box .student-info .left{
padding-right: 24rpx;
}
.header-box .student-info .left .avatar{
width: 130rpx;
height: 130rpx;
border: 1px solid #fff;
border-radius: 50%;
}
.header-box .student-info .right{
flex: 1;
}
.header-box .student-info .right .line-box{
display: flex;
justify-content: space-between;
color: #fff;
line-height: 1;
font-size: 24rpx;
}
.header-box .student-info .right .nickname-box .nickname{
font-size: 30rpx;
}
.header-box .student-info .right .nickname-box .num{
white-space: nowrap;
padding-left: 30rpx;
}
.header-box .student-info .right .wxnickname{
padding-top: 29rpx;
}
.header-box .student-info .right .mobile{
padding-top: 16rpx;
}
.header-box .opt-box{
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 154rpx;
padding-top: 37rpx;
}
.header-box .opt-box .btn{
height: 70rpx;
border-radius: 35rpx;
font-size: 24rpx;
color: #5F5A5A;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
.header-box .opt-box .btn-exchange{
width: 320rpx;
}
.header-box .opt-box .btn-out{
width: 105rpx;
}
.content-box{
width: 100%;
background: #fff;
border-radius: 20rpx 20rpx 0 0;
position: relative;
top: -30rpx;
z-index: 2;
overflow: hidden;
}
.clock-list{}
.clock-list .clock-item{
position: relative;
border-bottom: 15rpx solid #F7F7F9;
}
.clock-list .clock-item:last-of-type{
border-bottom: none;
}
.empty-content-box{
position: relative;
height: 600rpx;
}
.has-nomore{
font-size: 26rpx;
color: #9C9C9D;
padding: 75rpx 0;
text-align: center;
}
\ No newline at end of file
var app = getApp();
import {
themeDetail,
unlockClockMemberList,
} from '../../../service/business/themeindex.js';
import {
formIdCreate
} from '../../../service/common.js';
import {
sharePosteCanvas
} from '../../../utilities/generatePoster.js';
import {
generateCustomerQrcode,
posterLog,
schoolDetailGet
} from '../../../service/business/common.js'
import {
LocalStorage
} from '../../../utilities/index.js';
import {
screenshot
} from '../../../utilities/screenshot.js';
unlocksubjectstudents
} from '../../../service/business/morethemeindex'
Page({
data: {
imageRoot: app.globalData.imageRoot,
......@@ -29,49 +10,44 @@ Page({
id: 0,
tid: 0,//6870
sid: '',//1
searchName: '',
page: 1,
perPage: 10,
hasmore: true,
unlockMemberList: [],
memberLoading: false,
listLoading: false,
memberTotal: 0,
emptyPage: false,
emptyMemberPage: false,
shareObj: {},
initShareObj: {},
mode_id: 0
},
onLoad: function (options) {
let that = this;
const {tid,sid} = options;
that.setData({
mode_id: tid,
mode_id: tid || 0,
sid
})
wx.hideShareMenu();
this.clockMemberListGet('init');
},
onReady: function () {
let dakarole = LocalStorage.getItem('dakarole');
if (dakarole == 1) {
},
onShow: function () {
let that = this;
if(that.data.needRefresh){
this.setData({
permission: [1, 2, 3, 4, 5, 6, 7]
page: 1,
hasmore: true,
})
this.clockMemberListGet('init');
}
},
onShow: function () {
let that = this;
this.setData({
page: 1,
hasmore: true,
})
this.clockMemberListGet('init');
let dakarole = LocalStorage.getItem('dakarole');
onHide: function () {
this.data.needRefresh = false
},
onPullDownRefresh: function () {
this.setData({
mPage: 1,
page: 1,
hasmore: true,
})
this.clockMemberListGet('down');
......@@ -83,22 +59,21 @@ Page({
if (!this.data.hasmore) {
return
}
if (this.data.memberLoading) {
if (this.data.listLoading) {
return;
}
this.setData({
memberLoading: true
listLoading: true
})
unlockClockMemberList({
unlocksubjectstudents({
mode_id: this.data.mode_id,
page: this.data.page,
perPage: this.data.perPage,
school_id: this.data.sid,
keyword: this.data.searchName ? this.data.searchName : ''
}).then((res) => {
const { code,data } = res;
this.setData({
memberLoading: false
listLoading: false
})
if (code != 200) { // 失败的处理
......@@ -111,13 +86,10 @@ Page({
switch (type) {
case 'init': //页面进来第一次加载
this.setData({
unlockMemberList: data.list || []
unlockMemberList: [data.list] || []
}, () => {
if (this.data.memberTotal > this.data.unlockMemberList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
if (this.data.memberTotal > this.caculateArrLength(this.data.unlockMemberList)) {
this.data.page += 1;
} else { // 没有更多了
this.setData({
hasmore: false
......@@ -128,13 +100,10 @@ Page({
case 'down': // 页面下拉刷新
wx.stopPullDownRefresh();
this.setData({
unlockMemberList: data.list || []
unlockMemberList: [data.list]
}, () => {
if (this.data.memberTotal > this.data.unlockMemberList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
if (this.data.memberTotal > this.caculateArrLength(this.data.unlockMemberList)) {
this.data.page += 1;
} else { // 没有更多了
this.setData({
hasmore: false
......@@ -143,16 +112,11 @@ Page({
})
break;
case 'up': // 页面上拉加载
let list = this.data.unlockMemberList;
let _list = list.concat(data.list);
this.setData({
unlockMemberList: _list
[`unlockMemberList[${this.data.page - 1}]`]: data.list
}, () => {
if (this.data.memberTotal > this.data.unlockMemberList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
if (this.data.memberTotal > this.caculateArrLength(this.data.unlockMemberList)) {
this.data.page += 1;
} else { // 没有更多了
this.setData({
hasmore: false
......@@ -163,7 +127,7 @@ Page({
default:
break;
}
if (this.data.unlockMemberList.length) {
if (this.caculateArrLength(this.data.unlockMemberList) == 0) {
this.setData({
emptyMemberPage: true
})
......@@ -175,38 +139,22 @@ Page({
}
}).catch((e) => {
this.setData({
memberLoading: false
listLoading: false
})
})
},
formIdCreate(e) {
const { formId } = e.detail;
formIdCreate({
formId
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
})
return _length;
},
// 搜索
searchinput(e) {
const { value } = e.detail;
this.setData({
searchName: value,
toStudentAct (e) {
const { id } = e.currentTarget.dataset;
console.log(id)
wx.navigateTo({
url: `/business/pages/morethemeindex/studentact?sid=${this.data.sid}&studentId=${id}&modeid=${this.data.mode_id}`
})
},
search() {
this.setData({
page: 1,
hasmore: true,
}, () => {
this.clockMemberListGet('down');
})
},
clearsearchinput() {
this.setData({
searchName: '',
page: 1,
hasmore: true,
}, () => {
this.clockMemberListGet('init');
})
},
}
})
\ No newline at end of file
{
"navigationBarTitleText": "参与概况",
"navigationBarTitleText": "成员管理",
"enablePullDownRefresh": true,
"usingComponents": {
"sjd-media-show": "../../../components/sjdmediashow",
"empty-content": "../../../components/emptycontent",
"poster-box": "../../../components/posterbox",
"go-top": "../../components/goTop",
"list-loading": "../../../components/listloading",
"comment-editor": "../../../components/commenteditor",
"calender": "../../../components/calendar",
"expiredTip": "../../components/expiredTip"
}
}
\ No newline at end of file
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<view class="search-box">
<view class="ipt-box">
<image class="ipt-iocn" src="{{imageRoot}}2b/themeindex/w-icon.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
<input type="text" placeholder-class="placeholderclass" class="search-input" value="{{searchName}}" bindinput="searchinput" placeholder="输入学员昵称"></input>
<image class="close-iocn" src="{{imageRoot}}2b/common/closeicon.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" bindtap="clearsearchinput" wx:if="{{searchName}}"></image>
</view>
<view class="btn" bindtap="search">搜索</view>
<view class="page-tip">正式学员 和潜客 是什么意思
<image class="tip-icon" src="{{imageRoot}}2c/ucenter2/icon_zuoye.png?{{imageVersion}}"></image>
</view>
<view class="wrap-box">
<view class="list-box" wx:if="{{unlockMemberList.length>0}}">
<view class="list-item" wx:for="{{unlockMemberList}}" wx:key="{{index}}">
<view class="list-box" wx:if="{{memberTotal>0}}">
<block wx:for="{{unlockMemberList}}" wx:for-item="bigitem" wx:key="bigindex" wx:for-index="bigindex">
<view class="list-item" wx:for="{{bigitem}}" wx:for-item="item" wx:key="{{index}}" bindtap="toStudentAct" data-id="{{item.student_id}}">
<view class="left">
<view class="userinfo">
<image class="avator" src="{{filter.imagify(item.avatar, 'image/resize,w_160/format,jpg')}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
<view class="namebox">
<view class="name">{{item.nickname}}</view>
<view class="time">{{item.max_time}}</view>
</view>
</view>
<image class="avatar" src="{{filter.imagify(item.school_student.avatar, 'image/resize,w_160/format,jpg')}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
</view>
<view class="right">
<text>已挑战</text>
<text class="static">{{item.record_count}}</text>
<text>关</text>
<view class="nickname">{{item.school_student.nickname}}</view>
<view class="time">{{item.min_created_at}} 加入</view>
<view class="num">已闯{{item.unlock_subject_count}}关</view>
</view>
<view class="status {{item.is_formal_student?'status2':'status1'}}">{{item.is_formal_student?'在读':'非在读'}}</view>
</view>
</view>
<empty-content text="{{searchName?'没有找到该学员~':'暂无数据~'}}" emptyimg="common/empty/empty_b.png" wx:else></empty-content>
</block>
</view>
<empty-content text="暂无数据~" emptyimg="common/empty/empty_b.png" wx:else></empty-content>
</view>
<expiredTip/>
\ No newline at end of file
/* 搜索框 */
.search-box{
padding: 36rpx 25rpx 16rpx 25rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.search-box .btn{
width:92rpx;
height: 48rpx;
line-height: 46rpx;
text-align: center;
border:2rpx solid rgba(101,184,244,1);
border-radius:10rpx;
font-size:26rpx;
font-family:PingFang-SC-Regular;
font-weight:400;
color:rgba(101,184,244,1);
box-sizing:content-box;
}
.search-box .ipt-box{
width:525rpx;
height:60rpx;
background:rgba(255,255,255,1);
border:1px solid rgba(228,229,240,1);
border-radius:30rpx;
display: flex;
justify-content: center;
box-sizing: content-box;
position: relative;
}
.search-box .ipt-box .close-iocn{
width: 17rpx;
height: 19rpx;
position: absolute;
right:0rpx;
top:0rpx;
padding:20rpx;
z-index:30;
}
.search-box .ipt-box .ipt-iocn{
width:29rpx;
height:30rpx;
padding: 15rpx 28rpx;
}
.search-box .ipt-box .search-input{
width: 440rpx;
border: none;
height: 60rpx;
}
.search-box .btn{
width: 92rpx;
height: 48rpx;
/* line-height: 48rpx;
text-align: center; */
border: 2rpx solid rgba(101,184,244,1);
border-radius: 10rpx;
font-size: 26rpx;
font-family: PingFang-SC-Regular;
font-weight: 400;
color: rgba(101,184,244,1);
display: flex;
justify-content: center;
align-items: center;
page{
background: #F0F0F4;
}
.page-tip{
width: 100%;
height: 70rpx;
background: #fff;
display: flex;
align-items: center;
font-size: 26rpx;
color: #65B8F4;
padding: 0 23rpx;
z-index: 2;
}
.page-tip .tip-icon{
width: 24rpx;
height: 24rpx;
margin-left: 12rpx;
}
.list-box {
background: #fff;
padding: 31rpx 24rpx;
}
.list-item {
.list-box .list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 24rpx;
height: 130rpx;
padding: 20rpx;
position: relative;
margin-bottom: 24rpx;
border-radius: 20rpx;
background: #fff;
}
.list-item:after{
content: '';
width: 100%;
height: 1px;
background: rgba(0,0,0,1);
opacity: 0.05;
position: absolute;
left: 0;
bottom: 0;
}
.list-item:last-of-type:after{
display: none;
.list-box .list-item::last-of-type{
margin-bottom: 0
}
.list-item .left {
display: flex;
align-items: center;
.list-box .list-item .left {
width: 100rpx;
min-width: 100rpx;
height: 100rpx;
border-radius: 50%;
margin-right: 30rpx;
overflow: hidden;
}
.userinfo {
margin-left: 26rpx;
display: flex;
align-items: center;
line-height: 1;
.list-box .list-item .left .avatar{
width: 100%;
height: 100%;
}
.userinfo .avator {
display: block;
width: 66rpx;
height: 66rpx;
border-radius: 50%;
margin-right: 32rpx;
.list-box .list-item .right{
max-width: 400rpx;
}
.namebox .name {
width: 245rpx;
.list-box .list-item .right>view{
line-height: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: #000;
font-size: 28rpx;
text-overflow: ellipsis;
}
.list-box .list-item .right .nickname{
font-size: 26rpx;
color: #1F1F1F;
font-weight: bold;
}
.list-box .list-item .right .time{
font-size: 22rpx;
color: #ADADAD;
padding-top: 10rpx;
}
.namebox .time {
padding-top: 26rpx;
.list-box .list-item .right .num{
font-size: 22rpx;
columns: #939393;
color: #ADADAD;
padding-top: 20rpx;
}
.right{
.status{
width: 114rpx;
height: 38rpx;
border-radius: 19rpx;
position: absolute;
right: 20rpx;
top: 20rpx;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
color: #8F8F8F;
}
.right text {
font-size: 22rpx;
color: #898A88;
.status2{
color: #35BAFD;
background: rgba(53,186,253,.1);
}
.right text.static {
font-size: 26rpx;
color: #000;
padding: 0 8rpx;
.status1{
color: #FFBA01;
background: rgba(255,186,0,.1);
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ Component({
},
candrag: {
type: Boolean,
value: false
value: true
}
},
options: {
......
......@@ -505,6 +505,8 @@ const apis = {
unlocksubjectindex: `${api}member/unlock_subject/index`, //B-模式对应的主题列表
unlocksubjectdetail: `${api}member/unlock_subject/detail`, //B-模式对应的主题列表
unlocksubjectsituation: `${api}member/unlock_subject/situation`, //B-参与概况
unlocksubjectstudents: `${api}member/unlock_subject/students`, //B-成员列表
modeStudentDetail: `${api}member/unlock_subject/mode_student_detail`, //B-闯关个人动态详情
},
points: {
exchangeRecord: `${api}member/integral_goods/exchange`, //B-积分兑换记录
......
export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/',
host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn',
// host: 'https://qxapi.qingxiao.online/daka',
// host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '5.0',
imageVersion: '20200117',
// host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn',
host: 'https://clock.wp53.cn',
host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785',
miniProgram: {
clock: 'wxdeee20e52a1fd7ee'
......
......@@ -42,9 +42,32 @@ function unlocksubjectsituation(data) {
errorresolve: 1,
})
}
// 闯关打卡成员列表
function unlocksubjectstudents(data) {
return wxRequest({
role: '2b',
url: apis.business.morethemeindex.unlocksubjectstudents,
data,
method: 'GET',
errorresolve: 1,
})
}
//闯关个人动态详情
function modeStudentDetail(data) {
return wxRequest({
role: '2b',
url: apis.business.morethemeindex.modeStudentDetail,
data,
method: 'GET',
errorresolve: 1,
})
}
export {
unlocksubjectshow,
unlocksubjectindex,
unlocksubjectdetail,
unlocksubjectsituation
unlocksubjectsituation,
unlocksubjectstudents,
modeStudentDetail
}
\ No newline at end of file
......@@ -1289,6 +1289,8 @@
height: auto;
background: rgba(247, 247, 247, 1);
border-radius: 8rpx;
position: relative;
z-index: 10;
}
.detail-theme-box .theme-box {
......
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