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
b3303c5c
Commit
b3303c5c
authored
Oct 26, 2023
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
展示优化
parent
db0347dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
static/nativeComponents/GoodsList/GoodsItem/index.js
+18
-0
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+4
-4
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+5
-2
No files found.
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
b3303c5c
...
...
@@ -31,6 +31,8 @@ const componentOptions = {
currentSecKillInfo
:
{},
// 当前秒杀信息
priceTextStyle
:
'flex-start'
,
cutPrice
:
""
,
// 砍价价格
minPrice
:
0
,
minGoodsSuggestedRetailPrice
:
0
,
},
// 数据监听器
observers
:
{
...
...
@@ -43,6 +45,12 @@ const componentOptions = {
this
.
getSecKillInfo
(
val
);
}
}
if
(
this
.
data
.
datas
.
componentData
[
'columnNum'
]
==
3
)
{
this
.
setData
({
minPrice
:
this
.
keepSelfNum
(
val
.
minPrice
||
0
),
minGoodsSuggestedRetailPrice
:
this
.
keepSelfNum
(
val
.
minGoodsSuggestedRetailPrice
||
0
)
})
}
}
},
// 组件方法
...
...
@@ -277,6 +285,16 @@ const componentOptions = {
"items.coverImage"
:
"https://cdn.mayi888.com/product/85pdScJ5ch.jpg?x-oss-process=image/resize,m_pad,limit_0,w_400,h_400"
,
})
},
keepSelfNum
(
num
)
{
let
r
;
num
=
Number
(
num
);
try
{
r
=
num
.
toString
().
split
(
"."
)[
1
].
length
;
}
catch
(
e
)
{
r
=
0
;
}
return
num
.
toFixed
(
r
);
}
},
// 组件生命周期
lifetimes
:
{
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
b3303c5c
...
...
@@ -169,7 +169,7 @@
</block>
<!-- 秒杀展示 -->
<block wx:elif="{{items && items.secondKillActivityInfoGoodsList}}">
<view class="flex" style="margin: 12rpx 0 6rpx;align-items: center;width: 100%;">
<view class="flex" style="margin: 12rpx 0 6rpx;align-items: center;width: 100%;
flex-wrap: wrap;
">
<view style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;">
¥{{ currentSecKillInfo.spikePrice }}
</view>
...
...
@@ -184,8 +184,8 @@
style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;"
wx:elif="{{datas.componentData['priceShow']}}"
>
<text>¥{{items!=null ?
items['minPrice']:
0}}</text>
<text style="font-size:24rpx;color:#999;text-decoration:line-through;" wx:if="{{items!=null&&datas.componentData['priceMarking']&&items['minGoodsSuggestedRetailPrice']&&(items['minPrice']-0<items['minGoodsSuggestedRetailPrice']-0)&&datas.componentData['columnNum']<
3}}">¥{{items['minGoodsSuggestedRetailPrice']
}}</text>
<text>¥{{items!=null ?
minPrice :
0}}</text>
<text style="font-size:24rpx;color:#999;text-decoration:line-through;" wx:if="{{items!=null&&datas.componentData['priceMarking']&&items['minGoodsSuggestedRetailPrice']&&(items['minPrice']-0<items['minGoodsSuggestedRetailPrice']-0)&&datas.componentData['columnNum']<
4}}">¥{{minGoodsSuggestedRetailPrice
}}</text>
</view>
<view class="vipPrice2 flex" wx:if="{{datas.componentData.vipPrice}}">
<view class="left" wx:if="{{items.showVipPrice==true}}">
...
...
@@ -217,7 +217,7 @@
>
已售罄
</view>
<view wx:if="{{(items&&items.totalQty-0>0||items&&items.oversoldFlag==1)&& datas.componentData['paynow']}}" catchtap="onclickBuynow">
<view wx:if="{{(items&&items.totalQty-0>0||items&&items.oversoldFlag==1)&& datas.componentData['paynow']}}" catchtap="onclickBuynow"
style="margin-left: auto;"
>
<text wx:if="{{datas.componentData.btnType<6}}" style="color:{{datas.componentData.btnColor}}" class="buy-now-icon iconfont-common {{datas.componentData.btnIcon}}"></text>
<view
wx:else
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
b3303c5c
...
...
@@ -310,7 +310,7 @@ align-items: flex-start;
}
.buy-now {
color: #ffffff;
position:
absolut
e;
position:
relativ
e;
right: 0;
bottom: 0;
border-radius: 30rpx;
...
...
@@ -327,7 +327,7 @@ align-items: flex-start;
-o-border-radius: 30rpx;
}
.buy-now-icon {
position:
absolut
e;
position:
relativ
e;
right: 0;
bottom: 2px;
font-size: 36rpx;
...
...
@@ -426,6 +426,9 @@ margin-right: 8rpx;
}
.bottom {
position: relative;
display: flex;
align-items: baseline;
flex-wrap: wrap;
}
.price {
font-weight: 600;
...
...
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