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
ff35bbf5
Commit
ff35bbf5
authored
Sep 28, 2021
by
Xuguangxing
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy
parents
ebbb2c40
89cea63d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
622 additions
and
31 deletions
+622
-31
avatorSwiper_beisir.vue
src/components/avatorSwiper_beisir.vue
+150
-0
groupShare.vue
src/components/groupShare.vue
+14
-6
groupSwiper copy.vue
src/components/groupSwiper copy.vue
+153
-0
groupSwiper.vue
src/components/groupSwiper.vue
+13
-9
swipeCustomerInfo.vue
src/components/swipeCustomerInfo.vue
+2
-2
smallPic copy.vue
src/views/goodsDetail/smallPic copy.vue
+266
-0
index.vue
src/views/goodsList/index.vue
+19
-12
List.vue
src/views/orderList/components/List.vue
+5
-2
No files found.
src/components/avatorSwiper_beisir.vue
0 → 100644
View file @
ff35bbf5
<
template
>
<div
class=
"avator-swiper"
>
<swiper
ref=
"mySwiper"
:options=
"swiperOptions"
class=
"avator-swiper_container"
@
set-translate=
"setTranslate"
>
<swiper-slide
v-for=
"(item, index) in avatorData"
:key=
"index"
class=
"avator-swiper_item"
>
<div
class=
"avator-swiper_item"
>
<img
:src=
"item | Img2Thumb"
/>
</div>
</swiper-slide>
</swiper>
</div>
</
template
>
<
script
>
import
{
swiper
,
swiperSlide
}
from
'
vue-awesome-swiper
'
;
import
'
swiper/dist/css/swiper.css
'
;
import
Img2Thumb
from
'
@/filters/img2Thumb.filter
'
;
export
default
{
name
:
'
AvatorSwiper
'
,
components
:
{
swiper
,
swiperSlide
},
filters
:
{
Img2Thumb
},
props
:
{
avatorData
:
{
type
:
Array
,
default
()
{
return
[];
}
}
},
data
()
{
const
vm
=
this
;
return
{
activeIndex
:
0
,
swiperOptions
:
{
loop
:
true
,
initialSlide
:
0
,
slidesPerView
:
9
,
spaceBetween
:
4
,
speed
:
900
,
centeredSlides
:
true
,
watchSlidesProgress
:
true
,
allowTouchMove
:
false
,
autoplay
:
false
,
on
:
{
init
:
function
()
{
const
slideLeft
=
this
.
slides
.
eq
(
this
.
activeIndex
);
console
.
log
(
slideLeft
);
// slideLeft.addClass('ani-left');
},
// transitionStart: function() {
// const activeIndex = this.activeIndex;
// const slideLeft = this.slides.eq(activeIndex);
// const slideRight = this.slides.eq(activeIndex + 7);
// vm.avatorItem = vm.getAvatorItem(slideLeft);
// vm.rightImgPath = slideRight.data('src');
// slideLeft.addClass('ani-left');
// slideRight.addClass('ani-right');
// },
transitionEnd
:
function
()
{
console
.
log
(
'
结束
'
);
vm
.
$emit
(
'
customers-end
'
,
vm
.
avatorItem
);
// // for (let i = 0; i
<
this
.
slides
.
length
;
i
++
)
{
// // let slide = this.slides.eq(i);
// // slide.removeClass('ani-left ani-right');
// // }
const
slides
=
this
.
slides
;
for
(
let
i
=
0
;
i
<
slides
.
length
;
i
++
)
{
const
slide
=
slides
.
eq
(
i
);
const
progress
=
slides
[
i
].
progress
;
slide
.
css
(
'
opacity
'
,
1
-
Math
.
abs
(
progress
)
/
9
);
slide
.
css
(
'
transform
'
,
`scale(
${
1
-
Math
.
abs
(
progress
)
/
17
}
`
);
}
}
}
}
};
},
computed
:
{
swiper
()
{
return
this
.
$refs
.
mySwiper
.
swiper
;
}
},
mounted
()
{
// this.onSlidePrevChange();
},
beforeDestroy
()
{
clearInterval
(
this
.
timer
);
// this.onSlidePrevChange();
},
methods
:
{
setTranslate
()
{
const
slides
=
this
.
swiper
.
slides
;
for
(
let
i
=
0
;
i
<
slides
.
length
;
i
++
)
{
const
slide
=
slides
.
eq
(
i
);
const
progress
=
slides
[
i
].
progress
;
slide
.
css
(
'
opacity
'
,
1
-
Math
.
abs
(
progress
)
/
9
);
slide
.
css
(
'
transform
'
,
`scale(
${
1
-
Math
.
abs
(
progress
)
/
17
}
`
);
}
},
onSlidePrevChange
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
);
this
.
timer
=
setInterval
(()
=>
{
this
.
$emit
(
'
customers-start
'
);
this
.
swiper
.
slideNext
();
},
5000
);
},
getAvatorItem
(
ele
)
{
return
{
src
:
ele
.
data
(
'
src
'
),
name
:
ele
.
data
(
'
name
'
)
};
}
}
// methods: {
// slideChange() {
// this.activeIndex = this.swiper.realIndex;
// },
// }
};
</
script
>
<
style
lang=
"less"
>
.avator-swiper {
width: 100%;
margin: 0 auto !important;
&_item {
transition: transform 0.2s linear;
height: 32px;
padding-top: 2px;
img {
height: 25px;
width: 25px;
border-radius: 50%;
}
&.active {
transform: scale(1.2);
}
}
}
</
style
>
src/components/groupShare.vue
View file @
ff35bbf5
...
@@ -59,11 +59,10 @@ export default {
...
@@ -59,11 +59,10 @@ export default {
},
},
mounted
()
{
mounted
()
{
EventBus
.
$on
(
'
goods_share_info
'
,
({
shareInfo
,
type
})
=>
{
EventBus
.
$on
(
'
goods_share_info
'
,
({
shareInfo
,
type
})
=>
{
this
.
$store
.
dispatch
(
'
change_loading
'
,
true
);
if
(
!
isApp
&&
!
isWxMp
)
{
// if (!isApp && !isWxMp) {
this
.
tipDialogMessage
();
// this.tipDialogMessage();
return
;
// return;
}
// }
this
.
type
=
type
;
this
.
type
=
type
;
if
(
typeof
shareInfo
===
'
object
'
)
{
if
(
typeof
shareInfo
===
'
object
'
)
{
this
.
sharePicData
=
shareInfo
;
this
.
sharePicData
=
shareInfo
;
...
@@ -140,7 +139,7 @@ export default {
...
@@ -140,7 +139,7 @@ export default {
};
};
switch
(
type
)
{
switch
(
type
)
{
case
0
:
case
0
:
linkPath
=
`
${
config
.
localHost
}
/groupBuy/list?activityId=
${
shareInfo
.
activityId
}
`
;
linkPath
=
`
${
config
.
localHost
}
/groupBuy/list?activityId=
${
shareInfo
.
activityId
}
&vccToken={token}
`
;
break
;
break
;
case
1
:
case
1
:
case
2
:
case
2
:
...
@@ -159,6 +158,15 @@ export default {
...
@@ -159,6 +158,15 @@ export default {
if
(
isWxMp
)
{
if
(
isWxMp
)
{
return
`/pages/groupbuy/webview?url=
${
encodeURIComponent
(
JSON
.
stringify
(
linkPath
))}
`
;
return
`/pages/groupbuy/webview?url=
${
encodeURIComponent
(
JSON
.
stringify
(
linkPath
))}
`
;
}
}
if
(
isApp
)
{
const
linkPrve
=
`https://mall.q-gp.com/common/launch?wxapp=gh_e1d790d67513&jumpUrl=
${
encodeURIComponent
(
'
pages/groupbuy/webview
'
)}
&terminal=1`
;
const
linkParams
=
encodeURIComponent
(
JSON
.
stringify
({
url
:
linkPath
}));
alert
(
linkPrve
);
alert
(
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
);
return
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
;
}
return
linkPath
;
return
linkPath
;
},
},
shareOpenWechat
()
{
shareOpenWechat
()
{
...
...
src/components/groupSwiper copy.vue
0 → 100644
View file @
ff35bbf5
<
template
>
<div
class=
"avator-swiper"
>
<swiper
ref=
"mySwiper"
:options=
"swiperOptions"
class=
"avator-swiper_container"
>
<swiper-slide
v-for=
"(item, index) in avatorData"
:key=
"index"
:data-name=
"item.name"
:data-src=
"item.avatar"
class=
"avator-swiper_item"
>
<img
:src=
"item.avatar"
/>
</swiper-slide>
</swiper>
<div
class=
"avator-swiper_right"
>
<cr-image
class=
"avator-swiper_item"
:src=
"rightImgPath"
/>
</div>
</div>
</
template
>
<
script
>
import
{
swiper
,
swiperSlide
}
from
'
vue-awesome-swiper
'
;
import
'
swiper/dist/css/swiper.css
'
;
export
default
{
name
:
'
GroupSwiper
'
,
components
:
{
swiper
,
swiperSlide
},
props
:
{
avatorData
:
{
type
:
Array
,
default
()
{
return
[];
}
}
},
data
()
{
const
vm
=
this
;
return
{
timer
:
null
,
rightImgPath
:
''
,
avatorItem
:
null
,
swiperOptions
:
{
loop
:
true
,
initialSlide
:
0
,
slidesPerView
:
7
,
spaceBetween
:
4
,
speed
:
1600
,
centeredSlides
:
true
,
watchSlidesProgress
:
true
,
allowTouchMove
:
false
,
autoplay
:
false
,
on
:
{
init
:
function
()
{
const
slideLeft
=
this
.
slides
.
eq
(
this
.
activeIndex
-
3
);
slideLeft
.
addClass
(
'
ani-left
'
);
},
transitionStart
:
function
()
{
const
activeIndex
=
this
.
activeIndex
;
const
slideLeft
=
this
.
slides
.
eq
(
activeIndex
-
3
);
const
slideRight
=
this
.
slides
.
eq
(
activeIndex
+
4
);
vm
.
avatorItem
=
vm
.
getAvatorItem
(
slideLeft
);
vm
.
rightImgPath
=
slideRight
.
data
(
'
src
'
);
slideLeft
.
addClass
(
'
ani-left
'
);
slideRight
.
addClass
(
'
ani-right
'
);
},
transitionEnd
:
function
()
{
vm
.
$emit
(
'
animation-event-end
'
,
vm
.
avatorItem
);
for
(
let
i
=
0
;
i
<
this
.
slides
.
length
;
i
++
)
{
let
slide
=
this
.
slides
.
eq
(
i
);
slide
.
removeClass
(
'
ani-left ani-right
'
);
}
}
}
}
};
},
computed
:
{
swiper
()
{
return
this
.
$refs
.
mySwiper
.
swiper
;
}
},
mounted
()
{
this
.
onSlidePrevChange
();
},
beforeDestroy
()
{
clearInterval
(
this
.
timer
);
},
methods
:
{
onSlidePrevChange
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
);
this
.
timer
=
setInterval
(()
=>
{
this
.
$emit
(
'
animation-event-start
'
);
this
.
swiper
.
slidePrev
();
},
5000
);
},
getAvatorItem
(
ele
)
{
return
{
src
:
ele
.
data
(
'
src
'
),
name
:
ele
.
data
(
'
name
'
)
};
}
}
};
</
script
>
<
style
lang=
"less"
>
@keyframes leftToRight {
from {
transform: scale(0.3, 0.3);
transform-origin: right right;
opacity: 0;
}
to {
transform: scale(1, 1);
transform-origin: left left;
opacity: 1;
}
}
.ani-left {
transform-origin: right;
animation: leftToRight 1.6s linear;
}
@keyframes scaleTo {
to {
opacity: 1;
}
}
.ani-right {
opacity: 0;
// animation: scaleTo 3s ease-out;
}
.avator-swiper {
width: 100%;
margin: 0 auto !important;
position: relative;
&_right {
height: 100%;
width: 25px;
position: absolute;
right: 3px;
top: 0px;
}
&_item {
// transition: transform 0.2s linear;
padding-top: 2px;
img {
height: 25px;
width: 25px;
border-radius: 50%;
border: solid @white 1px;
}
}
}
</
style
>
src/components/groupSwiper.vue
View file @
ff35bbf5
...
@@ -44,20 +44,20 @@ export default {
...
@@ -44,20 +44,20 @@ export default {
initialSlide
:
0
,
initialSlide
:
0
,
slidesPerView
:
7
,
slidesPerView
:
7
,
spaceBetween
:
4
,
spaceBetween
:
4
,
speed
:
7
00
,
speed
:
16
00
,
centeredSlides
:
tru
e
,
centeredSlides
:
fals
e
,
watchSlidesProgress
:
true
,
watchSlidesProgress
:
true
,
allowTouchMove
:
false
,
allowTouchMove
:
false
,
autoplay
:
false
,
autoplay
:
false
,
on
:
{
on
:
{
init
:
function
()
{
init
:
function
()
{
const
slideLeft
=
this
.
slides
.
eq
(
this
.
activeIndex
-
3
);
const
slideLeft
=
this
.
slides
.
eq
(
this
.
activeIndex
);
slideLeft
.
addClass
(
'
ani-left
'
);
slideLeft
.
addClass
(
'
ani-left
'
);
},
},
transitionStart
:
function
()
{
transitionStart
:
function
()
{
const
activeIndex
=
this
.
activeIndex
;
const
activeIndex
=
this
.
activeIndex
;
const
slideLeft
=
this
.
slides
.
eq
(
activeIndex
-
3
);
const
slideLeft
=
this
.
slides
.
eq
(
activeIndex
);
const
slideRight
=
this
.
slides
.
eq
(
activeIndex
+
4
);
const
slideRight
=
this
.
slides
.
eq
(
activeIndex
+
7
);
vm
.
avatorItem
=
vm
.
getAvatorItem
(
slideLeft
);
vm
.
avatorItem
=
vm
.
getAvatorItem
(
slideLeft
);
vm
.
rightImgPath
=
slideRight
.
data
(
'
src
'
);
vm
.
rightImgPath
=
slideRight
.
data
(
'
src
'
);
slideLeft
.
addClass
(
'
ani-left
'
);
slideLeft
.
addClass
(
'
ani-left
'
);
...
@@ -80,18 +80,19 @@ export default {
...
@@ -80,18 +80,19 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
onSlidePrevChange
();
},
beforeDestroy
()
{
clearInterval
(
this
.
timer
);
// this.onSlidePrevChange();
// this.onSlidePrevChange();
},
},
// beforeDestroy() {
// this.swiper.destroy(true);
// },
methods
:
{
methods
:
{
onSlidePrevChange
()
{
onSlidePrevChange
()
{
this
.
timer
&&
clearInterval
(
this
.
timer
);
this
.
timer
&&
clearInterval
(
this
.
timer
);
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
$emit
(
'
animation-event-start
'
);
this
.
$emit
(
'
animation-event-start
'
);
this
.
swiper
.
slidePrev
();
this
.
swiper
.
slidePrev
();
},
10
000
);
},
5
000
);
},
},
getAvatorItem
(
ele
)
{
getAvatorItem
(
ele
)
{
return
{
return
{
...
@@ -132,6 +133,9 @@ export default {
...
@@ -132,6 +133,9 @@ export default {
width: 100%;
width: 100%;
margin: 0 auto !important;
margin: 0 auto !important;
position: relative;
position: relative;
&_container {
transition-timing-function: linear;
}
&_right {
&_right {
height: 100%;
height: 100%;
width: 25px;
width: 25px;
...
...
src/components/swipeCustomerInfo.vue
View file @
ff35bbf5
...
@@ -46,8 +46,8 @@ export default {
...
@@ -46,8 +46,8 @@ export default {
}
}
},
},
watch
:
{
watch
:
{
value
(
v
)
{
value
()
{
console
.
log
(
v
);
//
console.log(v);
}
}
},
},
methods
:
{
methods
:
{
...
...
src/views/goodsDetail/smallPic copy.vue
0 → 100644
View file @
ff35bbf5
<
template
>
<div
v-if=
"Object.keys(detailInfo).length > 0"
class=
"goods"
style=
"height: 100%"
>
<!-- 主体 -->
<div
class=
"goods-container"
>
<div
class=
"goods-red-bg"
/>
<div
class=
"goods-group-buy-head-content"
>
<div
class=
"goods-group-buy-head-content-desc"
>
超值0元购,正在拼团中
</div>
<div
class=
"goods-group-buy-head-content-swipe"
>
<swipe-customer-info
v-model=
"showInfo"
direction=
"right"
/>
</div>
</div>
<div
class=
"goods-product-info"
>
<div
class=
"goods-product-info-img"
>
<span
v-if=
"detailInfo.groupBuyInfo && detailInfo.groupBuyInfo.groupBuyLimitUserCount"
class=
"goods-product-info-tag"
>
{{
detailInfo
.
groupBuyInfo
.
groupBuyLimitUserCount
}}
人团
</span
>
<cr-image
class=
"goods-product-info-img-img-box"
width=
""
height=
""
:src=
"detailInfo.thumbImageUrl"
/>
</div>
<div
class=
"goods-product-info-desc"
>
<div
class=
"goods-product-info-desc-part1"
>
<div
class=
"goods-product-info-desc-title"
>
{{
detailInfo
.
goodsName
}}
</div>
<div
class=
"goods-product-info-desc-progress"
>
<cr-progress
class=
"group-item-progress"
stroke-width=
"5"
color=
"#EC1500"
track-color=
"#F7F8F9"
:show-pivot=
"false"
:percentage=
"stockPercentage"
/>
</div>
<div
class=
"goods-product-info-desc-num"
>
已拼
{{
detailInfo
.
groupBuyInfo
?
detailInfo
.
groupBuyInfo
.
groupBuySuccessCount
:
0
}}
团
</div>
</div>
<div
class=
"goods-product-info-desc-price"
>
<div
class=
"goods-product-info-desc-price-group"
>
成团价 ¥
<span
class=
"actualPrice"
>
0
</span>
</div>
<div
class=
"goods-product-info-desc-price-market"
>
售价¥
{{
detailInfo
.
activityPrice
}}
</div>
</div>
</div>
</div>
<div
class=
"goods-group-info"
>
<div
class=
"goods-group-info-status"
>
<cr-image
v-if=
"detailInfo.groupBuyInfo.groupBuyStatus == 2"
width=
"80"
src=
"../../assets/images/success.png"
/>
<cr-image
v-if=
"detailInfo.groupBuyInfo.groupBuyStatus == 3"
width=
"80"
src=
"../../assets/images/defeat.png"
/>
</div>
<avatorGroup
:group-info=
"detailInfo.groupBuyInfo ||
{}" />
<group-desc-info
:group-info=
"detailInfo.groupBuyInfo ||
{}"
:timestemp="groupTimestemp"
:show-button-group="true"
@changeButtonVisible="changeButtonVisible"
@share="setShareData"
/>
<successInfo
:group-info=
"detailInfo.groupBuyInfo ||
{}" />
<cr-divider
hairline
:style=
"
{
borderColor: '#ECECEC'
}"
/>
<rules
:group-info=
"detailInfo.groupBuyInfo ||
{}" />
</div>
<span
v-if=
"detailImgList.length"
id=
"goodDetail"
class=
"goods-divider"
>
宝贝详情
</span>
<div
class=
"goods-detail-imgs"
>
<cr-image
v-for=
"(item, index) in detailImgList"
:key=
"index"
lazy-load
width=
""
height=
""
style=
"width: 100%; height: auto; display: block"
:src=
"item"
/>
</div>
</div>
<bottom-nav
v-if=
"showButtonNav"
:status=
"2"
:disabled=
"false"
@
share=
"setShareData"
/>
</div>
</
template
>
<
script
>
import
goods
from
'
@/api/groupBuy
'
;
import
bottomNav
from
'
./components/bottomNav
'
;
import
swipeCustomerInfo
from
'
@/components/swipeCustomerInfo
'
;
import
avatorGroup
from
'
@/components/avatorGroup
'
;
import
successInfo
from
'
@/components/groupBuySuccessInfo
'
;
import
rules
from
'
@/components/rules
'
;
import
groupDescInfo
from
'
./components/groupDescInfo
'
;
import
localStorage
from
'
@/service/localStorage.service
'
;
import
{
EventBus
}
from
'
@/service/utils.service
'
;
// import sharePic from '@/components/sharePic';
import
config
from
'
@/config
'
;
export
default
{
// eslint-disable-next-line vue/name-property-casing
name
:
'
goodDetail
'
,
components
:
{
bottomNav
,
swipeCustomerInfo
,
avatorGroup
,
successInfo
,
rules
,
groupDescInfo
// sharePic
},
data
()
{
return
{
groupTimestemp
:
''
,
// 小团结束时间
showInfo
:
false
,
countDownText
:
''
,
stockPercentage
:
0
,
shareInfo
:
{},
// 调用分享需要的参数
picUrl
:
''
,
// 海报url
// 以下是原有的data
detailParam
:
{
skuNo
:
''
,
receiverId
:
''
,
count
:
1
},
customers
:
{},
detailInfo
:
{},
imgList
:
[],
detailImgList
:
[],
// 商品详情图像展示
name
:
{},
showButtonNav
:
false
// 是否显示底部按钮
};
},
created
()
{
console
.
log
(
config
.
localHost
);
this
.
detailParam
=
{
...
this
.
$route
.
query
};
localStorage
.
set
(
'
templateId
'
,
this
.
detailParam
.
templateId
);
// 设置活动模板id,用于下单
if
(
this
.
detailParam
.
groupBuyGroupId
)
{
localStorage
.
set
(
'
groupBuyGroupId
'
,
this
.
detailParam
.
groupBuyGroupId
);
// 设置groupBuyGroupId,用于下单
this
.
groupId
=
+
this
.
detailParam
.
groupBuyGroupId
;
}
else
{
localStorage
.
remove
(
'
groupBuyGroupId
'
);
this
.
groupId
=
0
;
}
this
.
name
=
this
.
$route
.
params
;
this
.
imgList
=
[
this
.
name
.
goodsimg
];
this
.
init
(
this
.
detailParam
);
},
mounted
()
{
EventBus
.
$on
(
''
);
// todo 曝光埋点
setTimeout
(()
=>
{
this
.
showInfo
=
true
;
},
3000
);
setTimeout
(()
=>
{
this
.
showInfo
=
false
;
},
5000
);
},
methods
:
{
setShareData
()
{
const
avatorList
=
[];
if
(
this
.
detailInfo
.
groupBuyInfo
.
groupBuyValidUserInfoList
)
{
this
.
detailInfo
.
groupBuyInfo
.
groupBuyValidUserInfoList
.
map
(
v
=>
{
avatorList
.
push
(
v
.
avatar
);
});
}
const
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
:
avatorList
,
endTime
:
this
.
detailInfo
?.
groupBuyInfo
.
currentGroupEndTime
||
this
.
detailInfo
?.
endTime
||
''
};
EventBus
.
$emit
(
'
goods_share_info
'
,
{
shareInfo
:
sharePicData
,
type
:
2
});
},
changeButtonVisible
(
res
)
{
this
.
showButtonNav
=
res
;
},
async
init
(
detailParam
)
{
const
[
res
]
=
await
goods
.
detailInfo
(
detailParam
);
if
(
res
.
groupBuyInfo
.
groupId
)
{
localStorage
.
set
(
'
groupBuyGroupId
'
,
res
.
groupBuyInfo
.
groupId
||
''
);
// 设置groupBuyGroupId,用于下单
this
.
groupId
=
+
res
.
groupBuyInfo
.
groupId
||
''
;
}
if
(
res
.
saleCount
&&
res
.
activitySkuTotalCount
)
{
const
percentage
=
+
res
.
saleCount
/
+
res
.
activitySkuTotalCount
;
if
(
isNaN
(
percentage
))
{
this
.
stockPercentage
=
0
;
}
else
{
this
.
stockPercentage
=
Math
.
floor
(
percentage
)
>=
1
?
100
:
Math
.
floor
(
percentage
*
100
);
}
console
.
log
(
this
.
stockPercentage
);
}
this
.
imgList
=
res
.
imageUrl
||
[];
this
.
detailInfo
=
res
;
this
.
setStartStatus
(
res
);
try
{
const
detailImages
=
await
goods
.
getDetailPic
(
this
.
detailInfo
.
contentDetailUrl
);
// const imgReg = new RegExp('(?
<=
src
=
"
).[^
"
]
*
'
,
'
g
'
);
// this.detailImgList = (detailImages ||
''
).match(imgReg);
let imgReg = /<img.*?(?:>|
\
/>)/gi;
// eslint-disable-next-line no-useless-escape
let srcReg = /src=[
\'
"]?([^
\'
"]*)[
\'
"]?/i;
let arr = (detailImages ||
''
).match(imgReg);
let srcArr = [];
for (let i = 0; i < arr.length; i++) {
let src = arr[i].match(srcReg)[1].replace(
'
http
:
//', 'https://');
srcArr
.
push
(
src
);
}
this
.
detailImgList
=
srcArr
;
}
catch
(
error
)
{
console
.
error
(
error
);
}
},
setStartStatus
(
data
)
{
const
currentTime
=
new
Date
(
data
.
currentTime
.
replace
(
/
\-
/g
,
'
/
'
)).
getTime
();
const
activityStartTime
=
new
Date
(
data
.
startTime
.
replace
(
/
\-
/g
,
'
/
'
)).
getTime
();
const
activityEndTime
=
new
Date
(
data
.
endTime
.
replace
(
/
\-
/g
,
'
/
'
)).
getTime
();
this
.
groupTimestemp
=
data
.
groupBuyInfo
.
currentGroupEndTime
?
new
Date
(
data
.
groupBuyInfo
.
currentGroupEndTime
.
replace
(
/
\-
/g
,
'
/
'
)).
getTime
()
:
-
1
;
if
(
currentTime
<=
activityStartTime
)
{
// 当前时间小于活动开始时间
this
.
countDownText
=
'
距活动开始时间
'
;
return
;
}
if
(
currentTime
>=
activityEndTime
)
{
this
.
countDownText
=
'
活动已结束
'
;
return
;
}
if
(
currentTime
>
activityStartTime
&&
currentTime
<
activityEndTime
)
{
this
.
countDownText
=
'
距活动结束
'
;
return
;
}
}
}
};
</
script
>
<
style
lang=
"less"
src=
"./smallPic.less"
scoped
></
style
>
src/views/goodsList/index.vue
View file @
ff35bbf5
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</div>
</div>
<div
class=
"group-portrait-ul"
>
<div
class=
"group-portrait-ul"
>
<groupSwiper
<groupSwiper
v-if=
"showLoops"
v-if=
"showLoops
&& goodsTemp.groupBuyUserInfoList.length
"
ref=
"swipeRota"
ref=
"swipeRota"
:avator-data=
"goodsTemp.groupBuyUserInfoList"
:avator-data=
"goodsTemp.groupBuyUserInfoList"
@
animation-event-start=
"animationEventStart"
@
animation-event-start=
"animationEventStart"
...
@@ -141,20 +141,11 @@ export default {
...
@@ -141,20 +141,11 @@ export default {
created
()
{
created
()
{
this
.
reload
=
true
;
this
.
reload
=
true
;
},
},
mounted
()
{
this
.
showLoops
=
true
;
},
deactivated
()
{
deactivated
()
{
clearTimeout
((
this
.
$refs
.
swipeRota
&&
this
.
$refs
.
swipeRota
.
timer
)
||
null
);
this
.
showLoops
=
false
;
this
.
showLoops
=
false
;
},
},
activated
()
{
activated
()
{
this
.
showLoops
=
true
;
this
.
showLoops
=
true
;
this
.
$nextTick
(()
=>
{
console
.
log
(
this
.
$refs
.
swipeRota
);
this
.
$refs
.
swipeRota
&&
this
.
$refs
.
swipeRota
.
onSlidePrevChange
();
});
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
to
,
from
,
next
)
{
const
{
activityId
}
=
to
.
query
;
const
{
activityId
}
=
to
.
query
;
...
@@ -283,7 +274,8 @@ export default {
...
@@ -283,7 +274,8 @@ export default {
}
}
}
}
};
};
async
function
computedTemplate
(
info
)
{
async
function
computedTemplate
(
info
=
{})
{
if
(
!
Object
.
keys
(
info
).
length
)
return
info
;
info
.
endTime
=
info
.
endTime
.
replace
(
/-|
\.
/g
,
'
/
'
);
info
.
endTime
=
info
.
endTime
.
replace
(
/-|
\.
/g
,
'
/
'
);
info
.
startTime
=
info
.
startTime
.
replace
(
/-|
\.
/g
,
'
/
'
);
info
.
startTime
=
info
.
startTime
.
replace
(
/-|
\.
/g
,
'
/
'
);
const
{
endTime
,
startTime
}
=
info
;
const
{
endTime
,
startTime
}
=
info
;
...
@@ -318,7 +310,22 @@ async function getActivityList(urlQuery, next) {
...
@@ -318,7 +310,22 @@ async function getActivityList(urlQuery, next) {
// t.startTime = '2021-09-23 10:45:00';
// t.startTime = '2021-09-23 10:45:00';
// t.endTime = '2021-09-23 19:17:20';
// t.endTime = '2021-09-23 19:17:20';
t
=
await
computedTemplate
(
t
);
t
=
await
computedTemplate
(
t
);
t
.
groupBuyUserInfoList
=
t
.
groupBuyUserInfoList
.
reverse
();
t
.
groupBuyUserInfoList
=
(
t
.
groupBuyUserInfoList
||
[]).
reverse
();
// [
// {
// userTag: '团长',
// avatar: 'https://avatar.q-gp.com/14612340001/ee8991d0-1d38-11ec-b6f6-bf45b18f0626'
// },
// {
// userTag: '团长',
// avatar:
// 'https://thirdwx.qlogo.cn/mmopen/vi_32/2tyJekZCNaHnZBJicakCibFzB71ukXJRGEy6iaT44twhGLToibR9QWeyDTOjEWyVte0Zh5rrV8R9lmiazVGnia15HADA/132'
// },
// {
// avatar:
// 'https://thirdwx.qlogo.cn/mmopen/vi_32/LF7hK1yuMnxUAnx4YmjPyJCn0WqwVMplgTnDSBwwOib5uHP9fQazPf7xRXCUNEfI8sicf7boaCNoD2NUss2k7jFg/132'
// }
// ]; // (t.groupBuyUserInfoList || []).reverse();
store
.
commit
(
'
CHANGE_TITLE
'
,
t
.
title
||
'
活动页
'
);
store
.
commit
(
'
CHANGE_TITLE
'
,
t
.
title
||
'
活动页
'
);
nextFns
(
vm
=>
{
nextFns
(
vm
=>
{
topicIndex
=
0
;
topicIndex
=
0
;
...
...
src/views/orderList/components/List.vue
View file @
ff35bbf5
...
@@ -60,8 +60,11 @@
...
@@ -60,8 +60,11 @@
查看订单
查看订单
</cr-button>
</cr-button>
<!-- 支付中按钮跳转支付页面 -->
<!-- 支付中按钮跳转支付页面 -->
<!-- v-if="item.openGroupStatus === 0 && item.payStatus === '0'" -->
<cr-button
<cr-button
v-if=
"item.openGroupStatus === 0 && item.payStatus === '0'"
v-if=
"
(item.openGroupStatus == 0 || item.openGroupStatus == 1) && item.payStatus == '0'
"
size=
"small"
size=
"small"
plain
plain
type=
"primary"
type=
"primary"
...
@@ -145,7 +148,7 @@ export default {
...
@@ -145,7 +148,7 @@ export default {
3
:
{
3
:
{
class
:
'
Ol__head-fail
'
,
class
:
'
Ol__head-fail
'
,
message
:
'
拼团失败
'
,
message
:
'
拼团失败
'
,
footTxt
:
'
退款将原路返还,请注意帐户变动
'
footTxt
:
'
如已支付,
退款将原路返还,请注意帐户变动
'
}
}
}
}
};
};
...
...
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