123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <block>
- <view class="choose-product-item"
- v-for="(item, dix) in list"
- :key="item.id"
- >
- <view>
- <view class="choose-product-item-img">
- <!-- <text class="no-txt">{{index?(index*pageSize-(pageSize-fristLength))+(dix+1):(dix+1)}}</text> -->
- <image mode="aspectFit" :src="item.productImage+'?x-oss-process=image/resize,p_50'" style="width: 100%;height: 200rpx;"></image>
- <view class="back-price" v-if="item.promoRuleValue">返<text>{{item.promoRuleValue}}</text>元</view>
- <view class="choose-product-item-left-info-code ellipsis-one">{{item.productCode}}</view>
- </view>
- <view class="choose-product-item-info">
- <view class="choose-product-item-left-info-name ellipsis-two">{{item.productName}}</view>
- <view class="choose-product-item-left-info-guige ellipsis-two">{{item.productOrigCode}}</view>
- <view class="choose-product-item-left-info-price">
- <view class="price-txt">¥<text>{{item.cost}}</text></view>
- <view>
- <uni-number-box v-if="!edit" v-model="item.qty" :min="1" :max="999999" @change="v=>{changeQty(v,item.id)}"></uni-number-box>
- <view v-else class="edit-qty">
- X <text>{{item.qty}}</text>
- <image src="../static/del.png" style="width: 30px;height: 30px;" mode="aspectFit" @click="remove(item.id)"></image>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </block>
- </template>
- <script>
- import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue'
- export default {
- name: 'chooseProductItemSkline',
- components: {
- uniNumberBox
- },
- props: {
- index: {
- type: Number,
- default: 0
- },
- list: {
- type: Array,
- default: () => []
- },
- edit: {
- type: Boolean,
- default: false
- },
- pageSize: {
- type: Number,
- default: 6
- },
- fristLength: {
- type: Number,
- default: 0
- }
- },
- data() {
- return {
- }
- },
- methods: {
- changeQty(e, id) {
- this.$emit('changeQty', e, id)
- },
- remove(id){
- this.$emit('remove',id)
- }
- }
- }
- </script>
- <style lang="less">
- .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: center;
- text{
- font-size: 36rpx;
- }
- }
- > view{
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex-grow: 1;
- width: 100%;
- }
- .choose-product-item-img{
- margin-right: 20rpx;
- width: 35%;
- position: relative;
- overflow: hidden;
- border: 1px solid #eee;
- padding: 10rpx;
- .no-txt{
- position: absolute;
- top: 10rpx;
- left: 10rpx;
- height: 30rpx;
- min-width: 30rpx;
- background: #9E9E9E;
- color: #fff;
- text-align: center;
- line-height: 30rpx;
- border-radius: 5rpx;
- z-index: 100;
- }
- .back-price{
- zoom: calc(0.8);
- padding: 6rpx 65rpx;
- background: rgba(255 ,87 ,34 , 1);
- position: absolute;
- top: 18rpx;
- right: -45rpx;
- color: #fff;
- z-index: 2;
- font-size: 20rpx;
- text-align: center;
- transform: rotate(40deg);
- display: flex;
- align-items: center;
- text{
- font-size: 28rpx;
- margin: 0 5rpx;
- }
- }
- .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: 65%;
- flex-grow: 1;
- .choose-product-item-left-info-price{
- display: flex;
- align-items:center;
- justify-content: space-between;
- >view{
- &:last-child{
- display: flex;
- align-items:center;
- }
- }
- .edit-qty{
- display: flex;
- align-items:center;
- justify-content: space-between;
- color: #999;
- font-size: 12px;
- > text{
- color: #666;
- font-size: 14px;
- }
- image{
- margin-left: 20px;
- }
- }
- }
- .choose-product-item-left-info-name{
- font-size: 28rpx;
- font-weight: 900;
- color: #666;
- }
- .choose-product-item-left-info-guige{
- color: #2196F3;
- margin: 10rpx 0;
- text{
- margin-right: 10rpx;
- }
- }
- }
- }
- </style>
|