zhangdan před 4 roky
rodič
revize
0b1a67c36d
3 změnil soubory, kde provedl 61 přidání a 28 odebrání
  1. 2 2
      App.vue
  2. 52 24
      pages/index/index.vue
  3. 7 2
      pages/index/order.vue

+ 2 - 2
App.vue

@@ -1,6 +1,6 @@
 <script>
-	const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
-	// const uat_domain = 'http://192.168.16.213:8308' // 本地
+	// const uat_domain = 'https://cust.test.sxzxyj.net' // 预发布
+	const uat_domain = 'http://192.168.16.213:8308' // 本地
 	const pro_domain = 'https://cust.sxzxyj.net' // 生产
 	const uat_URL = uat_domain+'/gc-cust/' // 预发布
 	const pro_URL = pro_domain+'/gc-cust/'  // 生产

+ 52 - 24
pages/index/index.vue

@@ -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;

+ 7 - 2
pages/index/order.vue

@@ -13,7 +13,7 @@
 		</view>
 			<view class="content-body">
 				<view class="store-image flex flex_column justify_center align_center">
-					<u-image :src="pageInfo.reverseReceiveAddress.headerImageList? pageInfo.reverseReceiveAddress.headerImageList[0]:'/static/index/def_home_shop.png'" width="172" height="172" ></u-image>
+					<u-image :src="pageInfo.reverseReceiveAddress && pageInfo.reverseReceiveAddress.headerImageList? pageInfo.reverseReceiveAddress.headerImageList[0]:'/static/index/def_home_shop.png'" width="172" height="172" ></u-image>
 					<text v-if="isHasRider.haveBindRider && pageInfo.name">{{pageInfo.name}}</text>
 					<text v-else>{{mobile}}</text>
 				</view>
@@ -180,7 +180,8 @@
 				isHasOrder:false,
 				sourceTypeReserve:'',
 				orderCreateTime:'',
-				orderId:''
+				orderId:'',
+				imageHeader:'', // 门头照
 			}
 		},
 		onLoad() {
@@ -313,6 +314,9 @@
 						this.form.mobile=res.data.mobile
 						this.reverseReceiveAddress=Object.assign(this.reverseReceiveAddress,res.data.reverseReceiveAddress||{})
 						this.sourceTypeReserve=res.data.sourceTypeReserve
+						if(res.data.reverseReceiveAddress && res.data.reverseReceiveAddress.headerImageList){
+							this.imageHeader=res.data.reverseReceiveAddress.headerImageList.join()
+						}
 					}else{
 						uni.showToast({
 							title:res.message,
@@ -450,6 +454,7 @@
 				params.houseAddress=this.reverseReceiveAddress.receiveAddress?this.reverseReceiveAddress.receiveAddress:''
 				params.lat=this.reverseReceiveAddress.lat?this.reverseReceiveAddress.lat:''
 				params.lng=this.reverseReceiveAddress.lng?this.reverseReceiveAddress.lng:''
+				params.imageHeader=this.imageHeader?this.imageHeader:''
 				orderInfoSave(params).then(res=>{
 					if(res.status==200){
 						this.getOrderNum()