1
0
forked from dyf/APP

公用模块放common

This commit is contained in:
微微一笑
2025-07-07 09:21:39 +08:00
parent 60ad9ac123
commit 2e6ee192c5
14 changed files with 1004 additions and 776 deletions

View File

@ -0,0 +1,25 @@
<template>
<view class="device-page">
<view class="deviceTitle">欢迎你使用我们的产品和服务!本用户协议(以下简称协议)由你(以下简称用户)[公司名称](以下简称我们本公司)就使用[产品名称]的相关事宜共同订立
欢迎你使用我们的产品和服务!本用户协议(以下简称协议)由你(以下简称用户)[公司名称](以下简称我们本公司)就使用[产品名称]的相关事宜共同订立</view>
</view>
</template>
<script>
</script>
<style scoped>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.deviceTitle{
color: rgba(255, 255, 255, 0.87);
line-height: 45mnrpx;
font-size: 28rpx;
}
</style>

View File

@ -0,0 +1,408 @@
<template>
<view>
<!-- 使用自定义导航栏 -->
<custom-navbar :title="navTitle" :showBack="false" backgroundColor="#202020" color="#FFFFFF" right-text="发送信息"
right-color="rgba(255, 255, 255, 0.87)" @right-click="handleSend"></custom-navbar>
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
<scroll-view class="device-list" scroll-y>
<uni-swipe-action ref="swipeAction">
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
<uni-swipe-action-item :right-options="Options" @click="handleSwipeClick($event, item, index)"
class="device-card">
<!-- 设备卡片内容保持不变 -->
<view @click.stop="handleFile(item)">
<view class="device-header">
<view class="deviceIMG">
<image src="/static/images/device.png" mode="" class="IMG"></image>
</view>
<view class="device-name">
<view>设备:001-00</view>
<view class="ID">ID:0222222</view>
</view>
</view>
<view class="device-status online">已连接</view>
<view class="device-info">
<text class="onlines">在线</text>
<text class="line"></text>
<text>电量90%</text>
</view>
</view>
<image src="/static/images/cires.png" class="circle"></image>
</uni-swipe-action-item>
</block>
</uni-swipe-action>
<view class="device-uplod" @click="scan">
<uni-icons type="plusempty" size="60" color="rgba(255, 255, 255, 0.5)"></uni-icons>
</view>
</scroll-view>
</view>
<!-- 删除弹框 -->
<view class="agreement-mask" v-if="deleteShow">
<view class="agreement-popupC">
<view class="popup-content">
<image src="/static/images/dell.png" mode="" class="svg"></image>
<uni-icon class="trash"></uni-icon>
<view>
<view class="popup-Title">确定删除所选设备</view>
</view>
</view>
<!-- 按钮组 -->
<view class="popup-buttons">
<!-- <button class="btn closeBtn" @click="sureBtn">取消</button> -->
<button class="btn agreeBtn" @click="handleBtn">确定</button>
</view>
</view>
</view>
<!-- =========重命名============== -->
<view class="agreement-mask" v-if="RenameModel">
<view class="agreement-popupD">
<view class="popup-content">
<view>
<view class="popup-flex">
<text>设备名称</text>
<input type="text" placeholder="请输入设备名称" class="popup-input" />
</view>
</view>
</view>
<!-- 按钮组 -->
<view class="popup-buttons" style="margin-top:50rpx;">
<button class="btn agreeBtn4" @click="handleBtn">确定</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
deviceList: Array(5).fill().map((_, i) => ({
id: `022222${i}`,
})),
Options: [{
text: '重命名',
style: {
backgroundColor: '#E09319',
borderRadius: '16px',
width: '240rpx', // 初始宽度
},
},
{
text: '删除',
style: {
backgroundColor: 'rgb(240, 60, 60)',
borderRadius: '16px',
width: '240rpx', // 初始宽度
},
},
],
navTitle: "我的设备",
deleteShow: false,
RenameModel: false
}
},
methods: {
scan() {
uni.navigateTo({
url: '/pages/common/scan/scan'
})
},
// 右滑点击事件处理
handleSwipeClick(e, item, index) {
const {
content
} = e
console.log(e, 'eeeee');
switch (content.text) {
case '删除':
this.handleDeleteDevice(item, index)
break
case '重命名':
this.handleRenameDevice(item, index)
break
};
},
// 删除设备
handleDeleteDevice(item, index) {
this.deleteShow = true
uni.hideTabBar()
},
// 确认删除
handleBtn() {
this.deleteShow = false,
uni.showTabBar()
},
// 重命名设备
handleRenameDevice(item, index) {
this.RenameModel = true
uni.hideTabBar()
},
// 发生短信
handleSend() {
uni.navigateTo({
url: '/pages/common/send/index'
})
},
handleFile() {
uni.navigateTo({
url: '/pages/6170/deviceControl/index'
})
},
}
}
</script>
<style>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
/* 设备列表 */
.device-list {
/* flex: 1; */
/* padding: 20rpx; */
}
/* 设备卡片 */
.device-card {
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
/* padding: 30rpx; */
margin-bottom: 20rpx;
/* box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05); */
box-sizing: border-box;
position: relative;
}
.device-header {
display: flex;
align-items: center;
margin-bottom: 15rpx;
padding: 30rpx 0 10rpx 30rpx;
}
.device-name {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.87);
margin-left: 24rpx;
line-height: 50rpx;
}
.ID {
color: rgba(255, 255, 255, 0.6);
font-size: 26rpx;
}
.device-status {
width: 122rpx;
height: 52rpx;
font-size: 26rpx;
border-radius: 0px 8px 0px 8px;
background-color: rgb(42, 42, 42);
position: absolute;
top: 0rpx;
right: 0rpx;
text-align: center;
line-height: 52rpx;
}
.circle {
width: 10rpx;
height: 50rpx;
position: absolute;
right: 40rpx;
top: 100rpx;
}
.online {
color: rgb(187, 230, 0);
}
.device-id {
font-size: 26rpx;
color: #999;
margin-bottom: 20rpx;
display: block;
}
.device-info {
display: flex;
justify-content: space-evenly;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.87);
position: relative;
padding: 0rpx 0rpx 30rpx 30rpx;
}
.deviceIMG {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
position: relative;
background-color: rgba(42, 42, 42, 0.6);
display: flex;
align-items: center;
}
.IMG {
width: 68rpx;
height: 50rpx;
margin-left: 17%;
}
.onlines::before {
content: '';
position: absolute;
width: 15rpx;
height: 15rpx;
background: rgb(0, 171, 103);
border-radius: 50%;
left: 120rpx;
top: 15rpx
}
.line {
width: 2rpx;
height: 24rpx;
background: linear-gradient(90deg,
rgba(0, 0, 0, 0) 0%,
rgb(255, 255, 255) 50%,
rgba(255, 255, 255, 0) 100%);
margin-top: 12rpx;
}
.device-uplod {
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
align-items: center;
text-align: center;
height: 202rpx;
line-height: 200rpx;
}
.uni-swipe-action-item__options {
transition: width 0.3s ease;
}
/* 遮罩层 */
.agreement-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
.popup-Title {
color: rgba(255, 255, 255, 0.86);
text-align: center;
padding: 30rpx 0rpx;
}
.popup-buttons {
display: flex;
text-align: center;
}
/* 弹窗主体 */
.agreement-popup {
width: 100%;
height: 50%;
background-color: rgb(42, 42, 42);
border-radius: 60rpx 60rpx 0rpx 0rpx;
padding: 40rpx;
box-sizing: border-box;
position: absolute;
bottom: 0rpx;
}
.agreement-popupC {
width: 60%;
background-color: rgb(42, 42, 42);
border-radius: 40rpx;
padding: 30rpx;
text-align: center;
border: 1px solid rgba(255, 200, 78, 0.3);
}
.agreement-popupD {
width: 70%;
background-color: rgb(42, 42, 42);
border-radius: 40rpx;
padding: 40rpx;
text-align: center;
border: 1px solid rgba(187, 230, 0, 0.3);
}
.popup-flex {
display: flex;
white-space: nowrap;
color: rgba(255, 255, 255, 0.87);
height: 50rpx;
padding: 30rpx;
}
.popup-input {
border: 1px solid rgba(255, 255, 255, 0.4);
border-radius: 12rpx;
margin-left: 15rpx;
padding: 10rpx 0rpx;
font-size: 28rpx;
}
.svg {
width: 58rpx;
height: 62rpx;
}
/* 通用按钮样式 */
.btn {
height: 60rpx;
line-height: 60rpx;
border-radius: 40rpx;
font-size: 24rpx;
margin: 10rpx auto;
text-align: center;
}
/* 同意按钮 */
.agreeBtn {
background: #FFC84E;
color: #232323;
border: none;
width: 170rpx !important;
}
.agreeBtn4 {
background: rgba(187, 230, 0, 1);
color: #232323;
border: none;
width: 170rpx !important;
}
.closeBtn {
border: 1px solid rgba(255, 255, 255, 0.2);
background-color: rgba(35, 35, 35, 0.87);
color: rgba(255, 255, 255, 1);
}
</style>

