Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_wechat
Overview
Overview
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
pseer
gxpt_wechat
Commits
f322e21e
Commit
f322e21e
authored
Mar 01, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的车牌内容优化
parent
7178b3a4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
41 deletions
+92
-41
index.js
api/index.js
+10
-0
myInfo.vue
pages/my/myInfo.vue
+16
-2
list.vue
setting/license-plate-number/list.vue
+66
-39
No files found.
api/index.js
View file @
f322e21e
...
...
@@ -30,6 +30,16 @@ export const updateUserInfo=(data)=>{
return
http
.
post
(
url
,
data
)
}
export
const
plateNumberBind
=
(
data
)
=>
{
let
url
=
`/consumer/bind`
return
http
.
post
(
url
,
data
)
}
export
const
plateNumberUnbind
=
(
data
)
=>
{
let
url
=
`/consumer/bind`
return
http
.
post
(
url
,
data
)
}
// 退出登录操作
export
const
loginOut
=
()
=>
{
let
url
=
`/login/logout`
...
...
pages/my/myInfo.vue
View file @
f322e21e
...
...
@@ -60,9 +60,13 @@
<view
class=
"cu-list menu sm-border"
>
<view
class=
"cu-item arrow"
@
tap=
"onHandle(6)"
>
<view
class=
"content"
>
<view
class=
"content"
style=
"position: relative;"
>
<image
:src=
"assetsPath+'/my_list_3.png'"
class=
"png"
mode=
"aspectFit"
></image>
<text
class=
"text-title"
>
我的车辆
</text>
<view
class=
"numberplate"
>
<text>
{{
userInfo
.
numberplate
||
''
}}
</text>
</view>
</view>
</view>
...
...
@@ -326,8 +330,9 @@
url
:
'/pages/deviceManage/index'
})
}
else
if
(
val
===
6
){
let
num
=
this
.
userInfo
.
numberplate
||
''
;
uni
.
navigateTo
({
url
:
'/setting/license-plate-number/list
'
url
:
'/setting/license-plate-number/list
?number='
+
num
})
}
},
...
...
@@ -627,4 +632,12 @@
}
}
}
.numberplate
{
position
:
absolute
;
right
:
8
upx
;
top
:
0
;
height
:
100%
;
display
:
flex
;
align-items
:
center
;
}
</
style
>
\ No newline at end of file
setting/license-plate-number/list.vue
View file @
f322e21e
...
...
@@ -3,7 +3,8 @@
<view>
<u-swipe-action>
<u-swipe-action-item
v-for=
"(item,k) in licensePlateNumber"
:key=
"k"
:index=
"k"
:name=
"k"
:options=
"options"
@
click=
"onClick"
>
<u-swipe-action-item
v-for=
"(item,k) in licensePlateNumber"
:key=
"k"
:index=
"k"
:name=
"k"
:options=
"options"
@
click=
"onClick"
>
<!--
<view
class=
"swipe-action u-border-top u-border-bottom"
>
-->
<xm-cell
special
label=
"车牌号"
:value=
"item.name"
></xm-cell>
<!--
</view>
-->
...
...
@@ -13,12 +14,11 @@
<view
v-if=
"licensePlateNumber && licensePlateNumber.length
<
=
0
"
class=
"empty-box"
>
<u-empty
text=
"暂未绑定车牌号"
textColor=
'#C1C1C1'
width=
"120"
:icon=
"listBlankImage"
>
<u-empty
text=
"暂未绑定车牌号"
textColor=
'#C1C1C1'
width=
"120"
:icon=
"listBlankImage"
>
</u-empty>
</view>
<view
class=
"foot-box"
>
<view
class=
"foot-box"
v-if=
"!licensePlateNumber.length"
>
<view
class=
"btn-box"
>
<button
class=
"cu-btn block bg-blue lg round "
@
tap=
"onShowKeyboard('xmKeyboard')"
>
新增
</button>
</view>
...
...
@@ -26,69 +26,76 @@
<uni-popup
ref=
"popupConfirm"
type=
"dialog"
>
<uni-popup-dialog
type=
"warn"
mode=
"base"
:content=
"content"
:duration=
"2000"
:before-close=
"true"
@
close=
"close"
@
confirm=
"confirm"
></uni-popup-dialog>
<uni-popup-dialog
type=
"warn"
mode=
"base"
:content=
"content"
:duration=
"2000"
:before-close=
"true"
@
close=
"close"
@
confirm=
"confirm"
></uni-popup-dialog>
</uni-popup>
<xm-keyboard-v2
ref=
"xmKeyboard"
:initValue=
"initValue"
:cursor=
"true"
:vibration=
"true"
@
confirm=
"onSave"
></xm-keyboard-v2>
<xm-keyboard-v2
ref=
"xmKeyboard"
:initValue=
"initValue"
:cursor=
"true"
:vibration=
"true"
@
confirm=
"onSave"
></xm-keyboard-v2>
</view>
</
template
>
<
script
>
import
config
from
"@/config/index.config"
import
config
from
"@/config/index.config"
;
import
{
plateNumberBind
,
plateNumberUnbind
}
from
"@/api/index.js"
;
export
default
{
data
()
{
return
{
initValue
:
''
,
content
:
"请确认解除车牌号绑定"
,
listBlankImage
:
config
.
assetsPath
+
'/no_data_icon.png'
,
licensePlateNumber
:
[{
id
:
'1'
,
name
:
'鄂A 66666'
}],
initValue
:
''
,
content
:
"请确认解除车牌号绑定"
,
listBlankImage
:
config
.
assetsPath
+
'/no_data_icon.png'
,
licensePlateNumber
:
[],
options
:
[{
text
:
'删除'
,
style
:
{
backgroundColor
:
'#f56c6c'
}
}],
deleteIndex
:
''
,
deleteIndex
:
''
,
userInfo
:{}
};
},
onLoad
()
{
onLoad
(
option
)
{
console
.
log
(
option
,
999
)
this
.
userInfo
=
uni
.
getStorageSync
(
'userInfo'
)
if
(
option
.
number
){
this
.
licensePlateNumber
.
push
({
name
:
option
.
number
})
}
},
methods
:
{
onClick
(
e
){
console
.
log
(
e
,
909090
)
onClick
(
e
)
{
console
.
log
(
e
,
909090
)
this
.
deleteIndex
=
e
.
index
this
.
$refs
.
popupConfirm
.
open
();
},
close
(){
close
()
{
this
.
$refs
.
popupConfirm
.
close
()
},
confirm
(){
this
.
licensePlateNumber
=
this
.
licensePlateNumber
.
filter
((
item
,
index
)
=>
index
!=
this
.
deleteIndex
);
this
.
close
()
confirm
()
{
plateNumberUnbind
({
id
:
this
.
userInfo
.
id
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"解绑成功"
,
success
:
()
=>
{
this
.
licensePlateNumber
=
this
.
licensePlateNumber
.
filter
((
item
,
index
)
=>
index
!=
this
.
deleteIndex
);
}
})
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
"解绑成功"
title
:
res
.
data
.
msg
,
})
}
})
this
.
close
()
},
onShowKeyboard
(
ref
)
{
...
...
@@ -99,10 +106,30 @@
let
obj
=
{
name
:
e
}
plateNumberBind
({
id
:
this
.
userInfo
.
id
,
numberplate
:
e
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"保存成功"
,
success
:
()
=>
{
this
.
licensePlateNumber
.
push
(
obj
)
this
.
$refs
.
xmKeyboard
.
inputClear
()
}
})
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
msg
,
})
}
})
}
}
}
</
script
>
...
...
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