Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
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
Administrator
jd-vx-app
Commits
9c9f96a9
Commit
9c9f96a9
authored
Aug 22, 2022
by
肖健
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v1.0.0' into v1.0.0
parents
f858ecd5
feccd1cd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
567 additions
and
543 deletions
+567
-543
api.js
common/api/api.js
+1
-1
main.vue
pages/main.vue
+14
-1
moveCar.vue
pages/moveCar.vue
+2
-0
personal.vue
pages/personal.vue
+548
-541
shop.vue
pages/shop.vue
+2
-0
No files found.
common/api/api.js
View file @
9c9f96a9
...
...
@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
// console.log(33333333333,res[1])
if
(
res
[
1
].
data
.
code
==
401
){
uni
.
removeStorageSync
(
'userToken'
)
uni
.
navigate
To
({
uni
.
redirect
To
({
url
:
"/pages/login/index/index?failure=401"
})
return
;
...
...
pages/main.vue
View file @
9c9f96a9
...
...
@@ -85,6 +85,7 @@
},
methods
:
{
tabChange
(
index
)
{
uni
.
setStorageSync
(
'tabbar'
,
index
)
let
that
=
this
switch
(
index
)
{
case
0
:
...
...
@@ -333,6 +334,7 @@
duration
:
2000
});
// 判断是否扫码进入
that
.
scene
=
uni
.
getStorageSync
(
'scene'
)
// console.log(that.scene,"微信扫码进入")
...
...
@@ -360,6 +362,17 @@
});
}
})
}
else
{
let
routerLogin
=
uni
.
getStorageSync
(
'routerLogin'
)
let
tabbar
=
uni
.
getStorageSync
(
'tabbar'
)
if
(
tabbar
){
this
.
tabChange
(
tabbar
)
}
if
(
routerLogin
){
uni
.
redirectTo
({
url
:
routerLogin
})
}
}
}
else
{
...
...
pages/moveCar.vue
View file @
9c9f96a9
...
...
@@ -56,6 +56,8 @@
methods
:
{
goUrl
(
vo
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=1'
...
...
pages/personal.vue
View file @
9c9f96a9
...
...
@@ -3,7 +3,7 @@
* @Description: 个人中心
-->
<
template
>
<view
class=
""
v-if=
"show"
>
<view
class=
""
v-if=
"show"
>
<view
class=
"personal"
>
<div
class=
"ps__bg"
>
<div
class=
"ps__title"
></div>
...
...
@@ -56,16 +56,16 @@
<div
class=
"ps__btn"
v-if=
"logoutFlag"
@
click=
"loginOut"
>
退出登录
</div>
</view>
<u-gap
bgColor=
"transparent"
height=
"70"
></u-gap>
</view>
</view>
</
template
>
<
script
>
let
plugin
=
requirePlugin
(
'loginPlugin'
);
export
default
{
export
default
{
data
()
{
return
{
show
:
false
,
logoutFlag
:
true
,
show
:
false
,
logoutFlag
:
true
,
menu
:
[
// {
// icon: require("@/static/my/my01.png"),
...
...
@@ -141,7 +141,7 @@ export default {
url
:
'/pages/main'
});
});
}
else
{
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
...
...
@@ -153,14 +153,15 @@ export default {
},
goOrder
(
current
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
){
uni
.
removeStorageSync
(
'routerLogin'
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let
returnPage
=
'/pages/main'
;
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageType
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageType
})
return
;
}
...
...
@@ -170,18 +171,20 @@ export default {
},
goUrl
(
vo
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
){
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let
returnPage
=
'/pages/main'
;
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageTyp
e
url
:
"/pages/login/index/index?returnPage="
+
returnPag
e
})
return
;
}
if
(
vo
.
type
==
"jd"
)
{
if
(
vo
.
type
==
"jd"
)
{
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
''
,
// 目标小程序的页面路径
...
...
@@ -205,7 +208,9 @@ export default {
},
editInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
){
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
'/pagesD/pages/personal/userInfo'
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
...
...
@@ -220,10 +225,11 @@ export default {
},
async
getUserInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
if
(
!
token
)
{
this
.
logoutFlag
=
false
return
}
this
.
logoutFlag
=
true
let
opts
=
{
url
:
'/app/user/info'
,
method
:
'get'
...
...
@@ -231,10 +237,10 @@ export default {
await
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
userInfo
=
res
.
data
.
data
if
(
this
.
userInfo
.
avatar
)
{
if
(
this
.
userInfo
.
avatar
)
{
this
.
avatar
=
this
.
userInfo
.
avatar
}
}
else
{
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
...
...
@@ -260,7 +266,7 @@ export default {
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
...
...
@@ -303,14 +309,15 @@ export default {
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
withSubscriptions
:
true
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您已拒绝订阅消息授权,无法接收通知"
,
...
...
@@ -331,25 +338,25 @@ export default {
},
mounted
()
{
setTimeout
(()
=>
{
this
.
show
=
true
this
.
show
=
true
},
100
);
this
.
getUserInfo
()
},
onReady
:
function
()
{
onReady
:
function
()
{
uni
.
setNavigationBarTitle
({
title
:
'个人中心'
});
},
};
};
</
script
>
<
style
lang=
"scss"
scoped
>
.personal
{
.personal
{
.ps__bg
{
background
:
url('http://euzhi.com/my15.png')
no-repeat
;
background-size
:
cover
;
z-index
:
999
;
padding-bottom
:
50rpx
;
padding-bottom
:
50rpx
;
.ps__title
{
font-size
:
40rpx
;
...
...
@@ -580,5 +587,5 @@ export default {
font-weight
:
500
;
color
:
#666666
;
}
}
}
</
style
>
pages/shop.vue
View file @
9c9f96a9
...
...
@@ -166,6 +166,8 @@ export default {
},
goDetail
(
id
,
link
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
false
)
if
(
!
token
){
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
...
...
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