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
631b0364
Commit
631b0364
authored
Apr 02, 2020
by
lvtz
Browse files
Options
Browse Files
Download
Plain Diff
fix
parents
d7b0db58
f9329669
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
95 deletions
+125
-95
index.js
ucenter/index.js
+94
-77
index.js
wechatinfoget/index.js
+31
-18
No files found.
ucenter/index.js
View file @
631b0364
...
...
@@ -5,6 +5,9 @@ author: wxl
import
{
LocalStorage
}
from
"../utilities/index.js"
;
import
{
wxLogin
}
from
"../utilities/wxApi.js"
;
import
{
schoolList
}
from
"../service/business/ucenter.js"
;
// import {
// getAccountList
// } from '../../../service/common.js';
import
{
identitylist
,
studentidentity
,
...
...
@@ -12,7 +15,7 @@ import {
}
from
"../service/customer/signup.js"
;
import
{
noticecount
}
from
"../service/customer/mynews.js"
;
import
{
commonwaitjobGet
}
from
"../service/business/common.js"
;
import
{
bTokenExchange
,
authLogin
}
from
"../service/common.js"
;
import
{
bTokenExchange
,
authLogin
,
getAccountList
}
from
"../service/common.js"
;
import
{
getActivities
,
activityLog
,
getMember
}
from
"../service/common.js"
;
import
{
getClassInfo
}
from
"../service/customer/schoolindex.js"
;
import
{
behaviorLog
}
from
"../service/customer/staticlog.js"
;
...
...
@@ -69,7 +72,6 @@ Page({
loginStatus
:
1
,
//已登录
})
}
console
.
log
(
user
,
'登录信息'
)
this
.
setData
({
sid
:
sid
||
0
,
...
...
@@ -119,6 +121,12 @@ Page({
});
},
onShow
:
function
()
{
const
user
=
LocalStorage
.
getItem
(
"user"
);
if
(
user
&&
user
.
token
){
this
.
setData
({
loginStatus
:
1
,
//已登录
})
}
if
(
this
.
data
.
sid
!=
0
)
{
this
.
userShow
();
}
...
...
@@ -241,48 +249,73 @@ Page({
let
user
=
LocalStorage
.
getItem
(
"user"
);
let
dakarole
=
LocalStorage
.
getItem
(
"dakarole"
);
if
(
user
&&
user
.
token
)
{
wx
.
navigateTo
({
url
:
`/business/pages/exchangebusiness/index?from=1`
});
return
;
}
getMember
()
.
then
(
res
=>
{
const
{
data
,
code
}
=
res
;
if
(
code
==
40000
)
{
// 没绑定微信或者没有校区
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/newinfo?sid=0&school_id=0`
});
}
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
}
`
});
getAccountList
({
page
:
1
,
perPage
:
100
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
if
(
data
.
list
.
length
>
0
)
{
wx
.
navigateTo
({
url
:
`/business/pages/exchangebusiness/index?from=1`
});
}
else
{
wx
.
navigateTo
({
url
:
`/business/pages/
loginregistermgt/login
`
url
:
`/business/pages/
organizationalmgt/newinfo
`
});
}
}
else
{
wx
.
showToast
({
title
:
"登录失败"
,
duration
:
500
wxLogin
().
then
(
res
=>
{
this
.
setData
({
loginCode
:
res
.
code
});
});
}
})
.
catch
(
err
=>
{
wx
.
navigateTo
({
url
:
`/business/pages/loginregistermgt/login`
}).
catch
((
err
)
=>
{
wxLogin
().
then
(
res
=>
{
this
.
setData
({
loginCode
:
res
.
code
});
});
});
})
return
;
}
// getMember()
// .then(res => {
// const { data, code } = res;
// if (code == 40000) {
// // 没绑定微信或者没有校区
// wx.navigateTo({
// url: `/business/pages/organizationalmgt/newinfo?sid=0&school_id=0`
// });
// } 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/loginregistermgt/login`
// });
// }
// } else {
// wx.showToast({
// title: "登录失败",
// duration: 500
// });
// }
// })
// .catch(err => {
// wx.navigateTo({
// url: `/business/pages/loginregistermgt/login`
// });
// });
},
loginToManagerWaitDel
()
{
wx
.
navigateTo
({
...
...
@@ -295,8 +328,6 @@ Page({
this
.
log
(
"loginToManager"
);
let
visitor
=
LocalStorage
.
getItem
(
"visitor"
)
let
user
=
LocalStorage
.
getItem
(
"user"
);
console
.
log
(
user
,
'user'
);
if
(
this
.
data
.
loginStatus
==
1
){
wx
.
navigateTo
({
url
:
`/business/pages/exchangebusiness/index?from=1`
...
...
@@ -304,17 +335,19 @@ Page({
return
}
const
{
encryptedData
,
iv
}
=
e
.
detail
;
console
.
log
(
that
.
data
.
loginCode
,
iv
,
encryptedData
);
if
(
e
.
detail
.
errMsg
==
"getPhoneNumber:fail user deny"
)
{
//用户点击拒绝
wxLogin
().
then
(
res
=>
{
this
.
setData
({
loginCode
:
res
.
code
});
});
wx
.
showToast
({
title
:
"获取手机号失败"
,
icon
:
"none"
});
}
else
{
//允许授权执行跳转
console
.
log
(
22232322
);
authLogin
({
type
:
5
,
mobile_code
:
that
.
data
.
loginCode
,
...
...
@@ -330,48 +363,39 @@ Page({
LocalStorage
.
setItem
(
"teacher"
,
{
token
:
`bearer
${
data
.
token
}
`
});
getMember
()
.
then
(
res
=>
{
const
{
data
,
code
}
=
res
;
if
(
code
==
200
)
{
// 没绑定微信或者没有校区
getAccountList
({
page
:
1
,
perPage
:
100
}).
then
((
res
)
=>
{
const
{
code
,
data
}
=
res
;
if
(
code
==
200
)
{
if
(
data
.
list
.
length
>
0
)
{
wx
.
navigateTo
({
url
:
`/business/pages/
organizationalmgt/newinfo
`
url
:
`/business/pages/
exchangebusiness/index?from=1
`
});
}
else
if
(
code
==
2000
)
{
this
.
setData
({
loginStatus
:
1
})
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
wx
.
navigateTo
({
url
:
`/business/pages/organizationalmgt/newinfo`
});
}
})
.
catch
(
err
=>
{
}
else
{
wxLogin
().
then
(
res
=>
{
this
.
setData
({
loginCode
:
res
.
code
});
});
}
}).
catch
((
err
)
=>
{
wxLogin
().
then
(
res
=>
{
this
.
setData
({
loginCode
:
res
.
code
});
});
})
}
});
}
},
noticecountGet
()
{
noticecount
({
school_id
:
this
.
data
.
sid
...
...
@@ -385,13 +409,6 @@ Page({
}
});
},
// goMyLikes() {
// wx.navigateTo({
// url: `/src/pages/mylikes/index?sid=${this.data.sid}`,
// })
// },
goMytask
()
{
this
.
log
(
"goMytask"
);
if
(
this
.
data
.
noUserinfo
)
{
...
...
wechatinfoget/index.js
View file @
631b0364
...
...
@@ -69,6 +69,11 @@ Page({
if
(
errMsg
==
'getUserInfo:fail auth deny'
)
{
that
.
setData
({
loading
:
false
})
wx
.
showModal
({
title
:
'提示'
,
content
:
'请确认授权进入轻校通'
,
showCancel
:
false
})
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
return
;
}
that
.
setData
({
loading
:
true
})
...
...
@@ -94,7 +99,6 @@ Page({
LocalStorage
.
setItemSync
(
'visitor'
,
visitor
);
const
query
=
app
.
globalData
.
query
;
if
(
query
&&
query
.
sid
){
console
.
log
(
1212121
)
studentidentity
({
school_id
:
query
.
sid
}).
then
((
res
)
=>
{
...
...
@@ -134,39 +138,48 @@ Page({
that
.
goUrlIndex
()
}
}).
catch
((
err
)
=>
{
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
that
.
goUrlIndex
()
})
}
else
{
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
that
.
goUrlIndex
()
}
}).
catch
(()
=>
{
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
that
.
goUrlIndex
()
})
}
// 授权成功,新版本通知未读 跳转
// if(LocalStorage.getItem('versionNotice') != 1){
// wx.redirectTo({
// url: '/src/pages/versionnotice/index'
// })
// return
// }
// let url = that.urlMath() || '/ucenter/index';
// if (url == '/ucenter/index' || url.indexOf('\/schoolindex\/') != -1) {
// wx.reLaunch({
// url: url,
// })
// } else {
// wx.redirectTo({url: url})
// }
}
else
{
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
wx
.
showModal
({
title
:
'提示'
,
content
:
'授权失败,请重试'
})
}
}).
catch
(()
=>
{
wxLogin
().
then
((
res
)
=>
{
this
.
setData
({
loginCode
:
res
.
code
})
})
that
.
setData
({
loading
:
false
})
})
},
...
...
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