Kaynağa Gözat

上下班修复

seimin 3 yıl önce
ebeveyn
işleme
341fc0320b
6 değiştirilmiş dosya ile 15207 ekleme ve 635 silme
  1. 34 34
      index.html
  2. 15114 556
      package-lock.json
  3. 1 0
      package.json
  4. 19 17
      src/main.js
  5. 29 20
      src/views/my.vue
  6. 10 8
      src/views/workList.vue

+ 34 - 34
index.html

@@ -1,43 +1,43 @@
1 1
 <!DOCTYPE html>
2 2
 <html>
3
-
4
-<head>
5
-  <meta charset="utf-8">
6
-  <link rel="stylesheet" href="./static/css/iconfont.css">
7
-  <script src="./static/js/JQ-3.3.1.js"></script>
8
-  <meta name="viewport"
9
-    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover">
10
-  <!-- <meta name="viewport" content="width=device-width,intial-scale=1,user-
3
+  <head>
4
+    <meta charset="utf-8" />
5
+    <link rel="stylesheet" href="./static/css/iconfont.css" />
6
+    <script src="./static/js/JQ-3.3.1.js"></script>
7
+    <meta
8
+      name="viewport"
9
+      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover"
10
+    />
11
+    <!-- <meta name="viewport" content="width=device-width,intial-scale=1,user-
11 12
         scalable=no"> -->
12
-  <title>微信运维</title>
13
-  <style>
14
-    html {
15
-      background-color: white;
16
-      height: 100vh;
17
-    }
18
-
19
-    body {
20
-      margin: 0;
21
-      padding: 0;
22
-      background-color: white
23
-    }
13
+    <title>微信运维</title>
14
+    <style>
15
+      html {
16
+        background-color: white;
17
+        height: 100vh;
18
+      }
24 19
 
25
-    img {
26
-      vertical-align: middle
27
-    }
20
+      body {
21
+        margin: 0;
22
+        padding: 0;
23
+        background-color: white;
24
+      }
28 25
 
29
-    a {
30
-      text-decoration: none
31
-    }
32
-  </style>
33
-  <!-- <script src="https://wx2.zuel.edu.cn/thirdparty/nifty/js/jquery-2.2.4.min.js"></script> -->
34
-  <script src="./static/jssdk/jweixin-1.2.0.js"></script>
35
-  <script src="./static/jssdk/jssdk.js"></script>
36
-</head>
26
+      img {
27
+        vertical-align: middle;
28
+      }
37 29
 
38
-<body>
39
-  <div id="app"></div>
40
-</body>
30
+      a {
31
+        text-decoration: none;
32
+      }
33
+    </style>
34
+    <!-- <script src="https://wx2.zuel.edu.cn/thirdparty/nifty/js/jquery-2.2.4.min.js"></script> -->
35
+    <script src="./static/jssdk/jweixin-1.2.0.js"></script>
36
+    <script src="./static/jssdk/jssdk.js"></script>
37
+  </head>
41 38
 
39
+  <body>
40
+    <div id="app"></div>
41
+  </body>
42 42
 </html>
43 43
 <script src="./static/js/public.js"></script>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 15114 - 556
package-lock.json


+ 1 - 0
package.json

@@ -16,6 +16,7 @@
16 16
     "less": "^3.9.0",
17 17
     "less-loader": "^4.1.0",
18 18
     "lib-flexible": "^0.3.2",
19
+    "vconsole": "^3.9.4",
19 20
     "vue": "^2.5.2",
20 21
     "vue-axios": "^2.1.4",
21 22
     "vue-router": "^3.0.1"

+ 19 - 17
src/main.js

@@ -1,29 +1,31 @@
1 1
 // The Vue build version to load with the `import` command
2 2
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
-import Vue from 'vue'
4
-import App from './App'
5
-import router from './router'
6
-import axios from 'axios'
7
-import Cube from './index'
8
-import 'lib-flexible'
9
-import './filters'
3
+import Vue from "vue";
4
+import App from "./App";
5
+import router from "./router";
6
+import axios from "axios";
7
+import Cube from "./index";
8
+import "lib-flexible";
9
+import "./filters";
10
+// import VConsole from "vconsole";
10 11
 // import host from '../src/request/host'
11 12
 // import {get,post} from './service/http'
12
-Vue.use(Cube)
13
+// new VConsole();
14
+Vue.use(Cube);
13 15
 // 修改请求接口(删掉地址栏中的app2)
14
-let domainName = document.domain;//域名
15
-let protocolName = document.location.protocol;//http协议
16
-axios.defaults.baseURL=protocolName + '//' + domainName;
16
+let domainName = document.domain; //域名
17
+let protocolName = document.location.protocol; //http协议
18
+axios.defaults.baseURL = protocolName + "//" + domainName;
17 19
 
18 20
 // axios.defaults.timeout = 5000;
19
-Vue.prototype.$http= axios
20
-Vue.config.productionTip = false
21
-Vue.prototype.$host = protocolName + '//' + domainName;
21
+Vue.prototype.$http = axios;
22
+Vue.config.productionTip = false;
23
+Vue.prototype.$host = protocolName + "//" + domainName;
22 24
 
