Browse Source

新增移动端我的界面

shenjj 7 years ago
parent
commit
907b9733ec
2 changed files with 47 additions and 37 deletions
  1. 3 3
      components/mobile/common/userHeader.vue
  2. 44 34
      pages/mobile/user/index.vue

+ 3 - 3
components/mobile/common/userHeader.vue

@@ -69,9 +69,9 @@
           this.$store.dispatch('loadUserInfo').then(() => {
             this.$emit('switchEnAction')
           })
-          this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
-            this.$emit('updateLoad')
-          })
+          // this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
+          //   this.$emit('updateLoad')
+          // })
         })
       },
       setShowEnterpriseToggle(flag, e) {

+ 44 - 34
pages/mobile/user/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="user-content mobile-content">
-    <user-header @updateLoad="updateEnterpriseInfo"></user-header>
+    <user-header @switchEnAction="updateEnterpriseInfo"></user-header>
     <ul class="switch-list">
       <li :class="{active: activeType === 'store'}" @click="swtichTab('store')">店铺管理</li>
       <li :class="{active: activeType === 'Account'}" @click="swtichTab('Account')">账户管理</li>
@@ -99,9 +99,9 @@
             </div>
           </li>
         </ul>
-        <div class="control clearfix">
-          <div class="cancel" @click="storeInfosave('cancel')" v-if="storeState !== 'look'">取消</div>
-          <div class="save" @click="storeInfosave()" v-if="storeState !== 'look'">保存</div>
+        <div class="control clearfix" v-if="storeState !== 'look'">
+          <div class="cancel" @click="storeInfosave('cancel')" >取消</div>
+          <div class="save" @click="storeInfosave()">保存</div>
         </div>
       </template>
       <template v-else>
@@ -116,7 +116,7 @@
 
     <!-- 账户管理 -->
     <template v-else>
-      <div class="topinfo clearfix" v-show="enterpriseInfo.enName">
+      <div class="topinfo clearfix" v-if="enterpriseInfo.enName">
         <div class="pull-left">
           企业信息
         </div>
@@ -125,7 +125,7 @@
           编辑
         </div>
       </div>
-      <ul class="infoul infoul2" v-show="enterpriseInfo.enName">
+      <ul class="infoul infoul2" v-if="enterpriseInfo.enName">
         <li class="clearfix" :class="{noupdate:  storeState !== 'look'}">
           <div class="name pull-left" :class="{update: storeState !== 'look'}" >企业名称:</div>
           <div class="text pull-left" :class="{update: storeState !== 'look'}">
@@ -165,10 +165,10 @@
           <div class="text pull-left" v-if="storeState === 'look'">
             {{enterpriseInfo.enIndustry || '-'}}
           </div>
-          <div v-else class="text pull-left clearfix">
+          <div v-else class="text pull-left clearfix" @click="isShowTypeAlert = true">
             <input v-model="enterpriseInfo.enIndustry" type="text" style="width: 4.5rem" readonly/>
-            <div class="moreIcon pull-right" @click="isShowTypeAlert = true">
-              <img src="/images/store/default/moreicon.png" @click="isShowTypeAlert = true"/>
+            <div class="moreIcon pull-right">
+              <img src="/images/store/default/moreicon.png" />
             </div>
           </div>
         </li>
@@ -223,10 +223,10 @@
           </li>
         </ul>
 
-        <div class="topinfo clearfix" style="color: #999;border-top: 1px solid #d9d9d9;background: #fafafa" v-show="admininfo.userName">
+        <div class="topinfo clearfix" style="color: #999;border-top: 1px solid #d9d9d9;background: #fafafa" v-if = "admininfo.userName">
           管理员信息
         </div>
-        <ul class="infoul infoul2" style="color: #999;background: #fafafa" v-show="admininfo.userName">
+        <ul class="infoul infoul2" style="color: #999;background: #fafafa" v-if="admininfo.userName">
           <li class="clearfix">
             <div class="name pull-left">姓名:</div>
             <div class="text pull-left">
@@ -247,9 +247,9 @@
           </li>
         </ul>
       </template>
-      <div class="control clearfix">
-        <div class="cancel" @click="storeInfosave('cancel')" v-if="storeState !== 'look'">取消</div>
-        <div class="save" @click="storeInfosave()" v-if="storeState !== 'look'">保存</div>
+      <div class="control clearfix" v-if="storeState !== 'look'">
+        <div class="cancel" @click="storeInfosave('cancel')">取消</div>
+        <div class="save" @click="storeInfosave()">保存</div>
       </div>
     </template>
     <!-- /end 账户管理 -->
@@ -263,7 +263,7 @@
         </div>
         <div class="content-title-label clearfix" >
           <div v-for="(item, index) in ContentTitleArray" @click="chooseTitle(index)">
-            <a>{{item}}</a>
+            <a :class="{active: index === titleActive}">{{item}}</a>
           </div>
         </div>
         <div class="content-info" v-if="TypeListShow.firstListShow">
@@ -331,7 +331,8 @@
         },
         TypeObj: {},
         enterpriseInfo: {},
