Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
93a3d0cb
Commit
93a3d0cb
authored
Apr 08, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'切换学生身份'
parent
1870bf28
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
8 deletions
+61
-8
index.js
business/pages/exchangebusiness/index.js
+53
-5
index.wxml
business/pages/exchangebusiness/index.wxml
+2
-2
index.wxml
business/pages/organizationalmgt/index.wxml
+1
-1
index.wxss
business/pages/organizationalmgt/index.wxss
+5
-0
No files found.
business/pages/exchangebusiness/index.js
View file @
93a3d0cb
...
...
@@ -21,6 +21,10 @@ import {
getAccountList
,
getMemberMe
}
from
'../../../service/common.js'
;
import
{
studentidentity
,
identityswitch
,
}
from
"../../../service/customer/signup.js"
;
import
apis
from
'../../../constants/api.js'
;
import
permissionUtils
from
'../../../utilities/permission.js'
;
var
app
=
getApp
();
...
...
@@ -51,6 +55,7 @@ Page({
page
:
1
,
perPage
:
10
,
currole
:
1
,
// 1从个人中心进入 标记学生身份 2从工作台切换身份 标记老师身份
studentId
:
0
,
},
/**
* 生命周期函数--监听页面加载
...
...
@@ -210,6 +215,7 @@ Page({
this
.
setData
({
studentSchoolList
:
res
.
data
.
list
})
this
.
userShow
();
}
}).
catch
(()
=>
{
wx
.
hideLoading
();
...
...
@@ -232,6 +238,22 @@ Page({
});
return
_length
;
},
userShow
()
{
studentidentity
({
school_id
:
this
.
data
.
sid
})
.
then
(
res
=>
{
const
{
data
,
code
}
=
res
;
if
(
code
==
200
&&
data
)
{
this
.
setData
({
studentId
:
data
.
student_id
})
}
else
{
}
})
.
catch
(
err
=>
{
});
},
getHistorySchoolList
(
type
)
{
if
(
!
this
.
data
.
hasmore
)
{
return
;
...
...
@@ -243,8 +265,8 @@ Page({
listLoading
:
true
});
historySchoolList
({
page
:
1
,
perPage
:
10
page
:
this
.
data
.
page
,
perPage
:
this
.
data
.
perPage
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
;
this
.
setData
({
...
...
@@ -333,10 +355,36 @@ Page({
const
{
item
}
=
e
.
currentTarget
.
dataset
;
console
.
log
(
item
)
wx
.
reLaunch
({
url
:
`/ucenter/index?sid=
${
item
.
school_id
}
`
identityswitch
({
school_id
:
item
.
school_id
,
student_id
:
item
.
id
})
.
then
(
res
=>
{
const
{
data
,
code
}
=
res
;
if
(
code
==
200
)
{
const
visitor
=
LocalStorage
.
getItem
(
"visitor"
);
Object
.
assign
(
visitor
,
{
studentId
:
item
.
id
});
LocalStorage
.
setItem
(
"visitor"
,
visitor
);
wx
.
reLaunch
({
url
:
`/ucenter/index?sid=
${
item
.
school_id
}
`
})
}
else
{
wx
.
showToast
({
title
:
"切换失败"
,
icon
:
"none"
,
duration
:
2000
});
}
})
.
catch
(
res
=>
{
wx
.
showToast
({
title
:
"切换失败"
,
icon
:
"none"
,
duration
:
2000
});
});
},
goWebsite
(
e
)
{
const
{
...
...
business/pages/exchangebusiness/index.wxml
View file @
93a3d0cb
...
...
@@ -49,7 +49,7 @@
<view class="rolebox" wx:for="{{studentSchoolList}}" wx:key="id" wx:for-item="studentschool" data-item="{{studentschool}}" bindtap="goUcenter">
<view class="leftbox">
<image class="schoolavatar" src="{{filter.imagify(studentschool.avatar)}}" />
<view class="schoolname {{currole == 1 && sid == studentschool.school_id ? 'short' : ''}}">
<view class="schoolname {{currole == 1 && sid == studentschool.school_id
&& studentId == studentschool.id
? 'short' : ''}}">
<view class="schoolnametext">
{{studentschool.school.title}}
</view>
...
...
@@ -58,7 +58,7 @@
</view>
</view>
</view>
<view class="currenttag" wx:if="{{currole == 1 && sid == studentschool.school_id}}">您当前身份</view>
<view class="currenttag" wx:if="{{currole == 1 && sid == studentschool.school_id
&& studentId == studentschool.id
}}">您当前身份</view>
</view>
</view>
<view class="boxwrap operatebox" bindtap="goLogin">
...
...
business/pages/organizationalmgt/index.wxml
View file @
93a3d0cb
...
...
@@ -10,7 +10,7 @@
</view>
<view class="info-box">
<view class="name">{{nickName}}</view>
<view class="roletag" wx:if="{{type == 1}}">老师</view>
<view class="roletag
{{type == 1 ? 'teacher' : ''}}
" wx:if="{{type == 1}}">老师</view>
<view class="roletag" wx:if="{{type == 2}}">校长</view>
</view>
<view class="right">
...
...
business/pages/organizationalmgt/index.wxss
View file @
93a3d0cb
...
...
@@ -55,6 +55,11 @@ page{
display: inline-block;
padding: 0 7rpx;
}
.header-box .top-box .info-box .roletag.teacher {
color: #FF9F49;
background-color: #FFF2E7;
border: 1px solid rgba(255,159,73,1);
}
.header-box .top-box .info-box .name{
font-size:28rpx;
font-family:PingFang SC;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment