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
ac05b28c
Commit
ac05b28c
authored
May 22, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nativehome_tst' of
http://code.mayi888.com/chengmo/mayi-mp-shop
into nativehome_tst
parents
d8d64b5b
2ea9721a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
4 deletions
+79
-4
static/nativeComponents/GoodsList/GoodsItem/index.js
+7
-0
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+2
-2
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+8
-0
static/nativeComponents/GoodsList/index.js
+22
-0
static/nativeComponents/GoodsList/index.wxml
+23
-0
static/nativeComponents/GoodsList/index.wxss
+17
-2
No files found.
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
ac05b28c
...
@@ -29,6 +29,7 @@ const componentOptions = {
...
@@ -29,6 +29,7 @@ const componentOptions = {
isBeginSecKill
:
false
,
// 是否开始秒杀
isBeginSecKill
:
false
,
// 是否开始秒杀
isLessTenHour
:
false
,
// 秒杀活动小于 10 小时
isLessTenHour
:
false
,
// 秒杀活动小于 10 小时
currentSecKillInfo
:
{},
// 当前秒杀信息
currentSecKillInfo
:
{},
// 当前秒杀信息
priceTextStyle
:
'flex-start'
},
},
// 数据监听器
// 数据监听器
observers
:
{
observers
:
{
...
@@ -60,6 +61,12 @@ const componentOptions = {
...
@@ -60,6 +61,12 @@ const componentOptions = {
imgFillType
imgFillType
})
})
log
.
info
(
'datas'
);
log
.
info
(
'datas'
);
const
textStyle
=
{
'left'
:
'flex-start'
,
'center'
:
'center'
,
'right'
:
'flex-end'
};
this
.
setData
({
priceTextStyle
:
textStyle
[
this
.
data
.
datas
.
componentData
[
'priceTextAlign'
]]
})
},
},
// 获取当前秒杀信息
// 获取当前秒杀信息
getSecKillInfo
(
val
)
{
getSecKillInfo
(
val
)
{
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
ac05b28c
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
<view class="itemNo" wx:if="{{datas.componentData['itemNo']}}">{{items.productCode}}</view>
<view class="itemNo" wx:if="{{datas.componentData['itemNo']}}">{{items.productCode}}</view>
<view class="info-top flex">
<view class="info-top flex">
<view
<view
class="
name
"
class="
{{datas.componentData.style === 'swipe' ? 'line-clamp1' : 'name'}}
"
wx:if="{{datas.componentData['nameShow']}}"
wx:if="{{datas.componentData['nameShow']}}"
style="color:{{datas.componentData['nameColor']}};font-weight:{{datas.componentData['nameFontWeight']}};font-size:{{datas.componentData['nameFontSize']}}em;"
style="color:{{datas.componentData['nameColor']}};font-weight:{{datas.componentData['nameFontWeight']}};font-size:{{datas.componentData['nameFontSize']}}em;"
>
>
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
<!-- 底部 -->
<!-- 底部 -->
<view class="bottom" wx:if="{{datas.componentData['goodsType'] !=1}}">
<view class="bottom" wx:if="{{datas.componentData['goodsType'] !=1}}">
<!-- 价格 -->
<!-- 价格 -->
<view class="priceItem flex" style="flex-wrap:{{items && items.secondKillActivityInfoGoodsList ? 'wrap' : 'nowrap'}}">
<view class="priceItem flex" style="flex-wrap:{{items && items.secondKillActivityInfoGoodsList ? 'wrap' : 'nowrap'}}
;justify-content:{{priceTextStyle}}
">
<!-- 秒杀展示 -->
<!-- 秒杀展示 -->
<block wx:if="{{items && items.secondKillActivityInfoGoodsList}}">
<block wx:if="{{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%;">
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
ac05b28c
...
@@ -417,4 +417,11 @@ margin-right: 8rpx;
...
@@ -417,4 +417,11 @@ margin-right: 8rpx;
.price {
.price {
font-weight: 600;
font-weight: 600;
margin-top: 12rpx;
margin-top: 12rpx;
}
.line-clamp1 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
}
\ No newline at end of file
static/nativeComponents/GoodsList/index.js
View file @
ac05b28c
...
@@ -68,6 +68,8 @@ const componentOptions = {
...
@@ -68,6 +68,8 @@ const componentOptions = {
randomNumber
:
""
,
randomNumber
:
""
,
selectScreen
:
false
,
// 筛选选中状态
selectScreen
:
false
,
// 筛选选中状态
clientHeight
:
0
,
//窗口高度
clientHeight
:
0
,
//窗口高度
swipeInfo
:
[],
currentSwiperIndex
:
0
},
},
// 数据监听器
// 数据监听器
observers
:
{},
observers
:
{},
...
@@ -233,6 +235,26 @@ const componentOptions = {
...
@@ -233,6 +235,26 @@ const componentOptions = {
this
.
getInterList
(
2
);
this
.
getInterList
(
2
);
}
}
}
}
this
.
getSwipeLen
();
},
handleSwipeChange
(
e
)
{
this
.
setData
({
currentSwiperIndex
:
e
.
detail
.
current
})
},
getSwipeLen
()
{
const
goodsListLen
=
this
.
data
.
datas
.
componentData
.
goodsList
.
length
||
0
;
const
len
=
Math
.
ceil
((
goodsListLen
/
this
.
data
.
datas
.
componentData
.
columnNum
));
const
result
=
[];
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
const
itemLen
=
this
.
getSwipeItemLen
(
i
);
result
.
push
(
itemLen
)
}
this
.
setData
({
swipeInfo
:
result
});
},
getSwipeItemLen
(
index
)
{
const
goodsListLen
=
this
.
data
.
datas
.
componentData
.
goodsList
.
length
||
0
;
const
columnNum
=
this
.
data
.
datas
.
componentData
.
columnNum
;
const
total
=
(
index
+
1
)
*
columnNum
;
return
total
>
goodsListLen
?
goodsListLen
-
(
index
*
columnNum
)
:
columnNum
},
},
getProductList
(
code
,
type
)
{
getProductList
(
code
,
type
)
{
let
{
goodsSort
,
attributeValueList
}
=
this
.
data
.
datas
.
componentData
;
let
{
goodsSort
,
attributeValueList
}
=
this
.
data
.
datas
.
componentData
;
...
...
static/nativeComponents/GoodsList/index.wxml
View file @
ac05b28c
...
@@ -149,6 +149,29 @@
...
@@ -149,6 +149,29 @@
<view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
<view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
<heap-item datas="{{datas}}"></heap-item>
<heap-item datas="{{datas}}"></heap-item>
</view>
</view>
<!-- 轮播滑动 -->
<view wx:if="{{datas.componentData.style === 'swipe'}}">
<swiper bindchange="handleSwipeChange">
<block wx:for="{{swipeInfo}}">
<swiper-item>
<view style="display: grid;gap:{{datas.componentData.proGap*2}}rpx;grid-template-columns:repeat({{datas.componentData.columnNum}}, 1fr)">
<view wx:for="{{item}}" wx:for-index="indey">
<goods-item
datas="{{datas}}"
items="{{datas.componentData.goodsList[index * datas.componentData.columnNum + indey]}}"
indexs="{{index}}"
></goods-item>
</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="flex custom-indicator">
<block wx:for="{{swipeInfo}}">
<view class="custom-indicator__item {{currentSwiperIndex === index && 'custom-indicator__active'}}"></view>
</block>
</view>
</view>
<view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading && datas.componentData.style != 'rowList'}}">
<view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading && datas.componentData.style != 'rowList'}}">
<image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
<image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
没有找到商品
没有找到商品
...
...
static/nativeComponents/GoodsList/index.wxss
View file @
ac05b28c
...
@@ -207,4 +207,20 @@ image{
...
@@ -207,4 +207,20 @@ image{
color: #999;
color: #999;
font-size: 28rpx;
font-size: 28rpx;
margin-top: 10rpx;
margin-top: 10rpx;
}
}
\ No newline at end of file
.custom-indicator {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
.custom-indicator .custom-indicator__item {
width: 32rpx;
border: 2rpx solid rgba(0, 0, 0, 0.1);
}
.custom-indicator .custom-indicator__active {
border: 2rpx solid #C72A30;
}
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