Houjie
2025-05-15 1833dd6d7cac01c35840af52fadc1199821e5805
pages/user/people.vue
@@ -2,10 +2,12 @@
   <view>
      <scroll-view scroll-y class="page">
           <!-- 头部logo-->
        <view class="UCenter-bg">
          <image :src="personalList.avatar" class="png round animation-slide-right margin-bottom-sm" mode="scaleToFill" :style="[{animationDelay: '0.1s'}]"></image>
          <image src="https://static.jeecg.com/upload/test/wave_1595818053612.gif" mode="scaleToFill" class="gif-wave"></image>
        </view>
       <view class="UCenter-bg">
          <image src="/static/avatar_boy.png" class="png round animation-slide-right margin-bottom-sm"
             mode="scaleToFill" :style="[{animationDelay: '0.1s'}]"></image>
          <image src="https://static.jeecg.com/upload/test/wave_1595818053612.gif" mode="scaleToFill"
             class="gif-wave"></image>
       </view>
        <view class="padding flex text-center text-grey bg-white shadow-warp">
          <view class="flex flex-sub flex-direction solid-right animation-slide-top" :style="[{animationDelay: '0.2s'}]">
            <view class="text-xl text-orange">{{personalList.username}}</view>
@@ -19,7 +21,7 @@
        </view>
        <!-- 列表list-->
        <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg radius">
          <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
          <!-- <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
            <view class="content" >
              <text class="cuIcon-favorfill text-yellow"></text>
              <text class="text-grey">收藏</text>
@@ -42,7 +44,7 @@
                <text class="cuIcon-location text-cyan"></text>
               <text class="text-grey">定位</text>
            </view>
         </navigator>
         </navigator> -->
         <navigator class="cu-item arrow animation-slide-bottom" url="/pages/user/userdetail" :style="[{animationDelay: '0.6s'}]">
              <view class="content">
                <text class="cuIcon-settingsfill text-cyan"></text>
@@ -82,15 +84,21 @@
              id:''
         };
      },
      watch: {
         cur: {
            immediate: true,
            handler() {
               console.log('watch',this.cur)
                this.userId=this.$store.getters.userid;
               this.load()
            },
         },
      // watch: {
      //    cur: {
      //       immediate: true,
      //       handler() {
      //          console.log('watch',this.cur)
      //           this.userId=this.$store.getters.userid;
      //          this.load()
      //       },
      //    },
      // },
      created() {
      this.id=uni.getStorageSync("userId");
      console.log(this.id);
      this.load();
      },
      methods: {
         scan(){
@@ -109,20 +117,18 @@
            // #endif
         },
         load(){
            if(!this.userId){
            this.$http.get(this.userUrl,{params:{id:this.id}}).then(res=>{
               
               return;
            }
            this.$http.get(this.userUrl,{params:{id:this.userId}}).then(res=>{
               console.log("res",res)
                if (res.data.success) {
                  let perArr = res.data.result
                    let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
                  this.personalList.avatar =avatar
                  this.personalList.realname = perArr.realname
                  this.personalList.username = perArr.username
                  this.personalList.depart = perArr.departIds
                   this.getpost(perArr.post)
                  console.log("res",res)
                    // let avatar=(perArr.avatar && perArr.avatar.length > 0)? api.getFileAccessHttpUrl(perArr.avatar):'/static/avatar_boy.png'
                  this.personalList.avatar =res.data.result.avatar
                  // this.personalList.realname = perArr.realname
                  this.personalList.username = res.data.result.realname
                  // this.personalList.depart = perArr.departIds
                     this.getpost(res.data.result.post)
               }
            }).catch(err => {
               console.log(err);