Эх сурвалжийг харах

我的团队 回显团队人员信息 修改request状态提示信息

liude 1 жил өмнө
parent
commit
33c5739012

+ 21 - 13
package-lock.json

@@ -4169,6 +4169,27 @@
         "whatwg-fetch": "^3.6.2"
       },
       "dependencies": {
+        "@vue/vue-loader-v15": {
+          "version": "npm:vue-loader@15.11.1",
+          "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
+          "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
+          "dev": true,
+          "requires": {
+            "@vue/component-compiler-utils": "^3.1.0",
+            "hash-sum": "^1.0.2",
+            "loader-utils": "^1.1.0",
+            "vue-hot-reload-api": "^2.3.0",
+            "vue-style-loader": "^4.1.0"
+          },
+          "dependencies": {
+            "hash-sum": {
+              "version": "1.0.2",
+              "resolved": "https://registry.npmmirror.com/hash-sum/-/hash-sum-1.0.2.tgz",
+              "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
+              "dev": true
+            }
+          }
+        },
         "acorn": {
           "version": "8.8.2",
           "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.8.2.tgz",
@@ -4304,19 +4325,6 @@
       "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.4.tgz",
       "integrity": "sha512-abSgiVRhfjfl3JALR/cSuBl74hGJ3SePgf1mKzodf1eMWLwHZbfEGxT2cNJSsNiw44jEgrO7bNkhchaWA7RwNw=="
     },
-    "@vue/vue-loader-v15": {
-      "version": "npm:vue-loader@15.11.1",
-      "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-15.11.1.tgz",
-      "integrity": "sha512-0iw4VchYLePqJfJu9s62ACWUXeSqM30SQqlIftbYWM3C+jpPcEHKSPUZBLjSF9au4HTHQ/naF6OGnO3Q/qGR3Q==",
-      "dev": true,
-      "requires": {
-        "@vue/component-compiler-utils": "^3.1.0",
-        "hash-sum": "^1.0.2",
-        "loader-utils": "^1.1.0",
-        "vue-hot-reload-api": "^2.3.0",
-        "vue-style-loader": "^4.1.0"
-      }
-    },
     "@vue/web-component-wrapper": {
       "version": "1.3.0",
       "resolved": false,

+ 110 - 76
src/pages/client/clientUser/myGroup.vue

@@ -1,8 +1,8 @@
 <template>
   <view class="container">
     <view class="top-img-box">
-      <img class="top-img" src="@/static/logo.png" alt="" />
-      <view class="top-name"> My Team </view>
+      <image class="top-img" :src="avatar" />
+      <view class="top-name"> {{ nickname }} </view>
     </view>
 
     <view class="group-item-box">
@@ -11,11 +11,14 @@
         <view class="top-r">></view>
       </view>
       <view class="item-content">
-        <img class="item-img" :key="item" src="@/static/logo.png" alt="" v-for="item of 3" />
+        <view class="person-item" v-for="item of teamPersonList">
+          <image class="item-img" :src="item.inviteUserAvatar" mode="aspectFill" />
+          <view class="item-name">{{ item.name }}</view>
+        </view>
       </view>
     </view>
 
-    <view class="group-item-box">
+    <!-- <view class="group-item-box">
       <view class="item-top">
         <view class="top-l">最近动态</view>
         <view class="top-r">></view>
@@ -33,78 +36,75 @@
       <view class="item-content">
         <img class="item-img" src="@/static/logo.png" alt="" :key="item" v-for="item of 3" />
       </view>
-    </view>
-	
-	<button @click='handlerBind'>绑定</button>
+    </view> -->
+
+    <button @click='handlerBind'>绑定</button>
   </view>
 </template>
 
 <script>
-  import { getMyTeam , inviteBind } from "@/api/client/mine.js"
-export default {
-  data() {
-    return {
-      queryParams:{
-        paging:'1,10'
-      }
-    };
-  },
-  mounted(){
-    this.handlerInitList()
-  },
-  methods:{
-    // 初始化我的团队列表
-    handlerInitList(){
-      getMyTeam(this.queryParams).then(res=>{
-        console.log("Res",res)
-      })
+  import {
+    getMyTeam,
+    inviteBind
+  } from "@/api/client/mine.js"
+  import {
+    mapGetters
+  } from "vuex"
+  export default {
+    data() {
+      return {
+        queryParams: {
+          paging: '1,10'
+        },
+        teamPersonList: []
+      };
     },
-	// 测试绑定
-	handlerBind(){
-		let params = {
-			userId:'1692178132393070594',
-			targetId:'1774462327015325697',
-			type:1
-		}
-		inviteBind(params).then(res=>{
-			console.log("@@@@res",res)
-		})
-	}
-  }
-};
+    mounted() {
+      this.handlerInitList()
+    },
+    computed: {
+      ...mapGetters(['userId', 'gender', 'avatar', 'nickname'])
+    },
+    methods: {
+      // 初始化我的团队列表
+      handlerInitList() {
+        getMyTeam(this.queryParams).then(res => {
+          let {
+            records
+          } = res.data
+          this.teamPersonList = records
+          console.log("Res", res)
+        })
+      },
+      // 测试绑定
+      handlerBind() {
+        let params = {
+          userId: this.userId,
+          targetId: '1774462327015325697',
+          type: 1
+        }
+        inviteBind(params).then(res => {
+          console.log("@@@@res", res)
+        })
+      }
+    }
+  };
 </script>
 
 <style lang="scss" scoped>
-.container {
-  padding: 20rpx 10rpx 50rpx;
-
-  .top-img-box {
-    text-align: center;
-
-    .top-img {
-      width: 160rpx;
-      height: 160rpx;
-      border-radius: 100rpx;
-    }
-
-    .top-name {
-      color: #6b7280;
-      font-weight: bold;
-      font-size: 32rpx;
-      margin-top: 20rpx;
-    }
-  }
+  .container {
+    padding: 20rpx 10rpx 50rpx;
 
-  .group-item-box {
-    padding: 0 20rpx;
-    margin-top: 60rpx;
+    .top-img-box {
+      text-align: center;
 
-    .item-top {
-      display: flex;
-      justify-content: space-between;
+      .top-img {
+        width: 160rpx;
+        height: 160rpx;
+        border-radius: 100rpx;
+      }
 
-      .top-l,
-      .top-r {
+      .top-name {
         color: #6b7280;
         font-weight: bold;
         font-size: 32rpx;
@@ -112,22 +112,56 @@ export default {
       }
     }
 
-    .item-content {
-      display: flex;
+    .group-item-box {
+      padding: 0 20rpx;
+      margin-top: 60rpx;
 
-      .item-img {
-        width: 160rpx;
-        height: 160rpx;
-        border-radius: 100rpx;
-        margin: 60rpx 20rpx 0 0;
+      .item-top {
+        display: flex;
+        justify-content: space-between;
+
+        .top-l,
+        .top-r {
+          color: #6b7280;
+          font-weight: bold;
+          font-size: 32rpx;
+          margin-top: 20rpx;
+        }
       }
 
-      .dynamic-img {
+      .item-content {
+        display: flex;
         width: 100%;
-        height: 500rpx;
-        margin-top: 60rpx;
+
+        .person-item {
+          margin-right: 20rpx;
+          text-align: center;
+          width: 25%;
+        }
+
+        .item-name {
+          font-size: 28rpx;
+          font-weight: bold;
+          color: #000;
+        }
+
+        .person-item:last-child {
+          margin: 0;
+        }
+
+        .item-img {
+          width: 160rpx;
+          height: 160rpx;
+          border-radius: 100rpx;
+          margin: 60rpx 20rpx 0 0;
+        }
+
+        .dynamic-img {
+          width: 100%;
+          height: 500rpx;
+          margin-top: 60rpx;
+        }
       }
     }
   }
-}
 </style>

+ 10 - 9
src/utils/request.js

@@ -43,7 +43,8 @@ instance.interceptors.response.use(async (res) => {
   uni.hideLoading()
   const {
     code,
-    data
+    data,
+    message
   } = res.data
   if (data && data.accessToken) {
     setAccessToken(data.accessToken)
@@ -54,24 +55,24 @@ instance.interceptors.response.use(async (res) => {
   // 未知错误
   if (code === 'ERROR') {
     uni.showToast({
-      title: '未知错误',
-      icon: 'error'
+      title: `${message ? message :'未知错误'}`,
+      icon: 'none'
     })
     return res.data
   }
   // 请求错误
   if (code === 'BAD_REQUEST') {
     uni.showToast({
-      title: '请求异常',
-      icon: 'error'
+      title: `${message ? message :'请求异常'}`,
+      icon: 'none'
     })
     return res.data
   }
   // 拒绝访问
   if (code === 'FORBIDDEN') {
     uni.showToast({
-      title: '拒绝访问',
-      icon: 'error'
+      title: `${message ? message :'拒绝访问'}`,
+      icon: 'none'
     })
     return
   }
@@ -89,8 +90,8 @@ instance.interceptors.response.use(async (res) => {
   // 访问资源异常
   if (code === 'UNAVAILABLE') {
     uni.showToast({
-      title: '访问资源不可用',
-      icon: 'error'
+      title: `${message ? message :'访问资源不可用'}`,
+      icon: 'none'
     })
     return
   }