-        hidelook: true
+        hidelook: true,
+        titleActive: ''
       }
     },
     components: {
@@ -381,18 +382,21 @@
               secondsListShow: false,
               threetListShow: false
           }
+          this.titleActive = 0
         } else if (key === 1) {
           this.TypeListShow = {
             firstListShow: false,
             secondsListShow: true,
             threetListShow: false
           }
+          this.titleActive = 1
         } else if (key === 2) {
           this.TypeListShow = {
             firstListShow: false,
             secondsListShow: true,
             threetListShow: false
           }
+          this.titleActive = 2
         }
       },
       chooseItem(listIndex, key, index) {
@@ -400,7 +404,7 @@
           this.TypeListActive.firstListActive = index
           this.ContentTitleArray[0] = key
           this.TypeList.secondsList = []
-
+          this.titleActive = 0
           if (this.TypeObj[key] instanceof Array) {
             this.TypeList.secondsList = this.TypeObj[key]
           } else {
@@ -423,6 +427,7 @@
           this.TypeListActive.secondsListActive = index
           this.TypeListActive.threetListActive = ''
           this.ContentTitleArray[1] = key
+          this.titleActive = 1
           if (this.TypeObj[this.ContentTitleArray[0]][key] instanceof Array) {
             this.TypeList.threetList = this.TypeObj[this.ContentTitleArray[0]][key] ? this.TypeObj[this.ContentTitleArray[0]][key] : []
           }
@@ -445,6 +450,7 @@
             }
           }
         } else if (listIndex === 'threetList') {
+          this.titleActive = 2
           this.TypeListActive.threetListActive = index
           this.ContentTitleArray[2] = key
           this.enterpriseInfo.enIndustry = key
@@ -510,20 +516,21 @@
         this.clearInfo()
         // let str = JSON.stringify(this.$store.state.supplier.material.enUser.data)
         // this.enterpriseInfo = JSON.parse(str)
-        console.log(this.enterpriseInfo)
-        if (this.storeInfo.enUU) {
-          this.$store.dispatch('supplier/loadEnUser', {enUU: this.storeInfo.enUU, filter: 'enUU'}).then(() => {
-            this.scopeLabel = this.enterpriseInfo.enBusinessScope ? this.enterpriseInfo.enBusinessScope.split(',') : []
-            if (!this.enterpriseInfo.enAdminuu) {
-              this.isSearchSearchingMore = false
-              return false
-            }
-            this.$http.get(`/basic/user/getUserByUU?uu=${this.enterpriseInfo.enAdminuu}`).then(res => {
-              this.admininfo = res.data
-              this.isSearchSearchingMore = false
+        this.$store.dispatch('loadStoreStatus', { op: 'check' }).then(() => {
+          if (this.storeInfo.enUU) {
+            this.$store.dispatch('supplier/loadEnUser', {enUU: this.storeInfo.enUU, filter: 'enUU'}).then(() => {
+              this.scopeLabel = this.enterpriseInfo.enBusinessScope ? this.enterpriseInfo.enBusinessScope.split(',') : []
+              if (!this.enterpriseInfo.enAdminuu) {
+                this.isSearchSearchingMore = false
+                return false
+              }
+              this.$http.get(`/basic/user/getUserByUU?uu=${this.enterpriseInfo.enAdminuu}`).then(res => {
+                this.admininfo = res.data
+                this.isSearchSearchingMore = false
+              })
             })
-          })
-        }
+          }
+        })
       },
       updateInfo() {
         this.storeState = 'update'
@@ -618,7 +625,7 @@
 <style scoped lang="scss">
   .user-content{
     margin-bottom: 0rem;
-    padding-bottom: 1.4rem;
+    padding-bottom: 0.98rem;
     ul.switch-list {
       li {
         display: inline-block;
@@ -790,7 +797,7 @@
         max-width: 3rem;
       }
       .updatespan {
-        background: #353535;
+        background: #666;
         color: #fff;
         font-size: 0.26rem;
         padding:0 2px;
@@ -893,13 +900,16 @@
           a {
             height: 0.5rem;
             line-height: 0.5rem;
-            color: #3f84f6 !important;
-            border-bottom: 0.01rem solid #3f84f6;
+            color: #333 !important;
             display: inline-block;
             width: 80%;
             overflow: hidden;
             text-overflow: ellipsis;
             white-space: nowrap;
+            &.active {
+              color: #3e82f5 !important;
+              border-bottom: 1px solid #3e82f5;
+            }
           }
         }
       }