dingdong-mall/components/goods-card/vertical-goods-card.vue

85 lines
2.2 KiB
Vue
Raw Normal View History

2022-03-15 17:38:58 +08:00
<template>
<view>
<view class="cu-bar bg-white solid-bottom margin-top-sm">
<view class="action">
<text class="cuIcon-titles text-main-color"></text> {{title}}
2022-03-15 17:38:58 +08:00
</view>
</view>
<view class="cu-card case no-card solid-bottom bg-white padding-top-xs" v-for="(item, index) in goodsInfos" :key="index" @click="showDetails(item)">
2022-03-15 17:38:58 +08:00
<view class="cu-item shadow">
<view v-if="multiPicMode" class="flex justify-between align-center multi-pic-container">
<view class="left-view"><image class="radius" :src="item.goodsImgsMap[0][0].imgUrl" mode="aspectFill"></image></view>
<view class="flex-column-between align-center right-view">
<image class="radius" :src="item.goodsImgsMap[0][1].imgUrl" mode="aspectFill"></image>
<image class="radius" :src="item.goodsImgsMap[0][2].imgUrl" mode="aspectFill"></image>
</view>
</view>
<view v-else>
2022-06-07 11:23:36 +08:00
<image :src="item.goodsImgUrl" mode="aspectFill"></image>
2022-03-15 17:38:58 +08:00
</view>
<view class="cu-item item-margin-custom">
<view class="content flex-sub">
2022-06-07 11:23:36 +08:00
<view class="text-xl">{{item.goodsName}}</view>
<view class="text-sm text-gray margin-tb-xs">{{item.goodsDesc}}</view>
2022-03-15 17:38:58 +08:00
<view class="flex justify-between align-end">
<view class="text-red text-sm">自营直选不满意重新服务全程上险</view>
2022-06-07 11:23:36 +08:00
<view class="text-red text-price text-xl">{{item.goodsStandardList[0].goodsPrice}}</view>
2022-03-15 17:38:58 +08:00
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
2022-04-01 16:54:10 +08:00
name: "vertical-goods-card",
2022-03-15 17:38:58 +08:00
props: {
title: '',
goodsInfos: {
type: Array,
default: []
},
multiPicMode: {
type: Boolean,
default: false
2022-03-15 17:38:58 +08:00
}
},
data() {
return {};
},
methods: {
showDetails(productItem) {
2022-04-01 16:54:10 +08:00
uni.$emit('index_showProductDetail', productItem)
}
2022-03-15 17:38:58 +08:00
}
}
</script>
<style scoped>
.item-margin-custom {
margin: 10rpx 30rpx 30rpx 30rpx;
}
.multi-pic-container {
height: 450rpx;
overflow: hidden;
}
.multi-pic-container > view {
width: calc(50% - 5rpx);
height: 100%;
}
.multi-pic-container > .left-view > image {
height: 100%;
width: 100%;
}
.multi-pic-container > .right-view > image {
height: calc(50% - 5rpx);
width: 100%;
2022-03-15 17:38:58 +08:00
}
</style>