Commit b70bb63f authored by wangxuelai's avatar wangxuelai

'校区切换省份'

parent 6a66ec5a
...@@ -29,7 +29,8 @@ App({ ...@@ -29,7 +29,8 @@ App({
this.globalData.query = query; this.globalData.query = query;
this.versionCheck(); this.versionCheck();
this.getSystemInfo(); this.getSystemInfo();
this.globalData.myDevice = wx.getSystemInfoSync() this.globalData.myDevice = wx.getSystemInfoSync();
console.log(this.globalData.myDevice, 'myDevice');
if (wx.setInnerAudioOption){ if (wx.setInnerAudioOption){
wx.setInnerAudioOption({ wx.setInnerAudioOption({
obeyMuteSwitch: false obeyMuteSwitch: false
......
...@@ -185,7 +185,7 @@ Page({ ...@@ -185,7 +185,7 @@ Page({
titleinput (e) { titleinput (e) {
const {value} = e.detail; const {value} = e.detail;
this.setData({ this.setData({
'params.title': value.length > 20 ? value.substr(0, 20) : value 'params.title': value.length > 30 ? value.substr(0, 30) : value
}) })
}, },
numberInput(e){ numberInput(e){
......
...@@ -44,7 +44,9 @@ page{ ...@@ -44,7 +44,9 @@ page{
font-size: 30rpx; font-size: 30rpx;
color:#545454; color:#545454;
font-weight: bold; font-weight: bold;
padding-top: 43rpx; /* padding-top: 43rpx; */
line-height: 1.4;
padding: 43rpx 30rpx 0;
} }
.header-box .plan-box{ .header-box .plan-box{
display: flex; display: flex;
......
...@@ -9,6 +9,11 @@ import { ...@@ -9,6 +9,11 @@ import {
schoolList, schoolList,
loginTime loginTime
} from '../../../service/business/ucenter.js'; } from '../../../service/business/ucenter.js';
import {
getClassInfo,
studentSchoolList,
historySchoolList
} from '../../../service/customer/schoolindex.js';
import { import {
LocalStorage, LocalStorage,
} from '../../../utilities/index.js'; } from '../../../utilities/index.js';
...@@ -25,44 +30,111 @@ Page({ ...@@ -25,44 +30,111 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tab: 1,
imageRoot: app.globalData.imageRoot, imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/', localImageRoot: '../../../images/',
schoolList: [], schoolList: [],
schoolTotal: 0, schoolTotal: 0,
sid: 0, sid: 0,
nowDate: new Date() nowDate: new Date(),
studentSchoolList: [],
teacherSchoolList: [],
masterSchoolList: [],
historySchoolList: [],
historySchoolTotal: 0,
statusBarHeight: app.globalData.statusBarHeight,
titleBarHeight: app.globalData.titleBarHeight,
hasmore: true,
listLoading: false,
emptyPage: false,
page: 1,
perPage: 10,
currole: 1, // 1从个人中心进入 标记学生身份 2从工作台切换身份 标记老师身份
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
const {sid,from} = options; const {sid,from,currole} = options;
this.setData({ this.setData({
sid: sid || 0, sid: sid || 0,
from: from || 2 from: from || 2,
currole: currole || 1
}) })
console.log(this.data.currole)
let user = LocalStorage.getItem('user'); let user = LocalStorage.getItem('user');
let dakarole = LocalStorage.getItem('dakarole'); let dakarole = LocalStorage.getItem('dakarole');
let that = this; let that = this;
wx.showLoading({ wx.showLoading({
title: '数据加载中' title: '数据加载中'
}) })
this.getStudentSchoolList();
this.getTeacherSchoolList();
this.getMasterSchoolList();
},
tabShift (e) {
const { tab } = e.currentTarget.dataset;
if (this.data.tab == tab) {
return;
}
this.setData({
tab,
})
if (this.data.historySchoolList.length == 0) {
this.getHistorySchoolList('init');
}
},
onPullDownRefresh () {
if (this.data.tab == 2) {
this.setData({
hasmore: true,
listLoading: false,
emptyPage: false,
page: 1,
perPage: 10,
})
this.getHistorySchoolList('down');
} else {
this.getStudentSchoolList();
this.getTeacherSchoolList();
this.getMasterSchoolList();
}
},
onReachBottom() {
if (this.data.tab == 2) {
this.getHistorySchoolList('up');
}
},
getTeacherSchoolList() {
getAccountList({ getAccountList({
page: 1, page: 1,
perPage: 100 perPage: 100,
type: 1,
}).then((res) => { }).then((res) => {
wx.hideLoading(); wx.hideLoading();
if (res.code == 200) { if (res.code == 200) {
wx.stopPullDownRefresh();
this.setData({ this.setData({
schoolList: res.data.list, teacherSchoolList: res.data.list,
schoolTotal: res.data.list.length,
nowDate: res.datetime
}) })
} }
}).catch(() => { }).catch(() => {
})
},
getMasterSchoolList() {
getAccountList({
page: 1,
perPage: 100,
type: 2,
}).then((res) => {
wx.hideLoading(); wx.hideLoading();
if (res.code == 200) {
this.setData({
masterSchoolList: res.data.list,
})
}
}).catch(() => {
}) })
}, },
godeskcenter (e) { godeskcenter (e) {
...@@ -94,13 +166,11 @@ Page({ ...@@ -94,13 +166,11 @@ Page({
url: `/business/pages/classservice/teacherindex?sid=${item.id}`, url: `/business/pages/classservice/teacherindex?sid=${item.id}`,
}) })
} }
loginTime({ loginTime({
id: item.id, id: item.id,
type: 1 type: 1
}) })
}, },
getMemberMeInfo(sid){ getMemberMeInfo(sid){
let that = this; let that = this;
getMemberMe({ getMemberMe({
...@@ -130,5 +200,134 @@ Page({ ...@@ -130,5 +200,134 @@ Page({
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/organizationalmgt/newinfo?school_id=${this.data.sid}&sid=0` url: `/business/pages/organizationalmgt/newinfo?school_id=${this.data.sid}&sid=0`
}) })
},
getStudentSchoolList() {
studentSchoolList({
page: 1,
perPage: 100
}).then((res) => {
wx.hideLoading();
if (res.code == 200) {
this.setData({
studentSchoolList: res.data.list
})
}
}).catch(() => {
wx.hideLoading();
})
},
goback () {
const curPages = getCurrentPages();
if (curPages.length > 1) {
wx.navigateBack();
} else {
wx.reLaunch({
url: '/ucenter/index',
})
}
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
});
return _length;
},
getHistorySchoolList(type) {
if (!this.data.hasmore) {
return;
}
if (this.data.listLoading) {
return;
}
this.setData({
listLoading: true
});
historySchoolList({
page: 1,
perPage: 10
}).then(res => {
const { code, data } = res;
this.setData({
listLoading: false
});
if (code != 200) {
// 失败的处理
} else {
if (data.total) {
this.setData({
historySchoolTotal: data.total
});
}
switch (type) {
case "init": //页面进来第一次加载
this.setData({
historySchoolList: [data.list]
});
if (this.data.historySchoolTotal > this.caculateArrLength(this.data.historySchoolList)) {
this.data.page = this.data.page + 1;
} else {
// 没有更多了
this.setData({
hasmore: false
});
}
break;
case "down": // 页面下拉刷新
this.setData({
historySchoolList: [data.list]
}, () => {
if (this.data.historySchoolTotal > this.caculateArrLength(this.data.historySchoolList)) {
this.data.page = this.data.page + 1;
} else {
// 没有更多了
this.setData({
hasmore: false
});
}
}
);
wx.stopPullDownRefresh();
break;
case "up": // 页面上拉刷新
let list = this.data.historySchoolList;
this.setData(
{
[`historySchoolList[${this.data.page - 1}]`]: data.list
},
() => {
if (
this.data.historySchoolTotal >
this.caculateArrLength(this.data.historySchoolList)
) {
this.data.page = this.data.page + 1;
} else {
// 没有更多了
this.setData({
hasmore: false
});
} }
}
);
break;
default:
break;
}
if (this.caculateArrLength(this.data.historySchoolList) == 0) {
this.setData({
emptyPage: true
});
} else {
this.setData({
emptyPage: false
});
}
}
})
.catch(e => {
this.setData({
listLoading: false
});
});
},
}) })
\ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"expiredTip": "../../components/expiredTip" "expiredTip": "../../components/expiredTip",
"list-loading": "../../../components/listloading",
"empty-content": "../../../components/emptycontent"
}, },
"navigationBarTitleText": "选择校区" "navigationBarTitleText": "选择校区",
"navigationStyle": "custom",
"enablePullDownRefresh": true
} }
\ No newline at end of file
<!--business/pages/exchangebusiness/index.wxml--> <!--business/pages/exchangebusiness/index.wxml-->
<wxs src="../../../filter/index.wxs" module="filter" /> <wxs src="../../../filter/index.wxs" module="filter" />
<view class="container"> <view class="container" style="padding-top: {{statusBarHeight + titleBarHeight}}px;">
<view class="exchangebusiness-container clearfix"> <view class="headerbox" hover-class="none" hover-stop-propagation="false" style="padding-top: {{statusBarHeight}}px;">
<view class="content-item" wx:for="{{schoolList}}" wx:key="index" > <view class="tabsboxwrap" style="height: {{titleBarHeight}}px;">
<view bindtap='godeskcenter' data-item="{{item}}"> <view class="backbtnbox" style="height: {{titleBarHeight}}px;" hover-class="none" hover-stop-propagation="false" bindtap="goback">
<view class="title"> <image class="backbtn" src="{{imageRoot}}2b/common/arrowblack.png?{{imageVersion}}" />
<view class="title-text">{{item.title}}</view>
<view class="title-flag1 " wx:if="{{item.school_teacher.type==2}}">管理员身份</view>
<view class="title-flag2 " wx:if="{{item.school_teacher.type==1}}">老师身份</view>
</view> </view>
<view class="time" wx:if="{{item.school_teacher.last_login_time}}">上次登录时间:{{item.school_teacher.last_login_time}}</view> <view class="tabsbox" style="top: {{statusBarHeight}}px;">
<view class="deadline-time" wx:if="{{!item.expire_time}}">终身包</view> <view class="tabitem {{tab==1 ? 'active' : ''}}" data-tab="1" bindtap="tabShift">
<view class="deadline-time" wx:if="{{item.expire_time && filter.dateTimeCompare(nowDate,item.expire_time)}}"> 身份切换
<image class="icon" src="{{imageRoot}}2b/common/exprie-time.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
{{item.trial_status == 2 ? '账号' :'试用'}}已到期
</view> </view>
<view class="deadline-time" wx:if="{{item.expire_time && !filter.dateTimeCompare(nowDate,item.expire_time)}}"> <view class="tabitem {{tab==2 ? 'active' : ''}}" data-tab="2" bindtap="" bindtap="tabShift">
<image class="icon" src="{{imageRoot}}2b/common/ex-clock.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /> 历史访问
账号到期时间:{{ filter.matchTime(item.expire_time ,'year')}}
</view> </view>
</view> </view>
</view> </view>
<view class="add-school" bindtap="goShopedit"><image class="" src="{{imageRoot}}2b/organizationalmgt/icon_add.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />创建新校区</view>
</view> </view>
<view class="footer"> <view class="usedesc">{{tab==1 ? '轻触头像以切换身份' : '轻触头像进入'}}</view>
<view class="left" bindtap="go2cindex">切换到学员界面</view> <block wx:if="{{tab==1}}">
<view class="right" bindtap="goLogin">退出当前账号</view> <view class="boxwrap" wx:if="{{masterSchoolList.length > 0}}">
<view class="sortname">
校长
</view> </view>
<view class="rolebox" wx:for="{{masterSchoolList}}" wx:key="id" wx:for-item="masterschool" bindtap='godeskcenter' data-item="{{masterschool}}">
<view class="leftbox">
<image class="schoolavatar" src="{{filter.imagify(masterschool.school_teacher.avatar)}}" />
<view class="schoolname {{currole == 2 && sid == masterschool.id ? 'short' : ''}}">{{masterschool.title}}</view>
</view>
<view class="currenttag" wx:if="{{currole == 2 && sid == masterschool.id}}">您当前身份</view>
</view>
</view>
<view class="boxwrap" wx:if="{{teacherSchoolList.length > 0}}">
<view class="sortname">
老师
</view>
<view class="rolebox" wx:for="{{teacherSchoolList}}" wx:key="id" wx:for-item="teacherschool" bindtap='godeskcenter' data-item="{{teacherschool}}">
<view class="leftbox">
<image class="schoolavatar" src="{{filter.imagify(teacherschool.school_teacher.avatar)}}" />
<view class="schoolname {{currole == 2 && sid == teacherschool.id ? 'short' : ''}}">{{teacherschool.title}}</view>
</view>
<view class="currenttag" wx:if="{{currole == 2 && sid == teacherschool.id}}">您当前身份</view>
</view>
</view>
<view class="boxwrap studentbox" wx:if="{{studentSchoolList.length > 0}}">
<view class="sortname">
学生
</view>
<view class="rolebox" wx:for="{{studentSchoolList}}" wx:key="id" wx:for-item="studentschool">
<view class="leftbox">
<image class="schoolavatar" src="{{filter.imagify(studentschool.avatar)}}" />
<view class="schoolname {{currole == 1 && sid == studentschool.school_id ? 'short' : ''}}">
<view class="schoolnametext">
{{studentschool.school.title}}
</view>
<view class="studentname">
{{studentschool.nickname}}
</view>
</view>
</view>
<view class="currenttag" wx:if="{{currole == 1 && sid == studentschool.school_id}}">您当前身份</view>
<!-- <view class="currenttag">您当前身份</view> -->
</view>
</view>
<view class="boxwrap operatebox" bindtap="goLogin">
<view class="operateiconbox">
<image class="operateicon shiftaccount" src="{{imageRoot}}2b/common/exchange2.png"></image>
</view>
<view class="operatename">切换其他账号</view>
</view>
<view class="boxwrap operatebox" bindtap="goShopedit">
<view class="operateiconbox">
<image class="operateicon addschool" src="{{imageRoot}}2b/common/add.png"></image>
</view>
<view class="operatename">创建新校区</view>
</view>
</block>
<block wx:if="{{tab==2}}">
<block wx:if="{{!emptyPage}}">
<block wx:if="{{historySchoolList.length > 0}}" wx:for="{{historySchoolList}}" wx:key="index" wx:for-item="historyschool">
<view class="boxwrap studentbox" wx:if="{{historySchoolList.length > 0}}" wx:for="{{historyschool}}" wx:key="id">
<view class="leftbox">
<image class="schoolavatar" wx:if="{{item.logo}}" src="{{filter.imagify(item.logo)}}" />
<image class="schoolavatar" wx:else src="{{imageRoot}}2c/common/logologo.png?{{imageVersion}}"></image>
<view class="schoolname">
<view class="schoolnametext">
{{item.title}}
</view>
<view class="studentname">
最后访问:{{item.last_visited_at}}
</view>
</view>
</view>
</view>
</block>
<list-loading loading="{{listLoading}}"></list-loading>
</block>
<view wx:else>
<empty-content></empty-content>
</view>
</block>
<expiredTip changebusiness="{{1}}"/> <expiredTip changebusiness="{{1}}"/>
</view> </view>
\ No newline at end of file
/* business/pages/exchangebusiness/index.wxss */ /* business/pages/exchangebusiness/index.wxss */
page{
background:#f5f5f5;
}
.container{ .container{
background:#f5f5f5;
padding-bottom: 100rpx; padding-bottom: 100rpx;
min-height: 100vh;
} }
.exchangebusiness-container{ .headerbox {
padding: 35rpx 24rpx; position: fixed;
width: 100%;
z-index: 2;
top: 0;
left: 0;
background-color: #fff;
} }
.exchangebusiness-container .content-item{ .tabsboxwrap {
width:100%; display: flex;
height:auto; align-items: center;
background:rgba(255,255,255,1); justify-content: center;
border-radius:20rpx;
margin-bottom: 24rpx;
padding: 32rpx 37rpx ;
position: relative; position: relative;
} }
.exchangebusiness-container .content-item .title{ .backbtnbox {
padding-bottom: 22rpx; position: absolute;
left: 26rpx;
top: 0;
display: flex; display: flex;
justify-content: space-between; align-items: center;
justify-content: center;
} }
.exchangebusiness-container .content-item .title .title-text { .backbtnbox .backbtn {
font-size:26rpx; width: 24rpx;
font-family:PingFang SC; height: 14rpx;
font-weight:bold; transform: rotate(-90deg);
color:rgba(0,0,0,1);
line-height: 36rpx;
width: 410rpx;
word-break: break-all;
} }
.exchangebusiness-container .content-item .title .title-flag1{ .tabsbox {
width:127rpx; width: 350rpx;
height:43rpx; margin: 0 auto;
background:rgba(101,184,244,0.05);
border:1px solid rgba(101,184,244,1);
border-radius:10rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(101,184,244,1);
line-height:1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; border: 1px solid rgba(53,186,253,1);
border-radius: 6rpx;
overflow: hidden;
} }
.exchangebusiness-container .content-item .title .title-flag2{ .tabsbox .tabitem {
width:127rpx; width: 175rpx;
height:43rpx; height: 64rpx;
background:rgba(255,185,122,0.05);
border:1px solid rgba(255,185,122,1);
border-radius:10rpx;
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,159,73,1);
line-height:1;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} background-color: #fff;
.exchangebusiness-container .content-item .time{ color: #35BAFD;
font-size: 26rpx;
}
.tabsbox .tabitem.active {
color: #FFFFFF;
background-color: #35BAFD;
}
.usedesc {
color: #666666;
font-size: 26rpx;
text-align: center;
line-height: 1; line-height: 1;
font-size:24rpx; padding: 30rpx 0;
font-family:PingFang SC; }
font-weight:400; .boxwrap {
color:rgba(88,88,88,1); background-color: #fff;
padding-bottom: 56rpx; width: 702rpx;
margin: 0 auto 20rpx;
border-radius: 20rpx;
padding: 24rpx;
}
.boxwrap .sortname {
color: 32rpx;
color: #222222;
font-weight: 600;
line-height: 1;
margin-bottom: 20rpx;
} }
.exchangebusiness-container .content-item .deadline-time{ .boxwrap .rolebox {
background-color: #F7F7F7;
border-radius: 20rpx;
padding: 21rpx 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
font-size:24rpx; justify-content: space-between;
font-family:PingFang SC; margin-bottom: 20rpx;
font-weight:400;
color:rgba(159,159,159,1);
line-height: 1;
} }
.exchangebusiness-container .content-item .deadline-time .icon{ .boxwrap .rolebox:last-child{
width:29rpx; margin-bottom: 0;
height:29rpx;
margin-right: 14rpx;
border-radius: 50%;
} }
.add-school{ .boxwrap .leftbox{
width:100%;
height:180rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(151,151,151,1);
}
.add-school image{
width: 40rpx;
height: 40rpx;
margin-right: 18rpx;
}
.footer{
width:100%;
height:100rpx;
background:rgba(255,255,255,1);
display: flex;
position: fixed;
left: 0;
bottom: 0;
z-index: 9;
} }
.footer .left{ .boxwrap .leftbox .schoolavatar{
flex: 1; width: 88rpx;
height: 88rpx;
border-radius: 50%;
display: block;
margin-right: 16rpx;
}
.boxwrap .leftbox .schoolname{
width: 500rpx;
word-break: break-all;
color: #222222;
font-size: 26rpx;
}
.boxwrap .leftbox .schoolname.short{
width: 350rpx;
}
.boxwrap .currenttag {
background-color: #35BAFD;
color: #fff;
width: 138rpx;
height: 36rpx;
font-size: 22rpx;
text-align: center;
line-height: 36rpx;
border-radius: 6rpx;
}
.boxwrap .rolebox:last-child {
margin-bottom: 0;
}
.boxwrap.operatebox {
padding-top: 27rpx;
padding-bottom: 27rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; }
font-size:28rpx; .boxwrap.operatebox .operateiconbox {
font-family:PingFang SC; width: 34rpx;
font-weight:400; height: 34rpx;
color:rgba(72,68,68,1);
border-right: 1px solid rgba(0,0,0,.05);
}
.footer .right{
flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 16rpx;
}
.boxwrap.operatebox .operatename {
color: #666666;
font-size: 26rpx;
}
.boxwrap.operatebox .operateiconbox .shiftaccount {
width: 26rpx;
height: 30rpx;
}
.boxwrap.operatebox .operateiconbox .addschool {
width: 34rpx;
height: 34rpx;
}
.boxwrap.studentbox .rolebox .leftbox .schoolname{
width: 500rpx;
height: 88rpx;
display: flex;
justify-content: center; justify-content: center;
font-size:28rpx; flex-direction: column;
font-family:PingFang SC; }
font-weight:400; .boxwrap.studentbox .rolebox .leftbox .schoolname.short {
color:rgba(255,73,73,1); width: 350rpx;
}
.boxwrap.studentbox .leftbox .schoolname .schoolnametext {
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.boxwrap.studentbox .leftbox .schoolname .studentname {
color: #999999;
font-size: 22rpx;
padding-top: 8rpx;
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</view> </view>
</view> </view>
<view class="footer-box"> <view class="footer-box">
<view class="btn" bindtap="toPostFeedback"><image class="icon" src="{{imageRoot}}2b/helpcenter/adviceicon.png?{{imageVersion}}"/>建议反馈</view> <!-- <view class="btn" bindtap="toPostFeedback"><image class="icon" src="{{imageRoot}}2b/helpcenter/adviceicon.png?{{imageVersion}}"/>建议反馈</view> -->
<view class="btn"><image class="icon" src="{{imageRoot}}2b/helpcenter/wechaticon.png?{{imageVersion}}"/>在线咨询 <view class="btn"><image class="icon" src="{{imageRoot}}2b/helpcenter/wechaticon.png?{{imageVersion}}"/>在线咨询
<button class="contact" open-type="contact"></button> <button class="contact" open-type="contact"></button>
</view> </view>
......
...@@ -39,6 +39,7 @@ Page({ ...@@ -39,6 +39,7 @@ Page({
feedbackAppId: 'wx8abaf00ee8c3202e', feedbackAppId: 'wx8abaf00ee8c3202e',
allSubject:[], allSubject:[],
waitJob: 0, waitJob: 0,
type: 1,
extraData: { extraData: {
id : "65621", id : "65621",
customData : { customData : {
...@@ -102,6 +103,7 @@ Page({ ...@@ -102,6 +103,7 @@ Page({
this.setData({ this.setData({
nickName: data.schoolTeacher.nickname ? data.schoolTeacher.nickname : visitor && visitor.userInfo && visitor.userInfo.nickName, nickName: data.schoolTeacher.nickname ? data.schoolTeacher.nickname : visitor && visitor.userInfo && visitor.userInfo.nickName,
avatarUrl: data.schoolTeacher.avatar ? data.schoolTeacher.avatar : visitor && visitor.userInfo && visitor.userInfo.avatarUrl, avatarUrl: data.schoolTeacher.avatar ? data.schoolTeacher.avatar : visitor && visitor.userInfo && visitor.userInfo.avatarUrl,
type: data.schoolTeacher.type
}) })
}else{ }else{
this.setData({ this.setData({
...@@ -111,7 +113,11 @@ Page({ ...@@ -111,7 +113,11 @@ Page({
} }
}) })
}, },
exchangeBusinessSchool() {
wx.reLaunch({
url: `/business/pages/exchangebusiness/index?from=2&sid=${this.data.sid}&currole=2`
})
},
schoolDetailGet(){ schoolDetailGet(){
schoolDetailGet({ schoolDetailGet({
id: this.data.sid id: this.data.sid
...@@ -194,6 +200,11 @@ Page({ ...@@ -194,6 +200,11 @@ Page({
}) })
this.log('gotodotasks'); this.log('gotodotasks');
}, },
goAdvice() {
wx.navigateTo({
url: `/business/pages/helpcenter/feedbacksubmit?sid=${this.data.sid}`
})
},
log(btnName){ log(btnName){
const { const {
originParams, originParams,
......
...@@ -5,57 +5,57 @@ ...@@ -5,57 +5,57 @@
<view class="header-box"> <view class="header-box">
<view class="top-box" bindtap="gobusinessinfo"> <view class="top-box" bindtap="gobusinessinfo">
<view class="logo-box"> <view class="logo-box">
<image class="organizational-logo" wx:if="{{schoolInfo.logo}}" src="{{filter.imagify(schoolInfo.logo, 'image/resize,w_640/format,jpg/quality,q_50')}}"></image> <image class="organizational-logo" wx:if="{{avatarUrl}}" src="{{filter.imagify(avatarUrl, 'image/resize,w_320/format,jpg/quality,q_50')}}"></image>
<image class="organizational-logo" wx:else src="{{imageRoot}}2c/common/logologo.png?{{imageVersion}}"></image> <image class="organizational-logo" wx:else src="{{imageRoot}}2c/common/logologo.png?{{imageVersion}}"></image>
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="name">{{schoolInfo && schoolInfo.title}}</view> <view class="name">{{nickName}}</view>
<view class="list-box"> <view class="roletag" wx:if="{{type == 1}}">老师</view>
<view class="item" wx:for="{{schoolInfo.categoryName}}" wx:key="index">{{item.name}} <view class="roletag" wx:if="{{type == 2}}">校长</view>
{{ index+1 == schoolInfo.categoryName.length? '' : '|'}} </view>
</view>
</view> </view>
<view class="right"> <view class="right">
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
<view class="nick-name"> <view class="nick-name">
<image class="icon" src="{{filter.imagify(avatarUrl, 'image/resize,w_640/format,jpg/quality,q_50')}}"></image> <view class="schoolname">{{schoolInfo.title}}</view>
{{nickName}} <view class="rolechangebox" bindtap="exchangeBusinessSchool">
<view class="rolechange">身份切换</view>
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/exchange2.png?{{imageVersion}}"></image>
</view>
</view> </view>
</view> </view>
<view class="line-box"> <view class="line-box">
<view class="line" bindtap="gotodotasks"> <view class="line" bindtap="gotodotasks">
<view class="left"> <view class="left">
<image class="icon message-icon" src="{{imageRoot}}2b/classservice/message-icon.png?{{imageVersion}}"/>消息 <image class="icon" src="{{imageRoot}}2b/organizationalmgt/message.png?{{imageVersion}}"/>消息
</view> </view>
<view class="right"> <view class="right">
<view class="red-dot" wx:if="{{waitJob>0}}">{{waitJob}}</view> <view class="red-dot" wx:if="{{waitJob>0}}"></view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
<view class="line" bindtap="goPcwebsite"> <view class="line" bindtap="goHelpcenter">
<view class="left"> <view class="left">
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/pc-icon.png?{{imageVersion}}"/>登录PC管理 <image class="icon" src="{{imageRoot}}2b/organizationalmgt/help.png?{{imageVersion}}" />帮助中心
</view> </view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
<!-- <navigator class="line" target="miniProgram" open-type="navigate" app-id="{{feedbackAppId}}" <view class="line" bindtap="goAdvice">
extra-data="{{ extraData }}" version="release">
<view class="left"> <view class="left">
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/answer-icon.png?{{imageVersion}}"/>问题反馈 <image class="icon" src="{{imageRoot}}2b/organizationalmgt/advice.png?{{imageVersion}}" />建议反馈
</view> </view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</navigator> --> </view>
<view class="line" bindtap="goSetting"> <view class="line" bindtap="goSetting">
<view class="left"> <view class="left">
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/set-icon.png?{{imageVersion}}" />设置 <image class="icon" src="{{imageRoot}}2b/organizationalmgt/setting.png?{{imageVersion}}" />设置
</view> </view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
<view class="line" bindtap="goHelpcenter"> <view class="line" bindtap="goPcwebsite">
<view class="left"> <view class="left">
<image class="icon" src="{{imageRoot}}2b/organizationalmgt/helpcenter.png?{{imageVersion}}" />意见反馈 <image class="icon" src="{{imageRoot}}2b/organizationalmgt/pc.png?{{imageVersion}}"/>登录电脑端管理
</view> </view>
<image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="right-icon" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
......
...@@ -44,6 +44,17 @@ page{ ...@@ -44,6 +44,17 @@ page{
.header-box .top-box .info-box{ .header-box .top-box .info-box{
flex: 1; flex: 1;
} }
.header-box .top-box .info-box .roletag {
line-height: 36rpx;
background: rgba(234,248,255,1);
border-radius: 6rpx;
border: 1px solid rgba(53,186,253,1);
color: #35BAFD;
font-size: 22rpx;
text-align: center;
display: inline-block;
padding: 0 7rpx;
}
.header-box .top-box .info-box .name{ .header-box .top-box .info-box .name{
font-size:28rpx; font-size:28rpx;
font-family:PingFang SC; font-family:PingFang SC;
...@@ -83,10 +94,28 @@ page{ ...@@ -83,10 +94,28 @@ page{
padding-top: 25rpx; padding-top: 25rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
}
.header-box .nick-name .schoolname {
color: #666666;
font-size: 22rpx;
max-width: 450rpx;
line-height: 1.5;
word-break: break-all;
}
.header-box .nick-name .rolechangebox {
display: flex;
align-items: center;
justify-content: space-between;
}
.header-box .nick-name .rolechangebox .rolechange {
color: #666666;
font-size: 22rpx;
padding-right: 14rpx;
} }
.header-box .nick-name .icon{ .header-box .nick-name .icon{
width: 34rpx; width: 24rpx;
height: 34rpx; height: 24rpx;
margin-right: 14rpx; margin-right: 14rpx;
border-radius: 50%; border-radius: 50%;
} }
...@@ -126,17 +155,18 @@ page{ ...@@ -126,17 +155,18 @@ page{
align-items: center; align-items: center;
} }
.line-box .line .right .red-dot{ .line-box .line .right .red-dot{
padding: 0 7rpx; /* padding: 0 7rpx; */
font-size: 20rpx; /* font-size: 20rpx; */
color: #fff; color: #fff;
background:#FF3030; background:#FF3030;
border-radius: 18rpx; border-radius: 50%;
margin-right: 27rpx; margin-right: 14rpx;
height: 36rpx; height: 14rpx;
min-width: 36rpx; width: 14rpx;
display: flex; /* min-width: 36rpx; */
/* display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center; */
} }
.line-box .line .right-icon{ .line-box .line .right-icon{
width:11rpx; width:11rpx;
......
import { import {
LocalStorage schoolDetailGet,
} from '../../../service/business/common.js';
import {
LocalStorage,
} from '../../../utilities/index.js'; } from '../../../utilities/index.js';
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -11,6 +14,7 @@ Page({ ...@@ -11,6 +14,7 @@ Page({
imageRoot: app.globalData.imageRoot, imageRoot: app.globalData.imageRoot,
localImageRoot: '../../../images/', localImageRoot: '../../../images/',
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
schoolInfo: {}
}, },
onLoad: function (options) { onLoad: function (options) {
let that = this; let that = this;
...@@ -18,28 +22,40 @@ Page({ ...@@ -18,28 +22,40 @@ Page({
that.setData({ that.setData({
sid sid
}) })
this.schoolDetailGet();
}, },
onShow: function () { onShow: function () {
},
schoolDetailGet(){
schoolDetailGet({
id: this.data.sid
}).then((res) => {
const {code, data} = res;
if(code == 200){
this.setData({
schoolInfo: data,
})
}
})
}, },
// 账号安全 // 账号安全
goAccountSecurity(){ goAccountSecurity(){
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/organizationalmgt/accountsecurity?sid=${this.data.sid}` url: `/business/pages/loginregistermgt/findpsd?sid=${this.data.sid}&from=${this.data.from}`
})
},
// 关于我们
aboutUs(){
wx.showModal({
title: '提示',
content: '哪来的关于我们',
showCancel: false,
confirmColor:'#16B0FD'
}) })
}, },
// 退出登录 // // 关于我们
// aboutUs(){
// wx.showModal({
// title: '提示',
// content: '哪来的关于我们',
// showCancel: false,
// confirmColor:'#16B0FD'
// })
// },
// // 退出登录
exitBusiness(){ exitBusiness(){
LocalStorage.removeItem('user'); LocalStorage.removeItem('user');
LocalStorage.removeItem('dakarole'); LocalStorage.removeItem('dakarole');
...@@ -49,10 +65,13 @@ Page({ ...@@ -49,10 +65,13 @@ Page({
url: '/business/pages/loginregistermgt/login' url: '/business/pages/loginregistermgt/login'
}) })
}, },
exchangeBusiness(){ // exchangeBusiness(){
wx.navigateTo({ // wx.navigateTo({
// url: `/business/pages/organizationalmgt/exchangebusiness?sid=${this.data.sid}` // // url: `/business/pages/organizationalmgt/exchangebusiness?sid=${this.data.sid}`
url: `/business/pages/exchangebusiness/index?from=2` // url: `/business/pages/exchangebusiness/index?from=2`
}) // })
// },
goRecharge () {
console.log('充值');
} }
}) })
\ No newline at end of file
<view class="container"> <view class="container">
<view class="box"> <view class="box">
<view class="line-item" bindtap='goRecharge'>
<view class="item-label">套餐续费</view>
<view class="right">
<view class="expiretime">{{schoolInfo.expire_time}}到期</view>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="line-item" bindtap='goAccountSecurity'> <view class="line-item" bindtap='goAccountSecurity'>
<view class="item-label">账号安全</view> <view class="item-label">修改密码</view>
<view class="right"> <view class="right">
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
...@@ -13,6 +20,6 @@ ...@@ -13,6 +20,6 @@
</view> </view>
</view> --> </view> -->
</view> </view>
<view class="opt-item" bindtap="exchangeBusiness">切换机构校区</view> <!-- <view class="opt-item" bindtap="exchangeBusiness">切换机构校区</view> -->
<view class="opt-item opt-item-red" bindtap="exitBusiness">退出登录</view> <view class="opt-item opt-item-red" bindtap="exitBusiness">退出登录</view>
</view> </view>
page{
background: #F7F7F9;
}
.container{ .container{
background: #F7F7F9;
min-height: 100vh;
} }
.box{ .box{
background: #fff; background: #fff;
...@@ -42,6 +40,10 @@ page{ ...@@ -42,6 +40,10 @@ page{
height: 20rpx; height: 20rpx;
margin-left: 20rpx; margin-left: 20rpx;
} }
.line-item .right .expiretime {
color: #FF3520;
font-size: 22rpx;
}
.opt-item{ .opt-item{
width: 100%; width: 100%;
height: 100rpx; height: 100rpx;
...@@ -51,11 +53,15 @@ page{ ...@@ -51,11 +53,15 @@ page{
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #000; color: #000;
margin-top: 20rpx; /* margin-top: 20rpx; */
position: relative; position: absolute;
left: 0;
bottom: 0;
} }
.opt-item-red{ .opt-item-red{
color: #FF4949; color: #FF3520;
font-size: 26rpx;
font-weight: 600;
} }
.box::before,.opt-item::before{ .box::before,.opt-item::before{
content: ''; content: '';
......
...@@ -170,8 +170,10 @@ const apis = { ...@@ -170,8 +170,10 @@ const apis = {
}, },
schoolindex: { schoolindex: {
classindex: `${api}student/class/index`, classindex: `${api}student/class/index`,
studentSchoolList: `${api}student/all/students`,
schoolClassList: `${api}student/class/class_list`, schoolClassList: `${api}student/class/class_list`,
schooldetail: `${api}student/school/detail` schooldetail: `${api}student/school/detail`,
historySchoolList: `${api}student/history/schools`
}, },
growthRecord: { growthRecord: {
customerClass: `${api}student/class/grow_class_list`, customerClass: `${api}student/class/grow_class_list`,
......
export default { export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/', imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/dakav2/images/',
host: 'https://qxapi.qingxiao.online/daka', // host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn', // host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '5.0', storageVersion: '5.0',
imageVersion: '20200326', imageVersion: '20200408',
// host: 'https://clock.wp53.cn', host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn', host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785', appId: 'wxc1246ea029394785',
miniProgram: { miniProgram: {
clock: 'wxdeee20e52a1fd7ee' clock: 'wxdeee20e52a1fd7ee'
......
...@@ -35,9 +35,28 @@ function getSchoolDetail(data) { ...@@ -35,9 +35,28 @@ function getSchoolDetail(data) {
errorresolve: 1, errorresolve: 1,
}) })
} }
function studentSchoolList(data) {
return wxRequest({
url: apis.customer.schoolindex.studentSchoolList,
data,
method: 'GET',
errorresolve: 1,
})
}
function historySchoolList(data) {
return wxRequest({
url: apis.customer.schoolindex.historySchoolList,
data,
method: 'GET',
errorresolve: 1,
})
}
export { export {
getClassInfo, getClassInfo,
getSchoolClassList, getSchoolClassList,
getSchoolDetail, getSchoolDetail,
CgetClassInfo CgetClassInfo,
studentSchoolList,
historySchoolList
} }
\ No newline at end of file
...@@ -257,7 +257,7 @@ Page({ ...@@ -257,7 +257,7 @@ Page({
if (code == 200) { if (code == 200) {
if (data.list.length > 0) { if (data.list.length > 0) {
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/exchangebusiness/index?from=1` url: `/business/pages/exchangebusiness/index?from=1&sid=${this.data.sid}&currole=1`
}); });
} else { } else {
wx.navigateTo({ wx.navigateTo({
...@@ -330,7 +330,7 @@ Page({ ...@@ -330,7 +330,7 @@ Page({
let user = LocalStorage.getItem("user"); let user = LocalStorage.getItem("user");
if(this.data.loginStatus==1){ if(this.data.loginStatus==1){
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/exchangebusiness/index?from=1` url: `/business/pages/exchangebusiness/index?from=1&sid=${this.data.sid}&currole=1`
}) })
return return
} }
...@@ -373,7 +373,7 @@ Page({ ...@@ -373,7 +373,7 @@ Page({
if (code == 200) { if (code == 200) {
if (data.list.length > 0) { if (data.list.length > 0) {
wx.navigateTo({ wx.navigateTo({
url: `/business/pages/exchangebusiness/index?from=1` url: `/business/pages/exchangebusiness/index?from=1&currole=1&sid=${this.data.sid}`
}); });
} else { } else {
wx.navigateTo({ wx.navigateTo({
...@@ -428,7 +428,7 @@ Page({ ...@@ -428,7 +428,7 @@ Page({
exchangeSchool() { exchangeSchool() {
this.log("exchangeSchool"); this.log("exchangeSchool");
wx.navigateTo({ wx.navigateTo({
url: `/src/pages/exchangebusiness/index?from=2&sid=${this.data.sid}` url: `/src/pages/exchangebusiness/index?from=2&sid=${this.data.sid}&currole=1`
}); });
}, },
goMyInfluence() { goMyInfluence() {
......
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