Browse Source

修改区域发布省市问题

guo00guo 5 năm trước cách đây
mục cha
commit
8b509c1fce

+ 27 - 15
src/components/commons/Header2.0.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="header-nav">
+  <div class="header-nav" v-loading="loading">
     <div class="container">
         <div class="nav-location pull-left">
           <i class="el-icon-location-outline" style="margin-right: 5px"></i>
-          <span style="line-height: 34px" v-if="!city && city != ''">{{city}}</span>
-          <span style="line-height: 34px" v-else>暂无</span>
+          <span style="line-height: 34px" v-if="!city || city == ''">暂无</span>
+          <span style="line-height: 34px" v-else>{{city}}</span>
         </div>
         <div class="nav-list pull-right">
           <ul>
@@ -92,6 +92,7 @@
     data(){
       return {
         user: {},
+        loading: false,
         fullScreenLoading: true,
         loginUrl: process.env.LOGIN_URL,
         registerUrl: process.env.REGISTER_URL,
@@ -125,13 +126,23 @@
         },
         getAddress(){
             Http.get(Apis.USER.GET_ADDRESS).then((res) => {
+              console.log(res);
                 this.city = res.city
+              console.log(this.city);
             }).catch((error) => {
                 this.hideLoading()
                 notify('error', '获取定位失败:' + error.data)
             })
         },
+
+        showLoading() {
+          this.loading = true
+        },
+        hideLoading() {
+          this.loading = false
+        },
         setUserInfo () {
+            this.showLoading();
             if (storageGet('user') == null) {
                 storageSave('rolesPermissions', {
                     'isRegionManager': false,
@@ -149,23 +160,25 @@
               // this.fullScreenLoading = false
 
                 getCurrentUser().then((res) => {
-                    // console.log(res)
                     storageSave('user', res)
                     this.user = res
                     this.rolesPermissions = getRolesPermissions(res.roleList)
                     storageSave('rolesPermissions', getRolesPermissions(res.roleList))
                     console.log('用户信息加载成功')
                     this.isLogin = true
-                    this.fullScreenLoading = false
+                    // this.fullScreenLoading = false
+                    this.hideLoading();
                 }).catch((error) => {
                     console.log('用户信息加载失败')
-                    this.fullScreenLoading = false
+                    // this.fullScreenLoading = false
+                    this.hideLoading();
                 })
             } else {
                 this.user = storageGet('user')
-                this.fullScreenLoading = false
+                // this.fullScreenLoading = false
                 this.isLogin = true
             }
+            this.hideLoading();
         },
         getCurrentUserSuccess (res) {
             // console.log(res)
@@ -189,12 +202,12 @@
             })
 
         },
-        showLoading () {
-            this.fullScreenLoading = true
-        },
-        hideLoading () {
-            this.fullScreenLoading = false
-        },
+        // showLoading () {
+        //     this.fullScreenLoading = true
+        // },
+        // hideLoading () {
+        //     this.fullScreenLoading = false
+        // },
         handleClickAuthReject () {
             if (this.user.userVO.authType == 'agency') {
                 this.$router.push({
@@ -357,12 +370,11 @@
         })
     },
     beforeMount () {
+      this.getAddress();
         this.setUserInfo()
         // if (storageGet('user' != null)){
         //   this.isLogin = true
         // }
-        this.getAddress();
-        console.log(this.isLogin)
     }
   }
 </script>

+ 1 - 1
src/components/commons/ProvinceCity.vue

@@ -21,7 +21,7 @@
       style="width: calc(50% - 20px);margin-right: 0px"
     >
       <el-select v-model="city" :loading="loadingCity" @change="cityChanged" placeholder="请选择" :disabled="isModifyMode">
-<!--        <el-option :key="''" :label="'请选择'" :value="''"></el-option>-->
+        <el-option :key="''" :label="'请选择'" :value="''"></el-option>
         <el-option v-for="item in cities" :key="item.code" :label="item.name" :value="item.code"></el-option>
       </el-select>
     </el-form-item>

+ 3 - 1
src/components/project/ProjectCreate.vue

@@ -197,7 +197,7 @@ export default {
         requireDocUrl: '',
         fileUrl: '',
         resource: '0',
-        location: {provinceCode: '3200', cityCode: '3201'},
+        location: {provinceCode: '3200', cityCode: ''},
         institution: {},
         datetime: '',
         price: '',
@@ -356,6 +356,8 @@ export default {
       return provinceName + ' / ' + cityName
     },
     locationChange (provinceId, cityId) {
+      // console.log("测试省:" + provinceId);
+      // console.log("测试市:" + cityId);
       if (provinceId || cityId) {
         this.project.location = {provinceCode: provinceId, cityCode: cityId}
       }

+ 4 - 4
src/pages/DetailPage/UserDetail.vue

@@ -9,12 +9,12 @@
           <!--          <span  class="badge">{{user.photo}}</span>-->
           <img :src="user.photo==null?defaultValue.image:user.photo" style="width: 50px; height: 50px;"/>
         </el-form-item>
-        <el-form-item label="性别" prop="count" v-if="this.gender != null &&  this.gender != ''">
+        <el-form-item label="性别" prop="gender" v-if="user.gender != null &&  user.gender != ''">
           <span>{{user.gender}}</span>
         </el-form-item>
-        <el-form-item label="地址" prop="address">
-          <span class="badge">{{user.address}}</span>
-        </el-form-item>
+<!--        <el-form-item label="地址" prop="address">-->
+<!--          <span class="badge">{{user.address}}</span>-->
+<!--        </el-form-item>-->
         <el-form-item label="接包次数" prop="count">
           <span>{{user.taskCount}}</span>
         </el-form-item>

+ 1 - 1
src/pages/Homepage/Homepage.vue

@@ -54,7 +54,7 @@
           </el-row>
         </el-col>
         <el-col :span="5" class="homepage-right-modules">
-          <LoginCard/>
+<!--          <LoginCard/>-->
           <HotCrowd :applicationTypeRank="homeDataNoCache.applicationTypeRank"/>
           <HotAgency :agencyRank="homeDataNoCache.agencyRank"/>
           <HotUser :userRank="homeDataNoCache.userRank"/>

+ 6 - 6
src/pages/HomepageSearch/UserList.vue

@@ -51,18 +51,18 @@
                 prop="name"
                 label="名称"
                 align="left"
-                width="200">
+                width="300">
               </el-table-column>
               <!--              <el-table-column-->
               <!--                prop="gender"-->
               <!--                align="left"-->
               <!--                label="性别">-->
               <!--              </el-table-column>-->
-              <el-table-column
-                prop="address"
-                align="left"
-                label="省市">
-              </el-table-column>
+<!--              <el-table-column-->
+<!--                prop="address"-->
+<!--                align="left"-->
+<!--                label="省市">-->
+<!--              </el-table-column>-->
               <el-table-column
                 prop="taskCount"
                 align="center"

+ 4 - 5
src/pages/UserCenter/ReBindingMail.vue

@@ -20,7 +20,7 @@
 
 <script>
   import Http from '@/js/http.js'
-  import {storageGet} from '@/js/index'
+  import {storageGet,logout} from '@/js/index'
   import {notify} from '@/constants/index'
 
   export default {
@@ -33,7 +33,7 @@
           const reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
           const email = reg.test(value);
           if (!email) {
-            callback(new Error("请输入正确的邮箱格式"));
+            callback(new Error("请输入正确的邮箱格式,注意去掉前后的空格"));
           } else {
             callback();
           }
@@ -82,13 +82,12 @@
             this.codeTime = 60;
             this.hasVerifyCode = false;
           } else {
-            notify('success', '重新绑定成功');
-            window.alert('密码修改成功,请重新登录');
+            // notify('success', '重新绑定成功');
+            window.alert('邮箱修改成功, 请重新登录');
             logout().then((res) => {
               window.location.href = process.env.LOGIN_URL;
               // this.$router.push('/home')
             })
-            // this.$router.push({path: '/personal/mailBinding'});
           }
         })