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
72b3b155
Commit
72b3b155
authored
Sep 24, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加详情页分享
parent
11b38334
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
13 deletions
+48
-13
bottomNav.vue
src/views/goodsDetail/components/bottomNav.vue
+0
-5
groupDescInfo.vue
src/views/goodsDetail/components/groupDescInfo.vue
+9
-2
index.vue
src/views/goodsDetail/index.vue
+1
-1
smallPic.vue
src/views/goodsDetail/smallPic.vue
+38
-5
No files found.
src/views/goodsDetail/components/bottomNav.vue
View file @
72b3b155
...
...
@@ -42,10 +42,8 @@
</div>
</template>
<
script
>
import
goodsCheckMixin
from
'
@/mixins/goodsCheck.mixin
'
;
export
default
{
name
:
'
BottomNav
'
,
mixins
:
[
goodsCheckMixin
],
props
:
{
groupId
:
{
type
:
Number
,
...
...
@@ -83,9 +81,6 @@ export default {
createOrJoin
(
mark
)
{
// 参团
// mark 1-> 开团 2-> 参团
if
(
this
.
checkLogin
())
{
return
;
}
this
.
$emit
(
'
buy
'
,
mark
);
}
}
...
...
src/views/goodsDetail/components/groupDescInfo.vue
View file @
72b3b155
...
...
@@ -21,7 +21,12 @@
<!-- </template> -->
</div>
<div
v-if=
"showButtonGroup"
ref=
"buttonArea"
class=
"button-area"
>
<cr-button
v-if=
"groupInfo.groupBuyStatus == 1"
block
shape=
"circle"
type=
"primary"
<cr-button
v-if=
"groupInfo.groupBuyStatus == 1"
block
shape=
"circle"
type=
"primary"
@
click=
"share"
>
邀请好友
</cr-button
>
<cr-button
v-else
plain
block
shape=
"circle"
type=
"primary"
@
click=
"toList"
...
...
@@ -87,11 +92,13 @@ export default {
},
methods
:
{
toList
()
{
console
.
log
(
this
.
$route
);
const
{
activityId
}
=
this
.
$route
.
query
||
''
;
if
(
activityId
)
{
this
.
$router
.
push
({
name
:
'
groupBuyList
'
,
query
:
{
activityId
}
});
}
},
share
()
{
this
.
$emit
(
'
share
'
);
}
}
};
...
...
src/views/goodsDetail/index.vue
View file @
72b3b155
...
...
@@ -263,7 +263,7 @@ export default {
})
},
created
()
{
this
.
hasLogin
=
localStorage
.
get
(
'
vccToken
'
)
!=
'
null
'
?
true
:
false
;
this
.
hasLogin
=
localStorage
.
get
(
'
vccToken
'
)
?
true
:
false
;
this
.
detailParam
=
{
...
this
.
$route
.
query
};
localStorage
.
remove
(
'
orderData
'
);
localStorage
.
set
(
'
activityId
'
,
this
.
detailParam
.
templateId
);
// 设置活动模板id,用于下单
...
...
src/views/goodsDetail/smallPic.vue
View file @
72b3b155
...
...
@@ -65,6 +65,7 @@
:timestemp="groupTimestemp"
:show-button-group="true"
@changeButtonVisible="changeButtonVisible"
@share="setShareData"
/>
<successInfo
:group-info=
"detailInfo.groupBuyInfo ||
{}" />
<cr-divider
...
...
@@ -90,6 +91,7 @@
</div>
</div>
<bottom-nav
v-if=
"showButtonNav"
:status=
"2"
:disabled=
"false"
@
share=
"shareTo"
/>
<sharePic
ref=
"sharePic"
:share-pic-data=
"sharePicData"
@
outputPicUrl=
"outputPicUrl"
/>
</div>
</template>
<
script
>
...
...
@@ -101,6 +103,7 @@ import successInfo from '@/components/groupBuySuccessInfo';
import
rules
from
'
@/components/rules
'
;
import
groupDescInfo
from
'
./components/groupDescInfo
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
sharePic
from
'
@/components/sharePic
'
;
export
default
{
// eslint-disable-next-line vue/name-property-casing
name
:
'
goodDetail
'
,
...
...
@@ -110,7 +113,8 @@ export default {
avatorGroup
,
successInfo
,
rules
,
groupDescInfo
groupDescInfo
,
sharePic
},
data
()
{
return
{
...
...
@@ -120,6 +124,7 @@ export default {
inProgress
:
false
,
// 活动是否已经开始
countDownText
:
''
,
stockPercentage
:
0
,
sharePicData
:
{},
// 以下是原有的data
detailParam
:
{
skuNo
:
''
,
...
...
@@ -129,13 +134,11 @@ export default {
detailInfo
:
{},
imgList
:
[],
detailImgList
:
[],
// 商品详情图像展示
hasLogin
:
false
,
name
:
{},
showButtonNav
:
false
// 是否显示底部按钮
};
},
created
()
{
this
.
hasLogin
=
window
.
localStorage
.
getItem
(
'
vccToken
'
)
!=
'
null
'
?
true
:
false
;
this
.
detailParam
=
{
...
this
.
$route
.
query
};
localStorage
.
set
(
'
activityId
'
,
this
.
detailParam
.
templateId
);
// 设置活动模板id,用于下单
if
(
this
.
detailParam
.
groupBuyGroupId
)
{
...
...
@@ -159,8 +162,38 @@ export default {
},
5000
);
},
methods
:
{
shareTo
()
{
// 分享
outputPicUrl
(
res
)
{
const
shareInfo
=
{
title
:
this
.
detailInfo
.
goodsName
,
desc
:
''
,
link
:
`
${
window
.
location
.
href
}
&groupBuyGroupId=
${
this
.
groupId
}
`
||
''
,
// 页面地址
imgUrl
:
this
.
detailInfo
.
thumbImageUrl
,
// 图片地
posterUrl
:
res
||
''
};
this
.
$store
.
dispatch
(
'
goods_share_open
'
,
shareInfo
);
},
setShareData
()
{
const
avatorList
=
[];
this
.
detailInfo
.
groupBuyInfo
.
groupBuyValidUserInfoList
.
map
(
v
=>
{
avatorList
.
push
(
v
.
avatar
);
});
this
.
sharePicData
=
{
groupBuySuccessGuys
:
this
.
detailInfo
?.
groupBuyInfo
.
groupBuySuccessPersonCount
,
salePrice
:
this
.
detailInfo
.
price
,
// y
groupBuyGroupId
:
this
.
groupId
,
goodsSpecialId
:
this
.
detailParam
.
goodsSpecialId
,
openGroupCnt
:
this
.
detailInfo
?.
groupBuyInfo
.
groupBuyLimitUserCount
,
templateId
:
this
.
detailParam
.
templateId
,
templateDetailId
:
this
.
detailParam
.
templateDetailId
,
needGuys
:
this
.
detailInfo
?.
groupBuyInfo
.
groupBuyNeedUserCount
,
skuName
:
this
.
detailInfo
.
goodsName
,
// y
activityId
:
this
.
detailParam
.
activityId
,
skuImg
:
this
.
detailInfo
.
thumbImageUrl
,
// y,
activityPrice
:
this
.
detailInfo
.
activityPrice
,
// y
skuNo
:
this
.
detailParam
.
skuNo
,
peoplePhotoList
:
[
'
https://img.lkbang.net/avator/default.png
'
]
};
this
.
$refs
.
sharePic
.
createAndUploadPic
();
},
changeButtonVisible
(
res
)
{
this
.
showButtonNav
=
res
;
...
...
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