|
@@ -80,36 +80,48 @@
|
|
|
<view class="rubbishType-type">
|
|
|
{{rubbishSLName ? rubbishSLName :''}}
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishSLList" 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>
|
|
|
+ <swiper class="swiper" :indicator-dots="indicatorDotsSL" :autoplay="autoplay" :interval="interval" :duration="duration">
|
|
|
+ <swiper-item v-for="(item,index) in rubbishSLList" :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>
|
|
|
<!-- 金属类 -->
|
|
|
<view class="statistics-box" v-if="rubbishJSList.length">
|
|
|
<view class="rubbishType-type">
|
|
|
{{rubbishJSName ? rubbishJSName :''}}
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishJSList" 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>
|
|
|
+ <swiper class="swiper" :indicator-dots="indicatorDotsJS" :autoplay="autoplaySL" :interval="interval" :duration="duration">
|
|
|
+ <swiper-item v-for="(item,index) in rubbishJSList" :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>
|
|
|
<!-- 衣物类 -->
|
|
|
<view class="statistics-box" v-if="rubbishYWList.length">
|
|
|
<view class="rubbishType-type">
|
|
|
{{rubbishYWName ? rubbishYWName :''}}
|
|
|
</view>
|
|
|
- <view class="flex rubbish">
|
|
|
- <view v-for="item in rubbishYWList" 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>
|
|
|
+ <swiper class="swiper" :indicator-dots="indicatorDotsYW" :autoplay="autoplaySL" :interval="interval" :duration="duration">
|
|
|
+ <swiper-item v-for="(item,index) in rubbishYWList" :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>
|
|
|
<view class="nodata" v-if="rubbishPriceList.length==0">
|
|
|
<u-empty src="/static/def_result.png" :text="noDataText" icon-size="260" ></u-empty>
|
|
@@ -189,7 +201,10 @@
|
|
|
indicatorDots: true,
|
|
|
autoplay: false,
|
|
|
interval: 2000,
|
|
|
- duration: 500
|
|
|
+ duration: 500,
|
|
|
+ indicatorDotsSL:false,
|
|
|
+ indicatorDotsJS:false,
|
|
|
+ indicatorDotsYW:false
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -233,7 +248,7 @@
|
|
|
},
|
|
|
methods:{
|
|
|
pageInit() {
|
|
|
- // this.geRubbishTypeList()
|
|
|
+ this.geRubbishTypeList()
|
|
|
this.getSaomaInfo()
|
|
|
this.getHasRider()
|
|
|
this.getOrderNum()
|
|
@@ -377,98 +392,149 @@
|
|
|
this.reverseReceiveAddress.provinceName=this.reverseReceiveAddress.cityName
|
|
|
}
|
|
|
},
|
|
|
- // 获取垃圾分类
|
|
|
- // geRubbishTypeList(){
|
|
|
- // geRubbishType().then(res=>{
|
|
|
- // if(res.status==200){
|
|
|
- // console.log(res,'---------垃圾类型')
|
|
|
- // this.rubbishPriceList=res.data
|
|
|
- // const a= res.data.find(item=>item.code=='PAPER')
|
|
|
- // const b= res.data.find(item=>item.code=='PLASTIC')
|
|
|
- // const c= res.data.find(item=>item.code=='CLOTHES')
|
|
|
- // const d= res.data.find(item=>item.code=='METAL')
|
|
|
- // /* 纸张类 */
|
|
|
- // this.rubbishPaperList=a.rubbishTypeVOList
|
|
|
- // if (a.rubbishTypeVOList.length > 4) {
|
|
|
- // this.indicatorDots=true
|
|
|
- // let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
- // let arr = []
|
|
|
- // for (var i = 0; i < num; i++) {
|
|
|
- // arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
|
|
|
- // console.log(arr,'===========arr')
|
|
|
- // }
|
|
|
- // this.rubbishPaperList= arr
|
|
|
- // } else {
|
|
|
- // this.rubbishPaperList = a.rubbishTypeVOList.length?[a.rubbishTypeVOList]:[]
|
|
|
- // }
|
|
|
- // console.log(this.rubbishPaperList, '--------aaaaaa')
|
|
|
- // // this.rubbishPaperList=a.rubbishTypeVOList
|
|
|
- // this.rubbishPaperList.map(item=>{
|
|
|
- // item.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=>{
|
|
|
- // if(item.code=='PLASTIC_WHITE'){
|
|
|
- // item.image='/static/index/icon_frame_white.png'
|
|
|
- // }
|
|
|
- // if(item.code=='PLASTIC_BLACK'){
|
|
|
- // item.image='/static/index/icon_frame_black.png'
|
|
|
- // }
|
|
|
- // if(item.code=='PMMA'){
|
|
|
- // item.image='/static/index/icon_acrylic.png'
|
|
|
- // }
|
|
|
- // if(item.code=='PLASTIC_LUCENCY'){
|
|
|
- // item.image='/static/index/icon_bottle.png'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // // 衣物
|
|
|
- // this.rubbishYWList=c.rubbishTypeVOList
|
|
|
- // this.rubbishYWList.map(item=>{
|
|
|
- // if(item.code=='SIMPLE_CLOTHES'){
|
|
|
- // item.image='/static/index/icon_clothes.png'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // // 金属
|
|
|
- // this.rubbishJSList=d.rubbishTypeVOList
|
|
|
- // this.rubbishJSList.map(item=>{
|
|
|
- // if(item.code=='THIN_IRON'){
|
|
|
- // item.image='/static/index/icon_iron_thin.png'
|
|
|
- // }
|
|
|
- // if(item.code=='THICK_IRON'){
|
|
|
- // item.image='/static/index/icon_iron_thick.png'
|
|
|
- // }
|
|
|
- // if(item.code=='STAINLESS_IRON'){
|
|
|
- // item.image='/static/index/icon_steel.png'
|
|
|
- // }
|
|
|
- // })
|
|
|
- // this.rubbishPaperName=a.name
|
|
|
- // this.rubbishSLName=b.name
|
|
|
- // this.rubbishYWName=c.name
|
|
|
- // this.rubbishJSName=d.name
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
+ // 获取垃圾分类
|
|
|
+ geRubbishTypeList(){
|
|
|
+ geRubbishType().then(res=>{
|
|
|
+ if(res.status==200){
|
|
|
+ this.rubbishPriceList=res.data
|
|
|
+ const a= res.data.find(item=>item.code=='PAPER')
|
|
|
+ const b= res.data.find(item=>item.code=='PLASTIC')
|
|
|
+ const c= res.data.find(item=>item.code=='CLOTHES')
|
|
|
+ const d= res.data.find(item=>item.code=='METAL')
|
|
|
+ console.log(res.data,a,b,c,d,'000000000000000')
|
|
|
+ /* 纸张类 */
|
|
|
+ if(a){
|
|
|
+ if (a.rubbishTypeVOList.length > 4) {
|
|
|
+ this.indicatorDots=true
|
|
|
+ let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
+ let arr = []
|
|
|
+ for (var i = 0; i < num; i++) {
|
|
|
+ arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
|
|
|
+ console.log(arr,'===========arr')
|
|
|
+ }
|
|
|
+ this.rubbishPaperList= arr
|
|
|
+ } else {
|
|
|
+ this.indicatorDots=false
|
|
|
+ this.rubbishPaperList = a.rubbishTypeVOList.length?[a.rubbishTypeVOList]:[]
|
|
|
+ }
|
|
|
+ console.log(this.rubbishPaperList, '--------aaaaaa')
|
|
|
+ }
|
|
|
+ this.rubbishPaperList.map(item=>{
|
|
|
+ item.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'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // 塑料类
|
|
|
+ if(b){
|
|
|
+ if (b.rubbishTypeVOList.length > 4) {
|
|
|
+ this.indicatorDotsSL=true
|
|
|
+ let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
+ let arr = []
|
|
|
+ for (var i = 0; i < num; i++) {
|
|
|
+ arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
|
|
|
+ console.log(arr,'===========arr')
|
|
|
+ }
|
|
|
+ this.rubbishSLList= arr
|
|
|
+ } else {
|
|
|
+ this.indicatorDotsSL=false
|
|
|
+ this.rubbishSLList = b.rubbishTypeVOList.length?[b.rubbishTypeVOList]:[]
|
|
|
+ }
|
|
|
+ console.log(this.rubbishSLList, '--------aaaaaa')
|
|
|
+ }
|
|
|
+ this.rubbishSLList.map(item=>{
|
|
|
+ item.map(item=>{
|
|
|
+ if(item.code=='PLASTIC_WHITE'){
|
|
|
+ item.image='/static/index/icon_frame_white.png'
|
|
|
+ }
|
|
|
+ if(item.code=='PLASTIC_BLACK'){
|
|
|
+ item.image='/static/index/icon_frame_black.png'
|
|
|
+ }
|
|
|
+ if(item.code=='PMMA'){
|
|
|
+ item.image='/static/index/icon_acrylic.png'
|
|
|
+ }
|
|
|
+ if(item.code=='PLASTIC_LUCENCY'){
|
|
|
+ item.image='/static/index/icon_bottle.png'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // 衣物
|
|
|
+ if(c){
|
|
|
+ if (c.rubbishTypeVOList.length > 4) {
|
|
|
+ this.indicatorDotsJS=true
|
|
|
+ let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
+ let arr = []
|
|
|
+ for (var i = 0; i < num; i++) {
|
|
|
+ arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
|
|
|
+ console.log(arr,'===========arr')
|
|
|
+ }
|
|
|
+ this.rubbishYWList= arr
|
|
|
+ } else {
|
|
|
+ this.indicatorDotsJS=false
|
|
|
+ this.rubbishYWList =c.rubbishTypeVOList.length?[c.rubbishTypeVOList]:[]
|
|
|
+ }
|
|
|
+ console.log(this.rubbishYWList, '--------aaaaaa')
|
|
|
+ }
|
|
|
+ this.rubbishYWList.map(item=>{
|
|
|
+ item.map(item=>{
|
|
|
+ if(item.code=='SIMPLE_CLOTHES'){
|
|
|
+ item.image='/static/index/icon_clothes.png'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // 金属
|
|
|
+ if(d){
|
|
|
+ if (d.rubbishTypeVOList.length > 4) {
|
|
|
+ this.indicatorDotsYW=true
|
|
|
+ let num=Math.ceil(a.rubbishTypeVOList.length/4)
|
|
|
+ let arr = []
|
|
|
+ for (var i = 0; i < num; i++) {
|
|
|
+ arr[i]=a.rubbishTypeVOList.slice(i*4,(i+1)*4)
|
|
|
+ console.log(arr,'===========arr')
|
|
|
+ }
|
|
|
+ this.rubbishJSList= arr
|
|
|
+ } else {
|
|
|
+ this.indicatorDotsYW=false
|
|
|
+ this.rubbishJSList =d.rubbishTypeVOList.length?[d.rubbishTypeVOList]:[]
|
|
|
+ }
|
|
|
+ console.log(this.rubbishJSList, '--------aaaaaa')
|
|
|
+ }
|
|
|
+ this.rubbishJSList.map(item=>{
|
|
|
+ item.map(item=>{
|
|
|
+ if(item.code=='THIN_IRON'){
|
|
|
+ item.image='/static/index/icon_iron_thin.png'
|
|
|
+ }
|
|
|
+ if(item.code=='THICK_IRON'){
|
|
|
+ item.image='/static/index/icon_iron_thick.png'
|
|
|
+ }
|
|
|
+ if(item.code=='STAINLESS_IRON'){
|
|
|
+ item.image='/static/index/icon_steel.png'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.rubbishPaperName=a?a.name:''
|
|
|
+ this.rubbishSLName=b?b.name:''
|
|
|
+ this.rubbishYWName=c?c.name:''
|
|
|
+ this.rubbishJSName=d?d.name:''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 预约
|
|
|
submit(){
|
|
|
const testVal=/^1[34578]\d{9}$/
|