Skip to content

优惠券 ​

查询领取资格,以页面或弹窗形态显示领取前后图片,并调用宿主优惠券服务。

完整信封 ​

ts
{
    component: 'v2.coupon', text: '优惠券', type: '4-1', active: true,
    props: {
        mode: 'page', popupMode: 'bottom', coupon: { id: 'coupon-1', name: '新人券' },
        before: { image: 'https://example.com/before.png', link: { httpType: 10, http: '' } },
        after: { image: 'https://example.com/after.png', link: { httpType: 10, http: '/pages/coupons' } }
    }
}

Props ​

字段类型默认值说明
mode'page' | 'popup''page'页面或弹窗展示
popupMode'bottom' | 'center''bottom'弹窗位置
couponobject | nullnull优惠券对象
before.image/linkstring / CmsV2Link空值领取前状态
after.image/linkstring / CmsV2Link空值领取后状态

coupon 可包含 id/name/newUser/startDate/endDate/url/content/remark,实际接口字段由宿主适配。领取依赖 coupon service,领取后跳转依赖 link service。

为 uni-app 商城与 CMS 场景设计