1004749546@qq.com há 4 anos atrás
pai
commit
40f7981890

+ 1 - 8
api/data.js

@@ -6,14 +6,7 @@ export const getLookUpDatas = (params) => {
     method: 'get'
   })
 }
-// 开箱操作
-export const openDevice = (params) => {
-  return axios.request({
-    url: `device/ctl/open`,
-    method: 'post',
-	data: params
-  })
-}
+
 //查询省
 export const  getProvince = () => {
   return axios.request({

+ 7 - 1
api/index.js

@@ -51,4 +51,10 @@ export const recycleOrderReserveSum = (params) => {
 	data:params
   })
 }
-// 根据垃圾大类型查询今日价格
+// 骑手状态
+export const WorkStatusGet = (params) => {
+  return axios.request({
+    url: `reserve/hangWorkStatus`,
+    method: 'post',
+  })
+}

+ 36 - 0
api/order.js

@@ -0,0 +1,36 @@
+import axios from '@/libs/axios.js'
+// 历史记录预约单列表
+export const historyOrderQuery = (params) => {
+	let url = `reserve/historyOrderReservePage/${params.pageNo}/${params.pageSize}`
+	delete params.pageNo
+	delete params.pageSize
+  return axios.request({
+    url: url,
+    method: 'post',
+	data:params
+  })
+}
+// 历史记录预约单列表金额/重量汇总
+export const historyOrderTotal = (params) => {
+  return axios.request({
+    url: 'reserve/historyGroupExtPage',
+    method: 'post',
+	data:params
+  })
+}
+// 订单详情
+export const orderDetailFind = (params) => {
+  return axios.request({
+    url: 'reserve/orderReserveInfo',
+    method: 'post',
+	data:params
+  })
+}
+// 预订单提交
+export const orderSubmit = (params) => {
+  return axios.request({
+    url: 'reserve/OrderReserveSubmit',
+    method: 'post',
+	data:params
+  })
+}

+ 56 - 30
pages/index/index.vue

@@ -14,39 +14,39 @@
 			<view class="header-cont">
 				<view class="cont-item">
 					<text v-if="!titleStatus" >{{numTotal}}</text>
-					<text>完成订单数(个)</text>
 					<u-loading :show="titleStatus"></u-loading>
+					<view>完成订单数(个)</view>
 				</view>
 				<view class="cont-item">
-					<text v-if="!titleStatus" >{{weightTotal}}</text>
-					<text>回收重量(kg)</text>
 					<u-loading :show="titleStatus"></u-loading>
+					<text v-if="!titleStatus" >{{weightTotal}}</text>
+					<view>回收重量(kg)</view>
 				</view>
 				<view class="cont-item">
-					<text v-if="!titleStatus" >{{moneyTotal}}</text>
-					<text>交易金额(元)</text>
 					<u-loading :show="titleStatus"></u-loading>
+					<text v-if="!titleStatus" >{{moneyTotal}}</text>
+					<view>交易金额(元)</view>
 				</view>
 			</view>
 		</view>
 		<!-- 接单按钮 -->
-		<view v-if="workStatus==0 && hasLogin" class="btn-view start-btn">
+		<view v-if="workStatus==0 && hasLogin" @click="changeWorkStateFun(1)" class="btn-view start-btn">
 			点击开始接单
 		</view>
-		<view v-if="workStatus==1 && hasLogin" class="btn-view end-btn">
+		<view v-if="workStatus==1 && hasLogin" @click="changeWorkStateFun(0)" class="btn-view end-btn">
 			接单中(点击停止接单)
 		</view>
 		<!-- 待处理订单 -->
 		<view class="list">
 			<view v-if="hasLogin" class="title">
-				<view>待处理订单(10个)</view>
+				<view>待处理订单({{listdata.length}}个)</view>
 			</view>
 			<view class="list-item" v-for="item in listdata" :key="item.id">
-				<u-image class="img-icon" :src="item.icon?item.imageHeader:'../../static/def_home_shop.jpg'" border-radius="16" width="160" height="160"></u-image>
+				<u-image class="img-icon" :src="item.icon?item.imageHeader:'/static/def_home_shop.png'" border-radius="16" width="160" height="160"></u-image>
 				<view class="cont-item-right flex_1 flex flex_column justify_between">
 					<view class="flex align_center justify_between">
 						<view class="flex_1 bold ellipsis-one">{{item.contactName}}</view>
-						<view @click="intoWaitOrderDetail()" class="do-btn">去处理</view>
+						<view @click="intoWaitOrderDetail(item)" class="do-btn">去处理</view>
 					</view>
 					 <view @click="openLocation(item)" class="greey-font flex align_center justify_between">
 						 <view class="dizhi ellipsis-one">{{item.contactAddress}}</view>
@@ -55,13 +55,10 @@
 							 <text>{{item.distance}}KM</text>
 						 </view>
 					 </view>
-					 <view class="greey-font">2021.05.10 上午,预估{{item.reserveWeight}}kg</view>
+					 <view class="greey-font">{{item.reserveTime}},预估{{item.reserveWeight}}kg</view>
 					 <view class="flex">
-						 <view class="mark">
-						 	纸张类
-						 </view>
-						 <view class="mark">
-						 	金属类
+						 <view v-for="key in item.orderReserveItemEntityList" :key="key.id" class="mark">
+						 	{{key.typeName}}
 						 </view>
 					 </view>
 				</view>
@@ -79,7 +76,7 @@
 </template>
 
 <script>
-	import {waitOrderQuery,reserveTotal,changeWorkState} from '@/api/index.js'
+	import {waitOrderQuery,reserveTotal,changeWorkState, WorkStatusGet} from '@/api/index.js'
 	import { checkLogin } from '@/api/login.js'
 	import moment from 'moment'
 	import getDate from '@/libs/getDate.js'
@@ -94,7 +91,8 @@
 				scrollTop: 0,  //  滚动条位置
 				numTotal: 0, // 完成订单个数
 				weightTotal: 0, // 回收重量
-				moneyTotal: 0 // 交易金额
+				moneyTotal: 0, // 交易金额
+				workStatus: '0', // 工作状态 0 不接单 1接单
 			}
 		},
 		onLoad() {
@@ -120,6 +118,7 @@
 				if(this.hasLogin){
 					this.getCurPosition()
 					this.getTotalData()
+					this.getWorkStatus()
 				} else {
 					this.noDataText = '您尚未登录或登录已过期!'
 				}
@@ -160,6 +159,14 @@
 				      })
 				    }
 			},
