Преглед изворни кода

Merge branch 'master' of http://git.ringzle.com:3000/htcwl/hotelHomestayWx

2912631854@qq.com пре 1 година
родитељ
комит
c6f0f0dd37

+ 31 - 0
pages.json

@@ -145,6 +145,37 @@
 						"enablePullDownRefresh": true
 					}
 				},
+				{
+					"path": "home/moneyBill",
+					"style": {
+						"navigationBarTitleText": "资金账单",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "home/moneyBillDetail",
+					"style": {
+						"navigationBarTitleText": "账单详情",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": true
+					}
+				},
+				{
+					"path": "home/orderBillDetail",
+					"style": {
+						"navigationBarTitleText": "账单详情",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": true
+					}
+				},{
+					"path": "home/tj",
+					"style": {
+						"navigationBarTitleText": "数据统计",
+						"navigationStyle": "custom",
+						"enablePullDownRefresh": true
+					}
+				},
 				{
 					"path": "Verification/index",
 					"style": {

+ 46 - 32
pages/login/select.vue

@@ -15,60 +15,70 @@
 	export default {
 		data() {
 			return {
-				userInfo:null,
-				merchantId:'',
-				types:[],
-				list:[]
+				userInfo: null,
+				merchantId: '',
+				types: [],
+				list: []
 			}
 		},
 		created() {
 			this.getType();
 		},
 		onLoad(option) {
-			if(option.userInfo) this.userInfo = JSON.parse(decodeURIComponent(option.userInfo));
+			if (option.userInfo) this.userInfo = JSON.parse(decodeURIComponent(option.userInfo));
 			this.getList();
 		},
 		methods: {
-			goBack(e){
+			goBack(e) {
 				uni.clearStorageSync();
 			},
-			getType(){
-				this.$api.post('/api/dict/getListByTypes',['BusinessType']).then(res=>{
-					if(res.data.code===0){
+			getType() {
+				this.$api.post('/api/dict/getListByTypes', ['BusinessType']).then(res => {
+					if (res.data.code === 0) {
 						this.types = res.data.data
-					}else this.$showToast(res.data.msg);
+					} else this.$showToast(res.data.msg);
 				})
 			},
-			getList(){
-				this.$api.post('/merchant/register/getMerchantStoreList').then(res=>{
-					if(res.data.code===0){
+			getList() {
+				this.$api.post('/merchant/register/getMerchantStoreList').then(res => {
+					if (res.data.code === 0) {
 						this.list = res.data.data;
-						this.list.forEach(l=>{
-							let t = this.types.find(t=>t.dictValue==l.merchantType);
-							l.typeName = t?t.dictLabel:''
+						this.list.forEach(l => {
+							let t = this.types.find(t => t.dictValue == l.merchantType);
+							l.typeName = t ? t.dictLabel : ''
 						})
-					}else this.$showToast(res.data.msg);
+					} else this.$showToast(res.data.msg);
 				})
 			},
-			toHome(item){//1711268640588517378   1721450548101648385
-				if(item.merchantType==2) uni.setStorageSync('homestayId',item.merchantId);
-				else uni.setStorageSync('merchantId',item.merchantId);
-				uni.setStorageSync('userInfo',JSON.stringify(this.userInfo));
-				uni.reLaunch({
-					url:'/pages/home/index'
-				})
+			toHome(item) { //1711268640588517378   1721450548101648385
+				uni.setStorageSync('userInfo', JSON.stringify(this.userInfo));
+				if (item.merchantType == 2) {
+					uni.setStorageSync('homestayId', item.merchantId);
+					uni.setStorageSync('merchantId','');
+					uni.reLaunch({
+						url: '/pages/home/index'
+					})
+				} else {
+					uni.setStorageSync('homestayId', '');
+					uni.setStorageSync('merchantId', item.merchantId);
+					uni.reLaunch({
+						url: '/pagesHouse/home/index?merchantName='+item.merchantName 
+					})
+				}
+				
 			}
-		}			
+		}
 	}
 </script>
 
 <style scoped lang="less">
-	.page{
+	.page {
 		background: #F3F4F4;
 		padding-bottom: 20rpx;
 		box-sizing: border-box;
 		overflow-y: auto;
-		.card{
+
+		.card {
 			width: calc(100% - 60rpx);
 			height: 180rpx;
 			background: #FFFFFF;
@@ -81,16 +91,19 @@
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
-			&>view{
-				&:first-child{
+
+			&>view {
+				&:first-child {
 					display: flex;
 					flex-direction: column;
-					text{
+
+					text {
 						font-size: 32rpx;
 						font-family: PingFang SC, PingFang SC;
 						font-weight: 800;
 						color: #1E3A62;
-						&:last-child{
+
+						&:last-child {
 							font-size: 24rpx;
 							font-family: PingFang SC, PingFang SC;
 							font-weight: 400;
@@ -99,7 +112,8 @@
 						}
 					}
 				}
-				&:last-child{
+
+				&:last-child {
 					width: 140rpx;
 					height: 56rpx;
 					border-radius: 36rpx 36rpx 36rpx 36rpx;

+ 0 - 7
pages/statistics/index.vue

@@ -155,7 +155,6 @@
 					},
 				},
 				PieChartsList: {},
-
 				// 交易趋势
 				revenueChartDataOne: {},
 				revenueOptsone: {
@@ -194,8 +193,6 @@
 					},
 				},
 				dataListOne: [],
-
-
 				// 入住率
 				revenueChartDataTwo: {},
 				revenueOptstwo: {
@@ -256,11 +253,8 @@
 
 			getDays(day) {
 				var today = new Date();
-
 				var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
-
 				today.setTime(targetday_milliseconds); //注意,这行是关键代码
-
 				var tYear = today.getFullYear();
 				var tMonth = today.getMonth();
 				var tDate = today.getDate();
@@ -272,7 +266,6 @@
 				this.fromData.dateDay = tYear + '-' + tMonth
 				return tYear + '-' + tMonth
 			},
-
 			doHandleMonth(month) {
 				var m = month;
 				if (month.toString().length == 1) {

+ 74 - 23
pagesHouse/home/bill.vue

@@ -2,35 +2,38 @@
 	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
 		<c-nav-bar title="交易账单"></c-nav-bar>
 		<view class="query">
-			<u-icon @click="" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"
-				space="10px"></u-icon>
+			<u-icon @click="show=true" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"
+				size="25px"></u-icon>
+
 		</view>
-		<view class="list" v-for="(item2,index2) in data" :key="index2" >
+		<view class="list">
 			<view class="time">
-				<text>今日</text>
-				<text>{{new Date().Format('yyyy-MM-dd')}}</text>
+				<text v-if="date==cdate">今日</text>
+				<text>{{date}}</text>
 			</view>
 			<view class="money">
 				<view>
 					<text>收入金额</text>
-					<text class="in">+879.00</text>
-					<text>2笔</text>
+					<text class="in">+{{info.orderAmount||0}}</text>
+					<text>{{info.orders||0}}笔</text>
 				</view>
 				<view>
 					<text>退款金额</text>
-					<text>879.00</text>
-					<text>2笔</text>
+					<text>{{info.refundOrderAmount||0}}</text>
+					<text>{{info.refundOrders||0}}笔</text>
 				</view>
 			</view>
-			<view class="li" v-for="(item,index) in data" :key="index">
+			<view class="li" v-for="(item,index) in info.fishermanOrderDTOS" :key="index" @click="detail(item)">
 				<view class="left">
-					<text>黄沙村渔家乐12客位</text>
-					<text>2024-02-23 09:12:34</text>
+					<text>{{item.thingName}}</text>
+					<text>{{item.orderTime}}</text>
 				</view>
-				<view class="right">+12</text>
+				<view class="right">+{{item.price}}</text>
 				</view>
 			</view>
 		</view>
+		<u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
+			mode="date"></u-datetime-picker>
 	</view>
 </template>
 
@@ -38,17 +41,66 @@
 	export default {
 		data() {
 			return {
-				h: uni.getSystemInfoSync().windowHeight - 87,
+				cdate: new Date().Format('yyyy-MM-dd'),
+				date: new Date().Format('yyyy-MM-dd'),
+				show: false,
+				value1: Number(new Date()),
 				mt: uni.getSystemInfoSync().statusBarHeight + 44,
-				data: [4, 5],
-				name: '黄沙村渔家乐',
-				emg: 'https://i.ringzle.com/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
-				icons: ['https://i.ringzle.com/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
-					'https://i.ringzle.com/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
-					'https://i.ringzle.com/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
-				]
+				info: {
+					orderAmount: 0,
+					orders: 0,
+					refundOrderAmount: 0,
+					fishermanOrderDTOS: [],
+					refundOrders: 0,
+
+				},
 			}
-		}
+		},
+		onLoad() {
+			this.getList()
+		},
+		methods: {
+			confirmDate(e) {
+				// 创建一个Date对象并传入时间戳
+				const date = new Date(e.value);
+				// 使用Date对象的方法获取年、月、日、小时、分钟和秒
+				const year = date.getFullYear();
+				const month = ('0' + (date.getMonth() + 1)).slice(-2);
+				const day = ('0' + date.getDate()).slice(-2);
+				// 格式化时间
+				const formattedTime = `${year}-${month}-${day}`;
+
+				this.date = formattedTime;
+				this.getList();
+				this.show = false;
+			},
+			getList() {
+				this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanDeal', {
+					dateTime: this.date,
+					dateType: '1',
+					fishermanId: uni.getStorageSync('merchantId')
+				}).then(res => {
+					console.log(res.data)
+					if (res.data.code === 0) {
+						this.info = res.data.data;
+					} else {
+						this.info = {
+							orderAmount: 0,
+							orders: 0,
+							refundOrderAmount: 0,
+							fishermanOrderDTOS: [],
+							refundOrders: 0,
+						}
+					}
+				})
+			},
+			detail(item) {
+				let info=encodeURIComponent(JSON.stringify(item));
+				uni.navigateTo({
+					url: "/pagesHouse/home/orderBillDetail?info="+info
+				})
+			}
+		},
 	}
 </script>
 
@@ -105,7 +157,6 @@
 						&:nth-child(2) {
 							font-size: 40rpx;
 							margin: 14rpx 0 16rpx;
-							color: ;
 						}
 
 						&:last-child {

+ 54 - 26
pagesHouse/home/index.vue

@@ -2,56 +2,56 @@
 	<view class="page" :style="{'min-height':(h-th)+'px'}">
 		<u-navbar bgColor="transparent">
 			<view class="u-nav-slot" slot="left">
-				<text>{{name}}</text>
+				<text>{{merchantName}}</text>
 			</view>
 		</u-navbar>
 		<view class="bg" :style="{'padding-top':(mt+10)+'px'}">
 			<view class="dataBox">
 				<view class="item">
 					<view>成交金额</view>
-					<view>¥<text>238</text></view>
-					<view>昨日¥900.78</view>
+					<view>¥<text>{{info.todayOrderAmount||0}}</text></view>
+					<view>昨日¥{{info.yesterdayOrderAmount||0}}</view>
 				</view>
 				<view class="item">
 					<view>成交订单数</view>
-					<view>¥<text>238</text></view>
-					<view>昨日8</view>
+					<view>¥<text>{{info.todayOrders||0}}</text></view>
+					<view>昨日{{info.yesterdayOrders||0}}</view>
 				</view>
 				<view class="item">
 					<view>退款金额</view>
-					<view>¥<text>238</text></view>
-					<view>昨日¥900.78</view>
+					<view>¥<text>{{info.todayRefundAmount||0}}</text></view>
+					<view>昨日¥{{info.yesterdayRefundAmount||0}}</view>
 				</view>
 				<view class="item">
 					<view>退款订单数</view>
-					<view>¥<text>238</text></view>
-					<view>昨日8</view>
+					<view>¥<text>{{info.todayRefundOrders||0}}</text></view>
+					<view>昨日{{info.yesterdayRefundOrders||0}}</view>
 				</view>
 				<view class="item">
 					<view>已购商品数量</view>
-					<view>¥<text>238</text></view>
-					<view>昨日78</view>
+					<view>¥<text>{{info.todayPurchasedNums||0}}</text></view>
+					<view>昨日{{info.yesterdayPurchasedNums||0}}</view>
 				</view>
 			</view>
 			<view class="numberData">
 				<view>
-					<text>0</text>
+					<text>{{info.todayObligationOrders||0}}</text>
 					<text>待付款</text>
 				</view>
 				<view>
-					<text>0</text>
+					<text>{{info.todayPendingOrders||0}}</text>
 					<text>待使用</text>
 				</view>
 				<view>
-					<text>0</text>
+					<text>{{info.todayOrders||0}}</text>
 					<text>已完成</text>
 				</view>
 				<view>
-					<text>0</text>
+					<text>{{info.todayCancelledOrders||0}}</text>
 					<text>已取消</text>
 				</view>
 				<view>
-					<text>0</text>
+					<text>{{info.todayRefundOrders||0}}</text>
 					<text>退款售后</text>
 				</view>
 			</view>
@@ -60,11 +60,11 @@
 					<image :src="icons[0]"></image>
 					<text>交易账单</text>
 				</view>
-				<view>
+				<view @click="toHref('/pagesHouse/home/moneyBill')">
 					<image :src="icons[1]"></image>
 					<text>资金账单</text>
 				</view>
-				<view>
+				<view @click="toHref('/pagesHouse/home/tj')">
 					<image :src="icons[2]"></image>
 					<text>数据统计</text>
 				</view>
@@ -82,13 +82,13 @@
 				<text>销量</text>
 				<text>成交金额</text>
 			</view>
-			<view class="li" v-for="(item,index) in data" :key="index">
+			<view class="li" v-for="(item,index) in list" :key="index">
 				<view class="avatar">
-					<image :src="emg"></image>
-					<text>黄山村渔家乐12客位体验渔民出海</text>
+					<image :src="item.pic"></image>
+					<text>{{item.thingName}}</text>
 				</view>
-				<text>897</text>
-				<text>¥765</text>
+				<text>{{item.num}}</text>
+				<text>¥{{item.price}}</text>
 			</view>
 		</view>
 		<Tabbares :tabbarid="0"></Tabbares>
@@ -99,16 +99,43 @@
 	export default {
 		data() {
 			return {
-				data: [1, 2, 3, 4, 5],
-				name: '黄沙村渔家乐',
+				merchantName: '黄沙村渔家乐',
 				emg: 'https://i.ringzle.com/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
 				icons: ['https://i.ringzle.com/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
 					'https://i.ringzle.com/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
 					'https://i.ringzle.com/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
-				]
+				],
+				info:{},
+				list:[],
 			}
 		},
+		onLoad(opt){
+			if(opt.merchantName ){
+				this.merchantName =opt.merchantName ;
+			}
+			this.getData();
+			this.getList();
+		},
 		methods: {
+			getData() {
+				this.$api.get('/merchant/merchantFisherman/home/getMerchantFishermanAppHome/'+ uni.getStorageSync('merchantId')).then(res => {
+					if (res.data.code === 0) {
+						this.info = res.data.data;
+					} 
+				})
+			},
+			getList(){
+				this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanOrderList',{
+					dateTime:new Date().Format('yyyy-MM-dd'),
+					dateType:'1',
+					fishermanId:uni.getStorageSync('merchantId')
+					
+				}).then(res => {
+					if (res.data.code === 0) {
+						this.list = res.data.data;
+					} 
+				})
+			},
 			toHref(url) {
 				uni.redirectTo({
 					url: url
@@ -135,6 +162,7 @@
 			padding: 0 20rpx 6rpx;
 			background-color: #fff;
 			border-radius: 24rpx;
+			box-sizing: border-box;
 
 			.tit {
 				padding: 40rpx 0;

+ 92 - 0
pagesHouse/home/moneyBill.vue

@@ -0,0 +1,92 @@
+<template>
+	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="资金账单"></c-nav-bar>
+		<view class="time">
+			<view>
+				<text>2024-02月</text>
+				<u-icon name="arrow-down" color="#999" size="25px"></u-icon>
+			</view>
+			<text>提现¥1000.00</text>
+		</view>
+		<view class="list">
+			<view class="li" v-for="(item,index) in data" :key="index" @click="detail()">
+				<view class="left">
+					<text>黄沙村渔家乐12客位</text>
+					<text>2024-02-23 09:12:34</text>
+				</view>
+				<view class="right">+12</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				h: uni.getSystemInfoSync().windowHeight - 87,
+				mt: uni.getSystemInfoSync().statusBarHeight + 44,
+				data: [4, 5],
+			}
+		},
+		methods:{
+			detail(){
+				uni.navigateTo({
+					url:"/pagesHouse/home/moneyBillDetail"
+				})
+			}
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.time {
+		display: flex;
+		justify-content: space-between;
+		padding: 24rpx;
+		background-color: #F5F8FA;
+		&>view {
+			display: flex;
+			align-items: center;
+			text {
+				font-size: 30rpx;
+				color: #111;
+				margin-right: 10rpx;
+			}
+		}
+
+		&>text {
+			font-size: 26rpx;
+			color: #999;
+		}
+	}
+	.list{
+		padding: 0 24rpx;
+		.li {
+			display: flex;
+			justify-content: space-between;
+			padding: 30rpx 0;
+			border-bottom: 1rpx solid #EFEFEF;
+		
+			.left {
+				text {
+					&:first-child {
+						font-size: 28rpx;
+						color: #111;
+						margin-bottom: 15rpx;
+					}
+		
+					display: block;
+					color: #999;
+					font-size: 26rpx;
+				}
+			}
+		
+			.right {
+				color: #111111;
+				font-size: 36rpx;
+				font-weight: bold;
+			}
+		}
+	}
+</style>

+ 84 - 0
pagesHouse/home/moneyBillDetail.vue

@@ -0,0 +1,84 @@
+<template>
+	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="账单详情"></c-nav-bar>
+		<view class="box">
+			<image src="https://i.ringzle.com/file/20240224/d2b9acd9522747ac89239dcde0894c93.png"></image>
+			<text class="tit">黄沙村渔家乐12客位</text>
+			<text class="money">+<text>200.00</text></text>
+		</view>
+		<view class="info">
+			<view class="li">
+				<text>当前状态</text>
+				<text>交易成功</text>
+			</view>
+			<view class="li">
+				<text>创建时间</text>
+				<text>2024-02-16 11:39:24</text>
+			</view>
+			<view class="li">
+				<text>订单号</text>
+				<text>20987877676667888w</text>
+			</view>
+			<view class="li">
+				<text>交易类型</text>
+				<text>结算提现</text>
+			</view>
+		</view>
+	</view>
+
+</template>
+
+<script>
+
+</script>
+
+<style scoped lang="scss">
+	.box {
+		width: calc(100% - 80rpx);
+		padding: 30rpx 0 60rpx;
+		color: #333;
+		border-bottom: 1rpx solid #EFEFEF;
+		text-align: center;
+
+		image {
+			width: 80rpx;
+			height: 80rpx;
+		}
+
+		text {
+			display: block;
+
+		}
+
+		.tit {
+			margin: 26rpx 0 14rpx;
+			font-size: 26rpx;
+		}
+
+		.money {
+			font-size: 28rpx;
+			text {
+				display: inline-block;
+				font-weight: bold;
+				font-size: 32rpx;
+			}
+		}
+	}
+
+	.info {
+		padding: 60rpx 40rpx 0;
+
+		.li {
+			margin-bottom: 32rpx;
+			text{
+				&:first-child{
+					display: inline-block;
+					width: 104rpx;
+					color: #999;
+				}
+				margin-right: 40rpx;
+				color: #111;
+			}
+		}
+	}
+</style>

+ 122 - 0
pagesHouse/home/orderBillDetail.vue

@@ -0,0 +1,122 @@
+<template>
+	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="账单详情"></c-nav-bar>
+		<view class="box">
+			<image src="https://i.ringzle.com/file/20240224/d2b9acd9522747ac89239dcde0894c93.png"></image>
+			<text class="tit">{{infoMation.thingName}}</text>
+			<text class="money">+<text>{{infoMation.price}}</text></text>
+		</view>
+		<view class="info">
+			<view class="li">
+				<text >当前状态</text>
+				<text>{{infoMation.state==''?'':status[infoMation.state]}}</text>
+			</view>
+			<view class="li">
+				<text>创建时间</text>
+				<text>{{infoMation.orderTime}}</text>
+			</view>
+			<view class="li">
+				<text>订单号</text>
+				<text>{{infoMation.orderCode}}</text>
+			</view>
+			<!-- <view class="li">
+				<text>交易类型</text>
+				<text>结算提现</text>
+			</view> -->
+			<view class="li">
+				<text>商品名称</text>
+				<text>{{infoMation.thingName}}</text>
+			</view>
+		</view>
+	</view>
+
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				infoMation: {
+					thingName: '',
+					price:0,
+					orderCode:'',
+					orderTime:'',
+					state:''
+				},
+				status: {
+					'0': '待支付',
+					'1': '已支付',
+					'-1': '已取消',
+					'-2': '退款中',
+					'-3': '已退款',
+					'3': '已完成',
+					'4': '待使用',
+					'5': '已预约'
+				}
+			}
+		},
+		onLoad(option) {
+			console.log(option)
+			const info = JSON.parse(decodeURIComponent(option.info ? option
+				.info : infoMation));
+			this.infoMation = info;
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.box {
+		width: calc(100% - 80rpx);
+		padding: 30rpx 0 60rpx;
+		color: #333;
+		border-bottom: 1rpx solid #EFEFEF;
+		text-align: center;
+
+		image {
+			width: 80rpx;
+			height: 80rpx;
+		}
+
+		text {
+			display: block;
+
+		}
+
+		.tit {
+			margin: 26rpx 0 14rpx;
+			font-size: 26rpx;
+		}
+
+		.money {
+			font-size: 28rpx;
+
+			text {
+				display: inline-block;
+				font-weight: bold;
+				font-size: 32rpx;
+			}
+		}
+	}
+
+	.info {
+		padding: 60rpx 40rpx 0;
+
+		.li {
+			margin-bottom: 32rpx;
+
+			text {
+				&:first-child {
+					display: inline-block;
+					width: 104rpx;
+					color: #999;
+				}
+
+				margin-right: 40rpx;
+				color: #111;
+			}
+		}
+	}
+</style>

+ 55 - 15
pagesHouse/home/orderList.vue

@@ -2,11 +2,12 @@
 	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
 		<c-nav-bar title="订单列表"></c-nav-bar>
 		<view class="query">
-			<u-icon @click="" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666" space="10px"></u-icon>
+			<u-icon @click="show=true" name="calendar" label="自定义查询" labelPos="right" labelColor="#666" color="#666"
+				space="10px" size="25px"></u-icon>
 		</view>
 		<view class="list">
 			<view class="time">
-				<text>{{new Date().Format('yyyy-MM-dd')}}</text>
+				<text>{{date}}</text>
 			</view>
 			<view class="content">
 				<view class="li first">
@@ -14,16 +15,18 @@
 					<text>销量</text>
 					<text>成交金额</text>
 				</view>
-				<view class="li" v-for="(item,index) in data" :key="index">
+				<view class="li" v-for="(item,index) in list" :key="index" @click="detail(item)">
 					<view class="avatar">
-						<image :src="emg"></image>
-						<text>黄山村渔家乐12客位体验渔民出海</text>
+						<image :src="item.pic"></image>
+						<text>{{item.thingName}}</text>
 					</view>
-					<text>897</text>
-					<text>¥765</text>
+					<text>{{item.num}}</text>
+					<text>¥{{item.price}}</text>
 				</view>
 			</view>
 		</view>
+		<u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
+			mode="date"></u-datetime-picker>
 	</view>
 </template>
 
@@ -31,15 +34,48 @@
 	export default {
 		data() {
 			return {
+				date: new Date().Format('yyyy-MM-dd'),
+				show: false,
+				value1: Number(new Date()),
 				h: uni.getSystemInfoSync().windowHeight - 87,
 				mt: uni.getSystemInfoSync().statusBarHeight + 44,
-				data: [1, 2, 3, 4, 5],
-				name: '黄沙村渔家乐',
-				emg: 'https://i.ringzle.com/file/20240224/91173dde1cb44b139129e12ad4971f1d.png',
-				icons: ['https://i.ringzle.com/file/20240224/70ab9f9d1a144c95927dedc6e84bcce7.png',
-					'https://i.ringzle.com/file/20240224/3f990c250f444ac9a5d9f334f322c98e.png',
-					'https://i.ringzle.com/file/20240224/7ca1bfa6e348438e83edc5af0589f847.png'
-				]
+				list: [],
+			}
+		},
+		onLoad(){
+			this.getList();
+		},
+		methods: {
+			confirmDate(e){
+					// 创建一个Date对象并传入时间戳
+					const date = new Date(e.value);
+					// 使用Date对象的方法获取年、月、日、小时、分钟和秒
+					const year = date.getFullYear();
+					const month = ('0' + (date.getMonth() + 1)).slice(-2);
+					const day = ('0' + date.getDate()).slice(-2);
+					// 格式化时间
+					const formattedTime = `${year}-${month}-${day}`;
+				
+					this.date = formattedTime;
+					this.getList();
+					this.show = false;
+			},
+			getList(){
+				this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanOrderList',{
+					dateTime:this.date,
+					dateType:'1',
+					fishermanId:uni.getStorageSync('merchantId')
+				}).then(res => {
+					if (res.data.code === 0) {
+						this.list = res.data.data;
+					} 
+				})
+			},
+			detail(item) {
+				let info=encodeURIComponent(JSON.stringify(item));
+				uni.navigateTo({
+					url: "/pagesHouse/home/orderBillDetail?info="+info
+				})
 			}
 		}
 	}
@@ -50,17 +86,20 @@
 		background: #F3F4F4;
 		padding-bottom: 40rpx;
 		box-sizing: border-box;
-		.query{
+
+		.query {
 			height: 100rpx;
 			display: flex;
 			align-items: center;
 			padding-left: 30rpx;
 			background-color: #fff;
 		}
+
 		.list {
 			width: calc(100% - 36rpx);
 			margin: 20rpx auto;
 			padding: 0 0 6rpx;
+
 			.time {
 				margin: 24rpx 0;
 				color: #111;
@@ -70,6 +109,7 @@
 				background-color: #fff;
 				padding: 22rpx 20rpx 4rpx;
 				border-radius: 24rpx;
+
 				.li {
 					display: grid;
 					grid-template-columns: 60% 20% 20%;

+ 373 - 0
pagesHouse/home/tj.vue

@@ -0,0 +1,373 @@
+<template>
+	<view class="page" :style="{'min-height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="数据统计"></c-nav-bar>
+		<view class="tabs">
+			<text :class="type==1?'on':''" @click="type=1">月账单</text>
+			<text :class="type==2?'on':''" @click="type=2">年账单</text>
+		</view>
+		<view class="content">
+			<view class="time" @click="show=true">
+				<u-icon name="calendar" :label="dateStr" labelPos="right" labelColor="#666" color="#666" space="7px"
+					size="25px"></u-icon>
+				<u-icon name="arrow-down" color="#999" size="20px" style="margin-left: 20rpx;"></u-icon>
+			</view>
+
+			<view class="money">
+				<view>
+					<text>收入金额</text>
+					<text class="in">+{{info.allOrderAmount||0}}</text>
+					<text>{{info.allOrders||0}}笔</text>
+				</view>
+				<view>
+					<text>退款金额</text>
+					<text>{{info.allRefundOrderAmount||0}}</text>
+					<text>{{info.allRefundOrders||0}}笔</text>
+				</view>
+			</view>
+		</view>
+		<view class="chart">
+			<view class="tit">累计曲线图</view>
+			<view class="total">
+				<view class="t1">总收入<text>{{total}}</text></view>
+				<view class="t2">总退款<text>{{total2}}</text></view>
+			</view>
+			<view class="line_charts_two">
+				<qiun-data-charts type="line" :opts="gameOpts" :chartData="gameChartData" />
+			</view>
+		</view>
+		<u-datetime-picker @confirm="confirmDate" @cancel="show=false" :show="show" v-model="value1"
+			mode="year-month"></u-datetime-picker>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				total: '',
+				total2: '',
+				info: {
+					allOrderAmount: 0,
+					allOrders: 0,
+					allRefundOrderAmount: 0,
+					allRefundOrders: 0
+				},
+				show: false,
+				value1: Number(new Date()),
+				dateStr: new Date().Format('yyyy年-MM月'),
+				date: new Date().Format('yyyy-MM'),
+				dataList: [],
+				type: 1,
+				gameChartData: {},
+				gameOpts: {
+					color: ["#4B98FE", "#00D05E"],
+					padding: [15, 15, 0, 15],
+					dataLabel: false,
+					dataPointShapeType: 'hollow',
+					dataZoom: [{
+							type: 'slider',
+							start: 0,
+							end: 50,
+						},
+						{
+							type: 'inside',
+							orient: 'vertical',
+						},
+					],
+					grid: {
+						left: '3%',
+						right: '4%',
+						bottom: '10%',
+						height: '80%',
+						containLabel: true,
+					},
+
+					xAxis: {
+						disableGrid: true,
+					},
+					yAxis: {
+						gridColor: "rgba(230,230,230,0.6)",
+						disabled: false,
+						disableGrid: false,
+						gridType: 'dash',
+						dashLength: '4',
+						data: [{
+							axisLineColor: "#FFFFFF",
+						}, ],
+					},
+					// legend: {
+					// 	show: true,
+					// 	position: "top",
+					// 	float: "left",
+					// },
+					extra: {
+						line: {
+							type: "curve",
+							width: 2,
+							activeType: "hollow"
+						},
+					},
+				},
+			}
+		},
+		watch: {
+			type(newval, oldval) {
+				if (newval == 1) {
+					this.date = new Date().Format('yyyy-MM');
+					this.dateStr = this.date.split('-')[0] + '年' + '-' + this.date.split('-')[1] + '月';
+				} else {
+					this.date = new Date().Format('yyyy');
+					this.dateStr = this.date + '年';
+				}
+			},
+			date(newval, oldval) {
+				if (newval != oldval) {
+					this.getBottomData();
+					this.gettopData()
+				}
+			}
+		},
+		onLoad() {
+			this.gettopData();
+			this.getBottomData();
+		},
+		methods: {
+			confirmDate(e) {
+				// 创建一个Date对象并传入时间戳
+				const date = new Date(e.value);
+				// 使用Date对象的方法获取年、月、日、小时、分钟和秒
+				const year = date.getFullYear();
+				const month = ('0' + (date.getMonth() + 1)).slice(-2);
+				const day = ('0' + date.getDate()).slice(-2);
+				// 格式化时间
+				let formattedTime = "";
+				if (this.type == 1) {
+					formattedTime = `${year}-${month}`;
+					this.dateStr = `${year}年-${month}月`
+				} else {
+					formattedTime = `${year}`;
+					this.dateStr = `${year}年`
+				}
+				this.date = formattedTime;
+				this.show = false;
+			},
+			gettopData() {
+				this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanBill', {
+					dateTime: this.date,
+					dateType: this.type + '',
+					fishermanId: uni.getStorageSync('merchantId')
+				}).then(res => {
+					if (res.data.code === 0) {
+						this.info = res.data.data;
+					} else {
+						this.info = {
+							allOrderAmount: 0,
+							allOrders: 0,
+							allRefundOrderAmount: 0,
+							allRefundOrders: 0
+						}
+					}
+
+				})
+			},
+			getBottomData() {
+				this.$api.post('/merchant/merchantFisherman/home/getMerchantFishermanCurveAnalyse', {
+					dateTime: this.date,
+					dateType: this.type + '',
+					fishermanId: uni.getStorageSync('merchantId')
+				}).then(res => {
+					let x = [],
+						y = [],
+						z = [];
+					this.total = 0;
+					this.total2 = 0;
+					if (res.data.code === 0) {
+						this.dataList = res.data.data;
+						for (let i = 0; i < res.data.data.length; i++) {
+							x.push(this.type == 1 ? res.data.data[i].dateKey : (res.data.data[i].dateKey + '月'));
+							y.push(res.data.data[i].orderNums);
+							z.push(res.data.data[i].refundOrderNums);
+							this.total += res.data.data[i].orderNums;
+							this.total2 += res.data.data[i].refundOrderNums
+						}
+					} else {
+						this.dataList = []
+					}
+					setTimeout(() => {
+						this.drawGameCharts(x, y, z);
+					}, 500)
+				})
+			},
+			drawGameCharts(x, y, z) {
+				let res = {
+					categories: x,
+					series: [{
+							name: "总收入",
+							data: y,
+							legendShape: "circle",
+							color: "#367BFF",
+						},
+						{
+							name: "总退款",
+							data: z,
+							legendShape: "circle",
+							color: "#77DFDD",
+						},
+					],
+				};
+				this.gameChartData = JSON.parse(JSON.stringify(res));
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.line_charts_two {
+		width: 630rpx;
+		height: 500rpx;
+		// background-color: aqua;
+	}
+
+	.page {
+		background: #F5F8FA;
+		box-sizing: border-box;
+
+		.total {
+			margin: 36rpx;
+			display: flex;
+			align-items: center;
+
+			&>view {
+				position: relative;
+				color: #777;
+				margin-right: 80rpx;
+				font-size: 26rpx;
+				padding-left: 30rpx;
+
+				&.t1 {
+					&::after {
+						position: absolute;
+						left: 0;
+						top: 43%;
+						z-index: 1;
+						display: inline-block;
+						content: "";
+						width: 20rpx;
+						height: 10rpx;
+						border-radius: 10rpx;
+						background-color: #367BFF;
+					}
+				}
+
+				&.t2 {
+					&::after {
+						position: absolute;
+						left: 0;
+						top: 43%;
+						z-index: 1;
+						display: inline-block;
+						content: "";
+						width: 20rpx;
+						height: 10rpx;
+						border-radius: 10rpx;
+						background-color: #77DFDD;
+					}
+				}
+
+				text {
+					color: #111;
+					font-size: 28rpx;
+				}
+			}
+		}
+	}
+
+	.chart {
+		width: calc(100% - 40rpx);
+		border-radius: 16rpx;
+		padding: 36rpx 22rpx;
+		background-color: #fff;
+		margin: 20rpx auto 0;
+
+		.tit {
+			font-size: 28rpx;
+			font-weight: bold;
+		}
+	}
+
+	.tabs {
+		text-align: center;
+		border-bottom: 1rpx solid #EFEFEF;
+		background-color: #fff;
+		display: flex;
+
+		text {
+			display: inline-block;
+			padding: 28rpx;
+			width: 50%;
+			position: relative;
+
+			&.on::after {
+				display: block;
+				content: '';
+				position: absolute;
+				width: 64rpx;
+				height: 6rpx;
+				background-color: #007A69;
+				bottom: 8rpx;
+				z-index: 1;
+				left: 50%;
+				border-radius: 4rpx;
+				transform: translate(-50%, 0);
+			}
+		}
+	}
+
+	.content {
+		padding: 48rpx 30rpx 56rpx;
+		background-color: #fff;
+
+		.time {
+			display: flex;
+			align-items: center;
+			margin-bottom: 42rpx;
+		}
+
+		.money {
+			display: flex;
+			align-items: center;
+			padding: 0 10rpx;
+
+			&>view {
+				width: 50%;
+
+				text {
+					display: block;
+					font-weight: bold;
+
+					&:first-child {
+						color: #111;
+						font-size: 28rpx;
+						font-weight: inherit;
+					}
+
+					&:nth-child(2) {
+						font-size: 40rpx;
+						margin: 14rpx 0 16rpx;
+						color: #111;
+					}
+
+					&:last-child {
+						color: #999;
+						font-size: 26rpx;
+						font-weight: inherit;
+					}
+				}
+
+				.in {
+					color: #FEA400;
+				}
+			}
+		}
+	}
+</style>