1004749546@qq.com 4 vuotta sitten
vanhempi
commit
10bc62bda0

+ 1 - 1
App.vue

@@ -1,6 +1,6 @@
 <script>
 	// const uat_domain = 'https://rider.test.sxzxyj.net' // 预发布
-	const uat_domain = 'http://192.168.16.224:8309' // 本地
+	const uat_domain = 'http://192.168.16.148:8309' // 本地
 	const pro_domain = 'https://gather.zyucgj.cn' // 生产
 	const uat_URL = uat_domain+'/gc-rider/' // 预发布
 	const pro_URL = pro_domain+'/gc-rider/'  // 生产

+ 36 - 17
api/index.js

@@ -1,35 +1,54 @@
 import axios from '@/libs/axios.js'
-// 新增采集信息
-export const gatherList = params => {
+// 待处理订单
+export const waitOrderQuery = (params) => {
   return axios.request({
-    url: `gather/query/${params.pageNo}/${params.pageSize}`,
+    url: `reserve/orderReserveWaitPage`,
     method: 'post',
 	data: params
   })
 }
-
-// 查询采集信息详情
-export const gatherDetail = (params) => {
+// 首页当天订单完成数量/金额/重量统计
+export const reserveTotal = (params) => {
   return axios.request({
-    url: `gather/findById/${params.id}`,
-    method: 'get',
+    url: `reserve/orderReserveTodayInfo`,
+    method: 'post',
+	data: params
   })
 }
 
-// 采集信息总计
-export const gatherTotal = (params) => {
+// 根据垃圾大类型查询今日价格
+export const reservePriceFind = (params) => {
   return axios.request({
-    url: `gather/sumByOperator`,
+    url: `reserve/findByRubbishType`,
     method: 'post',
-	data: params
+	data:params
   })
 }
-
-// 保存采集信息详情
-export const gatherSave = (params) => {
+// 开始/停止接单
+export const changeWorkState = (params) => {
   return axios.request({
-    url: `gather/save`,
+    url: `reserve/stopTakingorderReserve`,
     method: 'post',
 	data:params
   })
-}
+}
+// 回收统计
+export const recycleOrderReserve = (params) => {
+	let url = `reserve/recycleOrderReservePage/${params.pageNo}/${params.pageSize}`
+	delete params.pageNo
+	delete params.pageSize
+  return axios.request({
+    url: url,
+    method: 'post',
+	data:params
+  })
+}
+// 回收统计总计
+export const recycleOrderReserveSum = (params) => {
+  return axios.request({
+    url: `reserve/recycleOrderReserveSum`,
+    method: 'post',
+	data:params
+  })
+}
+// 根据垃圾大类型查询今日价格

+ 6 - 6
pages.json

@@ -10,12 +10,6 @@
 				"enablePullDownRefresh": false
 			}
 		},
-		{
-			"path": "pages/index/addData",
-			"style": {
-				"navigationBarTitleText": "垃圾数据录入"
-			}
-		},
 		{
 			"path": "pages/login/login",
 			"style": {
@@ -75,6 +69,12 @@
 			"style": {
 				"navigationBarTitleText": "订单详情"
 			}
+		},
+		{
+			"path": "pages/recoveryTotal/index",		
+			"style": {
+				"navigationBarTitleText": "回收统计"
+			}
 		}
     ],
 	"globalStyle": {

+ 0 - 326
pages/index/addData.vue

@@ -1,326 +0,0 @@
-<template>
-	<view class="content">
-		<view>
-			<view class="form-data">
-				<u-form :model="form" ref="uForm" :label-width="140" :error-type="['toast']">
-						<u-form-item prop="gatherNum_other" label="其他垃圾:" >
-							<u-input :disabled="isView" @input="numberToFixed('gatherNum_other',0,999999)" type="number" placeholder="请输入" v-model="form.gatherNum_other" />
-							<text slot="right" style="color: #000000;">桶(约{{form.gatherNum_other*240}}kg)</text>
-						</u-form-item>
-						<u-form-item prop="gatherNum_chuyu" label="厨余垃圾:" >
-							<u-input :disabled="isView" @input="numberToFixed('gatherNum_chuyu',0,999999)" placeholder="请输入" type="number" v-model="form.gatherNum_chuyu" />
-							<text slot="right" style="color: #000000;">桶(约{{form.gatherNum_chuyu*240}}kg)</text>
-						</u-form-item>
-						<u-form-item prop="gatherNum_jianzhu" label="建筑垃圾:" >
-							<u-input :disabled="isView" @input="numberToFixed('gatherNum_jianzhu',2,999999)" placeholder="请输入" type="digit" v-model="form.gatherNum_jianzhu" />
-							<text slot="right" style="color: #000000;">吨(约{{form.gatherNum_jianzhu*1000}}kg)</text>
-						</u-form-item>
-				</u-form>
-			</view>
-			<view class="form-data remark">
-				<text>信息备注</text>
-				<textarea :disabled="isView" :auto-height="true" :maxlength="30" v-model="form.remarks" class="receiveAddress"/>
-			</view>
-			<view class="form-data qyImg">
-				<text>清运照片</text>
-				<view class="info-main">
-					<view v-if="photograph.length<3 && !isView" class="camera-btn">
-						<view @click="goPhotograph" class="photograph-camera">
-							<u-icon name="camera" color="#bfbfbf" size="60" ></u-icon>
-						</view>
-						<view >
-							(最多3张)
-						</view>
-						<view >
-							(每张最大不超过10M)
-						</view>
-					</view>
-					<view v-show="photograph.length" v-for="(item,index) in photograph" :key="index" class="photograph-con">
-						<u-icon v-show="!isView" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
-						<u-image width="100%" height="100%" :src="item" @click="previewPictures(item)"></u-image>
-					</view>
-				</view>
-			</view>
-			<u-button v-if="isView" @click="isView = false" class="submitBtn" type="waring" shape="circle">修改</u-button>
-			<u-button v-else @click="submit" :loading="loading" class="submitBtn" type="success" shape="circle">提交</u-button>
-			<uni-popup ref="openModal" type="center">
-				<uni-popup-dialog content="确认提交吗?" @confirm="onOk" :title="title"></uni-popup-dialog>
-			</uni-popup>
-		</view>
-	</view>
-</template>
-
-<script>
-	import uniPopup from '@/components/uni-popup/uni-popup.vue'
-	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
-	import {gatherSave,gatherDetail} from '@/api/index.js'
-	import {numberToFixed,saveImgToAliOss} from '@/libs/tools.js'
-	export default {
-		components: {
-			uniPopup,uniPopupDialog
-		},
-		data() {
-			return {
-				title:'',
-				loading:false, // 提交按钮加载圈
-				photograph: [], //  图片路径
-				form: {
-					gatherNum_other: '', // 其它垃圾
-					gatherNum_chuyu: '', // 厨余垃圾
-					gatherNum_jianzhu: '', // 建筑垃圾
-					remarks: '' // 备注
-				},
-				isView: false ,// 是否是查看详情
-				itemId:''
-			};
-		},
-		onLoad(option) {
-			console.log(option,option.id,'ppppppppp')
-			// 查看
-			if(option && option.id){
-				this.isView = true
-				this.itemId=option.id
-				this.getDetailData()
-			}else {
-				console.log('--------新增')
-				this.photograph = []
-				this.form.remarks = ''
-				this.$refs.uForm.resetFields()
-			}
-		},
-		onUnload() {
-		},
-		methods: {
-			// 保留几位小数
-			numberToFixed: function (key, num, max) {
-			  let val = this.form[key]
-			  let ret = numberToFixed(val, num, max)
-			  this.$nextTick(() => {
-			  	this.form[key] = ret
-			  })
-			},
-			// 获取详情数据
-			getDetailData(){
-				gatherDetail({id:this.itemId}).then(res=>{
-					if(res.status==200){
-						console.log(res)
-						const a = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_BUILDING')
-						const b = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_OTHER')
-						const c = res.data.gatherRubbishList.find(item=>item.rubbishType=='GATHER_KITCHEN')
-						this.form.gatherNum_jianzhu= a ? a.gatherNum.toString() : '0'
-						this.form.gatherNum_chuyu= c ? c.gatherNum.toString() : '0'
-						this.form.gatherNum_other= b ? b.gatherNum.toString() : '0'
-						this.form.remarks=res.data.remarks
-						this.photograph=res.data.imageUrlList || []
-						console.log(this.form,'this.form')
-					}
-				})
-			},
-			// 拍照或从相册选图片
-			goPhotograph() {
-				uni.chooseImage({
-				    count: 1, //默认9
-				    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
-				    sourceType: ['album','camera'], //从相册选择
-				    success:  (res) =>{
-						console.log(res,'rrrrrrrrrrr')
-				        console.log(JSON.stringify(res.tempFilePaths));
-						console.log(this.photograph.length,'this.photograph')
-						if(res.tempFiles[0].size>10485760){
-							uni.showToast({
-								title: '图片过大无法上传!',
-								icon: 'none'
-							})
-							return
-						}
-						uni.showLoading({
-							title:'正在保存图片...',
-							mask: true
-						})
-						saveImgToAliOss(res.tempFilePaths[0],(ret)=>{
-							// console.log(ret,'----------ret')
-							this.photograph.push(ret.data)
-							// _this.photograph = ret.data
-							uni.hideLoading()
-						})
-				    }
-				});
-			},
-			//  预览图片
-			previewPictures(item) {
-				const photograph = [item];
-				uni.previewImage({
-					urls: photograph,
-				});
-			},
-			//  删除图片
-			cancelPhotograph(index) {
-				setTimeout(() => {
-					this.photograph.splice(index,1)
-				}, 500);
-			},
-			// 提交
-			submit(){
-				if((!this.form.gatherNum_other ||this.form.gatherNum_other==0)  && (!this.form.gatherNum_chuyu || this.form.gatherNum_chuyu==0) && (!this.form.gatherNum_jianzhu || this.form.gatherNum_jianzhu==0)) {
-					uni.showToast({
-						title: '请至少输入一项垃圾分类的数量!',
-						icon: 'none'
-					})
-					return false
-				} else {
-					this.$refs.openModal.open()
-				}
-			},
-			// 确认提交
-			onOk() {
-				this.$refs.openModal.close()
-				let params = {
-					rubbishEntityList: [],
-					imageUrlList: this.photograph,
-					remarks: this.form.remarks
-				}
-				if(this.itemId){
-					params.id=this.itemId
-				}
-				if(this.form.gatherNum_other) {
-					params.rubbishEntityList.push({
-						"rubbishType":"GATHER_OTHER",
-						"rubbishWeight": this.form.gatherNum_other*240,
-						"gatherNum": this.form.gatherNum_other,
-						"unit":"BUCKET"
-					})
-				}
-				if(this.form.gatherNum_chuyu) {
-					params.rubbishEntityList.push({
-						"rubbishType":"GATHER_KITCHEN",
-						"rubbishWeight": this.form.gatherNum_chuyu*240,
-						"gatherNum": this.form.gatherNum_chuyu,
-						"unit":"BUCKET"
-					})
-				}
-				if(this.form.gatherNum_jianzhu) {
-					params.rubbishEntityList.push({
-						"rubbishType":"GATHER_BUILDING",
-						"rubbishWeight": this.form.gatherNum_jianzhu*1000,
-						"gatherNum": this.form.gatherNum_jianzhu,
-						"unit":"TON"
-					})
-				}
-				this.loading=true
-				gatherSave(params).then(res=>{
-					if(res.status == 200) {
-						uni.showToast({
-							title: res.message,
-							icon: 'none'
-						})
-						setTimeout(()=>{
-							uni.navigateBack()
-						},300)
-					} else {
-						uni.showToast({
-							title: res.message,
-							icon: 'none'
-						})
-					}
-					this.loading= false
-				})
-			},
-			
-		},
-		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
-		onReady() {
-			this.$refs.uForm.setRules(this.rules);
-		}
-	}
-</script>
-
-<style lang="scss">
-	.content{
-		width: 100%;
-		height: 100vh;
-		padding: 0;
-		background: #F5F5F5;
-		// .buttons{
-		// 	font-size: 32upx;
-		// 	display: block;
-		// 	height: 80upx;
-		// 	line-height: 80upx;
-		// 	margin: 0 auto;
-		// 	background-color: #0DC55F;
-		// 	color: #fff;
-		// 	border-radius: 50upx;
-		// }
-		.receiveAddress{
-			width: 100%;
-			line-height: 1.5em;
-			box-sizing: border-box;
-			font-style: normal;
-		}
-		.form-data{
-			padding: 0 40upx;
-			margin-bottom: 20upx;
-			background-color: #fff;
-		}
-		.remark{
-			padding: 40upx ;
-		}
-		.qyImg{
-			padding: 40upx ;
-		}
-		.info-main {
-			margin-top: 14upx;
-			border-radius: 12upx;
-			background-color: #fff;
-			display: flex;
-			.location-icon {
-				padding-left: 10upx;
-				vertical-align: sub;
-			}
-			.photograph-camera {
-				border: 2upx dashed #bfbfbf;
-				border-radius: 12upx;
-				width: 140upx;
-				height: 140upx;
-				display: flex;
-				align-items: center;
-				justify-content: center;
-			}
-			.camera-btn{
-				display: flex;
-				flex-direction: column;
-				align-items: center;
-				color: #999999;
-				font-size: 24upx;
-			}
-			.photograph-con {
-				margin: 0 20upx;
-				width: 140upx;
-				height: 140upx;
-				text-align: center;
-				position: relative;
-				.photograph-icon {
-					display: inline-block;
-					padding-top: 48upx;
-				}
-				.close-circle-icon {
-					background-color: #fff;
-					border-radius: 50%;
-					position: absolute;
-					right: -23upx;
-					top: -23upx;
-					z-index: 9;
-				}
-			}
-		}
-		.submitBtn{
-			font-size: 32upx;
-			display: block;
-			width: 670upx;
-			height: 80upx;
-			line-height: 80upx;
-			margin: 0 auto;
-			color: #fff;
-			border-radius: 50upx;
-		}
-	}
-</style>

+ 102 - 147
pages/index/index.vue

@@ -13,46 +13,49 @@
 			<view class="title">今日统计</view>
 			<view class="header-cont">
 				<view class="cont-item">
-					<text v-if="!titleStatus" >{{otherTotal}}</text>
+					<text v-if="!titleStatus" >{{numTotal}}</text>
 					<text>完成订单数(个)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 				<view class="cont-item">
-					<text v-if="!titleStatus" >{{chuyuTotal}}</text>
+					<text v-if="!titleStatus" >{{weightTotal}}</text>
 					<text>回收重量(kg)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 				<view class="cont-item">
-					<text v-if="!titleStatus" >{{jianzhuTotal}}</text>
+					<text v-if="!titleStatus" >{{moneyTotal}}</text>
 					<text>交易金额(元)</text>
 					<u-loading :show="titleStatus"></u-loading>
 				</view>
 			</view>
 		</view>
 		<!-- 接单按钮 -->
-		<view class="btn-view start-btn">
+		<view v-if="workStatus==0 && hasLogin" class="btn-view start-btn">
 			点击开始接单
 		</view>
+		<view v-if="workStatus==1 && hasLogin" class="btn-view end-btn">
+			接单中(点击停止接单)
+		</view>
 		<!-- 待处理订单 -->
 		<view class="list">
-			<view class="title">
+			<view v-if="hasLogin" class="title">
 				<view>待处理订单(10个)</view>
 			</view>
 			<view class="list-item" v-for="item in listdata" :key="item.id">
-				<u-image class="img-icon" :src="item.icon?item.icon:'../../static/logo.jpg'" border-radius="16" width="160" height="160"></u-image>
+				<u-image class="img-icon" :src="item.icon?item.imageHeader:'../../static/def_home_shop.jpg'" 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.name}}</view>
+						<view class="flex_1 bold ellipsis-one">{{item.contactName}}</view>
 						<view @click="intoWaitOrderDetail()" class="do-btn">去处理</view>
 					</view>
