Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
user
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
hooloo
mp
user
Commits
4bf5da33
Commit
4bf5da33
authored
Jun 10, 2022
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改首页字体,修改每单杯数判断
parent
d77d6b90
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
31 deletions
+42
-31
components/OrderQrCode/index.vue
+1
-0
components/menuAssembly/index.vue
+1
-16
components/shopCar/shopCar.vue
+11
-6
menuSubPackage/pages/goodsDetail/goodsDetail.vue
+3
-2
pages/menu/menu.vue
+3
-1
pages/order/order.vue
+17
-2
utils/utils.js
+6
-4
No files found.
components/OrderQrCode/index.vue
View file @
4bf5da33
...
...
@@ -149,6 +149,7 @@ export default {
background
:
#FFFFFF
;
border-radius
:
10
rpx
;
padding-top
:
25
rpx
;
padding-bottom
:
25
rpx
;
.code
{
font-size
:
36
rpx
;
...
...
components/menuAssembly/index.vue
View file @
4bf5da33
...
...
@@ -116,7 +116,6 @@ export default {
.shop-box
{
min-width
:
300
rpx
;
font-size
:
28
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
display
:
flex
;
...
...
@@ -132,7 +131,6 @@ export default {
.distance
{
height
:
46
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#FFFFFF
;
line-height
:
42
rpx
;
...
...
@@ -189,7 +187,6 @@ export default {
.user-name
{
height
:
28
rpx
;
font-size
:
20
rpx
;
font-family
:
ArialMT
;
color
:
#FFFFFF
;
line-height
:
22
rpx
;
}
...
...
@@ -198,7 +195,6 @@ export default {
display
:
flex
;
height
:
22
rpx
;
font-size
:
16
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#FFFFFF
;
line-height
:
22
rpx
;
...
...
@@ -224,7 +220,6 @@ export default {
background
:
#006ECF
;
border-radius
:
4
rpx
;
font-size
:
20
rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#FFFFFF
;
line-height
:
48
rpx
;
...
...
@@ -254,7 +249,6 @@ export default {
.first
{
height
:
44
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
#323232
;
line-height
:
44
rpx
;
...
...
@@ -265,14 +259,12 @@ export default {
margin-top
:
20
rpx
;
height
:
34
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#323232
;
line-height
:
34
rpx
;
.time
{
font-size
:
28
rpx
;
font-family
:
Arial-BoldMT
,
Arial
;
font-weight
:
normal
;
color
:
#006ECF
;
margin
:
0
16
rpx
;
...
...
@@ -314,7 +306,6 @@ export default {
text-align
:
center
;
margin-top
:
14
rpx
;
font-size
:
16
rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#666666
;
line-height
:
22
rpx
;
...
...
@@ -346,7 +337,6 @@ export default {
height
:
170
rpx
;
line-height
:
170
rpx
;
font-size
:
24
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#666666
;
display
:
flex
;
...
...
@@ -383,7 +373,6 @@ export default {
margin-bottom
:
40
rpx
;
height
:
44
rpx
;
font-size
:
32
rpx
;
font-family
:
PingFangSC-Semibold
,
PingFang
SC
;
font-weight
:
600
;
color
:
#000000
;
line-height
:
44
rpx
;
...
...
@@ -411,7 +400,6 @@ export default {
.goods-name
{
font-size
:
28
rpx
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#000000
;
}
...
...
@@ -424,7 +412,6 @@ export default {
margin-right
:
10
rpx
;
padding
:
4
rpx
6
rpx
;
font-size
:
16
rpx
;
font-family
:
ArialMT
;
color
:
#006ECF
;
line-height
:
24
rpx
;
display
:
inline-block
;
...
...
@@ -434,7 +421,6 @@ export default {
.desc-box
{
display
:
flex
;
font-size
:
20
rpx
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#666666
;
line-height
:
40
rpx
;
...
...
@@ -449,10 +435,10 @@ export default {
display
:
inline-block
;
height
:
32
rpx
;
font-size
:
24
rpx
;
font-family
:
Arial-BoldMT
,
Arial
;
color
:
#EB5F17
;
line-height
:
32
rpx
;
margin-right
:
6
rpx
;
font-weight
:
800
;
}
.price
{
...
...
@@ -460,7 +446,6 @@ export default {
display
:
inline-block
;
height
:
22
rpx
;
font-size
:
20
rpx
;
font-family
:
ArialMT
;
color
:
#666666
;
line-height
:
22
rpx
;
...
...
components/shopCar/shopCar.vue
View file @
4bf5da33
...
...
@@ -89,8 +89,8 @@ export default {
allchecked
:
true
,
// checked:true,
goods
:
[],
//购物车商品信息
loginInfo
:
""
,
imgPath
:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309'
loginInfo
:
""
,
imgPath
:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic3%2Fcover%2F01%2F82%2F40%2F596fa6dc00bb4_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1633499781&t=d37222e32213957ddbdd01d62e071309'
,
}
},
created
()
{
...
...
@@ -128,9 +128,13 @@ export default {
},
//跳转到结算
saveReserve
(
e
)
{
if
(
this
.
totalPrice
<
0
||
this
.
totalNum
<=
0
)
{
uni
.
showToast
({
title
:
'请选择商品'
,
icon
:
'error'
})
return
;
}
let
Authorization
=
uni
.
getStorageSync
(
'Authorization'
);
let
shopCarInfo
=
uni
.
getStorageSync
(
'shopCarInfo'
).
filter
(
v
=>
v
.
flag
==
true
);
if
(
shopCarInfo
&&
this
.
totalPrice
>
0
&&
this
.
totalNum
>
0
)
{
if
(
shopCarInfo
)
{
if
(
Authorization
)
{
uni
.
navigateTo
({
url
:
`/orderSubPackage/pages/settlement/index?buyType=1`
...
...
@@ -192,9 +196,10 @@ export default {
this
.
goods
.
forEach
(
function
(
val
)
{
s
+=
Number
(
val
.
num
);
},
0
);
if
(
s
>=
9
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
s
>=
countOfOrder
)
{
uni
.
showToast
({
title
:
'最多可一次购买
9
杯'
,
title
:
'最多可一次购买
'
+
countOfOrder
+
'
杯'
,
icon
:
'none'
});
return
;
...
...
@@ -211,7 +216,7 @@ export default {
totalNum
()
{
let
totalNum
=
0
;
this
.
goods
.
map
(
item
=>
{
item
.
flag
?
totalNum
+=
item
.
num
:
totalNum
+=
0
item
.
flag
?
totalNum
+=
parseInt
(
item
.
num
)
:
totalNum
+=
0
})
return
totalNum
},
...
...
menuSubPackage/pages/goodsDetail/goodsDetail.vue
View file @
4bf5da33
...
...
@@ -191,11 +191,12 @@ export default {
}
},
addGood
()
{
if
(
this
.
size
<
9
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
this
.
size
<
countOfOrder
)
{
this
.
size
=
this
.
size
+
1
;
}
else
{
uni
.
showToast
({
title
:
'最多可一次购买
9
杯'
,
title
:
'最多可一次购买
'
+
countOfOrder
+
'
杯'
,
icon
:
'none'
,
});
}
...
...
pages/menu/menu.vue
View file @
4bf5da33
...
...
@@ -126,7 +126,7 @@ export default {
getShopMenus
(
params
)
{
$EventBus
.
$off
(
'getMenuList'
);
$EventBus
.
$on
(
'getMenuList'
,
(
data
)
=>
{
console
.
log
(
"shop:"
+
data
.
id
);
console
.
log
(
"shop:"
+
JSON
.
stringify
(
data
)
);
if
(
this
.
shopInfo
&&
this
.
shopInfo
.
id
!=
data
.
id
)
{
// 切换店铺清空购物车
uni
.
removeStorageSync
(
'shopCarInfo'
);
...
...
@@ -234,9 +234,11 @@ export default {
},
async
getMenuList
(
id
)
{
let
{
data
}
=
await
Menu
.
getMenuList
(
id
);
console
.
log
(
"menus:"
+
JSON
.
stringify
(
data
));
if
(
data
.
code
==
200
)
{
data
.
data
=
data
.
data
;
this
.
$store
.
commit
(
'setMenuAllInfo'
,
data
.
data
);
uni
.
setStorageSync
(
'countOfOrder'
,
parseInt
(
data
.
data
.
countOfOrder
));
this
.
$refs
.
MenuAssembly
.
createList
(
data
.
data
.
categorys
)
}
},
...
...
pages/order/order.vue
View file @
4bf5da33
...
...
@@ -127,22 +127,37 @@ export default {
}
},
async
oneMoreOrder
(
item
)
{
// 清空购物车
uni
.
removeStorageSync
(
'shopCarInfo'
);
$EventBus
.
$emit
(
'updateCar'
);
//
const
numObj
=
{}
const
{
id
,
shopId
,
orderDetails
}
=
item
;
orderDetails
.
forEach
(
item
=>
{
orderDetails
[
item
.
skuId
]
=
item
.
num
})
const
{
data
}
=
await
order
.
moreOrder
({
orderId
:
id
,
shopId
});
if
(
!
data
||
!
data
.
data
){
uni
.
showToast
({
title
:
"该订单中的商品已经售罄了"
});
return
;
}
let
list
=
new
Array
();
data
.
data
.
forEach
(
item
=>
{
const
skuId
=
item
.
skus
[
0
].
skuId
const
nextData
=
{
...
item
,
skuId
,
num
:
orderDetails
[
skuId
],
flag
:
true
,
sku
:
item
.
skus
[
0
]
}
if
(
nextData
.
sku
.
state
==
1
)
{
Utils
.
getallNum
(
nextData
)
list
.
push
(
nextData
);
}
});
uni
.
switchTab
({
url
:
'/pages/menu/menu'
})
if
(
!
list
||
list
.
length
<=
0
)
{
uni
.
showToast
({
title
:
"该订单中的商品已经售罄了"
,
icon
:
'error'
});
return
;
}
list
.
forEach
(
nextData
=>
{
Utils
.
getallNum
(
nextData
);
})
uni
.
switchTab
({
url
:
'/pages/menu/menu'
});
},
async
getList
()
{
if
(
!
this
.
userms
)
return
...
...
utils/utils.js
View file @
4bf5da33
...
...
@@ -47,9 +47,10 @@ export default {
let
shopCarInfo
=
uni
.
getStorageSync
(
'shopCarInfo'
)
||
[];
let
size
=
0
;
shopCarInfo
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
if
(
size
>=
9
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
size
>=
countOfOrder
)
{
uni
.
showToast
({
title
:
'最多可一次购买
9
杯'
,
title
:
'最多可一次购买
'
+
countOfOrder
+
'
杯'
,
icon
:
'none'
,
});
return
false
;
...
...
@@ -77,9 +78,10 @@ export default {
let
goodsList
=
[];
let
size
=
0
;
goodsList
.
forEach
((
item
)
=>
(
size
+=
item
.
num
));
if
(
size
>=
9
)
{
let
countOfOrder
=
uni
.
getStorageSync
(
'countOfOrder'
);
if
(
size
>=
countOfOrder
)
{
uni
.
showToast
({
title
:
'最多可一次购买
9
杯'
,
title
:
'最多可一次购买
'
+
countOfOrder
+
'
杯'
,
icon
:
'none'
,
});
return
false
;
...
...
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