Commit 8579974a authored by lvtz's avatar lvtz

fix

parent 8e83e696
// business/pages/deskcenter/index.js // business/pages/deskcenter/index.js
import { import { loginTime } from "../../../service/business/ucenter.js";
loginTime
} from "../../../service/business/ucenter.js";
import { LocalStorage, formatDay } from "../../../utilities/index.js"; import { LocalStorage, formatDay } from "../../../utilities/index.js";
import { import {
commonwaitjobGet, commonwaitjobGet,
...@@ -11,14 +9,14 @@ import { ...@@ -11,14 +9,14 @@ import {
schoolDetailGet, schoolDetailGet,
} from "../../../service/business/common.js"; } from "../../../service/business/common.js";
import { import {
getAccountList, getAccountList,
getMemberMe, getMemberMe,
helpAds helpAds,
} from "../../../service/common.js"; } from "../../../service/common.js";
import apis from "../../../constants/api.js"; import apis from "../../../constants/api.js";
import { todocallGet } from "../../../service/business/classservice.js"; import { todocallGet } from "../../../service/business/classservice.js";
import permissionUtils from '../../../utilities/permission.js'; import permissionUtils from "../../../utilities/permission.js";
var wxCharts = require("../../../utilities/wxcharts-min.js"); var wxCharts = require("../../../utilities/wxcharts-min.js");
var columnChart = null; var columnChart = null;
...@@ -31,9 +29,9 @@ Page({ ...@@ -31,9 +29,9 @@ Page({
imageRoot: app.globalData.imageRoot, imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
schoolShow: false, schoolShow: false,
schoolList:[], schoolList: [],
schoolTotal:0, schoolTotal: 0,
selectSchoolData:{}, selectSchoolData: {},
schoolTitile: "", schoolTitile: "",
sid: 0, sid: 0,
...@@ -65,42 +63,10 @@ Page({ ...@@ -65,42 +63,10 @@ Page({
analyzeDashStatic: {}, //面板数据 analyzeDashStatic: {}, //面板数据
guideDailogShow: false, guideDailogShow: false,
guideIndex: 1, guideIndex: 1,
adsList: [], adsList: [],
curbanner: 0, curbanner: 0,
// 待办事项 waitJobList: [],//新校区待办事项
waitJobList: [
{
type: 1,
title: "创建一个班级",
count: 0,
},
{
type: 2,
title: "创建一个作业打卡活动",
count: 0,
},
{
type: 3,
title: "添加老师至学校",
count: 0,
},
{
type: 4,
title: "配置一个精美的微官网",
count: 0,
},
{
type: 5,
title: "给学生一次课堂点评",
count: 0,
},
{
type: 6,
title: "给学生配置积分奖励",
count: 0,
},
],
}, },
onLoad: function (options) { onLoad: function (options) {
...@@ -115,7 +81,7 @@ Page({ ...@@ -115,7 +81,7 @@ Page({
// this.analyzeclasscourseGet(); // this.analyzeclasscourseGet();
// this.schoolDetailGet(); // this.schoolDetailGet();
this.getschoolList(); this.getschoolList();
this.getAds() this.getAds();
}, },
onShow: function () { onShow: function () {
this.getMemberMeInfo(); this.getMemberMeInfo();
...@@ -175,78 +141,82 @@ Page({ ...@@ -175,78 +141,82 @@ Page({
} }
}); });
}, },
getAds () { getAds() {
helpAds({ helpAds({
type: 1, type: 1,
page: 1, page: 1,
perPage: 10 perPage: 10,
}).then((res) => { }).then((res) => {
const { code, data } = res; const { code, data } = res;
if (code == 200) { if (code == 200) {
// this.adsList = data.list; // this.adsList = data.list;
this.setData({ this.setData({
adsList: data.list adsList: data.list,
}) });
} else { } else {
wx.showToast({ wx.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: "none",
}) });
} }
}) });
}, },
getschoolList(){ getschoolList() {
getAccountList({ getAccountList({
page: 1, page: 1,
perPage: 100, perPage: 100,
school_id: this.data.sid school_id: this.data.sid,
}).then((res) => {
const {code, data} = res;
if (code == 200) {
this.data.schoolTotal = data.total;
this.setData({
schoolList: data.list,
selectSchoolData: this.data.sid?data.list.find((item)=>item.id == this.data.sid):data.list[0]
})
}
}).catch(() => {
}) })
.then((res) => {
const { code, data } = res;
if (code == 200) {
this.data.schoolTotal = data.total;
this.setData({
schoolList: data.list,
selectSchoolData: this.data.sid
? data.list.find((item) => item.id == this.data.sid)
: data.list[0],
});
}
})
.catch(() => {});
}, },
selectSchool () { selectSchool() {
if(this.data.schoolList.length==1){ if (this.data.schoolList.length == 1) {
return return;
} }
this.setData({ this.setData({
schoolShow: !this.data.schoolShow schoolShow: !this.data.schoolShow,
}) });
}, },
sureSelect (e) { sureSelect(e) {
const {item} = e.currentTarget.dataset; const { item } = e.currentTarget.dataset;
if (item.id == this.data.id) { if (item.id == this.data.id) {
this.setData({ this.setData({
schoolShow: false, schoolShow: false,
}) });
return; return;
} }
// app.globalData.accountExpired = false; // app.globalData.accountExpired = false;
loginTime({ loginTime({
id: item.id, id: item.id,
type: 1 type: 1,
}) });
if(item.school_teacher.type==2){ //管理员 if (item.school_teacher.type == 2) {
//管理员
// this.getMemberMeInfo(item.id) // this.getMemberMeInfo(item.id)
LocalStorage.setItem('dakarole', 1); LocalStorage.setItem("dakarole", 1);
wx.reLaunch({ wx.reLaunch({
url: `/business/pages/deskcenter/index?sid=${item.id}`, url: `/business/pages/deskcenter/index?sid=${item.id}`,
}) });
}else { } else {
LocalStorage.setItem('dakarole', 2); LocalStorage.setItem("dakarole", 2);
permissionUtils.myMenulistGet(item.id) permissionUtils.myMenulistGet(item.id);
wx.reLaunch({ wx.reLaunch({
url: `/business/pages/classservice/teacherindex?sid=${item.id}`, url: `/business/pages/classservice/teacherindex?sid=${item.id}`,
}) });
} }
// this.setData({ // this.setData({
// sid: item.id, // sid: item.id,
// schoolShow: false, // schoolShow: false,
...@@ -259,7 +229,7 @@ Page({ ...@@ -259,7 +229,7 @@ Page({
// this.getCommonwaitJob(); // this.getCommonwaitJob();
// this.getMemberMeInfo(); // this.getMemberMeInfo();
// }) // })
}, },
// 超时 // 超时
// todocallGet() { // todocallGet() {
...@@ -300,12 +270,12 @@ Page({ ...@@ -300,12 +270,12 @@ Page({
// }, 200); // }, 200);
// }, // },
// 轮播图手动 // 轮播图手动
bindSwiperchange (e){ bindSwiperchange(e) {
console.log(33) console.log(33);
let that = this; let that = this;
that.setData({ that.setData({
curbanner: e.detail.current curbanner: e.detail.current,
}) });
}, },
// 打卡 // 打卡
goClocklist() { goClocklist() {
...@@ -368,10 +338,10 @@ Page({ ...@@ -368,10 +338,10 @@ Page({
}); });
}, },
// 待处理更多 // 待处理更多
toMoreDeal () { toMoreDeal() {
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/todotasks/globaldeal?sid=${this.data.sid}`, url: `/business/pages/todotasks/globaldeal?sid=${this.data.sid}`,
}) });
}, },
// 待处理具体跳转 // 待处理具体跳转
jumpTodo(e) { jumpTodo(e) {
...@@ -394,7 +364,7 @@ Page({ ...@@ -394,7 +364,7 @@ Page({
url = `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`; url = `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`;
break; break;
case 6: case 6:
url = `/business/pages/scorerulesetting/index?sid=${this.data.sid}`; url = `/business/pages/scoremgt/index?sid=${this.data.sid}`;
break; break;
default: default:
url = ""; url = "";
...@@ -438,16 +408,67 @@ Page({ ...@@ -438,16 +408,67 @@ Page({
commonwaitjobGet({ commonwaitjobGet({
school_id: this.data.sid, school_id: this.data.sid,
}).then((res) => { }).then((res) => {
if (res.code == 200) { const { code, data } = res;
if (code == 200) {
let waitJobList = [];
for (let i in data.statistic) {
if (data.statistic[i] == 0) {
waitJobList.push({
title: this.transformTitle(i, 2),
type: this.transformTitle(i, 1),
count: data.statistic[i],
});
}
}
this.setData({ this.setData({
waitJob: waitJob:
(res.data.apply_number || 0) + (data.apply_number || 0) +
(res.data.customer_number || 0) + (data.customer_number || 0) +
(res.data.noReviews || 0), (data.noReviews || 0),
waitJobList: waitJobList,
}); });
} }
}); });
}, },
// 待办事项处理,kind 1为类型 2为标题
transformTitle(key, kind) {
let title = "";
let type = "";
switch (key) {
case "class_count":
title = "创建一个班级";
type = 1;
break;
case "subject_mixed_count":
title = "创建一个作业打卡活动";
type = 2;
break;
case "teacher_count":
title = "添加老师至学校";
type = 3;
break;
case "website_count":
title = "配置一个精美的微官网";
type = 4;
break;
case "class_review_count":
title = "给学生一次课堂点评";
type = 5;
break;
case "integral_good_count":
title = "给学生配置积分奖励";
type = 6;
break;
default:
break;
}
if (kind == 1) {
return type;
}
if (kind == 2) {
return title;
}
},
watchBack(name, that) { watchBack(name, that) {
that.setData({ that.setData({
accountExpired: name, accountExpired: name,
......
...@@ -115,14 +115,14 @@ ...@@ -115,14 +115,14 @@
</view> </view>
</view> </view>
</view> </view>
<view class="section-wrap"> <view class="section-wrap" wx:if="{{waitJobList.length>0}}">
<view class="section section-waitdeal"> <view class="section section-waitdeal">
<view class="section-title"> <view class="section-title">
<view class="title-text">待处理</view> <view class="title-text">待处理</view>
<view class="btn-more" bindtap="toMoreDeal">更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"/></view> <view class="btn-more" bindtap="toMoreDeal">更多<image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"/></view>
</view> </view>
<view class="waitdeal-box"> <view class="waitdeal-box">
<view class="item" wx:for="{{waitJobList}}" wx:key="index" data-type="{{item.type}}" bindtap="jumpTodo"> <view class="item" wx:for="{{waitJobList}}" wx:key="index" data-type="{{item.type}}" bindtap="jumpTodo" wx:if="{{item.count==0 && index<3}}">
<view class="l"> <view class="l">
<image class="item-icon" src="{{imageRoot}}2b/deskcenternew/waitdeal/icon_0{{item.type}}.png?{{imageVersion}}"/> <image class="item-icon" src="{{imageRoot}}2b/deskcenternew/waitdeal/icon_0{{item.type}}.png?{{imageVersion}}"/>
<view class="item-title">{{item.title}}</view> <view class="item-title">{{item.title}}</view>
......
import {
commonwaitjobGet
} from "../../../service/business/common.js";
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
...@@ -5,38 +8,7 @@ Page({ ...@@ -5,38 +8,7 @@ Page({
imageRoot: app.globalData.imageRoot, imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
sid: 0, sid: 0,
waitJobList: [ waitJobList: [],//新校区待办事项
{
type: 1,
title: "创建一个班级",
count: 0,
},
{
type: 2,
title: "创建一个作业打卡活动",
count: 0,
},
{
type: 3,
title: "添加老师至学校",
count: 0,
},
{
type: 4,
title: "配置一个精美的微官网",
count: 0,
},
{
type: 5,
title: "给学生一次课堂点评",
count: 0,
},
{
type: 6,
title: "给学生配置积分奖励",
count: 0,
},
],
}, },
onLoad: function (options) { onLoad: function (options) {
const { sid } = options; const { sid } = options;
...@@ -44,6 +16,70 @@ Page({ ...@@ -44,6 +16,70 @@ Page({
sid, sid,
}); });
}, },
onShow (){
this.getCommonwaitJob();
},
getCommonwaitJob() {
commonwaitjobGet({
school_id: this.data.sid,
}).then((res) => {
const { code, data} = res;
if (code == 200) {
let waitJobList = [];
for (let i in data.statistic) {
if (data.statistic[i] == 0) {
waitJobList.push({
title: this.transformTitle(i, 2),
type: this.transformTitle(i, 1),
count: data.statistic[i],
});
}
}
this.setData({
waitJobList: waitJobList,
});
}
});
},
// 待办事项处理,kind 1为类型 2为标题
transformTitle(key, kind) {
let title = "";
let type = "";
switch (key) {
case "class_count":
title = "创建一个班级";
type = 1;
break;
case "subject_mixed_count":
title = "创建一个作业打卡活动";
type = 2;
break;
case "teacher_count":
title = "添加老师至学校";
type = 3;
break;
case "website_count":
title = "配置一个精美的微官网";
type = 4;
break;
case "class_review_count":
title = "给学生一次课堂点评";
type = 5;
break;
case "integral_good_count":
title = "给学生配置积分奖励";
type = 6;
break;
default:
break;
}
if (kind == 1) {
return type;
}
if (kind == 2) {
return title;
}
},
jumpTodo(e) { jumpTodo(e) {
const { type } = e.currentTarget.dataset; const { type } = e.currentTarget.dataset;
let url = ""; let url = "";
...@@ -64,7 +100,7 @@ Page({ ...@@ -64,7 +100,7 @@ Page({
url = `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`; url = `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`;
break; break;
case 6: case 6:
url = `/business/pages/scorerulesetting/index?sid=${this.data.sid}`; url = `/business/pages/scoremgt/index?sid=${this.data.sid}?sid=${this.data.sid}`;
break; break;
default: default:
url = ""; url = "";
......
{ {
"navigationBarTitleText": "待处理", "navigationBarTitleText": "待处理",
"usingComponents": { "usingComponents": {
"expiredTip": "../../components/expiredTip" "expiredTip": "../../components/expiredTip",
"empty-content": "../../../components/emptycontent"
} }
} }
\ No newline at end of file
<view class="container"> <view class="container">
<view class="waitdeal-box"> <view class="waitdeal-box" wx:if="{{waitJobList.length>0}}">
<view class="item" wx:for="{{waitJobList}}" wx:key="index" data-type="{{item.type}}" bindtap="jumpTodo"> <view class="item" wx:for="{{waitJobList}}" wx:key="index" data-type="{{item.type}}" bindtap="jumpTodo" wx:if="{{item.count==0}}">
<view class="l"> <view class="l">
<image class="item-icon" src="{{imageRoot}}2b/deskcenternew/waitdeal/icon_0{{item.type}}.png?{{imageVersion}}"/> <image class="item-icon" src="{{imageRoot}}2b/deskcenternew/waitdeal/icon_0{{item.type}}.png?{{imageVersion}}"/>
<view class="item-title">{{item.title}}</view> <view class="item-title">{{item.title}}</view>
...@@ -11,4 +11,5 @@ ...@@ -11,4 +11,5 @@
</view> </view>
</view> </view>
</view> </view>
<empty-content text="暂无待处理事项~" emptyimg="" wx:else></empty-content>
</view> </view>
\ 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