Commit 27de48ea authored by sujie@126.com's avatar sujie@126.com

dd

parent f3dab1b3
......@@ -310,7 +310,6 @@ Page({
const visitor = LocalStorage.getItem('visitor');
studentidentity({
class_id: this.data.id,
consumer_id: visitor && visitor.id
}).then((res) => {
wx.hideLoading();
const {
......@@ -603,8 +602,8 @@ Page({
const nowDay = this.data.activeDay ? clockdate : today
judgeIsClock({
subject_id: tid,
consumer_id: visitor && visitor.id,
now_consumer_id: visitor && visitor.id,
student_id: visitor && visitor.studentId,
now_student_id: visitor && visitor.studentId,
calendar_date: nowDay
}).then((res) => {
const {
......@@ -687,9 +686,8 @@ Page({
page: 1,
perPage: 1,
subject_id: this.data.tid,
now_consumer_id: visitor && visitor.id,
// exclude_consumer_id: visitor.id,
consumer_id: visitor && visitor.id,
now_student_id: visitor && visitor.studentId,
student_id: visitor && visitor.studentId,
calendar_date: nowDay
}).then((res) => {
const {
......@@ -940,28 +938,28 @@ Page({
} = e.detail;
let clock = this.data.selfClockDetail;
if (type == 2) { // 取消点赞
if(clock.likes.list.find(ele=>ele.consumer_id==customerId)){
if(clock.likes.list.find(ele=>ele.student_id==customerId)){
clock.had_like = 0;
clock.likes.total--;
clock.likes.list = clock.likes.list.filter(ele => ele.consumer_id != customerId);
clock.likes.list = clock.likes.list.filter(ele => ele.student_id != customerId);
}
} else if (type == 1) { // 点赞
clock.had_like = 1;
if (!clock.likes) {
clock.likes = {
list: [{
consumer_id: customerId,
student_id: customerId,
nickname: nickname,
remark: this.data.personalClockInfo.clock_circle_user && this.data.personalClockInfo.clock_circle_user.remark || nickname,
}],
total: 1
}
} else {
if(clock.likes.list.find(ele=>ele.consumer_id==customerId)){
if(clock.likes.list.find(ele=>ele.student_id==customerId)){
return false;
}
clock.likes.list.push({
consumer_id: customerId,
student_id: customerId,
nickname: nickname,
remark: this.data.personalClockInfo.clock_circle_user && this.data.personalClockInfo.clock_circle_user.remark || nickname,
});
......
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