View File

@ -0,0 +1,362 @@
<template>
<view class="pageContent">
<image src="/static/images/login.png" mode="" class="login-bg"></image>
<view class="content_con">
欢迎登录
</view>
<view class="content">
<view class='ver_item'>
<input type="number" v-model="phone" :maxlength="11" placeholder="请输入手机号" class="input" />
</view>
<view class='ver_item'>
<input type="number" v-model="code" :maxlength="6" placeholder="请输入验证码" class="input" />
<button :class="showView?' get_phone_number blue':'get_phone_number grad'"
@click="getPhoneCode">{{ isCounting ? `${countdown}s后重新获取` : '获取验证码' }}</button>
</view>
<!-- 协议勾选 -->
<view class="agreement">
<view class="custom-checkbox" @click="toggleCheck">
<view class="checkbox-icon" :class="{ checked: isChecked }">
<uni-icons v-if="isChecked" type="checkmarkempty" size="8" color="#fff"></uni-icons>
</view>
<text class="checkbox-label">我已认真阅读理解并同意<a class="agreeT">用户服务协议</a><a
class="agreeT">隐私政策</a></text>
</view>
</view>
<!-- 登录按钮 -->
<button class="login-btn" @click="handleLogin">
登录
</button>
</view>
<!-- 弹框 -->
<view class="agreement-mask" v-if="showAgreement">
<!-- 协议弹窗 -->
<view class="agreement-popup" @click.stop>
<!-- 标题 -->
<view class="popup-title">服务协议及隐私政策</view>
<!-- 协议内容 -->
<view class="popup-content">
为了更好的保障您的合法权益请您阅读并同意以下协议
<text class="protocol-link" @click="openProtocol('user')">用户服务协议</text>
<text class="protocol-link" @click="openProtocol('privacy')">隐私政策</text>
</view>
<!-- 按钮组 -->
<view class="popup-buttons">
<button class="btn disagree" @click="handleDisagree">不同意</button>
<button class="btn agree" @click="handleAgree">同意</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showView: false,
//codebtn: '获取验证码',
phone: '', //手机号码
code: "", //验证码
agreed: false,
isCounting: false,
countdown: 60,
isChecked: false,
showAgreement: false // 控制弹窗显示
}
},
methods: {
// 获取验证码
getPhoneCode() {
const phoneNumber = this.phone
const myreg = /^1[3456789]\d{9}$/;
if (!phoneNumber) {
uni.showToast({
title: '手机号不能为空',
icon: 'none',
duration: 1000
});
return false;
} else if (!myreg.test(phoneNumber)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none',
duration: 1000
});
return false;
}
this.isCounting = true
this.countdown = 60
const timer = setInterval(() => {
this.countdown--
if (this.countdown <= 0) {
clearInterval(timer)
this.isCounting = false
}
}, 1000)
// 接口调用
// uni.request({
// ...
// })
},
// 勾选同意
toggleCheck() {
this.isChecked = !this.isChecked
},
// 登录
handleLogin() {
if (this.phone == '') {
uni.showToast({
title: '手机号不能为空',
icon: 'none',
duration: 1000
})
return false
} else if (this.code == '') {
uni.showToast({
title: '验证码不能为空',
icon: 'none',
duration: 1000
})
return false
} else if (!this.isChecked) {
this.showAgreement = true
return false
}
// 接口调用
// uni.request({
// ...
// })
// uni.showToast({
// title: '验证通过了,走接口',
// icon: 'none',
// duration: 1000
// })
uni.switchTab({
url: '/pages/common/index/index'
})
},
// 打开具体协议
openProtocol(type) {
if (type === 'user') {
// 跳转到用户协议页面
uni.navigateTo({
url: '/pages/protocol/user'
})
} else {
// 跳转到隐私政策页面
uni.navigateTo({
url: '/pages/protocol/privacy'
})
}
},
// 不同意
handleDisagree() {
this.showAgreement = false
},
// 同意
handleAgree() {
this.isChecked = !this.isChecked
this.showAgreement = false
},
},
}
</script>
<style scoped>
.pageContent {
background: rgb(26, 26, 26);
height: 100vh;
}
.login-bg {
background-size: 100% 100%;
width: 100%;
height: 100%;
position: relative;
}
.content {
height: 70%;
width: 100%;
background: rgb(26, 26, 26);
position: absolute;
bottom: 0px;
border-radius: 60px 60px 0px 0px;
box-sizing: border-box;
padding: 30rpx;
}
.content_con {
position: absolute;
top: 220rpx;
color: rgba(255, 255, 255, 0.87);
left: 30rpx;
font-size: 60rpx;
}
.input {
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
height: 80rpx;
color: rgba(255, 255, 255, 0.6);
margin-top: 50rpx;
}
.ver_item {
position: relative;
}
.get_phone_number {
position: absolute;
right: 0px;
color: #999;
top: 1rpx;
background: rgb(26, 26, 26);
border: none;
text-align: right;
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
}
.grad {
color: rgb(187, 230, 0);
}
.blue {
color: rgba(255, 255, 255, 0.6);
}
.agreement {
margin: 50rpx 0;
display: flex;
align-items: center;
font-size: 28rpx;
color: #666;
}
.login-btn {
margin-top: 150rpx;
background-color: rgb(187, 230, 0);
color: rgb(35, 35, 35);
border-radius: 50rpx;
}
.login-btn[disabled] {
background-color: #ccc;
}
.custom-checkbox {
display: flex;
align-items: center;
}
.checkbox-icon {
width: 30rpx;
height: 30rpx;
border: 1px solid rgba(255, 255, 255, 0.87);
border-radius: 50rpx;
display: flex;
justify-content: center;
align-items: center;
margin-right: 10rpx;
}
.checkbox-icon.checked {
background-color: #07C160;
border-color: #07C160;
color: white;
}
.checkbox-label {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.87);
}
.agreeT {
color: rgb(187, 230, 0);
}
/* 遮罩层 */
.agreement-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 999;
}
/* 弹窗主体 */
.agreement-popup {
width: 80%;
background-color: rgba(42, 42, 42);
border-radius: 16rpx;
padding: 40rpx;
box-sizing: border-box;
border: 1rpx solid rgba(187, 230, 0, 0.3)
}
/* 标题 */
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
color: rgba(255, 255, 255, 0.87);
}
/* 内容文本 */
.popup-content {
font-size: 30rpx;
line-height: 1.6;
color: rgba(255, 255, 255, 0.87);
margin-bottom: 50rpx;
}
/* 协议链接 */
.protocol-link {
color: rgb(187, 230, 0);
margin: 0 10rpx;
}
/* 按钮容器 */
.popup-buttons {
display: flex;
justify-content: space-between;
}
/* 通用按钮样式 */
.btn {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 32rpx;
margin: 0 20rpx;
}
/* 不同意按钮 */
.disagree {
background-color: transparent;
color: rgba(255, 255, 255, 0.87);
border: 1px solid rgb(255, 255, 255);
font-size: 24rpx;
}
/* 同意按钮 */
.agree {
background-color: rgb(187, 230, 0);
color: #232323;
border: none;
font-size: 24rpx;
}
</style>

