yunxing 4 years ago
parent
commit
fefae235a3

+ 7 - 1
src/api/httputils.js

@@ -2,7 +2,7 @@ import axios from 'axios'
 import store from '@/store'
 import router from '@/router'
 // import { MessageBox } from 'element-ui'
-
+import { Toast } from 'vant'
 var CancelToken = axios.CancelToken
 var cancel
 
@@ -62,6 +62,12 @@ axiosservice.interceptors.response.use(
         return res
     },
     function(err) {
+        // TODO: 接口错误处理
+        let { data } = err.response
+        let message = data.path + data.error
+        // console.log(message)
+        Toast.setDefaultOptions({ duration: 3000 })
+        Toast('网络异常,请稍后再试')
         if (err.response.status == 401) {
             // store.commit('SETISREQUESTtAUTH', 'err')
             // router.push({

+ 18 - 1
src/main.ts

@@ -17,8 +17,25 @@ import VConsole from 'vconsole'
 // 开发环境引入 vConsole调试工具
 if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_RealEnv !== 'production') {
     // TODO: vConsole
-    // new VConsole()
+    new VConsole()
 }
+// 打包后,监听deviceready事件,处理 部分设备 不能使用cordova插件方法的问题
+/* if (process.env.NODE_ENV === 'production') {
+    window.addEventListener('deviceready', function() {
+        new Vue({
+            router,
+            store,
+            render: (h) => h(App),
+        }).$mount('#app')
+    })
+} else {
+    // 开发环境
+    new Vue({
+        router,
+        store,
+        render: (h) => h(App),
+    }).$mount('#app')
+} */
 new Vue({
     router,
     store,

+ 10 - 1
src/views/equipmentFacilities/EngineRoomPicture.vue

@@ -150,6 +150,10 @@ export default {
             let postParams = {
                 system_code: this.smsxt,
             }
+            // 搜索 设备间名称
+            if (this.keyword) {
+                data.keyword = `${this.keyword}:wzjc;`
+            }
             // 右弹窗选择专业之后
             if (this.system_code && this.system_code !== '全部') {
                 postParams.system_code = this.system_code
@@ -164,7 +168,7 @@ export default {
             }
             let resData = res.data.data || []
             console.log(resData)
-            resData = resData.filter((v) => v.photos_num)  // TODO:开发时 过滤有图片的列表项
+            resData = resData.filter((v) => v.photos_num) // TODO:开发时 过滤有图片的列表项
             console.log(resData)
             this.list = this.list.concat(resData)
             this.count = res.data.count || 0
@@ -174,6 +178,11 @@ export default {
                 await sleep(1000)
             }
             await this.getList()
+            // list无数据,不执行后续分页查询
+            if (!this.list.length) {
+                this.finished = true
+                return true
+            }
             this.page++
             this.loading = false
             if (this.list.length >= this.count) {

+ 1 - 1
src/views/overview/index.vue

@@ -4,7 +4,7 @@
         <!-- <ImagePreview1 class='overview-img-preview' :visible.sync='showImgPreview' :imgList='imgList' /> -->
         <!-- 轮播 -->
         <div class='my-swipe'>
-            <van-swipe :autoplay='0' indicator-color='white' v-show='imgList.length'>
+            <van-swipe :autoplay='3000' indicator-color='white' v-show='imgList.length'>
                 <van-swipe-item v-for='(image, index) in imgList' :key='index'>
                     <span class='type-name' v-show='image.typename'>{{ image.typename }}</span>
                     <van-image fit='contain' :src='image.url' />