css和逻辑调整

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