123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <block>
- <view class="choose-product-item"
- v-for="(item, index) in list"
- :key="item.id"
- @click="toDetail(item)"
- >
- <view style="flex-grow: 1;">
- <view class="choose-product-item-img">
- <image mode="aspectFit" :src="item.productImage ? item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="width: 100%;height: 100%;"></image>
- <view class="back-price fantext" v-if="item.promoRuleValue">返<text>{{item.promoRuleValue}}</text>元</view>
- <view class="back-price xiajia" v-if="item.status==0">下架</view>
- <view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
- <view class="choose-product-item-left-info-code ">
- <text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text>
- </view>
- </view>
- <view class="choose-product-item-info">
- <view class="choose-product-item-left-info-name">
- <text :max-lines="2" overflow="ellipsis">{{item.productName}}</text>
- </view>
- <view class="choose-product-item-left-info-guige">
- <text :max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text>
- </view>
- <view class="choose-product-item-left-info-price">
- <view class="price-txt" v-if="isLogin">
- ¥<text>{{Number(item.price).toFixed(2).toString().split('.')[0]}}</text>.{{Number(item.price).toFixed(2).toString().split('.')[1]}}
- </view>
- <view class="price-txt" v-else>¥***</view>
- <view class="flex align_center rebate-tag" v-if="index==1">
- 返<text>5</text>元
- </view>
- <view class="flex align_center rebate-tag" v-if="index==2">
- 买3赠2
- </view>
- <view class="flex align_center tejia-tag" v-if="index==3">
- 特价<text>¥20</text>
- </view>
- </view>
- </view>
- </view>
- <view class="flex align_center justify_center">
- <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
- </view>
- </view>
- </block>
- </template>
- <script>
- export default {
- name: 'chooseProductItemSkline',
- props: {
- index: {
- type: Number,
- default: 0
- },
- list: {
- type: Array,
- default: () => []
- },
- edit: {
- type: Boolean,
- default: false
- },
- isLogin:{
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- }
- },
- methods: {
- toDetail(item){
- this.$emit('toDetail',item)
- }
- }
- }
- </script>
- <style lang="less">
- @import '/flex.css';
- .choose-product-item{
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px;
- border-bottom: 1px solid #eee;
- .price-txt{
- color: red;
- display: flex;
- align-items: baseline;
- font-size: 12px;
- text{
- font-size: 36rpx;
- }
- }
- > view{
- display: flex;
- align-items: center;
- justify-content: space-between;
- &::first-child{
- flex-grow: 1;
- }
- }
- .choose-product-item-img{
- margin-right: 20rpx;
- width: 30%;
- height: 180rpx;
- position: relative;
- overflow: hidden;
- border: 1px solid #f8f8f8;
- border-radius: 5px;
- padding: 10rpx;
- .back-price{
- zoom: calc(0.8);
- padding: 6rpx 65rpx;
- position: absolute;
- top: 18rpx;
- right: -45rpx;
- z-index: 2;
- font-size: 20rpx;
- text-align: center;
- transform: rotate(40deg);
- display: flex;
- align-items: center;
- text{
- font-size: 28rpx;
- margin: 0 5rpx;
- }
- }
- .xiajia{
- background: #ececec;
- color: #5f5f5f;
- }
- .fantext{
- background: rgba(255 ,87 ,34 , 1);
- color: #fff;
- font-size: 8px;
- }
- .choose-product-item-left-info-code{
- color: #666;
- position: absolute;
- width: 100%;
- left:0;
- bottom:0;
- background: rgba(255,255,255,0.7);
- text-align: center;
- }
- }
- .choose-product-item-info{
- margin-right: 10rpx;
- width: 70%;
- flex-grow: 1;
- .choose-product-item-left-info-price{
- display: flex;
- align-items:center;
- .rebate-tag{
- background: #ffe7df;
- color: #E91E63;
- padding: 2px 5px;
- font-size: 10px;
- border-radius: 3px;
- margin-left: 6px;
- }
- .tejia-tag{
- color: #E91E63;
- margin-left: 6px;
- font-size: 12px;
- text{
- font-size: 12px;
- color: #999;
- margin-left: 5px;
- }
- }
- }
- .choose-product-item-left-info-name{
- font-size: 28rpx;
- color: #666;
- }
- .choose-product-item-left-info-guige{
- color: #2196F3;
- margin: 10rpx 0;
- text{
- margin-right: 10rpx;
- }
- }
- }
- }
- </style>
|