db 2 years ago
parent
commit
df13681d67
1 changed files with 85 additions and 43 deletions
  1. 85 43
      pages/my/my.vue

+ 85 - 43
pages/my/my.vue

@@ -2,7 +2,6 @@
   <view class="container my-container" v-if="haveData">
     <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
       <view class="content">
-        <van-icon custom-class="search-icon" name="arrow-left" size="24px" @click="goSearch" />
         <view class="text">我的</view>
       </view>
     </view>
@@ -17,19 +16,25 @@
         <view class="info">
           <view class="info-img">
             <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
-              <image class="avatar" v-if="isLogin && userInfo.Headimgurl" :src="userInfo.Headimgurl"></image>
+              <image class="avatar" v-if="Headimgurl" :src="Headimgurl"></image>
               <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/logo.png" class="avatar" v-else></image>
             </button>
           </view>
           <view class="info-list">
-            <text class="name">{{ userInfo.RealName || "暂无" }}</text>
-            <text class="mobile">{{ userInfo.Mobile || userInfo.Email }}</text>
-            <text class="company-name">{{ userInfo.CompanyName || "暂无" }}</text>
+            <block v-if="isLogin">
+              <text class="name">{{ userInfo.RealName || "--" }}</text>
+              <text class="mobile">{{ userInfo.Mobile || userInfo.Email }}</text>
+              <text class="company-name">{{ userInfo.CompanyName || "--" }}</text>
+            </block>
+            <block v-else>
+              <text class="name">Hi,请绑定联系方式~</text>
+              <text class="bind-btn" @click="loginHandle">绑定联系方式</text>
+            </block>
           </view>
         </view>
         <view class="auth-info">
           <template v-if="isLogin">
-            <scroll-view scroll-x="true" scroll-with-animation class="auth-ul" v-if="userInfo.HasPermission !== 0">
+            <scroll-view scroll-x="true" scroll-with-animation class="auth-ul" v-if="userInfo.HasPermission === 0">
               <text class="auth-li" v-for="item in authList" :key="item">{{ item }}</text>
             </scroll-view>
             <block v-else>
@@ -53,15 +58,20 @@
           </view>
         </view>
       </view>
-      <!-- <view class="info-bot">
-        <view class="my-bot-cont">
-          <view class="list-item border_bottom" @click="itemClickHandle('提问')">
-            <text>我的提问</text>
+      <view class="info-bot">
+        <view class="list-item border_bottom" v-for="type in typeArr" :key="type" @click="itemClickHandle(type)">
+          <text>{{ type }}</text>
+          <view class="my-bot-box">
+            <block v-if="type == '外呼号码'">
+              <text v-if="userInfo.OutboundCountryCode && userInfo.OutboundMobile" style="margin-right: 40rpx; font-size: 28rpx">{{ userInfo.OutboundCountryCode }}-{{ userInfo.OutboundMobile }}</text>
+              <text v-else style="margin-right: 40rpx; font-size: 28rpx">未设置</text>
+            </block>
             <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
           </view>
         </view>
-      </view> -->
+      </view>
     </view>
+    <view class="bottom-text">您手边的弘则研究素材库</view>
   </view>
 </template>
 
