Przeglądaj źródła

速度相关更新

zhengkaixin 2 lat temu
rodzic
commit
4c0b30e969

+ 9 - 0
apis/pagejs/user.js

@@ -94,4 +94,13 @@ export function myPointsNotes(data) {
 		data: data,
 		url: url
 	})
+}
+
+export function myPointsSort(data) {
+	var url='/mobile/points/myPointsSort';
+	return request({
+		method: 'post',
+		data: data,
+		url: url
+	})
 }

+ 20 - 5
pages/mine/points/points.vue

@@ -1,14 +1,24 @@
 <template>
 	<view>
 		<u-navbar title="积分">
-			<view class="slot-wrap"  v-if="false" >
+			<view class="slot-wrap"  @click="showPointsRule()" >
 				积分规则
 			</view>	
 		</u-navbar>
+		<u-modal v-model="showPointsRuleBl" title="积分规则" >
+			<view class="showPointsRuleClass">
+				<view>登陆微官网一分</view>
+				<view>点赞一分</view>
+				<view>分享一分</view>
+				<view>登陆微官网一分</view>
+				<view>每天上限为4分</view>
+			</view>
+		</u-modal>
+
 		<view class="background">
 			<view class="points">
 				<view class="number">
-					{{plusInfo.userPoints}}
+					{{top?top.userScore:plusInfo.userPoints}}
 				</view>
 				<view class="unit">
 					积分
@@ -127,6 +137,7 @@
 				list:[],
 				current: 0,
 				top:null,
