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
cb444a1e
Commit
cb444a1e
authored
Dec 07, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
快速加购
parent
bd7da9ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
10 deletions
+20
-10
src/App.vue
+1
-1
src/components/common/TwoBAddCart.vue
+6
-2
src/utils/mayi.js
+2
-2
static/nativeComponents/GoodsList/GoodsItem/index.js
+11
-5
No files found.
src/App.vue
View file @
cb444a1e
...
@@ -11,7 +11,7 @@ export default {
...
@@ -11,7 +11,7 @@ export default {
let
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
()
:
{};
let
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
()
:
{};
console
.
log
(
extConfig
,
"-----------extConfig"
);
console
.
log
(
extConfig
,
"-----------extConfig"
);
if
(
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
if
(
JSON
.
stringify
(
extConfig
)
==
"{}"
)
{
extConfig
=
process
.
env
.
NODE_ENV
==
"development"
?
{
mixid
:
"antgood"
,
shopid
:
67
}:{
"mixid"
:
"
fruit"
,
"shopid"
:
1213
};
extConfig
=
process
.
env
.
NODE_ENV
==
"development"
?
{
mixid
:
"antgood"
,
shopid
:
67
}:{
"mixid"
:
"
qiyeCT"
,
"shopid"
:
1045
};
}
}
...
...
src/components/common/TwoBAddCart.vue
View file @
cb444a1e
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</p>
</p>
<van-stepper
button-size=
"24px"
integer
:min=
"0"
<van-stepper
button-size=
"24px"
integer
:min=
"0"
:step=
"item.plusPurchaseMultiple"
:step=
"item.plusPurchaseMultiple"
:max=
"item.
oversoldFlag == 1 ? 999999 : item.
maxLimitPurchaseNum > 0 ? item.maxLimitPurchaseNum : 999999"
:max=
"item.maxLimitPurchaseNum > 0 ? item.maxLimitPurchaseNum : 999999"
@
minus=
"(e) => changeQty(item, e, 'minus')"
@
plus=
"(e) => changeQty(item, e, 'plus')"
@
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"
/>
@
blur=
"(e) => changeQty(item, e, 'blur')"
v-model=
"item.qty"
:disabled=
"item.disabled"
/>
</div>
</div>
...
@@ -195,7 +195,11 @@ export default {
...
@@ -195,7 +195,11 @@ export default {
)
{
)
{
qty
=
0
;
qty
=
0
;
}
else
{
}
else
{
qty
-=
(
data
.
plusPurchaseMultiple
-
0
||
1
)
if
(
qty
-
data
.
plusPurchaseMultiple
<
data
.
minLimitPurchaseNum
&&
data
.
minLimitPurchaseNum
>
0
)
{
qty
=
data
.
minLimitPurchaseNum
;
}
else
{
qty
-=
(
data
.
plusPurchaseMultiple
-
0
||
1
)
}
}
}
}
else
if
(
type
==
"plus"
)
{
}
else
if
(
type
==
"plus"
)
{
if
(
data
.
minLimitPurchaseNum
>
0
&&
qty
==
0
)
{
if
(
data
.
minLimitPurchaseNum
>
0
&&
qty
==
0
)
{
...
...
src/utils/mayi.js
View file @
cb444a1e
...
@@ -132,7 +132,7 @@ export function $themeToLink(data, option) {
...
@@ -132,7 +132,7 @@ export function $themeToLink(data, option) {
}
}
}
}
}
}
export
function
$themeAddToCard
(
item
,
callback
)
{
export
function
$themeAddToCard
(
item
,
callback
=
()
=>
{
}
)
{
let
errorMsg
=
""
;
let
errorMsg
=
""
;
if
(
item
.
productNature
==
5
)
{
if
(
item
.
productNature
==
5
)
{
errorMsg
=
"电子卡券不可加入购物车"
;
errorMsg
=
"电子卡券不可加入购物车"
;
...
@@ -151,7 +151,7 @@ export function $themeAddToCard(item, callback) {
...
@@ -151,7 +151,7 @@ export function $themeAddToCard(item, callback) {
}
}
cart
cart
.
addCart
([
.
addCart
([
{
productGoodsId
:
item
.
minProductGoodsId
,
qty
:
item
.
saleQty
}
{
productGoodsId
:
item
.
minProductGoodsId
,
qty
:
item
.
plusPurchaseMultiple
}
])
])
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
...
...
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
cb444a1e
...
@@ -117,12 +117,18 @@ const componentOptions = {
...
@@ -117,12 +117,18 @@ const componentOptions = {
console
.
log
(
"加入购物车"
);
console
.
log
(
"加入购物车"
);
// $themeAddToCard(this.data.items);
// $themeAddToCard(this.data.items);
console
.
log
(
app
.
globalData
.
shopInfo
.
whetherOpenEnterprisesWantGoods
-
0
,
'app.globalData.shopInfo='
)
console
.
log
(
app
.
globalData
.
shopInfo
.
whetherOpenEnterprisesWantGoods
-
0
,
'app.globalData.shopInfo='
)
let
{
whetherToEnableQuickPurchase
}
=
app
.
shop_configuration
;
if
(
app
.
globalData
.
shopInfo
.
whetherOpenEnterprisesWantGoods
-
0
==
1
)
{
if
(
whetherToEnableQuickPurchase
==
1
)
{
//
开启企业要货
加购
//
快速
加购
app
.
openTwoBAddCart
(
_
this
.
data
.
items
);
$themeAddToCard
(
this
.
data
.
items
);
}
else
{
}
else
{
app
.
openSelectGoods
(
_this
.
data
.
items
);
// 选规格加购
if
(
app
.
globalData
.
shopInfo
.
whetherOpenEnterprisesWantGoods
-
0
==
1
)
{
// 开启企业要货加购
app
.
openTwoBAddCart
(
_this
.
data
.
items
);
}
else
{
app
.
openSelectGoods
(
_this
.
data
.
items
);
}
}
}
}
else
{
}
else
{
// 进入确认订单
// 进入确认订单
...
...
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