+			// 获取骑手状态
+			getWorkStatus() {
+				WorkStatusGet().then(res=>{
+					if(res.status==200){
+						this.workStatus = res.data[0].workStatus
+					} 
+				})
+			},
 			// 获取当前位置
 			getCurPosition () {
 				let _this = this
@@ -189,16 +196,25 @@
 						this.listdata = res.data
 						this.listdata.forEach(item =>{
 							item.distance = item.distance ? Math.round(item.distance/1000) : ''
+							item.reserveTime = moment(item.confirmDate).format('YYYY-MM-DD') + item.reserveTimeType
 						})
 					}
 				})
 			},
 			// 今日统计
 			getTotalData() {
-				reserveTotal().then(res=>{
+				this.titleStatus = true
+				reserveTotal({}).then(res=>{
 					if(res.status == 200) {
-						
+						this.numTotal = res.data.orderReserveCount
+						this.weightTotal = res.data.totalAllWeight/1000
+						this.moneyTotal = res.data.originalAllAmount
+					} else {
+						this.numTotal = 0
+						this.weightTotal = 0
+						this.moneyTotal = 0
 					}
+					this.titleStatus = false
 				})
 			},
 			// 打开回收价格页面
@@ -212,9 +228,9 @@
 				}
 			},
 			// 进入待处理订单详情
-			intoWaitOrderDetail(){
+			intoWaitOrderDetail(item){
 				uni.navigateTo({
-					url: '/pages/order/waitOrderDetail'
+					url: '/pages/order/waitOrderDetail?orderNo='+item.orderReserveNo
 				})
 			},
 			// 导航
@@ -242,15 +258,27 @@
 				  }
 				});
 			},
