Explorar el Código

fix:模考返回刷新列表

xuqiaoying hace 3 años
padre
commit
c5a44c3661
Se han modificado 2 ficheros con 12 adiciones y 27 borrados
  1. 2 2
      common/request.js
  2. 10 25
      pages5/examList/index.vue

+ 2 - 2
common/request.js

@@ -5,12 +5,12 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 10 - 25
pages5/examList/index.vue

@@ -185,29 +185,9 @@ export default {
 		console.log('查看返回的onloaddddd')
 		this.param.mockStatus = option.state || 0
 		
-		// this.endDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
-			
-		// this.mockSubscribeListSubscribe();
-		// uni.getSystemInfo({
-		// 	success:(e) => {
-		// 		let info = uni.createSelectorQuery().select(".nav");
-		// 		info.boundingClientRect((navData) => { //data - 各种参数
-				
-		// 			let info = uni.createSelectorQuery().select(".tabs");
-		// 			info.boundingClientRect((tabData) => { //data - 各种参数
-		// 				this.modalTop = navData.height + tabData.height
-		// 				console.log(navData) // 获取元素宽度
-		// 				console.log(tabData) // 获取元素宽度
-		// 			}).exec()
-		// 		}).exec()
-		// 	}
-		// })
-	},
-	onShow() {
-		console.log('查看返回的oonshow')
 		this.endDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
 			
-		this.mockSubscribeListSubscribe();
+		// this.mockSubscribeListSubscribe();
 		uni.getSystemInfo({
 			success:(e) => {
 				let info = uni.createSelectorQuery().select(".nav");
@@ -240,10 +220,13 @@ export default {
 		}
 	},
 	onShow() {
+		console.log('sfhdsofhsoh-----onshow', this.itemIndex)
 		this.nowTime = +this.$method.timest();
-		if(this.itemIndex !== '') {
-			this.refreshByIndex();
-		}
+		// if(this.itemIndex !== '') {
+		// 	this.refreshByIndex();
+		// }
+		this.recordList = []
+		this.mockSubscribeListSubscribe();
 		
 	},
 	methods: {
@@ -323,7 +306,8 @@ export default {
 			}
 			// mock/subscribe/listSubscribe
 			this.$api.mockSubscribeListSubscribe(param).then(res => {
-				this.recordList = []
+				console.log('请求请求')
+				
 				this.recordList.push(...res.data.rows)
 				this.total = res.data.total
 			})
@@ -340,6 +324,7 @@ export default {
 			param.pageNum = this.itemIndex+1;
 			param.pageSize =  1
 			this.$api.mockSubscribeListSubscribe(param).then(res => {
+				console.log('res.data.rows[0]', res.data.rows[0])
 				this.$set(this.recordList,this.itemIndex,res.data.rows[0])
 				this.itemIndex = ''
 			})