【功能完善】积分商城:完善积分+价格显示样式

pull/108/head
puhui999 2024-10-02 15:40:09 +08:00
parent c5307513cc
commit d7a18f9c01
3 changed files with 22 additions and 46 deletions

View File

@ -1,18 +1,6 @@
<!-- 积分商城商品列表 --> <!-- 积分商城商品列表 -->
<template> <template>
<s-layout title="积分商城" navbar="normal" :leftWidth="0" :rightWidth="0"> <s-layout title="积分商城" navbar="normal" :leftWidth="0" :rightWidth="0">
<!-- 筛选 -->
<su-sticky bgColor="#fff">
<view class="ss-flex">
<view class="ss-flex-1">
</view>
<view class="list-icon" @tap="iconStatus = !iconStatus">
<text v-if="iconStatus" class="sicon-goods-list" />
<text v-else class="sicon-goods-card" />
</view>
</view>
</su-sticky>
<scroll-view <scroll-view
class="scroll-box" class="scroll-box"
:style="{ height: pageHeight + 'rpx' }" :style="{ height: pageHeight + 'rpx' }"
@ -20,7 +8,7 @@
:scroll-with-animation="false" :scroll-with-animation="false"
:enable-back-to-top="true" :enable-back-to-top="true"
> >
<s-point-card ref="sPointCardRef" :property="sPointCardData" class="ss-p-x-20 ss-m-t-20"/> <s-point-card ref="sPointCardRef" class="ss-p-x-20 ss-m-t-20"/>
<s-empty <s-empty
v-if="activityTotal === 0" v-if="activityTotal === 0"
icon="/static/goods-empty.png" icon="/static/goods-empty.png"
@ -40,7 +28,7 @@
<script setup> <script setup>
import sheep from '@/sheep'; import sheep from '@/sheep';
import { onLoad, onReachBottom } from '@dcloudio/uni-app'; import { onLoad, onReachBottom } from '@dcloudio/uni-app';
import { computed, reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import PointApi from '@/sheep/api/promotion/point'; import PointApi from '@/sheep/api/promotion/point';
import SLayout from '@/sheep/components/s-layout/s-layout.vue'; import SLayout from '@/sheep/components/s-layout/s-layout.vue';
@ -50,32 +38,7 @@
const pageHeight = const pageHeight =
(safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350; (safeArea.height + safeAreaInsets.bottom) * 2 + statusBarHeight - sheep.$platform.navbar - 350;
const sPointCardData = ref({
'layoutType': 'twoCol',
});
//
const LayoutTypeEnum = {
//
ONE_COL_BIG_IMG: 'oneColBigImg',
//
TWO_COL: 'twoCol',
};
const sPointCardRef = ref(); const sPointCardRef = ref();
// true - false -
const iconStatus = computed({
get() {
return sPointCardData.value.layoutType === LayoutTypeEnum.ONE_COL_BIG_IMG;
},
set(newValue) {
newValue ? (sPointCardData.value.layoutType = LayoutTypeEnum.ONE_COL_BIG_IMG) :
(sPointCardData.value.layoutType = LayoutTypeEnum.TWO_COL);
//
if (sPointCardData.value.layoutType === LayoutTypeEnum.TWO_COL) {
//
sPointCardRef.value.calculateGoodsColumn();
}
},
});
// //
const activityPageParams = reactive({ const activityPageParams = reactive({
pageNo: 1, // pageNo: 1, //

View File

@ -31,15 +31,14 @@
<view class="title-card detail-card ss-p-y-40 ss-p-x-20"> <view class="title-card detail-card ss-p-y-40 ss-p-x-20">
<view class="ss-flex ss-row-between ss-col-center ss-m-b-18"> <view class="ss-flex ss-row-between ss-col-center ss-m-b-18">
<view class="price-box ss-flex ss-col-bottom"> <view class="price-box ss-flex ss-col-bottom">
<view v-if="getShowPrice.price > 0" class="price-text"> {{ getShowPrice.price }}</view>
<text v-if="getShowPrice.price > 0 && getShowPrice.point > 0">+</text>
<image <image
:src="sheep.$url.static('/static/img/shop/goods/score1.svg')" :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
class="point-img" class="point-img"
></image> ></image>
<view class="point-text ss-m-r-16"> <text class="point-text ss-m-r-16">
{{ getShowPrice.point }} {{ getShowPrice.point }}
</view> {{ !getShowPrice.price || getShowPrice.price === 0 ? '' : `+¥${getShowPrice.price}` }}
</text>
</view> </view>
<view class="sales-text"> <view class="sales-text">
{{ formatExchange(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }} {{ formatExchange(state.goodsInfo.sales_show_type, state.goodsInfo.sales) }}

View File

@ -19,8 +19,16 @@
<view class="goods-title ss-line-2">{{ state.goodsInfo.name }}</view> <view class="goods-title ss-line-2">{{ state.goodsInfo.name }}</view>
<view class="header-right-bottom ss-flex ss-col-center ss-row-between"> <view class="header-right-bottom ss-flex ss-col-center ss-row-between">
<!-- 价格 --> <!-- 价格 -->
<view v-if="state.goodsInfo.activity_type === PromotionActivityTypeEnum.POINT.type" class="price-text"> <view v-if="state.goodsInfo.activity_type === PromotionActivityTypeEnum.POINT.type"
{{ getShowPriceText }} class="price-text ss-flex">
<image
v-if="!isEmpty(state.selectedSku)"
:src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
class="point-img"
></image>
<text class="point-text ss-m-r-16">
{{ getShowPriceText }}
</text>
</view> </view>
<view v-else class="price-text"> <view v-else class="price-text">
{{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }} {{ fen2yuan(state.selectedSku.price || state.goodsInfo.price) }}
@ -124,7 +132,7 @@
let priceText = `${fen2yuan(state.goodsInfo.price)}`; let priceText = `${fen2yuan(state.goodsInfo.price)}`;
if (!isEmpty(state.selectedSku)) { if (!isEmpty(state.selectedSku)) {
const sku = state.selectedSku; const sku = state.selectedSku;
priceText = `${sku.point}积分${!sku.pointPrice ? '' : `+¥${fen2yuan(sku.pointPrice)}`}`; priceText = `${sku.point}${!sku.pointPrice ? '' : `+¥${fen2yuan(sku.pointPrice)}`}`;
} }
return priceText; return priceText;
}); });
@ -320,6 +328,12 @@
} }
} }
.point-img {
width: 36rpx;
height: 36rpx;
margin: 0 4rpx;
}
.ss-modal-box { .ss-modal-box {
border-radius: 30rpx 30rpx 0 0; border-radius: 30rpx 30rpx 0 0;
max-height: 1000rpx; max-height: 1000rpx;