0.0.21 • Published 3 years ago

@retailwe/ui-coupon-popup v0.0.21

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

优惠券弹出框

引入

"usingComponents": {
  "wr-coupon-popup": "@retailwe/ui-coupon-popup/index"
}

代码演示

默认模式
  <wr-coupon-popup show="{{isShowCouponPop}}" wr-class="coupon-popup"  list="{{couponList}}" bind:closeCouponPopup="closeCouponPopup" bind:couponTap="couponChange" />

自定义优惠券组件模式
<wr-coupon-popup show="{{isShowCouponPop}}" wr-class="coupon-popup" isSlotCoupon="{{true}}" bind:closeCouponPopup="closeCouponPopup" bind:couponChange="couponChange">
<view slot="coupon-list">
    <view class="coupon-card" wx:for="{{coupons}}" wx:if="{{index < 10}}" wx:key="index">
    <coupon-card couponDTO="{{item}}" />
    </view>
</view>
<view slot="coupon-bottom" class="to-gain-center" wx:if="{{coupons.length > 10}}" bind:tap="toUserCenter">
    <view>领券中心查看更多</view>
    <wr-icon class="icon" name="arrow" size="24" />
</view>
</wr-coupon-popup>
enum CouponCardStatus {
  /** 普通 */
  default = 'default',
  /** 不可用 */
  useless = 'useless',
  /** 禁用 */
  disabled = 'disabled',
}

enum ButtonType {
  normal = 'normal',
  disabled = 'disabled',
}

interface CouponListItem { 
  /** 优惠券状态 */
  status: CouponCardStatus;
  /** 优惠券类型 */
  type: string;
  /** 折扣或者满减值 */
  value: string;
  /** 标签tag地址 */
  tag: string;
  /** 描述 */
  desc: string;
  /** 标题 */
  title: string;
  /** 有效时间限制 */
  timeLimit: string;
  /** 货币符号 */
  currency: string;
  /** 优惠券状图案 */
  sealImg: string;
  /** 按钮类型,正常或禁用 */
  buttonType: ButtonType;
  /** 操作按钮文案 */
  buttonText: string;
}

入参

参数说明类型默认值是否必要
list优惠券数据CouponListItem[][]
show显示隐藏Booleanfalse
title弹窗标题String优惠券
isSlotCoupon是否开启组件插槽, 开启后不需要传入 listBooleanfalse

Events

事件是否必要说明
closeCouponPopup关闭弹窗
couponTap默认模式下,点击优惠券操作按钮,回调当前点击优惠券的索引 index

外部样式类

类名说明
wr-class根节点样式类

slot

name说明
coupon-list自定义优惠券组件插槽
coupon-bottom弹出窗底部插槽
0.0.21

3 years ago

0.0.20

3 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