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)=>{
...
@@ -30,6 +30,16 @@ export const updateUserInfo=(data)=>{
return
http
.
post
(
url
,
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
=
()
=>
{
export
const
loginOut
=
()
=>
{
let
url
=
`/login/logout`
let
url
=
`/login/logout`
...
...
pages/my/myInfo.vue
View file @
f322e21e
...
@@ -60,9 +60,13 @@
...
@@ -60,9 +60,13 @@
<view
class=
"cu-list menu sm-border"
>
<view
class=
"cu-list menu sm-border"
>
<view
class=
"cu-item arrow"
@
tap=
"onHandle(6)"
>
<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>
<image
:src=
"assetsPath+'/my_list_3.png'"
class=
"png"
mode=
"aspectFit"
></image>
<text
class=
"text-title"
>
我的车辆
</text>
<text
class=
"text-title"
>
我的车辆
</text>
<view
class=
"numberplate"
>
<text>
{{
userInfo
.
numberplate
||
''
}}
</text>
</view>
</view>
</view>
</view>
</view>
...
@@ -326,8 +330,9 @@
...
@@ -326,8 +330,9 @@
url
:
'/pages/deviceManage/index'
url
:
'/pages/deviceManage/index'
})
})
}
else
if
(
val
===
6
){
}
else
if
(
val
===
6
){
let
num
=
this
.
userInfo
.
numberplate
||
''
;
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/setting/license-plate-number/list
'
url
:
'/setting/license-plate-number/list
?number='
+
num
})
})
}
}
},
},
...
@@ -627,4 +632,12 @@
...
@@ -627,4 +632,12 @@
}
}
}
}
}
}
.numberplate
{
position
:
absolute
;
right
:
8
upx
;
top
:
0
;
height
:
100%
;
display
:
flex
;
align-items
:
center
;
}
</
style
>
</
style
>
\ No newline at end of file
setting/license-plate-number/list.vue
View file @
f322e21e
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
<view>
<view>
<u-swipe-action>
<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"
>
-->
<!--
<view
class=
"swipe-action u-border-top u-border-bottom"
>
-->
<xm-cell
special
label=
"车牌号"
:value=
"item.name"
></xm-cell>
<xm-cell
special
label=
"车牌号"
:value=
"item.name"
></xm-cell>
<!--
</view>
-->
<!--
</view>
-->
...
@@ -13,12 +14,11 @@
...
@@ -13,12 +14,11 @@
<view
v-if=
"licensePlateNumber && licensePlateNumber.length
<
=
0
"
class=
"empty-box"
>
<view
v-if=
"licensePlateNumber && licensePlateNumber.length
<
=
0
"
class=
"empty-box"
>
<u-empty
text=
"暂未绑定车牌号"
textColor=
'#C1C1C1'
width=
"120"
<u-empty
text=
"暂未绑定车牌号"
textColor=
'#C1C1C1'
width=
"120"
:icon=
"listBlankImage"
>
:icon=
"listBlankImage"
>
</u-empty>
</u-empty>
</view>
</view>
<view
class=
"foot-box"
>
<view
class=
"foot-box"
v-if=
"!licensePlateNumber.length"
>
<view
class=
"btn-box"
>
<view
class=
"btn-box"
>
<button
class=
"cu-btn block bg-blue lg round "
@
tap=
"onShowKeyboard('xmKeyboard')"
>
新增
</button>
<button
class=
"cu-btn block bg-blue lg round "
@
tap=
"onShowKeyboard('xmKeyboard')"
>
新增
</button>
</view>
</view>
...
@@ -26,69 +26,76 @@
...
@@ -26,69 +26,76 @@
<uni-popup
ref=
"popupConfirm"
type=
"dialog"
>
<uni-popup
ref=
"popupConfirm"
type=
"dialog"
>
<uni-popup-dialog
<uni-popup-dialog
type=
"warn"
mode=
"base"
:content=
"content"
:duration=
"2000"
:before-close=
"true"
type=
"warn"
@
close=
"close"
@
confirm=
"confirm"
></uni-popup-dialog>
mode=
"base"
:content=
"content"
:duration=
"2000"
:before-close=
"true"
@
close=
"close"
@
confirm=
"confirm"
></uni-popup-dialog>
</uni-popup>
</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>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
config
from
"@/config/index.config"
import
config
from
"@/config/index.config"
;
import
{
plateNumberBind
,
plateNumberUnbind
}
from
"@/api/index.js"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
initValue
:
''
,
initValue
:
''
,
content
:
"请确认解除车牌号绑定"
,
content
:
"请确认解除车牌号绑定"
,
listBlankImage
:
config
.
assetsPath
+
'/no_data_icon.png'
,
listBlankImage
:
config
.
assetsPath
+
'/no_data_icon.png'
,
licensePlateNumber
:
[{
licensePlateNumber
:
[],
id
:
'1'
,
name
:
'鄂A 66666'
}],
options
:
[{
options
:
[{
text
:
'删除'
,
text
:
'删除'
,
style
:
{
style
:
{
backgroundColor
:
'#f56c6c'
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
:
{
methods
:
{
onClick
(
e
){
onClick
(
e
)
{
console
.
log
(
e
,
909090
)
console
.
log
(
e
,
909090
)
this
.
deleteIndex
=
e
.
index
this
.
deleteIndex
=
e
.
index
this
.
$refs
.
popupConfirm
.
open
();
this
.
$refs
.
popupConfirm
.
open
();
},
},
close
()
{
close
(){
this
.
$refs
.
popupConfirm
.
close
()
this
.
$refs
.
popupConfirm
.
close
()
},
},
confirm
(){
confirm
()
{
plateNumberUnbind
({
this
.
licensePlateNumber
=
this
.
licensePlateNumber
.
filter
((
item
,
index
)
=>
index
!=
this
.
deleteIndex
);
id
:
this
.
userInfo
.
id
}).
then
(
res
=>
{
this
.
close
()
if
(
res
.
data
.
code
==
200
){
uni
.
showToast
({
icon
:
"none"
,
title
:
"解绑成功"
,
success
:
()
=>
{
this
.
licensePlateNumber
=
this
.
licensePlateNumber
.
filter
((
item
,
index
)
=>
index
!=
this
.
deleteIndex
);
}
})
}
else
{
uni
.
showToast
({
uni
.
showToast
({
icon
:
"none"
,
icon
:
"none"
,
title
:
"解绑成功"
title
:
res
.
data
.
msg
,
})
})
}
})
this
.
close
()
},
},
onShowKeyboard
(
ref
)
{
onShowKeyboard
(
ref
)
{
...
@@ -99,10 +106,30 @@
...
@@ -99,10 +106,30 @@
let
obj
=
{
let
obj
=
{
name
:
e
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
.
licensePlateNumber
.
push
(
obj
)
this
.
$refs
.
xmKeyboard
.
inputClear
()
this
.
$refs
.
xmKeyboard
.
inputClear
()
}
}
})
}
else
{
uni
.
showToast
({
icon
:
"none"
,
title
:
res
.
data
.
msg
,
})
}
})
}
}
}
}
}
</
script
>
</
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