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
2c0ed44d
Commit
2c0ed44d
authored
Oct 02, 2021
by
beisir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:图片剧中
parent
1f8c8048
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
66 deletions
+90
-66
App.vue
src/App.vue
+0
-4
avatorSwiper.vue
src/components/avatorSwiper.vue
+62
-44
groupBuySuccessInfo.vue
src/components/groupBuySuccessInfo.vue
+0
-1
groupShare.vue
src/components/groupShare.vue
+7
-7
groupSwiper.vue
src/components/groupSwiper.vue
+20
-10
index.less
src/views/goodsList/index.less
+1
-0
No files found.
src/App.vue
View file @
2c0ed44d
...
@@ -23,10 +23,6 @@ import { isApp, isWxMp, isWechat } from '@/service/validation.service';
...
@@ -23,10 +23,6 @@ import { isApp, isWxMp, isWechat } from '@/service/validation.service';
import
store
from
'
@/store
'
;
import
store
from
'
@/store
'
;
import
Weapp
from
'
@/components/weapp
'
;
import
Weapp
from
'
@/components/weapp
'
;
import
goodsShare
from
'
@/components/groupShare
'
;
import
goodsShare
from
'
@/components/groupShare
'
;
// import qs from 'qs';
// console.log(
// `pages/groupbuy/webview?url=${encodeURIComponent(JSON.stringify(window.location.href))}`
// );
export
default
{
export
default
{
name
:
'
App
'
,
name
:
'
App
'
,
components
:
{
components
:
{
...
...
src/components/avatorSwiper.vue
View file @
2c0ed44d
<
template
>
<
template
>
<div
class=
"avator-swiper"
>
<div
class=
"avator-swiper"
:class=
"
{ 'swiper-disabled': !isLoop }"
>
<div
v-if=
"isLoop"
class=
"avator_left avator-swiper_item"
:class=
"
{ 'ani-left': isAddClass }">
<div
v-if=
"isLoop"
class=
"avator_left avator-swiper_item"
:class=
"
{ 'ani-left': isAddClass }">
<img
:src=
"leftImgPath"
/>
<img
:src=
"leftImgPath"
/>
</div>
</div>
...
@@ -7,18 +7,17 @@
...
@@ -7,18 +7,17 @@
<swiper-slide
<swiper-slide
v-for=
"(item, index) in avatorData"
v-for=
"(item, index) in avatorData"
:key=
"index"
:key=
"index"
:data-src=
"item.avatar"
:data-src=
"item.avatar
|| defaultImg
"
:data-name=
"item.name"
:data-name=
"item.name"
class=
"avator-swiper_item"
class=
"avator-swiper_item"
>
>
<div
class=
"avator-swiper_item"
>
<img
:src=
"(item.avatar || defaultImg) | Img2Thumb"
/>
<img
:src=
"item.avatar | Img2Thumb"
/>
</div>
</swiper-slide>
</swiper-slide>
</swiper>
</swiper>
<div
v-if=
"isLoop"
class=
"avator_right avator-swiper_item"
:class=
"
{ 'ani-right': isAddClass }">
<div
v-if=
"isLoop"
class=
"avator_right avator-swiper_item"
:class=
"
{ 'ani-right': isAddClass }">
<img
:src=
"rightImgPath"
/>
<img
:src=
"rightImgPath"
/>
</div>
</div>
<span
class=
"avator-swiper-bg"
:style=
"
{ backgroundColor: bgColor }">
</span>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -53,14 +52,16 @@ export default {
...
@@ -53,14 +52,16 @@ export default {
isAddClass
:
false
,
isAddClass
:
false
,
rightImgPath
:
''
,
rightImgPath
:
''
,
leftImgPath
:
''
,
leftImgPath
:
''
,
avatorItem
:
null
,
defaultImg
:
'
https://himg.bdimg.com/sys/portraitn/item/19e96973556e646566696e6564d8bcc080
'
,
swiperOptions
:
{
swiperOptions
:
{
loop
:
isLoop
,
loop
:
isLoop
,
initialSlide
:
0
,
initialSlide
:
0
,
slidesPerView
:
9
,
slidesPerView
:
9
,
spaceBetween
:
4
,
//
spaceBetween: 4,
cssMode
:
true
,
//
cssMode: true,
speed
:
800
,
speed
:
800
,
centeredSlides
:
true
,
centeredSlides
:
isLoop
,
centeredSlidesBounds
:
true
,
centeredSlidesBounds
:
true
,
allowTouchMove
:
false
,
allowTouchMove
:
false
,
autoplay
,
autoplay
,
...
@@ -80,9 +81,7 @@ export default {
...
@@ -80,9 +81,7 @@ export default {
vm
.
isAddClass
=
true
;
vm
.
isAddClass
=
true
;
clearTimeout
(
vm
.
timer
);
clearTimeout
(
vm
.
timer
);
vm
.
timer
=
setTimeout
(()
=>
{
vm
.
timer
=
setTimeout
(()
=>
{
isLoop
vm
.
$store
.
dispatch
(
'
goods_avator_info
'
,
{
...
vm
.
avatorItem
,
showInfo
:
true
});
?
vm
.
$store
.
dispatch
(
'
goods_avator_info
'
,
{
...
vm
.
avatorItem
,
showInfo
:
true
})
:
vm
.
oneTransLate
();
clearTimeout
(
vm
.
timer
);
clearTimeout
(
vm
.
timer
);
},
800
);
},
800
);
},
},
...
@@ -102,19 +101,21 @@ export default {
...
@@ -102,19 +101,21 @@ export default {
return
this
.
$refs
.
mySwiper
.
swiper
;
return
this
.
$refs
.
mySwiper
.
swiper
;
}
}
},
},
mounted
()
{},
mounted
()
{
if
(
!
this
.
isLoop
)
{
this
.
oneTransLate
();
}
},
beforeDestroy
()
{
beforeDestroy
()
{
this
.
$store
.
dispatch
(
'
goods_avator_info
'
,
{
showInfo
:
false
});
this
.
$store
.
dispatch
(
'
goods_avator_info
'
,
{
showInfo
:
false
});
clearTimeout
(
this
.
timer
);
clearTimeout
(
this
.
timer
);
},
},
methods
:
{
methods
:
{
oneTransLate
()
{
oneTransLate
()
{
if
(
!
this
.
isLoop
)
{
const
avatorData
=
this
.
avatorData
;
const
avatorData
=
this
.
avatorData
;
const
imgItem
=
avatorData
[
avatorData
.
length
-
1
];
const
imgItem
=
avatorData
[
avatorData
.
length
-
1
];
const
lastItem
=
{
src
:
imgItem
.
avatar
,
name
:
imgItem
.
name
,
showInfo
:
true
};
const
lastItem
=
{
src
:
imgItem
.
avatar
,
name
:
imgItem
.
name
,
showInfo
:
true
};
this
.
$store
.
dispatch
(
'
goods_avator_info
'
,
lastItem
);
this
.
$store
.
dispatch
(
'
goods_avator_info
'
,
lastItem
);
}
},
},
// setTranslate() {
// setTranslate() {
// const slides = this.swiper.slides;
// const slides = this.swiper.slides;
...
@@ -159,22 +160,28 @@ export default {
...
@@ -159,22 +160,28 @@ export default {
animation: bigToSamll 0.8s linear;
animation: bigToSamll 0.8s linear;
}
}
.ani-right {
.ani-right {
transform-origin:
center
;
transform-origin:
left
;
animation: samllToBig 0.8s linear;
animation: samllToBig 0.8s linear;
}
}
.avator-swiper-bg {
width: 4px;
height: 24px;
position: absolute;
top: 0;
right: -2px;
z-index: 2;
background-color: #f7f8f9;
}
.ani-opt {
.ani-opt {
opacity: 0;
opacity: 0;
transition: 0.1s linear;
}
}
.avator_left,
.avator_left,
.avator_right {
.avator_right {
backface-visibility: hidden;
perspective: 1000;
position: absolute;
position: absolute;
top: 0;
top: 0;
}
}
.avator_right {
.avator_right {
right:
0
px;
right:
4
px;
}
}
.avator_left {
.avator_left {
left: 0px;
left: 0px;
...
@@ -182,41 +189,45 @@ export default {
...
@@ -182,41 +189,45 @@ export default {
.avator-swiper {
.avator-swiper {
position: relative;
position: relative;
width: 26
2
px;
width: 26
1
px;
margin: 0 auto;
margin: 0 auto;
&_item {
&_item {
height:
32
px;
height:
25
px;
width: 25px;
width: 25px;
display: flex;
transition: transform 0 0.2s linear;
align-items: center;
box-sizing: border-box;
justify-content: center;
// display: flex;
// align-items: center;
// justify-content: center;
// transform: scale(1);
// transform: scale(1);
// transition: transform 0 0.2s linear;
// transition: transform 0 0.2s linear;
img {
img {
display: block;
height: 25px;
height: 25px;
width: 25px;
width: 25px;
border-radius: 50%;
border-radius: 50%;
box-sizing: border-box;
}
}
}
}
}
}
.swiper-slide {
//
.swiper-slide {
text-align: center;
//
text-align: center;
/* Center slide text vertically */
//
/* Center slide text vertically */
display: -webkit-box;
//
display: -webkit-box;
display: -ms-flexbox;
//
display: -ms-flexbox;
display: -webkit-flex;
//
display: -webkit-flex;
display: flex;
//
display: flex;
-webkit-box-pack: center;
//
-webkit-box-pack: center;
-ms-flex-pack: center;
//
-ms-flex-pack: center;
-webkit-justify-content: center;
//
-webkit-justify-content: center;
justify-content: center;
//
justify-content: center;
-webkit-box-align: center;
//
-webkit-box-align: center;
-ms-flex-align: center;
//
-ms-flex-align: center;
-webkit-align-items: center;
//
-webkit-align-items: center;
align-items: center;
//
align-items: center;
}
//
}
// .avator-swiper_container {
// .avator-swiper_container {
// .swiper-slide-active {
// .swiper-slide-active {
// transform: scale(1.2);
// transform: scale(1.2);
...
@@ -232,4 +243,11 @@ export default {
...
@@ -232,4 +243,11 @@ export default {
// transform: scale(0.8);
// transform: scale(0.8);
// }
// }
// }
// }
.swiper-disabled {
@{deep} .swiper-wrapper {
display: flex;
justify-content: center;
}
}
</
style
>
</
style
>
src/components/groupBuySuccessInfo.vue
View file @
2c0ed44d
...
@@ -39,7 +39,6 @@ export default {
...
@@ -39,7 +39,6 @@ export default {
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.success-info {
.success-info {
.text-14();
.text-14();
width: 327px;
color: @black;
color: @black;
text-align: center;
text-align: center;
height: 90px;
height: 90px;
...
...
src/components/groupShare.vue
View file @
2c0ed44d
...
@@ -164,13 +164,13 @@ export default {
...
@@ -164,13 +164,13 @@ export default {
return
`/pages/groupbuy/webview?url=
${
encodeURIComponent
(
JSON
.
stringify
(
linkPath
))}
`
;
return
`/pages/groupbuy/webview?url=
${
encodeURIComponent
(
JSON
.
stringify
(
linkPath
))}
`
;
}
}
// // 本地测试时走的逻辑
// // 本地测试时走的逻辑
//
if (isApp) {
if
(
isApp
)
{
//
const linkPrve = `https://mall.q-gp.com/common/launch?wxapp=gh_e1d790d67513&jumpUrl=${encodeURIComponent(
const
linkPrve
=
`https://mall.q-gp.com/common/launch?wxapp=gh_e1d790d67513&jumpUrl=
${
encodeURIComponent
(
//
'pages/groupbuy/webview'
'
pages/groupbuy/webview
'
//
)}&terminal=1`;
)}
&terminal=1`
;
//
const linkParams = encodeURIComponent(JSON.stringify({ url: linkPath }));
const
linkParams
=
encodeURIComponent
(
JSON
.
stringify
({
url
:
linkPath
}));
//
return `${linkPrve}&extraInfo=${linkParams}`;
return
`
${
linkPrve
}
&extraInfo=
${
linkParams
}
`
;
//
}
}
return
linkPath
;
return
linkPath
;
},
},
shareOpenWechat
()
{
shareOpenWechat
()
{
...
...
src/components/groupSwiper.vue
View file @
2c0ed44d
<
template
>
<
template
>
<div
class=
"avator-swiper"
>
<div
class=
"avator-swiper"
:class=
"
{ 'swiper-disabled': !isLoop }"
>
<div
v-if=
"isLoop"
class=
"avator_left avator-swiper_item"
:class=
"
{ anileft: isAnimate }">
<div
v-if=
"isLoop"
class=
"avator_left avator-swiper_item"
:class=
"
{ anileft: isAnimate }">
<img
:src=
"leftImgPath"
/>
<img
:src=
"leftImgPath"
/>
</div>
</div>
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
v-for=
"(item, index) in avatorData"
v-for=
"(item, index) in avatorData"
:key=
"index"
:key=
"index"
:data-name=
"item.name"
:data-name=
"item.name"
:data-src=
"item.avatar"
:data-src=
"item.avatar
|| defaultImg
"
class=
"avator-swiper_item"
class=
"avator-swiper_item"
>
>
<img
:src=
"item.avatar"
/>
<img
:src=
"item.avatar
|| defaultImg
"
/>
</swiper-slide>
</swiper-slide>
</swiper>
</swiper>
<div
v-if=
"isLoop"
class=
"avator_right avator-swiper_item"
>
<div
v-if=
"isLoop"
class=
"avator_right avator-swiper_item"
>
...
@@ -53,6 +53,7 @@ export default {
...
@@ -53,6 +53,7 @@ export default {
leftImgPath
:
''
,
leftImgPath
:
''
,
rightImgPath
:
''
,
rightImgPath
:
''
,
avatorItem
:
null
,
avatorItem
:
null
,
defaultImg
:
'
https://himg.bdimg.com/sys/portraitn/item/19e96973556e646566696e6564d8bcc080
'
,
swiperOptions
:
{
swiperOptions
:
{
loop
:
isLoop
,
loop
:
isLoop
,
initialSlide
:
0
,
initialSlide
:
0
,
...
@@ -60,7 +61,7 @@ export default {
...
@@ -60,7 +61,7 @@ export default {
// spaceBetween: 8,
// spaceBetween: 8,
// cssMode: true,
// cssMode: true,
speed
:
600
,
speed
:
600
,
centeredSlides
:
true
,
centeredSlides
:
isLoop
,
centeredSlidesBounds
:
true
,
centeredSlidesBounds
:
true
,
allowTouchMove
:
false
,
allowTouchMove
:
false
,
autoplay
,
autoplay
,
...
@@ -80,7 +81,7 @@ export default {
...
@@ -80,7 +81,7 @@ export default {
slideRight
.
addClass
(
'
ani-opt
'
);
slideRight
.
addClass
(
'
ani-opt
'
);
clearTimeout
(
vm
.
timer
);
clearTimeout
(
vm
.
timer
);
vm
.
timer
=
setTimeout
(()
=>
{
vm
.
timer
=
setTimeout
(()
=>
{
isLoop
?
vm
.
$emit
(
'
animation-event-end
'
,
vm
.
avatorItem
)
:
vm
.
oneTransLate
(
);
vm
.
$emit
(
'
animation-event-end
'
,
vm
.
avatorItem
);
clearTimeout
(
vm
.
timer
);
clearTimeout
(
vm
.
timer
);
},
800
);
},
800
);
},
},
...
@@ -100,16 +101,18 @@ export default {
...
@@ -100,16 +101,18 @@ export default {
return
this
.
$refs
.
mySwiper
.
swiper
;
return
this
.
$refs
.
mySwiper
.
swiper
;
}
}
},
},
mounted
()
{},
mounted
()
{
if
(
!
this
.
isLoop
)
{
this
.
oneTransLate
();
}
},
destroyed
()
{
destroyed
()
{
clearTimeout
(
this
.
timer
);
clearTimeout
(
this
.
timer
);
},
},
methods
:
{
methods
:
{
oneTransLate
()
{
oneTransLate
()
{
if
(
!
this
.
isLoop
)
{
const
[
fristItem
]
=
this
.
avatorData
;
const
[
fristItem
]
=
this
.
avatorData
;
this
.
$emit
(
'
animation-event-end
'
,
{
src
:
fristItem
.
avatar
,
name
:
fristItem
.
name
});
this
.
$emit
(
'
animation-event-end
'
,
{
src
:
fristItem
.
avatar
,
name
:
fristItem
.
name
});
}
},
},
getAvatorItem
(
ele
)
{
getAvatorItem
(
ele
)
{
return
{
return
{
...
@@ -163,6 +166,7 @@ export default {
...
@@ -163,6 +166,7 @@ export default {
position: relative;
position: relative;
width: 100%;
width: 100%;
height: 24px;
height: 24px;
margin-right: -15px;
&_container {
&_container {
transition-timing-function: linear;
transition-timing-function: linear;
}
}
...
@@ -181,4 +185,10 @@ export default {
...
@@ -181,4 +185,10 @@ export default {
}
}
}
}
}
}
.swiper-disabled {
@{deep} .swiper-wrapper {
display: flex;
justify-content: right;
}
}
</
style
>
</
style
>
src/views/goodsList/index.less
View file @
2c0ed44d
.group {
.group {
font-size: @font-size-14;
font-size: @font-size-14;
// height: 100%;
position: relative;
position: relative;
&-top {
&-top {
height: 375px;
height: 375px;
...
...
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