浏览代码

扫一扫

seimin 3 年之前
父节点
当前提交
8638fa4923
共有 5 个文件被更改,包括 306 次插入10 次删除
  1. 1 1
      src/http/http.js
  2. 9 0
      src/router/index.js
  3. 5 8
      src/views/Login.vue
  4. 1 1
      src/views/indes.vue
  5. 290 0
      src/views/scanResult.vue

+ 1 - 1
src/http/http.js

@@ -9,7 +9,7 @@ export function SM(Vue) {
9 9
       res = res.data;
10 10
       if (res) {
11 11
         wx.config({
12
-          debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
12
+          debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
13 13
           appId: res.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
14 14
           timestamp: res.timestamp, // 必填,生成签名的时间戳
15 15
           nonceStr: res.nonceStr, // 必填,生成签名的随机串

+ 9 - 0
src/router/index.js

@@ -25,6 +25,7 @@ import Processing from './../views/processing.vue' //处理中页面
25 25
 import Solved from './../views/solved.vue' //已解决页面
26 26
 import Closed from './../views/closed.vue' //已关闭页面
27 27
 import WaitConfirm from './../views/waitConfirm.vue' //待审核页面
28
+import ScanResult from './../views/scanResult.vue' //扫一扫结果页面
28 29
 Vue.use(Router)
29 30
 
30 31
 export default new Router({
@@ -224,6 +225,14 @@ export default new Router({
224 225
     },
225 226
   },
226 227
   {
228
+    path: '/scanResult/:data',
229
+    name: 'ScanResult',
230
+    component: ScanResult,
231
+    meta: {
232
+      allowBack: false
233
+    },
234
+  },
235
+  {
227 236
     path: '*',
228 237
     hidden: true,
229 238
     redirect: {

+ 5 - 8
src/views/Login.vue

@@ -51,7 +51,6 @@ export default {
51 51
           window.location.href = res.data.url;
52 52
         } else {
53 53
           if (res.data.user) {
54
-            that.getConfig();
55 54
             localStorage.setItem(
56 55
               "loginUser",
57 56
               JSON.stringify(res.data.user.user)
@@ -60,7 +59,7 @@ export default {
60 59
               "login_requester",
61 60
               JSON.stringify(res.data.user.requester)
62 61
             );
63
-            this.$router.push({ path: "/main" });
62
+            that.getConfig();
64 63
           }
65 64
         }
66 65
       });
@@ -83,7 +82,6 @@ export default {
83 82
             // alert(3);
84 83
             // alert(JSON.stringify(res.data));
85 84
             if (res.data.user) {
86
-              that.getConfig();
87 85
               localStorage.setItem(
88 86
                 "loginUser",
89 87
                 JSON.stringify(res.data.user.user)
@@ -92,7 +90,7 @@ export default {
92 90
                 "login_requester",
93 91
                 JSON.stringify(res.data.user.requester)
94 92
               );
95
-              this.$router.push({ path: "/main" });
93
+              that.getConfig();
96 94
             }
97 95
           } else if (res.data.state == 501) {
98 96
             that
@@ -126,7 +124,6 @@ export default {
126 124
         .then(function (res) {
127 125
           that.loading = false;
128 126
           if (res.data && res.data.state == 200) {
129
-            that.getConfig();
130 127
             localStorage.setItem(
131 128
               "loginUser",
132 129
               JSON.stringify(res.data.data.user)
@@ -135,7 +132,7 @@ export default {
135 132
               "login_requester",
136 133
               JSON.stringify(res.data.data.requester)
137 134
             );
138
-            that.$router.push({ path: "/main" });
135
+            that.getConfig();
139 136
           }
140 137
         });
141 138
     },
@@ -168,6 +165,7 @@ export default {
168 165
             "wxIncidentWithCmdb",
169 166
             wxIncidentWithCmdb.valueconfig
170 167
           );
168
+          this.$router.push({ path: "/main" });
171 169
         });
172 170
     },
173 171
     // 获取报修人登录方式
@@ -204,13 +202,12 @@ export default {
204 202
       this.$http.post("service/auth/loginEncrypt", postData).then((res) => {
205 203
         that.loading = false;
206 204
         if (res.data && res.data.state == 200) {
207
-          this.getConfig();
208 205
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
209 206
           localStorage.setItem(
210 207
             "login_requester",
211 208
             JSON.stringify(res.data.data.requester)
212 209
           );
213
-          this.$router.push({ path: "/main" });
210
+          this.getConfig();
214 211
         } else {
215 212
           that
216 213
             .$createDialog({

+ 1 - 1
src/views/indes.vue

@@ -247,7 +247,7 @@ export default {
247 247
   methods: {
248 248
     scan(){
249 249
       SM(this).then((ress1) => {
250
-        alert(ress1);
250
+        this.$router.push({name:'ScanResult',params:{data:ress1}});
251 251
       })
252 252
     },
253 253
     // 获取公告列表数据

+ 290 - 0
src/views/scanResult.vue

@@ -0,0 +1,290 @@
1
+<template>
2
+  <div class="order">
3
+    <div class="conentBox">
4
+      <div class="conent">
5
+        <div class="header">资产信息</div>
6
+        <div>
7
+          <div class="label headtop" id="info">{{result[0]}}</div>
8
+
9
+          <div class="info">
10
+            <p>
11
+              <span class="fl">编码:</span>
12
+              <span class="fr">{{result[1]}}</span>
13
+            </p>
14
+            <p>
15
+              <span class="fl">型号:</span>
16
+              <span class="fr">{{result[2]}}</span>
17
+            </p>
18
+            <p>
19
+              <span class="fl">序列号:</span>
20
+              <span class="fr">{{result[3]}}</span>
21
+            </p>
22
+            <p>
23
+              <span class="fl">用途:</span>
24
+              <span class="fr">{{result[4]}}</span>
25
+            </p>
26
+            <p>
27
+              <span class="fl">IP:</span>
28
+              <span class="fr">{{result[5]}}</span>
29
+            </p>
30
+            <p>
31
+              <span class="fl">位置:</span>
32
+              <span class="fr">{{result[6]}}</span>
33
+            </p>
34
+          </div>
35
+        </div>
36
+      </div>
37
+    </div>
38
+  </div>
39
+</template>
40
+
41
+<script>
42
+  export default {
43
+    data(){
44
+      return {
45
+        result:[]
46
+      }
47
+    },
48
+    methods:{
49
+
50
+    },
51
+    created(){
52
+      this.result = JSON.parse(this.$route.params.data);
53
+    }
54
+  }
55
+</script>
56
+
57
+<style lang="less" scoped>
58
+i.iconfont.blue {
59
+  color: #005395;
60
+}
61
+.order {
62
+  .header {
63
+    width: 100%;
64
+    height: 0.88rem;
65
+    line-height: 0.88rem;
66
+    text-align: center;
67
+    color: #fff;
68
+    font-size: 0.37rem;
69
+    background: linear-gradient(#2e2f32, #414246);
70
+    position: fixed;
71
+    top: 0;
72
+    z-index: 6;
73
+  }
74
+  .navBar {
75
+    width: 100%;
76
+    height: 0.96rem;
77
+    line-height: 0.96rem;
78
+    background-color: #fafafa;
79
+    font-size: 0.28rem;
80
+    position: fixed;
81
+    top: 0.88rem;
82
+
83
+    div {
84
+      width: 33.33%;
85
+      text-align: center;
86
+      &.p50{
87
+        width: 49.99% ;
88
+    }
89
+      a {
90
+        display: inline-block;
91
+        height: 0.9rem;
92
+        width: 1.7rem;
93
+        padding: 0 0.1rem;
94
+        &.active {
95
+          color: #005395;
96
+          border-bottom: 0.06rem solid #005395;
97
+        }
98
+      }
99
+    }
100
+  }
101
+
102
+  .headtop {
103
+    margin-top: 0.88rem;
104
+  }
105
+  .label {
106
+    background-color: #eeeeee;
107
+    height: 0.6rem;
108
+    line-height: 0.58rem;
109
+    padding-left: 0.2rem;
110
+    font-size: 0.24rem;
111
+    color: #666666;
112
+    span {
113
+      font-size: 0.2rem;
114
+      display: inline-block;
115
+      margin-left: 0.08rem;
116
+      color: #999999;
117
+    }
118
+    &.formLabel {
119
+      background-color: #fff;
120
+    }
121
+  }
122
+  .conentBox {
123
+    width: 100%;
124
+    .conent {
125
+      font-size: 0.32rem;
126
+      font-weight: 400;
127
+      line-height: 0.45rem;
128
+      // border-bottom: 0.16rem solid #e5e5e5;
129
+
130
+      .shows {
131
+        display: none;
132
+      }
133
+      .boeder_B {
134
+        border-bottom: 0.01rem solid #ccc;
135
+      }
136
+        p {
137
+          &.desc{
138
+            overflow: hidden;
139
+          }
140
+          .grayFont {
141
+            width: 75%;
142
+            text-align: right;
143
+            overflow-x: scroll;
144
+          }
145
+      }
146
+      .bottom {
147
+        overflow: hidden;
148
+        line-height: 0.86rem;
149
+        border-bottom: 0.01rem solid #e6e6e6;
150
+        font-size: 0.24rem;
151
+        color: #999;
152
+        padding: 0 0.24rem 0 0.48rem;
153
+      }
154
+      .info {
155
+        color: #999;
156
+        font-size: 0.28rem;
157
+        overflow: hidden;
158
+        .head {
159
+          border-bottom: 0.01rem solid #e6e6e6;
160
+          p {
161
+            padding: 0.24rem 0.3rem;
162
+            i {
163
+              color: #00559d;
164
+            }
165
+          }
166
+        }
167
+        p {
168
+          line-height: 0.4rem;
169
+          padding: 0.1rem 0.24rem;
170
+          overflow: hidden;
171
+          .overflowEllipsis2 {
172
+            margin-left: 1.96rem;
173
+          }
174
+        }
175
+        .info_hide {
176
+          padding: 0.2rem 0.24rem;
177
+          border-bottom: 0.01rem solid #e6e6e6;
178
+          .hide {
179
+            color: #00559d;
180
+          }
181
+        }
182
+        .imgs-container{
183
+          a{
184
+            color:#03c !important;
185
+            &:visited{
186
+              color: #551a8b !important;
187
+            }
188
+          }
189
+           img {
190
+            width: 1.5rem;
191
+            height: 1.5rem;
192
+            margin-right: 0.7rem;
193
+            &:nth-child(1) {
194
+              margin-left: 0.75rem;
195
+            }
196
+          }
197
+        }
198
+        .progress {
199
+          padding: 0.2rem 0.2rem;
200
+          overflow: hidden;
201
+          transition-duration: .2s;
202
+          transition-timing-function: linear;
203
+          &.progressHide{
204
+            height: 1.7rem;
205
+          }
206
+          .progress_info {
207
+            overflow: hidden;
208
+            margin-bottom: 0.1rem;
209
+            &:nth-last-child(1) {
210
+              .cont {
211
+                border: none !important;
212
+              }
213
+            }
214
+            .progress_info_L {
215
+              float: left;
216
+              color: #333;
217
+              max-width: 18%;
218
+            }
219
+            .progress_info_R {
220
+              float: right;
221
+              margin-left: 0.09rem;
222
+              width: 80%;
223
+              font-size: 0.25rem;
224
+              .time {
225
+                i {
226
+                  margin-left: -0.15rem;
227
+                  &.icon-icon_weizuo {
228
+                    color: #005495;
229
+                  }
230
+                  &.icon-icon_zhengzaijinx {
231
+                    color: #48a843;
232
+                    font-size: 0.37rem;
233
+                  }
234
+                }
235
+                span {
236
+                  margin-left: 0.15rem;
237
+                }
238
+              }
239
+              .cont {
240
+                border-left: 1px solid #999;
241
+                padding-left: 0.4rem;
242
+                min-height: 0.4rem;
243
+                &.blue {
244
+                  border-left: 1px solid #005395;
245
+                }
246
+              }
247
+
248
+              .text1 {
249
+                font-size: 0.15rem;
250
+              }
251
+              .text2 {
252
+                color: #666;
253
+                word-break: break-all;
254
+              }
255
+              p {
256
+                padding: 0;
257
+              }
258
+            }
259
+          }
260
+        }
261
+      }
262
+      .txtLabel {
263
+        width: 100%;
264
+        overflow: hidden;
265
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
266
+        .txt {
267
+          width: 30%;
268
+          color: #666;
269
+        }
270
+        .cube-textarea-wrapper {
271
+          width: 62%;
272
+        }
273
+      }
274
+      .sub {
275
+        background: #ececec;
276
+        .cube-btn {
277
+          background-color: #005395 !important;
278
+          width: 90%;
279
+          margin: 0.2rem auto;
280
+          border-radius: 8px;
281
+        }
282
+      }
283
+    }
284
+  }
285
+  .showwrap {
286
+    width: 75%;
287
+    text-align: right;
288
+  }
289
+}
290
+</style>