Przeglądaj źródła

登录页样式逻辑同步旧版登录页样式逻辑

zhangxin 2 dni temu
rodzic
commit
e152b3c5ae

+ 15 - 5
.gitignore

@@ -1,21 +1,31 @@
1
-# Logs
2
-logs
1
+# 操作系统相关
2
+Thumbs.db       # Windows
3
+desktop.ini     # Windows
4
+
5
+# 日志文件
6
+logs/
3 7
 *.log
8
+logs
4 9
 npm-debug.log*
5 10
 yarn-debug.log*
6 11
 yarn-error.log*
7 12
 pnpm-debug.log*
8 13
 lerna-debug.log*
9 14
 
15
+# 编译/构建产物
10 16
 node_modules
17
+dist/           # 前端打包产物
18
+build/          # 后端/前端构建文件夹
19
+target/         # Java 编译产物
11 20
 .DS_Store
12 21
 dist
13 22
 *.local
14 23
 
15
-# Editor directories and files
16
-.idea
24
+# IDE 配置
25
+.idea/
26
+.vscode/
17 27
 *.suo
18 28
 *.ntvs*
19 29
 *.njsproj
20 30
 *.sln
21
-*.sw?
31
+*.sw?

+ 5 - 1
readme.md

@@ -1,8 +1,12 @@
1
+# pnpm -v 10.30.3
2
+# npm -v 10.8.2
3
+# node -v v20.19.0
4
+
1 5
 # 启动项目命令
2 6
 ```bash
7
+pnpm install
3 8
 pnpm dev:h5
4 9
 ```
5 10
 
6
-
7 11
 # HBuilderX 打包环境说明
8 12
 直接修改 `.env.production` 文件中的 `VITE_API_BASE_URL` 环境地址,然后使用 HBuilderX [发行]-[云打包] 即可。

+ 2 - 2
src/manifest.json

@@ -2,8 +2,8 @@
2 2
     "name" : "小葫芦",
3 3
     "appid" : "__UNI__6259019",
4 4
     "description" : "",
5
-    "versionName" : "1.0.1",
6
-    "versionCode" : 101,
5
+    "versionName" : "1.0.2",
6
+    "versionCode" : 102,
7 7
     "transformPx" : false,
8 8
     /* 5+App特有相关 */
9 9
     "app-plus" : {

+ 13 - 1
src/pages.json

@@ -11,7 +11,19 @@
11 11
 		{
12 12
 			"path": "pages/login/index",
13 13
 			"style": {
14
-				"navigationBarTitleText": "登录"
14
+				"navigationBarTitleText": "",
15
+				"enablePullDownRefresh": false,
16
+				"navigationBarBackgroundColor": "#108cff",
17
+				"navigationStyle": "custom"
18
+				
19
+			}
20
+		},
21
+		{
22
+			"path": "pages/privacy/index",
23
+			"style": {
24
+				"navigationBarTitleText": "隐私政策",
25
+				"enablePullDownRefresh": false,
26
+				"navigationStyle": "custom"
15 27
 			}
16 28
 		},
17 29
 		{

+ 186 - 73
src/pages/login/index.vue

@@ -1,88 +1,201 @@
1 1
 <template>
2
-  <view class="login-container">
3
-    <view class="login-form">
4
-      <up-form :model="form" ref="formRef" label-position="left">
5
-        <up-form-item label="用户名" prop="username" required :label-width="60">
6
-          <up-input v-model="form.username" placeholder="请输入用户名" />
7
-        </up-form-item>
8
-        <up-form-item label="密码" prop="password" required :label-width="60">
9
-          <up-input v-model="form.password" type="password" placeholder="请输入密码" />
10
-        </up-form-item>
11
-        <up-button type="primary" @click="handleLogin" :loading="loading" class="login-btn">
12
-          登录
13
-        </up-button>
14
-      </up-form>
15
-    </view>
16
-  </view>
2
+	<view>
3
+		<view class="loginway">
4
+			<div class="navigation"></div>
5
+			<image class="loginimg" mode="widthFix" src="/static/login/logo_word.png"></image>
6
+			<view class="input_wrap">
7
+				<up-form labelPosition="left" :model="form" :rules="rules" ref="loginFormRef">
8
+					<up-form-item label="" prop="username" class="inputFormWrap">
9
+						<up-input shape="circle" clearable prefixIcon="/static/login/icon-account.png"
10
+							:prefixIconStyle="prefixIconStyle" v-model="form.username" placeholder="请输入账号"></up-input>
11
+					</up-form-item>
12
+					<up-form-item label="" prop="password" class="inputFormWrap">
13
+						<up-input shape="circle" clearable password prefixIcon="/static/login/icon-password.png"
14
+							:prefixIconStyle="prefixIconStyle" v-model="form.password" placeholder="请输入密码"></up-input>
15
+					</up-form-item>
16
+					<up-form-item label="" prop="" class="inputFormWrap">
17
+						<up-checkbox-group v-model="checkboxs" placement="column" @change="changeRemember">
18
+							<up-checkbox :label="'记住密码'" :name="'remember'"></up-checkbox>
19
+						</up-checkbox-group>
20
+					</up-form-item>
21
+					<up-form-item label="" prop="agreePrivacy" class="inputFormWrap agree_form_item">
22
+						<view class="agree_row">
23
+							<up-checkbox-group v-model="agreePrivacyList" placement="row" @change="onAgreeChange">
24
+								<up-checkbox :name="'agree'"></up-checkbox>
25
+							</up-checkbox-group>
26
+							<text class="agree_text">我已阅读并同意</text>
27
+							<text class="agree_link" @click="toPrivacy">《隐私政策》</text>
28
+						</view>
29
+					</up-form-item>
30
+					<up-form-item>
31
+						<up-button type="primary" text="登录" shape="circle" :loading="loading" @click="handleLogin"></up-button>
32
+					</up-form-item>
33
+				</up-form>
34
+			</view>
35
+		</view>
36
+	</view>
17 37
 </template>
18
-
19 38
 <script setup lang="ts">
20
-import { ref } from 'vue'
39
+import { ref, onMounted } from 'vue'
21 40
 import { loginApi } from '@/apis/login'
22
-import type { Login_Params,userInfo_Result } from '@/types/login'
23
-const loading = ref(false)
24
-const formRef = ref()
41
+import type { Login_Params, userInfo_Result } from '@/types/login'
42
+import { computed } from 'vue'
43
+const remember = computed(() => {
44
+	return checkboxs.value.length > 0
45
+})
46
+const prefixIconStyle = {
47
+	width: "16px",
48
+	height: "16px",
49
+	marginRight: "4px",
50
+	marginLeft: "10px"
51
+}
52
+const rules = ref({
53
+	username: {
54
+		type: 'string',
55
+		required: true,
56
+		message: '请输入账号',
57
+		trigger: []
58
+	},
59
+	password: {
60
+		type: 'string',
61
+		required: true,
62
+		message: '请输入密码',
63
+		trigger: []
64
+	},
65
+	agreePrivacy: {
66
+		required: true,
67
+		message: '请阅读并同意《隐私政策》',
68
+		trigger: [],
69
+		validator: (rule: any, value: any, callback: any) => {
70
+			if(!value){
71
+				callback(new Error('请阅读并同意《隐私政策》'));
72
+			}else{
73
+				callback();
74
+			}
75
+		}
76
+	}
77
+})
25 78
 const form = ref<Login_Params>({
26
-  username: '',
27
-  password: '',
28
-  systemCode: "system_crm",
29
-  clientFlag: "2",
30
-  code: "996007qa.code",
31
-  uuid: "123",
32
-  agreePrivacy: false
79
+	username: '',
80
+	password: '',
81
+	systemCode: "system_crm",
82
+	clientFlag: "2",
83
+	code: "996007qa.code",
84
+	uuid: "123",
85
+	agreePrivacy: false
33 86
 })
87
+const checkboxs = ref<string[]>([])
88
+const agreePrivacyList = ref<string[]>([])
89
+const getUserByCache = () => {
90
+	const savedUsername = uni.getStorageSync('username');
91
+	const savedPassword = uni.getStorageSync('password');
34 92
 
35
-const handleLogin = async () => {
36
-  if (!form.value.username) {
37
-    uni.showToast({ title: '请输入用户名', icon: 'none' })
38
-    return
39
-  }
40
-  if (!form.value.password) {
41
-    uni.showToast({ title: '请输入密码', icon: 'none' })
42
-    return
43
-  }
44
-
45
-  loading.value = true
46
-  try {
47
-    const res = await loginApi.login(form.value)
48
-    uni.setStorageSync('token', res.data.access_token)
49
-    const infoRes = await loginApi.getInfo()
50
-    uni.setStorageSync('userInfo', infoRes.user)
51
-    uni.showToast({ title: '登录成功', icon: 'success' })
52
-    setTimeout(() => {
53
-      uni.reLaunch({ url: '/pages/repair/index' })
54
-    }, 1000)
55
-  } catch (error) {
56
-    console.error('登录失败', error)
57
-  } finally {
58
-    loading.value = false
59
-  }
93
+	if (savedUsername && savedPassword) {
94
+		form.value.username = savedUsername;
95
+		form.value.password = savedPassword;
96
+		checkboxs.value = ['remember']
97
+	}
98
+}
99
+const onAgreeChange = (list: string[]) => {
100
+	form.value.agreePrivacy = (list || []).indexOf('agree') >= 0;
60 101
 }
102
+const toPrivacy = () => {
103
+	uni.navigateTo({ url: '/pages/privacy/index' });
104
+}
105
+const changeRemember = (value: string[]) => {
106
+	if (value.length > 0) {
107
+		uni.setStorageSync('username', form.value.username);
108
+		uni.setStorageSync('password', form.value.password);
109
+	} else {
110
+		uni.removeStorageSync('username');
111
+		uni.removeStorageSync('password');
112
+	}
113
+}
114
+const loginFormRef = ref<any>(null)
115
+const loading = ref<boolean>(false)
116
+const handleLogin = () => {
117
+	loginFormRef.value.validate().then(async () => {
118
+		loading.value = true
119
+		if (remember.value) {
120
+			uni.setStorageSync('username', form.value.username);
121
+			uni.setStorageSync('password', form.value.password);
122
+		} else {
123
+			uni.removeStorageSync('username');
124
+			uni.removeStorageSync('password');
125
+		}
126
+		const res = await loginApi.login(form.value)
127
+		loading.value = false
128
+		uni.setStorageSync('token', res.data.access_token)
129
+		const infoRes = await loginApi.getInfo()
130
+		uni.setStorageSync('userInfo', infoRes.user)
131
+		uni.showToast({ title: '登录成功', icon: 'success' })
132
+		setTimeout(() => {
133
+			uni.reLaunch({ url: '/pages/repair/index' })
134
+		}, 500)
135
+	}).catch((res: any) => {
136
+		uni.$u.toast(res[0].message);
137
+	})
138
+}
139
+
140
+onMounted(() => {
141
+	getUserByCache();
142
+})
61 143
 </script>
62 144
 
63
-<style scoped>
64
-.login-container {
65
-  display: flex;
66
-  flex-direction: column;
67
-  align-items: center;
68
-  justify-content: center;
69
-  min-height: 100vh;
70
-  background-color: #f5f5f5;
71
-  padding: 0 30rpx;
145
+<style lang="scss" scoped>
146
+.inputFormWrap {
147
+	:deep(.u-border) {
148
+		border: 1px solid #dadbde !important;
149
+	}
72 150
 }
73 151
 
74
-.login-form {
75
-  width: 100%;
76
-  max-width: 500rpx;
77
-  background-color: #fff;
78
-  padding: 50rpx;
79
-  border-radius: 16rpx;
80
-  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
152
+.agree_form_item {
153
+	:deep(.u-form-item__body__right) {
154
+		flex: 1;
155
+	}
81 156
 }
82 157
 
83
-.login-btn {
84
-  width: 100%;
85
-  height: 80rpx;
86
-  margin-top: 40rpx;
158
+.agree_row {
159
+	display: flex;
160
+	align-items: center;
161
+	flex-wrap: wrap;
162
+}
163
+
164
+.agree_text {
165
+	font-size: 26rpx;
166
+	color: #606266;
167
+	margin-left: 8rpx;
168
+}
169
+
170
+.agree_link {
171
+	font-size: 26rpx;
172
+	color: #108cff;
173
+	margin-left: 4rpx;
174
+}
175
+
176
+page {
177
+	background: #fff;
178
+}
179
+
180
+.loginway {
181
+	display: flex;
182
+	flex-direction: column;
183
+	height: 100vh;
184
+
185
+	.navigation {
186
+		background-color: #108cff;
187
+		width: 100%;
188
+		height: 120rpx;
189
+	}
190
+
191
+	.loginimg {
192
+		display: block;
193
+		width: 100%;
194
+		height: 100%;
195
+	}
196
+
197
+	.input_wrap {
198
+		padding: 20rpx 30rpx;
199
+	}
87 200
 }
88
-</style>
201
+</style>

+ 128 - 0
src/pages/privacy/index.vue

@@ -0,0 +1,128 @@
1
+<template>
2
+	<view class="privacy_wrap">
3
+		<up-navbar title="隐私政策" :autoBack="true" :placeholder="true" v-hideNav></up-navbar>
4
+		<scroll-view scroll-y class="privacy_content">
5
+			<view class="privacy_body">
6
+				<!-- 一、隐私政策导言 -->
7
+				<view class="section">
8
+					<text class="section_title">一、隐私政策导言</text>
9
+					<text class="section_text">本应用由【小葫芦(深圳)互联网有限公司】(以下简称“我们”)运营。</text>
10
+					<text class="section_text">本隐私政策适用于【小葫芦CRM系统】及其相关客户端、网页、小程序等全部产品与服务。请您在使用我们的产品与服务前仔细阅读并理解本政策。</text>
11
+				</view>
12
+				<!-- 二、我们如何收集和使用您的个人信息 -->
13
+				<view class="section">
14
+					<text class="section_title">二、我们如何收集和使用您的个人信息</text>
15
+					<text class="section_text">我们仅会出于以下目的、在对应业务功能中收集以下类型的个人信息,且以下类型中标注为“必需”的为特定业务功能所必需,未提供将无法使用该功能。</text>
16
+					<text class="section_text p">1. 账号注册与登录:收集您的手机号码、账号名称、密码(加密存储),用于创建账号与身份验证。其中手机号码、密码为必需。</text>
17
+					<text class="section_text p">2. 客户关系管理及业务跟进:收集您的姓名、电话号码、工作单位/公司名称、职位、电子邮箱、沟通记录,用于线索管理、跟进记录与合同/订单相关服务。其中姓名、电话号码为开展上述业务所必需。</text>
18
+					<text class="section_text p">3. 设备与日志信息:收集设备型号、操作系统版本、唯一设备标识符、IP 地址、应用内操作日志,用于保障账号安全、排查故障与改进服务。此类信息为服务安全与运行所必需。</text>
19
+					<text class="section_text p">【若收集身份证、护照、驾照等法定证件或个人生物识别信息】我们会在收集前单独提醒您此次收集涉及的信息类型,并明确说明处理目的与规则,仅在您同意后收集。</text>
20
+					<text class="section_text p">个人信息涉及的地理区域:我们将在中华人民共和国境内对您的个人信息进行存储与备份;如存在跨境传输,我们会单独列出并取得您的同意。</text>
21
+					<text class="section_text p">保留期限:账号存续期间我们持续保留为提供服务所必需的信息;日志类信息保留【1】年;【其他类型请按实际填写】。您注销账号后,我们将在【30】日内删除或匿名化您的个人信息。若确需改变收集与使用的目的,我们会再次征得您的同意。</text>
22
+				</view>
23
+				<!-- 三、我们如何使用 Cookie 和同类技术 -->
24
+				<!-- <view class="section">
25
+					<text class="section_title">三、我们如何使用 Cookie 和同类技术</text>
26
+					<text class="section_text">我们及授权第三方可能使用 Cookie、本地存储器、脚本、Web 信标等自动数据收集工具,用于登录状态保持、安全验证、统计与优化体验。</text>
27
+					<text class="section_text p">您可通过浏览器或设备设置限制、清除 Cookie 及本地存储,或通过应用内“隐私设置”关闭部分非必需收集。具体操作路径:【请根据实际产品补充,如:设置-隐私-清除缓存/关闭统计】。关闭后可能影响部分功能使用。</text>
28
+				</view> -->
29
+				<!-- 四、我们如何共享、转让、公开披露用户的个人信息 -->
30
+				<view class="section">
31
+					<text class="section_title">四、我们如何共享、转让、公开披露您的个人信息</text>
32
+					<text class="section_text">共享与转让:我们不会与第三方共享或转让您的个人信息,除非(1)事先获得您的同意;(2)根据法律法规或政府、司法机关要求;(3)与我们的关联公司、授权服务商共享(如云存储、客服系统),且我们仅会共享业务所必需的信息,并通过协议约束其保护义务与使用目的。</text>
33
+					<text class="section_text p">公开披露:我们不会公开披露您的个人信息,除非获得您的明确同意或基于法律强制要求。若因法律要求需披露,我们会尽可能提前告知并限定披露范围。</text>
34
+					<text class="section_text p">未经您同意的例外情形:响应执法机关、政府机构依法提出的要求;进行个人信息安全审计;为保护您或他人人身、财产安全所必需等法律法规规定的情形。</text>
35
+					<!-- <text class="section_text p">【若为平台类服务】您在上传、交流、发布信息时,可能被其他用户或第三方看到。请谨慎发布敏感信息,我们会对平台内信息采取【请填写具体安全措施】以降低风险。</text> -->
36
+				</view>
37
+				<!-- 五、我们如何保护您的信息 -->
38
+				<view class="section">
39
+					<text class="section_title">五、我们如何保护您的信息</text>
40
+					<text class="section_text">我们采取数据加密、访问控制、安全审计、权限最小化等技术与管理措施保护您的个人信息,对传输与存储环节进行加密,并建立保留与删除机制。</text>
41
+					<text class="section_text p">我们遵循《中华人民共和国个人信息保护法》等国内相关法律法规。</text>
42
+					<text class="section_text p">请您妥善保管账号与密码,勿向他人泄露。提供个人信息即表示您知悉可能存在被非法获取、篡改或泄露的风险,我们将尽力降低该风险。若发生个人信息安全事件,我们将依法承担相应责任,并会及时通过应用内通知、短信等方式告知您事件概况与应对建议。</text>
43
+				</view>
44
+				<!-- 六、信息的存储 -->
45
+				<view class="section">
46
+					<text class="section_title">六、信息的存储</text>
47
+					<text class="section_text">您的个人信息将存储在中华人民共和国境内。存储期限见本政策第二条“保留期限”部分。法律法规另有要求或您另行同意的,从其规定。</text>
48
+				</view>
49
+				<!-- 七、您如何管理个人信息 -->
50
+				<view class="section">
51
+					<text class="section_title">七、您如何管理您的个人信息(用户权利)</text>
52
+					<text class="section_text">您享有以下权利:查询、更正、补充您的个人信息;删除您的个人信息(法律法规另有规定的除外);撤回同意;注销账号;获取您的个人信息副本等。</text>
53
+					<text class="section_text p">操作方式:您可通过【应用内“我的”-“账号与安全”/“隐私设置”】进行访问、更正、删除及撤回同意;注销账号可通过【请填写具体路径,如:设置-账号与安全-注销账号】或联系客服办理。</text>
54
+					<text class="section_text p">我们将在收到您请求后【30】个工作日内响应;如需较长时间,我们会告知原因与预计时间。如需验证身份,我们会通过【电话】进行验证并采取措施保护验证过程中的信息安全。若我们拒绝您的请求,会说明理由与依据。</text>
55
+				</view>
56
+				<!-- 八、未成年人保护 -->
57
+				<view class="section">
58
+					<text class="section_title">八、未成年人保护</text>
59
+					<text class="section_text">本应用【年龄分级:18+】。若用户为未成年人,我们会在收集其个人信息前取得监护人同意,并仅在不违反法律法规的前提下收集必要信息。监护人有权查阅、更正、删除未成年人个人信息。若发现我们在未获监护人同意的情况下收集了未成年人信息,请通过本政策第九条联系方式告知我们,我们将尽快删除。</text>
60
+				</view>
61
+				<!-- 九、如何联系我们 -->
62
+				<view class="section">
63
+					<text class="section_title">九、如何联系我们</text>
64
+					<text class="section_text">如您对个人信息处理有疑问、投诉或建议,请联系:</text>
65
+					<!-- <text class="section_text p">个人信息安全责任部门:【请填写部门名称】</text> -->
66
+					<text class="section_text p">联系地址:江苏省南京市江宁区天元东路228号莱茵量子国际</text>
67
+					<!-- <text class="section_text p">电子邮箱:【请填写邮箱】</text> -->
68
+					<text class="section_text p">客服/反馈渠道:13268211521</text>
69
+					<text class="section_text p">我们将在收到反馈后【30】个工作日内回复。</text>
70
+					<!-- <text class="section_text p">若无法协商解决争议,您可向【运营主体】所在地有管辖权的法院提起诉讼,或联系【行业自律协会/政府相关管理机构等,请按实际填写】寻求解决。</text> -->
71
+				</view>
72
+				<!-- 十、隐私政策变更 -->
73
+				<view class="section">
74
+					<text class="section_title">十、隐私政策变更</text>
75
+					<text class="section_text">我们可能适时修订本隐私政策。重大变更时,我们将通过应用内弹窗、推送通知、登录页提示、短信或邮件等方式及时告知您,并再次征得同意(法律法规另有规定除外)。请您定期查阅本页最新版本。若您继续使用我们的服务,即表示接受更新后的政策。</text>
76
+				</view>
77
+			</view>
78
+		</scroll-view>
79
+	</view>
80
+</template>
81
+
82
+<script>
83
+	export default {
84
+		data() {
85
+			return {};
86
+		}
87
+	};
88
+</script>
89
+
90
+<style lang="scss" scoped>
91
+	.privacy_wrap {
92
+		min-height: 100vh;
93
+		background: #fff;
94
+		display: flex;
95
+		flex-direction: column;
96
+	}
97
+
98
+	.privacy_content {
99
+		flex: 1;
100
+		height: calc(100vh - 44px);
101
+	}
102
+
103
+	.privacy_body {
104
+		padding: 24rpx 30rpx 60rpx;
105
+	}
106
+
107
+	.section {
108
+		margin-bottom: 32rpx;
109
+	}
110
+
111
+	.section_title {
112
+		display: block;
113
+		font-size: 30rpx;
114
+		font-weight: 600;
115
+		color: #303133;
116
+		margin-bottom: 16rpx;
117
+	}
118
+
119
+	.section_text {
120
+		display: block;
121
+		font-size: 28rpx;
122
+		color: #606266;
123
+		line-height: 1.6;
124
+	}
125
+	.section_text.p {
126
+		margin-top: 12rpx;
127
+	}
128
+</style>

+ 64 - 11
src/pages/repair/components/charts/line.vue

@@ -1,16 +1,59 @@
1 1
 <template>
2 2
     <view class="chart-box">
3
-        <ucharts type="map" :chartData="chartData" :opts="opts" />
3
+        <ucharts type="area" :chartData="chartData" :opts="opts" />
4 4
     </view>
5 5
 </template>
6 6
 
7 7
 <script setup lang="ts">
8 8
 import { ref, watch } from 'vue';
9
-import { onShow,onReady } from '@dcloudio/uni-app';
9
+import { onShow } from '@dcloudio/uni-app';
10 10
 import ucharts from 'ch-ucharts'
11
+const props = defineProps({
12
+    data: {
13
+        type: Object,
14
+        default: () => ({
15
+            categories: [
16
+                '2000',
17
+                '2001',
18
+                '2002',
19
+                '2003',
20
+                '2004',
21
+                '2005',
22
+                '2006',
23
+                '2007',
24
+                '2008',
25
+                '2009',
26
+                '2010',
27
+                '2011',
28
+                '2012',
29
+                '2013',
30
+                '2014',
31
+                '2015',
32
+                '2016',
33
+                '2017',
34
+                '2018',
35
+                '2019',
36
+                '2020',
37
+            ],
38
+            series: [
39
+                {
40
+                    name: '',
41
+                    data: [
42
+                        35, 8, 25, 37, 4, 20, 35, 8, 25, 37, 4, 20, 35, 8, 25, 37, 4, 20,
43
+                        11, 20, 15,
44
+                    ],
45
+                },
46
+            ],
47
+        }),
48
+    },
49
+    showLegend: {
50
+        type: Boolean,
51
+        default: false,
52
+    },
53
+})
11 54
 const opts = {
12 55
     color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"],
13
-    padding: [0, 0, 0, 0],
56
+    padding: [10, 0, 0, 0],
14 57
     dataLabel: true,
15 58
     enableScroll: false,
16 59
     extra: {
@@ -25,16 +68,26 @@ const opts = {
25 68
         }
26 69
     }
27 70
 }
28
-const chartData = ref({})
29
-const getServerData = () => {
30
-}
31
-onReady(()=>{
32
-    getServerData();
33
-})
34
-  
71
+
72
+
73
+const chartData = ref(JSON.parse(JSON.stringify(props.data)))
74
+
75
+// 监听数据变化从而更新图形
76
+watch(
77
+    () => props.data,
78
+    (val) => {
79
+        chartData.value = JSON.parse(JSON.stringify(val))
80
+    },
81
+    {
82
+        immediate: true,
83
+        deep: true,
84
+    },
85
+)
86
+
35 87
 onShow(() => {
88
+    // 屏幕尺寸变化时更新数据重绘图形
36 89
     const windowResizeCallback = () => {
37
-        chartData.value = JSON.parse(JSON.stringify(chartData.value))
90
+        chartData.value = JSON.parse(JSON.stringify(props.data))
38 91
     };
39 92
     uni.onWindowResize(windowResizeCallback);
40 93
 })

+ 11 - 3
src/pages/repair/index.vue

@@ -44,11 +44,13 @@
44 44
         </view>
45 45
       </view>
46 46
     </view>
47
-    <!-- 退出登录按钮 -->
48
-    <up-button type="primary" @click="handleLogout">退出登录</up-button>
49 47
     <!-- 图表组件 -->
50 48
     <view class="chart-container">
51
-      <!-- <LineChart /> -->
49
+      <LineChart />
50
+    </view>
51
+    <!-- 退出登录按钮 -->
52
+    <view class="logout-btn-wrap">
53
+      <up-button type="primary" @click="handleLogout">退出登录</up-button>
52 54
     </view>
53 55
   </view>
54 56
 </template>
@@ -251,4 +253,10 @@ const handleLogout = () => {
251 253
 .chart-container {
252 254
   padding: 32rpx;
253 255
 }
256
+.logout-btn-wrap{
257
+  .u-button{
258
+    width: 200rpx;
259
+    margin-top: 32rpx;
260
+  }
261
+}
254 262
 </style>

BIN
src/static/login/icon-account.png


BIN
src/static/login/icon-password.png


BIN
src/static/login/logo_word.png


+ 7 - 0
vite.config.ts

@@ -24,6 +24,13 @@ const viteConfig: UserConfig = {
24 24
     host: '0.0.0.0',
25 25
     port: 5173,
26 26
   },
27
+  css: {
28
+    preprocessorOptions: {
29
+      scss: {
30
+        quietDeps: false // 忽略scss 的@import废弃 警告
31
+      }
32
+    }
33
+  }
27 34
 };
28 35
 
29 36
 export default defineConfig(viteConfig);