ydf il y a 1 an
Parent
commit
3468c3335f

+ 7 - 1
pages.json

@@ -1,6 +1,12 @@
1 1
 {
2
-  "entryPagePath": "pages/beixWarehouse/beixWarehouse",
2
+  "entryPagePath": "pages/login/login",
3 3
   "pages": [
4
+	  {
5
+		"path": "pages/login/login",
6
+		"style": {
7
+		  "navigationBarTitleText": "登录"
8
+		}
9
+	  },
4 10
     {
5 11
       "path": "pages/home/home",
6 12
       "style": {

+ 170 - 0
pages/login/login.vue

@@ -0,0 +1,170 @@
1
+<template>
2
+  <view class="login-container">
3
+	<image class="bg-image" src="../../static/login/login-bj.png"></image>
4
+	<view class="login-title">
5
+		<view class="welcome-text">您好,欢迎使用</view>
6
+		<view class="system-name">交收库管理系统</view>
7
+	</view>
8
+    <view class="login-form">
9
+      <view class="input-group">
10
+		  
11
+        <view class="input-label">
12
+			<uni-icons custom-prefix="iconfont" type="icon-yonghu_yonghuming" color="#000000" size="18"></uni-icons>
13
+			用户名称
14
+		</view>
15
+		<view class="uni-input-wrapper">
16
+			<input v-model="username" class="input-field" placeholder="请输入用户名" />
17
+		</view>
18
+      </view>
19
+
20
+      <view class="input-group">
21
+		<view class="input-label">
22
+			<uni-icons custom-prefix="iconfont" type="icon-mima" color="#000000" size="18"></uni-icons>
23
+			登录密码
24
+		</view>
25
+		<view class="uni-input-wrapper">
26
+			<input v-model="password" class="input-field" placeholder="请输入密码" :password="showPassword" />
27
+			<uni-icons @click="changePassword" :type="!showPassword ? 'eye' : 'eye-slash'" color="#000000" size="32"></uni-icons>
28
+		</view>
29
+      </view>
30
+
31
+      <button class="login-button" @click="handleLogin">登录</button>
32
+    </view>
33
+  </view>
34
+</template>
35
+
36
+<script setup>
37
+import { ref } from 'vue';
38
+
39
+const username = ref('');
40
+const password = ref('');
41
+
42
+const showPassword = ref(true)
43
+
44
+const changePassword = () => {
45
+	showPassword.value = !showPassword.value;
46
+}
47
+const handleLogin = async () => {
48
+  if (!username.value || !password.value) {
49
+    uni.showToast({
50
+      title: '请输入用户名和密码',
51
+      icon: 'none'
52
+    });
53
+    return;
54
+  }
55
+  
56
+  uni.request({
57
+    url: 'http://172.16.6.128:8011/admin-api/system/auth/login',
58
+    method: 'POST',
59
+    data: {
60
+		username: username.value,
61
+		password: password.value
62
+	  },
63
+    success: (res) => {
64
+	  if (res.data.code === 0) {
65
+	    uni.showToast({
66
+	      title: '登录成功',
67
+	      icon: 'success'
68
+	    });
69
+	    // 跳转到首页或其他页面
70
+		uni.switchTab({
71
+		  url: '/pages/home/home' // 注意路径前的斜杠
72
+		});
73
+	  } else {
74
+	    uni.showToast({
75
+	      title: res.data.msg,
76
+	      icon: 'none'
77
+	    });
78
+	  }
79
+    },
80
+    fail: (err) => {
81
+      console.error(err); // 失败回调
82
+    }
83
+  });
84
+  
85
+};
86
+</script>
87
+
88
+<style lang="scss" scoped>
89
+.login-container {
90
+  height: 100vh;
91
+  display: flex;
92
+  flex-direction: column;
93
+  position: relative;
94
+  overflow: hidden;
95
+	.bg-image {
96
+		position: absolute;
97
+		width: 100%;
98
+		height: 100vh;
99
+		top: 0;
100
+		left: 0;
101
+		object-fit: cover;
102
+		z-index: -1;
103
+	}
104
+	.login-title{
105
+		margin: 100rpx 30rpx 0;
106
+		.welcome-text {
107
+		  font-size: 58rpx;
108
+		  margin-bottom: 15rpx;
109
+		  letter-spacing: 5rpx;
110
+		}
111
+		
112
+		.system-name {
113
+		  font-size: 68rpx;
114
+		  font-weight: bold;
115
+		  letter-spacing: 10rpx;
116
+		}
117
+	}
118
+	
119
+}
120
+
121
+.login-form {
122
+  margin: 60rpx 30rpx 0;
123
+  padding: 70rpx;
124
+  background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
125
+  border-radius: 25px 25px 0 0;
126
+  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
127
+  height: 100vh;
128
+}
129
+
130
+
131
+.input-group {
132
+  margin-bottom: 55rpx;
133
+}
134
+
135
+.input-label {
136
+  font-size: 30rpx;
137
+  margin-bottom: 10rpx;
138
+  display: block;
139
+}
140
+.uni-input-wrapper {
141
+   display: flex;
142
+   margin: 10rpx 0;
143
+   flex-direction: row;
144
+   flex-wrap: nowrap;
145
+   border: 1px solid #B2C7E6;
146
+   background-color: #ffffff;
147
+   padding: 0px 10px 0 20px;
148
+   border-radius: 4px;
149
+   align-items: center;
150
+ }
151
+.input-field {
152
+  width: 100%;
153
+  padding: 10px 0;
154
+}
155
+
156
+.login-button {
157
+  width: 100%;
158
+  height: 70rpx;
159
+  line-height: 70rpx;
160
+  border-radius: 10rpx;
161
+  background-color: #1E5FDF;
162
+  color: #fff;
163
+  font-size: 28rpx;
164
+  text-align: center;
165
+}
166
+
167
+.login-button:hover {
168
+  background-color: #005bb5;
169
+}
170
+</style>

+ 8 - 0
static/iconfont.css

@@ -13,6 +13,14 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.icon-mima:before {
17
+  content: "\e7e2";
18
+}
19
+
20
+.icon-yonghu_yonghuming:before {
21
+  content: "\e678";
22
+}
23
+
16 24
 .icon-down:before {
17 25
   content: "\e628";
18 26
 }

BIN
static/iconfont.ttf


BIN
static/login/login-bj.png


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/app.js.map


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/assets.js.map


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


+ 1 - 0
unpackage/dist/dev/mp-weixin/app.js

@@ -2,6 +2,7 @@
2 2
 Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3 3
 const common_vendor = require("./common/vendor.js");
4 4
 if (!Math) {
5
+  "./pages/login/login.js";
5 6
   "./pages/home/home.js";
6 7
   "./pages/daixjgk/daixjgk.js";
7 8
   "./pages/beixWarehouse/beixWarehouse.js";

+ 2 - 1
unpackage/dist/dev/mp-weixin/app.json

@@ -1,5 +1,6 @@
1 1
 {
2 2
   "pages": [
3
+    "pages/login/login",
3 4
     "pages/home/home",
4 5
     "pages/daixjgk/daixjgk",
5 6
     "pages/beixWarehouse/beixWarehouse",
@@ -36,7 +37,7 @@
36 37
       }
37 38
     ]
38 39
   },
39
-  "entryPagePath": "pages/beixWarehouse/beixWarehouse",
40
+  "entryPagePath": "pages/login/login",
40 41
   "permission": {
41 42
     "scope.userLocation": {
42 43
       "desc": "您的位置信息将用于定位打卡功能"

Fichier diff supprimé car celui-ci est trop grand
+ 7 - 1
unpackage/dist/dev/mp-weixin/app.wxss


+ 7 - 5
unpackage/dist/dev/mp-weixin/common/assets.js

@@ -1,4 +1,5 @@
1 1
 "use strict";
2
+const _imports_0$5 = "/static/login/login-bj.png";
2 3
 const _imports_0$4 = "/static/home/home-bj.png";
3 4
 const _imports_1 = "/static/home/logo.png";
4 5
 const _imports_2$1 = "/static/home/daixjsk.png";
@@ -10,11 +11,12 @@ const _imports_0$2 = "/static/icons/warehouse-ico.png";
10 11
 const _imports_2 = "/static/icons/location-ico.png";
11 12
 const _imports_0$1 = "/static/tp.png";
12 13
 const _imports_0 = "/static/logo.png";
13
-exports._imports_0 = _imports_0$4;
14
-exports._imports_0$1 = _imports_0$3;
15
-exports._imports_0$2 = _imports_0$2;
16
-exports._imports_0$3 = _imports_0$1;
17
-exports._imports_0$4 = _imports_0;
14
+exports._imports_0 = _imports_0$5;
15
+exports._imports_0$1 = _imports_0$4;
16
+exports._imports_0$2 = _imports_0$3;
17
+exports._imports_0$3 = _imports_0$2;
18
+exports._imports_0$4 = _imports_0$1;
19
+exports._imports_0$5 = _imports_0;
18 20
 exports._imports_1 = _imports_1;
19 21
 exports._imports_2 = _imports_2$1;
20 22
 exports._imports_2$1 = _imports_2;

+ 9 - 3
unpackage/dist/dev/mp-weixin/common/vendor.js

@@ -7156,9 +7156,9 @@ function initOnError() {
7156 7156
   };
7157 7157
 }
7158 7158
 function initRuntimeSocketService() {
7159
-  const hosts = "2.0.1.1,10.153.42.136,192.168.40.245,192.168.137.1,127.0.0.1";
7159
+  const hosts = "2.0.1.3,10.153.42.137,192.168.40.245,127.0.0.1";
7160 7160
   const port = "8090";
7161
-  const id = "mp-weixin_UIuA0q";
7161
+  const id = "mp-weixin_6qua5J";
7162 7162
   const lazy = typeof swan !== "undefined";
7163 7163
   let restoreError = lazy ? () => {
7164 7164
   } : initOnError();
@@ -8090,9 +8090,15 @@ const createSubpackageApp = initCreateSubpackageApp();
8090 8090
   wx.createPluginApp = global.createPluginApp = createPluginApp;
8091 8091
   wx.createSubpackageApp = global.createSubpackageApp = createSubpackageApp;
8092 8092
 }
8093
-const entryPagePath = "pages/beixWarehouse/beixWarehouse";
8093
+const entryPagePath = "pages/login/login";
8094 8094
 const pages = [
8095 8095
   {
8096
+    path: "pages/login/login",
8097
+    style: {
8098
+      navigationBarTitleText: "登录"
8099
+    }
8100
+  },
8101
+  {
8096 8102
     path: "pages/home/home",
8097 8103
     style: {
8098 8104
       navigationBarTitleText: "首页"

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

@@ -170,7 +170,7 @@ const _sfc_main = {
170 170
         e: common_vendor.t(amSign.value.time),
171 171
         f: common_vendor.t(amSign.value.address)
172 172
       } : {}, {
173
-        g: common_assets._imports_0$3
173
+        g: common_assets._imports_0$4
174 174
       });
175 175
     };
176 176
   }

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

@@ -43,7 +43,7 @@ const _sfc_main = {
43 43
     return (_ctx, _cache) => {
44 44
       return {
45 45
         a: common_vendor.o(($event) => goFilterPage()),
46
-        b: common_assets._imports_0$1,
46
+        b: common_assets._imports_0$2,
47 47
         c: common_vendor.f(warehouses.value, (warehouse, index, i0) => {
48 48
           return {
49 49
             a: common_vendor.t(warehouse.name),
@@ -57,7 +57,7 @@ const _sfc_main = {
57 57
             i: index
58 58
           };
59 59
         }),
60
-        d: common_assets._imports_0$2,
60
+        d: common_assets._imports_0$3,
61 61
         e: common_assets._imports_2$1,
62 62
         f: common_vendor.o(selectAll),
63 63
         g: common_vendor.o(confirmSelection),

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

@@ -11,7 +11,7 @@ const _sfc_main = {
11 11
     };
12 12
     return (_ctx, _cache) => {
13 13
       return {
14
-        a: common_assets._imports_0,
14
+        a: common_assets._imports_0$1,
15 15
         b: common_assets._imports_1,
16 16
         c: common_assets._imports_2,
17 17
         d: common_vendor.o(($event) => goDetailPage("/pages/daixjgk/daixjgk")),

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

@@ -13,7 +13,7 @@ const _sfc_main = {
13 13
 };
14 14
 function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
15 15
   return {
16
-    a: common_assets._imports_0$4,
16
+    a: common_assets._imports_0$5,
17 17
     b: common_vendor.t($data.title)
18 18
   };
19 19
 }

+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/warehouse/components/warehouseInfo/warehouseInfo.js

@@ -6,7 +6,7 @@ const _sfc_main = {
6 6
   setup(__props) {
7 7
     return (_ctx, _cache) => {
8 8
       return {
9
-        a: common_assets._imports_0$3
9
+        a: common_assets._imports_0$4
10 10
       };
11 11
     };
12 12
   }

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

@@ -88,7 +88,7 @@ const _sfc_main = {
88 88
             j: index
89 89
           };
90 90
         }),
91
-        c: common_assets._imports_0$2,
91
+        c: common_assets._imports_0$3,
92 92
         d: common_vendor.o(selectAll),
93 93
         e: common_vendor.o(confirmSelection),
94 94
         f: tabCurrentIndex.value,