Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
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
李俊赕
self-support
Commits
0b7191b6
Commit
0b7191b6
authored
May 21, 2021
by
刘用法
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员用户切换师傅用户
parent
d2c7023e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
10 deletions
+98
-10
order.js
src/common/api/order.js
+7
-1
pages.json
src/pages.json
+7
-2
mine.vue
src/pages/index/mine.vue
+33
-7
index.vue
src/pages/mine/superLogin/index.vue
+51
-0
No files found.
src/common/api/order.js
View file @
0b7191b6
...
...
@@ -166,6 +166,10 @@ let orderApiFun = function(vm){
let
payableRecord
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
settle
+
vm
.
vuex_token
+
'/payable/v2/queryPayableRecord'
,
params
,
formType
);
// 获取我的钱包-师傅提现
let
workerApplyPay
=
async
()
=>
await
vm
.
$u
.
get
(
prefix
+
vm
.
vuex_token
+
'/applypay/batch/workerApplyPay'
);
// 是否有特殊登录权限
let
allowLogin
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'other/auth/'
+
vm
.
vuex_token
+
'/allow/login'
,
params
);
// 特殊登录切换师傅
let
otherUser
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
prefix
+
'other/auth/'
+
vm
.
vuex_token
+
'/other/user'
,
params
);
const
orderApi
=
{
listByRecommendOrder
,
...
...
@@ -204,6 +208,8 @@ let orderApiFun = function(vm){
listStatement
,
payableRecord
,
workerApplyPay
,
allowLogin
,
otherUser
}
return
orderApi
}
...
...
src/pages.json
View file @
0b7191b6
...
...
@@ -255,9 +255,14 @@
"navigationBarTitleText"
:
"我的仓库"
,
"enablePullDownRefresh"
:
false
}
}
},
{
"path"
:
"superLogin/index"
,
"style"
:
{
"navigationBarTitleText"
:
""
}
}
]
},
...
...
src/pages/index/mine.vue
View file @
0b7191b6
...
...
@@ -16,6 +16,7 @@
<u-icon
class=
"tel-arrow-icon"
name=
"arrow-up-fill"
></u-icon>
</view>
</view>
<view
v-if=
"showSuperButton"
class=
"super-button"
><u-button
@
click=
"handleSuperButton"
>
切换用户
</u-button></view>
</view>
<view
class=
"list-view"
>
...
...
@@ -45,6 +46,7 @@
return
{
qnPath
:
process
.
uniEnv
.
qn_base_url
,
serviceTel
:
'18124099271'
,
showSuperButton
:
false
}
},
computed
:
{
...
...
@@ -134,9 +136,19 @@
},
onLoad
()
{
app
.
trackPage
(
'我的首页'
)
if
(
this
.
vuex_token
&&
!
this
.
settled
)
{
console
.
log
(
'-------000-------'
)
if
(
this
.
vuex_token
)
{
console
.
log
(
'-------1111-------'
)
if
(
!
this
.
showSuperButton
)
{
this
.
allowLogin
()
}
if
(
!
this
.
settled
)
{
this
.
getData
()
}
}
},
methods
:
{
getData
()
{
...
...
@@ -164,6 +176,17 @@
}
this
.
$u
.
route
({
url
:
"pages/login/index"
})
},
async
allowLogin
()
{
let
res
=
await
this
.
$u
.
api
.
allowLogin
()
console
.
log
(
res
)
if
(
res
)
{
this
.
showSuperButton
=
res
.
code
==
200
}
},
handleSuperButton
()
{
this
.
$u
.
route
({
url
:
'pages/mine/superLogin/index'
})
}
}
}
</
script
>
...
...
@@ -240,6 +263,9 @@
}
}
}
.super-button
{
margin-left
:
20rpx
;
}
}
.list-view
{
...
...
src/pages/mine/superLogin/index.vue
0 → 100644
View file @
0b7191b6
<
template
>
<view
class=
"super-login"
>
<u-input
auto-focus
v-model=
"mobile"
focus
type=
"number"
placeholder=
"请输入手机号"
></u-input>
<view
class=
"line-view"
></view>
<view
class=
"button-view"
>
<u-button
class=
"change-button"
type=
"primary"
@
click=
"handleClick"
>
确认切换
</u-button>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
mobile
:
''
}
},
methods
:
{
handleClick
()
{
this
.
otherUser
()
},
async
otherUser
()
{
let
res
=
await
this
.
$u
.
api
.
otherUser
({
mobile
:
this
.
mobile
})
console
.
log
(
res
)
if
(
res
&&
res
.
code
==
200
)
{
this
.
$u
.
vuex
(
"vuex_token"
,
res
.
data
);
uni
.
navigateBack
({
})
}
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.super-login
{
padding
:
30rpx
;
margin
:
30rpx
;
background-color
:
#FFFFFF
;
border-radius
:
12rpx
;
.line-view
{
background-color
:
#F4F5F7
;
height
:
2rpx
;
}
.button-view
{
margin-top
:
40rpx
;
}
}
</
style
>
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