-					 <view class="greey-font flex align_center justify_between">
-						 <view class="dizhi ellipsis-one">{{item.addrDetail}}</view>
+					 <view @click="openLocation(item)" class="greey-font flex align_center justify_between">
+						 <view class="dizhi ellipsis-one">{{item.contactAddress}}</view>
 						 <view class="flex align_center">
 							 <view class="t-icon t-icon-icon_coordinate location-icon"></view>
-							 <text>2.9KM</text>
+							 <text>{{item.distance}}KM</text>
 						 </view>
 					 </view>
-					 <view class="greey-font">2021.05.10 上午,预估50~100kg</view>
+					 <view class="greey-font">2021.05.10 上午,预估{{item.reserveWeight}}kg</view>
 					 <view class="flex">
 						 <view class="mark">
 						 	纸张类
@@ -63,6 +66,12 @@
 					 </view>
 				</view>
 			</view>
+			<view class="nodata" v-if="listdata.length==0 && status!='loading'">
+				<u-empty :text="noDataText" mode="list"></u-empty>
+			</view>
+			<view class="loadmore">
+				<u-loadmore v-if="status=='loading'" :status="status" />
+			</view>
 		</view>
 		<!-- 筛选弹框 -->
 		<search-modal v-if="openScreen" :visible="openScreen" :defaultParams="searchForm" @refresh="refresh" @close="openScreen=false"></search-modal>
