Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
bd7da9ca
Commit
bd7da9ca
authored
Dec 06, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加购倍数
parent
a117c8b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
src/components/common/SelectGoods.vue
+9
-3
src/components/common/TwoBAddCart.vue
+5
-3
No files found.
src/components/common/SelectGoods.vue
View file @
bd7da9ca
...
...
@@ -67,6 +67,7 @@
<div
class=
"buyQty flex"
>
<div
class=
"ti"
>
购买数量
</div>
<van-stepper
:value=
"buyQty"
:step=
"product_goods_info.plusPurchaseMultiple"
:min=
"product_goods_info.productMinCount > 0 ? product_goods_info.productMinCount : 1"
:max=
"MaxQtyNum"
:disable-input=
"true"
@
change=
"changeQty"
input-class=
"ipt"
/>
</div>
...
...
@@ -113,7 +114,8 @@ export default {
sellMaxQty
:
""
,
limitQty
:
""
,
specifications
:
[],
//原规格
discountPrice
:
""
discountPrice
:
""
,
plusPurchaseMultiple
:
1
,
},
buyQty
:
1
,
goodsGuige
:
[],
...
...
@@ -215,7 +217,7 @@ export default {
this
.
productNature
=
res
.
data
.
productNature
-
0
;
// 商品开售状态 1:立刻开售,2:定时开售)
this
.
saleWay
=
res
.
data
.
saleWay
?
res
.
data
.
saleWay
-
0
:
1
;
this
.
init
();
this
.
init
(
val
);
}
})
},
...
...
@@ -223,7 +225,7 @@ export default {
this
.
show
=
false
;
},
// 初始化
async
init
()
{
async
init
(
val
)
{
let
query
=
{
productInfoId
:
val
.
productId
,
terminalProductId
:
val
.
terminalProductId
,
...
...
@@ -239,6 +241,7 @@ export default {
res
.
data
.
data
[
0
].
productGoodsMixId
;
this
.
product_goods_info
.
specifications
=
res
.
data
.
data
[
0
].
specifications
;
this
.
product_goods_info
.
oversoldFlag
=
res
.
data
.
data
[
0
].
oversoldFlag
;
this
.
product_goods_info
.
plusPurchaseMultiple
=
res
.
data
.
data
[
0
].
plusPurchaseMultiple
-
0
;
}
});
// 获取商品规格
...
...
@@ -423,6 +426,7 @@ export default {
query
.
goodsString
=
JSON
.
stringify
(
this
.
goodsString
);
query
.
maxQty
=
this
.
product_goods_info
.
maxQty
;
query
.
productMinCount
=
this
.
product_goods_info
.
productMinCount
;
query
.
plusPurchaseMultiple
=
this
.
product_goods_info
.
plusPurchaseMultiple
;
query
.
fromLived
=
1
;
query
.
liveId
=
this
.
liveId
;
this
.
show
=
false
;
...
...
@@ -482,6 +486,8 @@ export default {
Number
(
res
.
data
.
data
.
goodsSuggestedRetailPrice
);
this
.
product_goods_info
.
singleItemActivityId
=
res
.
data
.
data
.
singleItemActivityId
||
''
;
this
.
product_goods_info
.
plusPurchaseMultiple
=
res
.
data
.
data
.
plusPurchaseMultiple
-
0
||
1
;
if
(
!
getNewPrice
)
{
this
.
buyQty
=
this
.
product_goods_info
.
productMinCount
>
0
?
this
.
product_goods_info
.
productMinCount
:
1
;
...
...
src/components/common/TwoBAddCart.vue
View file @
bd7da9ca
...
...
@@ -31,6 +31,7 @@
库存:
<span
v-if=
"item.oversoldFlag == 1"
>
充足
</span><span
v-else
>
{{
item
.
saleQty
|
keepIntNum
}}
</span>
</p>
<van-stepper
button-size=
"24px"
integer
:min=
"0"
:step=
"item.plusPurchaseMultiple"
:max=
"item.oversoldFlag == 1 ? 999999 : item.maxLimitPurchaseNum > 0 ? item.maxLimitPurchaseNum : 999999"
@
minus=
"(e) => changeQty(item, e, 'minus')"
@
plus=
"(e) => changeQty(item, e, 'plus')"
@
blur=
"(e) => changeQty(item, e, 'blur')"
v-model=
"item.qty"
:disabled=
"item.disabled"
/>
...
...
@@ -154,6 +155,7 @@ export default {
item
.
disabled
=
false
;
item
.
minLimitPurchaseNum
=
item
.
minLimitPurchaseNum
-
0
;
item
.
maxLimitPurchaseNum
=
item
.
maxLimitPurchaseNum
-
0
;
item
.
plusPurchaseMultiple
=
item
.
plusPurchaseMultiple
-
0
;
item
.
discountPrice
=
item
.
discountPrice
-
0
;
item
.
goodsImgUrl
=
DFSImg
(
item
.
goodsImgUrl
);
item
.
purchased
=
0
;
...
...
@@ -193,13 +195,13 @@ export default {
)
{
qty
=
0
;
}
else
{
qty
=
Number
(
qty
)
-
1
;
qty
-=
(
data
.
plusPurchaseMultiple
-
0
||
1
)
}
}
else
if
(
type
==
"plus"
)
{
if
(
data
.
minLimitPurchaseNum
>
0
&&
qty
==
0
)
{
qty
=
data
.
minLimitPurchaseNum
;
qty
=
data
.
minLimitPurchaseNum
<
data
.
plusPurchaseMultiple
?
data
.
plusPurchaseMultiple
:
data
.
minLimitPurchaseNum
;
}
else
{
qty
=
Number
(
qty
)
+
1
;
qty
+=
(
data
.
plusPurchaseMultiple
-
0
||
1
)
}
}
else
if
(
type
==
"blur"
)
{
if
(
...
...
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