Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
02267fd5
Commit
02267fd5
authored
Jun 21, 2023
by
hxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
砍价标识处理
parent
9a4852b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
static/nativeComponents/GoodsList/GoodsItem/index.js
+5
-1
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+9
-1
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+21
-0
No files found.
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
02267fd5
...
...
@@ -29,11 +29,15 @@ const componentOptions = {
isBeginSecKill
:
false
,
// 是否开始秒杀
isLessTenHour
:
false
,
// 秒杀活动小于 10 小时
currentSecKillInfo
:
{},
// 当前秒杀信息
priceTextStyle
:
'flex-start'
priceTextStyle
:
'flex-start'
,
cutPrice
:
""
,
// 砍价价格
},
// 数据监听器
observers
:
{
items
(
val
)
{
if
(
val
&&
val
.
cutActivityGoodsList
&&
val
.
cutActivityGoodsList
.
length
!=
0
)
{
this
.
setData
({
cutPrice
:
Number
(
val
.
cutActivityGoodsList
[
0
].
minPrice
).
toFixed
(
2
)
})
}
if
(
val
&&
val
.
secondKillActivityInfoGoodsList
&&
!
this
.
data
.
currentSecKillInfo
.
id
)
{
if
(
val
.
secondKillActivityInfoGoodsList
.
length
>
0
)
{
this
.
getSecKillInfo
(
val
);
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
02267fd5
...
...
@@ -159,8 +159,16 @@
<view class="bottom" wx:if="{{datas.componentData['goodsType'] !=1}}">
<!-- 价格 -->
<view class="priceItem flex" style="flex-wrap:{{items && items.secondKillActivityInfoGoodsList ? 'wrap' : 'nowrap'}};justify-content:{{priceTextStyle}}">
<!-- 砍价展示 -->
<block wx:if="{{items && items.cutActivityGoodsList && items.cutActivityGoodsList.length != 0}}">
<view class="flex cut-price__wrapper">
<view class="cut-price__min" style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;">¥{{ cutPrice }}</view>
<text style="font-size:24rpx;color:#999;text-decoration:line-through;margin-left:12rpx;">¥{{items.minPrice}}</text>
<view class="cut-price__tag">砍价享</view>
</view>
</block>
<!-- 秒杀展示 -->
<block wx:if="{{items && items.secondKillActivityInfoGoodsList}}">
<block wx:
el
if="{{items && items.secondKillActivityInfoGoodsList}}">
<view class="flex" style="margin: 12rpx 0 6rpx;align-items: center;width: 100%;">
<view style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;">
¥{{ currentSecKillInfo.spikePrice }}
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
02267fd5
...
...
@@ -424,4 +424,24 @@ margin-right: 8rpx;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
.cut-price__wrapper {
margin: 12rpx 0 6rpx;
display: flex;
align-items: flex-end;
flex-wrap: wrap;
}
.cut-price__wrapper .cut-price__min {
font-weight: 600;
}
.cut-price__wrapper .cut-price__tag {
font-size: 24rpx;
padding: 2rpx 8rpx;
margin-left: 12rpx;
border: 2rpx solid;
border-radius: 8rpx;
color: #C72A30;
}
\ No newline at end of file
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