| | |
| | | <!-- 商品图片 --> |
| | | <view class="goods-image-container"> |
| | | <u-image |
| | | :src="couponInfo.goodsImage || '/static/default_goods.png'" |
| | | :src="couponInfo.goodsUrl" |
| | | width="100%" |
| | | height="300rpx" |
| | | mode="aspectFit" |
| | | border-radius="16" |
| | | @click="previewImage(couponInfo.goodsImage)" |
| | | @click="previewImage(couponInfo.goodsUrl)" |
| | | ></u-image> |
| | | </view> |
| | | |
| | |
| | | couponInfo: null, // 单个优惠券信息 |
| | | loading: false, |
| | | showShoppingModal: false ,// 控制去购物弹窗显示 |
| | | couponId:'' |
| | | couponId:'', |
| | | cardId:'' |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.loadCouponInfo(this.cardId); |
| | | }, |
| | | onLoad(options) { |
| | | // 通过参数传递优惠券ID |
| | | // 例如: /pages/order/claim-coupon/claim-coupon?id=123 |
| | | options.id = '1966390012058017794' |
| | | |
| | | this.couponId = '' |
| | | if (options.id) { |
| | | this.cardId = options.id |
| | | this.loadCouponInfo(options.id); |
| | | } else { |
| | | // 如果没有传递ID,显示空状态 |
| | |
| | | uni.showLoading({ |
| | | title: '领取中...' |
| | | }); |
| | | |
| | | console.log(this.couponInfo) |
| | | // 调用领取优惠券接口 |
| | | const res = await claimVirtualCoupon(this.couponInfo.id); |
| | | |