瀏覽代碼

首页入口处 时间判断

zhangsijie 1 年之前
父節點
當前提交
fe4ac6ddc3

+ 6 - 5
pages/cb/index/index.vue

@@ -30,7 +30,7 @@
 						<equipItem @click.native="itemClick(item)" v-bind:item="item" :key="index">
 							<view class="date">
 								<p>设备ID:{{item.imei||item.device_id}}</p>
-								<p>最新上报时间:{{item.addtime|timeFormat}}</p>
+								<p>最新上报时间:{{item.uptime|timeFormat}}</p>
 								<view class="" style="display: flex;justify-content: space-between;" v-if="(device_type == 3 || device_type==7) && $QueryPermission(325)">
 									<p>设备到期情况:<span
 											:class="'prevents_item_bot_sapn'+item.device_expire">{{item.device_expiretext}}</span>
@@ -256,6 +256,9 @@
 				this.loadingtf =false
 				console.log(res)
 				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
+				this.equipArr[act].list.forEach(item => {
+					item.uptime = item.addtime;
+				})
 				for (var i = 0; i < this.equipArr[act].list.length; i++) {
 					if (this.equipArr[act].list[i].device_expire == 0) {
 						this.equipArr[act].list[i]['device_expiretext'] = "未到期"
@@ -313,9 +316,6 @@
 				this.loadingtf = false
 				console.log(res)
 				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
-				this.equipArr[act].list.forEach(item => {
-					item.addtime = item.uptime;
-				})
 				console.log(this.equipArr[act].list)
 			},
 			tabClick(index) {
@@ -328,7 +328,8 @@
 					url: "./search?device_id=" + this.device_id
 				})
 			},
-			itemClick(item) {
+			itemClick(itemOld) {
+				let item = JSON.parse(JSON.stringify(itemOld))
 				item.type = this.equipArr[this.active].type
 				let data = JSON.stringify(item)
 				if (item.type == 10) {

文件差異過大導致無法顯示
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/index/index.js.map


+ 8 - 7
unpackage/dist/dev/mp-weixin/pages/cb/index/index.js

@@ -135,7 +135,7 @@ var render = function () {
     (_vm.device_type == 3 || _vm.device_type == 7) && _vm.$QueryPermission(325)
   var l0 = _vm.__map(_vm.equipArr[_vm.active].list, function (item, index) {
     var $orig = _vm.__get_orig(item)
-    var f0 = _vm._f("timeFormat")(item.addtime)
+    var f0 = _vm._f("timeFormat")(item.uptime)
     return {
       $orig: $orig,
       f0: f0,
@@ -408,6 +408,9 @@ var _default = {
                 _this2.loadingtf = false;
                 console.log(res);
                 _this2.equipArr[act].list = [].concat((0, _toConsumableArray2.default)(_this2.equipArr[act].list), (0, _toConsumableArray2.default)(res.data));
+                _this2.equipArr[act].list.forEach(function (item) {
+                  item.uptime = item.addtime;
+                });
                 for (i = 0; i < _this2.equipArr[act].list.length; i++) {
                   if (_this2.equipArr[act].list[i].device_expire == 0) {
                     _this2.equipArr[act].list[i]['device_expiretext'] = "未到期";
@@ -418,7 +421,7 @@ var _default = {
                   }
                 }
                 console.log(_this2.equipArr[act].list);
-              case 9:
+              case 10:
               case "end":
                 return _context.stop();
             }
@@ -516,11 +519,8 @@ var _default = {
                 _this5.loadingtf = false;
                 console.log(res);
                 _this5.equipArr[act].list = [].concat((0, _toConsumableArray2.default)(_this5.equipArr[act].list), (0, _toConsumableArray2.default)(res.data));
-                _this5.equipArr[act].list.forEach(function (item) {
-                  item.addtime = item.uptime;
-                });
                 console.log(_this5.equipArr[act].list);
-              case 9:
+              case 8:
               case "end":
                 return _context4.stop();
             }
@@ -538,7 +538,8 @@ var _default = {
         url: "./search?device_id=" + this.device_id
       });
     },
-    itemClick: function itemClick(item) {
+    itemClick: function itemClick(itemOld) {
+      var item = JSON.parse(JSON.stringify(itemOld));
       item.type = this.equipArr[this.active].type;
       var data = JSON.stringify(item);
       if (item.type == 10) {