1.0.3 • Published 3 years ago

@mas.io/mas-cs-shop-card v1.0.3

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

安装

tnpm install --save @alipay/mas-cs-shop-card

组件介绍

行业小程序门店列表组件,分为门店卡片和下方的按钮卡片两部分,两个组件可以分开使用也可以结合使用,具体看demo

参数说明

卡片组件

属性必填参数类型参数说明默认值示例
imgNstring门店图片---''
statusNstring门店状态---''
titleYstring门店名---余杭区五常街道向往街11号
tagYstring门店名后面的标签''买过
rateNnumber评分---3.8
subTitleNstring副标题---666单
addressNstring门店地址---余杭区五常街道向往街11
distanceNstring门店距离---3km
shopTagsNArrar\门店标签[]'十元优惠', '到期退款'
dataNany点击事件携带的参数值---index
onClickN(data: any) => void卡片点击事件----
onAppearN(data: any) => void卡片曝光事件----

在小程序中使用

{
  "usingComponents": {
    "shop-card": "@alipay/mas-cs-shop-card/es/index",
    "shop-card-goods": "@alipay/mas-cs-shop-card/es/goods-info/index"
  }
}

在 page.axml 中引用组件

<!-- 页面使用方式 -->
<shop-card
  title="ZJK一站式汽车服务"
    address="余杭区五常街道向往街11号"
    rate="{{ 3.8 }}"
    subTitle="666单"
    distance="3km"
    data="click data"
    status="暂停营业"
    tag="买过"
    img="https://gw.alipayobjects.com/mdn/rms_6d74f8/afts/img/A*_BBwT7BtC4UAAAAAAAAAAAAAARQnAQ"
    onClick="onClick"
    shopTags="{{ ['十元优惠', '到期退款'] }}"
>
  <block a:for="{{ 3 }}">
    <shop-card-goods
      key="{{ index }}"
      data="{{ index }}"
      name="商品名称"
      btn="购买"
      price="¥20"
      disabled="{{ false }}"
      oldPrice="门店价¥30"
      onClick="onPay"
    />
  </block>
</shop-card>

Badges

TNPM version TNPM downloads install size