优惠券

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