css和逻辑调整

parent 476c26af
<template>
<view @tap="toShop(item.shopId)" class="card" v-for="item in cardData" :key="item.shopId">
<image class="img" :src="item.shopLogo" mode="aspectFill" />
<image class="img" :src="item.shopLogo" mode="scaleToFill" />
<view class="right">
<text class="text">{{ item.shopName }}</text>
<view class="twoBxo">
......
<template>
<view class="card">
<view class="head">
<image class="imgBg" :src="shopCardData.shopLogo" mode="aspectFill" />
<image class="imgBg" :src="shopCardData.shopLogo" mode="scaleToFill" />
<view class="containerBox">
<image class="img" :src="shopCardData.shopLogo" mode="aspectFill" />
<image class="img" :src="shopCardData.shopLogo" mode="scaleToFill" />
<view class="right">
<text class="text">{{ shopCardData.shopName }}</text>
<view class="twoBxo">
......
......@@ -38,22 +38,25 @@
<!-- 红包 -->
<view class="redEnvelope">
<view class="title">今日福利</view>
<scroll-view class="box-red" scroll-x="true" @scroll="scroll">
<view class="redBagBox" v-for="(item, index) in coupon" :key="index">
<!-- <scroll-view class="box-red" scroll-x="true" @scroll="scroll"> -->
<view class="box-red">
<view class="redBagBox" v-for="(item, index) in coupon" :key="index" @tap="receive(item)">
<view class="content">
<text class="textO">{{ item.activityName }}</text>
<text class="textW">{{ item.discountValue }}</text>
<text class="textO">{{ item.thresholdAmount }}{{ item.discountValue }}</text>
</view>
<view v-if="item.numState === 0" class="textF" @tap="receive(item)">领取</view>
<view v-if="item.numState === 0" class="textF">领取</view>
<view v-else class="textF" @tap="toUse(item)">去使用</view>
</view>
</scroll-view>
<image
</view>
<!-- </scroll-view> -->
<!-- <image
@tap="toCoupon"
class="discount"
src="../../static/index/discount.png"
mode="widthFix"
/>
/> -->
</view>
<!-- 贵阳老味道 -->
<!-- <view class="guiyang"></view> -->
......@@ -87,7 +90,7 @@
:key="index"
>
<!-- <image class="img" src="../../static/index/eatFood.png" mode="widthFix" /> -->
<image class="img" :src="item.shopLogo" mode="aspectFill" />
<image class="img" :src="item.shopLogo" mode="scaleToFill" />
<text class="one">{{ item.shopName }}</text>
<view class="price">
<text class="two">{{ item.grade }}推荐</text>
......@@ -273,7 +276,7 @@ const toSearch = (res) => {
// 获取优惠券
const getCouponMainList = () => {
couponMainList().then((res) => {
coupon.value = res.data.records.slice(0, 10);
coupon.value = res.data.records.slice(0, 4);
});
};
// 领取优惠券
......@@ -281,19 +284,27 @@ const receive = (data) => {
if (data.couponType === 'mch' && data.numState === 0) {
receiveCoupon([data.couponYzfId]).then((res) => {
data.numState = 1;
xma.navigateTo({
url: `/pages/ticket/detail?shopId=${data.activityCode}`,
});
});
} else if (data.couponType === 'mch' && data.numState === 1) {
xma.navigateTo({
url: `/pages/ticket/detail?shopId=${data.activityCode}`,
});
} else if (data.couponType === 'yzf') {
xma.showToast({
title: '领取成功!',
title: '请前往或下载翼支付APP领取或使用',
icon: 'none',
});
});
}
};
// TO优惠券详情
const toCoupon = () => {
xma.navigateTo({
url: '/pages/index/coupon',
});
};
// const toCoupon = () => {
// xma.navigateTo({
// url: '/pages/index/coupon',
// });
// };
// 获取分类
const getClassification = () => {
groupBuyList().then((res) => {
......@@ -654,7 +665,7 @@ page {
.title {
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
font-weight: bold;
font-size: 28rpx;
font-size: 26rpx;
color: #3d3d3d;
line-height: 28rpx;
text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.36);
......@@ -664,9 +675,9 @@ page {
.box-red {
padding: 10rpx 0 0 20rpx;
box-sizing: border-box;
white-space: nowrap;
width: 80%;
z-index: -1;
width: 100%;
display: flex;
justify-content: space-evenly;
.redBagBox {
margin-right: 8rpx;
width: 124rpx;
......@@ -687,7 +698,7 @@ page {
align-items: center;
justify-content: center;
.textO {
width: 124rpx;
width: 100rpx;
font-size: 12rpx;
color: #fa5151;
text-align: center;
......
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