赞
踩
1.使用微信提供的 send-coupon 发券插件,样式可自定义
- <send-coupon
- @customevent="getcoupon"
- :send_coupon_params="send_coupon_params" // 发券参数
- :sign="sign" //签名
- :send_coupon_merchant="send_coupon_merchant" v-if="yhqPop"> // 发券商户号
- <view class="getuhq-pop centerboth">
- <view class="yhq-pop-count">
- <view class="amtit centerboth">温馨提示:</view>
- <view class="amens centerboth">恭喜您有新的优惠券了</view>
- <view class="btn centerboth">确定</view>
- </view>
- </view>
- </send-coupon>
2.领取操作
- getcoupon: function(params) {
- this.yhqPop = false;
- }
3.领取卡券到卡包(领取会员卡操作)
- let data = res.data.data;
- // #ifdef MP-WEIXIN
- wx.addCard({
- cardList: [{
- "cardExt":'{"nonce_str":"'+data.nonce_str+'","code":"'+data.code+'","signature":"'+data.signature+'","timestamp":"'+data.timestamp+'"}',
- "cardId": data.cardId
- }],
- success(res) {
- if(res.cardList[0].isSuccess){
- uni.showToast({
- title: '领取成功',
- icon: 'none'
- })
- }
- }
- })
- // #endif

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。