@@ -70,45 +79,28 @@
 </template>
 
 <script>
-	import searchModal from './searchModal.vue'
-	import {gatherList,gatherTotal} from '@/api/index.js'
+	import {waitOrderQuery,reserveTotal,changeWorkState} from '@/api/index.js'
 	import { checkLogin } from '@/api/login.js'
 	import moment from 'moment'
 	import getDate from '@/libs/getDate.js'
 	export default {
-		components: { searchModal },
 		data() {
 			return {
 				hasLogin: false, // 是否登录
-				listdata: [
-					{
-						name: '百果园(未央路店)',
-						addrDetail: '西安市未央区凤城八路海圣诞节回复多少积分',
-					},
-					{
-						name: '百果园(未央路店)',
-						addrDetail: '西安市未央区凤城八路海圣诞节回复多少积分',
-					}
-				], // 列表数据
-				otherTotal: 0, // 其它垃圾总和
-				jianzhuTotal: 0, // 建筑垃圾总和
-				chuyuTotal: 0, // 厨余垃圾总和
-				pageNo: 1,  //  当前页码
-				pageSize: 10,  //  每页条数
-				total: 0,  //  数据总条数
+				listdata: [], // 列表数据
 				noDataText: '暂无数据',  //  列表请求状态提示语
 				status: 'loadmore',  //  加载中状态
 				titleStatus: false,  //  顶部加载中状态
-				openScreen: false,  //  是否打开筛选
-				searchForm: {  //  查询条件
-					beginDate: getDate.getRecentday().starttime,  //  创建时间默认筛选近7天
-					endDate: getDate.getRecentday().endtime,  //  创建时间默认筛选近7天
-				},
 				scrollTop: 0,  //  滚动条位置
+				numTotal: 0, // 完成订单个数
+				weightTotal: 0, // 回收重量
+				moneyTotal: 0 // 交易金额
 			}
 		},
 		onLoad() {
 			this.checkUpdate()
+			// 获取当前经纬度
+			// this.getCurPosition()
 			// 开启分享
 			uni.showShareMenu({
 				withShareTicket: true,
@@ -126,27 +118,14 @@
 			checkLogin().then(res => {
 				this.hasLogin = res.status == 200
 				if(this.hasLogin){
-					// this.pageInit()
+					this.getCurPosition()
+					this.getTotalData()
 				} else {
-					this.noDataText = '您尚未登录或登录已过期,完成登录后可查看录入信息!'
+					this.noDataText = '您尚未登录或登录已过期!'
 				}
 			})
 		},
 		methods: {
-			pageInit() {
-				this.pageNo = 1
-				this.pageSize = 10
-				this.total = 0
-				this.scrollTop = 0
-				this.otherTotal= 0 // 其它垃圾总和
-				this.jianzhuTotal= 0 // 建筑垃圾总和
-				this.chuyuTotal= 0 // 厨余垃圾总和
-				this.searchForm.beginDate = getDate.getRecentday().starttime
-				this.searchForm.endDate = getDate.getRecentday().endtime
-				console.log(this.searchForm,'this.searchForm')
-				this.searchHandle()
-				this.getTotal()
-			},
 			// 检查更新
 			checkUpdate(){
 				if (uni.canIUse('getUpdateManager')) {
@@ -181,16 +160,56 @@
 				      })
 				    }
 			},
+			// 获取当前位置
+			getCurPosition () {
+				let _this = this
+				uni.getLocation({
+					 type: 'wgs84', // 默认wgs84
+					 success: function(res) {
+					   console.log(res,'------')
+					   let lat = res.latitude
+					   let lng = res.longitude
+					   // 查询订单信息
+					   _this.getList(lat,lng)
+					 },
+					 fail: function(res) {
+						 console.log(res)
+						 // 查询订单信息
+						 _this.getList()
+					 }
+				});
+			},
+			// 待处理订单信息
+			getList (lat,lng) {
+				// let lat = this.currentPosition.lat
+				// let lng = this.currentPosition.lng
+				waitOrderQuery({handleUserLng:lat,handleUserLat:lng}).then(res => {
+					console.log(res)
+					if(res.status == 200){
+						this.listdata = res.data
+						this.listdata.forEach(item =>{
+							item.distance = item.distance ? Math.round(item.distance/1000) : ''
+						})
+					}
+				})
+			},
+			// 今日统计
+			getTotalData() {
+				reserveTotal().then(res=>{
+					if(res.status == 200) {
+						
+					}
+				})
+			},
 			// 打开回收价格页面
 			openPrice(){
-				uni.navigateTo({
-					url: '/pages/recoveryPrice/index'
-				})
-				// if(this.hasLogin){
-				// 	uni.navigateTo({
-				// 		url: '/pages/recoveryPrice/index'
-				// 	})
-				// }
+				if(this.hasLogin){
+					uni.navigateTo({
+						url: '/pages/recoveryPrice/index'
+					})
+				} else {
+					this.loginModal()
+				}
 			},
 			// 进入待处理订单详情
 			intoWaitOrderDetail(){
@@ -198,96 +217,32 @@
 					url: '/pages/order/waitOrderDetail'
 				})
 			},
