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
d265192e
Commit
d265192e
authored
Sep 10, 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
aef5e480
1f0c7ba8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
119 additions
and
17552 deletions
+119
-17552
package-lock.json
package-lock.json
+0
-17509
App.vue
src/App.vue
+0
-1
index.less
src/views/goodsList/index.less
+63
-18
index.vue
src/views/goodsList/index.vue
+56
-24
No files found.
package-lock.json
View file @
d265192e
This diff is collapsed.
Click to expand it.
src/App.vue
View file @
d265192e
...
@@ -32,7 +32,6 @@ export default {
...
@@ -32,7 +32,6 @@ export default {
header
:
{
header
:
{
immediate
:
true
,
immediate
:
true
,
handler
(
val
,
oldVal
)
{
handler
(
val
,
oldVal
)
{
console
.
log
(
val
);
if
(
val
!==
oldVal
)
{
if
(
val
!==
oldVal
)
{
document
.
body
.
className
=
val
?
'
has-header
'
:
''
;
document
.
body
.
className
=
val
?
'
has-header
'
:
''
;
}
}
...
...
src/views/goodsList/index.less
View file @
d265192e
.group {
.group {
height: 100%;
font-size: @font-size-14;
font-size: @font-size-14;
&-banner {
&-banner {
position: relative;
position: relative;
...
@@ -8,7 +7,6 @@
...
@@ -8,7 +7,6 @@
position: absolute;
position: absolute;
left: 0;
left: 0;
top: 0;
top: 0;
z-index: -1;
}
}
.banner-mark {
.banner-mark {
width: 40%;
width: 40%;
...
@@ -46,22 +44,6 @@
...
@@ -46,22 +44,6 @@
display: flex;
display: flex;
justify-content: center;
justify-content: center;
align-items: center;
align-items: center;
.colon {
display: inline-block;
margin: 0 4px;
color: #ee0a24;
}
.block {
display: inline-block;
width: 16px;
height: 16px;
line-height: 16px;
color: #fff;
font-size: 9.6px;
text-align: center;
background-color: #e82424;
border-radius: 3.2px;
}
&-label {
&-label {
font-size: 12px;
font-size: 12px;
color: #333333;
color: #333333;
...
@@ -139,7 +121,12 @@
...
@@ -139,7 +121,12 @@
font-size: @font-size-14;
font-size: @font-size-14;
color: #f70d0d;
color: #f70d0d;
margin-bottom: 4px;
margin-bottom: 4px;
font-weight: bold;
}
}
&-sup {
font-size: @font-size-18;
}
&-delprice {
&-delprice {
color: #999999;
color: #999999;
font-size: @font-size-12;
font-size: @font-size-12;
...
@@ -153,6 +140,64 @@
...
@@ -153,6 +140,64 @@
bottom: 12px;
bottom: 12px;
right: 0;
right: 0;
}
}
&.disabled {
opacity: 0.3;
.group-item-price {
color: #000;
}
}
}
.group-portrait {
&-head {
display: flex;
justify-content: space-around;
align-items: center;
}
&-num {
font-size: @font-size-12;
color: @white;
padding-top: 9px;
padding-bottom: 7px;
text-align: right;
}
&-swipe {
width: 130px;
height: 30px;
}
&-ul {
margin-left: 5px;
flex: 1;
display: flex;
justify-content: space-around;
}
&-image {
height: 23px;
width: 23px;
border: 1px solid @white;
border-radius: 50%;
margin-left: 8px;
overflow: hidden;
&:first-of-type {
margin-left: 0;
}
}
@keyframes leftToRight {
0% {
transform: translate(0);
}
100% {
transform: translate(38px);
}
}
.animateAuto {
animation: leftToRight 1s ease-in-out;
animation-fill-mode: forwards;
}
}
}
}
}
}
}
src/views/goodsList/index.vue
View file @
d265192e
<
template
>
<
template
>
<div
class=
"group"
>
<div
class=
"group"
:style=
"
{ backgroundColor: gpBackColor }"
>
<!-- 配置头部动态信息 start -->
<!-- 配置头部动态信息 start -->
<div
class=
"group-banner"
>
<div
class=
"group-banner"
>
<!-- 动态活动背景图 -->
<!-- 动态活动背景图 -->
...
@@ -16,31 +16,37 @@
...
@@ -16,31 +16,37 @@
<!-- 配置头部动态信息 end -->
<!-- 配置头部动态信息 end -->
<!-- 下方列表展示信息 start -->
<!-- 下方列表展示信息 start -->
<div
class=
"group-bottom"
:style=
"
{ backgroundColor: gpBackColor }">
<div
class=
"group-bottom"
>
<div
class=
""
/>
<div
class=
"group-portrait"
>
<div
class=
"group-portrait-head"
>
<div
class=
"group-portrait-swipe"
@
click=
"switchAnimation"
>
<swipeCustomerInfo
v-model=
"showSwipe"
/>
</div>
<ul
class=
"group-portrait-ul"
:class=
"animate"
>
<li
v-for=
"(imgItem, imgIndex) in gpImagePathArray"
:key=
"imgIndex"
class=
"group-portrait-image"
>
<cr-image
:src=
"imgItem"
/>
</li>
</ul>
</div>
<div
class=
"group-portrait-num"
@
click=
"showSwipe = !showSwipe"
>
已有 1230人 参与拼单
</div>
</div>
<div
class=
"group-list"
>
<div
class=
"group-list"
>
<div
class=
"list-title"
>
<div
class=
"list-title"
>
<b
class=
"list-title-text"
>
今日拼团
</b>
<b
class=
"list-title-text"
>
今日拼团
</b>
<div
class=
"list-count"
>
<div
class=
"list-count"
>
<span
class=
"list-count-label"
>
距结束:
</span>
<span
class=
"list-count-label"
>
距结束:
</span>
<cr-count-down
:time=
"gpCountDown"
format=
"
{d}天{h}时{m}分{s}秒">
<count-down
:end-time=
"gpCountDown"
/>
<template
#default
="
timeData
"
>
<span
class=
"block"
>
{{
timeData
.
h
|
filterTime
}}
</span>
<span
class=
"colon"
>
:
</span>
<span
class=
"block"
>
{{
timeData
.
m
|
filterTime
}}
</span>
<span
class=
"colon"
>
:
</span>
<span
class=
"block"
>
{{
timeData
.
s
|
filterTime
}}
</span>
</
template
>
</cr-count-down>
</div>
</div>
</div>
</div>
<cr-list
v-model=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"onLoad"
>
<cr-list
v-model=
"loading"
:finished=
"finished"
finished-text=
"没有更多了"
@
load=
"onLoad"
>
<dl
<dl
v-for=
"(item, index) in goodsList"
v-for=
"(item, index) in goodsList"
:key=
"index"
:key=
"index"
:thumb=
"item.thumbImageUrl || item.imageUrl"
:class=
"['group-item', index == goodsList.length - 1 ? 'disabled' : '']"
class=
"group-item"
>
>
<dt
class=
"group-item-thumb"
>
<dt
class=
"group-item-thumb"
>
<cr-image
:src=
"item.thumbImageUrl"
/>
<cr-image
:src=
"item.thumbImageUrl"
/>
...
@@ -48,6 +54,7 @@
...
@@ -48,6 +54,7 @@
</dt>
</dt>
<dd
class=
"group-item-content"
>
<dd
class=
"group-item-content"
>
<div
class=
"group-item-title"
>
{{
item
.
goodsName
}}
</div>
<div
class=
"group-item-title"
>
{{
item
.
goodsName
}}
</div>
<!-- 进度条:已瓶团消耗库村/该活动商品初始库存 -->
<cr-progress
<cr-progress
class=
"group-item-progress"
class=
"group-item-progress"
stroke-width=
"5"
stroke-width=
"5"
...
@@ -57,9 +64,13 @@
...
@@ -57,9 +64,13 @@
:percentage=
"handleProgressByStatus(item)"
:percentage=
"handleProgressByStatus(item)"
/>
/>
<div
class=
"group-item-already"
>
已拼2333团
</div>
<div
class=
"group-item-already"
>
已拼2333团
</div>
<div
class=
"group-item-price"
>
拼团价 ¥
0
</div>
<div
class=
"group-item-price"
>
拼团价 ¥
<sup
class=
"group-item-sup"
>
0
</sup>
</div>
<del
class=
"group-item-delprice"
>
¥
{{
item
.
activityPrice
}}
</del>
<del
class=
"group-item-delprice"
>
¥
{{
item
.
activityPrice
}}
</del>
<cr-button
shape=
"circle"
type=
"primary"
>
立即开团
</cr-button>
<!-- 立即开团 -->
<!-- 已抢光 -->
<!-- 未开始 -->
<!-- 已结束 -->
<cr-button
shape=
"circle"
type=
"primary"
:disabled=
"false"
>
立即开团
</cr-button>
</dd>
</dd>
</dl>
</dl>
</cr-list>
</cr-list>
...
@@ -70,6 +81,8 @@
...
@@ -70,6 +81,8 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
groupBuyApi
from
'
@/api/groupBuy
'
;
import
groupBuyApi
from
'
@/api/groupBuy
'
;
import
countDown
from
'
@/components/countDown
'
;
import
swipeCustomerInfo
from
'
@/components/swipeCustomerInfo
'
;
import
gpImagePath
from
'
@/assets/images/groupBuy/bg-top.png
'
;
import
gpImagePath
from
'
@/assets/images/groupBuy/bg-top.png
'
;
export
default
{
export
default
{
// beforeRouteEnter(to, from, next) {
// beforeRouteEnter(to, from, next) {
...
@@ -77,17 +90,30 @@ export default {
...
@@ -77,17 +90,30 @@ export default {
// },
// },
// eslint-disable-next-line vue/name-property-casing
// eslint-disable-next-line vue/name-property-casing
name
:
'
groupBuyList
'
,
name
:
'
groupBuyList
'
,
filters
:
{
components
:
{
countDown
,
swipeCustomerInfo
},
filterTime
(
time
)
{
return
time
>
9
?
time
:
'
0
'
+
time
;
}
},
data
()
{
data
()
{
return
{
return
{
animate
:
{
animateAuto
:
false
,
transition
:
true
,
blue
:
true
,
green
:
false
,
animation
:
false
},
showSwipe
:
true
,
gpImagePath
,
gpImagePath
,
gpBackColor
:
'
#FA494E
'
,
gpBackColor
:
'
#FA494E
'
,
gpImagePathArray
:
[
gpCountDown
:
30
*
60
*
60
*
1000
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_01.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_02.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_03.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_04.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_05.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_06.png
'
,
'
https://activitystatic.lkbang.net/mall-free-ui/img/avator_07.png
'
],
gpCountDown
:
new
Date
(
'
2021-09-10 00:00:00
'
).
getTime
(),
goodsList
:
[],
goodsList
:
[],
loading
:
false
,
loading
:
false
,
...
@@ -100,6 +126,10 @@ export default {
...
@@ -100,6 +126,10 @@ export default {
// todo 曝光埋点
// todo 曝光埋点
},
},
methods
:
{
methods
:
{
switchAnimation
()
{
this
.
animate
.
animateAuto
=
!
this
.
animate
.
animateAuto
;
},
onLoad
()
{
onLoad
()
{
// 异步更新数据
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
...
@@ -125,8 +155,10 @@ export default {
...
@@ -125,8 +155,10 @@ export default {
const
{
showSaleCount
,
goodsCount
}
=
item
;
const
{
showSaleCount
,
goodsCount
}
=
item
;
percentage
=
(
goodsCount
/
(
goodsCount
+
showSaleCount
))
*
100
;
percentage
=
(
goodsCount
/
(
goodsCount
+
showSaleCount
))
*
100
;
percentage
=
percentage
<
0
?
0
:
percentage
;
percentage
=
percentage
<
0
?
0
:
percentage
;
// console.log(percentage);
// percentage = !this.topicCfg.hasStart ? 0 : percentage;
// percentage = !this.topicCfg.hasStart ? 0 : percentage;
return
Math
.
round
(
percentage
*
100
)
/
100
;
return
Math
.
round
(
percentage
*
100
)
/
100
;
// return 70;
},
},
async
getGoodsList
()
{
async
getGoodsList
()
{
// const { pageSize, pageNo, activityId } = this;
// const { pageSize, pageNo, activityId } = this;
...
...
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