feat: 商品详情交互开发
This commit is contained in:
@@ -8,6 +8,15 @@
|
||||
<view class="tag-wrapper" v-if="goodsData.timeTag">
|
||||
<view class="time-tag">{{ goodsData.timeTag || "随时可退" }}</view>
|
||||
</view>
|
||||
<!-- 日历ICON,酒店订单显示 -->
|
||||
<uni-icons
|
||||
class="calender-icon"
|
||||
v-if="isShowCalendar"
|
||||
type="calendar"
|
||||
size="24"
|
||||
color="#00A6FF"
|
||||
@click="showCalendar"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 地址区域 -->
|
||||
@@ -31,9 +40,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, defineProps } from "vue";
|
||||
import { computed, defineProps, defineEmits } from "vue";
|
||||
import LocationInfo from "@/components/LocationInfo/index.vue";
|
||||
|
||||
// 事件定义
|
||||
const emits = defineEmits(["showCalendar"]);
|
||||
|
||||
// Props定义
|
||||
const props = defineProps({
|
||||
goodsData: {
|
||||
@@ -44,12 +56,23 @@ const props = defineProps({
|
||||
|
||||
// 设施列表 - 使用computed优化性能
|
||||
const facilitiesList = computed(() => {
|
||||
if (props.goodsData.commodityTag && props.goodsData.commodityTag.length) {
|
||||
return props.goodsData.commodityTag;
|
||||
if (
|
||||
props.goodsData.commodityFacilityList &&
|
||||
props.goodsData.commodityFacilityList.length
|
||||
) {
|
||||
return props.goodsData.commodityFacilityList;
|
||||
}
|
||||
|
||||
return [];
|
||||
});
|
||||
|
||||
// 日历弹窗
|
||||
const showCalendar = () => emits("showCalendar");
|
||||
|
||||
// 是否显示日历按钮
|
||||
const isShowCalendar = computed(() => {
|
||||
return props.goodsData.commodityTypeCode === "0";
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
.good-info {
|
||||
background: #fff;
|
||||
margin-bottom: 12px;
|
||||
|
||||
// 标题区域
|
||||
.title-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
|
||||
.title {
|
||||
@@ -11,8 +12,10 @@
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
line-height: 1.4;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
flex: 0 280px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tag-wrapper {
|
||||
@@ -27,11 +30,14 @@
|
||||
border: 1px solid #f55726;
|
||||
}
|
||||
}
|
||||
|
||||
.calender-icon {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 地址区域
|
||||
.address-section {
|
||||
margin-bottom: 12px;
|
||||
padding: 12px 0;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
@@ -52,6 +58,8 @@
|
||||
|
||||
// 设施信息区域
|
||||
.facilities-section {
|
||||
margin-top: 12px;
|
||||
|
||||
.facilities-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
|
||||
Reference in New Issue
Block a user