Bladeren bron

no message

WIN-2CJ8FMUT9OF\Administrator 11 maanden geleden
bovenliggende
commit
4f37397d43

+ 3 - 0
api/chart.js

@@ -11,4 +11,7 @@ export const chartConsume = (data) => request(url + 'consume', 'post', data)
 export const chartTotal = (data) => request(url + 'total', 'post', data)
 //获取消费明细
 export const chartList = (data) => request(url + 'list', 'post', data)
+//获取最新的一条消费记录
+export const chartNewList = (data) => request(url + 'new_list', 'post', data)
+
 export const chartSummary = (data) => request(url + 'summary', 'post', data)

+ 97 - 23
pages/index/index.vue

@@ -33,7 +33,7 @@
 						<view class="z-3">
 							<view class="fc-00D5FF fw-b fs-48">
 								¥{{setTotalMoney(totalData.total_money)}}万
-								
+
 							</view>
 							<view class="fc-f fs-14">
 								收款总金额
@@ -79,7 +79,7 @@
 					</view>
 					<!-- 滚动列表 -->
 					<swiper class="scroll-view-css z-3" circular :indicator-dots="false" :autoplay="true"
-						:interval="3000" :duration="800" :vertical="true" :circular='true' :display-multiple-items="8"
+						:interval="400" :duration="800" :vertical="true" :circular='true' :display-multiple-items="8"
 						@change="listChang">
 						<swiper-item v-for="(item,i) in listData" :key="i">
 							<view class="item-box">
@@ -142,9 +142,9 @@
 				</view>
 				<view class="flex-1 chart-box mbt-12">
 					<image class="chart-bg" src="/static/k2.png" mode=""></image>
-					<!-- <view class="title-box">
-						<image class="title-img" src="/static/zjtj.png" mode=""></image>
-						<view class="bfje-num">
+					<view class="title-box mb-15">
+						<image class="title-img" src="/static/zxxfmx.png" mode=""></image>
+						<!-- 						<view class="bfje-num">
 							<view class="bfje-title">
 								<image class="bf-img" src="/static/bfje.png" mode=""></image>
 								<view class="fc-B2D6FF fs-28">
@@ -154,19 +154,53 @@
 							<view class="fc-f fs-40">
 								{{Number(summaryDaya.total_money).toFixed(2)}}
 							</view>
-						</view>
-					</view> -->
-					<view class="flex-1 tj-box">
+						</view> -->
+					</view>
+					<swiper class="scroll-view-css z-3" circular :indicator-dots="false" :autoplay="true"
+						:interval="450" :duration="800" :vertical="true" :circular='true' :display-multiple-items="2">
+						<swiper-item v-for="(item,i) in newListData" :key="i">
+							<view class="item-box-two">
+								<view class="user-box w-30">
+									<image class="user-img" :src="item.head_img" mode=""></image>
+									<view class="">
+										<view class="fs-32 fc-f w-90 text-overflow-ellipsis-one">
+											{{item.nickname}}
+										</view>
+										<view class="fs-28 fc-B2D6FF">
+											消费者
+										</view>
+									</view>
+								</view>
+								<view class="w-30">
+									<view class="fs-32 fc-f w-90 text-overflow-ellipsis-one">
+										{{item.shop_name}}
+									</view>
+									<view class="fs-28 fc-B2D6FF">
+										消费门店
+									</view>
+								</view>
+								<view class="w-20">
+									<view class="fs-32 fc-f">
+										¥{{item.pay_money}}
+									</view>
+									<view class="fs-28 fc-B2D6FF">
+										消费金额
+									</view>
+								</view>
+							</view>
+							<view class="hr"></view>
+						</swiper-item>
+					</swiper>
+					<!-- 					<view class="flex-1 tj-box">
 						<view class="hx-box z-3">
-							<!-- 环形图 -->
 							<ringVue ref="ringRef"></ringVue>
 						</view>
 						<view class="bf-box mr-86 ml-28">
 							<view class="bf-num">
 								<image class="yhbf-img" src="/static/yhbf.png" mode=""></image>