View File

@ -0,0 +1,25 @@
<template>
<view class="device-page">
<view class="deviceTitle">欢迎你使用我们的产品和服务!本用户协议(以下简称"协议")由你(以下简称"用户")[公司名称](以下简称"我们""本公司")就使用[产品名称]的相关事宜共同订立
欢迎你使用我们的产品和服务!本用户协议(以下简称"协议")由你(以下简称"用户")[公司名称](以下简称"我们""本公司")就使用[产品名称]的相关事宜共同订立</view>
</view>
</template>
<script>
</script>
<style scoped>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.deviceTitle{
color: rgba(255, 255, 255, 0.87);
line-height: 45mnrpx;
font-size: 28rpx;
}
</style>

View File

@ -0,0 +1,177 @@
<template>
<view class="pageContent">
<!-- 初始状态 -->
<view class="pause" v-if="!isConnecting">
<image src="/static/images/svg.png" class="svg"></image>
<view class="scanT">ID: {{ deviceId }}</view>
</view>
<!-- 连接中状态 -->
<view class="connecting-container" v-else>
<view class="device-info">
<view>
<image src="/static/images/bip.6.png" class="bip"></image>
</view>
<text class="device-name">设备名CLI</text>
<text class="device-model1">ID:{{deviceId}}</text>
</view>
<view class="connecting-line" v-if="isConnecting && !isConnected">连接中...</view>
<view class="connecting-success" v-if="isConnected">设备绑定成功</view>
</view>
<view class="btn-bottom">
<button class="login-btn" @click="handleConnect">
{{ isConnecting ? '确认' : '连接' }}
</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
deviceId: '',
isConnecting: false, // 是否正在连接
isConnected: false // 是否连接成功
}
},
methods: {
handleConnect() {
if (this.isConnecting) {
} else {
console.log('这里了么');
// 开始连接逻辑
uni.showLoading({
mask: true,
title: '加载中....'
})
this.isConnecting = true;
//这里可以添加实际的连接操作
setTimeout(() => {
this.connectSuccess();
}, 2000);
}
},
connectSuccess() {
uni.hideLoading()
// 连接成功后的处理
uni.showToast({
title: '连接成功',
icon: 'success'
});
}
},
onLoad(options) {
if (options.deviceId) {
this.deviceId = decodeURIComponent(options.deviceId);
} else {
this.deviceId = '未获取到设备ID';
}
}
}
</script>
<style scoped>
.pageContent {
height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
position: relative;
}
.pause {
text-align: center;
transform: translate(-50%, -100%);
position: absolute;
left: 50%;
top: 30%;
}
.scanT {
color: rgba(255, 255, 255, 0.87);
font-size: 38rpx;
padding-top: 20rpx;
}
.svg {
width: 120rpx;
height: 120rpx;
}
.login-btn {
background-color: rgb(187, 230, 0);
color: rgb(35, 35, 35);
border-radius: 50rpx;
position: absolute;
bottom: 200rpx;
width: 90%;
box-sizing: border-box;
}
/* 连接中状态样式 */
.connecting-container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
position: absolute;
top: 20%;
left: 0;
right: 0;
}
.connecting-text {
font-size: 36rpx;
color: rgba(255, 255, 255, 0.87);
margin-bottom: 40rpx;
font-weight: bold;
}
.device-dimensions,
.dimensions {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 20rpx;
}
.scanned-device {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.87);
margin-bottom: 30rpx;
}
.device-info {
display: flex;
flex-direction: column;
margin-bottom: 30rpx;
}
.device-name {
color: rgba(255, 255, 255, 0.87);
font-size: 34rpx;
margin-top: 10rpx;
}
.device-model1 {
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
margin-top: 10rpx;
}
.connecting-line {
font-size: 30rpx;
color: rgba(255, 255, 255, 0.6);
margin-bottom: 40rpx;
}
.bip {
width: 174rpx;
height: 123rpx;
}
.connecting-success {
color: rgb(187, 230, 0);
}
</style>

