zhangdan há 4 anos atrás
pai
commit
6d81e3ebdc
4 ficheiros alterados com 101 adições e 103 exclusões
  1. 2 2
      App.vue
  2. 1 1
      api/data.js
  3. 0 8
      api/index.js
  4. 98 92
      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/'  // 生产

+ 1 - 1
api/data.js

@@ -46,6 +46,6 @@ export const searchRider = (params) => {
   return axios.request({
     url: `userExt/queryNearRiderInfo`,
     method: 'post',
-	data: {}
+	data: params
   })
 }

+ 0 - 8
api/index.js

@@ -17,14 +17,6 @@ export const geRubbishType = params => {
   })
 }
 
-// 查询附近有无骑手可接单
-export const searchRider = (params) => {
-  return axios.request({
-    url: `userExt/queryNearRiderInfo`,
-    method: 'post',
-	data: params
-  })
-}
 
 
 // 获取订单状态

+ 98 - 92
pages/index/order.vue

@@ -233,7 +233,7 @@
 		},
 		methods:{
 			pageInit() {
-				this.geRubbishTypeList()
+				// this.geRubbishTypeList()
 				this.getSaomaInfo()
 				this.getHasRider()
 				this.getOrderNum()
@@ -287,7 +287,11 @@
 			},
 			// 未绑定骑手 校验3公里是否有启用的骑手
 			getHasRider(){
-				searchRider().then(res=>{
+				const params={}
+				params.lat=this.reverseReceiveAddress.lat?this.reverseReceiveAddress.lat:''
+				params.lng=this.reverseReceiveAddress.lng?this.reverseReceiveAddress.lng:''
+				console.log(params,'========canshu')
+				searchRider(params).then(res=>{
 					console.log(res,'==================')
 					if(res.status==200){
 						this.isBindRider=res.data.haveBindRider
@@ -306,10 +310,12 @@
 				wx.chooseLocation({
 					success:(res)=>{
 						if(res){
+							console.log(res,'========ditu')
 							this.getArea(res.address)
 							this.reverseReceiveAddress.lat=res.latitude
 							this.reverseReceiveAddress.lng=res.longitude
 							this.reverseReceiveAddress.receiveAreasName= res.address
+							this.getHasRider()
 						}
 					}
 				})
@@ -372,97 +378,97 @@
 				}
 			  },
 			// 获取垃圾分类
-			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'
-								}
-							})
+			// 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
-					}
-				})
-			},
+			// 			})
+			// 			// 塑料类
+			// 			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
+			// 		}
+			// 	})
+			// },
 			// 预约
 			submit(){
 				const testVal=/^1[34578]\d{9}$/