-								<!-- <view class="fc-f fs-40 z-3 text-align-center">
+								<view class="fc-f fs-40 z-3 text-align-center">
 									¥{{Number(summaryDaya.total_member).toFixed(2)}}
-								</view> -->
+								</view>
 							</view>
 							<view class="bf-title">
 								<image class="yh-bg" src="/static/yh-bg.png" mode=""></image>
@@ -179,9 +213,9 @@
 						<view class="bf-box">
 							<view class="bf-num">
 								<image class="yhbf-img" src="/static/dpbf.png" mode=""></image>
-								<!-- <view class="fc-f fs-40 z-3 text-align-center">
+								<view class="fc-f fs-40 z-3 text-align-center">
 									¥{{Number(summaryDaya.total_shop).toFixed(2)}}
-								</view> -->
+								</view>
 							</view>
 							<view class="bf-title">
 								<image class="yh-bg" src="/static/dp-bg.png" mode=""></image>
@@ -191,7 +225,7 @@
 								</view>
 							</view>
 						</view>
-					</view>
+					</view> -->
 				</view>
 				<view class="flex-1 chart-box">
 					<image class="chart-bg" src="/static/k2.png" mode=""></image>
@@ -217,7 +251,8 @@
 		chartConsume,
 		chartTotal,
 		chartList,
-		chartSummary
+		chartSummary,
+		chartNewList
 	} from '@/api/chart.js';
 	export default {
 		components: {
@@ -237,7 +272,9 @@
 				shopGdp: '',
 				userGdp: '',
 				page: 1,
-				total: 0
+				total: 0,
+				newListData: [],
+				orderId: ''
 			}
 		},
 		onReady() {
@@ -249,8 +286,6 @@
 			}
 		},
 		mounted() {
-			
-			
 			// document.addEventListener('keydown', (event) => {
 			// 	event.preventDefault();
 			// 	event.stopPropagation();
@@ -265,14 +300,13 @@
 			this.chartConsume()
 			this.chartTotal()
 			this.chartList()
-			this.chartSummary()
+			// this.chartSummary()
 		},
 		methods: {
-			setTotalMoney(money){
-				let m = ((money*1 + 500000)/10000).toFixed(2);
+			setTotalMoney(money) {
+				let m = ((money * 1 + 100000) / 10000).toFixed(2);
 				return m
 			},
-			
 			chartSummary() {
 				chartSummary().then((res) => {
 					if (res.code === 1) {
@@ -292,11 +326,34 @@
 					if (res.code === 1) {
 						this.total = res.data.total
 						this.listData = [...this.listData, ...res.data.items]
+						this.orderId = this.listData[0].id
+						res.data.items.forEach((j, k) => {
+							if (k <= 9 && this.page === 1) {
+								this.newListData.push(j)
+							}
+						});
+						setInterval(() => {
+							this.chartNewList()
+						}, 5000)
+					}
+				})
+			},
+			chartNewList() {
+				chartNewList({
+					order_id: this.orderId
+				}).then((res) => {
+					if (res.code === 1) {
+						if (res.data.id) {
+							this.orderId = res.data.id
+							this.newListData.splice(0, 1)
+							this.newListData.push(res.data)
+							console.log(this.newListData, '1111111');
+						}
 					}
 				})
 			},
 			listChang(e) {
-				if(e.detail.current === 42) {
+				if (e.detail.current === 90) {
 					this.page++
 					this.chartList()
 				}
@@ -474,6 +531,10 @@
 		margin-bottom: 10rpx;
 	}
 
+	.mb-15 {
+		margin-bottom: 15rpx;
+	}
+
 	.mb-5 {
 		margin-bottom: 5rpx;
 	}
@@ -722,6 +783,19 @@
 		justify-content: space-between;
 	}
 
+	.item-box-two {
+		width: 100%;
+		height: 27rpx;
+		background: rgba(0, 161, 255, 0.05);
+		border-radius: 9rpx;
+		margin-bottom: 6rpx;
+		padding: 5rpx 9rpx;
+		box-sizing: border-box;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
+
 	.hr {
 		width: 375rpx;
 		height: 6rpx;

BIN
static/zxxfmx.png


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__90A3ED1/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__90A3ED1/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


Some files were not shown because too many files changed in this diff