View File

@ -0,0 +1,61 @@
<template>
<view class="pageContent">
<view class="pause" @click="scanCode">
<uni-icons type="scan" size="100" color="rgba(255, 255, 255, 0.5)"></uni-icons>
<view class="scanT">扫一扫添加设备</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 这里可以添加数据绑定
}
},
methods: {
// 扫描
scanCode() {
uni.scanCode({
success: (res) => { // 改为箭头函数保持this指向
console.log('条码内容:' + res.result);
// 跳转并传递扫描结果
uni.navigateTo({
url: `/pages/common/qrcode/qrcode?deviceId=${encodeURIComponent(res.result)}`
});
},
fail: (err) => {
console.log('扫码失败', err);
uni.showToast({
title: '扫码失败',
icon: 'none'
});
}
});
}
}
}
</script>
<style scoped>
.pageContent {
height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.pause {
text-align: center;
transform: translate(-50%, -100%);
position: absolute;
left: 50%;
top: 40%;
}
.scanT {
color: rgba(255, 255, 255, 0.87);
font-size: 38rpx;
padding-top: 20rpx;
}
</style>

220
pages/common/send/index.vue Normal file
View File

@ -0,0 +1,220 @@
<template>
<view class="container">
<!-- 设备列表 -->
<scroll-view class="device-list" scroll-y>
<view class="device-card" v-for="(item, index) in deviceList" :key="index" @click="toggleSelect(index)">
<!-- 复选框 -->
<view class="checkbox" :class="{ checked: item.checked }">
<uni-icons v-if="item.checked" type="checkmarkempty" size="18" color="rgb(0, 0, 0)"></uni-icons>
</view>
<!-- 设备信息 -->
<view class="device-content">
<view class="device-header">
<view class="deviceIMG">
<image src="/static/images/device.png" mode="" class="IMG"></image>
</view>
<view class="device-name">
<view>设备:001-00</view>
<view class="ID">ID:{{ item.id }}</view>
</view>
</view>
<view class="device-status online">已连接</view>
<view class="device-info">
<text class="onlines">在线</text>
<text class="line"></text>
<text>电量90</text>
</view>
</view>
</view>
<view style="padding:20rpx;">
<view class="ql-editor">编辑信息</view>
<view class="ql-input">
<textarea placeholder-style="color:rgba(255, 255, 255, 0.4)" placeholder="请输入内容" class="textarea"/>
</view>
<button class="login-btn">发送</button>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
deviceList: Array(6).fill().map((_, i) => ({
id: `1321615${i}`,
checked: false,
showConfirm: false
})),
}
},
methods: {
toggleSelect(index) {
this.deviceList[index].checked = !this.deviceList[index].checked
this.$forceUpdate()
},
sendMessage() {
const selectedDevices = this.deviceList.filter(item => item.checked)
console.log('选中的设备:', selectedDevices)
uni.showToast({
title: `已发送到${selectedDevices.length}台设备`,
icon: 'success'
})
}
}
}
</script>
<style scoped>
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
}
.header {
padding: 30rpx;
text-align: center;
}
.title {
font-size: 36rpx;
color: rgba(255, 255, 255, 0.87);
}
.device-list {
flex: 1;
padding: 0 20rpx;
}
.device-card {
position: relative;
display: flex;
align-items: center;
width: 94%;
}
.checkbox {
width: 40rpx;
height: 40rpx;
border: 2rpx solid rgba(255, 255, 255, 0.5);
margin-right: 20rpx;
border-radius: 4rpx;
display: flex;
align-items: center;
justify-content: center;
}
.checkbox.checked {
background-color: rgb(187, 230, 0);
border-color: rgb(187, 230, 0);
}
.device-content {
background-color: rgb(26, 26, 26);
border-radius: 16rpx;
margin-bottom: 20rpx;
position: relative;
/* display: flex; */
align-items: center;
padding: 20rpx;
width: 93%;
}
.device-header {
display: flex;
align-items: center;
margin-bottom: 15rpx;
}
.device-name {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.87);
margin-left: 24rpx;
line-height: 50rpx;
}
.ID {
color: rgba(255, 255, 255, 0.6);
font-size: 26rpx;
}
.device-status {
width: 122rpx;
height: 52rpx;
font-size: 26rpx;
border-radius: 0px 8px 0px 8px;
background-color: rgb(42, 42, 42);
position: absolute;
top: 0rpx;
right: 0rpx;
text-align: center;
line-height: 52rpx;
}
.online {
color: rgb(187, 230, 0);
}
.device-info {
display: flex;
justify-content: space-evenly;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.87);
padding-top: 10rpx;
}
.deviceIMG {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
position: relative;
background-color: rgba(42, 42, 42, 0.6);
display: flex;
align-items: center;
}
.IMG {
width: 68rpx;
height: 50rpx;
margin-left: 17%;
}
.onlines::before {
content: '';
position: absolute;
width: 15rpx;
height: 15rpx;
background: rgb(0, 171, 103);
border-radius: 50%;
left: 98rpx;
bottom: 32rpx
}
.line {
width: 2rpx;
height: 24rpx;
background: linear-gradient(90deg,
rgba(0, 0, 0, 0) 0%,
rgb(255, 255, 255) 50%,
rgba(255, 255, 255, 0) 100%);
margin-top: 12rpx;
}
.ql-editor {
color: rgba(255, 255, 255, 0.6);
font-size:30rpx;
}
.ql-input {
width:95.9%;
height: 200rpx;
margin-top: 30rpx;
box-sizing: border-box;
padding: 30rpx;
border-radius:16rpx;
background: rgb(26, 26, 26);
}
.textarea{
color: rgba(255, 255, 255, 0.8);
}
.login-btn {
margin-top:30rpx;
background-color: rgb(187, 230, 0);
color: rgb(35, 35, 35);
border-radius: 50rpx;
width:90%;
margin-left: 10rpx;
}
</style>

288
pages/common/user/index.vue Normal file
View File

@ -0,0 +1,288 @@
<template>
<view class="pageContent">
<image src="/static/images/login.png" mode="" class="login-bg"></image>
<view class="content_con">
<view class="user_logo">
<image src="/static/images/logo.png" class="logo"></image>
</view>
<view class="user-right">
<view class="user-title">星汉研创</view>
<view class="ID">ID:123456</view>
</view>
</view>
<view class="content">
<view class="menu-list">
<view class="menu-item" @click="userAgree">
<image src="/static/images/xy.png" class="icon"></image>
<text class="title">用户协议</text>
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
</view>
<view class="menu-item" @click="privacyAgree">
<image src="/static/images/ys.png" class="icon"></image>
<text class="title">隐私协议</text>
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
</view>
<view class="menu-item" @click="aboutUs">
<image src="/static/images/wm.png" class="icon"></image>
<text class="title">关于我们</text>
<uni-icons type="right" size="25" color="rgba(255, 255, 255, 0.4)" class="uniIcon"></uni-icons>
</view>
<view class="btn_footer">
<button class="logout" @click="logout">退出登录</button>
</view>
</view>
</view>
<!-- 弹框 -->
<view class="agreement-mask" v-if="showAgreement">
<!-- 协议弹窗 -->
<view class="agreement-popup" @click.stop>
<!-- 标题 -->
<view class="popup-title">退出登录</view>
<!-- 协议内容 -->
<view class="popup-content">
您确定要退出登录吗
</view>
<!-- 按钮组 -->
<view class="popup-buttons">
<button class="btn disagree" @click="handleDisagree">取消</button>
<button class="btn agree" @click="handleAgree">确定</button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showAgreement: false // 控制弹窗显示
}
},
methods: {
// 不同意
handleDisagree() {
this.showAgreement = false,
uni.showTabBar()
},
// 同意
handleAgree() {
this.showAgreement = false
uni.navigateTo({
url: '/pages/common/login/index'
})
uni.showTabBar()
},
// 退出登录
logout() {
this.showAgreement = true
uni.hideTabBar()
},
// 用户协议
userAgree(){
uni.navigateTo({
url: '/pages/common/userAgreement/index'
})
},
// 隐私协议
privacyAgree(){
uni.navigateTo({
url: '/pages/common/privacyAgreement/index'
})
},
// 关于我们
aboutUs(){
uni.navigateTo({
url: '/pages/common/aboutUs/index'
})
}
},
}
</script>
<style scoped>
.pageContent {
background: rgb(26, 26, 26);
height: 100vh;
}
.login-bg {
background-size: 100% 100%;
width: 100%;
height: 100%;
position: relative;
}
.content {
height: 78%;
width: 100%;
background: rgb(26, 26, 26);
position: absolute;
bottom: 0px;
border-radius: 60px 60px 0px 0px;
box-sizing: border-box;
padding: 30rpx;
}
.content_con {
position: absolute;
top: 100rpx;
color: rgba(255, 255, 255, 0.87);
left: 30rpx;
font-size: 60rpx;
display: flex;
align-items: center;
}
.user-title {
color: rgba(255, 255, 255, 0.87);
font-size: 36rpx;
}
.ID {
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
}
.logo {
width: 120rpx;
height: 120rpx;
}
.menu-list {
background-color: rgb(42, 42, 42);
border-radius: 16rpx;
padding: 0 30rpx;
margin-top: 50rpx;
/* 使菜单靠底部 */
}
.menu-item {
font-size: 32rpx;
color: rgb(255, 255, 255);
padding: 30rpx 0;
border-bottom: 1rpx solid rgba(255, 255, 255, 0.04);
display: flex;
align-items: center;
}
.menu-item:last-child {
border-bottom: none;
}
.icon {
width: 36rpx;
height: 36rpx;
}
.title {
padding-left: 20rpx;
padding-top: -8rpx;
font-size: 28rpx;
}
.uniIcon {
position: absolute;
right: 50rpx;
}
.user-right {
margin-left: 30rpx;
}
.btn_footer {
height: 80rpx;
background: rgb(42, 42, 42);
position: absolute;
width: 92%;
bottom: 60rpx;
left: 30rpx;
border-radius: 16rpx;
}
.logout {
background: rgb(42, 42, 42);
color: rgba(255, 255, 255, 0.87);
}
/* 遮罩层 */
.agreement-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}
/* 弹窗主体 */
.agreement-popup {
width: 80%;
background-color: rgba(42, 42, 42);
border-radius: 16rpx;
padding: 40rpx;
box-sizing: border-box;
border: 1rpx solid rgba(187, 230, 0, 0.3);
}
/* 标题 */
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
margin-bottom: 30rpx;
color: rgba(255, 255, 255, 0.87);
}
/* 内容文本 */
.popup-content {
font-size: 30rpx;
line-height: 1.6;
color: rgba(255, 255, 255, 0.87);
margin-bottom: 50rpx;
}
/* 协议链接 */
.protocol-link {
color: rgb(187, 230, 0);
margin: 0 10rpx;
}
/* 按钮容器 */
.popup-buttons {
display: flex;
justify-content: space-between;
}
/* 通用按钮样式 */
.btn {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 32rpx;
margin: 0 20rpx;
}
/* 不同意按钮 */
.disagree {
background-color: transparent;
color: rgba(255, 255, 255, 0.87);
border: 1px solid rgb(255, 255, 255);
font-size: 24rpx;
}
/* 同意按钮 */
.agree {
background-color: rgb(187, 230, 0);
color: #232323;
border: none;
font-size: 24rpx;
}
</style>

View File

@ -0,0 +1,25 @@
<template>
<view class="device-page">
<view class="deviceTitle">欢迎你使用我们的产品和服务!本用户协议(以下简称"协议")由你(以下简称"用户")[公司名称](以下简称"我们""本公司")就使用[产品名称]的相关事宜共同订立
欢迎你使用我们的产品和服务!本用户协议(以下简称"协议")由你(以下简称"用户")[公司名称](以下简称"我们""本公司")就使用[产品名称]的相关事宜共同订立</view>
</view>
</template>
<script>
</script>
<style scoped>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.deviceTitle{
color: rgba(255, 255, 255, 0.87);
line-height: 45mnrpx;
font-size: 28rpx;
}
</style>