Переглянути джерело

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/zxyj-mini-html into develop

lilei 4 роки тому
батько
коміт
e72478f5e3

+ 5 - 4
api/order.js

@@ -11,7 +11,7 @@ export const getStoreItems = params => {
 // 下单 保存订单
 export const saveOrder = params => {
   return axios.request({
-    url: `order/save`,
+    url: `order/addOrder`,
     method: 'post',
 	data: params
   })
@@ -20,14 +20,15 @@ export const saveOrder = params => {
 // 下单 预支付
 export const signPay  = params => {
   return axios.request({
-    url: `order/pay?orderId=${params.orderId}`,
-    method: 'get',
+    url: `order/payOrder`,
+    method: 'post',
+    data: params
   })
 };
 
 // 我的订单
 export const getOrderList = params => {
-	let url = `order/query/${params.pageNo}/${params.pageSize}`
+	let url = `order/queryPage/${params.pageNo}/${params.pageSize}`
 	delete params.pageNo
 	delete params.pageSize
 	return axios.request({

+ 9 - 0
api/user.js

@@ -130,4 +130,13 @@ export const getMessage = params => {
     data: params,
     method: 'post'
   })
+}
+// 乐豆使用明细
+export const ldUsedQuery = params => { 
+  let url = `customerGoldLog/queryByMonth`
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
 }

+ 85 - 0
libs/getDate.js

@@ -0,0 +1,85 @@
+// 引入 moment 时间插件
+import moment from 'moment'
+// 获取今日/昨日/本周/上周/本月/上月 时间
+export default {
+  // 获取今日的开始结束时间
+  getToday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取昨日的开始结束时间
+  getYesterday () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().add(-1, 'days').startOf('day').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().add(-1, 'days').endOf('day').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前周的开始到当天结束时间
+  getCurrWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week()).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一周的开始结束时间
+  getLastWeekDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().week(moment().week() - 1).startOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().week(moment().week() - 1).endOf('week').add('days').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取当前月的开始到当天结束时间
+  getCurrMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month()).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上一个月的开始结束时间
+  getLastMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取上2个月的开始结束时间
+  getLastTwoMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 2).startOf('month').valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().month(moment().month() - 2).endOf('month').valueOf()).format('YYYY-MM-DD')
+    return obj
+  },
+  // 获取3个月前到今天的开始结束时间
+  getThreeMonthDays () {
+    const obj = {
+      starttime: '',
+      endtime: ''
+    }
+    obj.starttime = moment(moment().month(moment().month() - 3).valueOf()).format('YYYY-MM-DD')
+    obj.endtime = moment(moment().valueOf()).format('YYYY-MM-DD')
+    return obj
+  }
+}

+ 5 - 0
package-lock.json

@@ -4,6 +4,11 @@
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
+    "moment": {
+      "version": "2.29.1",
+      "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
+      "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
+    },
     "uview-ui": {
       "version": "1.7.8",
       "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.7.8.tgz",

+ 1 - 0
package.json

@@ -14,6 +14,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
+    "moment": "^2.29.1",
     "uview-ui": "^1.7.7"
   }
 }

+ 9 - 0
pages.json

@@ -173,6 +173,15 @@
 		        "enablePullDownRefresh": false
 		    }
 		    
