适配优化的sql,将平台id改为0

master
paulGao 2022-06-08 16:08:58 +08:00 committed by 学习很差啦
parent 5550285531
commit 3a705cce8e
6 changed files with 50 additions and 52 deletions

View File

@ -5,7 +5,6 @@
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import APPUpdate from "@/plugins/APPUpdate"; import APPUpdate from "@/plugins/APPUpdate";
import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js"; import { getClipboardData } from "@/js_sdk/h5-copy/h5-copy.js";
<<<<<<< HEAD
import config from "@/config/config"; import config from "@/config/config";
import storage from "@/utils/storage"; import storage from "@/utils/storage";
// //

View File

@ -1,48 +1,47 @@
<template> <template>
<view class="coupon-center"> <view class="coupon-center">
<div class="swiper-box"> <swiper class="swiper-box">
<div class="swiper-item"> <swiper-item class="swiper-item">
<div class="scroll-v" enableBackToTop="true" scroll-y> <scroll-view class="scroll-v" enableBackToTop="true" scroll-y @scrolltolower="loadMore">
<u-empty mode="coupon" style='margin-top: 20%;' text="没有优惠券了" v-if="whetherEmpty"></u-empty> <u-empty mode="coupon" text="没有优惠券了" v-if="whetherEmpty"></u-empty>
<view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index"> <view v-else class="coupon-item" v-for="(item, index) in couponList" :key="index">
<view class="left"> <view class="left">
<view class="wave-line"> <view class="wave-line">
<view class="wave" v-for="(item, index) in 12" :key="index"></view> <view class="wave" v-for="(item, index) in 12" :key="index"></view>
</view> </view>
<view class="message"> <view class="message">
<view> <view>
<!--判断当前优惠券类型 couponType PRICE || DISCOUNT --> <!--判断当前优惠券类型 couponType PRICE || DISCOUNT -->
<span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span> <span v-if="item.couponType == 'DISCOUNT'">{{ item.couponDiscount }}</span>
<span v-else>{{ item.price }}</span> <span v-else>{{ item.price }}</span>
</view> </view>
<view>{{ item.consumeThreshold | unitPrice }}元可用</view> <view>{{ item.consumeThreshold | unitPrice }}元可用</view>
</view> </view>
<view class="circle circle-top"></view> <view class="circle circle-top"></view>
<view class="circle circle-bottom"></view> <view class="circle circle-bottom"></view>
</view> </view>
<view class="right"> <view class="right">
<view> <view>
<!-- 根据scopeType 判断是否是 平台品类或店铺 --> <!-- 根据scopeType 判断是否是 平台品类或店铺 -->
<view class="coupon-title wes-3" v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span> <span v-if="item.scopeType == 'ALL' && item.storeId == '0'"></span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'"></span> <span v-if="item.scopeType == 'PORTION_CATEGORY'"></span>
<view v-else>{{ item.storeName == 'platform' ? '' :item.storeName+'' }}使 <view v-else>{{ item.storeName == 'platform' ? '' :item.storeName+'' }}使</view>
</view> </view>
</view> <view v-if="item.endTime">{{ item.endTime.split(" ")[0] }}</view>
<view v-if="item.endTime">{{ item.endTime.split(" ")[0] }}</view> </view>
</view> <view class="receive" @click="receive(item)">
<view class="receive" @click="receive(item)"> <text>点击</text><br />
<text>点击</text><br /> <text>领取</text>
<text>领取</text> </view>
</view> <view class="bg-quan"> </view>
<view class="bg-quan"> </view> </view>
</view> </view>
</view> <uni-load-more :status="loadStatus"></uni-load-more>
</scroll-view>
</div> </swiper-item>
</div> </swiper>
</div> </view>
</view>
</template> </template>
<script> <script>
@ -291,4 +290,4 @@
width: 260rpx; width: 260rpx;
} }
</style> </style>

View File

@ -14,7 +14,7 @@
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view class="text"> 使用平台{{ <view class="text"> 使用平台{{
coupon.scopeType == 'ALL' && coupon.id == 'platform' coupon.scopeType == 'ALL' && coupon.storeId == '0'
? "全平台" ? "全平台"
: coupon.scopeType == "PORTION_CATEGORY" : coupon.scopeType == "PORTION_CATEGORY"
? "仅限品类" ? "仅限品类"

View File

@ -34,7 +34,7 @@
<view class="right"> <view class="right">
<view class="desc"> <view class="desc">
<view v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span> <span v-if="item.scopeType == 'ALL' && item.storeId == '0'"></span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'"></span> <span v-if="item.scopeType == 'PORTION_CATEGORY'"></span>
<view v-else <view v-else
>{{ >{{

View File

@ -32,7 +32,7 @@
<view class="content"> <view class="content">
<view class="title-1">{{ coupon.title }}</view> <view class="title-1">{{ coupon.title }}</view>
<view class="title-2">使用平台{{ <view class="title-2">使用平台{{
coupon.scopeType == 'ALL' && coupon.id == 'platform' coupon.scopeType == 'ALL' && coupon.storeId == '0'
? "全平台" ? "全平台"
: coupon.scopeType == "PORTION_CATEGORY" : coupon.scopeType == "PORTION_CATEGORY"
? "仅限品类" ? "仅限品类"
@ -188,7 +188,7 @@ export default {
* 立即使用优惠券 * 立即使用优惠券
*/ */
useItNow(item) { useItNow(item) {
if (item.storeId && item.storeId!='platform') { if (item.storeId && item.storeId!='0') {
uni.navigateTo({ uni.navigateTo({
url: `/pages/product/shopPage?id=${item.storeId}`, url: `/pages/product/shopPage?id=${item.storeId}`,
}); });

View File

@ -11,7 +11,7 @@
<view class="text"> <view class="text">
<div class="coupon-List-title"> <div class="coupon-List-title">
<view v-if="item.scopeType"> <view v-if="item.scopeType">
<span v-if="item.scopeType == 'ALL' && item.id == 'platform'"></span> <span v-if="item.scopeType == 'ALL' && item.storeId == '0'"></span>
<span v-if="item.scopeType == 'PORTION_CATEGORY'"></span> <span v-if="item.scopeType == 'PORTION_CATEGORY'"></span>
<view v-else>{{ <view v-else>{{
item.storeName == "platform" ? "全平台" : item.storeName + "店铺" item.storeName == "platform" ? "全平台" : item.storeName + "店铺"
@ -181,4 +181,4 @@
} }
} }
} }
</style> </style>