+				showPointsRuleBl:false,
 			}
 		},
 		onLoad() {
@@ -141,10 +152,14 @@
 			}
 		},
 		methods: {
+			showPointsRule(){
+				this.showPointsRuleBl=true;
+			},
 			pointsNotes(){
-				API.pointsNotes({
-					pageIndex:1,
-					pageSize:0,
+				var year=new Date().getFullYear()
+				API.myPointsSort({
+					year:year,
+				
 				}).then((res) => {
 						
 					

+ 48 - 17
pages/mine/points/rankingList.vue

@@ -6,8 +6,8 @@
 			积分排行榜
 			
 		</view>
-		<view class="self" v-if="top" >
-			<view class="rank">
+		<view class="self" v-if="plusInfo" >
+			<view class="rank" v-if="top">
 				 
 				<img v-if="top.rank==1" src="../../../assets/img/Gold Medal@1x.png" alt="">
 				<img v-else-if="top.rank==2" src="../../../assets/img/Silver Medal Copy@1x.png" alt="">
@@ -15,14 +15,14 @@
 				<span v-else>{{top.rank}}</span>
 			</view>
 			<view class="photo">
-				<img v-if="top.userImg" :src="top.userImg" alt="">
+				<img v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
 				<u-avatar  v-else  size="80" ></u-avatar>
 			</view>
 			<view class="name">
-				{{top.userName}}
+				{{userInfo.name}}
 			</view>
 			<view class="points">
-				{{top.userScore}}积分
+				{{top?top.userScore:plusInfo.userPoints}}积分
 			</view>
 		</view>
 		
@@ -53,7 +53,7 @@
 			</view>
 			
 		</view>
-		<u-divider   :isnone="!list.length" nonetext="统计中,敬请期待"  bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+		<u-divider   :isnone="!list.length" nonetext="统计中,敬请期待"  bg-color="#F2F4F4" border-color="#CFD2D5">只显示前{{recordsTotal}}条</u-divider>
 	</view>
 </template>
 
@@ -71,23 +71,54 @@
 				},
 				recordsTotal:0,
 				top:null,
-				
+				userInfo:{},
+				plusInfo:{}
 			}
 		},
 		onLoad() {
 			this.listForm.year=new Date().getFullYear()
 			this.getList();
+			this.userInfo=this.carhelp.getPersonInfo()
+			this.plusInfo=this.carhelp.getPersonInfoPlus()
+			
+			if(this.userInfo){
+				this.myPointsSort();
+			}
+			
 		},
 		onReachBottom() {
-			if (this.list.length < this.recordsTotal) {			
-				this.myLoadmore();
-			}
+			// if (this.list.length < this.recordsTotal) {			
+			// 	this.myLoadmore();
+			// }
 		},
 		methods: {
 			myLoadmore(){
 				this.listForm.pageIndex += 1;
 				this.getList();
 			},
+			myPointsSort(){
+				
+				
+				API.myPointsSort(this.listForm).then((res) => {
+						
+						
+ 						if(res.data.myPoint){
+							this.top=res.data.myPoint
+							if(res.data.myPoint.userSortNo){
+								this.top.rank=parseInt(res.data.myPoint.userSortNo)
+								
+							}
+						}
+						
+				
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			getList(){
 				uni.showLoading({
 					title: "加载中",
@@ -100,15 +131,15 @@
 							...this.list,
 							...res.data.pointsList.data
 						];
-						this.recordsTotal = res.data.pointsList.recordsTotal;
+						this.recordsTotal = res.data.pointsList.pageSize;
 						
- 						if(res.data.myPoint){
-							this.top=res.data.myPoint
-							if(res.data.myPoint.userSortNo){
-								this.top.rank=parseInt(res.data.myPoint.userSortNo)
+ 					// 	if(res.data.myPoint){
+						// 	this.top=res.data.myPoint
+						// 	if(res.data.myPoint.userSortNo){
+						// 		this.top.rank=parseInt(res.data.myPoint.userSortNo)
 								
-							}
-						}
+						// 	}
+						// }
 						
 					uni.hideLoading();
 					

+ 24 - 11
pages/news/articleDetails.vue

@@ -69,7 +69,7 @@
 			   
 			</view>
 		</view>
-			<u-divider   v-if="infolistComment.length==recordsTotal" border-color="#CFD2D5">已经到底了</u-divider>
+			<u-divider  style="margin-top: 20px;"   v-if="infolistComment.length==recordsTotal" >已经到底了,欢迎留下你的评论</u-divider>
 		
 		</view>
 		
@@ -143,11 +143,11 @@
 					pageIndex:1,
 					newsId:"",
 					queryStatus:0,
-					pageSize:5,
+					pageSize:10,
 				},
 				 back:true,
 				recordsTotal:0,
-				
+				getNewsCommentsListBl:true,
 			}
 		},
 		onLoad(op){
@@ -163,7 +163,7 @@
 	
 		methods: {
 			onReachBottom() {
-				if (this.infolistComment.length < this.recordsTotal) {			
+				if (this.infolistComment.length < this.recordsTotal&&this.getNewsCommentsListBl) {			
 					this.myLoadmore();
 				}
 			},
@@ -214,8 +214,8 @@
 						icon: "none"
 					})
 					
-					this.getInfo();
-					
+					//this.getInfo();
+					this.getNewsCommentsList(true)
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -246,8 +246,9 @@
 						icon: "none"
 					})
 					this.showMessage=false
-					this.getInfo();
+					//this.getInfo();
 					
+					this.getNewsCommentsList(true)
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -266,8 +267,10 @@
 					API.changeLikes({
 						newsId:this.id
 					}).then((res) => {
-						
-						this.getInfo(true)
+						this.info.iLike=true;
+						this.info.likesNum++;
+						uni.hideLoading();
+						//this.getInfo(true)
 					}).catch(error => {
 						uni.showToast({
 							title: error,
@@ -282,7 +285,12 @@
 				}
 				
 			},
-			getNewsCommentsList(){
+			getNewsCommentsList(bl){
+				if(bl){
+					this.listForm.pageIndex=1;
+					this.infolistComment=[];
+					this.getNewsCommentsListBl=false
+				}
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
@@ -297,6 +305,9 @@
 						...res.data.data
 					];
 					this.recordsTotal = res.data.recordsTotal;
+					this.$nextTick(()=>{
+						this.getNewsCommentsListBl=true
+					})
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -355,7 +366,9 @@
 </script>
 
 <style lang="scss" scoped>
-	
+	.showPointsRuleClass{
+		    padding: 10px 30px;
+	}
 	page{
 		padding-bottom:100px;
 		font-family: 'Regular';