提交 9b32c3a6 authored 作者: caodi\cd's avatar caodi\cd

fix:主页交互

上级 b4201cb5
......@@ -2,12 +2,12 @@
<view class="container">
<!-- 第一个模块 -->
<view class="header">
<view class="title">运维在线</view>
<view class="title">杭州内网监管在线-运维在线</view>
<view class="header-buttons">
<button class="log-button">操作日志</button>
<button class="exit-button">
<image src="/static/exit-icon.png" mode="aspectFit"></image>
</button>
<button class="log-button" @click="lookLog">操作日志</button>
<div class="exit-button" @click="logOut">
<image class="logout" src="@/static/img/logout.svg" mode="aspectFit"></image>
</div>
</view>
</view>
......@@ -17,9 +17,9 @@
<view class="profile-left">
<view class="avatar">
<image src="@/static/img/add-img/home1.png" mode="aspectFit"></image>
<view class="change-password" @click="changePassword">修改密码</view>
<view class="change-password" @click="updatePassword">修改密码</view>
</view>
<view class="username">用户名</view>
<view class="username">{{ userName }}</view>
</view>
<view class="profile-right">
<button class="inspection-button">巡检管理</button>
......@@ -31,12 +31,17 @@
<!-- 第三个模块 -->
<view class="card-section">
<view class="card-container">
<view class="card" v-for="(card, index) in cards" :key="index">
<image :src="card.image" class="card-image"></image>
<view class="card" v-for="(card, index) in cards" :key="index"
:style="{ backgroundImage: `url(${card.image})` }">
<view class="card-text">{{ card.text }}</view>
</view>
</view>
</view>
<!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog ref="inputClose2" mode="base" title="确定退出该账号?" @confirm="dialogInputConfirm2">
</uni-popup-dialog>
</uni-popup>
</view>
</template>
......@@ -56,16 +61,53 @@
image: '../../static/img/sj.png',
text: '设备上架'
}
]
],
userName: this.$store.state.now_user.user,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
methods: {
changePassword() {
uni.showToast({
title: '修改密码',
icon: 'none'
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
}
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
}
};
</script>
......@@ -117,23 +159,23 @@
font-family: PingFangSC-Regular;
font-size: 16px;
color: #000000;
line-height: 24px;
line-height: 36px;
font-weight: 400;
}
.exit-button {
width: 36px;
height: 36px;
background-color: transparent;
border: none;
background: #FFFFFF;
border: 0.5px solid rgba(224, 224, 224, 1);
border-radius: 18px;
display: flex;
justify-content: center;
align-items: center;
image {
width: 24px;
height: 24px;
.logout {
width: 16px;
height: 16px;
}
}
}
......@@ -141,11 +183,10 @@
.profile-section {
width: 720px;
margin-top: 20px;
.profile-box {
background-color: #f0f0f0;
border-radius: 10px;
background-color: #fff;
border-radius: 12px;
padding: 16px 32px;
display: flex;
justify-content: space-between;
......@@ -172,18 +213,24 @@
bottom: 0;
left: 0;
right: 0;
height: 22px;
background-color: rgba(0, 0, 0, 0.5);
color: white;
text-align: center;
height: 22px;
font-family: PingFangSC-Regular;
font-size: 12px;
line-height: 22px;
color: #FFFFFF;
line-height: 20px;
font-weight: 400;
}
}
.username {
margin-left: 10px;
font-size: 18px;
margin-left: 16px;
font-family: PingFangSC-Medium;
font-size: 20px;
color: #000000;
line-height: 28px;
font-weight: 500;
}
}
......@@ -193,20 +240,27 @@
.inspection-button {
width: 112px;
height: 36px;
background-color: blue;
color: white;
background-image: linear-gradient(105deg, #68ACFB 0%, #3774F6 100%);
border-radius: 18px;
font-size: 14px;
margin-right: 10px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #FFFFFF;
line-height: 36px;
font-weight: 400;
margin-right: 16px;
}
.record-button {
width: 112px;
height: 36px;
background-color: purple;
color: white;
background: #FFFFFF;
border: 1px solid rgba(55, 116, 246, 1);
border-radius: 18px;
font-size: 14px;
font-family: PingFangSC-Regular;
font-size: 16px;
color: #3774F6;
line-height: 36px;
font-weight: 400;
}
}
}
......@@ -228,17 +282,17 @@
display: flex;
flex-direction: column;
align-items: center;
padding-top: 35px;
.card-image {
width: 75px;
height: 75px;
margin-bottom: 20px;
}
padding-top: 130px;
background-size: cover; // 背景图覆盖整个卡片
background-position: center; // 背景图居中
.card-text {
font-size: 18px;
text-align: center;
font-family: PingFangSC-Semibold;
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: 600;
}
}
}
......
......@@ -655,7 +655,7 @@
flex: 1;
border: 1px solid #ddd;
border-radius: 4px;
padding: 6px;
padding: 16px;
font-size: 14px;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论