-			// 获取查询参数 刷新列表
-			refresh(params){
-				this.searchForm = params
-				this.listdata = []
-				this.total = 0
-				this.searchHandle(1)
-				this.getTotal()
-			},
-			// 搜索查询
-			searchHandle (pageNo) {
-				this.status = "loading"
-				pageNo ? this.pageNo = pageNo : null
-				gatherList({
-					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'):'',
-				}).then(res => {
-					if (res.status == 200) {
-						if(this.pageNo>1){
-							this.listdata = this.listdata.concat(res.data.list || [])
-						}else{
-							this.listdata = res.data.list || []
-							this.scrollTop = 0
-						}
-						this.total = res.data.count || 0
-						this.noDataText = '暂无数据'
-					} else {
-						this.noDataText = res.message
-						this.listdata = []
-						this.total = 0
-					}
-					this.status = "loadmore"
-				})
+			// 导航
+			openLocation(item) {
+				uni.openLocation({
+					latitude: item.lat - 0,
+					longitude: item.lng - 0,
+					name: item.name,
+					address: item.contactAddress
+				});
 			},
-			// scroll-view到底部加载更多
-			onreachBottom() {
-				console.log(111111)
-				if(this.listdata.length < this.total){
-					this.pageNo += 1
-					this.searchHandle()
-				}else{
-					uni.showToast({ title: '已经到底了', icon: 'none' })
-					this.status = "nomore"
-				}
-			},
-			// 总计
-			getTotal(){
-				this.titleStatus = true
-				gatherTotal({
-					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=>{
-						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'
-						}
-					console.log(res)
-					this.titleStatus = false
-				})
+			// 未登录弹窗
+			loginModal(){
+				uni.showModal({
+				  title: '提示',
+				  content: '您尚未登录或登录已过期,请登录后使用',
+				  success: (res)=> {
+				    if (res.confirm) {
+				     uni.navigateTo({
+				         url: '/pages/login/login'
+				     })
+				    } else if (res.cancel) {
+				      console.log('用户点击取消');
+				    }
+				  }
+				});
 			},
-			// 打开垃圾数据录入页面
-			intoPage(item) {
-				
-				uni.navigateTo({
-				    url: url
-				})
-				if(!this.hasLogin){
-					uni.showModal({
-					  title: '提示',
-					  content: '您尚未登录或登录已过期,请登录后使用',
-					  success: (res)=> {
-					    if (res.confirm) {
-					     uni.navigateTo({
-					         url: '/pages/login/login'
-					     })
-					    } else if (res.cancel) {
-					      console.log('用户点击取消');
-					    }
-					  }
-					});
-				} else {
-					uni.navigateTo({
-					    url: url
-					})
-				}
-			}
+			
 		}
 	}
 </script>

