Procházet zdrojové kódy

图片查看等问题

elis před 2 roky
rodič
revize
1a0458858c

+ 1 - 1
nngkxxdp/src/main/java/com/example/nngkxxdp/program/controller/HLWIntefaceController.java

@@ -117,7 +117,7 @@ public class HLWIntefaceController {
 
 
     @GetMapping("/forward")
-    public ResponseEntity<Resource> forward(@RequestParam(name = "url") String url){
+    public ResponseEntity<Resource> forward(String url){
         System.out.println("Start: ------------------------->");
 
         Resource resource = null;

+ 31 - 5
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/aticleList/aticleList.js

@@ -10,7 +10,10 @@ Page({
 	data: {
 		navState: 0,//导航状态
 		id:"",
-		aclist:[]
+		aclist:[],
+		page:1,
+		size:20,
+		isLoading:false
 		},
 		//监听滑块
 		bindchange(e) {
@@ -55,7 +58,7 @@ Page({
 		})
 		console.log(options);
 		this.setData({
-			aclist:"",
+			aclist:[],
 			id:options.id
 		})
 		
@@ -80,13 +83,25 @@ Page({
 
 	},
 	send(){
-		send(1,20,20430).then(res=>{
+		this.setData({
+			isLoading:true
+		})
+		  wx.showLoading({
+			title: '数据加载中...',
+		  })
+		send(this.data.page,this.data.size,20430).then(res=>{
 			if(res.result){
+				let a = this.data.aclist
+				a.push(...res.data.DATA)
 				this.setData({
-					aclist:res.data.DATA
+					aclist:a
 				})
 			}
 		})
+		wx.hideLoading() // 关闭loading
+        this.setData({
+          isLoading:false
+        })
 	},
 	send1(){
 		wx.request({
@@ -161,8 +176,19 @@ Page({
 	/**
 	 * 页面上拉触底事件的处理函数
 	 */
-	onReachBottom() {
+	onReachBottom: function () {
+		
+		if(this.data.isLoading) return  //判断是否为true 
+		let page = this.data.page+1;
+		this.setData({
+			page:page// 让页码值自增 +1
+		})
 
+		switch(this.data.id){
+			case "1":
+				this.send();
+				break
+		}
 	},
 
 	/**

+ 2 - 1
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/index/index.js

@@ -990,6 +990,7 @@ Page({
 		wx.navigateTo({
 			url: '/pages/web/web?url=' + "http://www.cqna.com.cn/na_Class/node_24150.html",
 		})
-	}
+	},
+	
 
 })