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 = {
...
@@ -31,6 +31,8 @@ const componentOptions = {
currentSecKillInfo
:
{},
// 当前秒杀信息
currentSecKillInfo
:
{},
// 当前秒杀信息
priceTextStyle
:
'flex-start'
,
priceTextStyle
:
'flex-start'
,
cutPrice
:
""
,
// 砍价价格
cutPrice
:
""
,
// 砍价价格
minPrice
:
0
,
minGoodsSuggestedRetailPrice
:
0
,
},
},
// 数据监听器
// 数据监听器
observers
:
{
observers
:
{
...
@@ -43,6 +45,12 @@ const componentOptions = {
...
@@ -43,6 +45,12 @@ const componentOptions = {
this
.
getSecKillInfo
(
val
);
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 = {
...
@@ -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"
,
"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
:
{
lifetimes
:
{
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
b3303c5c
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
</block>
</block>
<!-- 秒杀展示 -->
<!-- 秒杀展示 -->
<block wx:elif="{{items && items.secondKillActivityInfoGoodsList}}">
<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;">
<view style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;">
¥{{ currentSecKillInfo.spikePrice }}
¥{{ currentSecKillInfo.spikePrice }}
</view>
</view>
...
@@ -184,8 +184,8 @@
...
@@ -184,8 +184,8 @@
style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;"
style="color:{{datas.componentData['priceColor']}};font-size:{{datas.componentData['priceFontSize']}}em;"
wx:elif="{{datas.componentData['priceShow']}}"
wx:elif="{{datas.componentData['priceShow']}}"
>
>
<text>¥{{items!=null ?
items['minPrice']:
0}}</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']<
3}}">¥{{items['minGoodsSuggestedRetailPrice']
}}</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>
<view class="vipPrice2 flex" wx:if="{{datas.componentData.vipPrice}}">
<view class="vipPrice2 flex" wx:if="{{datas.componentData.vipPrice}}">
<view class="left" wx:if="{{items.showVipPrice==true}}">
<view class="left" wx:if="{{items.showVipPrice==true}}">
...
@@ -217,7 +217,7 @@
...
@@ -217,7 +217,7 @@
>
>
已售罄
已售罄
</view>
</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>
<text wx:if="{{datas.componentData.btnType<6}}" style="color:{{datas.componentData.btnColor}}" class="buy-now-icon iconfont-common {{datas.componentData.btnIcon}}"></text>
<view
<view
wx:else
wx:else
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
b3303c5c
...
@@ -310,7 +310,7 @@ align-items: flex-start;
...
@@ -310,7 +310,7 @@ align-items: flex-start;
}
}
.buy-now {
.buy-now {
color: #ffffff;
color: #ffffff;
position:
absolut
e;
position:
relativ
e;
right: 0;
right: 0;
bottom: 0;
bottom: 0;
border-radius: 30rpx;
border-radius: 30rpx;
...
@@ -327,7 +327,7 @@ align-items: flex-start;
...
@@ -327,7 +327,7 @@ align-items: flex-start;
-o-border-radius: 30rpx;
-o-border-radius: 30rpx;
}
}
.buy-now-icon {
.buy-now-icon {
position:
absolut
e;
position:
relativ
e;
right: 0;
right: 0;
bottom: 2px;
bottom: 2px;
font-size: 36rpx;
font-size: 36rpx;
...
@@ -426,6 +426,9 @@ margin-right: 8rpx;
...
@@ -426,6 +426,9 @@ margin-right: 8rpx;
}
}
.bottom {
.bottom {
position: relative;
position: relative;
display: flex;
align-items: baseline;
flex-wrap: wrap;
}
}
.price {
.price {
font-weight: 600;
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