Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 09f900c0
authored
Mar 01, 2024
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'hotfix_SAAS+V4.34.2-0228' into 'develop'
上线合并 See merge request
!51
2 parents
f4099b51
e43d8250
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
39 deletions
login/index/components/Box/Box.js
login/lib/index.js
login/loading/loading.js
pages/tab/mine/mine.js
pages/tab/mine/mine.scss
pages/tab/mine/mine.wxml
login/index/components/Box/Box.js
View file @
09f900c
...
@@ -170,6 +170,8 @@ Component({
...
@@ -170,6 +170,8 @@ Component({
USERAPI
[
target
](
obj
)
USERAPI
[
target
](
obj
)
.
then
(({
code
,
data
,
message
})
=>
{
.
then
(({
code
,
data
,
message
})
=>
{
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
// console.log(code, 'code');
// debugger
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
const
thisPage
=
wx
.
$router
.
getPageInstance
()
const
thisPage
=
wx
.
$router
.
getPageInstance
()
if
(
loginType
==
1
)
checkLoginUserInfo
(
data
)
if
(
loginType
==
1
)
checkLoginUserInfo
(
data
)
...
@@ -202,8 +204,8 @@ Component({
...
@@ -202,8 +204,8 @@ Component({
},
},
/**微信登录 */
/**微信登录 */
wxLogin
({
detail
})
{
wxLogin
({
detail
})
{
console
.
log
(
detail
,
'detail'
);
console
.
log
(
detail
,
'detail'
);
if
(
detail
.
errno
==
104
||!
detail
.
code
)
return
//用户手动拒绝
if
(
detail
.
errno
==
104
||
!
detail
.
code
)
return
//用户手动拒绝
// if (!detail.code) {
// if (!detail.code) {
// // wx.$api.showToast('当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。')
// // wx.$api.showToast('当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。')
// return
// return
...
@@ -237,7 +239,7 @@ Component({
...
@@ -237,7 +239,7 @@ Component({
/**页面初始化 */
/**页面初始化 */
async
init
()
{
async
init
()
{
this
.
setData
({
this
.
setData
({
code
:
3
code
:
3
})
})
network
.
getNetworkType
()
network
.
getNetworkType
()
try
{
try
{
...
@@ -246,7 +248,7 @@ Component({
...
@@ -246,7 +248,7 @@ Component({
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
thisPage
.
setData
({
thisPage
.
setData
({
disabled
:
false
,
disabled
:
false
,
loginToken
:
data
loginToken
:
data
})
})
this
.
loginToken
=
data
this
.
loginToken
=
data
}
else
this
.
reLogin
(
message
)
}
else
this
.
reLogin
(
message
)
...
...
login/lib/index.js
View file @
09f900c
import
{
import
{
setSessionId
,
setUserInfo
}
from
'~/utils/cache/storageApi'
setSessionId
,
setUserInfo
}
from
'~/utils/cache/storageApi'
import
USERAPI
from
'~/api/usersApi/index'
import
USERAPI
from
'~/api/usersApi/index'
const
setRouteData
=
targetPath
=>
{
const
setRouteData
=
targetPath
=>
{
let
[
url
,
query
]
=
targetPath
.
split
(
'?'
),
let
[
url
,
query
]
=
targetPath
.
split
(
'?'
),
...
@@ -19,18 +16,11 @@ const setRouteData = targetPath => {
...
@@ -19,18 +16,11 @@ const setRouteData = targetPath => {
}
}
}
}
/**选择账号登录 */
/**选择账号登录 */
const
selectAccountLogin
=
({
const
selectAccountLogin
=
({
id
,
sessionId
})
=>
{
id
,
sessionId
})
=>
{
USERAPI
.
selectAccountLogin
({
USERAPI
.
selectAccountLogin
({
id
,
id
,
sessionId
sessionId
}).
then
(({
}).
then
(({
code
,
data
,
message
})
=>
{
code
,
data
,
message
})
=>
{
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
console
.
log
(
data
)
console
.
log
(
data
)
setLoginInfo
(
data
.
loginUserInfoList
[
0
],
data
.
sessionId
)
setLoginInfo
(
data
.
loginUserInfoList
[
0
],
data
.
sessionId
)
...
@@ -43,6 +33,29 @@ const setLoginInfo = (userInfo, sessionId) => {
...
@@ -43,6 +33,29 @@ const setLoginInfo = (userInfo, sessionId) => {
wx
.
$api
.
showToast
(
'仅支持服务商类型账户登录'
)
wx
.
$api
.
showToast
(
'仅支持服务商类型账户登录'
)
return
return
}
}
console
.
log
(
'wx.$router.getPageInstance()'
,
wx
.
$router
.
getPageInstance
());
const
{
options
:
{
reportDate
},
options
}
=
wx
.
$router
.
getPageInstance
()
// 跳转别的小程序
// debugger
if
(
reportDate
)
{
let
params
=
`approvedBy=
${
userInfo
.
name
}
&`
for
(
const
key
in
options
)
{
params
+=
`
${
key
}
=
${
options
[
key
]}
&`
}
console
.
log
(
params
);
return
wx
.
navigateToMiniProgram
({
appId
:
'wx570d9331f9ace0bd'
,
path
:
`tabWorkOrder/pages/staffDaily/staffDaily`
+
'?'
+
params
,
envVersion
:
'trial'
,
success
(
res
)
{
// 打开成功
}
})
}
// 自动创建服务中心
// 自动创建服务中心
initServiceCenter
()
initServiceCenter
()
setUserInfo
(
userInfo
)
setUserInfo
(
userInfo
)
...
@@ -55,23 +68,14 @@ const initServiceCenter = () => {
...
@@ -55,23 +68,14 @@ const initServiceCenter = () => {
/**成功跳转 */
/**成功跳转 */
const
loginSuccess
=
()
=>
{
const
loginSuccess
=
()
=>
{
const
{
const
{
options
:
{
options
:
{
targetPath
}
targetPath
}
}
=
wx
.
$router
.
getPageInstance
()
}
=
wx
.
$router
.
getPageInstance
()
if
(
targetPath
)
{
if
(
targetPath
)
{
const
{
const
{
url
,
obj
}
=
setRouteData
(
targetPath
)
url
,
obj
}
=
setRouteData
(
targetPath
)
wx
.
$router
.
reLaunch
(
url
,
obj
)
wx
.
$router
.
reLaunch
(
url
,
obj
)
}
else
wx
.
$router
.
reLaunch
(
'pages.index'
)
}
else
wx
.
$router
.
reLaunch
(
'pages.index'
)
}
}
const
loginModal
=
async
({
const
loginModal
=
async
({
message
,
confirmText
,
cancelText
})
=>
{
message
,
confirmText
,
cancelText
})
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wx
.
showModal
({
wx
.
showModal
({
content
:
message
||
'网络异常'
,
content
:
message
||
'网络异常'
,
...
@@ -86,10 +90,7 @@ const loginModal = async ({
...
@@ -86,10 +90,7 @@ const loginModal = async ({
})
})
}
}
/**手机号&微信登录:是否跳转登录列表页 */
/**手机号&微信登录:是否跳转登录列表页 */
const
checkLoginUserInfo
=
({
const
checkLoginUserInfo
=
({
loginUserInfoList
,
sessionId
})
=>
{
loginUserInfoList
,
sessionId
})
=>
{
const
thisPage
=
wx
.
$router
.
getPageInstance
()
const
thisPage
=
wx
.
$router
.
getPageInstance
()
/**多个账号 */
/**多个账号 */
if
(
loginUserInfoList
.
length
>
1
)
if
(
loginUserInfoList
.
length
>
1
)
...
@@ -97,8 +98,7 @@ const checkLoginUserInfo = ({
...
@@ -97,8 +98,7 @@ const checkLoginUserInfo = ({
sessionId
,
sessionId
,
...
thisPage
.
options
...
thisPage
.
options
})
})
/**只有一个账号 */
/**只有一个账号 */
else
else
selectAccountLogin
({
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
sessionId
...
...
login/loading/loading.js
View file @
09f900c
...
@@ -98,10 +98,17 @@ Page({
...
@@ -98,10 +98,17 @@ Page({
init
()
{
init
()
{
wx
.
nextTick
(()
=>
{
wx
.
nextTick
(()
=>
{
const
sessionId
=
getSessionId
(),
const
sessionId
=
getSessionId
(),
{
url
,
targetPath
=
url
?
decodeURIComponent
(
url
)
:
''
}
=
this
.
options
{
url
,
targetPath
=
url
?
decodeURIComponent
(
url
)
:
''
,
reportDate
}
=
this
.
options
let
path
=
'pages.index'
,
let
path
=
'pages.index'
,
obj
=
{}
obj
=
{}
if
(
targetPath
)
obj
.
targetPath
=
targetPath
if
(
targetPath
)
obj
.
targetPath
=
targetPath
// 如果是日报跳转进来的
if
(
reportDate
)
{
obj
=
{
...
obj
,
...
this
.
options
}
}
if
(
sessionId
)
{
if
(
sessionId
)
{
USERAPI
.
checkSession
().
then
(({
code
})
=>
{
USERAPI
.
checkSession
().
then
(({
code
})
=>
{
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
...
...
pages/tab/mine/mine.js
View file @
09f900c
...
@@ -49,7 +49,7 @@ Page({
...
@@ -49,7 +49,7 @@ Page({
name
:
'更新日志'
,
name
:
'更新日志'
,
path
:
'packageMine.log'
,
path
:
'packageMine.log'
,
isHide
:
false
,
isHide
:
false
,
newTips
:
true
newTips
:
true
}
}
],
],
isShowService
:
false
,
isShowService
:
false
,
...
@@ -106,7 +106,7 @@ Page({
...
@@ -106,7 +106,7 @@ Page({
},
},
messageBoxPageIsRead
()
{
messageBoxPageIsRead
()
{
let
{
serviceMerchantId
}
=
this
.
data
let
{
serviceMerchantId
}
=
this
.
data
console
.
log
(
serviceMerchantId
,
'serviceMerchantId'
);
console
.
log
(
serviceMerchantId
,
'serviceMerchantId'
);
const
idx
=
this
.
data
.
boxItemList
.
findIndex
(
item
=>
item
.
name
==
'消息盒子'
)
const
idx
=
this
.
data
.
boxItemList
.
findIndex
(
item
=>
item
.
name
==
'消息盒子'
)
mineApi
mineApi
.
messageBoxPageIsRead
({
.
messageBoxPageIsRead
({
...
@@ -155,7 +155,7 @@ Page({
...
@@ -155,7 +155,7 @@ Page({
judgeIsHide
()
{
judgeIsHide
()
{
let
{
boxItemList
,
userInfo
}
=
this
.
data
let
{
boxItemList
,
userInfo
}
=
this
.
data
let
nameList
=
[
'服务中心管理'
,
'员工管理'
,
'客户管理'
]
let
nameList
=
[
'服务中心管理'
,
'员工管理'
,
'客户管理'
]
if
(
!
userInfo
.
isSuper
)
{
if
(
!
userInfo
.
isSuper
)
{
nameList
.
forEach
(
item
=>
{
nameList
.
forEach
(
item
=>
{
let
idx
=
boxItemList
.
findIndex
(
k
=>
k
.
name
==
item
)
let
idx
=
boxItemList
.
findIndex
(
k
=>
k
.
name
==
item
)
this
.
setData
({
this
.
setData
({
...
@@ -170,6 +170,29 @@ Page({
...
@@ -170,6 +170,29 @@ Page({
versionData
versionData
})
})
},
},
jump
(
e
)
{
console
.
log
(
e
)
let
{
url
}
=
e
.
currentTarget
.
dataset
const
baseUrl
=
'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
const
path
=
`
${
baseUrl
}${
url
}
.html`
// private user
wx
.
navigateTo
({
url
:
`/pages/webView/webView?url=
${
encodeURIComponent
(
path
)}
`
})
// var globalData = appInstance.globalData.extConfig
// restapi.getMerchantBussiness(globalData.merchantId, function (res) {
// console.log(res);
// if (res.returnCode == '0') {
// let path = `https://dj.glsx.com.cn/agreement/djUserPolicy.html?merchantName=${globalData.merchantName}&phone=${res.data.phone}`
// wx.navigateTo({
// url: `/pages/webpage/webpage?path=${encodeURIComponent(path)}`
// })
// }
// }, function (res) {
// console.log(res);
// })
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
...
...
pages/tab/mine/mine.scss
View file @
09f900c
...
@@ -204,3 +204,14 @@ page {
...
@@ -204,3 +204,14 @@ page {
height
:
88rpx
;
height
:
88rpx
;
line-height
:
88rpx
;
line-height
:
88rpx
;
}
}
.message-box
{
position
:
fixed
;
bottom
:
30rpx
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
.message-box
text
{
color
:
#5092FF
;
}
\ No newline at end of file
\ No newline at end of file
pages/tab/mine/mine.wxml
View file @
09f900c
...
@@ -40,6 +40,12 @@
...
@@ -40,6 +40,12 @@
<button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
<button class="logoutBtn" size="default" type="default" isabled="{{false}}" loading="{{false}}" bindtap="logout" hover-class="button-hover">
退出登录
退出登录
</button>
</button>
<view class="message-box">
<!-- <view class="message">为保障你的合法权益,请阅读并同意</view> -->
<text catchtap="jump" data-url="privacy">《隐私协议》</text>
和
<text catchtap="jump" data-url="agreement">《用户协议》</text>
</view>
</view>
</view>
<!-- 加微 -->
<!-- 加微 -->
<service wx:if="{{isShowService}}"></service>
<service wx:if="{{isShowService}}"></service>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment