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

fix:主页交互

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