0.0.23 • Published 3 years ago

@retailwe/ui-good-card v0.0.23

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

Card 商品卡片

引入

app.jsonindex.json中引入组件,详细介绍见快速上手

"usingComponents": {
  "wr-goods-card": "@retailwe/ui-good-card/index"
}

代码演示

基础用法

<wr-goods-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="{{ imageURL }}"
/>

高级用法

可以通过插槽添加定制内容

<wr-goods-card
  num="2"
  tag="标签"
  price="10.00"
  desc="描述信息"
  title="商品标题"
  thumb="{{ imageURL }}"
>
  <view slot="footer">
    <button size="mini">按钮</button>
    <button size="mini">按钮</button>
  </view>
</wr-goods-card>

API

Props

参数说明类型默认值说明
thumb左侧图片string--
thumb-mode左侧图片裁剪、缩放的模式,可选值参考小程序 image 组件 mode 属性值stringaspectFit-
title标题string--
desc描述string--
tag标签string--
num商品数量string | number--
price商品价格string | number--
price-fill价格是否保持两位小数booleantrue-
origin-price商品划线原价string | number--
layout图文布局stringhorizontal横向-horizontal、纵向-vertical
centered内容是否垂直居中stringfalse-
currency货币符号string¥-
thumb-link点击左侧图片后跳转的链接地址string--
link-type链接跳转类型,可选值为 redirectTo switchTab reLaunchstringnavigateTo-
lazy-load是否开启图片懒加载booleanfalse-

Slot

名称说明
title自定义标题栏,如果设置了title属性则不生效
desc自定义描述栏,如果设置了desc属性则不生效
thumb自定义 thumb,如果设置了thumb属性则不生效
bottom自定义价格下方区域
footer自定义 footer
tags自定义 tags

Events

EventDescriptionArguments
clickThumb点击商品图片触发-

外部样式类

类名说明
card-class根节点样式类
thumb-class左侧图片样式类
title-class标题样式类
price-class价格样式类
origin-price-class划线原价样式类
desc-class描述样式类
specs-class规格样式类
num-class数量样式类
0.0.22

3 years ago

0.0.23

3 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7-beta.1

4 years ago