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
f594431a
Commit
f594431a
authored
Jan 25, 2021
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品列表接口对接
parent
0fd2aaa7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
358 additions
and
46 deletions
+358
-46
static/font/common_icon.wxss
+96
-0
static/nativeComponents/GoodsList/GoodsItem/index.js
+5
-1
static/nativeComponents/GoodsList/GoodsItem/index.json
+3
-1
static/nativeComponents/GoodsList/GoodsItem/index.wxml
+31
-10
static/nativeComponents/GoodsList/GoodsItem/index.wxss
+43
-2
static/nativeComponents/GoodsList/index.js
+104
-29
static/nativeComponents/GoodsList/index.wxml
+42
-3
static/nativeComponents/GoodsList/index.wxss
+34
-0
No files found.
static/font/common_icon.wxss
0 → 100644
View file @
f594431a
@font-face {font-family: "iconfont-common";
src: url('//at.alicdn.com/t/font_1701913_tl1esdcjv9r.eot?t=1599790483837'); /* IE9 */
src: url('//at.alicdn.com/t/font_1701913_tl1esdcjv9r.eot?t=1599790483837#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAv4AAsAAAAAFZQAAAupAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFcgqZCJQvATYCJANUCywABCAFhUEHggAbRxJRlHFWOdnPwth5MZpRaXdXaa+yYD5eHGGF0NnvI/jaD93374Kk4iIBHZEDEhZxfI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kGw6gazFmhiiASmcY+MnKavT4NOJa/gJ4kBeMA1IQCCGJXLRtdpxPSkjkk1JylaRSNMN6VbytgkNZ9KGt7YIgs1wkGJkvGa45/q4QOIeKkHwimVE45hMxfZhOKBEW74kzbRzr4FqZlj7GYuCtRjfZIY7/UKyB7+zkreWcydnB2pTW8oF6zma3zMUkxiWohbmclbPtfhd7tynJ4TAyRhvfyeRYl+M6Onimy8a3cQZHnNnh6JofH2+csbi1VwWxTDYcliMI3YrRoi+yhQHPyji2g7iixg5Yp6Pn+ynHMXHqwLKt1oGWyHocGzvL/DASxUlY3TZXtW7S6iXUtOtmksQh3IjxVJvJYOQYzulw8niMLn29NhwDhzjmDUSX+eKlN+OqWtzBje+W6olu037VLYEhHBGIRBQSICESITGSIBpJkQzJkQJ5ISXyRtOQCvmAYNvCWh28U2jinT1Og5kTpyZBrawlSShwU4+B6nSEmeUpO++0O3lxH+/cKMfIWXtTYaJaeGNYlmQtvRYr1eOJglZV6XdBME9MoiOW+Bw9XFef/CmLtd+SXlrqcLZYWD5WZuOs/WbOajI5WWuHRcDZejhLJ3t88vZFYiLZyTfGAwAAAA==') format('woff2'),
url('//at.alicdn.com/t/font_1701913_tl1esdcjv9r.woff?t=1599790483837') format('woff'),
url('//at.alicdn.com/t/font_1701913_tl1esdcjv9r.ttf?t=1599790483837') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1701913_tl1esdcjv9r.svg?t=1599790483837#iconfont-common') format('svg'); /* iOS 4.1- */
}
.iconfont-common {
font-family: "iconfont-common" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.common-iconjiantou:before {
content: "\e618";
}
.common-icongouwuche:before {
content: "\e726";
}
.common-icon5gouwudai2:before {
content: "\e656";
}
.common-icongouwudai:before {
content: "\e600";
}
.common-icongwc:before {
content: "\e674";
}
.common-iconjiahao:before {
content: "\e620";
}
.common-iconsousuo:before {
content: "\e6a8";
}
.common-iconyoujiantou:before {
content: "\e61c";
}
.common-iconfenxiang:before {
content: "\e688";
}
.common-iconbofang:before {
content: "\e689";
}
.common-iconaixin:before {
content: "\e65c";
}
.common-iconaixin1:before {
content: "\e619";
}
.common-icondianzan:before {
content: "\e60c";
}
.common-iconbofang2:before {
content: "\e635";
}
.common-iconbofang1-copy:before {
content: "\e675";
}
.common-iconqinziAPPtubiao-:before {
content: "\e648";
}
.common-iconrenzhengguanli:before {
content: "\e650";
}
.common-iconerweima:before {
content: "\e673";
}
.common-iconjifen11:before {
content: "\e652";
}
.common-iconmoren:before {
content: "\e66b";
}
static/nativeComponents/GoodsList/GoodsItem/index.js
View file @
f594431a
...
...
@@ -17,7 +17,8 @@ const componentOptions = {
},
// 组件数据
data
:
{
isPageHidden
:
false
// 页面是否处于隐藏状态
isPageHidden
:
false
,
// 页面是否处于隐藏状态
timeData
:
{},
},
// 数据监听器
observers
:
{},
...
...
@@ -50,6 +51,9 @@ const componentOptions = {
showFlag
=
true
;
}
return
showFlag
;
},
onChange
(
e
)
{
this
.
setData
({
timeData
:
e
.
detail
});
}
},
// 组件生命周期
...
...
static/nativeComponents/GoodsList/GoodsItem/index.json
View file @
f594431a
{
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"van-count-down"
:
"/static/vant/count-down/index"
}
}
static/nativeComponents/GoodsList/GoodsItem/index.wxml
View file @
f594431a
<!-- 商品列表item -->
<view class="goodsItem" style="--proGap2:{{datas.componentData.proGap*2}}rpx;">
<view class="goodsItem
{{datas.componentData.style==='rowList'?'goodsRowList':''}}
" style="--proGap2:{{datas.componentData.proGap*2}}rpx;">
<view class="goods-item-child {{datas.componentData['borderColorShow']?'goods-item-child-bd':''}}" style="border-radius:{{datas.componentData.borderRadius}}em;--border_color:{{datas.componentData['borderColor']}};box-shadow:{{datas.componentData['cardShadow']?'0rpx 0rpx 10rpx '+datas.componentData['cardShadowSize']*2+'rpx #ccc':''}};">
<!-- 商户入口-顶部 -->
<view class="merchantsEntrance flex" wx:if="{{datas.componentData['merchantsEntrance'] && datas.componentData['merchantsEntranceType'] == 0}}">
...
...
@@ -18,11 +18,26 @@
style="padding:{{datas.componentData.imgSize}}"
>
<!-- 开启售卖 -->
<view class="saleWay" wx:if="{{items.saleWay==2 &&
getSaleTime(items.saleTime)
>0}}">
<view class="saleWay" wx:if="{{items.saleWay==2 &&
items.getSaleTime
>0}}">
<view class="saleWayBg"></view>
<view>
6545646
<view class="saleTime">
<van-count-down
use-slot
time="{{items.getSaleTime}}"
bind:change="onChange"
>
<text>距开售:</text>
<text class="block">{{ timeData.days }}</text>
<text class="colon">天</text>
<text class="block">{{ timeData.hours }}</text>
<text class="colon">时</text>
<text class="block">{{ timeData.minutes }}</text>
<text class="colon">分</text>
<text class="block">{{ timeData.seconds }}</text>
<text class="colon">秒</text>
</van-count-down>
</view>
</view>
<!-- 商品角标 -->
<view
...
...
@@ -34,12 +49,14 @@
</view>
<!-- 商品主图 -->
<image
mode="widthFix"
mode="aspectFit"
class="productImgUrl"
wx:if="{{datas.componentData.goodsImgType == 1}}"
src="{{items.productImgUrl}}"
/>
<image
mode="widthFix"
mode="aspectFit"
class="productImgUrl"
wx:else
src="{{items.coverImage}}"
/>
...
...
@@ -57,7 +74,11 @@
<view class="name" wx:if="{{datas.componentData['nameShow']}}">
{{items!=null?items['productName']:'名称'}}
</view>
<view class="follower-wrap" wx:if="{{datas.componentData['followerShow']}}">
<view
class="follower-wrap"
wx:if="{{datas.componentData['followerShow']}}"
style="padding-left:{{datas.componentData.columnNum == 3 ? '0' : '20rpx'}}"
>
<view class="follower-num" style="color:{{datas.componentData['followerColor']?datas.componentData['followerColor']:'#ff9933'}};">
{{items!=null? items['totalCollectionCount']:0}}
</view>
...
...
@@ -68,8 +89,8 @@
<view class="Sold">
<text wx:if="{{datas.componentData['alSaleShow']}}">已售{{items!=null ? items['totalSalesCount'] :0}}件</text>
<text wx:if="{{datas.componentData['alSaleShow'] && datas.componentData['collectShow']}}">/</text>
<text wx:if="{{datas.componentData['collectShow']}}">剩余{{items!=null && items['qty']!=undefined ? (items['qty'] > 0 ? items['qty']: items.oversoldFlag==1?'数量充足':'数量不足') : ''}}</text>
<
text wx:if="{{items!=null && (items['qty'] ? items['qty'] >= 0 : items['qty'] >= 0)}}">件<
/text>
<text wx:if="{{datas.componentData['collectShow']}}">剩余{{items!=null && items['qty']!=undefined ? (items['qty'] > 0 ? items['qty']: items.oversoldFlag==1?'数量充足':'数量不足') : ''}}<
text wx:if="{{items!=null && (items['qty'] ? items['qty'] >= 0 : items['saleQty'] >= 0) && items.oversoldFlag!=1}}">件<
/text>
</text>
</view>
<!-- 标签 -->
<view class="marketing flex" wx:if="{{datas.componentData['marketingTag']&&datas.componentData['marketingStyle']==0&&items.marketingTag}}">
...
...
@@ -124,7 +145,7 @@
已售罄
</view>
<view wx:if="{{(items&&items.totalQty-0>0||items&&items.oversoldFlag==1)&& datas.componentData['paynow']}}">
<text wx:if="{{datas.componentData.btnType<6}}" 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
wx:else
class="buy-now"
...
...
static/nativeComponents/GoodsList/GoodsItem/index.wxss
View file @
f594431a
@import "/static/font/common_icon.wxss";
.flex{
display: flex;
}
...
...
@@ -6,15 +7,40 @@
}
image{
width: 100%;
display: block;
}
.goodsItem{
margin-bottom: var(--proGap2);
white-space: initial;
}
.goods-item-child {
position: relative;
overflow: hidden;
background: #ffffff;
}
.goodsItem .goods-item-child{
display: flex;
align-items: flex-start;
}
.goodsItem .goods-item-child .imgBox{
width: auto;
width: 180rpx;
height: 180rpx;
margin: 20rpx;
overflow: hidden;
border-radius: 12rpx;
-webkit-border-radius: 12rpx;
-moz-border-radius: 12rpx;
-ms-border-radius: 12rpx;
-o-border-radius: 12rpx;
}
.goodsItem .goods-item-child .info{
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-around;
}
.merchantsEntrance{
padding: 8rpx 20rpx;
}
...
...
@@ -37,13 +63,17 @@ image{
position: relative;
overflow: hidden;
width: 100%;
margin: 0 auto
20rpx
;
margin: 0 auto;
}
.goodsPicture{
width: 100%;
height: 100%;
position: relative;
}
.goodsPicture .productImgUrl{
width: 100%;
height: 100%;
}
.goodsPicture .saleWay{
position: absolute;
bottom: 0;
...
...
@@ -51,6 +81,8 @@ image{
width: 100%;
display: flex;
justify-content: center;
z-index: 2;
color: #fff;
}
.goodsPicture .saleWay .saleWayBg{
background: #eee;
...
...
@@ -61,6 +93,14 @@ image{
bottom: 0;
opacity: 0.5;
}
.goodsPicture .saleWay .saleTime{
position: relative;
z-index: 2;
padding: 4rpx 0;
}
.goodsPicture .saleWay .saleTime text{
color: #fff;
}
.goodsPicture .angleSign{
position: absolute;
top: 0;
...
...
@@ -117,6 +157,7 @@ image{
color: #999;
text-align: center;
height: 70rpx;
border-left: 1px solid #999;
}
.info .follower-wrap .follower-num{
text-align: center;
...
...
@@ -204,7 +245,7 @@ image{
color: #999;
}
.Sold text{
font-size:
0.7em
;
font-size:
24rpx
;
}
.buy-now {
color: #ffffff;
...
...
static/nativeComponents/GoodsList/index.js
View file @
f594431a
...
...
@@ -14,7 +14,9 @@ const componentOptions = {
// 组件数据
data
:
{
isPageHidden
:
false
,
// 页面是否处于隐藏状态
titleIcon
:
""
,
titleIcon
:
""
,
classificationLoadPage
:
1
,
classificationLoadNum
:
10
},
// 数据监听器
observers
:
{},
...
...
@@ -68,10 +70,7 @@ const componentOptions = {
"data.datas.componentData.angleSignImg"
:
angleSignImg
,
titleIcon
});
console
.
log
(
this
.
data
.
titleIcon
,
"----------------------------68"
);
console
.
log
(
this
.
data
.
titleIcon
,
"----------------------------68"
);
if
(
goodsType
==
0
)
{
if
(
goodsSource
==
"classify"
)
{
//商品分类
...
...
@@ -95,7 +94,38 @@ const componentOptions = {
// type 1初始化 2滚动加载
//分类查
if
(
code
==
1
)
{
goodsApi
.
queryProductInfo
().
then
(
res
=>
{});
let
query
=
{
categoryId
:
this
.
data
.
datas
.
componentData
.
categoryId
,
page
:
this
.
showRowNum
()
?
1
:
this
.
data
.
datas
.
componentData
.
classificationLoadPage
,
// 当前页
rows
:
this
.
showRowNum
()
?
this
.
getItemNum
()
:
this
.
classificationLoadNum
,
// 一页多少条
sortColumn
:
this
.
data
.
datas
.
componentData
.
goodsSort
,
sortType
:
this
.
data
.
datas
.
componentData
.
goodsSort
!=
2
?
1
:
0
,
whetherShowSoldOutGoods
:
this
.
data
.
datas
.
componentData
.
whetherShowSoldOutGoods
,
//查询销售数量
whetherQueryCollectCount
:
true
,
//查询收藏数
whetherUseVirtualSalesQty
:
true
,
//是否使用虚拟销售数量
whetherUseVirtualCollectCount
:
true
,
//是否使用虚拟收藏人数
whetherFindDistributionCommission
:
this
.
whetherFindDistributionCommission
,
//是否查询商品佣金(0:不查询,1:展示,为空不查佣金)
whetherFindRecommendedCardFlag
:
this
.
data
.
datas
.
componentData
.
vipPrice
?
1
:
0
,
//是否查询会员价 1是 0否
whetherShowGoodsDefaultTagFlag
:
this
.
data
.
datas
.
componentData
.
marketingTag
?
1
:
0
,
//是否展示营销标签 1是 0否
whetherFindMultiShopFlag
:
1
,
//是否查询多商户 //商城使用
};
goodsApi
.
queryProductInfo
(
query
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
goodsList
=
res
.
data
.
data
.
list
;
this
.
goodsListVal
(
goodsList
);
}
});
}
else
{
// 商品产品详情
let
terminalProductIds
=
goodsList
.
map
(
element
=>
{
...
...
@@ -119,7 +149,9 @@ const componentOptions = {
await
goodsApi
.
queryBriefProductInfo
(
query
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
data
=
res
.
data
.
data
.
list
;
let
ids
=
data
.
map
(
element
=>
{
let
ids
=
data
.
map
(
element
=>
{
let
goodsList
=
this
.
render
?
res
.
data
.
list
:
res
.
data
.
data
.
list
;
return
element
.
terminalProductId
;
});
this
.
moreProduct
(
ids
);
...
...
@@ -132,7 +164,6 @@ const componentOptions = {
marketingTag
,
whetherFindDistributionCommission
,
goodsList
,
marketingTagList
}
=
this
.
data
.
datas
.
componentData
;
let
moreQuery
=
{
terminalProductIds
,
...
...
@@ -143,34 +174,78 @@ const componentOptions = {
whetherFindRecommendedCardFlag
:
vipPrice
?
1
:
0
,
//是否查询会员价 1是 0否
whetherShowGoodsDefaultTagFlag
:
marketingTag
?
1
:
0
,
//是否展示营销标签 1是 0否
whetherFindMultiShopFlag
:
1
,
//是否查询多商户 //商城使用
whetherFindMultiSonShopFlag
:
1
//是否查询多商户 //多主题使用
};
goodsApi
.
queryMoreProductInfo
(
moreQuery
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
goodsList
=
res
.
data
.
data
;
goodsList
.
forEach
(
item
=>
{
item
.
marketingTag
=
item
.
defaultTags
?
this
.
filtermark
(
item
.
defaultTags
,
marketingTagList
)
:
[];
item
.
shopLogoUrl
=
DFSImg
(
item
.
shopLogoUrl
);
item
.
coverImage
=
DFSImg
(
item
.
coverImage
);
item
.
productImgUrl
=
DFSImg
(
item
.
productImgUrl
);
item
.
minPrice
=
Number
(
item
.
minPrice
).
toFixed
(
2
);
item
.
qty
=
Number
(
item
.
qty
)
||
0
;
item
.
totalCollectionCount
=
Number
(
item
.
totalCollectionCount
)
||
0
;
item
.
totalCollectionCount
=
Number
(
item
.
totalCollectionCount
)
||
0
;
item
.
minPriceAfterRecommendedCardPriceTable
=
Number
(
item
.
minPriceAfterRecommendedCardPriceTable
).
toFixed
(
2
)
||
0
;
item
.
minProductGoodsCommission
=
Number
(
item
.
minProductGoodsCommission
).
toFixed
(
2
)
||
0
;
item
.
minGoodsSuggestedRetailPrice
=
Number
(
item
.
minGoodsSuggestedRetailPrice
).
toFixed
(
2
);
});
this
.
setData
({
"datas.componentData.goodsList"
:
goodsList
});
this
.
goodsListVal
(
goodsList
);
}
});
},
goodsListVal
(
goodsList
)
{
goodsList
.
forEach
(
item
=>
{
item
.
marketingTag
=
item
.
defaultTags
?
this
.
filtermark
(
item
.
defaultTags
,
this
.
data
.
datas
.
componentData
.
marketingTagList
)
:
[];
item
.
shopLogoUrl
=
DFSImg
(
item
.
shopLogoUrl
);
item
.
coverImage
=
DFSImg
(
item
.
coverImage
);
item
.
productImgUrl
=
DFSImg
(
item
.
productImgUrl
);
item
.
minPrice
=
Number
(
item
.
minPrice
).
toFixed
(
2
);
item
.
qty
=
Number
(
item
.
qty
);
item
.
saleQty
=
Number
(
item
.
saleQty
);
item
.
totalCollectionCount
=
Number
(
item
.
totalCollectionCount
)
||
0
;
item
.
totalCollectionCount
=
Number
(
item
.
totalCollectionCount
)
||
0
;
item
.
minPriceAfterRecommendedCardPriceTable
=
Number
(
item
.
minPriceAfterRecommendedCardPriceTable
).
toFixed
(
2
)
||
0
;
item
.
minProductGoodsCommission
=
Number
(
item
.
minProductGoodsCommission
).
toFixed
(
2
)
||
0
;
item
.
minGoodsSuggestedRetailPrice
=
Number
(
item
.
minGoodsSuggestedRetailPrice
).
toFixed
(
2
);
if
(
item
.
saleTime
)
{
item
.
getSaleTime
=
0
;
item
.
getSaleTime
=
this
.
getSaleTime
(
item
.
saleTime
);
}
});
setTimeout
(()
=>
{
this
.
setData
({
"datas.componentData.goodsList"
:
goodsList
});
},
0
);
},
getSaleTime
(
val
)
{
return
new
Date
(
val
.
replace
(
/-/g
,
"/"
)).
getTime
()
-
new
Date
().
getTime
();
},
getItemNum
()
{
//数量
if
(
this
.
data
.
datas
.
componentData
.
style
===
"list"
&&
this
.
data
.
datas
.
componentData
[
"goodsSource"
]
!=
"assign"
)
{
//网格模式
if
(
this
.
data
.
datas
.
componentData
.
rowNum
*
this
.
data
.
datas
.
componentData
.
columnNum
>=
this
.
data
.
datas
.
componentData
.
goodsList
.
length
)
{
return
this
.
data
.
datas
.
componentData
.
goodsList
.
length
;
}
else
{
return
(
this
.
data
.
datas
.
componentData
.
rowNum
*
this
.
data
.
datas
.
componentData
.
columnNum
);
}
}
else
{
return
this
.
data
.
datas
.
componentData
.
goodsList
.
length
;
}
},
showRowNum
()
{
return
!
(
this
.
data
.
datas
.
componentData
.
moreShow
==
false
&&
this
.
data
.
datas
.
componentData
.
getStyle
==
"waterfall"
&&
this
.
data
.
datas
.
componentData
.
goodsSource
==
"classify"
);
},
filtermark
(
newlist
,
marketingTagList
)
{
let
list
=
[];
if
(
newlist
.
length
<=
0
)
return
;
...
...
static/nativeComponents/GoodsList/index.wxml
View file @
f594431a
<!-- 商品列表组件 -->
<view class="goodsList">
<view class="goodsList"
style="padding-top:{{datas.componentData.paddingList[0].value*2}}rpx;padding-bottom:{{datas.componentData.paddingList[1].value*2}}rpx;padding-left:{{datas.componentData.paddingList[2].value*2}}rpx;padding-right:{{datas.componentData.paddingList[3].value*2}}rpx;"
>
<view class="list-wrap heap-wrap" style="background-color:{{datas.componentData['heapBgColorShow'] ? datas.componentData['heapBgColor'] : ''}};border-radius:{{datas.componentData['cardBorderRadius']*2}}rpx;">
<!-- 头部 -->
<view class="tops flex" style="padding:{{(datas.componentData['titleIcon'] || (datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='top')) ?'0rpx 0rpx 0rpx 10rpx' : ''}};margin-bottom:{{datas.componentData['titleCardGap']*2}}rpx">
...
...
@@ -23,11 +23,50 @@
<view
wx:for="{{datas.componentData.goodsList}}"
wx:key="index"
class="item"
class="goods-item"
style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
>
<goods-item
datas="{{datas}}"
items="{{datas.componentData.goodsList[index]}}"
indexs="{{index}}"
></goods-item>
</view>
</view>
<!-- 横向滚动 -->
<view class="goods-across" wx:elif="{{datas.componentData.style==='across'}}">
<view class="prev-btn">
<text class="iconfont-common common-iconyoujiantou"></text>
</view>
<view class="next-btn">
<text class="iconfont-common common-iconyoujiantou"></text>
</view>
<view
wx:for="{{datas.componentData.goodsList}}"
wx:key="index"
class="goods-item"
style="width:{{100/datas.componentData.columnNum}}%;margin-right:{{datas.componentData.proGap*2}}rpx"
>
<goods-item
datas="{{datas}}"
items="{{datas.componentData.goodsList[index]}}"
indexs="{{index}}"
></goods-item>
</view>
</view>
<!-- 横向列表 -->
<view
class="goods goods-rowList"
wx:elif="{{datas.componentData.style==='rowList'}}"
style="margin-left:{{-datas.componentData.proGap*2}}rpx;"
>
<view
wx:for="{{datas.componentData.goodsList}}"
wx:key="index"
class="goods-item"
style="width:{{100/datas.componentData.columnNum}}%;padding-left:{{datas.componentData.proGap*2}}rpx"
>
<goods-item
class="goodsItem"
datas="{{datas}}"
items="{{datas.componentData.goodsList[index]}}"
indexs="{{index}}"
...
...
static/nativeComponents/GoodsList/index.wxss
View file @
f594431a
@import "/static/font/common_icon.wxss";
.flex{
display: flex;
}
...
...
@@ -11,6 +12,9 @@ image{
.goodsList .heap-wrap{
padding: 20rpx;
}
.goods-item{
box-sizing: border-box;
}
.tops{
justify-content: space-between;
align-items: center;
...
...
@@ -51,4 +55,33 @@ image{
}
.goodsItem-list .item{
box-sizing: border-box;
}
.goods-across{
overflow-y: hidden;
overflow-X: auto;
white-space: nowrap;
padding-bottom: 10rpx;
display: flex;
align-items: flex-start;
}
.goods-across .prev-btn,.goods-across .next-btn{
position: absolute;
top: 50%;
z-index: 99;
opacity: 0.5;
}
.goods-across .prev-btn text,.goods-across .next-btn text{
font-size: 60rpx;
}
.goods-across .prev-btn{
left: 10px;
transform: rotate(180deg);
}
.goods-across .next-btn{
right: 10px;
}
.goods-across .item{
flex-shrink: 0;
display: inline-block;
box-sizing: border-box;
}
\ 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