+		},
+		{
+		    "path" : "pages/toOrder/payFinish",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "支付完成",
+		        "enablePullDownRefresh": false
+		    }
+		    
 		}
     ],
 	"globalStyle": {

+ 79 - 16
pages/checkOut/checkOut.vue

@@ -22,7 +22,7 @@
 		<view class="num-cont">
 			<text>支付数量</text>
 			<view class="num-input">
-				<u-input v-model="number" type="number" placeholder="请输入数量" />
+				<u-input v-model="number" @click="inputNum('num')" type="number" placeholder="请输入数量" />
 				<text>个乐豆</text>
 			</view>
 		</view>
@@ -31,22 +31,36 @@
 			<u-button  @click="handlePay" type="error" >确认支付</u-button>
 		</view>
 		 <!-- 确认支付弹窗 -->
-		<u-modal v-model="showPayModal" title="请输入支付密码">
+		 <u-popup mode="center" closeable v-model="showPayModal" width="500rpx" >
 			<view class="slot-content">
-				<view>
-					<text>收取门店:</text>
-					<text>{{storeName}}</text>
+				<view>请输入支付密码</view>
+				<view class="text-cont">
+					<view>
+						<text>收取门店:</text>
+						<text>{{storeName}}</text>
+					</view>
+					<view>
+						<text>支付数量:</text>
+						<text><text class="num-big">{{number}}</text>个乐豆</text>
+					</view>
+					<view>
+						<text>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</text>
+						<text>{{remarks||'--'}}</text>
+					</view>
 				</view>
-				<view>
-					<text>支付数量:</text>
-					<text>{{number}}</text>
-				</view>
-				<view>
-					<text>备注:</text>
-					<text>{{remarks}}</text>
+				<view class="footer">
+					<u-input v-model="password" input-align="center" @click="inputNum('psw')" type="password" placeholder="请输入支付密码" />
 				</view>
 			</view>
-		</u-modal>
+		</u-popup>
+		<u-keyboard mode="number" 
+			safe-area-inset-bottom
+			v-model="showKeyboard" 
+			@change="handleChange" 
+			@backspace="handleBack" 
+			@confirm="showKeyboard=false" 
+			@cancel="showKeyboard=false">
+		</u-keyboard>
 	</view>
 </template>
 
@@ -54,16 +68,37 @@
 	export default{
 		data() {
 			return {
-				storeName: '和超级大黄蜂', // 门店名称
+				storeName: '和超级大黄蜂发挥教师的回复', // 门店名称
 				remarks: '', // 备注
 				number: '',  // 支付数量
-				showPayModal: false // 支付弹窗
+				showPayModal: false, // 支付弹窗
+				password: '', // 支付密码
+				showKeyboard: false, // 数字键盘
+				keyInputType: '' // 适用数字键盘输入关联的文本框  num:乐豆数量  psw: 支付密码
 			}
 		},
 		onLoad() {
 			
 		},
 		methods: {
+			// 打开数字键盘
+			inputNum(type) {
+				this.keyInputType = type
+				this.showKeyboard =  true
+			},
+			// 数字键盘输入改变
+			handleChange (val) {
+				if (this.keyInputType == 'num') {
+					this.number += val
+				} else {
+					this.password += val
+				}
+				console.log(this.value)
+			},
+			// 数字键盘退格键
+			handleBack () {
+				
+			},
 			// 确认支付
 			handlePay() {
 				this.showPayModal = true
@@ -98,6 +133,34 @@
 		}
 	}
 	.slot-content{
-		
+		padding: 30upx 0;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: space-between;
+		.text-cont{
+			width: 100%;
+			margin-top: 20upx;
+			border-bottom: 1px solid #F8F8F8;
+			>view {
+				padding: 20upx 40upx;
+				display: flex;
+				>text{
+					&:last-child {
+						flex: 1;
+						padding-left: 30upx;
+					}
+					.num-big{
+						font-size: 36upx;
+						color: red;
+					}
+				}
+			}
+			
+		}
+		.footer{
+			width: 50%;
+			border-bottom: 1px solid #b1b1b1;
+		}
 	}
 </style>

+ 49 - 107
pages/order/order.vue

@@ -8,34 +8,33 @@
 			<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
 				<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
 					<scroll-view scroll-y class="scroll-view" @scrolltolower="onreachBottom">
-						<view class="check-order-list" 
-						v-if="index==current" 
-						v-for="(item,sindex) in list" 
-						:key="item.id+'-'+sindex"
+						<view class="check-order-list" v-if="index==current" v-for="(item,sindex) in list" :key="item.id+'-'+sindex"
 						 @click="viewRow(item)">
 							<view class="check-row">
 								<view class="createDate">{{item.createDate}}</view>
-								<view >{{item.orderFlag}}</view>
+								<view>{{item.orderState}}</view>
 							</view>
-							<view class="bundle-list" v-for="row in item.itemList" :key="row.id">
+							<view class="bundle-list" v-for="row in item.orderGoodsList" :key="row.id">
 								<view class="img-cont">
-									<image :src="row.icon?row.icon:'../../static/goods.png'"></image>
+									<image :src="row.goodsImages"></image>
 								</view>
-								<view >
-									<view class="ellipsis-two">{{row.name}}</view>
+								<view>
+									<view class="ellipsis-two">{{row.goodsName}}</view>
 									<view class="bundle-num">
-										<view ><text class="price-num">{{row.price}}</text> <text class="price-text">乐豆</text></view>
-										<view >X {{row.number}}</view>
+										<view><text class="price-num">{{row.payGold}}</text> <text class="price-text">乐豆</text></view>
+										<view>X {{row.buyQty}}</view>
 									</view>
 								</view>
 							</view>
 							<view class="check-row">
 								<view class="text-right">
 									<text class="total-text">
-										共{{item.totalNum}}件商品
+										共{{item.goodsNum}}件商品
 									</text>
-									<text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><text class="price-num">{{item.amount}}</text> <text class="price-text">乐豆</text></text>
-									<text v-else><text class="money-total">实付</text><text class="price-num">{{item.payedAmount}}</text> <text class="price-text">乐豆</text></text>
+									<text v-if="item.orderFlag=='待支付'"><text class="money-total">应付</text><text class="price-num">{{item.originalGold}}</text>
+										<text class="price-text">乐豆</text></text>
+									<text v-else><text class="money-total">实付</text><text class="price-num">{{item.payGold}}</text> <text
+										 class="price-text">乐豆</text></text>
 								</view>
 							</view>
 							<view class="check-row">
@@ -72,40 +71,41 @@
 		getLookUpDatas,
 		listLookUp
 	} from '@/api/data'
+	import {
+		getOrderList
+	} from '@/api/order.js'
 	export default {
-		components: {
-		},
+		components: {},
 		data() {
 			return {
 				status: 'loadmore',
 				noDataText: '暂无数据',
-				tabList: [
-					{
+				tabList: [{
 						dispName: '全部',
 						typeId: 2,
-						queryLabel: 'ALL' // tab参数
+						queryLabel: [] // tab参数
 					},
 					{
 						dispName: '待支付',
 						typeId: 1,
-						queryLabel: 'DZF' // tab参数
+						queryLabel: ['WAIT_PAY'] // tab参数
 					},
 					{
 						dispName: '待发货',
 						typeId: 3,
-						queryLabel: 'DFH' // tab参数
+						queryLabel: ['WAIT_SEND','SEND_PART'] // tab参数
 					},
 					{
 						dispName: '已发货',
 						typeId: 3,
-						queryLabel: 'YFH' // tab参数
+						queryLabel: ['SEND_ALL'] // tab参数
 					},
 					{
 						dispName: '已完成',
 						typeId: 3,
-						queryLabel: 'YWC' // tab参数
+						queryLabel: ['FINISH'] // tab参数
 					},
-					
+
 				],
 				current: 0,
 				swiperCurrent: 0,
@@ -183,89 +183,17 @@
 			// 查询列表
 			getRow(pageNo) {
 				this.status = "loadmore"
-				this.list = [{
-					createDate: "2020-10-28 11:15:59",
-					orderFlag: "待支付",
-					payedAmount: 0,
-					id: 11,
-					amount: 450,
-					totalNum: 3,
-					itemList: [
-						{
-							name: "八九箭冠",
-							id: 76435,
-							number: 1,
-							price: 150,
-							icon: ''
-						},
-						{
-							name: "数据库的合法身份觉得很附近发生纠纷解决",
-							id: 76436,
-							number: 2,
-							price: 150,
-							icon: ''
-						}
-					]
-				},{
-					createDate: "2020-10-29 11:15:59",
-					orderFlag: "待发货",
-					payedAmount: 300,
-					id: 112,
-					amount: 300,
-					totalNum: 2,
-					itemList: [
-						{
-							name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
-							id: 76440,
-							number: 2,
-							price: 150,
-							icon: ''
-						}
-					]
-				},{
-					createDate: "2020-10-29 11:15:59",
-					orderFlag: "已发货",
-					payedAmount: 300,
-					id: 1112,
-					amount: 300,
-					totalNum: 2,
-					itemList: [
-						{
-							name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
-							id: 76420,
-							number: 2,
-							price: 150,
-							icon: ''
-						}
-					]
-				},{
-					createDate: "2020-10-29 11:15:59",
-					orderFlag: "已完成",
-					payedAmount: 300,
-					id: 1126,
-					amount: 300,
-					totalNum: 2,
-					itemList: [
-						{
-							name: "捐款事件的看法教科书上的发货角度思考JFK就是的JFK即将开放的",
-							id: 76496,
-							number: 2,
-							price: 150,
-							icon: ''
-						}
-					]
-				}]
-				return 
 				if (pageNo) {
 					this.pageNo = pageNo
 				}
 				let params = {
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					queryLabel: this.tabList[this.current].queryLabel, // tab分类
+					orderStateList: this.tabList[this.current].queryLabel, // tab分类
 				}
+				this.noDataText = '暂无数据'
 				this.status = "loading"
-				getBackLogList(params).then(res => {
+				getOrderList(params).then(res => {
 					if (res.status == 200) {
 						if (this.pageNo > 1) {
 							this.list = this.list.concat(res.data.list || [])
@@ -300,14 +228,14 @@
 				this.getRow(1)
 			},
 			// 查看物流
-			showLog (item) {
-				console.log(item,'111111')
+			showLog(item) {
+				console.log(item, '111111')
 				uni.navigateTo({
 					url: "/pages/order/LogList?id="
 				})
 			},
 			// 复制运单编号 
-			copyLogNum () {
+			copyLogNum() {
 				// H5 不支持
 				uni.setClipboardData({
 					data: this.logData.logNum,
@@ -380,6 +308,7 @@
 					}
 				}
 			}
+
 			// 列表样式
 			.check-order-list {
 				background: #ffffff;
@@ -388,6 +317,7 @@
 				border-radius: 6upx;
 				box-shadow: 1px 1px 3px #EEEEEE;
 				font-size: 28upx;
+
 				.check-row {
 					display: flex;
 					align-items: center;
@@ -418,22 +348,26 @@
 						}
 					}
 				}
+
 				// 订单中商品列表
 				.bundle-list {
 					display: flex;
 					padding: 20upx 10upx;
 					font-size: 28upx;
 					border-bottom: 1px solid #F8F8F8;
+
 					.img-cont {
 						width: 158rpx;
 						height: 140upx;
 						border-radius: 15upx;
 						overflow: hidden;
+
 						>image {
 							width: 100%;
 							height: 100%;
 						}
 					}
+
 					>view {
 						&:last-child {
 							flex: 1;
@@ -443,36 +377,44 @@
 							justify-content: space-between;
 						}
 					}
+
 					.bundle-num {
 						display: flex;
 						justify-content: space-between;
 					}
 				}
+
 				.btn-cont {
 					width: 180upx;
 					font-size: 30upx;
 				}
-				.price-text{
+
+				.price-text {
 					font-size: 20upx;
 					margin-left: 10upx;
 				}
-				.price-num{
+
+				.price-num {
 					font-size: 32upx;
 					color: red;
 				}
-				.total-text{
+
+				.total-text {
 					margin-right: 50upx;
 				}
-				.money-total{
+
+				.money-total {
 					margin-right: 10upx;
 				}
 			}
 		}
+
 		// 物流弹窗
 		.slot-content {
 			padding: 40upx 60upx;
 			font-size: 28upx;
-			>view{
+
+			>view {
 				line-height: 60upx;
 			}
 		}

+ 54 - 4
pages/toOrder/index.vue

@@ -50,13 +50,14 @@
 			  <u-image mode="scaleToFill" width="40rpx" height="40rpx" src="/static/ledou.png"></u-image>
 			</view>
 			<view>
-				<u-button size="mini" :custom-style="toOrderButton" type="error" @click="toPay">确认支付</u-button>
+				<u-button size="mini" :loading="btnLoading" :custom-style="toOrderButton" type="error" @click="toSave">确认支付</u-button>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import { saveOrder, signPay} from '@/api/order.js'
 	import {
 		findAddressBycustomerNo
 	} from '@/api/receiveAddress.js'
@@ -69,7 +70,13 @@
 					width: '180rpx',
 					height: '60rpx'
 				},
-				goodsList: []
+				goodsList: [],
+				userInfo: {
+					receiveAddress: '陕西省西安市未央区华帝金座',
+					receiverName: '王明',
+					receiverPhone: '14564654551',
+				},
+				btnLoading: false  // 提交按钮加载圈
 			};
 		},
 		onLoad() {
@@ -98,9 +105,52 @@
 					url:"/pages/toOrder/editAddress"
 				})
 			},
+			// 支付  保存订单
+			toSave(){
+				let orderGoodsList = []
+				this.goodsList.map((item,index)=>{
+					orderGoodsList[index] = {
+						goodsNo: item.goodsNo,
+						buyQty: item.buyQty
+					}
+				})
+				this.btnLoading = true
+				let params = Object.assign(this.userInfo,{orderGoodsList:orderGoodsList})
+				console.log(orderGoodsList,params,'orderGoodsList')
+				saveOrder(params).then(res=>{
+					console.log(res,'rrrrrrr')
+					if(res.status==200) {
+						let id = res.data.id
+						this.toPay(id)
+					} else {
+						this.btnLoading = false
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
+			},
 			// 支付
-			toPay(){
-				
+			toPay(id) {
+				signPay({id:id}).then(res=>{
+					this.btnLoading = false
+					if(res.status == 200) {
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+						// 跳转到支付完成界面
+						uni.navigateTo({
+							url:""
+						})
+					} else{
+						uni.showToast({
+							title: res.message,
+							icon: 'none'
+						})
+					}
+				})
 			}
 		},
 	}

+ 38 - 0
pages/toOrder/payFinish.vue

@@ -0,0 +1,38 @@
+<template>
+	<view class="page-cont">
+		<view class="icon-cont">
+			<u-icon class="icon" name="checkmark" color="green" size="80"></u-icon>
+			<view>支付成功</view>
+		</view>
+	</view>
+</template>
+
+<script>
+</script>
+
+<style lang="less">
+	page{
+		height: 100%;
+	}
+	.page-cont{
+		width: 100%;
+		height: 100%;
+		background-color: #fff;
+		.icon-cont{
+			width: 100%;
+			height: 300upx;
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			justify-content: center;
+		}
+		.icon{
+			width: 120upx;
+			height: 120upx;
+			background-color: #d1d1d1;
+			display: flex;
+			justify-content: center;
+			border-radius: 50%;
+		}
+	}
+</style>

+ 74 - 60
pages/userCenter/ldDetailed.vue

@@ -2,22 +2,25 @@
 	<view class="ldDetailed-container">
 		<!-- 筛选菜单 -->
 		<u-dropdown ref="uDropdown" class="filter-dropdown">
-			<u-dropdown-item v-model="queryParam.recordType" :title="titType" :options="optionsType" @change="searchHandle(1)"></u-dropdown-item>
-			<u-dropdown-item v-model="queryParam.recordScope" :title="titScope" :options="optionsScope" @change="searchHandle(1)"></u-dropdown-item>
+			<u-dropdown-item v-model="queryParam.changeType" :title="titType" :options="optionsType" @change="searchHandle()"></u-dropdown-item>
+			<u-dropdown-item v-model="timeScope" :title="titScope" :options="optionsScope" @change="searchHandle()"></u-dropdown-item>
 		</u-dropdown>
 		<scroll-view class="scroll-con" scroll-y @scrolltolower="onreachBottom">
 			<!-- 列表数据 -->
 			<view class="cell-item-con">
 				<view class="cell-item" v-for="(item, index) in listdata" :key="index">
-					<text class="cell-item-month">{{item.month}}</text>
-					<view class="cell-item-main" v-for="(subItem, ind) in item.list" :key="ind">
-						<text :class="['cell-item-pic', subItem.type == 1?'orange':'']">{{subItem.type == 1 ? '收' : '支'}}</text>
+					<text class="cell-item-month" v-if="timeScope == 'threeMonth'">{{item.month}}</text>
+					<view class="cell-item-main" v-for="(subItem, ind) in item.monthDataList" :key="ind">
+						<text :class="['cell-item-pic', subItem.changeType == 'ADD'?'orange':'']">{{subItem.changeType == 'ADD' ? '收' : '支'}}</text>
 						<view class="cell-item-c">
-							<text class="cell-item-des">{{subItem.dec}}</text>
-							<text class="cell-item-date">{{subItem.creatDate}}</text>
+							<text class="cell-item-des">{{subItem.remarks}}</text>
+							<text class="cell-item-date">{{subItem.createDate}}</text>
 						</view>
-						<text :class="['cell-item-score', Number(subItem.score) > 0 ? 'red' : 'black']">{{Number(subItem.score)>0 ? '+'+subItem.score : subItem.score}}</text>
+						<text :class="['cell-item-score', subItem.changeType == 'ADD' ? 'red' : 'black']">
+						{{subItem.changeType == 'ADD' ? '+'+subItem.changeNum : subItem.changeNum}}
+						</text>
 					</view>
+					<u-empty class="nodata" :text="noDataText" v-if="item.monthDataList.length==0 && status!='loading'" mode="list"></u-empty>
 				</view>
 			</view>
 			<u-empty class="nodata" :text="noDataText" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
@@ -29,92 +32,98 @@
 </template>
 
 <script>
+	import {ldUsedQuery} from '@/api/user.js'
+	import getDate from '@/libs/getDate'
+	import moment from 'moment'
 	export default {
 		data() {
 			return {
-				listdata: [
-					{
-						month: '本月',
-						list: [
-							{ type: 1, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: +25 },
-							{ type: 2, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: -30 },
-							{ type: 3, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: -15 },
-						]
-					},
-					{
-						month: '10月',
-						list: [
-							{ type: 1, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: +25 },
-							{ type: 2, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: -30 },
-							{ type: 3, dec: '投递可回收物获得乐豆', creatDate: '2020-11-04 14:08', score: -15 },
-						]
-					}
-				],
+				listdata: [],
 				pageNo: 1,  //  当前页码
 				pageSize: 10,  //  每页条数
 				total: 0,  //  数据总条数
 				noDataText: '暂无数据',  //  列表请求状态提示语
 				status: 'loadmore',  //  加载中状态
+				timeScope: 'threeMonth', // 时间类别 1:近三个月 2:本月 3:本月前一月 4:本月前2月
 				queryParam: {  //  过滤条件
-					recordType: '',
-					recordScope: ''
+					changeType: '', // 金币变更类型
 				},
 				optionsType: [
-					{ label: '所有记录', value: 1, },
-					{ label: '获取记录', value: 2, },
-					{ label: '使用记录', value: 3, }
+					{ label: '所有记录', value: '', },
+					{ label: '获取记录', value: 'ADD', },
+					{ label: '使用记录', value: 'SUB', }
 				]
 			}
 		},
 		onShow() {
-			this.searchHandle(1)
+			this.searchHandle()
 		},
 		onLoad() {
+			this.timeScope = 'threeMonth'
+			this.queryParam.changeType = ''
 		},
 		computed: {
+			// 时间过滤条件
 			optionsScope(){  //  过滤条件  近3个月
 				let arr = [
-					{ label: '近3个月', value: 1 },
-					{ label: '本月', value: 2 }
+					{ label: '近3个月', value: 'threeMonth' },
+					{ label: '本月', value: 'thisMonth' }
 				]
-				arr[2] = { label: new Date().getMonth() + '月', value: 3 }
-				arr[3] = { label: new Date().getMonth()-1 + '月', value: 4 }
+				arr[2] = { label: new Date().getMonth() + '月', value: 'lastMonth' }
+				arr[3] = { label: new Date().getMonth()-1 + '月', value: 'lastTwoMonth' }
 				return arr
 			},
 			titType(){  //  过滤条件 所有记录 title
-				const row = this.optionsType.find(item => item.value == this.queryParam.recordType)
+				const row = this.optionsType.find(item => item.value == this.queryParam.changeType)
 				return row ? row.label : this.optionsType[0].label
 			},
 			titScope(){  //  过滤条件 近3个月 title
-				const row = this.optionsScope.find(item => item.value == this.queryParam.recordScope)
+				const row = this.optionsScope.find(item => item.value == this.timeScope)
 				return row ? row.label : this.optionsScope[0].label
-			}
+			},
+			// 查询时间段
+			queryDate() {
+				var dt = new Date();
+				const threeTime = dt.setMonth( dt.getMonth()-2 )
+				const quickType = {
+				  threeMonth: [moment(getDate.getThreeMonthDays().starttime), moment(getDate.getThreeMonthDays().endtime)],
+				  lastMonth: [moment(getDate.getLastMonthDays().starttime), moment(getDate.getLastMonthDays().endtime)],
+				  thisMonth: [moment(getDate.getCurrMonthDays().starttime), moment(getDate.getCurrMonthDays().endtime)],
+				  lastTwoMonth: [moment(getDate.getLastTwoMonthDays().starttime), moment(getDate.getLastTwoMonthDays().endtime)],
+				}
+				let queryTime = {
+					beginDate: quickType[this.timeScope][0].format('YYYY-MM-DD'),
+					endDate: quickType[this.timeScope][1].format('YYYY-MM-DD')
+				}
+				return queryTime
+			},
+			
 		},
 		methods:{
 			// 搜索查询
-			searchHandle (pageNo) {
+			searchHandle () {
 				this.status = "loading"
-				pageNo ? this.pageNo = pageNo : null
-				// searchSuppliers({
-				// 	pageNo: this.pageNo,
-				// 	pageSize: this.pageSize,
-				// 	queryWord: this.queryValue
-				// }).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.total = res.data.count || 0
-				// 		this.listdata.length == 0 && this.queryValue != '' ? this.noDataText = '没有搜索到相关结果' : this.noDataText = '暂无数据'
-				// 	} else {
-				// 		this.noDataText = res.message
-				// 		this.listdata = []
-				// 		this.total = 0
-				// 	}
+				let params = Object.assign(this.queryParam,this.queryDate)
+				console.log(params,'pppppppp')
+				ldUsedQuery(params).then(res => {
+					console.log(res,'pppppppp')
+					if (res.status == 200) {
+						let list = res.data
+						// 查询3个月时 数据处理
+						if (this.timeScope == 'threeMonth') {
+							list.map(item=>{
+								let m = moment(item.month).month()+1
+								item.month = (m == moment().month()+1) ? '本月' : m+'月'
+							})
+						}
+						this.listdata = list
+					} else {
+						this.noDataText = res.message
+						this.listdata = []
+						this.total = 0
+					}
 					this.status = "loadmore"
-				// })
+				})
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
@@ -131,8 +140,13 @@
 </script>
 
 <style lang="less">
+	page{
+		height: 100%;
+		background-color: #fff;
+	}
 	.ldDetailed-container{
 		width: 100%;
+		height: 100%;
 		// 筛选菜单
 		.filter-dropdown{
 			background-color: #fff!important;