Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
group-buy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
group-buy-ui
Commits
928917fa
Commit
928917fa
authored
Sep 27, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 根据各种状态判断商品详情的按钮展示
parent
2d8d5a84
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
27 deletions
+51
-27
bottomNav.vue
src/views/goodsDetail/components/bottomNav.vue
+39
-13
groupDescInfo.vue
src/views/goodsDetail/components/groupDescInfo.vue
+4
-6
index.vue
src/views/goodsDetail/index.vue
+7
-8
smallPic.less
src/views/goodsDetail/smallPic.less
+1
-0
No files found.
src/views/goodsDetail/components/bottomNav.vue
View file @
928917fa
<
template
>
<div
class=
"goods-bottom"
>
<template
v-if=
"status == 1"
>
<template
v-if=
"groupId"
>
<template
v-if=
"!groupId"
>
<cr-button
shape=
"circle"
:disabled=
"disabled"
type=
"primary"
block
@
click=
"createOrJoin(1)"
>
立即开团
</cr-button>
</
template
>
<
template
v-else
>
<cr-button
class=
"mutiplie"
plain
...
...
@@ -11,7 +22,9 @@
@
click=
"createOrJoin(2)"
>
自己做团长
</cr-button
>
<!-- canJoinGroupBuyAgain -> 是否可以参团 groupBuyStatus 1->拼团中 -->
<cr-button
v-if=
"info.canJoinGroupBuyAgain && info.groupBuyStatus == 1"
class=
"mutiplie"
shape=
"circle"
:disabled=
"disabled"
...
...
@@ -22,22 +35,29 @@
立即参团
</cr-button>
</
template
>
<
template
v-else
>
<cr-button
shape=
"circle"
:disabled=
"disabled"
type=
"primary"
block
@
click=
"createOrJoin(1)"
>
立即开团
</cr-button>
</
template
>
</template>
<
template
v-else
>
<cr-button
shape=
"circle"
:disabled=
"disabled"
type=
"primary"
block
@
click=
"shareTo"
>
<cr-button
v-if=
"info.groupBuyStatus == 1 || info.groupBuyStatus == 0"
shape=
"circle"
:disabled=
"disabled"
type=
"primary"
block
@
click=
"shareTo"
>
邀请好友
</cr-button>
<cr-button
v-else
shape=
"circle"
plain
:disabled=
"disabled"
type=
"primary"
block
@
click=
"toList"
>
查看其他商品
</cr-button>
</
template
>
</div>
</template>
...
...
@@ -74,6 +94,12 @@ export default {
};
},
methods
:
{
toList
()
{
const
{
activityId
}
=
this
.
$route
.
query
||
''
;
if
(
activityId
)
{
this
.
$router
.
push
({
name
:
'
groupBuyList
'
,
query
:
{
activityId
}
});
}
},
shareTo
()
{
// 邀请好友
this
.
$emit
(
'
share
'
);
...
...
src/views/goodsDetail/components/groupDescInfo.vue
View file @
928917fa
...
...
@@ -73,12 +73,10 @@ export default {
if
(
this
.
$refs
.
buttonArea
)
{
this
.
observer
=
new
IntersectionObserver
(
entries
=>
{
entries
.
forEach
(
item
=>
{
if
(
this
.
groupInfo
.
groupBuyStatus
==
1
)
{
if
(
item
.
intersectionRatio
==
0
)
{
this
.
$emit
(
'
changeButtonVisible
'
,
true
);
}
else
{
this
.
$emit
(
'
changeButtonVisible
'
,
false
);
}
if
(
item
.
intersectionRatio
==
0
)
{
this
.
$emit
(
'
changeButtonVisible
'
,
true
);
}
else
{
this
.
$emit
(
'
changeButtonVisible
'
,
false
);
}
});
});
...
...
src/views/goodsDetail/index.vue
View file @
928917fa
...
...
@@ -185,6 +185,7 @@
type=
"shoppingCar"
:disabled=
"false"
:group-id=
"groupId"
:info=
"detailInfo.groupBuyInfo || {}"
@
buy=
"goVccOrDetail"
/>
</div>
...
...
@@ -326,6 +327,11 @@ export default {
},
// ka渠道逻辑
goVccOrDetail
(
res
)
{
if
(
!
res
)
{
this
.
currentPopupType
=
''
;
this
.
currentPopupName
=
''
;
return
;
}
const
buttonNameMap
=
{
0
:
'
立即参团
'
,
1
:
'
立即开团
'
,
...
...
@@ -373,15 +379,8 @@ export default {
},
async
init
(
detailParam
)
{
const
[
res
]
=
await
goods
.
detailInfo
(
detailParam
);
// canJoinGroupBuyAgain groupStatus
try
{
if
(
res
.
groupBuyInfo
?.
groupId
)
{
localStorage
.
set
(
'
groupBuyGroupId
'
,
res
.
groupBuyInfo
.
groupId
||
''
);
// 设置groupBuyGroupId,用于下单
this
.
groupId
=
+
res
.
groupBuyInfo
.
groupId
||
0
;
}
if
(
res
.
groupBuyInfo
?.
joinGroup
)
{
const
query
=
{
...
this
.
$route
.
query
};
return
this
.
$router
.
replace
({
name
:
'
groupBuySkuInfoSmallPic
'
,
query
});
}
this
.
imgList
=
res
.
imageUrl
||
[];
this
.
detailInfo
=
res
;
this
.
setStartStatus
(
res
);
...
...
src/views/goodsDetail/smallPic.less
View file @
928917fa
...
...
@@ -78,6 +78,7 @@
box-sizing: border-box;
font-size: 16px;
padding: 0 @padding-sd 60px;
overflow: hidden;
}
// 头像组、团购规则等
&-product-info{
...
...
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