Преглед изворни кода

优化修改登录页与首页样式

LinWuTai пре 1 година
родитељ
комит
1c9ec3082d

+ 25 - 0
pages.json

@@ -122,6 +122,31 @@
 		"navigationBarBackgroundColor": "#F8F8F8",
 		"backgroundColor": "#F8F8F8"
 	},
+	"tabBar": {
+		"color": "#7A7E83",
+		"selectedColor": "#3cc51f",
+		"borderStyle": "black",
+		"backgroundColor": "#ffffff",
+		"list": [
+		{
+			"pagePath": "pages/menus/menu/menu",
+			"iconPath": "static/images/我的2.png",
+			"selectedIconPath": "static/images/我的2 (1).png",
+			"text": "我的"
+		},
+		{
+			"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": "借用记录"
+		}]
+	},
 	"uniIdRouter": {},
 	"easycom": {
 		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"

+ 4 - 6
pages/home/home.vue

@@ -48,9 +48,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>
@@ -112,7 +112,7 @@
 				
 			},
 			toMine(){
-				uni.navigateTo({
+				uni.switchTab({
 					url:'/pages/menus/menu/menu',
 				})
 			},
@@ -144,11 +144,9 @@
 				return year+"-"+month+"-"+day;
 			}
 		},
-		onLoad:function(){
-			this.keyword = ""
-		},
 		onShow() {
 			this.initInfo()
+			this.keyword = ""
 		}
 	}
 </script>

+ 1 - 1
pages/login/login.vue

@@ -75,7 +75,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


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/home/home.js.map


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/login/login.js.map


Разлика између датотеке није приказан због своје велике величине
+ 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/menus/menu/menu",
+        "iconPath": "static/images/我的2.png",
+        "selectedIconPath": "static/images/我的2 (1).png",
+        "text": "我的"
+      },
+      {
+        "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": "借用记录"
+      }
+    ]
+  },
   "permission": {},
   "usingComponents": {}
 }

+ 57 - 0
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -26209,6 +26209,63 @@ var _default = {
 exports.default = _default;
 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
 
+/***/ }),
+/* 555 */,
+/* 556 */,
+/* 557 */,
+/* 558 */,
+/* 559 */,
+/* 560 */,
+/* 561 */,
+/* 562 */,
+/* 563 */,
+/* 564 */,
+/* 565 */,
+/* 566 */,
+/* 567 */,
+/* 568 */,
+/* 569 */,
+/* 570 */,
+/* 571 */,
+/* 572 */,
+/* 573 */,
+/* 574 */,
+/* 575 */,
+/* 576 */,
+/* 577 */,
+/* 578 */,
+/* 579 */,
+/* 580 */,
+/* 581 */,
+/* 582 */,
+/* 583 */,
+/* 584 */,
+/* 585 */,
+/* 586 */,
+/* 587 */,
+/* 588 */,
+/* 589 */,
+/* 590 */,
+/* 591 */,
+/* 592 */,
+/* 593 */,
+/* 594 */,
+/* 595 */,
+/* 596 */,
+/* 597 */,
+/* 598 */,
+/* 599 */,
+/* 600 */,
+/* 601 */,
+/* 602 */
+/*!********************************************************************************************************************************************!*\
+  !*** E:/存放文件/驿站/工作目录/开发项目/实验设备管理系统(广州医科大学生物医学工程学院)/lab-equipment-project/lab-equipment-mini-program/static/images/微信图片_20230411112151.png ***!
+  \********************************************************************************************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports) {
+
+module.exports = "/static/images/微信图片_20230411112151.png";
+
 /***/ })
 ]]);
 //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map

+ 2 - 4
unpackage/dist/dev/mp-weixin/pages/home/home.js

@@ -298,7 +298,7 @@ var _default = {
       }
     },
     toMine: function toMine() {
-      uni.navigateTo({
+      uni.switchTab({
         url: '/pages/menus/menu/menu'
       });
     },
@@ -330,11 +330,9 @@ var _default = {
       return year + "-" + month + "-" + day;
     }
   },
-  onLoad: function onLoad() {
-    this.keyword = "";
-  },
   onShow: function onShow() {
     this.initInfo();
+    this.keyword = "";
   }
 };
 exports.default = _default;

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
unpackage/dist/dev/mp-weixin/pages/home/home.wxml


+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/login/login.js

@@ -244,7 +244,7 @@ var _default = {
               _storage.default.session.setJSON('nickName', res.data.user.nickName);
               _storage.default.session.setJSON('userName', res.data.user.userName);
               _storage.default.session.setJSON('userId', res.data.user.userId);
-              uni.reLaunch({
+              uni.switchTab({
                 url: '/pages/home/home'
               });
             }

+ 18 - 4
unpackage/dist/dev/mp-weixin/pages/menus/menu/menu.js

@@ -131,6 +131,15 @@ var render = function () {
   var _vm = this
   var _h = _vm.$createElement
   var _c = _vm._self._c || _h
+  var m0 = __webpack_require__(/*! @/static/images/微信图片_20230411112151.png */ 602)
+  _vm.$mp.data = Object.assign(
+    {},
+    {
+      $root: {
+        m0: m0,
+      },
+    }
+  )
 }
 var recyclableRender = false
 var staticRenderFns = []
@@ -235,13 +244,14 @@ var _user = __webpack_require__(/*! @/api/user.js */ 188);
 //
 //
 //
+//
 var _default = {
   data: function data() {
     return {
       src: 'https://tupian.qqw21.com/article/UploadPic/2021-1/20211722215735941.jpg',
-      name: _storage.default.session.getJSON('nickName'),
+      name: "",
       amount: null,
-      role: _storage.default.session.getJSON('role')
+      role: ""
     };
   },
   methods: {
@@ -251,7 +261,7 @@ var _default = {
       });
     },
     toBorrowRecord: function toBorrowRecord() {
-      uni.navigateTo({
+      uni.switchTab({
         url: '/pages/menus/borrow-record/borrow-record'
       });
     },
@@ -291,7 +301,7 @@ var _default = {
               (0, _user.logout)().then(function (res) {
                 if (res.data.code === 200 && res.data.msg === "退出成功") {
                   uni.hideLoading();
-                  uni.reLaunch({
+                  uni.switchTab({
                     url: '/pages/home/home'
                   });
                 }
@@ -309,6 +319,10 @@ var _default = {
   },
   onLoad: function onLoad() {
     this.init();
+  },
+  onShow: function onShow() {
+    this.name = _storage.default.session.getJSON('nickName');
+    this.role = _storage.default.session.getJSON('role');
   }
 };
 exports.default = _default;

Разлика између датотеке није приказан због своје велике величине
+ 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;

Неке датотеке нису приказане због велике количине промена