Commit 71b92eb2 authored by wangxuelai's avatar wangxuelai

'修复bug'

parent 1de4a479
......@@ -1524,13 +1524,12 @@ Page({
goMembers() {
const { params } = this.data;
wx.navigateTo({
url: `/business/pages/themeindex/members?subject_id=${params.id}&subject_type=${params.subject_type}&sid=${params.school_id}`
url: `/business/pages/themeindex/members?subject_id=${params.id}&subject_type=${params.subject_type}&sid=${params.school_id}&title=${params.title}`
});
},
// 分享弹框
goClickShare(e) {
const { clock } = e.detail;
console.log(clock);
this.setData({
goShareClockItem: {
shareModalShow: true,
......
......@@ -362,6 +362,12 @@ Page({
mixedthemeTotal: data.total
});
}
data.list.forEach((ele) => {
if (ele.subject_type == 1) {
ele.isStarted = new Date(ele.start_time.replace(/-/g, '/')).getTime() <= new Date().getTime();
ele.isEnded = new Date(ele.end_time.replace(/-/g, '/')).getTime() <= new Date().getTime();
}
})
switch (type) {
case "init": //页面进来第一次加载
this.setData({
......@@ -424,6 +430,7 @@ Page({
default:
break;
}
console.log(this.data.mixedthemeList, 'mixedthemeList');
if (this.caculateArrLength(this.data.mixedthemeList) == 0) {
this.setData({
emptyPage: true
......
<wxs src="../../../filter/index.wxs" module="filter" />
<view class="container">
<permission-box cinfigid="30002">
<view class="top-nav" slot="menubtn">
......@@ -54,7 +55,7 @@
</view>
<view class="static-box">
<text class="" selectable="false" space="false" decode="false">共{{item.student_total}}学员</text>
<text class="" selectable="false" space="false" decode="false">未提交{{item.no_clock}}人</text>
<!-- <text class="" selectable="false" space="false" decode="false">未提交{{item.no_clock}}人</text> -->
</view>
<block wx:if="{{item.subject_status == 2}}">
<view class="clockstatus wait" wx:if="{{item.no_review > 0}}">
......@@ -74,10 +75,18 @@
<view class="operatebox" data-theme="{{item}}" catchtap="copytheme" data-btn="copybtn" data-index="{{index}}" data-listIndex="{{listIndex}}">
<image class="icon_copy" src="{{imageRoot}}2b/circleindex/icon_copy.png?{{imageVersion}}"></image>
</view>
<view class="notpublishstatus" wx:if="{{item.subject_status == 1}}">
<view class="notpublishstatus" wx:if="{{item.isStarted && !item.isEnded}}">
<image src="{{imageRoot}}2c/circleindex/clockwhite.png?{{imageVersion}}"></image>
<text>进行中</text>
</view>
<view class="notpublishstatus" wx:if="{{!item.isStarted && !item.isEnded}}">
<image src="{{imageRoot}}2c/circleindex/clockwhite.png?{{imageVersion}}"></image>
<text>待发布</text>
<text>未开始</text>
</view>
<!-- <view class="notpublishstatus" wx:if="{{item.isStarted && item.isEnded}}">
<image src="{{imageRoot}}2c/circleindex/clockwhite.png?{{imageVersion}}"></image>
<text>已结束</text>
</view> -->
</block>
<block wx:if="{{item.subject_type == 2}}">
<image class="taskbg rilibg" src="{{imageRoot}}2b/circleindex/rili.png?{{imageVersion}}"></image>
......@@ -87,13 +96,13 @@
</view>
<view class="static-box">
<text class="" selectable="false" space="false" decode="false">共{{item.days}}天</text>
<text class="" selectable="false" space="false" decode="false">未打卡{{item.no_clock}}人</text>
<!-- <text class="" selectable="false" space="false" decode="false">未打卡{{item.no_clock}}人</text> -->
</view>
<view class="clockstatus wait" wx:if="{{item.no_review > 0}}">
<image class="dianpinicon" wx:if="{{item.subject_status != 1}}" src="{{imageRoot}}2b/circleindex/dianpin.png?{{imageVersion}}"></image>
<text class="clockstatic" wx:if="{{item.subject_status != 1}}" selectable="false" space="false" decode="false">待点评{{item.no_review}}</text>
</view>
<view class="clockstatus success" wx:if="{{item.no_review == 0}}">
<view class="clockstatus success" wx:if="{{item.no_review == 0 && item.clock_count > 0}}">
<image class="dianpinicon" wx:if="{{item.subject_status != 1}}" src="{{imageRoot}}2b/circleindex/right.png?{{imageVersion}}"></image>
<text class="clockstatic" wx:if="{{item.subject_status != 1}}" selectable="false" space="false" decode="false">已全部点评</text>
</view>
......
......@@ -1258,7 +1258,7 @@ Page({
goMembers(){
const { params } = this.data;
wx.navigateTo({
url: `/business/pages/themeindex/members?subject_id=${params.id}&subject_type=${params.subject_type}&sid=${params.school_id}`,
url: `/business/pages/themeindex/members?subject_id=${params.id}&subject_type=${params.subject_type}&sid=${params.school_id}&title=${params.title}`,
})
},
// 分享弹框
......
......@@ -58,10 +58,10 @@
<view class="like-item" wx:for="{{likeItem}}" wx:key='index'>
<view class="like-left">
<view class="like-num">{{index+1}}</view>
<image class="like-avatar" src="{{filter.imagify(item.avatar? item.avatar:item.school_student.avatar)}}" wx:if="{{item.avatar}}"></image>
<image class="like-avatar" src="{{filter.imagify(item.school_student.avatar || item.avatar)}}" wx:if="{{item.school_student.avatar || item.avatar}}"></image>
<image class="like-avatar" src="{{imageRoot}}common/empty/avatar_user.png?{{imageVersion}}" wx:else></image>
<view class="like-left-info">
<view class="like-name">{{item.school_student && item.school_student.name ? item.school_student.name: item.name }}</view>
<view class="like-name">{{item.name || item.school_student.nickname}}</view>
<view class="like-phone">{{item.mobile}}</view>
</view>
</view>
......@@ -84,10 +84,10 @@
<view class="like-item" wx:for="{{integralItem}}" wx:key="index">
<view class="like-left">
<view class="like-num">{{index+1}}</view>
<image class="like-avatar" src="{{filter.imagify(item.avatar? item.avatar:item.school_student.avatar)}}" wx:if="{{item.avatar}}"></image>
<image class="like-avatar" src="{{filter.imagify(item.avatar || item.school_student.avatar)}}" wx:if="{{item.avatar || item.school_student.avatar}}"></image>
<image class="like-avatar" src="{{imageRoot}}common/empty/avatar_user.png?{{imageVersion}}" wx:else></image>
<view class="like-left-info">
<view class="like-name">{{item.school_student && item.school_student.name ? item.school_student.name: item.name }}</view>
<view class="like-name">{{item.name || item.school_student.nickname }}</view>
<view class="like-phone">{{item.mobile}}</view>
</view>
</view>
......
......@@ -42,11 +42,12 @@ Page({
},
onLoad: function(options) {
const { subject_id, subject_type, sid } = options;
const { title, subject_id, subject_type, sid } = options;
this.setData({
subject_type,
subject_id,
sid
sid,
title
});
this.getStudents("init");
},
......@@ -71,7 +72,21 @@ Page({
onHide: function() {
this.data.needRefresh = false;
},
onShareAppMessage: function (option) {
if (this.data.subject_type == 1) {
return {
title: `邀请您提交「${this.data.title}」作业`,
path: `/src/pages/themeindex/landpage?tid=${this.data.subject_id}&sid=${this.data.sid}`,
imageUrl: `${this.data.imageRoot}pageshare_cover/theme_share.png`,
}
} else if (this.data.subject_type == 2) {
return {
title: `邀请您参加${this.data.title}打卡`,
path: `/src/pages/calendarthemeindex/landpage?tid=${this.data.subject_id}&sid=${this.data.sid}`,
imageUrl: `${this.data.imageRoot}pageshare_cover/theme_share.png`,
}
}
},
onPullDownRefresh: function() {
if (this.data.currentTabsIndex == 0) {
this.setData({
......
......@@ -35,7 +35,7 @@
<view class="has-nomore" wx:if="{{!studentEmptyPage && !studentHasmore && studentPage>1}}">没有更多了</view>
<list-loading loading="{{studentLoading}}"></list-loading>
<view class='btn-add'>
<button class="text" bindtap="">邀请学生打卡</button>
<button class="text" open-type="share">邀请学生打卡</button>
</view>
</view>
......
......@@ -9,11 +9,11 @@
<block wx:for="{{studentList}}" wx:for-item="studentItem" wx:key="studentList">
<view class="like-item" wx:for="{{studentItem}}" wx:key="index">
<view class="like-left">
<image class="like-avatar" src="{{filter.imagify(item.avatar? item.avatar:item.school_student.avatar)}}" wx:if="{{item.avatar}}"></image>
<image class="like-avatar" src="{{filter.imagify(item.avatar || item.school_student.avatar)}}" wx:if="{{item.avatar || item.school_student.avatar}}"></image>
<image class="like-avatar" src="{{imageRoot}}common/empty/avatar_user.png?{{imageVersion}}" wx:else></image>
<view class="like-left-info">
<view class="like-name-wrap">
<view class="like-name-info">{{item.school_student && item.school_student.name ? item.school_student.name: item.name }}</view>
<view class="like-name-info">{{item.name || item.school_student.nickname}}</view>
</view>
<view class="like-phone">{{item.mobile}}</view>
</view>
......
......@@ -126,7 +126,8 @@ Page({
signStudentsList: [],
secret: '',//加入的密码
studentMobile: "" //手机号
studentMobile: '', //手机号
encryptedData: ''
},
onLoad: function(options, b) {
const visitor = LocalStorage.getItem("visitor");
......@@ -909,7 +910,16 @@ Page({
const visitor = LocalStorage.getItem("visitor");
let that = this;
const { encryptedData, iv } = e.detail;
console.log(e.detail, 'e.detail');
if (e.detail.errMsg == 'getPhoneNumber:fail user deny') { //用户点击拒绝
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
});
}
});
wx.showToast({
title: '获取手机号失败',
icon: 'none'
......@@ -917,73 +927,12 @@ Page({
} else { //允许授权执行跳转
that.setData({
sessionCode: that.data.sessionCode,
encryptData: encryptedData,
encryptedData: encryptedData,
iv
},()=>{
that.joinClock();
});
}
// if (!encryptedData) {
// wx.login({
// success(res) {
// console.log(res,'313')
// const sessionCode = res.code;
// that.setData({
// sessionCode: sessionCode,
// encryptData: encryptedData,
// iv
// },()=>{
// that.joinClock();
// });
// }
// });
// wx.showToast({
// title: "授权失败",
// icon: "none",
// duration: 2000
// });
// return;
// } else {
// }
// wx.showLoading({
// title: '手机号获取中',
// })
// getwechatmobile({
// code: this.data.sessionCode,
// encryptData: encryptedData,
// iv
// }).then((res) => {
// wx.hideLoading();
// const { code, data } = res;
// if (code == 200 && data && data.mobile) {
// this.joinClock()
// console.log(res,'res')
// } else {
// wx.showToast({
// title: '手机号获取失败',
// icon: 'none',
// duration: 2000
// })
// }
// wx.login({
// success(res) {
// const sessionCode = res.code;
// that.setData({
// sessionCode: sessionCode
// })
// }
// })
// }).catch((err) => {
// wx.hideLoading()
// wx.login({
// success(res) {
// const sessionCode = res.code;
// that.setData({
// sessionCode: sessionCode
// })
// }
// })
// })
},
passwordInput(e) {
const {
......@@ -1030,11 +979,25 @@ Page({
url: `/src/pages/themeindex/index?&tid=${this.data.themeSelect.id}&sid=${this.data.sid}`
});
} else {
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
});
}
});
}
})
.catch(err => {
console.log(err);
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode
});
}
});
});
}
});
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