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
66e79b00
Commit
66e79b00
authored
Apr 25, 2022
by
fwz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加购商品
parent
2b202d76
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
90 deletions
+114
-90
getCarCode.vue
pagesA/pages/index/getCarCode.vue
+109
-82
getPrice.vue
pagesA/pages/index/getPrice.vue
+3
-3
myMoveCar.vue
pagesB/pages/move-car/myMoveCar.vue
+1
-3
index.vue
pagesC/pages/shop/index.vue
+1
-2
No files found.
pagesA/pages/index/getCarCode.vue
View file @
66e79b00
...
...
@@ -49,49 +49,40 @@
<u-gap
bgColor=
"transparent"
height=
"20"
></u-gap>
<div
class=
"list"
>
<div
class=
"list__item"
v-for=
"(vo,inx) in mallList"
:key=
"inx"
>
<div
class=
"list__img"
>
<!--
<image
:src=
"vo.img"
/>
-->
</div>
<image
:src=
"vo.mainImgUrl"
class=
"list__img"
></image>
<!--
<div
class=
"list__img"
>
<image
:src=
"vo.img"
/>
</div>
-->
<div
class=
"list__money"
>
<div
class=
"money__title"
>
<text>
{{
vo
.
title
}}
</text>
</div>
<div
class=
"code__tips"
>
<text>
{{
vo
.
tip
}}
</text>
<text>
{{
vo
.
spec
}}
</text>
</div>
<div
class=
"money__num"
>
<text
class=
"num__one"
>
¥
{{
vo
.
currentPrice
/
100
}}
</text>
<text
class=
"num__two"
>
¥
{{
vo
.
originalPrice
/
100
}}
</text>
</div>
</div>
<u-number-box
v-model=
"value"
:min=
"0"
@
click=
"selectMall(vo.id)"
>
<view
slot=
"minus"
class=
"minus"
>
<u-icon
name=
"minus"
size=
"12"
></u-icon>
</view>
<text
slot=
"input"
style=
"width: 50rpx;text-align: center;"
class=
"input"
>
{{
value
}}
</text>
<view
slot=
"plus"
class=
"plus"
>
<u-icon
name=
"plus"
color=
"#FFFFFF"
size=
"12"
></u-icon>
</view>
</u-number-box>
<u-number-box>
<view
slot=
"minus"
class=
"minus"
@
click=
"minusMall(vo)"
>
<u-icon
name=
"minus"
size=
"12"
></u-icon>
</view>
<text
slot=
"input"
style=
"width: 50rpx;text-align: center;"
class=
"input"
>
{{
mallSelectMap
[
vo
.
id
]?
mallSelectMap
[
vo
.
id
]:
0
}}
</text>
<view
slot=
"plus"
class=
"plus"
@
click=
"plusMall(vo)"
>
<u-icon
name=
"plus"
color=
"#FFFFFF"
size=
"12"
></u-icon>
</view>
</u-number-box>
<!--
<u-number-box
v-model=
"mallSelectMap[vo.id]"
:min=
"0"
@
change=
"selectMall"
>
</u-number-box>
-->
<!--
<div
class=
"list__add"
@
click=
"add"
>
<image
src=
"@/static/index/get-car-code2.png"
/>
</div>
-->
</div>
...
...
@@ -103,10 +94,10 @@
<div
class=
"price__bottom"
>
<div
class=
"price"
>
<div
class=
"price__num"
>
共
<span>
{{
selectMallList
.
length
}}
</span>
件
共
<span>
{{
countNum
}}
</span>
件
</div>
<div
class=
"price__all"
>
合计
<span
class=
"num__
two"
>
¥00.00
</span>
合计
<span
class=
"num__
one"
>
¥
{{
countMoney
/
100
}}
</span>
</div>
</div>
<div
class=
"price__next"
@
click=
"pay"
>
...
...
@@ -160,7 +151,14 @@ export default {
value
:
0
,
//
selectMallList
:
[],
//选择商品的数量
countNum
:
0
,
//商品变更为零或者1
quantityChange
:
false
,
countMoney
:
0
,
mallMoney
:
0
,
mallSelectMap
:
{},
carNo
:
''
,
}
},
methods
:
{
...
...
@@ -174,12 +172,20 @@ export default {
});
},
pay
()
{
let
list
=
[{
id
:
this
.
freeCode
.
id
,
nums
:
1
,
}]
let
idMap
=
this
.
mallSelectMap
for
(
let
id
in
idMap
){
if
(
idMap
[
id
]
>
0
){
let
commodity
=
{
id
:
id
,
nums
:
idMap
[
id
]
}
list
.
push
(
commodity
)
}
}
this
.
createOrder
=
{
addressId
:
this
.
addressId
,
commodityList
:
[{
id
:
'2022042214065100000000'
,
nums
:
1
,
}],
commodityList
:
list
,
}
let
that
=
this
let
opts
=
{
url
:
'/app/mall/create/order'
,
method
:
'post'
};
...
...
@@ -269,31 +275,52 @@ export default {
})
},
getMallList
(){
let
opts
=
{
url
:
'/app/mall/
list
'
,
method
:
'get'
};
this
.
http
.
httpTokenRequest
(
opts
,
{
classification
:
"1"
}).
then
(
res
=>
{
let
opts
=
{
url
:
'/app/mall/
add/purchase
'
,
method
:
'get'
};
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
mallList
=
res
.
data
.
data
.
rows
this
.
mallList
=
res
.
data
.
data
this
.
mallList
.
forEach
(
element
=>
{
element
.
selectNum
=
0
})
}
})
},
selectMall
(
id
){
console
.
log
(
id
)
let
exist
=
false
this
.
selectMallList
.
forEach
(
element
=>
{
if
(
element
==
id
){
exist
=
true
}
})
if
(
!
exist
){
this
.
selectMallList
.
push
(
id
)
}
}
selectMoney
(
value
){
this
.
mallMoney
=
value
},
selectMall
(
num
){
//当添加数量且数量为1就加总共商品数量
this
.
quantityChange
=
(
num
.
value
==
0
||
num
.
value
==
1
)
},
plusMall
(
vo
){
if
(
!
this
.
mallSelectMap
[
vo
.
id
]
||
this
.
mallSelectMap
[
vo
.
id
]
==
0
){
this
.
countNum
=
this
.
countNum
+
1
this
.
mallSelectMap
[
vo
.
id
]
=
1
}
else
{
this
.
mallSelectMap
[
vo
.
id
]
+=
1
}
this
.
countMoney
+=
vo
.
currentPrice
console
.
log
(
this
.
mallSelectMap
)
},
minusMall
(
vo
){
if
(
this
.
mallSelectMap
[
vo
.
id
]
&&
this
.
mallSelectMap
[
vo
.
id
]
>
0
){
if
(
this
.
mallSelectMap
[
vo
.
id
]
==
1
){
this
.
countNum
-=
1
}
this
.
mallSelectMap
[
vo
.
id
]
-=
1
this
.
countMoney
-=
vo
.
currentPrice
}
},
},
onShow
()
{
this
.
getAddressList
()
this
.
getMoveCode
()
this
.
getMallList
()
},
onLoad
(
option
)
{
this
.
carNo
=
option
.
carNo
},
};
</
script
>
...
...
@@ -614,33 +641,33 @@ export default {
}
}
}
.minus
{
width
:
22px
;
height
:
22px
;
border-width
:
1px
;
border-color
:
#E6E6E6
;
border-top-left-radius
:
100px
;
border-top-right-radius
:
100px
;
border-bottom-left-radius
:
100px
;
border-bottom-right-radius
:
100px
;
@include
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.input
{
padding
:
0
10px
;
}
.plus
{
width
:
22px
;
height
:
22px
;
background-color
:
#FF0000
;
border-radius
:
50%
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
justify-content
:
center
;
align-items
:
center
;
}
.minus
{
width
:
22px
;
height
:
22px
;
border-width
:
1px
;
border-color
:
#E6E6E6
;
border-top-left-radius
:
100px
;
border-top-right-radius
:
100px
;
border-bottom-left-radius
:
100px
;
border-bottom-right-radius
:
100px
;
@include
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.input
{
padding
:
0
10px
;
}
.plus
{
width
:
22px
;
height
:
22px
;
background-color
:
#FF0000
;
border-radius
:
50%
;
/* #ifndef APP-NVUE */
display
:
flex
;
/* #endif */
justify-content
:
center
;
align-items
:
center
;
}
</
style
>
pagesA/pages/index/getPrice.vue
View file @
66e79b00
...
...
@@ -128,9 +128,9 @@ export default {
}
})
}
uni
.
navigateTo
({
url
:
'/pagesA/pages/index/getCarCode'
});
uni
.
navigateTo
({
url
:
'/pagesA/pages/index/getCarCode?carNo='
+
this
.
model1
.
carInfo
.
carNo
});
}).
catch
(
errors
=>
{
uni
.
$u
.
toast
(
'校验失败'
)
})
...
...
pagesB/pages/move-car/myMoveCar.vue
View file @
66e79b00
...
...
@@ -9,7 +9,6 @@
<u-search
placeholder=
"请输入车牌号"
:showAction=
'false'
bgColor=
'#ffffff'
v-model=
"keyword"
@
change=
"getMyMoveCodeList"
></u-search>
</div>
<div
class=
"my__list"
>
<scroll-list
ref=
"list"
:option=
"option"
@
load=
"load"
>
<div
class=
"list__item"
v-for=
"(vo,inx) in items"
:key=
"inx"
>
<div
class=
"item__top"
>
<div
class=
"top__img"
>
...
...
@@ -31,12 +30,11 @@
<span
@
click=
"openUnbindModal(vo.id)"
>
解除绑定
</span>
<span
@
click=
"goView(vo.id)"
>
查看详情
</span>
</div>
<div>
<div>
<u-modal
:show=
"unbindShow"
:title=
"unbindTitle"
:content=
'unbindContent'
@
confirm=
"unbind"
@
cancel=
"cancelModal"
showCancelButton=
"true"
></u-modal>
</div>
</div>
</scroll-list>
</div>
</div>
</view>
...
...
pagesC/pages/shop/index.vue
View file @
66e79b00
...
...
@@ -146,12 +146,11 @@ export default {
flex-wrap
:
wrap
;
.one__item
{
width
:
48
%
;
width
:
100
%
;
background
:
#FFFFFF
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.2
);
border-radius
:
20rpx
;
margin-bottom
:
30rpx
;
.one__item__img
{
width
:
100%
;
height
:
320rpx
;
...
...
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