From f7f48a03fe4ef6c9e36c01198b58f20fce819343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Tue, 25 Mar 2025 15:00:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=A7=81=E5=9F=9F=E6=93=8D=E7=9B=98?= =?UTF-8?q?=E6=89=8B=E3=80=91=20=E6=93=8D=E7=9B=98=E6=89=8B=E7=AB=AFUI=20-?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cunkebao/components/CustomTabBar.vue | 10 +- Cunkebao/components/LineChart.vue | 4 +- Cunkebao/components/TabBar.vue | 10 +- Cunkebao/pages/device/index.vue | 188 +++++++++++++++++++++- Cunkebao/pages/index/index.vue | 12 +- Cunkebao/pages/login/index.vue | 145 ++++++++++++++--- Cunkebao/pages/scenarios/detail.vue | 30 +++- Cunkebao/pages/scenarios/index.vue | 10 ++ Cunkebao/static/images/qr-placeholder.png | 1 + Cunkebao/static/images/qr-placeholder.svg | 26 +++ 10 files changed, 393 insertions(+), 43 deletions(-) create mode 100644 Cunkebao/static/images/qr-placeholder.png create mode 100644 Cunkebao/static/images/qr-placeholder.svg diff --git a/Cunkebao/components/CustomTabBar.vue b/Cunkebao/components/CustomTabBar.vue index f411b767..0ea6807f 100644 --- a/Cunkebao/components/CustomTabBar.vue +++ b/Cunkebao/components/CustomTabBar.vue @@ -5,7 +5,7 @@ :class="{ active: active === 'home' }" @click="switchTab('/pages/index/index', 'home')" > - + 首页 @@ -14,7 +14,7 @@ :class="{ active: active === 'market' }" @click="switchTab('/pages/scenarios/index', 'market')" > - + 场景获客 @@ -23,7 +23,7 @@ :class="{ active: active === 'work' }" @click="switchTab('/pages/work/index', 'work')" > - + 工作台 @@ -32,7 +32,7 @@ :class="{ active: active === 'profile' }" @click="switchTab('/pages/profile/index', 'profile')" > - + 我的 @@ -83,7 +83,7 @@ export default { .tab-text { font-size: 26rpx; - color: #999; + color: #777; &.active-text { color: #4080ff; diff --git a/Cunkebao/components/LineChart.vue b/Cunkebao/components/LineChart.vue index af7a2789..d40afa7b 100644 --- a/Cunkebao/components/LineChart.vue +++ b/Cunkebao/components/LineChart.vue @@ -135,7 +135,7 @@ export default { .axis-label { font-size: 22rpx; - color: #999; + color: #777; text-align: right; padding-right: 10rpx; } @@ -244,7 +244,7 @@ export default { position: absolute; transform: translateX(-50%); font-size: 22rpx; - color: #999; + color: #777; text-align: center; top: 10rpx; } diff --git a/Cunkebao/components/TabBar.vue b/Cunkebao/components/TabBar.vue index 79ab6229..b8f6d3d1 100644 --- a/Cunkebao/components/TabBar.vue +++ b/Cunkebao/components/TabBar.vue @@ -5,7 +5,7 @@ :class="{ active: active === 'home' }" @click="switchTab('/pages/index/index', 'home')" > - + 首页 @@ -14,7 +14,7 @@ :class="{ active: active === 'market' }" @click="switchTab('/pages/scenarios/index', 'market')" > - + 场景获客 @@ -23,7 +23,7 @@ :class="{ active: active === 'work' }" @click="switchTab('/pages/index/index', 'work')" > - + 工作台 @@ -32,7 +32,7 @@ :class="{ active: active === 'profile' }" @click="switchTab('/pages/profile/index', 'profile')" > - + 我的 @@ -84,7 +84,7 @@ export default { .tab-text { font-size: 26rpx; - color: #999; + color: #777; margin-top: 10rpx; &.active-text { diff --git a/Cunkebao/pages/device/index.vue b/Cunkebao/pages/device/index.vue index bd2f5446..a5abf574 100644 --- a/Cunkebao/pages/device/index.vue +++ b/Cunkebao/pages/device/index.vue @@ -157,6 +157,39 @@ title="选择状态" > + + + + + + 添加设备 + + × + + + + + + + 请使用设备扫描二维码进行添加 + 或手动输入设备ID + + + + + + 取消 + 确认添加 + + + + @@ -183,7 +216,10 @@ export default { { text: '在线', value: 'online' }, { text: '离线', value: 'offline' } ], - currentStatus: 'all' + currentStatus: 'all', + // 添加设备相关数据 + showAddDeviceModal: false, + deviceId: '' } }, computed: { @@ -203,10 +239,37 @@ export default { // 添加设备 addDevice() { - uni.showToast({ - title: '添加设备功能待实现', - icon: 'none' + this.showAddDeviceModal = true; + }, + + // 取消添加设备 + cancelAddDevice() { + this.showAddDeviceModal = false; + this.deviceId = ''; + }, + + // 确认添加设备 + confirmAddDevice() { + if (!this.deviceId.trim()) { + uni.showToast({ + title: '请输入设备ID', + icon: 'none' + }); + return; + } + + uni.showLoading({ + title: '添加中' }); + + setTimeout(() => { + uni.hideLoading(); + uni.showToast({ + title: '添加成功', + icon: 'success' + }); + this.cancelAddDevice(); + }, 1500); }, // 刷新列表 @@ -375,7 +438,7 @@ export default { border-radius: 35rpx; padding: 30rpx; margin: 15rpx; - box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); .stat-label { font-size: 28rpx; @@ -404,6 +467,7 @@ export default { border-radius: 35rpx; overflow: hidden; border: 2rpx solid #e9e9e9; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); } .search-bar { @@ -498,6 +562,7 @@ export default { margin: 25rpx; border-radius: 20rpx; border: 2rpx solid #e9e9e9; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); &:last-child { border-bottom: none; @@ -555,4 +620,117 @@ export default { } } } + +/* 添加设备弹窗样式 */ +.add-device-modal { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + + .modal-mask { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + } + + .modal-content { + position: relative; + width: 650rpx; + background-color: #fff; + border-radius: 20rpx; + overflow: hidden; + box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1); + + .modal-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx 40rpx; + + .modal-title { + font-size: 36rpx; + font-weight: bold; + color: #333; + } + + .modal-close { + padding: 10rpx; + + .close-icon { + font-size: 44rpx; + color: #777; + line-height: 1; + } + } + } + + .modal-body { + padding: 0rpx 40rpx; + padding-bottom: 30rpx; + + .qr-container { + width: 450rpx; + height: 450rpx; + margin: 0 auto 30rpx; + background-color: #f5f5f5; + display: flex; + align-items: center; + justify-content: center; + border-radius: 10rpx; + + .qr-image { + width: 400rpx; + height: 400rpx; + } + } + + .qr-hint { + text-align: center; + color: #666; + font-size: 28rpx; + } + + .device-id-input { + margin-top: 40rpx; + } + } + + .modal-actions { + display: flex; + justify-content: center; + padding: 20rpx 40rpx 40rpx; + + .cancel-btn, .confirm-btn { + width: 180rpx; + height: 80rpx; + border-radius: 25rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + margin: 0 15rpx; + } + + .cancel-btn { + background-color: #ffffff; + color: #333; + border: 1px solid #e5e5e5; + } + + .confirm-btn { + background-color: #4080ff; + color: #fff; + } + } + } +} \ No newline at end of file diff --git a/Cunkebao/pages/index/index.vue b/Cunkebao/pages/index/index.vue index cbff92fe..bb2e27b5 100644 --- a/Cunkebao/pages/index/index.vue +++ b/Cunkebao/pages/index/index.vue @@ -323,7 +323,7 @@ export default { .stat-label { font-size: 24rpx; - color: #999; + color: #777; } } } @@ -339,4 +339,14 @@ export default { height: 100%; } } + +.tab-text { + font-size: 26rpx; + color: #777; + margin-top: 10rpx; + + &.active-text { + color: #4080ff; + } +} \ No newline at end of file diff --git a/Cunkebao/pages/login/index.vue b/Cunkebao/pages/login/index.vue index f82b1504..0b309fee 100644 --- a/Cunkebao/pages/login/index.vue +++ b/Cunkebao/pages/login/index.vue @@ -3,7 +3,7 @@ - + - + - + placement="column" + @change="checkboxChange" + > + + 已阅读并同意 用户协议 @@ -95,7 +103,7 @@ text="登录" type="primary" @click="handleLogin" - customStyle="width: 100%; margin-top: 40rpx; height: 96rpx; border-radius: 24rpx; font-size: 70rpx;" + customStyle="width: 100%; margin-top: 40rpx; height: 96rpx; border-radius: 24rpx; font-size: 32rpx; font-weight: 500;" > @@ -131,8 +139,8 @@ export default { data() { return { tabsList: [ - { name: '验证码登录' }, - { name: '密码登录' } + { text: '验证码登录', name: '验证码登录', id: 0 }, + { text: '密码登录', name: '密码登录', id: 1 } ], current: 0, form: { @@ -146,18 +154,34 @@ export default { codeTips: '发送验证码' } }, + onLoad() { + // 确保初始状态下表单字段正确 + this.current = 0; + this.form.password = ''; + }, computed: { isValidMobile() { return /^1\d{10}$/.test(this.form.mobile) }, canLogin() { if (!this.isAgree || !this.isValidMobile) return false - return this.current === 0 ? !!this.form.code : !!this.form.password + return this.current == 0 ? !!this.form.code : !!this.form.password } }, methods: { + checkboxChange(value) { + console.log('checkboxChange', value) + }, handleTabChange(index) { - this.current = index + this.current = Number(index.index); + // 清除不相关的表单字段 + if (this.current == 0) { + this.form.password = ''; + } else { + this.form.code = ''; + } + // 确保密码输入框的可见状态正确重置 + this.showPassword = false; }, getCode() { if (this.sending || !this.isValidMobile) return @@ -175,17 +199,96 @@ export default { }, 1000) }, handleLogin() { - if (!this.canLogin) return - uni.showToast({ - title: '登录成功', - icon: 'success' + if (!this.canLogin) { + if (!this.isAgree) { + uni.showToast({ + title: '请先同意用户协议和隐私政策', + icon: 'none' + }) + return + } + if (!this.isValidMobile) { + uni.showToast({ + title: '请输入有效的手机号', + icon: 'none' + }) + return + } + if (this.current == 0 && !this.form.code) { + uni.showToast({ + title: '请输入验证码', + icon: 'none' + }) + return + } + if (this.current == 1 && !this.form.password) { + uni.showToast({ + title: '请输入密码', + icon: 'none' + }) + return + } + return + } + + // 显示加载中 + uni.showLoading({ + title: '登录中...', + mask: true }) + + // 模拟登录成功 + setTimeout(() => { + // 隐藏加载提示 + uni.hideLoading() + + // 保存登录状态和用户信息 + uni.setStorageSync('token', 'mock_token_' + Date.now()) + uni.setStorageSync('userInfo', { + mobile: this.form.mobile, + loginTime: Date.now() + }) + + // 显示登录成功提示 + uni.showToast({ + title: '登录成功', + icon: 'success', + duration: 1500 + }) + + // 延迟跳转到首页 + setTimeout(() => { + uni.reLaunch({ + url: '/pages/index/index', + success: () => { + console.log('跳转到首页成功') + }, + fail: (err) => { + console.error('跳转失败:', err) + uni.showToast({ + title: '跳转失败,请重试', + icon: 'none' + }) + } + }) + }, 1500) + }, 1000) }, handleWechatLogin() { console.log('微信登录') + // 仅模拟 + uni.showToast({ + title: '微信登录', + icon: 'none' + }) }, handleAppleLogin() { console.log('Apple登录') + // 仅模拟 + uni.showToast({ + title: 'Apple登录', + icon: 'none' + }) }, goToUserAgreement() { uni.navigateTo({ @@ -266,7 +369,7 @@ export default { .agreement-text { font-size: 28rpx; - color: #999999; + color: #777777; margin-left: 12rpx; } @@ -288,7 +391,7 @@ export default { } .text { - color: #999999; + color: #777777; padding: 0 30rpx; font-size: 28rpx; } @@ -331,8 +434,8 @@ export default { .contact-us { text-align: center; - font-size: 28rpx; - color: #999999; + font-size: 26rpx; + color: #777777; margin-top: 60rpx; padding-bottom: 40rpx; } diff --git a/Cunkebao/pages/scenarios/detail.vue b/Cunkebao/pages/scenarios/detail.vue index 969435d9..14c8f235 100644 --- a/Cunkebao/pages/scenarios/detail.vue +++ b/Cunkebao/pages/scenarios/detail.vue @@ -329,7 +329,7 @@ export default { .channel-desc { font-size: 28rpx; - color: #999; + color: #777; } } } @@ -351,7 +351,7 @@ export default { .data-label { font-size: 28rpx; - color: #999; + color: #777; } } } @@ -467,7 +467,7 @@ export default { .customer-time { font-size: 24rpx; - color: #999; + color: #777; } } } @@ -475,8 +475,30 @@ export default { .empty-tip { text-align: center; padding: 40rpx 0; - color: #999; + color: #777; font-size: 28rpx; } } + +.progress-label { + font-size: 24rpx; + color: #777; + margin-bottom: 10rpx; +} + +.stat-label { + font-size: 24rpx; + color: #777; +} + +.timeline-time { + font-size: 24rpx; + color: #777; + margin-bottom: 8rpx; +} + +.timeline-meta { + font-size: 22rpx; + color: #777; +} \ No newline at end of file diff --git a/Cunkebao/pages/scenarios/index.vue b/Cunkebao/pages/scenarios/index.vue index 7eb63cce..562f1fd9 100644 --- a/Cunkebao/pages/scenarios/index.vue +++ b/Cunkebao/pages/scenarios/index.vue @@ -499,4 +499,14 @@ export default { margin-left: 20rpx; } } + +.tab-text { + font-size: 26rpx; + color: #777; + margin-top: 10rpx; + + &.active-text { + color: #4080ff; + } +} \ No newline at end of file diff --git a/Cunkebao/static/images/qr-placeholder.png b/Cunkebao/static/images/qr-placeholder.png new file mode 100644 index 00000000..c5addfaf --- /dev/null +++ b/Cunkebao/static/images/qr-placeholder.png @@ -0,0 +1 @@ +data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEwAACxMBAJqcGAAABX5JREFUeJzt3U2IXGUUxvH/TCYkThLTqMVCoV0oBBcuChVcuHIjCFZw6c6NQlwLQkHowoUiQhcKRRDBlRsRioguBUEEQRAERRQEKX5UxdTYJE0nXw7cQrFkct+Ze+55vw/MMwi995znndOmEySYSAiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiItKcfusF7GQQbAGHgTuBW4BDwE3AQeAGYA1YBxaBzcnX34EfgfPAD8AZ4DRwGthMXbzsyRRxMBxVewOeBA4D9wMP1X7wGXwDfAF8DnwInPNdTnscTEcTHG5p2qzaG/AccBQ40mQJue0A7wEfAO8C59zWUZuD8WiCwy1NO1Z7A14AngWmm/rQAv4F3gWOAx97LybC3XnN8TiyuOVpZ2rvxEvARjMf1MZOACeJf3Gr9ZOcgyMh/+SWp52qvRNHgdm6H9CQ7YELwDHgdde1Tbg0Vo7Qd0vuNdTejbeBtxr4jFacAr4HxsDXzBOArdaGzwDTwNXAdcDVwF3A/cC9+T+iGR8DLwLfuq4s4mTIx6WxcoS+W3KvoXbxbwMn6Z6vgVeAj1zXdal2oXYf8SQbE5/k61x4B3gd+Ml1ZREeJ8dEd0vuNdQu/qPAdt0PcbYDvA8cxvX1yiWahdpV3A28OvnfMfBZrkdP2CY+uX/uuqqIZyO+xnx3S+4n1I72AJ9W/QBHm8TX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eaOwyqll7MkCuI67vT3GFQtfRihlxBXN+d5g6DqqUXM+QK4vruNHcYVC29mKG/AO0MF6TIrRxLAAAAAElFTkSuQmCC \ No newline at end of file diff --git a/Cunkebao/static/images/qr-placeholder.svg b/Cunkebao/static/images/qr-placeholder.svg new file mode 100644 index 00000000..fce4440c --- /dev/null +++ b/Cunkebao/static/images/qr-placeholder.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file