Browse Source

2022-4-8代码优化

twt 3 years ago
parent
commit
f94c22179f
4 changed files with 40 additions and 6 deletions
  1. 18 1
      pages/pc/indexNew.vue
  2. 3 0
      pages/pc/newDetail.vue
  3. 3 1
      pages/pc/newgroupingList.vue
  4. 16 4
      pages/pc/newsearchlist.vue

+ 18 - 1
pages/pc/indexNew.vue

@@ -144,7 +144,7 @@
 			 @getChildList="getChildList" @goDetail="goDetail"
 			 v-show="newgroupingListShow" :newcode="newgroupingcode" :data="newgroupingdata"></newgroupingList>
 		
-		    <newsearchlist v-show="newsearchShow"></newsearchlist>
+		    <newsearchlist v-show="newsearchShow" @goDetail="goDetail" @goDetail4="goDetail4"></newsearchlist>
 		</view>
 	</view>
 </template>
@@ -307,6 +307,23 @@
 				}
 				//console.log(wz)
 			},
+			goDetail4(item){
+				this.newgroupingcode=item.Code;
+				var newgroupingdata={
+					parentCode:item.parentCode,
+					name:item.Name,
+					title:item.Title,
+					topName:item.topName,
+					comment:''
+				}
+				console.log(newgroupingdata)
+				this.indexShow=false;
+				this.listShow=false;
+				this.newDetailShow=false;
+				this.newgroupingListShow=true;
+				this.newsearchShow=false;
+				this.newgroupingdata=newgroupingdata
+			},
 			gotoTop(){
 				uni.pageScrollTo({ 
 				   scrollTop: 0, duration: 300 

+ 3 - 0
pages/pc/newDetail.vue

@@ -59,6 +59,9 @@
 				// uni.setNavigationBarTitle({
 				// 	title: this.topName
 				// })
+				uni.pageScrollTo({
+				   scrollTop: 0, duration: 100 
+				}); 
 			}
 		},
 		onLoad(opt) {

+ 3 - 1
pages/pc/newgroupingList.vue

@@ -112,7 +112,9 @@
 				 uni.setNavigationBarTitle({
 				 	title: this.name
 				})
-				
+				uni.pageScrollTo({
+				   scrollTop: 0, duration: 100 
+				}); 
 			}
 		},
 		created(){

+ 16 - 4
pages/pc/newsearchlist.vue

@@ -98,13 +98,25 @@
 			goDetail(wz){
 				// 1分类2文章
 				if (wz.Type == 1) {
-					uni.navigateTo({
+					/* uni.navigateTo({
 						url:'groupingList?parentCode='+wz.Code+'&name='+wz.Name+'&title='+wz.Title+'&topName='
-					})
+					}) */
+					var item={
+						parentCode:wz.Code,
+						name:wz.Name,
+						title:wz.Title,
+						topName:'',
+					}
+					this.$emit("goDetail4",item)
 				}else{
-					uni.navigateTo({
+					var item={
+						id:wz.ID,
+						topName:'',twoName:''
+					}
+					this.$emit("goDetail",item)
+					/* uni.navigateTo({
 						url:'detail?id='+wz.ID+'&topName=&twoName='
-					})
+					}) */
 				}
 			
 			},