whj %!s(int64=4) %!d(string=hai) anos
pai
achega
679a8b3e1c
Modificáronse 1 ficheiros con 43 adicións e 2 borrados
  1. 43 2
      public/testweb/upgrade.html

+ 43 - 2
public/testweb/upgrade.html

xqd xqd
@@ -46,6 +46,9 @@
 <body>
     <div id="main">
         <div class="container" v-if="isInstall">
+            <div v-for="(item,index) in list" style="font-size: .5rem;margin-top: .3rem;" @click="tapvalue(item)">
+                {{item}}
+            </div>
             <input class="inputstyle" type="text" v-model="value" placeholder="请输入你需要升级的设备IMEI号码">
             <button class="btnstyle" @click="installbtn">点击设置</button>
         </div>
@@ -89,12 +92,50 @@
                 equipment: "",
                 isxian: "",
                 versionNum: "",
-                isnew: ""
+                isnew: "",
+                Numarr: [],
+                list: []
             },
             mounted() {
-
+                this.getNum()
+            },
+            watch: {
+                value(newdata, jiu) {
+                    if (typeof newdata === 'string') {
+                        if (newdata.trim().length !== 0) {
+                            this.debounce(this.changeStr, 1500);
+                        } else { }
+                    }
+                    if (newdata == "") {
+                        this.list = []
+                    }
+                }
             },
             methods: {
+                getNum() {
+                    axios.get("/getDevcielist").then(res => {
+                        this.Numarr = res.data.data
+                    })
+                },
+                tapvalue(item) {
+                    this.value = item
+                    this.list = []
+                },
+                changeStr() {
+                    this.list = []
+                    this.Numarr.forEach(item => {
+                        if (item.substr(item.length - 4) == this.value) {
+                            this.list.push(item)
+                        }
+                    })
+                    console.log(this.list)
+                },
+                debounce(fn, wait) {
+                    if (this.fun !== null) {
+                        clearTimeout(this.fun)
+                    }
+                    this.fun = setTimeout(fn, wait)
+                },
                 resetbtn() {
                     if (this.isxian == '在营') {
                         axios.get("/upVersion?id=" + this.value + "&type=" + 2).then(res => {