23 25
 /* eslint-disable no-new */
24 26
 new Vue({
25
-  el: '#app',
27
+  el: "#app",
26 28
   router,
27 29
   components: { App },
28
-  template: '<App/>'
29
-})
30
+  template: "<App/>"
31
+});

+ 29 - 20
src/views/my.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div class="bgColor">
3 3
     <div class="head">
4
-      <div class="img" @click="goToWork(loginUser.online)">
4
+      <div class="img" @click="getLocation(loginUser.online)">
5 5
         {{ loginUser.online == 1 ? "下班" : "上班" }}
6 6
       </div>
7 7
       <div class="name">{{ loginUser.name }}</div>
@@ -127,40 +127,49 @@ export default {
127 127
       promptingConent: "",
128 128
       promptingStatus: "",
129 129
       groups: "", //工作组
130
-      candidateGroups: ""
130
+      candidateGroups: "",
131
+      toast: null
131 132
     };
132 133
   },
133 134
   methods: {
134 135
     //获取位置,经纬度
135
-    getLocation() {
136
+    getLocation(online) {
137
+      let _this = this;
138
+      this.toast = this.$createToast({
139
+        time: 0,
140
+        mask: true,
141
+        txt: "正在加载中"
142
+      });
143
+      this.toast.show();
136 144
       //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
137
-      sdk.getLocation(function(res) {
145
+      sdk.getLocation(res => {
138 146
         // alert(JSON.stringify(res));
139 147
         // latitude
140 148
         // longitude
141
-        return this.$http.get(
142
-          `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=TADBZ-IRBWU-QAXVE-2IWED-UW2F5-YVF66`
143
-        );
149
+        $.ajax({
150
+          url: "https://apis.map.qq.com/ws/geocoder/v1",
151
+          data: {
152
+            location: res.latitude + "," + res.longitude,
153
+            key: "TADBZ-IRBWU-QAXVE-2IWED-UW2F5-YVF66",
154
+            output: "jsonp"
155
+          },
156
+          dataType: "jsonp",
157
+          success: function(result) {
158
+            if (result.status === 0) {
159
+              let address = result.result.formatted_addresses.recommend;
160
+              _this.goToWork(online, address);
161
+            }
162
+          }
163
+        });
144 164
       });
145 165
     },
146 166
     // 上下班
147
-    async goToWork(online) {
148
-      const toast = this.$createToast({
149
-        time: 0,
150
-        mask: true,
151
-        txt: "正在加载中"
152
-      });
153
-      toast.show();
154
-      let address = "";
155
-      let addressResult = await this.getLocation();
156
-      if (addressResult.status === 0) {
157
-        address = addressResult.result.formatted_addresses.recommend;
158
-      }
167
+    goToWork(online, address) {
159 168
       online = online == 1 ? 0 : 1;
160 169
       this.$http
161 170
         .post("service/auth/online", { onlion: online, address })
162 171
         .then(res => {
163
-          toast.hide();
172
+          this.toast.hide();
164 173
           if (res.status == 200) {
165 174
             this.loginUser.online = online;
166 175
             localStorage.setItem("loginUser", JSON.stringify(this.loginUser));

+ 10 - 8
src/views/workList.vue

@@ -40,8 +40,10 @@
40 40
                   </div>
41 41
                 </div>
42 42
                 <div class="center">
43
-                  <span>{{ item.opValue == 1 ? "上班" : "下班" }}打卡</span>
44
-                  <span>打卡地址:{{ item.adderss || "无" }}</span>
43
+                  <div>{{ item.opValue == 1 ? "上班" : "下班" }}打卡</div>
44
+                  <div style="word-break:break-all;text-align:justify;">
45
+                    打卡地址:{{ item.extra1 || "无" }}
46
+                  </div>
45 47
                 </div>
46 48
               </div>
47 49
             </div>
@@ -351,7 +353,8 @@ export default {
351 353
   border-top: 0.01rem rgb(223, 222, 222) solid;
352 354
   border-bottom: 0.01rem rgb(223, 222, 222) solid;
353 355
 }
354
-.cube-btn-light {
356
+.cube-btn-light,
357
+.cube-select {
355 358
   box-shadow: none;
356 359
   border-bottom: 0.02rem solid #e5e5e5;
357 360
 }
@@ -466,9 +469,8 @@ export default {
466 469
     line-height: 0.45rem;
467 470
     border-bottom: 0.16rem solid #e5e5e5;
468 471
     .head {
469
-      // border-bottom: 0.01rem solid #e6e6e6;
470 472
       .head_d {
471
-        padding: 0.24rem 0.48rem;
473
+        padding: 0.12rem 0.48rem;
472 474
         display: flex;
473 475
         span {
474 476
           flex: 1;
@@ -482,9 +484,9 @@ export default {
482 484
     .center {
483 485
       color: #333333;
484 486
       border-bottom: 0.01rem solid #e6e6e6;
485
-      padding: 0.24rem 0.48rem;
486
-      display: flex;
487
-      justify-content: space-between;
487
+      div {
488
+        padding: 0.12rem 0.48rem;
489
+      }
488 490
     }
489 491
     .bottom {
490 492
       display: flex;