Procházet zdrojové kódy

修改导航栏,修改我的页面,解决点击导航栏闪动问题

elis před 2 roky
rodič
revize
2ec6b24c57

+ 9 - 11
nngkxxdp/src/main/resources/static/nnzwminiapp/custom-tab-bar/index.js

@@ -7,12 +7,11 @@ Component({
 		
 	},
 	data: {
-		selected: '',
-		backgroundColor: "#ffffff",
-		color: "#979795",
-		selectedColor: "#1c1c1b",
+		selected: 0,
+		color: "#999999",
+		selectedColor: "#508FF4",
 		list: [{
-				"selectedIconPath": "/pages/images/f-fw2.png",
+				"selectedIconPath": "/pages/images/f-sy2.png",
 				"iconPath": "/pages/images/f-sy.png",
 				"pagePath": "/pages/index/index",
 				"text": "首页"
@@ -24,9 +23,7 @@ Component({
 				"text": "公开"
 			},
 			{
-				"selectedIconPath": "/pages/images/f-gk2.png",
-				"iconPath": "/pages/images/f-gk.png",
-				"pagePath": "/pages/nais/nais",
+				
 				"isSpecial": true,
 				"text": "这是南岸"
 			},
@@ -48,13 +45,14 @@ Component({
 		switchTab(e) {
 			const data = e.currentTarget.dataset
 			const url = data.path
-			wx.switchTab({url})
+			
+			
 			console.log("sss"+this.data.selected);
 			console.log("ttt"+data.index);
-			this.data.selected= '';
 			this.setData({
-			  selected: data.index
+				selected: data.index
 			})
+			wx.switchTab({url})
 		  }
 	}
 })

+ 6 - 5
nngkxxdp/src/main/resources/static/nnzwminiapp/custom-tab-bar/index.wxss

@@ -3,14 +3,14 @@
 	bottom: 0;
 	left: 0;
 	right: 0;
-	height: 48px;
-	background: white;
+	height: 160rpx;
+	/* background: white; */
 	display: flex;
+	background-image: url(https://s1.ax1x.com/2022/10/13/xavRX9.png);
 	padding-bottom: env(safe-area-inset-bottom);
   }
   
   .tab-bar-border {
-	background-color: rgba(0, 0, 0, 0.33);
 	position: absolute;
 	left: 0;
 	top: 0;
@@ -20,6 +20,7 @@
   }
   
   .tab-bar-item {
+	margin-top: 60rpx;  
 	flex: 1;
 	text-align: center;
 	display: flex;
@@ -29,8 +30,8 @@
   }
   
   .tab-bar-item image {
-	width: 27px;
-	height: 27px;
+	width: 40rpx;
+	height: 40rpx;
   }
   
   .tab-bar-item view {

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

@@ -32,7 +32,22 @@ Page({
   },
 
   onReady() {},
-  onShow() {},
+  onShow() {
+	if (typeof this.getTabBar === 'function' &&
+	this.getTabBar()) {
+	this.getTabBar().setData({
+		selected: 0
+	})
+}
+  },
+  onHide(){
+	if (typeof this.getTabBar === 'function' &&
+	this.getTabBar()) {
+	this.getTabBar().setData({
+	  selected: -1
+	})
+  }	
+},
   onLoad() {
     console.log(app.globalData.navHeight)
     this.setData({

+ 0 - 23
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/item/item.js

@@ -1,23 +0,0 @@
-// pages/myCenter/item/item.js
-Component({
-	/**
-	 * 组件的属性列表
-	 */
-	properties: {
-
-	},
-
-	/**
-	 * 组件的初始数据
-	 */
-	data: {
-
-	},
-
-	/**
-	 * 组件的方法列表
-	 */
-	methods: {
-
-	}
-})

+ 0 - 4
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/item/item.json

@@ -1,4 +0,0 @@
-{
-	"component": true,
-	"usingComponents": {}
-}

+ 0 - 2
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/item/item.wxml

@@ -1,2 +0,0 @@
-<!--pages/myCenter/item/item.wxml-->
-<text>pages/myCenter/item/item.wxml</text>

+ 0 - 1
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/item/item.wxss

@@ -1 +0,0 @@
-/* pages/myCenter/item/item.wxss */

+ 22 - 6
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/myCenter.js

@@ -31,12 +31,22 @@ Page({
 	 */
 	onShow() {
 		if (typeof this.getTabBar === 'function' &&
-			this.getTabBar()) {
-			this.getTabBar().setData({
-				selected: 4
-			})
-		}
-
+		this.getTabBar()) {
+		this.getTabBar().setData({
+			selected: 4
+		})
+	}
+	},
+	onHide(){
+		if (typeof this.getTabBar === 'function' &&
+		this.getTabBar()) {
+		this.getTabBar().setData({
+		  selected: -1
+		})
+	  }	
+	},
+	onLoad(){
+		
 	},
 
 	/**
@@ -72,5 +82,11 @@ Page({
 	 */
 	onShareAppMessage() {
 
+	},
+
+	navto(){
+		wx.navigateTo({
+		  url: '/pages/menu/menu',
+		})
 	}
 })

+ 15 - 9
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/myCenter.wxml

@@ -35,28 +35,31 @@
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>任务中心</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>积分商城</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>我的消息</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
@@ -66,37 +69,40 @@
 	</view>
 	<view class="list cont-width">
 		<view class="list-nav">
-			<view class="list-item">
+			<view class="list-item" bindtap="navto">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>我们的食堂</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>联系我们</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>反馈</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
 				</view>
 			</view>
+			<view class="line"></view>
 			<view class="list-item">
 				<view class="left">
 					<image src="../images/l-grzl.png" alt=""></image>
-					<text>个人资料</text>
+					<text>设置</text>
 				</view>
 				<view class="arrow">
 					<image src="../images/arrow.png" alt=""></image>
@@ -104,5 +110,5 @@
 			</view>
 		</view>
 	</view>
-
+	<view style="height: 120rpx;"></view>
 </view>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 1
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/myCenter/myCenter.wxss


+ 15 - 8
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/nais/nais.js

@@ -19,20 +19,27 @@ Page({
 	 * 生命周期函数--监听页面显示
 	 */
 	onShow() {
-		console.log(3);
-		if (typeof this.getTabBar === 'function' &&
-		this.getTabBar()) {
-		this.getTabBar().setData({
-		  selected: 2
-		})
-	  }
+		if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+			this.getTabBar().setData({
+				selected: 2
+			})
+		}
 	},
 
 	/**
 	 * 生命周期函数--监听页面隐藏
 	 */
-	onHide() {
 
+	onHide(){
+		if (typeof this.getTabBar === 'function' &&
+		this.getTabBar()) {
+		this.getTabBar().setData({
+		  selected: -1
+		})
+	  }	
+	},
+	onLoad(){
+		
 	},
 
 	/**

+ 15 - 2
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/publics/publics.js

@@ -38,13 +38,26 @@ Page({
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady() {
-
+	if (typeof this.getTabBar === 'function' && this.getTabBar()) {
+		this.getTabBar().setData({
+			selected: 1
+		})
+	}
   },
+  onHide(){
+	if (typeof this.getTabBar === 'function' &&
+	this.getTabBar()) {
+	this.getTabBar().setData({
+	  selected: -1
+	})
+  }	
+},
   // 事件处理函数
   onLoad() {
     this.setData({
       navHeight: app.globalData.navHeight + app.globalData.menuHeight / 2
-    })
+	})
+	
 
   },
   // 跳转更多界面

+ 17 - 6
nngkxxdp/src/main/resources/static/nnzwminiapp/pages/serve/serve.js

@@ -21,11 +21,19 @@ Page({
 	 */
 	onShow() {
 		if (typeof this.getTabBar === 'function' &&
-			this.getTabBar()) {
-			this.getTabBar().setData({
-			  selected: 3
-			})
-		  }
+		this.getTabBar()) {
+		this.getTabBar().setData({
+		  selected: 3
+		})
+	  }
+	},
+	onHide(){
+		if (typeof this.getTabBar === 'function' &&
+		this.getTabBar()) {
+		this.getTabBar().setData({
+		  selected: -1
+		})
+	  }	
 	},
 
 	/**
@@ -39,7 +47,10 @@ Page({
 	 * 生命周期函数--监听页面卸载
 	 */
 	onUnload() {
-
+		
+	},
+	onLoad(){
+		
 	},
 
 	/**

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů