From 67c26f9f772a80b59a8ae6941109db53297b5125 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 3 Apr 2025 18:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=BF=9D=E7=AB=A0=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8E=A5=E5=8F=A3=E8=B0=83=E8=AF=95=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/manifest.json | 5 +- .../coordinatePhotos/upload-record/index.vue | 7 +- src/pages/login/index.vue | 61 ++- .../components/addAndEditForm.vue | 374 +++++++++++++----- src/services/common.js | 29 ++ src/services/safetyViolations.js | 13 + src/utils/http.js | 6 +- vite.config.js | 3 +- 8 files changed, 352 insertions(+), 146 deletions(-) create mode 100644 src/services/common.js create mode 100644 src/services/safetyViolations.js diff --git a/src/manifest.json b/src/manifest.json index 3572b42..f399b91 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -20,7 +20,10 @@ "delay" : 0 }, /* 模块配置 */ - "modules" : {}, + "modules" : { + "Barcode" : {}, + "Camera" : {} + }, /* 应用发布信息 */ "distribute" : { /* android打包配置 */ diff --git a/src/pages/coordinatePhotos/upload-record/index.vue b/src/pages/coordinatePhotos/upload-record/index.vue index ecd0aab..d29100a 100644 --- a/src/pages/coordinatePhotos/upload-record/index.vue +++ b/src/pages/coordinatePhotos/upload-record/index.vue @@ -44,7 +44,7 @@ - + - + - + { .swiper-container { position: relative; + margin-bottom: 14rpx; .swiper-count { position: absolute; diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 9fab019..6a23f7b 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -117,39 +117,34 @@ const onSubmitLogin = debounce(() => { .validate() .then(async (valid) => { if (valid) { - uni.$u.toast('登录成功') - sendLoading.value = false - setTimeout(() => { - uni.switchTab({ url: '/pages/workbenches/index' }) - }, 500) - // try { - // console.log( - // '%c🔍 登录请求入参 %c', - // 'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;', - // '', - // opinionModel.value, - // ) - // const res = await loginApi(opinionModel.value) - // console.log( - // '%c🔍 登录请求出参 %c', - // 'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;', - // '', - // res, - // ) - // sendLoading.value = false - // if (res.code === 200) { - // memberStore.setToken(res.token) - // uni.$u.toast('登录成功') - // getUserInfo() - // setTimeout(() => { - // uni.switchTab({ url: '/pages/workbenches/index' }) - // }, 500) - // } else { - // uni.$u.toast('登录失败' + res.message) - // } - // } catch (error) { - // sendLoading.value = false - // } + try { + console.log( + '%c🔍 登录请求入参 %c', + 'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;', + '', + opinionModel.value, + ) + const res = await loginApi(opinionModel.value) + console.log( + '%c🔍 登录请求出参 %c', + 'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;', + '', + res, + ) + sendLoading.value = false + if (res.code === 200) { + memberStore.setToken(res.token) + uni.$u.toast('登录成功') + getUserInfo() + setTimeout(() => { + uni.switchTab({ url: '/pages/workbenches/index' }) + }, 500) + } else { + uni.$u.toast('登录失败' + res.message) + } + } catch (error) { + sendLoading.value = false + } } }) .catch(() => { diff --git a/src/pages/safetyViolations/components/addAndEditForm.vue b/src/pages/safetyViolations/components/addAndEditForm.vue index 0518260..2590a3c 100644 --- a/src/pages/safetyViolations/components/addAndEditForm.vue +++ b/src/pages/safetyViolations/components/addAndEditForm.vue @@ -10,23 +10,23 @@ style="background-color: #fff; padding: 0 30rpx 20rpx" > - + - + - +