Pārlūkot izejas kodu

tabbar和菜单页

littlegreen 2 gadi atpakaļ
vecāks
revīzija
3445cd1da1

+ 24 - 0
pages.json

@@ -122,6 +122,30 @@
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
 	},
+	"tabBar": {
+		"color": "#7A7E83",
+		"selectedColor": "#3cc51f",
+		"borderStyle": "black",
+		"backgroundColor": "#ffffff",
+		"list": [{
+			"pagePath": "pages/home/home",
+			"iconPath": "static/images/首页2 (1).png",
+			"selectedIconPath": "static/images/首页2.png",
+			"text": "首页"
+		},
+		{
+			"pagePath": "pages/menus/borrow-record/borrow-record",
+			"iconPath": "static/images/项目2.png",
+			"selectedIconPath": "static/images/项目2 (1).png",
+			"text": "借用记录"
+		},
+		{
+			"pagePath": "pages/menus/menu/menu",
+			"iconPath": "static/images/我的2.png",
+			"selectedIconPath": "static/images/我的2 (1).png",
+			"text": "我的"
+		}]
+	},
 	"uniIdRouter": {},
 	"easycom": {
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"

+ 4 - 6
pages/home/home.vue

@@ -44,9 +44,9 @@
 				<i class="iconfont icon-saoyisao"></i>
 				<text>扫码设备</text>
 			</view>
-			<view class="scan-mine" @click="toMine">
+			<!-- <view class="scan-mine" @click="toMine">
 				<i class="iconfont icon-wode"></i>
-			</view>
+			</view> -->
 		</view>
 	</view>
 </template>
@@ -108,7 +108,7 @@
 				
 			},
 			toMine(){
-				uni.navigateTo({
+				uni.switchTab({
 					url:'/pages/menus/menu/menu',
 				})
 			},
@@ -140,11 +140,9 @@
 				return year+"-"+month+"-"+day;
 			}
 		},
-		onLoad:function(){
-			this.keyword = ""
-		},
 		onShow() {
 			this.initInfo()
+			this.keyword = ""
 		}
 	}
 </script>

+ 1 - 1
pages/login/login.vue

@@ -69,7 +69,7 @@
 								cache.session.setJSON('nickName',res.data.user.nickName)
 								cache.session.setJSON('userName',res.data.user.userName)
 								cache.session.setJSON('userId',res.data.user.userId)
