吉安感知网项目-前端
shuishen
2026-01-17 86c2d61ba9d33f1886cfc904dcaf17f033e4c80a
uniapps/work-app/src/subPackages/userDetail/infos/index.vue
@@ -1,7 +1,18 @@
<template>
   <view class="container">
    <u-navbar
      title="个人资料"
      :is-back="true"
      back-text=""
      :back-icon-size="40"
      @left-click="onBackClick"
    >
    </u-navbar>
      <view class="pageBg"></view>
      <div class="avatarBox">
         <u-avatar @click="uploadAvatar" :src="userInfo.avatar" size="114" mode="aspectFill" />
         <!-- @click="uploadAvatar" -->
         <u-avatar  :src="userInfo.avatar || defaultAvatar" size="114" mode="aspectFill" />
      </div>
      <view class="detailBox">
         <div class="detailCon">
@@ -29,13 +40,14 @@
         </div>
      </view>
      <view class="btngroup">
         <u-button color="#AEAEAE" class="custom-style" shape="circle" @click="reset">重置</u-button>
         <u-button color="#1D6FE9" class="custom-style" shape="circle" @click="submit">提交</u-button>
         <u-button color="#AEAEAE" class="custom-style"  @click="reset">重置</u-button>
         <u-button color="#1D6FE9" class="custom-style"  @click="submit">提交</u-button>
      </view>
   </view>
</template>
<script setup>
import defaultAvatar  from '/static/images/defaultAvatar.svg'
   import {
      getEnvObj,
      getWebViewUrl
@@ -216,19 +228,44 @@
      });
   };
// 返回按钮点击事件
const onBackClick = () => {
  uni.navigateBack()
}
   onShow(async () => {
      getUserInfoData()
   });
</script>
<style lang="scss" scoped>
   .container {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
   }
.container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  // 添加导航栏高度的padding-top,避免内容被遮挡
  padding-top: 88rpx;
}
:deep(){
  .u-navbar__content{
    background: url("@/static/images/user/userbg.svg")  no-repeat !important;
    background-size: 100%!important;
    height: 44px !important;
  }
}
      .pageBg {
         position: fixed;
         top: 0;
         left: 0;
         width: 100%;
         height: 100%;
         background: url("@/static/images/user/userbg.svg")  no-repeat ;
         background-size: 100%;
      }
   .avatarBox {
      width: 228rpx;
      height: 228rpx;
@@ -236,12 +273,14 @@
   }
   .detailBox {
         position: absolute;
            top: 360rpx;
      width: 702rpx;
      min-height: 430rpx;
      background: #FFFFFF;
      border-radius: 12rpx;
      box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
    margin-top: 88rpx;
      .detailCon {
         padding: 0 24rpx;
      }
@@ -291,10 +330,13 @@
   .custom-style {
      width: 276rpx;
      height: 76rpx;
      height: 100rpx;
        font-family: "Source Han Sans CN";
      font-weight: 400;
      font-size: 36rpx;
   }
   :deep(.u-button.data-v-461e713c){
      width: 276rpx !important;
      height: 76rpx !important;
      height: 100rpx !important;
   }
</style>