lhl 4 yıl önce
ebeveyn
işleme
dc20123842
1 değiştirilmiş dosya ile 31 ekleme ve 11 silme
  1. 31 11
      pages/user/integral.vue

+ 31 - 11
pages/user/integral.vue

@@ -3,25 +3,25 @@
 		<!-- 头部 -->
 		<view class="header">
 			<image src="../../static/img/img38.png" mode="scaleToFill"></image>
-			<view class="money">3852</view>
+			<view class="money">{{+integralAll || 0}}</view>
 		</view>
 		<!-- 收入和支出 -->
 		<view class="navbar">
 			<view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
 		</view>
-		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab">
+		<swiper class="swiper-box" :current="tabCurrentIndex" duration="300" @change="changeTab" :style="{'height':height}">
 			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
 				<!-- 空白页 -->
 				<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
 				<!-- 推广奖励 -->
-				<scroll-view class="scorll" scroll-y="true">
+				<scroll-view class="scorll" scroll-y="true" :style="{'height':height}">
 					<view class="cost">
 						<view class="award" v-for="item in tabItem.orderList">
 							<view class="award-left">
 								<view class="text clamp">{{ item.mark }}</view>
 								<view class="time">{{ item.add_time }}</view>
 							</view>
-							<view class="award-right">{{ pm == 1 ? '-' : '+' }}{{ item.number }}</view>
+							<view class="award-right">{{ item.pm == 1 ? '+' : '-' }}{{ item.number }}</view>
 						</view>
 					</view>
 				</scroll-view>
@@ -37,6 +37,7 @@ import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 import empty from '@/components/empty';
 //接口
 import { integral } from '@/api/wallet.js';
+import { getUserInfo } from '@/api/user.js';
 export default {
 	components: {
 		empty,
@@ -65,13 +66,35 @@ export default {
 				}
 			],
 			list: [],
-			money: ''
+			// money: '',
+			integralAll: '',//当前积分
 		};
 	},
 	onLoad() {
 		this.loadData();
+		this.userinfo()
+	},
+	onReady(res) {
+		var _this = this;
+		uni.getSystemInfo({
+			success: resu => {
+				const query = uni.createSelectorQuery();
+				query.select('.swiper-box').boundingClientRect();
+				query.exec(function(res) {
+					_this.height = resu.windowHeight - res[0].top + 'px';
+					console.log('打印页面的剩余高度', _this.height);
+				});
+			},
+			fail: res => {}
+		});
 	},
 	methods: {
+		//加载用户信息
+		userinfo() {
+			getUserInfo({}).then(({ data }) => {
+				this.integralAll = data.integral;
+			});
+		},
 		//swiper 切换
 		changeTab(e) {
 			this.tabCurrentIndex = e.target.current;
@@ -131,7 +154,7 @@ export default {
 			font-weight: 500;
 			color: #3f7c1f;
 			position: absolute;
-			top: 50%;
+			top: 60%;
 			left: 50%;
 			transform: translate(-50%, -50%);
 		}
@@ -221,10 +244,7 @@ export default {
 	}
 }
 .swiper-box {
-		height: calc(100% - 536rpx);
-		background-color: #ffffff;
+		// height: calc(100% - 536rpx);
+		background-color: #fff;
 	}
-// .tab-content {
-// 	height: calc(100% - 260px);
-// }
 </style>