+ 0 - 2
pages/login/loginPw.scss

@@ -74,8 +74,6 @@
 		color: #191919;
 		.xieyi{
 			width: 80%;
-			// display: flex;
-			// align-items: center;
 		}
 		text{
 			color: #4F88F7;

+ 0 - 1
pages/recoveryPrice/index.vue

@@ -339,7 +339,6 @@
 			flex: 1;
 			display: flex;
 			flex-direction: column;
-
 			.uTabs {
 				border-bottom: 1px solid #EEEEEE;
 				box-shadow: 1px 1px 3px #eeeeee;

+ 287 - 0
pages/recoveryTotal/index.vue

@@ -0,0 +1,287 @@
+<template>
+	<view class="content">
+		<view class="header">
+			<view @click="openScreen=true">
+				<text v-if="searchForm.beginDate">{{searchForm.beginDate}} 至 {{searchForm.endDate}}</text>
+				<text v-else>全部</text>
+				<u-icon name="arrow-right" color="#9DA8B5" size="30"></u-icon>
+				<!-- <u-image  class="filter-img" width="36rpx" height="36rpx" src="/static/filter.png"></u-image> -->
+			</view>
+			<!-- 总计 -->
+			<view class="header-cont">
+				总计:回收重量1000.11kg,支出金额4500.00元
+			</view>
+		</view>
+		<view class="list-cont">
+			<view class="item-title">
+				详细记录
+			</view>
+			<view class="table">
+				<view>日期</view>
+				<view>重量(kg)</view>
+				<view>金额(元)</view>
+			</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>
+				<!-- <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>
+				<view class="loadmore">
+					<u-loadmore v-if="total>pageSize || status=='loading'" :status="status" />
+				</view>
+			</scroll-view>
+		</view>
+		<!-- 筛选弹框 -->
+		<search-modal v-if="openScreen" :visible="openScreen" :defaultParams="searchForm" @refresh="refresh" @close="openScreen=false"></search-modal>
+	</view>
+</template>
+
+<script>
+	import searchModal from './searchModal.vue'
+	import {recycleOrderReserve,recycleOrderReserveSum} from '@/api/index.js'
+	import { checkLogin } from '@/api/login.js'
+	import moment from 'moment'
+	import getDate from '@/libs/getDate.js'
+	export default {
+		components: { searchModal },
+		data() {
+			return {
+				listdata: [], // 列表数据
+				pageNo: 1,  //  当前页码
+				pageSize: 10,  //  每页条数
+				total: 0,  //  数据总条数
+				noDataText: '暂无数据',  //  列表请求状态提示语
+				status: 'loadmore',  //  加载中状态
+				openScreen: false,  //  是否打开筛选
+				searchForm: {  //  查询条件
+					beginDate: getDate.getRecentday().starttime,  //  创建时间默认筛选近7天
+					endDate: getDate.getRecentday().endtime,  //  创建时间默认筛选近7天
+				},
+				scrollTop: 0,  //  滚动条位置
+			}
+		},
+		onLoad() {
+			this.searchHandle(1)
+			this.getTotal()
+			// 开启分享
+			uni.showShareMenu({
+				withShareTicket: true,
+				menus: ['shareAppMessage', 'shareTimeline']
+			})
+		},
+		onShow() {
+		},
+		methods: {
+			// 打开查询弹窗
+			openSearch(){
+				if(this.hasLogin){
+					this.openScreen = true
+				}
+			},
+			// 获取查询参数 刷新列表
+			refresh(params){
+				this.searchForm = params
+				this.listdata = []
+				this.total = 0
+				this.searchHandle(1)
+				this.getTotal()
+			},
+			// 搜索查询
+			searchHandle (pageNo) {
+				this.status = "loading"
+				this.pageNo = pageNo ? pageNo : this.pageNo
+				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'):'',
+				}).then(res => {
+					if (res.status == 200) {
+						if(this.pageNo>1){
+							this.listdata = this.listdata.concat(res.data.list || [])
+						}else{
+							this.listdata = res.data.list || []
+							this.scrollTop = 0
+						}
+						this.total = res.data.count || 0
+						this.noDataText = '暂无数据'
+					} else {
+						this.noDataText = res.message
+						this.listdata = []
+						this.total = 0
+					}
+					this.status = "loadmore"
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				console.log(111111)
+				if(this.listdata.length < this.total){
+					this.pageNo += 1
+					this.searchHandle()
+				}else{
+					uni.showToast({ title: '已经到底了', icon: 'none' })
+					this.status = "nomore"
+				}
+			},
+			// 总计
+			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=>{
+						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'
+						}
+					console.log(res)
+					this.titleStatus = false
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content {
+		width: 100%;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		padding: 0;
+		.header{
+			width: 100%;
+			background-color: #FFFFFF;
+			display: flex;
+			flex-direction: column;
+			margin-bottom: 20upx;
+			font-size: 30rpx;
+			color: #191919;
+			view:first-child {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				padding: 28rpx 32rpx;
+			}
+			.header-cont{
+				background: rgba(255, 209, 0, 0.4);
+				padding: 20rpx 32rpx;
+			}
+			.filter-img{
+				padding: 10upx;
+			}
+		}
+		.list-cont{
+			flex: 1;
+			width: 100%;
+			-webkit-box-flex:1;
+			-webkit-flex:1;
+			-ms-flex:1;
+			background-color: #fff;
+			padding: 0 32rpx;
+			.item-title{
+				padding: 28rpx 0rpx;
+				font-size: 34rpx;
+				color: #191919;
+			}
+			.table{
+				padding: 20rpx 0;
+				display: flex;
+				font-size: 28rpx;
+				view{
+					width: 33%;
+					text-align: center;
+				}
+			}
+			.item{
+				border-bottom: 1px solid #E5E5E5;
+			}
+		}
+		.scroll-con{
+			flex: 1;
+			width: 100%;
+			-webkit-box-flex:1;
+			-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;
+					}
+				}
+			}
+		}
+		.footer{
+			z-index: 9999;
+			// position: absolute;
+			// bottom: 30upx;
+			// margin: 20upx;
+			width: 95%;
+			height: 80upx;
+			background-color: #0DC55F;
+			opacity: 1;
+			border-radius: 50upx;
+			color: #fff;
+			font-size: 30rpx;
+			display: flex;
+			align-items: center;
+			justify-content: center;
+		}
+	}
+</style>

+ 0 - 0
pages/index/searchModal.vue → pages/recoveryTotal/searchModal.vue


+ 4 - 6
pages/userCenter/index.vue

@@ -7,8 +7,8 @@
 				<!-- <u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image> -->
 			</view>
 			<view class="user-info">
-				<view v-if="hasLogin" class="user-info-item">{{userData.stationName || ''}}</view>
-				<view v-if="hasLogin" class="user-info-item">{{userData.gatherName||''}} {{userData.gatherPhone || ''}}</view>
+				<view v-if="hasLogin" class="user-info-item">{{userData.userName || ''}}</view>
+				<view v-if="hasLogin" class="user-info-item">{{userData.userMobile || ''}}</view>
 				<view v-if="!hasLogin"  class="user-info-item" @click="toLoginPage">
 					请点击登录
 				</view>
@@ -24,7 +24,7 @@
 				</view>
 				<u-icon name="arrow-right" color="#9DA8B5" size="32"></u-icon>
 			</navigator>
-			<navigator class="list-item flex align_center justify_between">
+			<navigator url="/pages/recoveryTotal/index" class="list-item flex align_center justify_between">
 				<view class="flex align_center">
 					<view class="t-icon icon t-icon-icon_statistics"></view>
 					<text>回收统计</text>
@@ -73,9 +73,7 @@
 			})
 		},
 		computed: {
-			user() {
-				return this.userData 
-			}
+			
 		},
 		onLoad() {
 			// this.getVersion()

BIN
static/def_home_shop.png