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
5dbe6a87
Commit
5dbe6a87
authored
Jun 19, 2019
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
''
parent
464b4e88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
index.js
business/pages/rolechange/index.js
+0
-2
index.js
components/sjdbottombar/index.js
+35
-2
No files found.
business/pages/rolechange/index.js
View file @
5dbe6a87
...
...
@@ -155,9 +155,7 @@ Page({
url
:
`/business/pages/organizationalmgt/index?sid=
${
res
.
data
.
data
.
list
[
0
].
id
}
`
})
LocalStorage
.
setItem
(
'teacher'
,
{
// expires_in: data.expires_in,
token
:
visitor
&&
visitor
.
token
,
// mobile,
role
:
2
// 1是校长 2是老师
});
LocalStorage
.
setItem
(
'dakarole'
,
2
);
...
...
components/sjdbottombar/index.js
View file @
5dbe6a87
...
...
@@ -25,11 +25,44 @@ Component({
methods
:
{
goUserBusiness
()
{
const
visitor
=
LocalStorage
.
getItem
(
'visitor'
);
console
.
log
(
visitor
,
'visitor'
)
getMemberId
({
open_id
:
visitor
.
openid
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
if
(
data
.
member_id
)
{
// 查询到该微信有机构的情况
LocalStorage
.
setItem
(
'user'
,
{
token
:
`bearer
${
data
.
token
}
`
,
mobile
:
data
.
mobile
})
LocalStorage
.
setItem
(
'dakarole'
,
1
);
if
(
data
.
member
.
length
>
0
)
{
// 有机构的情况下 跳转到当前机构
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/index?sid=
${
data
.
member
[
0
].
id
}
`
})
}
else
{
// 没有机构的情况下 跳转到新建机构页面
wx
.
navigateTo
({
url
:
'/business/pages/shopeditor/index?from=1'
})
}
}
else
{
// // 查询到该微信没有机构的情况
if
(
data
.
teacher
.
length
>
0
)
{
// 查询到该微信有老师的情况下 跳转到老师的机构管理页面
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/index?sid=
${
data
.
teacher
[
0
].
id
}
`
})
LocalStorage
.
setItem
(
'teacher'
,
{
token
:
visitor
&&
visitor
.
token
,
role
:
2
// 1是校长 2是老师
});
LocalStorage
.
setItem
(
'dakarole'
,
2
);
}
else
{
// 查询到该微信没有老师的情况下 跳转到登录页面
wx
.
navigateTo
({
url
:
'/business/pages/login/index'
})
}
}
}
})
console
.
log
(
'ssssssssssssssss'
);
}
}
})
\ No newline at end of file
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