Blame view

dist/static/js/pages/news/main.js 14.8 KB
ce4c83ff   wxy   初始提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  global.webpackJsonp([16],{
  
  /***/ 273:
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _vue = __webpack_require__(1);
  
  var _vue2 = _interopRequireDefault(_vue);
  
  var _index = __webpack_require__(274);
  
  var _index2 = _interopRequireDefault(_index);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var app = new _vue2.default(_index2.default);
  app.$mount();
  
  exports.default = {
    config: {
      navigationStyle: 'custom'
    }
  };
  
  /***/ }),
  
  /***/ 274:
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(276);
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__);
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
41
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_3594dd57_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__ = __webpack_require__(277);
ce4c83ff   wxy   初始提交
42
43
44
45
46
47
48
49
50
51
52
53
54
  var disposed = false
  function injectStyle (ssrContext) {
    if (disposed) return
    __webpack_require__(275)
  }
  var normalizeComponent = __webpack_require__(0)
  /* script */
  
  /* template */
  
  /* styles */
  var __vue_styles__ = injectStyle
  /* scopeId */
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
55
  var __vue_scopeId__ = "data-v-3594dd57"
ce4c83ff   wxy   初始提交
56
57
58
59
  /* moduleIdentifier (server only) */
  var __vue_module_identifier__ = null
  var Component = normalizeComponent(
    __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default.a,
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
60
    __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_3594dd57_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__["a" /* default */],
ce4c83ff   wxy   初始提交
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
    __vue_styles__,
    __vue_scopeId__,
    __vue_module_identifier__
  )
  Component.options.__file = "src\\pages\\news\\index.vue"
  if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")}
  if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")}
  
  /* hot reload */
  if (false) {(function () {
    var hotAPI = require("vue-hot-reload-api")
    hotAPI.install(require("vue"), false)
    if (!hotAPI.compatible) return
    module.hot.accept()
    if (!module.hot.data) {
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
76
      hotAPI.createRecord("data-v-3594dd57", Component.options)
ce4c83ff   wxy   初始提交
77
    } else {
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
78
      hotAPI.reload("data-v-3594dd57", Component.options)
ce4c83ff   wxy   初始提交
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
    }
    module.hot.dispose(function (data) {
      disposed = true
    })
  })()}
  
  /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  
  
  /***/ }),
  
  /***/ 275:
  /***/ (function(module, exports) {
  
  // removed by extract-text-webpack-plugin
  
  /***/ }),
  
  /***/ 276:
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _promise = __webpack_require__(12);
  
  var _promise2 = _interopRequireDefault(_promise);
  
  var _toConsumableArray2 = __webpack_require__(34);
  
  var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  //
  
  var hideArrBeforeSelect = [];
  exports.default = {
    data: function data() {
      return {
        news: [],
        types: [],
        statusBarHeight: 20,
        navBarHeight: 44,
        top: -600,
        showFilter: false,
        hideArr: [],
        hasLoad: false
      };
    },
  
    methods: {
      getNews: function getNews(e) {
        var _this = this;
  
        if (e === 'refresh' && this.showFilter) return;
        this.hasLoad = false;
        var _timestamp = new Date().getTime();
        var hideArr = this.hideArr;
        var allTypeSelected = hideArr.indexOf(true) < 0;
        var selectedTypes = [];
        this.types.forEach(function (v, i) {
          if (!hideArr[i]) selectedTypes.push(v);
        });
        if (hideArr[0] === false) selectedTypes = [];
        wx.request({
          url: this.rootUrl + '/jpub/list',
          method: selectedTypes.length ? 'POST' : 'GET',
          header: { 'content-type': 'application/x-www-form-urlencoded' },
          data: selectedTypes.length ? { tags: selectedTypes.join(',') } : undefined,
          success: function success(res) {
            var news = res.data;
            news.forEach(function (v) {
              var timeObj = _this.service.correctTime(v.createDate, 'all');
              v.timeFull = timeObj.full;
              v.createDate = timeObj.semantic;
            });
            console.log(res.data);
            _this.news = news;
            wx.setStorageSync('newsList', news);
            if (_this.news.length) {
              if (new Date().getTime() - _timestamp < 500) {
                setTimeout(function () {
                  _this.hasLoad = true;
                  if (e === 'refresh') wx.showToast({ title: '已刷新' });
                }, 500);
              } else {
                _this.hasLoad = true;
                if (e === 'refresh') wx.showToast({ title: '已刷新' });
              }
            } else _this.hasLoad = true;
          }
        });
      },
      getTypes: function getTypes() {
        var _this2 = this;
  
        wx.request({
          url: this.rootUrl + '/jpub/tags',
          success: function success(res) {
            var types = ['全部'].concat((0, _toConsumableArray3.default)(res.data.map(function (v) {
              return v.info_Tag;
            })));
            if (types.toString() !== _this2.types.toString()) {
              var hideArr = new Array(types.length).fill(true);
              hideArr[0] = false;
              _this2.hideArr = hideArr;
            }
            _this2.types = types;
          }
        });
      },
      navigateToDetail: function navigateToDetail(i) {
        wx.navigateTo({ url: '../newsDetail/main?index=' + i });
      },
      _showFilter: function _showFilter() {
        var _this3 = this;
  
        if (!this.showFilter) {
          this.top = this.navBarHeight;
          hideArrBeforeSelect = this.hideArr.concat();
          setTimeout(function () {
            _this3.showFilter = true;
          }, 100);
        }
      },
      changeSelect: function changeSelect(i) {
        // 多选
        // this.$set(this.hideArr,i,this.hideArr[i] ? false : true)
  
        //单选
        var hideArr = new Array(this.types.length).fill(true);
        hideArr[i] = false;
        this.hideArr = hideArr;
      },
      cancel: function cancel() {
        var _this4 = this;
  
        this.top = -600;
        setTimeout(function () {
          _this4.hideArr = hideArrBeforeSelect.concat();
          _this4.showFilter = false;
        }, 100);
      },
      confirm: function confirm() {
        var _this5 = this;
  
        this.top = -600;
        this.getNews();
        setTimeout(function () {
          _this5.showFilter = false;
        }, 100);
      },
      checkAuth: function checkAuth() {
        return new _promise2.default(function (resolve) {
          wx.getSetting({
            success: function success(res) {
              resolve(res.authSetting['scope.userInfo']);
            }
          });
        });
      },
      getUnionId: function getUnionId() {
        var _this6 = this;
  
        return new _promise2.default(function (resolve) {
          _this6.service.getUnionId(_this6.rootAvatar, _this6.rootUrl).then(function (res) {
            if (res === 'unverified') {
              wx.setStorageSync('isVerify', false);
              wx.redirectTo({ url: '../verify/main' });
              resolve(false);
            } else resolve(true);
          });
        });
      }
    },
    onLoad: function onLoad() {
      var _this7 = this;
  
      this.getUnionId();
  
      wx.getSystemInfo({
        success: function success(res) {
          _this7.statusBarHeight = res.statusBarHeight;
          var mbbc = void 0;
          try {
            mbbc = wx.getMenuButtonBoundingClientRect() ? wx.getMenuButtonBoundingClientRect() : null;
            if (!mbbc) {
              throw new Error('getMenuButtonBoundingClientRect error');
            } else {
              _this7.navBarHeight = mbbc.bottom + mbbc.top - res.statusBarHeight;
ce4c83ff   wxy   初始提交
305
            }
ce4c83ff   wxy   初始提交
306
          } catch (e) {
ce4c83ff   wxy   初始提交
307
308
309
310
311
            _this7.navBarHeight = 44;
            _this7.statusBarHeight = 20;
          }
        },
        fail: function fail(err) {
ce4c83ff   wxy   初始提交
312
313
314
315
          _this7.navBarHeight = 44;
          _this7.statusBarHeight = 20;
        }
      });
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
316
  
ce4c83ff   wxy   初始提交
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
      this.checkAuth().then(function (res) {
        if (!res) wx.redirectTo({ url: '../welcome/main' });
      });
    },
    onShow: function onShow() {
      var _this8 = this;
  
      this.getTypes();
      if (!wx.getStorageSync('isVerify')) this.getUnionId().then(function (res) {
        if (res) _this8.getNews();
      });else this.getNews();
    },
    onUnload: function onUnload() {
      this.hasLoad = false;
    }
  };
  
  /***/ }),
  
  /***/ 277:
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
    return _c('div', {
      staticClass: "container"
    }, [_c('div', {
      staticClass: "nav-bar",
      style: ('height:' + _vm.navBarHeight + 'px'),
      attrs: {
        "catchtouchmove": ""
      }
    }, [_c('div', {
      class: {
        fade: _vm.showFilter
      },
      attrs: {
        "eventid": '0'
      },
      on: {
        "tap": function($event) {
          _vm.getNews('refresh')
        }
      }
    }, [_c('img', {
      class: {
        rotate: !_vm.hasLoad
      },
      style: ('margin-top:' + _vm.statusBarHeight + 'px;'),
      attrs: {
        "src": "/static/imgs/refresh_arrow.png"
      }
    })]), _vm._v(" "), _c('div', {
      class: {
        fade: _vm.showFilter
      },
      attrs: {
        "eventid": '1'
      },
      on: {
        "tap": _vm._showFilter
      }
    }, [_c('img', {
      style: ('margin-top:' + _vm.statusBarHeight + 'px;'),
      attrs: {
        "src": "/static/imgs/filter.png"
      }
    })])]), _vm._v(" "), _c('div', {
      staticClass: "nav-bar-blank",
      style: ('height:' + _vm.navBarHeight + 'px;')
    }), _vm._v(" "), _vm._l((_vm.news), function(v, i) {
      return _c('div', {
        key: i,
        staticClass: "news-item",
        attrs: {
          "hover-class": "hover",
          "eventid": '2-' + i
        },
        on: {
          "tap": function($event) {
            _vm.navigateToDetail(i)
          }
        }
      }, [_c('div', [_c('div', {
        staticClass: "title"
      }, [(v.is_Top) ? _c('div', {
        staticClass: "top"
      }, [_vm._v("置顶")]) : _vm._e(), (v.is_Top) ? _c('div', {
        staticClass: "blank"
      }) : _vm._e(), _vm._v(_vm._s(v.info_Title))]), _vm._v(" "), _c('div', {
        staticClass: "time"
      }, [_c('div', {
        staticClass: "tag"
      }, [_vm._v(_vm._s(v.info_Tag))]), _vm._v("   浏览" + _vm._s(v.read_Count) + "   " + _vm._s(v.createDate))])]), _vm._v(" "), _c('img', {
        attrs: {
          "src": _vm.rootAvatar + v.title_Pic,
          "mode": "aspectFill",
          "lazy-load": ""
        }
      })])
    }), _vm._v(" "), (_vm.news.length === 0 && _vm.hasLoad) ? _c('div', {
      staticClass: "nodata"
    }, [_c('img', {
      attrs: {
        "src": "/static/images/empty.png"
      }
    }), _vm._v("暂无内容")]) : _vm._e(), _vm._v(" "), _c('div', {
      staticClass: "filter-bar",
      style: ('top:' + _vm.top + 'px;'),
      attrs: {
        "catchtouchmove": ""
      }
    }, [_c('div', {
      staticClass: "tips"
    }, [_vm._v("选择该页面显示的新闻类型")]), _vm._v(" "), _c('div', {
      staticClass: "types"
    }, _vm._l((_vm.types), function(v, i) {
      return _c('div', {
        key: i,
        class: _vm.hideArr[i] ? 'type-hide' : 'type-show',
        attrs: {
          "eventid": '3-' + i
        },
        on: {
          "tap": function($event) {
            _vm.changeSelect(i)
          }
        }
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
445
      }, [_vm._v(_vm._s(v) + "\r\n      "), (!_vm.hideArr[i]) ? _c('div', {
ce4c83ff   wxy   初始提交
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
        staticClass: "selected"
      }) : _vm._e(), _vm._v(" "), (!_vm.hideArr[i]) ? _c('img', {
        attrs: {
          "src": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4w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DkuNjczMzEzIDIyLjM3MDQ5NyAxNC4yNjc5NTggMzQuOTQ0ODgzIDE0LjAyNjQ1OCAxNi4yMDMwMyAzLjk4ODg0OCAzMy44NTYwODYgMC40ODQwMjQgNDYuNDkyODk0LTEyLjE1Mjc4NGw1NDYuNDgyMzQ5LTU0Ny4wMjY3NDhDOTYxLjk1NzQ1NyAyNTUuOTg1MTYyIDk2MS45NTc0NTcgMjI0Ljc4NzYyNiA5NDIuNzMxNTggMjA1LjUwMTM3NHoiIHAtaWQ9IjE5MDQwIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+"
        }
      }) : _vm._e()])
    })), _vm._v(" "), _c('div', {
      staticClass: "btns"
    }, [_c('div', {
      staticStyle: {
        "color": "#09BB07"
      },
      attrs: {
        "hover-class": "fade",
        "hover-start-time": "0",
        "hover-stay-time": "50",
        "eventid": '4'
      },
      on: {
        "tap": _vm.cancel
      }
    }, [_vm._v("取消")]), _vm._v(" "), _c('div', {
      staticStyle: {
        "color": "#E64340"
      },
      attrs: {
        "hover-class": "fade",
        "hover-start-time": "0",
        "hover-stay-time": "50",
        "eventid": '5'
      },
      on: {
        "tap": _vm.confirm
      }
    }, [_vm._v("确认")])])]), _vm._v(" "), _c('div', {
      staticClass: "black-mask",
      style: ('top:' + _vm.navBarHeight + 'px;'),
      attrs: {
        "hidden": !_vm.showFilter,
        "catchtouchmove": ""
      }
    })], 2)
  }
  var staticRenderFns = []
  render._withStripped = true
  var esExports = { render: render, staticRenderFns: staticRenderFns }
  /* harmony default export */ __webpack_exports__["a"] = (esExports);
  if (false) {
    module.hot.accept()
    if (module.hot.data) {
601b4cbe   wxy   修改我的评价iOS手机日期显示问题
496
       require("vue-hot-reload-api").rerender("data-v-3594dd57", esExports)
ce4c83ff   wxy   初始提交
497
498
499
500
501
502
503
    }
  }
  
  /***/ })
  
  },[273]);
  //# sourceMappingURL=main.js.map