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
a077959f
Commit
a077959f
authored
Mar 24, 2020
by
lvtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
759969be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
100 additions
and
0 deletions
+100
-0
index.js
ucenter/index.js
+77
-0
index.wxml
ucenter/index.wxml
+21
-0
index.wxss
ucenter/index.wxss
+2
-0
No files found.
ucenter/index.js
View file @
a077959f
...
...
@@ -128,6 +128,11 @@ Page({
})
},
onShow
:
function
()
{
// Do something when page show.
this
.
setData
({
storageUser
:
LocalStorage
.
getItem
(
"user"
)
})
console
.
log
(
this
.
data
.
storageUser
,
'user'
)
if
(
this
.
data
.
sid
!=
0
)
{
this
.
userShow
();
}
...
...
@@ -136,6 +141,7 @@ Page({
this
.
setData
({
loginCode
:
res
.
code
})
console
.
log
(
res
,
'red'
)
})
},
onHide
:
function
()
{
// Do something when page hide.
...
...
@@ -285,6 +291,77 @@ Page({
})
})
},
loginToManagerWaitDel
(){
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/newinfo`
})
},
// 新授权
getPhoneNumber
(
e
){
let
that
=
this
;
this
.
log
(
'loginToManager'
)
const
visitor
=
LocalStorage
.
getItem
(
'visitor'
)
||
{};
let
user
=
LocalStorage
.
getItem
(
'user'
);
console
.
log
(
user
,
'user'
)
// if(user && user.token){
// wx.navigateTo({
// url: `/business/pages/exchangebusiness/index?from=1`
// })
// return
// }
const
{
encryptedData
,
iv
}
=
e
.
detail
;
if
(
e
.
detail
.
errMsg
==
'getPhoneNumber:fail user deny'
)
{
//用户点击拒绝
wx
.
showToast
({
title
:
'获取手机号失败'
,
icon
:
'none'
})
}
else
{
//允许授权执行跳转
bTokenExchange
({
type
:
5
,
mobile_code
:
that
.
data
.
loginCode
,
mobile_iv
:
iv
,
mobile_data
:
encryptedData
,
}).
then
(
res
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
){
getMember
().
then
(
res
=>
{
const
{
data
,
code
}
=
res
;
if
(
code
==
40000
){
// 没绑定微信或者没有校区
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/newinfo`
})
}
else
if
(
code
==
200
){
if
(
data
.
member
.
length
+
data
.
teacher
.
length
>
0
){
LocalStorage
.
setItem
(
'user'
,
{
token
:
`bearer
${
data
.
token
}
`
,
})
LocalStorage
.
setItem
(
'teacher'
,
{
token
:
`bearer
${
data
.
token
}
`
,
})
wx
.
navigateTo
({
url
:
`/business/pages/exchangebusiness/index?from=1`
})
}
else
{
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/newinfo`
})
}
}
else
{
wx
.
showToast
({
title
:
'登录失败'
,
duration
:
500
})
}
}).
catch
((
err
)
=>
{
wx
.
navigateTo
({
url
:
`/business/pages/loginregistermgt/login`
})
})
}
})
}
},
noticecountGet
()
{
noticecount
({
...
...
ucenter/index.wxml
View file @
a077959f
...
...
@@ -126,6 +126,27 @@
<text class="title">机构登录</text>
<text class="desc">老师/校长在这里登录</text>
</view>
<view class="menu-item" bindtap="loginToManager" wx:if="{{ storageUser && storageUser.token }}">
<loginbtn loginCode="{{loginCode}}"/>
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image>
<text class="title">新登录</text>
<text class="desc"></text>
</view>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="menu-item" wx:else>
<!-- <loginbtn loginCode="{{loginCode}}"/> -->
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image>
<text class="title">新登录</text>
<text class="desc"></text>
</button>
<view class="menu-item" bindtap="loginToManagerWaitDel">
<loginbtn loginCode="{{loginCode}}"/>
<image class="menuicon" src="{{imageRoot}}2c/ucenter2/icon_tologin.png?{{imageVersion}}"></image>
<text class="title">创建新校区</text>
<text class="desc"></text>
</view>
</view>
<btabbar
...
...
ucenter/index.wxss
View file @
a077959f
...
...
@@ -217,6 +217,8 @@ page{
flex-direction: column;
position: relative;
padding: 27rpx 0;
margin: 0;
background: #fff;
}
.menu-box .menu-item .menuicon {
width: 46rpx;
...
...
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