-								uni.reLaunch({
+								uni.switchTab({
 									url:'/pages/home/home'
 								})
 							}

+ 17 - 11
pages/menus/menu/menu.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="mine-area">
+		<image style="width: 100%;" mode="aspectFill" :src="require('@/static/images/微信图片_20230411112151.png')"></image>
 		<view class="big-circle"></view>
 		<view class="avatar-area z10" >
 			<u-avatar :src="src" size="80" shape="circle"></u-avatar>
@@ -18,12 +19,12 @@
 						<text>我的信息</text>
 					</view>
 				</u-list-item>
-				<u-list-item>
+				<!-- <u-list-item>
 					<view class="menu-list" @click="toBorrowRecord">
 						<i class="iconfont icon-qianbao"></i>
 						<text>借用记录</text>
 					</view>
-				</u-list-item>
+				</u-list-item> -->
 				<u-list-item>
 					<view class="menu-list"  @click="toRepeat">
 						<i class="iconfont icon-a-shezhi2"></i>
@@ -36,7 +37,7 @@
 						<text>故障处理</text>
 					</view>
 				</u-list-item>
-				<u-list-item>
+				<!-- <u-list-item>
 					<view class="menu-list">
 						<i class="iconfont icon-dangewenjian"></i>
 						<text>使用指南</text>
@@ -47,7 +48,7 @@
 						<i class="iconfont icon-bangzhu"></i>
 						<text>关于我们</text>
 					</view>
-				</u-list-item>
+				</u-list-item> -->
 				<u-list-item>
 					<view class="menu-list" @click="toLogout">
 						<i class="iconfont icon-tuichu"></i>
@@ -67,9 +68,9 @@
 		data() {
 			return {
 				src: 'https://tupian.qqw21.com/article/UploadPic/2021-1/20211722215735941.jpg',
-				name: cache.session.getJSON('nickName'),
+				name: "",
 				amount:null,
-				role:cache.session.getJSON('role')
+				role:""
 			};
 		},
 		methods:{
@@ -79,7 +80,7 @@
 				})
 			},
 			toBorrowRecord(){
-				uni.navigateTo({
+				uni.switchTab({
 					url:'/pages/menus/borrow-record/borrow-record'
 				})
 			},
@@ -119,7 +120,7 @@
 								logout().then(res=>{
 									if(res.data.code===200&&res.data.msg==="退出成功"){
 										uni.hideLoading()
-										uni.reLaunch({
+										uni.switchTab({
 											url:'/pages/home/home'
 										})
 									}
@@ -151,7 +152,7 @@
 								logout().then(res=>{
 									if(res.data.code===200&&res.data.msg==="退出成功"){
 										uni.hideLoading()
-										uni.reLaunch({
+										uni.switchTab({
 											url:'/pages/home/home'
 										})	
 									}
@@ -172,13 +173,18 @@
 		},
 		onLoad() {
 			this.init()
+		},
+		onShow(){
+			this.name = cache.session.getJSON('nickName')
+			this.role = cache.session.getJSON('role')
 		}
 	}
 </script>
 
 <style lang="scss">
 .mine-area{
-	background-color: #000;
+	// background-color: #225f15;
+	// background-image: url('@/static/images/tsg02 (1).jpg');
 	height: 100vh;
 	position: relative;
 	overflow: hidden;
@@ -192,7 +198,7 @@
 	top: 25%;
 	left: 50%;
 	transform: translate(-50%, 0);
-	z-index: 1;
+	z-index: 5;
 }
 .avatar-area{
 	position: absolute;

BIN
static/images/tsg02 (1).jpg


BIN
static/images/微信图片_20230411112151.png


BIN
static/images/我的2 (1).png


BIN
static/images/我的2.png


BIN
static/images/项目2 (1).png


BIN
static/images/项目2.png


BIN
static/images/首页2 (1).png


BIN
static/images/首页2.png


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/menus/menu/menu.js.map


+ 26 - 0
unpackage/dist/dev/mp-weixin/app.json

@@ -21,6 +21,32 @@
     "navigationBarBackgroundColor": "#F8F8F8",
     "backgroundColor": "#F8F8F8"
   },
+  "tabBar": {
+    "color": "#7A7E83",
+    "selectedColor": "#3cc51f",
+    "borderStyle": "black",
+    "backgroundColor": "#ffffff",
+    "list": [
+      {
+        "pagePath": "pages/home/home",
+        "iconPath": "static/images/首页2 (1).png",
+        "selectedIconPath": "static/images/首页2.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/menus/borrow-record/borrow-record",
+        "iconPath": "static/images/项目2.png",
+        "selectedIconPath": "static/images/项目2 (1).png",
+        "text": "借用记录"
+      },
+      {
+        "pagePath": "pages/menus/menu/menu",
+        "iconPath": "static/images/我的2.png",
+        "selectedIconPath": "static/images/我的2 (1).png",
+        "text": "我的"
+      }
+    ]
+  },
   "permission": {},
   "usingComponents": {}
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/home/home.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/home/home.wxml


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/login/login.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/menus/menu/menu.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/menus/menu/menu.wxml


+ 1 - 2
unpackage/dist/dev/mp-weixin/pages/menus/menu/menu.wxss

@@ -25,7 +25,6 @@
 /* 透明度 */
 /* 文章场景相关 */
 .mine-area {
-  background-color: #000;
   height: 100vh;
   position: relative;
   overflow: hidden;
@@ -40,7 +39,7 @@
   left: 50%;
   -webkit-transform: translate(-50%, 0);
           transform: translate(-50%, 0);
-  z-index: 1;
+  z-index: 5;
 }
 .avatar-area {
   position: absolute;

+ 1 - 1
utils/baseurl.js

@@ -1,4 +1,4 @@
-let devUrl = 'http://192.168.0.100:80/dev-api';
+let devUrl = 'http://192.168.0.102:80/dev-api';
 let prodUrl = 'http://localhost:8089/prod-api';
 let baseUrl = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
 

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels