Parcourir la source

新增积分获取支出详情

zhaojiaqi il y a 4 semaines
Parent
commit
469f1944ba
4 fichiers modifiés avec 238 ajouts et 26 suppressions
  1. 0 2
      common/admin.js
  2. 6 0
      pages.json
  3. 205 0
      pagesPointsBase/Points/Detail.vue
  4. 27 24
      pagesPointsBase/Points/Index.vue

+ 0 - 2
common/admin.js

@@ -3,14 +3,12 @@ const utils = require('../common/util.js');
 
 //服务接口访问配置
 var config = {
-	// sysweburl: "https://www.zgsafesp.cn",
 	sysweburl: "http://110.188.24.28:50200", // 测试
 	// sysweburl: "http://110.188.24.28:50300", // 开发
 	upfileurl: "http://110.188.24.28:50120/file/upload", // 测试
 	// upfileurl: "http://171.94.154.2:50105/hlfs/file/upload", // 正式
 	getfileurl: "http://110.188.24.28:50120", // 测试
 	// getfileurl: "http://171.94.154.2:50105/hlfs", // 正式
-	// upuserimgurl: "/zg12345/SSP.asmx/UserImg"
 }
 
 // 服务器返回字段

+ 6 - 0
pages.json

@@ -246,6 +246,12 @@
 					"style": {
 						"navigationStyle": "custom"
 					}
+				},
+				{
+					"path": "Points/Detail",
+					"style": {
+						"navigationBarTitleText": "积分详情"
+					}
 				}
 			]
 		}

+ 205 - 0
pagesPointsBase/Points/Detail.vue

@@ -0,0 +1,205 @@
+<template>
+	<view class="container" v-if="isShow">
+		<view class="headerBox">
+			<view class="tabBox">
+				<view class="tabItem" :class="tabIndex == 0 ? 'active' : ''" @tap="onChangeState(0)">积分收入</view>
+				<view class="tabItem" :class="tabIndex == 1 ? 'active' : ''" @tap="onChangeState(1)">积分支出</view>
+			</view>
+		</view>
+		<view class="totalPointBox">
+			<text>总计:</text>
+			<text class="totalPoint">{{totalPoint}}</text>
+		</view>
+		<view class="listHeader">
+			<text class="listHeader_time">时间</text>
+			<text class="listHeader_type">形式</text>
+			<text class="listHeader_point">积分</text>
+		</view>
+		<view class="contentBox">
+			<z-paging ref="paging" v-model="listData" @query="onGetList" refresher-update-time-key="list">
+				<view class="listInfoBox">
+					<view class="listInfo" v-for="(item, index) in listData" :key="index">
+						<text class="listInfo_time">{{item.creationTime}}</text>
+						<text class="listInfo_type">{{item.sourceTxt}}</text>
+						<text class="listInfo_point">{{item.points}}</text>
+					</view>
+				</view>
+			</z-paging>
+		</view>
+	</view>
+</template>
+
+<script>
+	var that;
+	export default {
+		data() {
+			return {
+				isShow: false,
+				tabIndex: 0,
+				Direction: '',
+				listData: [],
+				isReLoad: false,
+				totalPoint: 0
+			}
+		},
+		onLoad(options) {
+			that = this;
+			that.onGetTotalPoint();
+			that.isShow = true;
+		},
+		methods: {
+			onGetTotalPoint(){
+				that.$admin.req({
+					method: 'GET',
+					url: '/api/v1/Snapshot/points/total?Direction=' + that.tabIndex,
+				}).then(res => {
+					that.totalPoint = res;
+				}, err => {
+					that.$util.msg(err);
+				})
+			},
+			onGetList(pageNo, pageSize) {
+				that.$admin.req({
+					method: 'GET',
+					url: '/api/v1/Snapshot/points?Direction=' + that.tabIndex + '&QueryIndex=' + (pageNo - 1) + '&QueryCount=' + pageSize,
+				}).then(res => {
+					if (res && res.length > 0) {
+						res.forEach((item, index) => {
+							item.creationTime = item.creationTime ? that.$util.formatTime(new Date(item.creationTime)).split(' ')[0] : '';
+						})
+						that.$refs.paging.complete(res);
+					} else if (res && res.length == 0) {
+						that.$refs.paging.complete([]);
+					} else {
+						that.$util.msg('网络出错!');
+						that.$refs.paging.complete(false);
+					}
+					typeof fun === 'function' && fun();
+				}, err => {
+					if (!that.isReLoad) {
+						that.isReLoad = true;
+						that.onGetOrderList(pageNo, pageSize);
+					} else {
+						that.$util.msg(err);
+						that.$refs.paging.complete(false);
+					}
+				})
+			},
+			// 切换工单状态
+			onChangeState(tabIndex) {
+				if (that.tabIndex != tabIndex){
+					that.tabIndex = tabIndex;
+					that.$refs.paging.reload();
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+	.container {
+		background-color: #F6F7F8;
+	}
+
+	.headerBox {
+		line-height: 0;
+		background-color: #fff;
+	}
+
+	.tabBox {
+		padding: 0;
+		line-height: 48rpx;
+	}
+
+	.tabItem {
+		padding: 20rpx 0 30rpx;
+		display: inline-block;
+		width: calc(50%);
+		text-align: center;
+		color: #333333;
+		font-size: 28rpx;
+		position: relative;
+	}
+
+	.active {
+		color: #3e6ffd;
+	}
+
+	.active::after {
+		content: " ";
+		width: 52rpx;
+		height: 6rpx;
+		background-color: #3e6ffd;
+		position: absolute;
+		bottom: 0;
+		left: calc(50% - 26rpx);
+	}
+	
+	.totalPointBox{
+		padding: 30rpx 40rpx;
+		text-align: right;
+		font-size: 32rpx;
+		font-weight: bold;
+	}
+	
+	.totalPoint {
+		color: #3e6ffd;
+		font-size: 36rpx;
+	}
+	
+	.listHeader {
+		display: flex;
+		justify-content: space-between;
+		font-size: 32rpx;
+		color: #333;
+		padding: 30rpx 20rpx 20rpx;
+		text-align: center;
+		color: #3e6ffd;
+		background-color: #fff;
+	}
+	
+	.listHeader_time{
+		width: 160rpx;
+		text-align: center;
+	}
+	
+	.listHeader_type{
+		width: calc(100% - 320rpx);
+		text-align: center;
+	}
+	
+	.listHeader_point{
+		width: 160rpx;
+		text-align: center;
+	}
+
+	.contentBox {
+		position: relative;
+		height: calc(100% - 250rpx);
+		background-color: #fff;
+	}
+
+	.listInfo {
+		display: flex;
+		justify-content: space-between;
+		color: #333;
+		text-align: center;
+		padding: 30rpx 20rpx 20rpx;
+	}
+	
+	.listInfo_time{
+		width: 160rpx;
+		text-align: center;
+	}
+	
+	.listInfo_type{
+		width: calc(100% - 320rpx);
+		text-align: center;
+	}
+	
+	.listInfo_point{
+		width: 160rpx;
+		text-align: center;
+		color: #fe0000;
+	}
+</style>

+ 27 - 24
pagesPointsBase/Points/Index.vue

@@ -70,7 +70,7 @@
 						<text class="rankList_point">累计积分</text>
 					</view>
 					<view class="rankList">
-						<view class="rankListItem" v-for="(item, index) in listData" :class="index == 0 ? 'rankListItem_mine' : ''" >
+						<view class="rankListItem" v-if="listData.length > 0" v-for="(item, index) in listData" :class="index == 0 ? 'rankListItem_mine' : ''" >
 							<image class="rankListItem_rankImg" :src="'../static/img/pointsIndex/rank' + item.rank + '.png'" v-if="[1,2,3].includes(item.rank)"></image>
 							<text class="rankListItem_rank" v-else>{{item.rank}}</text>
 							<view class="rankListItem_telBox">
@@ -79,13 +79,14 @@
 							</view>
 							<text class="rankListItem_point">{{item.points}}</text>
 						</view>
+						<view class="noneBox" v-else>
+							<image class="noneImg" src="../../static/img/home/noneImg.png"></image>
+							<view class="noneTips">暂无数据</view>
+						</view>
 					</view>
 				</view>
 			</view>
-			<!-- <view class="noneBox" v-else>
-				<image class="noneImg" src="../../static/img/home/noneImg.png"></image>
-				<view class="noneTips">暂无数据</view>
-			</view> -->
+			
 		</view>
 	</view>
 </template>
@@ -171,7 +172,9 @@
 				})
 			},
 			onDetailTo() {
-				that.$util.msg("功能即将上线,敬请期待!");
+				uni.navigateTo({
+					url: '/pagesPointsBase/Points/Detail'
+				})
 			},
 			onDescribeTo() {
 				that.$util.msg("功能即将上线,敬请期待!");
@@ -544,22 +547,22 @@
 		color: #fe0000;
 	}
 
-	// .noneBox {
-	// 	background-color: #fff;
-	// 	border-radius: 50rpx 50rpx 0 0;
-	// 	padding: 50rpx 20rpx;
-	// 	text-align: center;
-	// }
-	
-	// .noneImg {
-	// 	width: 200rpx;
-	// 	height: 200rpx;
-	// }
-	
-	// .noneTips {
-	// 	font-size: 26rpx;
-	// 	color: #aaaaaa;
-	// 	text-align: center;
-	// 	margin-top: 10rpx;
-	// }
+	.noneBox {
+		background-color: #fff;
+		border-radius: 50rpx 50rpx 0 0;
+		padding: 50rpx 20rpx;
+		text-align: center;
+	}
+	
+	.noneImg {
+		width: 200rpx;
+		height: 200rpx;
+	}
+	
+	.noneTips {
+		font-size: 26rpx;
+		color: #aaaaaa;
+		text-align: center;
+		margin-top: 10rpx;
+	}
 </style>