Commit fc01c6bf authored by wangxuelai's avatar wangxuelai

''

parent 4a615296
......@@ -30,6 +30,41 @@ function formatDateRemoveYearb (date) {
var minute = mi < 10 ? '0' + mi : mi;
return month + '-' + day + ' ' + hour + ':' + minute;
}
function formatDateToHourMinute (date) {
if (!date) {
return ''
};
var regexp = getRegExp('-', 'g');
var time = getDate(date.replace(regexp, '/'));
var y = time.getFullYear();
var m = time.getMonth() + 1;
var month = m < 10 ? '0' + m : m;
var d = time.getDate();
var day = d < 10 ? '0' + d : d;
var h = time.getHours();
var hour = h < 10 ? '0' + h : h;
var mi = time.getMinutes();
var minute = mi < 10 ? '0' + mi : mi;
return hour + ':' + minute;
}
function formatDate2(date) {
if (!date) {
return ''
};
var regexp = getRegExp('-', 'g');
var time = getDate(date.replace(regexp, '/'));
var y = time.getFullYear();
var m = time.getMonth() + 1;
var month = m < 10 ? '0' + m : m;
var d = time.getDate();
var day = d < 10 ? '0' + d : d;
var h = time.getHours();
var hour = h < 10 ? '0' + h : h;
var mi = time.getMinutes();
var minute = mi < 10 ? '0' + mi : mi;
return y + '-' + month + '-' + day + ' ' + hour + ':' + minute;
}
function formatDateRemoveYear (date) {
var time = getDate(date * 1000);
var y = time.getFullYear();
......@@ -508,5 +543,7 @@ module.exports = {
formatGender: formatGender,
formatDateRemoveYearb: formatDateRemoveYearb,
reviewClassImgShow: reviewClassImgShow,
checkStudentSelect: checkStudentSelect
checkStudentSelect: checkStudentSelect,
formatDateToHourMinute: formatDateToHourMinute,
formatDate2: formatDate2
}
\ No newline at end of file
......@@ -38,7 +38,6 @@ const definePage = function () {
})
}
function getForQueryStudentId (path, query) {
console.log(query, 'query');
let returnObj = {};
const pageObj = parameter.find(ele => ele.root == path) || null;
let queryParams = {};
......
......@@ -99,9 +99,10 @@ Page({
},
goInfluenceDetail () {
goInfluenceDetail (e) {
const {tab} = e.currentTarget.dataset;
wx.navigateTo({
url: `/src/pages/myinfluence/influencelist?sid=${this.data.sid}`,
url: `/src/pages/myinfluence/influencelist?sid=${this.data.sid}&tab=${tab || 0}`,
})
},
getdashboard () {
......
......@@ -40,7 +40,7 @@
<view class="questionicon">?</view>
</view>
<view class="innerbox">
<view class="innerboxitem border-right border-bottom">
<view class="innerboxitem border-right border-bottom" data-tab="0" bindtap="goInfluenceDetail">
<view class="itemtitle">好友查看</view>
<view class="staticline">
<text class="static">{{view.now}}</text>
......@@ -52,7 +52,7 @@
<text class="trendlinestatic">{{rate.getRate(view.now, view.last)}}%</text>
</view>
</view>
<view class="innerboxitem border-bottom">
<view class="innerboxitem border-bottom" data-tab="2" bindtap="goInfluenceDetail">
<view class="itemtitle">留下线索</view>
<view class="staticline">
<text class="static">{{clue.now}}</text>
......@@ -64,7 +64,7 @@
<text class="trendlinestatic">{{rate.getRate(clue.now, clue.last)}}%</text>
</view>
</view>
<view class="innerboxitem border-right">
<view class="innerboxitem border-right" data-tab="1" bindtap="goInfluenceDetail">
<view class="itemtitle">好友转发</view>
<view class="staticline">
<text class="static">{{share.now}}</text>
......
......@@ -52,9 +52,28 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const { sid } = options;
const { sid, tab } = options;
this.setData({
sid,
acIndex: Number(tab) || 0,
})
app.getCurrentSchoolStudentId({
source_id: this.data.sid,
source_type: 10,
}).then((res) => {
switch (this.data.acIndex) {
case 0:
this.getViewThumbnail('init');
break;
case 1:
this.getShareThumbnail('init');
break;
case 2:
this.getClueList('init');
break;
default:
break;
}
})
wx.setNavigationBarColor({
frontColor: '#ffffff',
......@@ -69,19 +88,7 @@ Page({
fail: () => {},
complete: () => {}
});
switch (this.data.acIndex) {
case 0:
this.getViewThumbnail('init');
break;
case 1:
this.getShareThumbnail('init');
break;
case 2:
this.getClueList('init');
break;
default:
break;
}
},
/**
......@@ -767,5 +774,99 @@ Page({
clueLoading: false
})
})
},
goViewOrigin (e) { // 点击跳转
const { viewpeople } = e.currentTarget.dataset;
const { source_type } = viewpeople.behavior;
switch(Number(source_type)) {
case 1: // 成长记录
wx.navigateTo({
url: `/src/pages/growthrecord/index?consumerId=${viewpeople.behavior.morph_source_student.id}&sid=${viewpeople.behavior.morph_source_student.school_id}`,
})
break;
case 3: // 打卡详情
wx.navigateTo({
url: `/src/pages/clockdetail/newindex?tid=${viewpeople.behavior.morph_source_record.subject_id}&cid=${viewpeople.behavior.morph_source_record.id}`,
})
break;
case 8: // 课堂点评
wx.navigateTo({
url: `/src/pages/papersquare/reviewdetail?sid=${viewpeople.behavior.morph_source_class_room_review.school_id}&id=${viewpeople.behavior.morph_source_class_room_review.class_id}&rid=${viewpeople.behavior.morph_source_class_room_review.id}&type=${viewpeople.behavior.morph_source_class_room_review.review_type}`
})
break;
default:
break;
}
},
gosharerOrigin (e) {
const { sharepeople } = e.currentTarget.dataset;
const { source_type } = sharepeople;
switch(Number(source_type)) {
case 1: // 成长记录
wx.navigateTo({
url: `/src/pages/growthrecord/index?consumerId=${sharepeople.morph_source_student.id}&sid=${sharepeople.morph_source_student.school_id}`,
})
break;
case 3: // 打卡详情
wx.navigateTo({
url: `/src/pages/clockdetail/newindex?tid=${sharepeople.morph_source_record.subject_id}&cid=${sharepeople.morph_source_record.id}`,
})
break;
case 8: // 课堂点评
wx.navigateTo({
url: `/src/pages/papersquare/reviewdetail?sid=${sharepeople.morph_source_class_room_review.school_id}&id=${sharepeople.morph_source_class_room_review.class_id}&rid=${sharepeople.morph_source_class_room_review.id}&type=${sharepeople.morph_source_class_room_review.review_type}`
})
break;
default:
break;
}
},
goClueOrigin (e) {
const { clueitem } = e.currentTarget.dataset;
const { source_type } = clueitem.last_behavior;
switch (Number(source_type)) {
case 1: // 成长记录
wx.navigateTo({
url: `/src/pages/growthrecord/index?consumerId=${clueitem.last_behavior.morph_source_student.id}&sid=${clueitem.last_behavior.school_id}`,
})
break;
case 2: // 主题(作业和日历)
if (clueitem.last_behavior.morph_source_subject.subject_type == 1) {
wx.navigateTo({
url: `/src/pages/themeindex/index?id=${clueitem.last_behavior.morph_source_subject.class_id}&tid=${clueitem.last_behavior.morph_source_subject.id}`,
})
} else if (clueitem.last_behavior.morph_source_subject.subject_type == 2) {
wx.navigateTo({
url: `/src/pages/calendarthemeindex/index?id=${clueitem.last_behavior.morph_source_subject.class_id}&tid=${clueitem.last_behavior.morph_source_subject.id}`,
})
}
break;
case 6: // 解锁模式
wx.navigateTo({
url: `/src/pages/morethemeindex/index?id=${clueitem.last_behavior.morph_source_unlock_mode.class_id}&tid=${clueitem.last_behavior.morph_source_unlock_mode.id}`,
})
break;
case 3: // 打卡详情
wx.navigateTo({
url: `/src/pages/clockdetail/newindex?tid=${clueitem.last_behavior.morph_source_record.subject_id}&cid=${clueitem.last_behavior.morph_source_record.id}`,
})
break;
case 29: // 学生勋章
break;
case 4: // 习作广场
wx.navigateTo({
url: `/src/pages/papersquare/index?sid=${clueitem.last_behavior.morph_source_school.id}`,
})
break;
case 5: // 个人中心
break;
case 7: // 微官网主页
wx.navigateTo({
url: `/src/pages/websiteindex/index?sid=${clueitem.last_behavior.morph_source_school.id}`,
})
break;
default:
break;
}
}
})
\ No newline at end of file
This diff is collapsed.
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