This commit is contained in:
weipengfei 2024-03-23 15:19:27 +08:00
parent 1eaa174edb
commit 9481cf10a1

View File

@ -1,378 +1,447 @@
<template> <template>
<view v-if="type == 0" class="wf-item-page wf-page0" :style="viewColor"> <view v-if="type == 0" class="wf-item-page wf-page0" :style="viewColor">
<view class='pictrue'> <view class='pictrue'>
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage> <easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
<view v-if="item.stock == 0" class="sell_out">已售罄</view> <view v-if="item.stock == 0" class="sell_out">已售罄</view>
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture"></view> <view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture">
</view> </view>
<view class="text">
<view class='name line2'>{{item.store_name}}</view>
<view class="item_tags">
<!-- 后端返回的标签 -->
<text class="tags_item delivery" :class="{'delivery_yellow': sale_type==2&&i==0}" v-for="(e, i) in item.mer_label_name" :key="i">{{e}}</text>
<!-- 商品标签 -->
<!-- <text v-if="item.product_type == 0 && item.merchant.type_name" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.product_type == 0 && item.merchant.is_trader" class="font-bg-red b-color">自营</text> -->
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
<view class="acea-row row-middle" style="display: flex;justify-content: space-between;">
<view class='money'><text class='num'>{{item.price}}</text></view>
<image class="car" src="@/static/assets/car.png"></image>
</view>
<view v-if="item.show_svip_info && item.show_svip_info.show_svip_price && item.svip_price" class="acea-row row-middle svip">
<text class='vip-money'>{{item.svip_price}}</text>
<view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view>
</view>
</view> </view>
<view v-else-if="type == 1" class="wf-page1" :style="viewColor"> <view class="text">
<view class='pictrue'> <view class='name line2'>{{item.store_name}}</view>
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage> <view class="acea-row row-middle">
<view v-if="item.stock == 0" class="sell_out">已售罄</view> <view><text class="store_info">{{item.store_info}}</text></view>
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture"></view> </view>
</view> <view class="item_tags">
<view class='text'> <!-- 后端返回的标签 -->
<view class='name line2'>{{item.store_name}}</view> <text class="tags_item delivery" :class="{'delivery_yellow': sale_type==2&&i==0}"
<view class="item_tags acea-row"> v-for="(e, i) in item.mer_label_name" :key="i">{{e}}</text>
<!-- 商品标签 -->
<!-- <text v-if="item.product_type == 0 && item.merchant.type_name" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.product_type == 0 && item.merchant.is_trader" class="font-bg-red b-color">自营</text> -->
<text v-if="item.product_type != 0"
:class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
<view class="acea-row row-middle" style="display: flex;justify-content: space-between;">
<view class='money'><text class='num'>{{item.price}}</text><text
style="color: #ccc;">/{{item.unit_name}}</text></view>
<image class="car" src="@/static/assets/car.png"></image>
</view>
<view v-if="item.show_svip_info && item.show_svip_info.show_svip_price && item.svip_price"
class="acea-row row-middle svip">
<text class='vip-money'>{{item.svip_price}}</text>
<view class="vipImg">
<image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view>
</view>
</view>
<view v-else-if="type == 1" class="wf-page1" :style="viewColor">
<view class='pictrue'>
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
<view v-if="item.stock == 0" class="sell_out">已售罄</view>
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture">
</view>
</view>
<view class='text'>
<view class='name line2'>{{item.store_name}}</view>
<view class="acea-row row-middle">
<view class="store_info"><text>{{item.store_info}}</text></view>
</view>
<view class="item_tags acea-row">
<text class="tags_item delivery_yellow" v-if="sale_type == 2">批发价</text> <text class="tags_item delivery_yellow" v-if="sale_type == 2">批发价</text>
<!-- 商品标签 --> <!-- 商品标签 -->
<!-- <text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red b-color">{{item.merchant.type_name}}</text> <!-- <text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
<text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red b-color">自营</text> --> <text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red b-color">自营</text> -->
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text> <text v-if="item.product_type != 0"
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text> :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text> <text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
</view> <text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
</view>
<view class='money'> <view class='money'>
<text class='num'>{{item.price}}</text> <text class='num'>{{item.price}}</text>
</view> </view>
<view v-if="item.show_svip_info.show_svip && item.show_svip_info.show_svip_price" class="acea-row row-middle svip"> <view v-if="item.show_svip_info.show_svip && item.show_svip_info.show_svip_price"
<text class='vip-money'>{{item.svip_price}}</text> class="acea-row row-middle svip">
<view class="vipImg"> <text class='vip-money'>{{item.svip_price}}</text>
<image :src="`${domain}/static/images/svip.png`"></image> <view class="vipImg">
</view> <image :src="`${domain}/static/images/svip.png`"></image>
</view>
</view> </view>
<view class="score">{{item.rate}}评分 {{item.reply_count}}条评论</view> <view class="score">{{item.rate}}评分 {{item.reply_count}}条评论</view>
<view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)"> <view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)">
<text class="line1">{{item.merchant.mer_name}}</text> <text class="line1">{{item.merchant.mer_name}}</text>
<view class="flex" v-if="isStore != '1'"> <view class="flex" v-if="isStore != '1'">
进店 进店
<text class="iconfont icon-xiangyou"></text> <text class="iconfont icon-xiangyou"></text>
</view> </view>
</view> </view>
</view> </view>
<!-- 返佣 --> <!-- 返佣 -->
<block v-if="item.max_extension>0 && (item.product_type == 0 || item.product_type == 2)"> <block v-if="item.max_extension>0 && (item.product_type == 0 || item.product_type == 2)">
<view class="foot-bar"> <view class="foot-bar">
<text class="iconfont icon-fenxiang"></text> <text class="iconfont icon-fenxiang"></text>
最高赚 ¥{{item.max_extension}} 最高赚 ¥{{item.max_extension}}
</view> </view>
</block> </block>
</view> </view>
</template> </template>
<script> <script>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | CRMEB [ CRMEB ] // | CRMEB [ CRMEB ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB // | Licensed CRMEBCRMEB
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com> // | Author: CRMEB Team <admin@crmeb.com>
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue' import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import { HTTP_REQUEST_URL } from '@/config/app'; import { HTTP_REQUEST_URL } from '@/config/app';
export default { export default {
components:{easyLoadimage}, components: { easyLoadimage },
computed: mapGetters(['viewColor']), computed: mapGetters(['viewColor']),
props: { props: {
item: { item: {
type: Object, type: Object,
require: true require: true
}, },
type: { type: {
type: Number, type: Number,
default: 0 default: 0
}, },
isStore: { isStore: {
type: [String, Number], type: [String, Number],
default: '1' default: '1'
}, },
isLogin: { isLogin: {
type: Boolean, type: Boolean,
require: false require: false
}, },
sale_type: { sale_type: {
type: [String, Number], type: [String, Number],
default: '1' default: '1'
}, },
}, },
data(){ data() {
return { return {
domain: HTTP_REQUEST_URL, domain: HTTP_REQUEST_URL,
} }
}, },
methods: { methods: {
goShop(id) { goShop(id) {
this.$emit('goShop', id); this.$emit('goShop', id);
}, },
authOpen(){ authOpen() {
this.$emit('authOpen'); this.$emit('authOpen');
}, },
followToggle(item){ followToggle(item) {
this.$emit('followToggle', item); this.$emit('followToggle', item);
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wf-item-page { .wf-item-page {
background: #fff; background: #fff;
overflow: hidden; overflow: hidden;
border-radius: 16rpx; border-radius: 16rpx;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.wf-page0 .coupon{
background:rgba(255,248,247,1); .wf-page0 .coupon {
border:1px solid rgba(233,51,35,1); background: rgba(255, 248, 247, 1);
border-radius:4rpx; border: 1px solid rgba(233, 51, 35, 1);
font-size:20rpx; border-radius: 4rpx;
margin-left: 18rpx; font-size: 20rpx;
padding: 1rpx 4rpx; margin-left: 18rpx;
} padding: 1rpx 4rpx;
.wf-page0 .pictrue{ }
width: 100%!important;
height: 345rpx; .wf-page0 .pictrue {
position: relative; width: 100% !important;
/deep/image,/deep/.easy-loadimage,uni-image{ height: 345rpx;
height: 345rpx; position: relative;
border-radius: 16rpx 16rpx 0 0;
} /deep/image,
.border-picture { /deep/.easy-loadimage,
position: absolute; uni-image {
top: 0; height: 345rpx;
left: 0; border-radius: 16rpx 16rpx 0 0;
width: 100%; }
height: 100%;
border-radius: 16rpx 16rpx 0 0; .border-picture {
background: center/cover no-repeat; position: absolute;
} top: 0;
} left: 0;
.loadfail-img{ width: 100%;
width: 100%; height: 100%;
border-radius: 16rpx 16rpx 0 0;
background: center/cover no-repeat;
}
}
.loadfail-img {
width: 100%;
height: 360rpx; height: 360rpx;
} }
.svip{
margin: 5rpx 0 15rpx; .svip {
} margin: 5rpx 0 15rpx;
.vip-money { }
color: #282828;
font-size: 22rpx; .vip-money {
margin-left: 6rpx; color: #282828;
font-weight: bold; font-size: 22rpx;
} margin-left: 6rpx;
.vipImg { font-weight: bold;
width: 65rpx; }
height: 28rpx;
margin-left: 4rpx; .vipImg {
image { width: 65rpx;
width: 100%; height: 28rpx;
height: 100%; margin-left: 4rpx;
display: block;
} image {
} width: 100%;
.wf-page0 .name { height: 100%;
color: #282828; display: block;
margin: 20rpx 0 10rpx 0; }
font-size: 13px; }
overflow:hidden;
text-overflow: ellipsis; .wf-page0 .name {
display: -webkit-box; color: #282828;
-webkit-line-clamp: 2; margin: 20rpx 0 10rpx 0;
-webkit-box-orient: vertical; font-size: 13px;
text-align: left; overflow: hidden;
} text-overflow: ellipsis;
.wf-page0 .text{ display: -webkit-box;
padding: 0 20rpx; -webkit-line-clamp: 2;
} -webkit-box-orient: vertical;
.wf-page0 .money { text-align: left;
font-size: 20rpx; }
font-weight: bold;
color: var(--view-priceColor); .wf-page0 .text {
} padding: 0 20rpx;
.b-color { }
background-color: var(--view-theme);
border: 1px solid var(--view-theme); .wf-page0 .money {
} font-size: 20rpx;
.wf-page0 .money .num { font-weight: bold;
font-size: 34rpx; color: var(--view-priceColor);
} }
.wf-page1 .wf-item{
.name{ .b-color {
font-size: 13px; background-color: var(--view-theme);
overflow:hidden; border: 1px solid var(--view-theme);
text-overflow: ellipsis; }
display: -webkit-box;
-webkit-line-clamp: 2; .wf-page0 .money .num {
-webkit-box-orient: vertical; font-size: 34rpx;
text-align: left; }
}
} .wf-page1 .wf-item {
.wf-page1 .pictrue { .name {
position: relative; font-size: 13px;
height: 345rpx; overflow: hidden;
width: 100%!important; text-overflow: ellipsis;
/deep/image,/deep/.easy-loadimage,uni-image{ display: -webkit-box;
height: 345rpx; -webkit-line-clamp: 2;
border-radius: 20rpx 20rpx 0 0; -webkit-box-orient: vertical;
} text-align: left;
.border-picture { }
position: absolute; }
top: 0;
left: 0; .wf-page1 .pictrue {
width: 100%; position: relative;
height: 100%; height: 345rpx;
border-radius: 20rpx 20rpx 0 0; width: 100% !important;
background: center/cover no-repeat;
} /deep/image,
/deep/.easy-loadimage,
} uni-image {
.sell_out { height: 345rpx;
display: flex; border-radius: 20rpx 20rpx 0 0;
width: 150rpx; }
height: 150rpx;
align-items: center; .border-picture {
justify-content: center; position: absolute;
border-radius: 100%; top: 0;
background: rgba(0,0,0,.6); left: 0;
color: #fff; width: 100%;
font-size: 30rpx; height: 100%;
position: absolute; border-radius: 20rpx 20rpx 0 0;
top: 50%; background: center/cover no-repeat;
left: 50%; }
margin: -75rpx 0 0 -75rpx;
&::before{ }
content: "";
display: block; .sell_out {
width: 140rpx; display: flex;
height: 140rpx; width: 150rpx;
border-radius: 100%; height: 150rpx;
border: 1px dashed #fff; align-items: center;
position: absolute; justify-content: center;
top: 5rpx; border-radius: 100%;
left: 5rpx; background: rgba(0, 0, 0, .6);
} color: #fff;
} font-size: 30rpx;
.loading-img{ position: absolute;
height: 345rpx; top: 50%;
max-height: 360rpx; left: 50%;
} margin: -75rpx 0 0 -75rpx;
.wf-page1 .text {
padding: 20rpx 17rpx 26rpx 17rpx; &::before {
font-size: 30rpx; content: "";
color: #222; display: block;
} width: 140rpx;
.wf-page1 .text .money { height: 140rpx;
display: flex; border-radius: 100%;
align-items: center; border: 1px dashed #fff;
font-size: 26rpx; position: absolute;
font-weight: bold; top: 5rpx;
margin-top: 8rpx; left: 5rpx;
color: var(--view-priceColor); }
} }
.wf-page1 .text .money .num {
font-size: 34rpx; .loading-img {
} height: 345rpx;
.item_tags{ max-height: 360rpx;
margin-top: 8rpx; }
display: flex;
} .wf-page1 .text {
.item_tags .tags_item { padding: 20rpx 17rpx 26rpx 17rpx;
display: flex; font-size: 30rpx;
font-size: 20rpx; color: #222;
text-align: center; }
border-radius: 5rpx;
padding: 0 4rpx; .wf-page1 .text .money {
height: 28rpx; display: flex;
align-items: center; align-items: center;
justify-content: center; font-size: 26rpx;
margin-right: 8rpx; font-weight: bold;
} margin-top: 8rpx;
.item_tags .tags_item.ticket{ color: var(--view-priceColor);
color: var(--view-theme); }
border: 1px solid var(--view-theme);
} .wf-page1 .text .money .num {
.item_tags .tags_item.delivery{ font-size: 34rpx;
// color: #FF9000; }
// border: 1px solid #FF9000;
color: var(--view-theme); .item_tags {
border: 1px solid var(--view-theme); margin-top: 8rpx;
} display: flex;
.item_tags .tags_item.delivery_yellow{ }
color: #FF9000;
border: 1px solid #FF9000; .item_tags .tags_item {
} display: flex;
.wf-page1 .text .money .ticket-big { font-size: 20rpx;
display: flex; text-align: center;
align-items: center; border-radius: 5rpx;
justify-content: center; padding: 0 4rpx;
max-width: 163rpx; height: 28rpx;
padding: 0 6rpx; align-items: center;
height: 28rpx; justify-content: center;
margin-left: 10rpx; margin-right: 8rpx;
background-image: url(~static/images/yh.png); }
background-size: 100% 100%;
font-size: 20rpx; .item_tags .tags_item.ticket {
font-weight: normal; color: var(--view-theme);
} border: 1px solid var(--view-theme);
.wf-page1 .text .score { }
margin-top: 10rpx;
color: #737373; .item_tags .tags_item.delivery {
font-size: 20rpx; // color: #FF9000;
} // border: 1px solid #FF9000;
.wf-page1 .text .company { color: var(--view-theme);
display: flex; border: 1px solid var(--view-theme);
align-items: center; }
color: #737373;
font-size: 20rpx; .item_tags .tags_item.delivery_yellow {
margin-top: 10rpx; color: #FF9000;
.line1{ border: 1px solid #FF9000;
max-width: 200rpx; }
}
.flex { .wf-page1 .text .money .ticket-big {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 10rpx; justify-content: center;
color: #282828; max-width: 163rpx;
.iconfont { padding: 0 6rpx;
font-size: 16rpx; height: 28rpx;
margin-top: 4rpx; margin-left: 10rpx;
} background-image: url(~static/images/yh.png);
} background-size: 100% 100%;
} font-size: 20rpx;
.foot-bar { font-weight: normal;
width: 100%; }
height: 52rpx;
display: flex; .wf-page1 .text .score {
align-items: center; margin-top: 10rpx;
justify-content: center; color: #737373;
background-image: linear-gradient(-90deg, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%); font-size: 20rpx;
border-radius: 0px 0px 16rpx 16rpx; }
color: #fff;
font-size: 24rpx; .wf-page1 .text .company {
.icon-fenxiang { display: flex;
font-size: 24rpx; align-items: center;
margin-right: 10rpx; color: #737373;
} font-size: 20rpx;
} margin-top: 10rpx;
.car{
width: 40rpx; .line1 {
height: 40rpx; max-width: 200rpx;
} }
</style>
.flex {
display: flex;
align-items: center;
margin-left: 10rpx;
color: #282828;
.iconfont {
font-size: 16rpx;
margin-top: 4rpx;
}
}
}
.foot-bar {
width: 100%;
height: 52rpx;
display: flex;
align-items: center;
justify-content: center;
background-image: linear-gradient(-90deg, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
border-radius: 0px 0px 16rpx 16rpx;
color: #fff;
font-size: 24rpx;
.icon-fenxiang {
font-size: 24rpx;
margin-right: 10rpx;
}
}
.car {
width: 40rpx;
height: 40rpx;
}
.store_info {
width: 100%;
font-size: 20rpx;
color: #aaa;
white-space: pre-wrap;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
/* 表示限制显示三行 */
}
</style>