|
@@ -34,12 +34,22 @@
|
|
|
<view class="rubbishType-type">
|
|
|
{{rubbishPaperName ? rubbishPaperName :''}}
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
+ <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
|
|
|
+ <swiper-item v-for="(item,index) in rubbishPaperList" :key="index">
|
|
|
+ <view class="flex rubbish">
|
|
|
+ <view v-for="key in item" class="rubbishType-item">
|
|
|
+ <u-image :src="key.image" width="92" height="92"></u-image>
|
|
|
+ <span>{{key.name ? key.name :''}}</span><span>{{key.customerPrice ? (key.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </swiper-item>
|
|
|
+ </swiper>
|
|
|
+ <!-- <view class="flex rubbish">
|
|
|
<view v-for="item in rubbishPaperList" class="rubbishType-item">
|
|
|
<u-image :src="item.image" width="92" height="92"></u-image>
|
|
|
<span>{{item.name ? item.name :''}}</span><span>{{item.customerPrice ? (item.customerPrice).toFixed(2)/1+'元/kg' :''}} </span>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
<!-- 塑料类 -->
|
|
|
<view class="statistics-box" v-if="rubbishSLList.length">
|
|
@@ -110,7 +120,11 @@
|
|
|
rubbishYWList:[],
|
|
|
rubbishJSList:[],
|
|
|
rubbishPriceList:[],
|
|
|
- orderId:'' // 订单id
|
|
|
+ orderId:'' ,// 订单id
|
|
|
+ indicatorDots: true,
|
|
|
+ autoplay: false,
|
|
|
+ interval: 2000,
|
|
|
+ duration: 500
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -175,27 +189,41 @@
|
|
|
const c= res.data.find(item=>item.code=='CLOTHES')
|
|
|
const d= res.data.find(item=>item.code=='METAL')
|
|
|
/* 纸张类 */
|
|
|
- this.rubbishPaperList=a.rubbishTypeVOList
|
|
|
- this.rubbishPaperList.map(item=>{
|
|
|
- if(item.code=='YELLOW_PAPER'){
|
|
|
- item.image='/static/index/icon_aper_yellow.png'
|
|
|
- }
|
|
|
- if(item.code=='COLOUR_PAPER'){
|
|
|
- item.image='/static/index/icon_aper_flower.png'
|
|
|
- }
|
|
|
- if(item.code=='BOOK_PAPER'){
|
|
|
- item.image='/static/index/icon_book.png'
|
|
|
- }
|
|
|
- if(item.code=='MAGAZINE'){
|
|
|
- item.image='/static/index/icon_magazine.png'
|
|
|
+
|
|
|
+ if (a.rubbishTypeVOList.length > 4) {
|
|
|
+ let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
+ console.log(num,'===========list项')
|
|
|
+ let arr = []
|
|
|
+ for (var i = 0; i < num; i++) {
|
|
|
+ arr[i]=a.rubbishTypeVOList.splice(i*4,(a.rubbishTypeVOList.length-4*(i+1))>4?4:a.rubbishTypeVOList.length-4*(i+1))
|
|
|
+ console.log(arr,'===========arr')
|
|
|
}
|
|
|
- if(item.code=='OTHER_PAPER'){
|
|
|
- item.image='/static/index/icon_aper_miscellaneous.png'
|
|
|
- }
|
|
|
- if(item.code=='NEWS_PAPER'){
|
|
|
- item.image='/static/index/icon_newspaper.png'
|
|
|
- }
|
|
|
- })
|
|
|
+ this.rubbishPaperList= arr
|
|
|
+ } else {
|
|
|
+ this.rubbishPaperList = a.rubbishTypeVOList.length?[a.rubbishTypeVOList]:[]
|
|
|
+ }
|
|
|
+ console.log(this.rubbishPaperList, '--------aaaaaa')
|
|
|
+ // this.rubbishPaperList=a.rubbishTypeVOList
|
|
|
+ // this.rubbishPaperList.map(item=>{
|
|
|
+ // if(item.code=='YELLOW_PAPER'){
|
|
|
+ // item.image='/static/index/icon_aper_yellow.png'
|
|
|
+ // }
|
|
|
+ // if(item.code=='COLOUR_PAPER'){
|
|
|
+ // item.image='/static/index/icon_aper_flower.png'
|
|
|
+ // }
|
|
|
+ // if(item.code=='BOOK_PAPER'){
|
|
|
+ // item.image='/static/index/icon_book.png'
|
|
|
+ // }
|
|
|
+ // if(item.code=='MAGAZINE'){
|
|
|
+ // item.image='/static/index/icon_magazine.png'
|
|
|
+ // }
|
|
|
+ // if(item.code=='OTHER_PAPER'){
|
|
|
+ // item.image='/static/index/icon_aper_miscellaneous.png'
|
|
|
+ // }
|
|
|
+ // if(item.code=='NEWS_PAPER'){
|
|
|
+ // item.image='/static/index/icon_newspaper.png'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
// 塑料类
|
|
|
this.rubbishSLList=b.rubbishTypeVOList
|
|
|
this.rubbishSLList.map(item=>{
|
|
@@ -425,7 +453,7 @@
|
|
|
}
|
|
|
.rubbish{
|
|
|
font-size:24upx;
|
|
|
- overflow-x: scroll;
|
|
|
+ // overflow-x: scroll;
|
|
|
.rubbishType-item{
|
|
|
display: flex;
|
|
|
flex-direction: column;
|