优惠券

parent b2ebea03
......@@ -22,3 +22,11 @@ export function getCouponShopList(prodId, shopId) {
method: 'GET',
});
}
// 商家商品优惠券
export function receiveCoupon(data) {
return request({
url: `/sgyrdd/coupon/receiveCoupon`,
method: 'POST',
data,
});
}
@font-face {
font-family: "iconfont"; /* Project id 4633414 */
src: url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.woff2?t=1722502888587') format('woff2'),
url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.woff?t=1722502888587') format('woff'),
url('//at.alicdn.com/t/c/font_4633414_jxzjjul419.ttf?t=1722502888587') format('truetype');
src: url('//at.alicdn.com/t/c/font_4633414_ne2afa4bsr9.woff2?t=1722652845956') format('woff2'),
url('//at.alicdn.com/t/c/font_4633414_ne2afa4bsr9.woff?t=1722652845956') format('woff'),
url('//at.alicdn.com/t/c/font_4633414_ne2afa4bsr9.ttf?t=1722652845956') format('truetype');
}
.iconfont {
......@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-lianhe40:before {
content: "\e866";
}
.icon-shuangxiajiantou:before {
content: "\e660";
}
......
......@@ -38,7 +38,14 @@
<text class="title">{{ item.activityName }}</text>
<view class="headbox">
<text class="time">{{ item.endTime }}过期</text>
<view class="btn" @click="getCoupon(item)">立即领取</view>
<view v-if="item.numState === 0" class="btn" @click="getCoupon(item)">
立即领取
</view>
<i
v-else
class="iconfont icon-lianhe40"
style="font-size: 120rpx; color: #efefef"
></i>
</view>
</view>
<view class="foot">
......@@ -63,6 +70,7 @@
</view>
</view>
</view>
<wd-status-tip v-if="productCoupons.length === 0" image="content" tip="暂无优惠券" />
</view>
</wd-popup>
<!-- 轮播 -->
......@@ -223,9 +231,8 @@
</template>
<script setup>
import { getProdDetail, getCollect, getCouponShopList } from '@/api/packageDetail';
import { getProdDetail, getCollect, getCouponShopList, receiveCoupon } from '@/api/packageDetail';
import { getStoreInformation } from '@/api/shop';
import { useMessage } from '../../../node_modules/wot-design-uni';
const prodInfo = ref({});
const prodRlue = ref({});
const myProdId = ref('');
......@@ -332,7 +339,13 @@ function collectionFn() {
* 领取优惠券
* @param {*} item
*/
function getCoupon(item) {}
function getCoupon(item) {
receiveCoupon([item.couponYzfId]).then((res) => {
if (res.code === 0) {
item.numState = 1;
}
});
}
function getLocationFn() {
xma.getLocation({
type: 'wgs84',
......@@ -394,6 +407,9 @@ page {
display: flex;
align-items: center;
justify-content: space-between;
background: #fff;
position: relative;
top: 0;
width: 100%;
.title {
font-size: 15 * 2rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment