liujd il y a 6 ans
Parent
commit
372f6b5faf

+ 114 - 12
mobile-code/src/admin/assets/list.vue

@@ -1,26 +1,128 @@
 <template>
 <template>
-  <div class="app-content">
-      <div class="list-wrap">
-          <div class="list-img">
-              <app-img />
-          </div>
-          <div class="list-det">
-
-          </div>
-      </div>
-  </div>
+	<div class="app-content">
+		<div class="list-wrap">
+			<block v-if="!$util.isEmpty(list.data)">
+				<div class="list" v-for="(item, index) in list.data" :key="index">
+					<div class="list-img">
+						<app-img :src="item.img | default_img" />
+					</div>
+					<div class="list-det">
+						<div class="det-top">
+							<div>{{ item.event }}</div>
+							<div class="app-bold">-{{ item.amount }}</div>
+						</div>
+						<div>
+							<i class="iconfont" :class="[item.payWay == 0 ? 'iconweixinlaiyuan' : item.payWay == 1 ? 'iconzhifubao' : 'iconxiaochengxu']"></i>
+							<span>{{ item.userName }}</span>
+						</div>
+						<div>{{ item.addTime | formatTime('MM-DD hh:mm') }}</div>
+					</div>
+				</div>
+			</block>
+			<block v-else>
+				<app-wrapper-empty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+			</block>
+		</div>
+	</div>
 </template>
 </template>
 
 
 <script>
 <script>
 import AppImg from '@/components/app-img'
 import AppImg from '@/components/app-img'
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
+import { list } from '@/mixins'
+// api
+import { getListB } from '@/api/bill'
 export default {
 export default {
 	name: 'assets-list',
 	name: 'assets-list',
 	components: {
 	components: {
-		AppImg
+		AppImg,
+		AppWrapperEmpty
+	},
+	mixins: [list],
+	data() {
+		return {}
+	},
+	onPullDownRefresh() {
+		this.resetList()
+		this._list().then(res => {
+			uni.stopPullDownRefresh()
+		})
+	},
+	onReachBottom() {
+		if (this.list.data.length < this.list.total) {
+			this._list().then(res => {
+				uni.stopPullDownRefresh()
+			})
+		} else {
+			uni.stopPullDownRefresh()
+		}
+	},
+	onLoad: function() {
+		this.init()
+	},
+	methods: {
+		async init() {
+			this._list()
+		},
+		_list() {
+			return getListB({
+				io: 1,
+				page: this.list.page
+			}).then(res => {
+				this.completes(res)
+			})
+		}
 	}
 	}
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-
+	.list-wrap {
+		width: 100%;
+		background-color: #fff;
+		.list {
+			width: calc(100% - 60px);
+			margin: 0 30px;
+			padding: 20px 0;
+			border-bottom: 2px solid $borderColor;
+			@include disFlex(flex-start, flex-start);
+			&:first-child {
+				margin-top: 0;
+			}
+			.list-img {
+				width: 80px;
+				margin-right: 20px;
+				border-radius: 50%;
+				img {
+					border-radius: 50%;
+				}
+			}
+			.list-det {
+				width: calc(100% - 100px);
+				color: $fontColor3;
+				& > div {
+					margin-top: 16px;
+					&:first-child {
+						margin-top: 0;
+					}
+				}
+				.iconfont {
+					margin-right: 20px;
+				}
+				.iconweixinlaiyuan {
+					color: #35b801;
+				}
+				.iconzhifubao {
+					color: #00aaed;
+                }
+                .iconxiaochengxu {
+					color: #35b801;
+                }
+				.det-top {
+					color: #333;
+					@include disFlex(center, space-between);
+				}
+			}
+		}
+	}
 </style>
 </style>

+ 37 - 16
mobile-code/src/admin/goodsManage/img-store.vue

@@ -2,22 +2,22 @@
 	<div class="app-content" @click="dropdownShow = false">
 	<div class="app-content" @click="dropdownShow = false">
 		<!-- bar -->
 		<!-- bar -->
 		<div class="bar-wrap">
 		<div class="bar-wrap">
-			<dropdown-list :show="dropdownShow" :top="60" :width="400" :height="400">
+			<dropdown-list :show="dropdownShow" :top="80" :width="750" :height="400">
 				<template v-slot:selectionbox>
 				<template v-slot:selectionbox>
-					<div class="sel-open-btn" @click.stop="dropdownShow = true">
-						<span>全部</span>
+					<div class="sel-open-btn" @click.stop="dropdownShow = dropdownShow ? false : true">
+						<span>{{ categoryName }}</span>
 						<i class="iconfont iconsanjiao_xia"></i>
 						<i class="iconfont iconsanjiao_xia"></i>
 					</div>
 					</div>
 				</template>
 				</template>
 				<template v-slot:dropdownbox>
 				<template v-slot:dropdownbox>
 					<div class="sel-list-wrap">
 					<div class="sel-list-wrap">
 						<scroll-view scroll-y class="tui-dropdown-scroll">
 						<scroll-view scroll-y class="tui-dropdown-scroll">
-							<div class="sel-list" v-for="(item, index) in categoryData" :key="index">{{ item.categoryName }}</div>
+							<div class="sel-list" v-for="(item, index) in categoryData" :key="index" @click.stop="selCategory(item)">{{ item.categoryName }}</div>
 						</scroll-view>
 						</scroll-view>
 					</div>
 					</div>
 				</template>
 				</template>
 			</dropdown-list>
 			</dropdown-list>
-			<div>
+			<div class="share-wrap" @click.stop="$msg('开发中!')">
 				<i class="iconfont iconfenxiang1"></i>
 				<i class="iconfont iconfenxiang1"></i>
 				<span>分享</span>
 				<span>分享</span>
 			</div>
 			</div>
@@ -129,6 +129,8 @@ export default {
 		return {
 		return {
 			picAdd: picAdd,
 			picAdd: picAdd,
 			listHei: 76,
 			listHei: 76,
+			categoryName: '全部',
+			categoryId: -1,
 			// modal
 			// modal
 			imgList: [],
 			imgList: [],
 			form: {
 			form: {
@@ -198,9 +200,11 @@ export default {
 		// 获取高度
 		// 获取高度
 		getListHei(dom) {
 		getListHei(dom) {
 			let listDom = uni.createSelectorQuery().select(dom)
 			let listDom = uni.createSelectorQuery().select(dom)
-			listDom.boundingClientRect(data => {
-				this.listHei = data.height
-			}).exec()
+			listDom
+				.boundingClientRect(data => {
+					this.listHei = data.height
+				})
+				.exec()
 		},
 		},
 		async init() {
 		async init() {
 			getCategory()
 			getCategory()
@@ -208,13 +212,15 @@ export default {
 		},
 		},
 		_list() {
 		_list() {
 			return getListB({
 			return getListB({
-				categoryId: -1,
+				categoryId: this.categoryId,
 				page: this.list.page
 				page: this.list.page
 			}).then(res => {
 			}).then(res => {
 				this.completes(res)
 				this.completes(res)
-				setTimeout(() => {
-					this.getListHei('.list')
-				}, 1000)
+				if (!this.$util.isEmpty(list.data)) {
+					setTimeout(() => {
+						this.getListHei('.list')
+					}, 100)
+				}
 			})
 			})
 		},
 		},
 		saveFn() {
 		saveFn() {
@@ -229,6 +235,13 @@ export default {
 			})
 			})
 		},
 		},
 		// 操作
 		// 操作
+		selCategory(item) {
+			this.categoryName = item.categoryName
+			this.categoryId = item.id
+			this.dropdownShow = false
+			this.resetList()
+			this._list()
+		},
 		selCategoryFn(item) {
 		selCategoryFn(item) {
 			let index = this.form.categoryIdList.findIndex(e => e == item.id)
 			let index = this.form.categoryIdList.findIndex(e => e == item.id)
 			if (index == -1) {
 			if (index == -1) {
@@ -292,14 +305,14 @@ export default {
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 	.app-content {
 	.app-content {
-		min-height: calc(100vh - 200px);
-		padding-top: 100px;
+		min-height: calc(100vh - 100px);
+		// padding-top: 100px;
 		padding-bottom: 100px;
 		padding-bottom: 100px;
 	}
 	}
 	// bar
 	// bar
 	.bar-wrap {
 	.bar-wrap {
-		position: fixed;
-		top: 0;
+		// position: fixed;
+		// top: 0;
 		width: 100%;
 		width: 100%;
 		height: 80px;
 		height: 80px;
 		background-color: #fff;
 		background-color: #fff;
@@ -309,6 +322,10 @@ export default {
 		& > div {
 		& > div {
 			padding: 0 30px;
 			padding: 0 30px;
 		}
 		}
+		.share-wrap {
+			position: absolute;
+			right: 0;
+		}
 		.iconfont {
 		.iconfont {
 			color: $fontColor2;
 			color: $fontColor2;
 		}
 		}
@@ -322,6 +339,9 @@ export default {
 		}
 		}
 		// 下拉框
 		// 下拉框
 		.sel-open-btn {
 		.sel-open-btn {
+			width: 30%;
+			height: 80px;
+			line-height: 80px;
 			padding-left: 30px;
 			padding-left: 30px;
 		}
 		}
 		.sel-list-wrap {
 		.sel-list-wrap {
@@ -338,6 +358,7 @@ export default {
 	}
 	}
 	// list
 	// list
 	.list-wrap {
 	.list-wrap {
+		height: calc(100vh - 200px);
 		@include disFlex(flex-start, flex-start);
 		@include disFlex(flex-start, flex-start);
 		flex-wrap: wrap;
 		flex-wrap: wrap;
 		position: relative;
 		position: relative;

+ 4 - 10
mobile-code/src/admin/home/components/echart-circle.vue

@@ -49,17 +49,11 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		initChart() {
 		initChart() {
-			let data = {
-				date: ['6.15', '6.16', '6.17', '6.18', '6.19', '6.20', '6.21'],
-				// accessNum: [10, 332, 301, 50, 390, 80, 320],
-				guestNum: [10, 332, 301, 50, 390, 80, 320]
-			}
-
 			// this.chart = echarts.init(this.$el, 'macarons')
 			// this.chart = echarts.init(this.$el, 'macarons')
 			this.chart = echarts.init(this.$el)
 			this.chart = echarts.init(this.$el)
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
-			// this.setOptions(chartData)
-			this.setOptions(data)
+			this.setOptions(chartData)
+			// this.setOptions(data)
 		},
 		},
 		setOptions(chartData) {
 		setOptions(chartData) {
 			this.chart.setOption({
 			this.chart.setOption({
@@ -71,7 +65,7 @@ export default {
 					orient: 'vertical',
 					orient: 'vertical',
 					x: '40%',
 					x: '40%',
 					y: '24%',
 					y: '24%',
-					data: ['门店 50%  158', '微信朋友圈  33.33%  134', '美团 16.67%   24']
+					data: chartData.nameArr
 				},
 				},
 				series: [
 				series: [
 					{
 					{
@@ -79,7 +73,7 @@ export default {
 						type: 'pie',
 						type: 'pie',
 						radius: '80%',
 						radius: '80%',
 						center: ['20%', '50%'],
 						center: ['20%', '50%'],
-						data: [{ value: 335, name: '门店 50%  158' }, { value: 310, name: '微信朋友圈  33.33%  134' }, { value: 234, name: '美团 16.67%   24' }],
+						data: chartData.list,
 						labelLine: {
 						labelLine: {
 							normal: {
 							normal: {
 								show: false
 								show: false

+ 14 - 17
mobile-code/src/admin/home/components/echart-columnar.vue

@@ -20,7 +20,8 @@ export default {
 			default: '240px'
 			default: '240px'
 		},
 		},
 		chartData: {
 		chartData: {
-			type: Object
+			type: Object,
+			default: () => {}
 		}
 		}
 		// autoResize: {
 		// autoResize: {
 		//     type: Boolean,
 		//     type: Boolean,
@@ -50,24 +51,20 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		initChart() {
 		initChart() {
-			let data = {
-				date: ['6.15', '6.16', '6.17', '6.18', '6.19', '6.20', '6.21'],
-				// accessNum: [10, 332, 301, 50, 390, 80, 320],
-				guestNum: [10, 332, 301, 50, 390, 80, 320]
-			}
-
-			let yMax = 500
-			for (var i = 0; i < data.guestNum.length; i++) {
-				this.dataShadow.push(yMax)
-			}
-
 			// this.chart = echarts.init(this.$el, 'macarons')
 			// this.chart = echarts.init(this.$el, 'macarons')
 			this.chart = echarts.init(this.$el)
 			this.chart = echarts.init(this.$el)
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
-			// this.setOptions(chartData)
-			this.setOptions(data)
+
+			this.setOptions(chartData)
 		},
 		},
 		setOptions(chartData) {
 		setOptions(chartData) {
+			let dataShadow = []
+			// let yMax = chartData.total || 500
+			let yMax = Math.max.apply(null, chartData.numArr)
+			for (var i = 0; i < chartData.numArr.length; i++) {
+				dataShadow.push(yMax)
+			}
+
 			this.chart.setOption({
 			this.chart.setOption({
 				color: ['#3385FF'],
 				color: ['#3385FF'],
 				grid: {
 				grid: {
@@ -79,7 +76,7 @@ export default {
 				},
 				},
 				xAxis: {
 				xAxis: {
 					type: 'category',
 					type: 'category',
-					data: chartData.date,
+					data: chartData.nameArr,
 					axisTick: {
 					axisTick: {
 						show: false,
 						show: false,
 						alignWithLabel: true
 						alignWithLabel: true
@@ -115,12 +112,12 @@ export default {
 						},
 						},
 						barGap: '-100%',
 						barGap: '-100%',
 						barCategoryGap: '50%',
 						barCategoryGap: '50%',
-						data: this.dataShadow,
+						data: dataShadow,
 						animation: false
 						animation: false
 					},
 					},
 					{
 					{
 						type: 'bar',
 						type: 'bar',
-						data: chartData.guestNum
+						data: chartData.numArr
 					}
 					}
 				]
 				]
 			})
 			})

+ 29 - 18
mobile-code/src/admin/home/components/echart-trend.vue

@@ -21,6 +21,18 @@ export default {
 		},
 		},
 		chartData: {
 		chartData: {
 			type: Object
 			type: Object
+		},
+		color: {
+			type: String,
+			default: '#FC243A'
+		},
+		yName: {
+			type: String,
+			default: '金额(¥)'
+		},
+		serviceName: {
+			type: String,
+			default: '收入统计'
 		}
 		}
 		// autoResize: {
 		// autoResize: {
 		//     type: Boolean,
 		//     type: Boolean,
@@ -49,17 +61,10 @@ export default {
 	},
 	},
 	methods: {
 	methods: {
 		initChart() {
 		initChart() {
-			let data = {
-				date: ['6.15', '6.16', '6.17', '6.18', '6.19', '6.20', '6.21'],
-				// accessNum: [10, 332, 301, 50, 390, 80, 320],
-				guestNum: [10, 332, 301, 50, 390, 80, 320]
-			}
-
 			// this.chart = echarts.init(this.$el, 'macarons')
 			// this.chart = echarts.init(this.$el, 'macarons')
 			this.chart = echarts.init(this.$el)
 			this.chart = echarts.init(this.$el)
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
 			let chartData = JSON.parse(JSON.stringify(this.chartData))
-			// this.setOptions(chartData)
-			this.setOptions(data)
+			this.setOptions(chartData)
 		},
 		},
 		setOptions(chartData) {
 		setOptions(chartData) {
 			this.chart.setOption({
 			this.chart.setOption({
@@ -78,7 +83,7 @@ export default {
 				legend: {
 				legend: {
 					x: 'right',
 					x: 'right',
 					y: 'top',
 					y: 'top',
-					data: ['收入统计'],
+					data: [this.serviceName],
 					textStyle: {
 					textStyle: {
 						color: '#999'
 						color: '#999'
 					}
 					}
@@ -97,12 +102,12 @@ export default {
 						axisLabel: {
 						axisLabel: {
 							show: true,
 							show: true,
 							textStyle: {
 							textStyle: {
-								color: 'rgba(153,153,153,1)' // 这里用参数代替了
+								color: '#999' // 这里用参数代替了
 							}
 							}
 						},
 						},
 						axisLine: {
 						axisLine: {
 							lineStyle: {
 							lineStyle: {
-								color: '#999' // 这里用参数代替了
+								color: '#ddd' // 这里用参数代替了
 							}
 							}
 						},
 						},
 						axisTick: {
 						axisTick: {
@@ -110,14 +115,17 @@ export default {
 						},
 						},
 						// 网格线
 						// 网格线
 						splitLine: {
 						splitLine: {
-							show: true
+							show: true,
+							lineStyle: {
+								color: '#ddd' // 这里用参数代替了
+							}
 						},
 						},
-						data: chartData.date
+						data: chartData.nameArr
 					}
 					}
 				],
 				],
 				yAxis: [
 				yAxis: [
 					{
 					{
-						name: '金额(¥)',
+						name: this.yName,
 						type: 'value',
 						type: 'value',
 						axisLabel: {
 						axisLabel: {
 							show: true,
 							show: true,
@@ -134,21 +142,24 @@ export default {
 							show: false
 							show: false
 						},
 						},
 						splitLine: {
 						splitLine: {
-							show: true
+							show: true,
+							lineStyle: {
+								color: '#ddd' // 这里用参数代替了
+							}
 						}
 						}
 					}
 					}
 				],
 				],
 				series: [
 				series: [
 					// 收入统计
 					// 收入统计
 					{
 					{
-						name: '收入统计',
+						name: this.serviceName,
 						type: 'line',
 						type: 'line',
 						smooth: true,
 						smooth: true,
 						// stack: '总量',
 						// stack: '总量',
 						yAxisIndex: 0,
 						yAxisIndex: 0,
 						itemStyle: {
 						itemStyle: {
 							normal: {
 							normal: {
-								color: 'rgba(51, 133, 255, 1)' // 线颜色
+								color: this.color // 线颜色
 							}
 							}
 						},
 						},
 						lineStyle: {
 						lineStyle: {
@@ -158,7 +169,7 @@ export default {
 								shadowBlur: 4,
 								shadowBlur: 4,
 								shadowOffsetY: 4						}
 								shadowOffsetY: 4						}
 						},
 						},
-						data: chartData.guestNum
+						data: chartData.numArr
 					}
 					}
 				]
 				]
 			})
 			})

+ 3 - 5
mobile-code/src/admin/home/order.vue

@@ -28,7 +28,7 @@
 							<!-- 待配送 -->
 							<!-- 待配送 -->
 							<div v-if="item.status == 2" class="admin-button-com" @click="freeShippingFn(item)">免发货</div>
 							<div v-if="item.status == 2" class="admin-button-com" @click="freeShippingFn(item)">免发货</div>
 							<div v-if="item.status == 2" class="admin-button-com" @click="$util.pageTo({
 							<div v-if="item.status == 2" class="admin-button-com" @click="$util.pageTo({
-						url: 'admin/order/ship',
+						url: '/admin/order/ship',
 						query: {
 						query: {
 							id: item.id,
 							id: item.id,
 							pageStatus: 0
 							pageStatus: 0
@@ -157,7 +157,7 @@ export default {
 		// 查看配送
 		// 查看配送
 		seeSendFn(item) {
 		seeSendFn(item) {
 			this.$util.pageTo({
 			this.$util.pageTo({
-				url: 'admin/order/ship',
+				url: '/admin/order/ship',
 				query: {
 				query: {
 					id: item.id,
 					id: item.id,
 					pageStatus: 5
 					pageStatus: 5
@@ -166,9 +166,7 @@ export default {
 		},
 		},
 		// 关闭弹窗
 		// 关闭弹窗
 		modalCancel() {
 		modalCancel() {
-			this.form.price = ''
-			this.updatePriceModal = false
-			this.freeShippingModal = false
+			this.freeShipModal = false
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 1
mobile-code/src/admin/order/components/sel-order.vue

@@ -15,7 +15,7 @@
 						<div class="axis-det">
 						<div class="axis-det">
 							<button class="admin-button-com big blue" @click="hasSendOrderFn">有配送单</button>
 							<button class="admin-button-com big blue" @click="hasSendOrderFn">有配送单</button>
 							<button class="admin-button-com big blue" @click="$util.pageTo({
 							<button class="admin-button-com big blue" @click="$util.pageTo({
-						url: '/admin/order/ship',
+						url: '/admin/order/fill-form',
 						query: {
 						query: {
 							id: orderData.id
 							id: orderData.id
 						}
 						}

+ 4 - 3
mobile-code/src/admin/order/detail.vue

@@ -137,7 +137,7 @@
 					<block v-else>
 					<block v-else>
 						<button class="admin-button-com middle" @click="freeShippingFn">免发货</button>
 						<button class="admin-button-com middle" @click="freeShippingFn">免发货</button>
 						<button class="admin-button-com middle" @click="$util.pageTo({
 						<button class="admin-button-com middle" @click="$util.pageTo({
-						url: 'admin/order/ship',
+						url: '/admin/order/ship',
 						query: {
 						query: {
 							id: data.id,
 							id: data.id,
 							pageStatus: 0
 							pageStatus: 0
@@ -226,7 +226,7 @@ export default {
 		// 查看配送
 		// 查看配送
 		seeSendFn() {
 		seeSendFn() {
 			this.$util.pageTo({
 			this.$util.pageTo({
-				url: 'admin/order/ship',
+				url: '/admin/order/ship',
 				query: {
 				query: {
 					id: this.data.id,
 					id: this.data.id,
 					pageStatus: 5
 					pageStatus: 5
@@ -254,8 +254,9 @@ export default {
 		// 关闭弹窗
 		// 关闭弹窗
 		modalCancel() {
 		modalCancel() {
 			this.form.price = ''
 			this.form.price = ''
-			this.updatePriceModal = false
+			this.freeShipModal = false
 			this.freeShippingModal = false
 			this.freeShippingModal = false
+			this.freeShipModal = false
 		}
 		}
 	}
 	}
 }
 }

+ 174 - 15
mobile-code/src/admin/statistics/index.vue

@@ -1,21 +1,49 @@
 <template>
 <template>
-	<div class="app-content">
+	<div class="app-content" @click="dropdownShow = false">
 		<!-- sel -wrap -->
 		<!-- sel -wrap -->
-		<div class="sel-wrap"></div>
+		<div class="sel-wrap">
+			<dropdown-list :show="dropdownShow" :top="80" :width="750" :height="400">
+				<template v-slot:selectionbox>
+					<div class="sel-open-btn" @click.stop="dropdownShow = dropdownShow ? false : true">
+						<span>{{ typeName }}</span>
+						<i class="iconfont iconsanjiao_xia"></i>
+					</div>
+				</template>
+				<template v-slot:dropdownbox>
+					<div class="sel-list-wrap">
+						<scroll-view scroll-y class="tui-dropdown-scroll">
+							<div class="sel-list" v-for="(item, index) in typeData" :key="index" @click.stop="selCategory(item)">{{ item.name }}</div>
+						</scroll-view>
+					</div>
+				</template>
+			</dropdown-list>
+		</div>
 		<!-- 收入统计 -->
 		<!-- 收入统计 -->
 		<div class="module-com">
 		<div class="module-com">
 			<div class="module-tit"></div>
 			<div class="module-tit"></div>
 			<div class="module-det">
 			<div class="module-det">
-				<echart-trend ref="echartTrend" :chartData="echartTrend"></echart-trend>
+				<echart-trend ref="echartIncome" :chartData="incomeStat" color="#FC243A" yName="金额(¥)" serviceName="收入统计"></echart-trend>
 			</div>
 			</div>
 		</div>
 		</div>
 		<!-- 访问统计 -->
 		<!-- 访问统计 -->
+		<div class="module-com">
+			<div class="module-tit"></div>
+			<div class="module-det">
+				<echart-trend ref="echartVisit" :chartData="visitStat" color="#3385FF" yName="数量(人)" serviceName="访问统计"></echart-trend>
+			</div>
+		</div>
 		<!-- 客户数统计 -->
 		<!-- 客户数统计 -->
+		<div class="module-com">
+			<div class="module-tit"></div>
+			<div class="module-det">
+				<echart-trend ref="echartUser" :chartData="userStat" color="#28C57D" yName="数量(人)" serviceName="客户数统计"></echart-trend>
+			</div>
+		</div>
 		<!-- 收入来源统计 -->
 		<!-- 收入来源统计 -->
 		<div class="module-com">
 		<div class="module-com">
 			<div class="module-tit">收入来源统计</div>
 			<div class="module-tit">收入来源统计</div>
 			<div class="module-det">
 			<div class="module-det">
-				<echart-circle ref="echartCircle" :chartData="echartTrend"></echart-circle>
+				<echart-circle ref="echartCircle" :chartData="incomeSourceStat"></echart-circle>
 			</div>
 			</div>
 		</div>
 		</div>
 		<!-- 分类统计 -->
 		<!-- 分类统计 -->
@@ -23,13 +51,13 @@
 			<div class="module-tit">分类统计</div>
 			<div class="module-tit">分类统计</div>
 			<div class="module-det">
 			<div class="module-det">
 				<div class="category-list-wrap">
 				<div class="category-list-wrap">
-					<div class="category-list" v-for="(item, index) in 6" :key="index">
-						<div class="list-tit">1花束</div>
+					<div class="category-list" v-for="(item, index) in categoryStat.list" :key="index">
+						<div class="list-tit">{{ `${index + 1} ${item.name}` }}</div>
 						<div class="list-det">
 						<div class="list-det">
 							<div class="progress-wrap">
 							<div class="progress-wrap">
-								<div class="progress" :style="{ width: (index + 1) * 10 + '%' }"></div>
+								<div class="progress" :style="{ width: item.percentage + '%' }"></div>
 							</div>
 							</div>
-							<div class="progress-num">7000</div>
+							<div class="progress-num">{{ item.num }}</div>
 						</div>
 						</div>
 					</div>
 					</div>
 				</div>
 				</div>
@@ -37,9 +65,9 @@
 		</div>
 		</div>
 		<!-- 用途统计 -->
 		<!-- 用途统计 -->
 		<div class="module-com">
 		<div class="module-com">
-			<div class="module-tit">分类统计</div>
+			<div class="module-tit">用途统计</div>
 			<div class="module-det">
 			<div class="module-det">
-				<echart-columnar ref="echartColumnar" :chartData="echartTrend"></echart-columnar>
+				<echart-columnar ref="echartColumnar" :chartData="useStat"></echart-columnar>
 			</div>
 			</div>
 		</div>
 		</div>
 	</div>
 	</div>
@@ -49,35 +77,166 @@
 import EchartTrend from '@/admin/home/components/echart-trend'
 import EchartTrend from '@/admin/home/components/echart-trend'
 import EchartCircle from '@/admin/home/components/echart-circle'
 import EchartCircle from '@/admin/home/components/echart-circle'
 import EchartColumnar from '@/admin/home/components/echart-columnar'
 import EchartColumnar from '@/admin/home/components/echart-columnar'
+import DropdownList from '@/components/plugin/dropdown-list'
+// api
+import { getStatList } from '@/api/statistics'
 export default {
 export default {
 	name: 'statistics',
 	name: 'statistics',
 	components: {
 	components: {
 		EchartTrend,
 		EchartTrend,
 		EchartCircle,
 		EchartCircle,
-		EchartColumnar
+		EchartColumnar,
+		DropdownList
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
-			echartTrend: {}
+			dropdownShow: false,
+			typeData: [
+				{
+					name: '最近7天',
+					value: 1
+				},
+				{
+					name: '最近30天',
+					value: 2
+				},
+				{
+					name: '本月',
+					value: 3
+				},
+				{
+					name: '上月',
+					value: 4
+				},
+				{
+					name: '最近3月',
+					value: 30
+				},
+				{
+					name: '最近半年',
+					value: 31
+				},
+				{
+					name: '最近一年',
+					value: 32
+				},
+				{
+					name: '今年',
+					value: 33
+				}
+			],
+			typeName: '最近7天',
+			type: 1,
+			// 收入统计
+			incomeStat: {},
+			// 访问量统计
+			visitStat: {},
+			// 客户数统计
+			userStat: {},
+			// 粉丝数统计
+			fansStat: {},
+			// 收入来源统计
+			incomeSourceStat: {},
+			// 分类统计
+			categoryStat: {},
+			// 用途统计
+			useStat: {}
 		}
 		}
 	},
 	},
 	onLoad() {},
 	onLoad() {},
 	mounted() {
 	mounted() {
-		// setTimeout(() => {
 		this.init()
 		this.init()
-		// }, 1000)
 	},
 	},
 	methods: {
 	methods: {
 		init() {
 		init() {
-			this.$refs.echartTrend.initChart()
+			this._getData()
+		},
+		_getData() {
+			getStatList({ type: this.type }).then(res => {
+				if (!this.$util.isEmpty(res.data)) {
+					let data = res.data
+					data.categoryStat.list = data.categoryStat.list.map(e => {
+						e.percentage = ((e.num / data.categoryStat.total) * 100).toFixed(2)
+						return e
+					})
+
+					data.incomeSourceStat.list = data.incomeSourceStat.list.map(e => {
+						e.name = `${e.name} ${((e.num / data.incomeSourceStat.total) * 100).toFixed(2)}% ${e.num}`
+						e.value = e.num
+						return e
+					})
+
+					Object.keys(data).forEach((i, index) => {
+						if (i != 'categoryStat') {
+							data[i].nameArr = data[i].list.map(e => e.name)
+							data[i].numArr = data[i].list.map(e => e.num)
+						}
+					})
+
+					this.incomeStat = data.incomeStat
+					this.visitStat = data.visitStat
+					this.userStat = data.userStat
+					this.fansStat = data.fansStat
+					this.incomeSourceStat = data.incomeSourceStat
+					this.categoryStat = data.categoryStat
+					this.useStat = data.useStat
+
+					console.log(data)
+
+					setTimeout(() => {
+						this.initChart()
+					}, 100)
+				}
+			})
+		},
+		initChart() {
+			this.$refs.echartIncome.initChart()
+			this.$refs.echartVisit.initChart()
+			this.$refs.echartUser.initChart()
 			this.$refs.echartCircle.initChart()
 			this.$refs.echartCircle.initChart()
 			this.$refs.echartColumnar.initChart()
 			this.$refs.echartColumnar.initChart()
+		},
+		selCategory(item) {
+			this.typeName = item.name
+			this.type = item.value
+			this.dropdownShow = false
+			this._getData()
 		}
 		}
 	}
 	}
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+	.sel-wrap {
+		width: 100%;
+		height: 80px;
+		// background-color: ;
+		// 下拉框
+		.sel-open-btn {
+			width: 30%;
+			height: 80px;
+			line-height: 80px;
+			padding-left: 30px;
+		}
+		.iconfont {
+			color: $fontColor2;
+		}
+		.iconsanjiao_xia {
+			font-size: 24px;
+			margin-left: 10px;
+		}
+		.sel-list-wrap {
+			background-color: #fff;
+			box-shadow: 6px 6px 10px #cccccc;
+			.sel-list {
+				padding: 20px 30px;
+				// border-top: 1px solid $borderColor;
+			}
+		}
+		.tui-dropdown-scroll {
+			height: 400px;
+		}
+	}
 	.module-com {
 	.module-com {
 		background-color: #fff;
 		background-color: #fff;
 		padding: 20px 16px 20px 14px;
 		padding: 20px 16px 20px 14px;

+ 8 - 0
mobile-code/src/api/bill/index.js

@@ -0,0 +1,8 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+/** *
+ * 商家流水(收支明细) b
+ */
+export const getListB = data => {
+	return https.get('/merchant-capital/list', data)
+}

+ 8 - 0
mobile-code/src/api/statistics/index.js

@@ -0,0 +1,8 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+/** *
+ * 数据统计 b
+ */
+export const getStatList = data => {
+	return https.get('/stat/list', data)
+}

+ 1 - 0
mobile-code/src/components/plugin/dropdown-list.vue

@@ -61,6 +61,7 @@ export default {
 		/* opacity: 0; */
 		/* opacity: 0; */
 		visibility: hidden;
 		visibility: hidden;
 		transition: all 0.2s ease-in-out;
 		transition: all 0.2s ease-in-out;
+		box-shadow: 0 6px 10px #cccccc
 
 
 	}
 	}
 
 

+ 1 - 1
mobile-code/src/official/index.vue

@@ -31,7 +31,7 @@
 			</div>
 			</div>
 			<div class="official-wrap">
 			<div class="official-wrap">
 				<div class="off-title">花卉宝,花店经营的标配工具</div>
 				<div class="off-title">花卉宝,花店经营的标配工具</div>
-				<div class="off-sub-tit">
+				<div class="off-sub-tit" @click="contactFn">
 					<app-img :src="`${constant.imgUrl}/retail/official/phone-small.png`" alt="" />
 					<app-img :src="`${constant.imgUrl}/retail/official/phone-small.png`" alt="" />
 					<span>咨询热线:0592 - 3272000</span>
 					<span>咨询热线:0592 - 3272000</span>
 				</div>
 				</div>