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

增加窗口关闭和登录调用量

mork 1 долоо хоног өмнө
parent
commit
fa674acf68

+ 35 - 8
src/views/HomeView.vue

@@ -101,19 +101,15 @@
     </div>
 
     <div :class="isMobile == true ? 'zoombtn-mb':'zoombtn'">
-      <div style="padding: 10px;
-    padding-bottom: 5px;
-    cursor: pointer;"
+      <div style="padding: 10px 10px 5px;cursor: pointer;"
     @click="mapZoom('max')"><Plus style="width: 1em; height: 1em;" /></div>
-      <div style="padding: 10px;
-    padding-top: 5px;
-    cursor: pointer;"
+      <div style="padding: 5px 10px 5px;cursor: pointer;"
     @click="mapZoom('min')"><Minus style="width: 1em; height: 1em;" /></div>
     </div>
 
     <KDYJS ref="kdyjs" :message="parentMessage"></KDYJS>
 
-    <div class="tips">试运行阶段服务范围:夏阳街道</div>
+    <div class="tips">试运行阶段服务范围:夏阳街道、盈浦街道</div>
     <div class="yjdpInfoDialog" v-show="yjdpInfoDialogShow">
       <div class="close" @click="closeYJDP">×</div>
       <div class="content" v-if="nowPoint != null">
@@ -165,7 +161,7 @@
       </el-form>
       <template #footer>
         <div class="dialog-footer">
-          <el-button @click="closeYHFK">取消</el-button>
+          <el-button @click="closeYHFK" style="margin-right: 10px;">取消</el-button>
           <el-button type="primary" @click="yhfkSubmit">提交</el-button>
         </div>
       </template>
@@ -302,6 +298,8 @@ import Header from "@/components/Header.vue";
 import KDYJS from "@/views/KDYJS.vue";
 import UTIL from '@/utils/util'
 
+import login from "@/api/login";
+
 export default {
   name: "HomeView",
   components: {
@@ -395,6 +393,8 @@ export default {
     let that = this;
     that.isMobile = UTIL.terminalType()
     this.$refs.kdyjs.open();
+    //增加访问调用量
+    this.initLogin();
     // 监听message事件
     window.addEventListener('message', this.handleMessage);
     let timer = setInterval(function() {
@@ -410,6 +410,33 @@ export default {
     window.removeEventListener('message', this.handleMessage);
   },
   methods: {
+    initLogin(){
+      let form = {
+        userName: "user_kdyjs_web",
+        password: "Kdyjs@1234",
+        clientId: webConfig.serviceId
+      }
+      login
+      .login(form)
+      .then(data => {
+        if (data.code === 200) {
+          localStorage.setItem(
+            webConfig.AUTH_USER_TOKEN_KEY,
+            data.message
+          );
+          localStorage.setItem("userInfo", JSON.stringify(data.content)); 
+          webConfig.oauthToken = data.message;
+          // that.$store.state.login = true;
+          // that.$store.state.user = data.content;
+          // that.$router.push("/");
+          ElMessage({
+            message: "登录成功",
+            type: "success",
+            duration: 1500
+          });
+        }
+      })
+    },
     mapZoom(type){
          mapTriggerEvent("mapZoom", { type: type });
     },

+ 30 - 2
src/views/KDYJS.vue

@@ -27,6 +27,9 @@
             </template>
           </el-input>
           <div class="addressPanel" v-show="addressPanelShow">
+            <div style="position: absolute;left: 350px;z-index: 9999;cursor: pointer;top: 45px;color: #6b6b6b;" title="关闭"  @click="closeSeachWin">
+              <Close style="width: 1em; height: 1em; margin-right: 8px;padding: 5px;" />
+            </div>
             <el-scrollbar>
               <ul>
                 <li v-for="(item, index) in searchResultList" :key="index" :class="searchSelect == index ? 'active' : ''" @click="judgeHandle(item,index)">
@@ -44,6 +47,9 @@
           <!-- v-show="resultPanelShow" -->
           <div class="resultPanel1" v-show="resultPanelShow">
             <div class="title">
+              <div style="position: absolute;left: 350px;z-index: 9999;cursor: pointer;color: #6b6b6b;margin-top: 6px;" title="关闭"  @click="closePositionWin">
+                <Close style="width: 1em; height: 1em; margin-right: 8px;padding: 5px;" />
+              </div>
               <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;padding-right: 20px;">
                 <img src="../../public/static/image/location-icon.png" style="width: 20px;vertical-align: middle;padding: 0 10px 0 20px;" />
                 <span>{{searchTitle}}</span>
@@ -106,8 +112,13 @@
               </el-scrollbar>
             </div>
           </div>
-          <div class="resultPanel2" v-show="resultPanelShow">
-            <div class="title"><img src="../../public/static/image/popup-icon.png" style="width: 20px;vertical-align: middle;padding: 0 10px 0 20px;" />该地址周边500m内分布</div>
+          <div class="resultPanel2" v-show="resultPanelShow2">
+            
+            <div class="title">
+              <div style="position: absolute;left: 350px;z-index: 9999;cursor: pointer;color: #6b6b6b;margin-top: 6px;" title="关闭"  @click="closePositionBuffWin">
+                <Close style="width: 1em; height: 1em; margin-right: 8px;padding: 5px;" />
+              </div>
+              <img src="../../public/static/image/popup-icon.png" style="width: 20px;vertical-align: middle;padding: 0 10px 0 20px;" />该地址周边500m内分布</div>
             <div class="resultPanel2content">
               <el-scrollbar>
                 <ul v-if="nearShopResult.length > 0">
@@ -255,6 +266,7 @@ export default {
 
       addressPanelShow: false,
       resultPanelShow: false,
+      resultPanelShow2: false,
 
       bgrImg: require('../../public/static/image/zc-r.png'),
       bggImg:require('../../public/static/image/zc-g.png'),
@@ -399,6 +411,7 @@ export default {
               that.addressPanelShow = true;
               that.resultPanelShow_mb = false;
               that.resultPanelShow = false;
+              that.resultPanelShow2 = false;
               
               let obj = {}
               result.content.pois.map(function (item) {
@@ -416,6 +429,7 @@ export default {
               that.addressPanelShow = true;
               that.resultPanelShow_mb = false;
               that.resultPanelShow = false;
+              that.resultPanelShow2 = false;
               ElMessage({
                 message: '未查到该地址或地址输入不准确!',
                 type: 'warning',
@@ -440,6 +454,7 @@ export default {
         this.nearShopResult = []
         this.addressPanelShow = false;
         this.resultPanelShow = false;
+        this.resultPanelShow2 = false;
         this.resultPanelShow_mb = false;
       }
     },
@@ -738,6 +753,7 @@ export default {
             }
         }else{
           that.resultPanelShow = true
+          that.resultPanelShow2 = true
           
         }
        
@@ -777,7 +793,19 @@ export default {
     handleDrawerClose(){
       let that = this;
       that.resultPanelShow = false
+      that.resultPanelShow2 = false
       that.resultPanelShow_mb = false;
+    },
+    closeSeachWin(){
+      this.addressPanelShow = false
+      this.resultPanelShow = false
+      this.resultPanelShow2 = false
+    },
+    closePositionWin(){
+      this.resultPanelShow = false
+    },
+    closePositionBuffWin(){
+      this.resultPanelShow2 = false
     }
   }
 };