@@ -78,12 +88,12 @@ export default {
       isLogin: false, //是否绑定且授权
       login_txt: "",
       haveData: null, //显示页面
-      typeArr: ["我的收藏", "访谈申请", "浏览历史", "我的提问"],
+      typeArr: ["外呼号码", "访谈申请", "我的提问", "优化建议"],
       typeObj: new Map([
         ["外呼号码", "editOutbound"],
         ["访谈申请", "applyInterview"],
-        ["浏览历史", "browseHistory"],
         ["我的提问", "myAskPage"],
+        ["优化建议", "advice"],
       ]),
       userInfo: {},
       authList: [],
@@ -93,6 +103,7 @@ export default {
         paddingBottom: "4px",
       },
       myNotice: true,
+      headimgurl: "",
     };
   },
   async onShow() {
@@ -111,8 +122,9 @@ export default {
     this.initNavBar();
   },
   methods: {
+    //点击了头像
     onChooseAvatar(e) {
-      this.userInfo.Headimgurl = e.detail.avatarUrl;
+      this.headimgurl = e.detail.avatarUrl;
     },
     //导航条的高度
     initNavBar() {
@@ -130,6 +142,7 @@ export default {
         if (res.Ret === 200) {
           this.authList = res.Data.PermissionName && res.Data.PermissionName.split(",");
           this.userInfo = res.Data;
+          this.headimgurl = res.Data.Headimgurl;
           res.Data.Mobile && this.$db.set("mobile", res.Data.Mobile);
         }
       });
@@ -179,11 +192,11 @@ export default {
     itemClickHandle(type) {
       /* 是否登录 */
       if (this.isLogin) {
-        if (type == "外呼") {
+        if (type == "外呼号码") {
           uni.navigateTo({
             url: "/activityPages/editOutbound/editOutbound?title=设置外呼号码&identification=我的",
           });
-        } else if (type == "提问") {
+        } else if (type == "我的提问") {
           uni.navigateTo({
             url: "/reportPages/myAskPage/myAskPage",
           });
@@ -201,32 +214,20 @@ export default {
 };
 </script>
 
-<style lang="scss">
-.nav-bar-wrap {
-  color: #fff;
-  position: fixed;
-  top: 0;
-  left: 0;
-  width: 100%;
-  z-index: 999;
-  .content {
-    position: relative;
-    height: 100%;
-    .search-icon {
-      position: absolute;
-      left: 34rpx;
-      top: 50%;
-      transform: translateY(-50%);
-    }
-  }
-}
-</style>
 <style lang="scss" scoped>
 .my-container {
   background: #f9f9f9;
   position: relative;
   .nav-bar-wrap {
+    color: #fff;
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    z-index: 999;
     .content {
+      position: relative;
+      height: 100%;
       .text {
         text-align: center;
         width: 50vw;
@@ -235,7 +236,7 @@ export default {
         top: 50%;
         transform: translate(-50%, -50%);
         font-weight: bold;
-        font-size: 16px;
+        font-size: 30rpx;
       }
     }
   }
@@ -301,6 +302,9 @@ export default {
           }
         }
         .info-list {
+          display: flex;
+          flex-direction: column;
+          justify-content: space-between;
           margin-left: 32rpx;
           font-size: 24rpx;
           font-weight: 400;
@@ -311,8 +315,15 @@ export default {
             line-height: 35rpx;
             font-weight: 500;
           }
-          .mobile {
-            padding: 13rpx 0 8rpx;
+          .bind-btn {
+            color: #3385ff;
+            width: 181rpx;
+            height: 49rpx;
+            background: #ffffff;
+            border-radius: 8rpx;
+            border: 2rpx solid #3385ff;
+            text-align: center;
+            line-height: 47rpx;
           }
         }
       }
@@ -340,7 +351,7 @@ export default {
         .no-auth {
           text-align: center;
           font-size: 28rpx;
-          margin-top: 20rpx;
+          color: #999999;
         }
         .auth-btn {
           width: 181rpx;
@@ -375,9 +386,40 @@ export default {
       }
     }
 
-    // .info-bot {
-
-    // }
+    .info-bot {
+      padding: 0 20rpx;
+      background-color: #fff;
+      box-shadow: 0px 0rpx 7rpx 1rpx #f0f3f5;
+      border-radius: 8rpx;
+      margin-top: 20rpx;
+      .list-item {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font-size: 34rpx;
+        color: #4a4a4a;
+        padding: 33rpx 34rpx;
+        .icon-area {
+          width: 100rpx;
+        }
+        &:last-child {
+          position: static;
+        }
+      }
+      .my-bot-box {
+        display: flex;
+      }
+    }
+  }
+  .bottom-text {
+    position: fixed;
+    bottom: 130rpx;
+    right: 0;
+    z-index: 9;
+    font-size: 20rpx;
+    color: #999999;
+    width: 100%;
+    text-align: center;
   }
 }
 </style>