-			
+			// 点击开始或停止接单
+			changeWorkStateFun(flag) {
+				changeWorkState({workStatus:flag}).then(res=>{
+					if(res.status == 200) {
+						this.getWorkStatus()
+					}
+				})
+			}
 		}
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss" >
+	page{
+		width: 100%;
+		height: 100%;
+		background-color: #fff;
+	}
 	.content {
 		width: 100%;
-		height: 100vh;
+		height: 100%;
 		display: flex;
 		flex-direction: column;
 		background-color: #fff;
@@ -294,15 +322,13 @@
 				align-items: center;
 				text{
 					line-height: 50upx;
-				}
-				text:last-of-type{
-					font-size: 24upx;
-				}
-				text:first-of-type{
 					font-size: 48upx;
 					font-family: Arial;
 					font-style:italic;
 				}
+				view{
+					font-size: 24upx;
+				}
 			}
 		}
 		.btn-view{

+ 21 - 134
pages/order/hisOrderDetail.vue

@@ -5,25 +5,24 @@
 			<view class="order-status">
 				<view class="status-title flex align_center justify_center">
 					<view class="t-icon icon t-icon-icon_complete"></view>
-				{{orderInfo.orderStateDictValue}}
+				{{orderInfo.orderStatusDictValue || '--'}}
 				</view>
 				<view class="status-care">
 					预约时间:2021-05-10 15:10:05
 				</view>
 			</view>
 			<!-- 服务信息 -->
-			<view class="info-main">
-				<view class="flex align_center">
+			<view class="info-main flex flex_column">
+				<view class="flex flex_1 align_center">
 					<view class="new-left">
-						陕西省西安市未央区华
-						帝金座602室
+						{{orderInfo.contactAddress || '--'}}
 					</view>
 				</view>
 				<view class="time flex align_center justify_between">
-					<text>百果园(贞观路店)</text>
+					<text>{{orderInfo.contactName}}</text>
 					<view class="flex align_center">
 						<view class="t-icon phone t-icon-icon_phone"></view>
-						<text>18092252287</text>
+						<text>{{orderInfo.contactMobile}}</text>
 					</view>
 				</view>
 			</view>
@@ -35,7 +34,7 @@
 				</view>
 				<view class="item flex justify_between">
 					<text>预约重量</text>
-					<text>50-100kg</text>
+					<text>{{orderInfo.reserveWeight}}</text>
 				</view>
 			</view>
 			<!-- 订单信息 -->
@@ -45,11 +44,11 @@
 				</view> -->
 				<view class="item flex justify_between">
 					<text>订单编号</text>
-					<text>202102022225</text>
+					<text>{{orderInfo.orderReserveNo||'--'}}</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>下单时间</text>
-					<text>2021-04-19 15:33</text>
+					<text>{{orderInfo.confirmDate}}</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>服务时间</text>
@@ -87,11 +86,11 @@
 			<view class="item-info">
 				<view class="item flex justify_between">
 					<text>应付金额</text>
-					<text>22.20 元</text>
+					<text>{{orderInfo.payAmount}} 元</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>支付方式</text>
-					<text>线下</text>
+					<text>{{orderInfo.payTypeDictValue}}</text>
 				</view>
 			</view>
 		</view>
@@ -100,6 +99,7 @@
 
 <script>
 	import moment from 'moment'
+	import { orderDetailFind } from '@/api/order.js'
 	export default {
 		data() {
 			return {
@@ -140,22 +140,14 @@
 				},
 				totalPrice: 0, // 支付合计
 				password: '', // 支付密码
-				showSetPswModal: false,  // 设置支付密码弹窗
-				showInputPsw: false, // 打开输入密码弹窗
-				showLeavePsw: false, // 打开确定放弃弹窗
-				orderId: '', // 订单id
-				leftTime: null,
-				payFinish: false , // 是否支付成功
-				focus: false
+				orderReserveNo: '', // 订单no
 			}
 		},
 		onLoad(options) {
-			// 监听设置密码是否成功
-			uni.$once('setPswSuccess', this.setPsw)
-			if (options.id) {
-				console.log(options.id)
-				this.orderId = options.id
-				// this.getOrderDetail()
+			if (options.orderNo) {
+				console.log(options.orderNo)
+				this.orderReserveNo = options.orderNo
+				this.getOrderDetail()
 			}
 			// 开启分享
 			uni.showShareMenu({
@@ -167,124 +159,18 @@
 			
 		},
 		methods: {
-			// 支付剩余时间
-			leftTimeFun() {
-				const date1 = moment().toArray()  //  当前时间 数组形式
-				const date2 = moment(this.orderInfo.orderTime).toDate()  //  下单时间  日期格式
-				const date3 = moment(date2).toArray()  //  下单时间  数组形式
-				const date4 = moment(date1).diff(moment(date3), 'seconds')//计算相差的秒数
-				const tt = 30 - Math.ceil(date4/60)  //向上取整
-				if (tt > 0) {
-					this.leftTime = tt
-				} else {
-					// this.getOrderDetail()
-					this.leftTime = '00'
-				}
-			},
 			// 获取订单详情
 			getOrderDetail() {
-				orderDetail({
-					id: this.orderId
+				orderDetailFind({
+					orderReserveNo: this.orderReserveNo
 				}).then(res => {
 					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 						this.orderInfo = res.data
-						if(this.orderInfo.orderState=='WAIT_PAY') {
-							this.leftTimeFun()
-						}
 					} 
 				})
 			},
-			// 跳转到设置支付密码页
-			toSetPwd () {
-				uni.navigateTo({
-					url:"/pages/userCenter/userInfo/smsVerification"
-				})
-			},
-			// 设置密码成功, 打开输入密码弹窗
-			setPsw (e) {
-				if (e.success) {
-					this.showInputPsw = true
-					setTimeout(()=>{
-						this.focus = true
-					},300)
-				}
-			},
-			// 关闭输入密码弹窗
-			closePayModal(){
-				if(!this.payFinish) {
-					this.showLeavePsw = true
-				} 
-			},
-			//确认放弃
-			canclePay() {
-				this.password = ''
-				this.showLeavePsw = false
-				this.showInputPsw = false
-				this.focus = false
-			},
-			// 继续支付
-			payAgain () {
-				this.focus = false
-				this.showLeavePsw = false
-				this.showInputPsw = true
-				setTimeout(()=>{
-					this.focus = true
-				},300)
-			},
-			// 支付 判断用户是否设置过支付密码
-			toPay() {
-				this.totalPrice = this.orderInfo.originalGold
-				this.payFinish = false
-				// 判断用户是否设置过支付密码
-				existPayPwd().then(res=>{
-					console.log(res,'rrrrrr')
-					if(res.status == 200) {
-						// 设置过支付密码,输入密码
-						if(res.data) {
-							this.showInputPsw = true
-							setTimeout(()=>{
-								this.focus = true
-							},300)
-						} else {
-							// 没设置过支付密码,提示设置密码
-							 this.showSetPswModal = true
-						}
-					} 
-				})
-			},
-			// 支付
-			toPayOrder() {
-				if (this.password === '') {
-					uni.showToast({
-						title: '请先输入支付密码',
-						icon: 'none'
-					})
-					return false
-				}
-				let id = this.orderInfo.id
-				let params = {
-					payPwd: this.password,
-					id: id
-				}
-				signPay(params).then(res=>{
-					this.btnLoading = false
-					if(res.status == 200) {
-						// 关闭弹窗 刷新页面
-						this.payFinish = true
-						this.showInputPsw = false
-						this.getOrderDetail()
-						// 刷新订单列表
-						uni.$emit('refresh')
-						// 跳转到支付完成界面
-						uni.navigateTo({
-							url:"/pagesA/toOrder/payFinish?id=" + id
-						})
-					} else{
-						this.password = ''
-					}
-				})
-			},
+			
 		},
 	}
 </script>
@@ -311,6 +197,7 @@
 				font-size: 28upx;
 				background-image: url(../../static/order_bg_stor.png);
 				background-repeat: no-repeat;
+				height: 260rpx;
 				.new-left{
 					width: 360rpx;
 					font-size: 36rpx;

+ 39 - 23
pages/order/historyOrder.vue

@@ -1,12 +1,12 @@
 <template>
 	<view class="order-content">
 		<view class="total">
-			总计:12000.00kg,222.00
+			总计:{{totalWeight}}kg,{{totalMoney}}
 		</view>
 		<scroll-view scroll-y class="list" @scrolltolower="onreachBottom">
-			<view class="list-item" @click="intoDetail()">
+			<view class="list-item" v-for="item in list" :key="item.id" @click="intoDetail(item)">
 				<view class="cont title flex align_center justify_between">
-					<text>2020-12-30 15:29:16</text>
+					<text>{{item.createDate}}</text>
 					<view class="flex align_center">
 						<text>查看详情</text>
 						<u-icon class="arrow-right" name="arrow-right" color="#999999" size="32"></u-icon>
@@ -14,15 +14,15 @@
 				</view>
 				<view class="cont">
 					<view class="cont-top flex align_center justify_between">
-						<text>百果园(贞观路店)</text>
-						<text>¥260.00</text>
+						<text>{{item.contactName||'--'}}</text>
+						<text>{{item.payAmount?'¥'+item.payAmount:'--'}}</text>
 					</view>
 					<view class="cont-bot flex align_center justify_between">
 						<view class="flex align_center">
 							<view class="t-icon phone t-icon-icon_phone"></view>
-							<text>18092252287</text>
+							<text>{{item.contactMobile}}</text>
 						</view>
-						<text>线下支付</text>
+						<text>{{item.payTypeDictValue||'--'}}</text>
 					</view>
 				</view>
 			</view>
@@ -32,21 +32,26 @@
 				<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
 			</view>
 		</scroll-view>
-		<view class="list">
-			
-		</view>
 	</view>
 </template>
 
 <script>
+	import { historyOrderQuery, historyOrderTotal } from '@/api/order.js'
 	export default {
 		data() {
 			return {
-				
+				list: [], // 列表数据
+				pageNo: 1,  //  当前页码
+				pageSize: 10,  //  每页条数
+				total: 0,  //  数据总条数
+				noDataText: '暂无数据',  //  列表请求状态提示语
+				status: 'loadmore',  //  加载中状态
+				totalWeight: 0, // 总重量
+				totalMoney: 0, //总金额
 			}
 		},
 		onLoad() {
-			// this.pageInit()
+			this.pageInit()
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -54,10 +59,20 @@
 			})
 		},
 		methods: {
+			pageInit() {
+				this.pageNo = 1
+				this.pageSize = 10
+				this.total = 0
+				this.totalWeight = 0
+				this.totalMoney = 0
+				this.list = []
+				this.getRow(1)
+				this.getTotalData()
+			},
 			// 进入详情
-			intoDetail() {
+			intoDetail(item) {
 				uni.navigateTo({
-					url: '/pages/order/hisOrderDetail'
+					url: '/pages/order/hisOrderDetail?orderNo='+item.orderReserveNo
 				})
 			},
 			// scroll-view到底部加载更多
@@ -85,24 +100,16 @@
 				let params = {
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					orderStateList: this.tabList[this.current].queryLabel, // tab分类
 				}
 				this.noDataText = '暂无数据'
 				this.status = "loading"
-				getOrderList(params).then(res => {
+				historyOrderQuery(params).then(res => {
 					if (res.status == 200) {
 						if (this.pageNo > 1) {
 							this.list = this.list.concat(res.data.list || [])
 						} else {
 							this.list = res.data.list || []
 						}
-						const date1 = moment().toArray()  //  当前时间 数组形式
-						this.list.map(item=>{ 
-							const date2 = moment(item.orderTime).toDate()  //  下单时间  日期格式
-							const date3 = moment(date2).toArray()  //  下单时间  数组形式
-							const tt = 1800 - moment(date1).diff(moment(date3), 'seconds')//   距离30分钟支付   当前剩余秒数 = 1800秒 - 计算相差的秒数(当前时间-支付时间)
-							item.leftTimeT = tt > 0 ? tt : 0
-						})
 						this.total = res.data.count || 0
 					} else {
 						this.list = []
@@ -112,6 +119,15 @@
 					this.status = "loadmore"
 				})
 			},
+			// 总计查询
+			getTotalData() {
+				historyOrderTotal({}).then(res=>{
+					if(res.status == 200) {
+						this.totalWeight = res.data.totalAllWeight/1000
+						this.totalMoney = res.data.originalAllAmount
+					} 
+				})
+			},
 		}
 	}
 </script>

+ 85 - 173
pages/order/waitOrderDetail.vue

@@ -5,7 +5,7 @@
 			<view class="order-status">
 				<view class="status-title flex align_center justify_center">
 					<view class="t-icon icon t-icon-icon_service"></view>
-				{{orderInfo.orderStateDictValue}}
+				{{orderInfo.orderStatusDictValue}}
 				</view>
 				<view class="status-care">
 					预约时间:2021-05-10 15:10:05
@@ -18,29 +18,34 @@
 					<view class="care">(切换分类可输入不同回收物的价格和重量)</view>
 				</view>
 				<view class="item flex">
-					<view class="item-type active">
-						纸质类
+					<view :class="['item-type', curType == item.code ? 'active' : '']" v-for="item in typeData" :key="item.id">
+						{{item.dispName}}
 					</view>
-					<view class="item-type">
+					<!-- <view class="item-type">
 						纸质类
-					</view>
+					</view> -->
 				</view>
-				<view class="item flex justify_between align_center">
-					<view class="flex flex_1 align_center">
+				<view class="table">
+					<view>单价(元/kg)</view>
+					<view>重量(kg)</view>
+					<view>合计金额(元)</view>
+				</view>
+				<view class="item flex justify_between">
+					<view class="flex align_center">
 						<text>黄纸</text>
-						<u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="value" placeholder="" type="number" />元/kg
+						<u-input :custom-style="inputLeftStyle" input-align="center" :clearable="false" v-model="value" placeholder="" type="number" />
 					</view>
 					<view class="flex flex_1 align_center">
-						<u-input class="flex_1" input-align="center" :clearable="false" v-model="value" placeholder="请输入重量" type="number" />kg
-						<text>/0.00元</text>
+						<u-input input-align="center" :clearable="false" v-model="value" placeholder="请输入重量" type="number" />
 					</view>
+					<view class="flex_1"></view>
 				</view>
 			</view>
 			<!-- 金额 -->
 			<view class="item-info">
 				<view class="item flex justify_between">
 					<text>应付金额</text>
-					<text>22.20 元</text>
+					<text>{{orderInfo.payAmount}} 元</text>
 				</view>
 				<view class="item flex justify_between">
 					<text>支付方式</text>
@@ -48,18 +53,17 @@
 				</view>
 			</view>
 			<!-- 服务信息 -->
-			<view class="info-main">
-				<view class="flex align_center">
+			<view class="info-main flex flex_column">
+				<view class="flex flex_1 align_center">
 					<view class="new-left">
-						陕西省西安市未央区华
-						帝金座602室
+						{{orderInfo.contactAddress}}
 					</view>
 				</view>
 				<view class="time flex align_center justify_between">
-					<text>百果园(贞观路店)</text>
+					<text>{{orderInfo.contactName}}</text>
 					<view class="flex align_center">
 						<view class="t-icon phone t-icon-icon_phone"></view>
-						<text>18092252287</text>
+						<text>{{orderInfo.contactMobile}}</text>
 					</view>
 				</view>
 			</view>
@@ -69,71 +73,35 @@
 
 <script>
 	import moment from 'moment'
+	import { orderDetailFind, orderSubmit } from '@/api/order.js'
+	import { getLookUpDatas } from '@/api/data.js'
+	import { reservePriceFind } from '@/api/index.js'
 	export default {
 		data() {
 			return {
-				orderInfo: {
-					id: '',
-					createDate: '2021-05-10 15:22',
-					orderStateDictValue: '待服务',
-					storeName: '昆仑润滑·车领主 (西咸新区-...',
-					location: '2.9km',
-					orderState:'WAIT_PAY',
-					type: [
-						{
-							name:'纸质类',
-							id: '1'
-						},
-						{
-							name:'衣物类',
-							id: '12'
-						}
-					],
-					orderGoodsList: [
-						{
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-						},
-						{
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-						},
-					],
-					payGold: 450
-				},
+				orderInfo: {},
 				totalPrice: 0, // 支付合计
-				password: '', // 支付密码
-				showSetPswModal: false,  // 设置支付密码弹窗
-				showInputPsw: false, // 打开输入密码弹窗
-				showLeavePsw: false, // 打开确定放弃弹窗
-				orderId: '', // 订单id
-				leftTime: null,
-				payFinish: false , // 是否支付成功
-				focus: false,
+				orderReserveNo: '', // 订单号
 				inputLeftStyle: {
 					Width: '120rpx',
 					borderBottom: '1px solid #707070',
 					padding: '0rpx 10rpx',
 					color: '#191919'
 				},
-				inputRightStyle: {
-					
-				}
+				curType: '', // 当前类型
+				typeData: [], // 垃圾类型数据
+				paperList: [], // 纸张分类价格数据
+				clothesList: [], // 衣物分类价格数据
+				metalList: [], // 金属分类价格数据
+				plasticList: [], // 塑料分类价格数据
 			}
 		},
 		onLoad(options) {
-			// 监听设置密码是否成功
-			uni.$once('setPswSuccess', this.setPsw)
-			if (options.id) {
-				console.log(options.id)
-				this.orderId = options.id
-				// this.getOrderDetail()
+			if (options.orderNo) {
+				console.log(options.orderNo)
+				this.orderReserveNo = options.orderNo
+				this.getOrderDetail()
+				this.getRubbishType()
 			}
 			// 开启分享
 			uni.showShareMenu({
@@ -145,121 +113,55 @@
 			
 		},
 		methods: {
-			// 支付剩余时间
-			leftTimeFun() {
-				const date1 = moment().toArray()  //  当前时间 数组形式
-				const date2 = moment(this.orderInfo.orderTime).toDate()  //  下单时间  日期格式
-				const date3 = moment(date2).toArray()  //  下单时间  数组形式
-				const date4 = moment(date1).diff(moment(date3), 'seconds')//计算相差的秒数
-				const tt = 30 - Math.ceil(date4/60)  //向上取整
-				if (tt > 0) {
-					this.leftTime = tt
-				} else {
-					// this.getOrderDetail()
-					this.leftTime = '00'
-				}
-			},
 			// 获取订单详情
 			getOrderDetail() {
-				orderDetail({
-					id: this.orderId
+				orderDetailFind({
+					orderReserveNo: this.orderReserveNo
 				}).then(res => {
 					console.log(res,'rrrrrrrr')
 					if (res.status == 200) {
 						this.orderInfo = res.data
-						if(this.orderInfo.orderState=='WAIT_PAY') {
-							this.leftTimeFun()
-						}
 					} 
 				})
 			},
-			// 跳转到设置支付密码页
-			toSetPwd () {
-				uni.navigateTo({
-					url:"/pages/userCenter/userInfo/smsVerification"
-				})
-			},
-			// 设置密码成功, 打开输入密码弹窗
-			setPsw (e) {
-				if (e.success) {
-					this.showInputPsw = true
-					setTimeout(()=>{
-						this.focus = true
-					},300)
-				}
-			},
-			// 关闭输入密码弹窗
-			closePayModal(){
-				if(!this.payFinish) {
-					this.showLeavePsw = true
-				} 
-			},
-			//确认放弃
-			canclePay() {
-				this.password = ''
-				this.showLeavePsw = false
-				this.showInputPsw = false
-				this.focus = false
-			},
-			// 继续支付
-			payAgain () {
-				this.focus = false
-				this.showLeavePsw = false
-				this.showInputPsw = true
-				setTimeout(()=>{
-					this.focus = true
-				},300)
-			},
-			// 支付 判断用户是否设置过支付密码
-			toPay() {
-				this.totalPrice = this.orderInfo.originalGold
-				this.payFinish = false
-				// 判断用户是否设置过支付密码
-				existPayPwd().then(res=>{
-					console.log(res,'rrrrrr')
+			// 获取垃圾类型数据
+			getRubbishType() {
+				getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
+					console.log(res,'------rrrrrr')
 					if(res.status == 200) {
-						// 设置过支付密码,输入密码
-						if(res.data) {
-							this.showInputPsw = true
-							setTimeout(()=>{
-								this.focus = true
-							},300)
-						} else {
-							// 没设置过支付密码,提示设置密码
-							 this.showSetPswModal = true
-						}
-					} 
+						this.typeData = res.data || []
+						this.curType = this.typeData.length ? this.typeData[0].code : ''
+						this.getRow()
+					} else {
+						this.typeData = []
+					}
 				})
 			},
-			// 支付
-			toPayOrder() {
-				if (this.password === '') {
-					uni.showToast({
-						title: '请先输入支付密码',
-						icon: 'none'
-					})
-					return false
-				}
-				let id = this.orderInfo.id
-				let params = {
-					payPwd: this.password,
-					id: id
-				}
-				signPay(params).then(res=>{
-					this.btnLoading = false
-					if(res.status == 200) {
-						// 关闭弹窗 刷新页面
-						this.payFinish = true
-						this.showInputPsw = false
-						this.getOrderDetail()
-						// 刷新订单列表
-						uni.$emit('refresh')
-						// 跳转到支付完成界面
-						uni.navigateTo({
-							url:"/pagesA/toOrder/payFinish?id=" + id
-						})
-					} else{
-						this.password = ''
+			// 查询列表
+			getRow() {
+				reservePriceFind({code:this.curType}).then(res => {
+					if (res.status == 200) {
+						this.list = res.data
+						// 纸质
+						if(this.curType == 'PAPER'){
+							
+						}
+						// 衣物
+						if(this.curType == 'CLOTHES'){
+							
+						}
+						// 金属
+						if(this.curType == 'METAL'){
+						
+						}
+						// 塑料类
+						if(this.curType == 'PLASTIC'){
+							
+						}
+					} else {
+						this.list = []
+						this.total = 0
+						this.noDataText = res.message
 					}
 				})
 			},
@@ -289,6 +191,7 @@
 				font-size: 28upx;
 				background-image: url(../../static/order_bg_stor.png);
 				background-repeat: no-repeat;
+				height: 260rpx;
 				.new-left{
 					width: 360rpx;
 					font-size: 36rpx;
@@ -350,6 +253,15 @@
 						margin-top: 10rpx;
 					}
 				}
+				.table{
+					padding: 20rpx 0;
+					display: flex;
+					font-size: 28rpx;
+					view{
+						width: 33%;
+						text-align: center;
+					}
+				}
 				.item{
 					padding: 28rpx 0;
 					font-size: 32rpx;
@@ -368,7 +280,7 @@
 						border-bottom: 1px solid #707070;
 					}
 					.item-type{
-						width: 128rpx;
+						padding: 0 20rpx;
 						height: 56rpx;
 						border: 1px solid #979797;
 						opacity: 1;

+ 75 - 179
pages/recoveryPrice/index.vue

@@ -9,55 +9,19 @@
 				<swiper-item class="swiper-item flex" v-for="(tabs, index) in tabList" :key="index">
 					<!-- 左侧 -->
 					<scroll-view scroll-y v-if="index==current" class="nav-left">
-						<view :class="['nav-left-item', curType == item.id ? 'active' : '']" v-for="(item, index) in typeData" :key="index" @click="selType(item.id)">
-							{{item.label}}
+						<view :class="['nav-left-item', curType == item.code ? 'active' : '']" v-for="(item, index) in typeData" :key="index" @click="selType(item.code)">
+							{{item.dispName}}
 						</view>
 					</scroll-view>
 					<!-- 右侧 -->
-					<scroll-view scroll-y class="nav-right flex_1" v-if="index==current" @scrolltolower="onreachBottom">
-						<!-- 纸质 -->
+					<scroll-view scroll-y class="nav-right flex_1" v-if="index==current" >
 						<view class="check-order-list" 
 						 >
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_aper_yellow.png" ></u-image>
+							<view v-for="item in list" :key="item.id" class="list-item flex align_center">
+								<u-image width="36" height="36" :src="item.icon" ></u-image>
 								<view class="item-cont">
-									<view>黄纸</view>
-									<view>1.24元/kg</view>
-								</view>
-							</view>
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_aper_flower.png" ></u-image>
-								<view class="item-cont">
-									<view>花纸</view>
-									<view>1.24元/kg</view>
-								</view>
-							</view>
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_book.png" ></u-image>
-								<view class="item-cont">
-									<view>书纸</view>
-									<view>1.24元/kg</view>
-								</view>
-							</view>
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_magazine.png" ></u-image>
-								<view class="item-cont">
-									<view>杂志</view>
-									<view>1.24元/kg</view>
-								</view>
-							</view>
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_newspaper.png" ></u-image>
-								<view class="item-cont">
-									<view>报纸</view>
-									<view>1.24元/kg</view>
-								</view>
-							</view>
-							<view class="list-item flex align_center">
-								<u-image width="36" height="36" src="/static/price/icon_aper_miscellaneous.png" ></u-image>
-								<view class="item-cont">
-									<view>杂纸</view>
-									<view>1.24元/kg</view>
+									<view>{{item.name}}</view>
+									<view>{{index==0?item.customerPrice:item.factoryPrice}}元/kg</view>
 								</view>
 							</view>
 						</view>
@@ -74,6 +38,8 @@
 </template>
 <script>
 	// import md5 from 'md5'
+	import { getLookUpDatas } from '@/api/data.js'
+	import { reservePriceFind } from '@/api/index.js'
 	export default {
 		data() {
 			return {
@@ -91,90 +57,13 @@
 						queryLabel: ['WAIT_SEND'] // tab参数
 					},
 				],
-				typeData: [
-					{
-						id: '1',
-						label: '纸品类',
-					},
-					{
-						id: '12',
-						label: '衣物类',
-					},
-					{
-						id: '13',
-						label: '金属类',
-					},
-					{
-						id: '16',
-						label: '塑料类',
-					}
-				], // 左侧类型数据
+				typeData: [], // 左侧类型数据
 				curType: '', // 当前类型
 				current: 0,
 				swiperCurrent: 0,
 				pageNo: 1,
 				pageSize: 10,
-				typeList: [{
-					id: '122',
-					createDate: '2021-05-10 15:22',
-					orderStateDictValue: '待付款',
-					storeName: '昆仑润滑·车领主 (西咸新区-...',
-					location: '2.9km',
-					orderState:'WAIT_PAY',
-					isUp: true,
-					orderGoodsList: [
-						{
-							id: '1',
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-							checked: false
-						},
-						{
-							id: '12',
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-							checked: false
-						},
-					],
-					payGold: 450
-					
-				},{
-					id: '156',
-					createDate: '2021-05-10 15:22',
-					orderStateDictValue: '待付款',
-					storeName: '昆仑润滑·车领主 (西咸新区-...',
-					location: '2.9km',
-					orderState:'WAIT_PAY',
-					isUp: false,
-					orderGoodsList: [
-						{
-							id: '13',
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-							checked: false
-						},
-						{
-							id: '15',
-							goodsImages: '',
-							goodsName: '水蜡免擦洗车(轿车)',
-							payGold: 200,
-							buyQty: 2,
-							goodsNum: 5,
-							checked: false
-						},
-					],
-					payGold: 450
-					
-				}],
+				list: [], // 类型list
 			}
 		},
 		onLoad() {
@@ -184,6 +73,8 @@
 				withShareTicket: true,
 				menus: ['shareAppMessage', 'shareTimeline']
 			})
+			// 获取垃圾类型
+			this.getRubbishType()
 		},
 		onUnload() {
 		},
@@ -204,6 +95,19 @@
 				this.pageNo = 1
 				this.getRow()
 			},
+			// 获取垃圾类型数据
+			getRubbishType() {
+				getLookUpDatas({type:'RESERVE_RUBBISH_TYPE'}).then(res=>{
+					console.log(res,'------rrrrrr')
+					if(res.status == 200) {
+						this.typeData = res.data || []
+						this.curType = this.typeData.length ? this.typeData[0].code : ''
+						this.getRow()
+					} else {
+						this.typeData = []
+					}
+				})
+			},
 			handleRefresh() {
 				this.getRow()
 			},
@@ -237,54 +141,58 @@
 			},
 			// 单击左侧菜单
 			selType (v) {
-				this.partList = []
+				this.typeList = []
 				this.curType = v
-				
+				this.getRow()
 			},
 			// scroll-view到底部加载更多
-			onreachBottom() {
-				this.action = 'onreachBottom'
-				if (this.list.length < this.total) {
-					this.pageNo += 1
-					this.getRow()
-				} else {
-					if(this.list.length) {
-						uni.showToast({
-							title: '已经到底了',
-							icon: 'none'
-						});
-					}
-					this.status = "nomore"
-				}
-			},
+			// onreachBottom() {
+			// 	this.action = 'onreachBottom'
+			// 	if (this.list.length < this.total) {
+			// 		this.pageNo += 1
+			// 		this.getRow()
+			// 	} else {
+			// 		if(this.list.length) {
+			// 			uni.showToast({
+			// 				title: '已经到底了',
+			// 				icon: 'none'
+			// 			});
+			// 		}
+			// 		this.status = "nomore"
+			// 	}
+			// },
 			// 查询列表
-			getRow(pageNo) {
-				this.status = "loadmore"
-				if (pageNo) {
-					this.pageNo = pageNo
-				}
-				let params = {
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					orderStateList: this.tabList[this.current].queryLabel, // tab分类
-				}
-				this.noDataText = '暂无数据'
+			getRow() {
 				this.status = "loading"
-				getOrderList(params).then(res => {
+				reservePriceFind({code:this.curType}).then(res => {
 					if (res.status == 200) {
-						if (this.pageNo > 1) {
-							this.list = this.list.concat(res.data.list || [])
-						} else {
-							this.list = res.data.list || []
+						this.list = res.data
+						// 纸质
+						if(this.curType == 'PAPER'){
+							this.list[0].icon = '/static/price/icon_aper_yellow.png'
+							this.list[1].icon = '/static/price/icon_aper_flower.png'
+							this.list[2].icon = '/static/price/icon_book.png'
+							this.list[3].icon = '/static/price/icon_magazine.png'
+							this.list[4].icon = '/static/price/icon_aper_miscellaneous.png'
+							this.list[5].icon = '/static/price/icon_newspaper.png'
+						}
+						// 衣物
+						if(this.curType == 'CLOTHES'){
+							this.list[0].icon = '/static/price/icon_clothes.png'
+						}
+						// 金属
+						if(this.curType == 'METAL'){
+							this.list[0].icon = '/static/price/icon_iron_thin.png'
+							this.list[1].icon = '/static/price/icon_iron_thick.png'
+							this.list[2].icon = '/static/price/icon_steel.png'
+						}
+						// 塑料类
+						if(this.curType == 'PLASTIC'){
+							this.list[0].icon = '/static/price/icon_frame_white.png'
+							this.list[1].icon = '/static/price/icon_frame_black.png'
+							this.list[2].icon = '/static/price/icon_acrylic.png'
+							this.list[3].icon = '/static/price/icon_bottle.png'
 						}
-						const date1 = moment().toArray()  //  当前时间 数组形式
-						this.list.map(item=>{ 
-							const date2 = moment(item.orderTime).toDate()  //  下单时间  日期格式
-							const date3 = moment(date2).toArray()  //  下单时间  数组形式
-							const tt = 1800 - moment(date1).diff(moment(date3), 'seconds')//   距离30分钟支付   当前剩余秒数 = 1800秒 - 计算相差的秒数(当前时间-支付时间)
-							item.leftTimeT = tt > 0 ? tt : 0
-						})
-						this.total = res.data.count || 0
 					} else {
 						this.list = []
 						this.total = 0
@@ -295,30 +203,18 @@
 			},
 			resetPage() {
 				this.status = 'loading';
+				this.curType = this.typeData[0].code
 				// 上划分页
 				if (this.action == 'onreachBottom') {
-					// this.getRow();
+					this.getRow();
 				}
 				// 左右切换tab
 				if (this.action == 'swiperChange') {
 					this.list = [];
-					// this.getRow(1);
+					this.getRow();
 				}
 			},
-			itemChange(item) {
-				// item.isUp = !item.isUp
-				this.$nextTick(function(){
-					item.isUp = !item.isUp
-				})
-			},
-			// 详细页
-			viewRow(item) {
-				console.log(item, '111111')
-				// 已完成的
-				uni.navigateTo({
-					url: "/pages/order/orderDetail?id=" + item.id
-				})
-			},
+			
 		}
 	}
 </script>

+ 18 - 69
pages/recoveryTotal/index.vue

@@ -9,7 +9,7 @@
 			</view>
 			<!-- 总计 -->
 			<view class="header-cont">
-				总计:回收重量1000.11kg,支出金额4500.00
+				总计:回收重量{{totalWeight}}kg,支出金额{{totalMoney}}
 			</view>
 		</view>
 		<view class="list-cont">
@@ -23,22 +23,11 @@
 			</view>
 			<scroll-view class="scroll-con" :scroll-top="scrollTop" scroll-y @scrolltolower="onreachBottom">
 				<!-- 列表数据 -->
-				<view class="table item" v-for="item in listdata">
-					<view>2020-10-21</view>
-					<view>100</view>
-					<view>100</view>
+				<view class="table item" v-for="item in listdata" :key="item.id">
+					<view>{{item.reserveFinishDate}}</view>
+					<view>{{item.totalAllWeight/1000}}</view>
+					<view>{{item.originalAllAmount}}</view>
 				</view>
-				<!-- <view class="cell-item" >
-					<view class="cell-item-title" >
-						<view>
-							<text>{{item.createDate}}</text>
-						</view>
-						<view @click="intoPage(item)">
-							<span class="view">查看详情</span>
-							<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
-						</view>
-					</view>
-				</view> -->
 				<view class="nodata" v-if="listdata.length==0 && status!='loading'">
 					<u-empty :text="noDataText" mode="list"></u-empty>
 				</view>
@@ -70,10 +59,12 @@
 				status: 'loadmore',  //  加载中状态
 				openScreen: false,  //  是否打开筛选
 				searchForm: {  //  查询条件
-					beginDate: getDate.getRecentday().starttime,  //  创建时间默认筛选近7天
-					endDate: getDate.getRecentday().endtime,  //  创建时间默认筛选近7天
+					beginDate: moment().startOf('year').format('YYYY-MM-DD'),  //  创建时间默认筛选近7天
+					endDate: moment().format('YYYY-MM-DD'),  //  创建时间默认筛选近7天
 				},
 				scrollTop: 0,  //  滚动条位置
+				totalWeight: 0, // 总重量
+				totalMoney: 0, //总金额
 			}
 		},
 		onLoad() {
@@ -109,8 +100,8 @@
 				recycleOrderReserve({
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					beginDate: this.searchForm.beginDate?moment(this.searchForm.beginDate).format('YYYY-MM-DD 00:00:00'):'',
-					endDate: this.searchForm.endDate ? moment(this.searchForm.endDate).format('YYYY-MM-DD 23:59:59'):'',
+					beginRecycleDate: this.searchForm.beginDate?moment(this.searchForm.beginDate).format('YYYY-MM-DD 00:00:00'):'',
+					endRecycleDate: this.searchForm.endDate ? moment(this.searchForm.endDate).format('YYYY-MM-DD 23:59:59'):'',
 				}).then(res => {
 					if (res.status == 200) {
 						if(this.pageNo>1){
@@ -142,20 +133,14 @@
 			},
 			// 总计
 			getTotal(){
-				this.titleStatus = true
 				recycleOrderReserveSum({
-					beginDate: this.searchForm.beginDate?moment(this.searchForm.beginDate).format('YYYY-MM-DD 00:00:00'):'',
-					endDate: this.searchForm.endDate ? moment(this.searchForm.endDate).format('YYYY-MM-DD 23:59:59'):''}).then(res=>{
+					beginRecycleDate: this.searchForm.beginDate?moment(this.searchForm.beginDate).format('YYYY-MM-DD 00:00:00'):'',
+					endRecycleDate: this.searchForm.endDate ? moment(this.searchForm.endDate).format('YYYY-MM-DD 23:59:59'):''}).then(res=>{
 						if(res.status==200){
-							const a = res.data.find(item=>item.rubbishType=='GATHER_BUILDING')
-							const b = res.data.find(item=>item.rubbishType=='GATHER_OTHER')
-							const c = res.data.find(item=>item.rubbishType=='GATHER_KITCHEN')
-							this.jianzhuTotal= a ? (a.rubbishWeight/1000).toFixed(3)/1 : '0'
-							this.chuyuTotal= c ? (c.rubbishWeight/1000).toFixed(3)/1 : '0'
-							this.otherTotal= b ? (b.rubbishWeight/1000).toFixed(3)/1 : '0'
+							this.totalWeight = res.data.totalAllWeight/1000
+							this.totalMoney = res.data.originalAllAmount
 						}
 					console.log(res)
-					this.titleStatus = false
 				})
 			},
 		}
@@ -218,6 +203,7 @@
 			.item{
 				border-bottom: 1px solid #E5E5E5;
 			}
+			
 		}
 		.scroll-con{
 			flex: 1;
@@ -226,45 +212,8 @@
 			-webkit-flex:1;
 			-ms-flex:1;
 			overflow: auto;
-			.cell-item{
-				width: 100%;
-				background-color: #fff;
-				border-radius: 15upx;
-				// padding: 20upx;
-				box-shadow: 0upx 3upx 6upx #eee;
-				.cell-item-title{
-					padding: 20upx 20upx 10upx;
-					width: 100%;
-					display: flex;
-					justify-content: space-between;
-					// border-bottom: 1px solid #e6e6e6;
-					.view{
-						color: #999999;
-						margin-right: 12upx;
-					}
-				}
-				.cell-item-cont{
-					width: 100%;
-					display: flex;
-					justify-content: space-between;
-					padding: 20upx;
-					margin-bottom: 20upx;
-					.cont-item{
-						display: flex;
-						flex-direction: column;
-						align-items: center;
-						width: 33%;
-						// border-right: 1px solid #e6e6e6;
-						:first-child {
-							width: 120upx;
-							height: 120upx;
-							margin-bottom: 20upx;
-						}
-					}
-					:last-child {
-						border: none;
-					}
-				}
+			.item:last-of-type{
+				border-bottom: none;
 			}
 		}
 		.footer{