index.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. //index.js
  2. //获取应用实例
  3. import * as echarts from '../../ec-canvas/echarts';
  4. var imageUtil = require('../../utils/window.js');
  5. const apiServer = require('../../api/request');
  6. var Chart = null;
  7. const app = getApp()
  8. var timeData = [
  9. '2020/6/1', '2009/6/2', '2009/6/3', '2009/6/4', '2009/6/5', '2009/6/6', '2009/6/7', '2009/6/8', '2009/6/9', '2009/6/10',
  10. ];
  11. timeData = timeData.map(function (str) {
  12. return str.replace('2009/', '');
  13. });
  14. function initChart(canvas, width, height, dpr, data) {
  15. const chart = echarts.init(canvas, null, {
  16. width: width,
  17. height: height,
  18. devicePixelRatio: dpr // new
  19. });
  20. canvas.setChart(chart);
  21. var option = {
  22. title: {//标题
  23. text: '',
  24. left: 'center'
  25. },
  26. renderAsImage: true, //支持渲染为图片模式
  27. color: ["#DF3E3E", "#80CDF8"],//图例图标颜色
  28. legend: {
  29. show: true,
  30. itemGap: 25,//每个图例间的间隔
  31. top: 30,
  32. x: 30,//水平安放位置,离容器左侧的距离 'left'
  33. z: 100,
  34. textStyle: {
  35. color: '#383838'
  36. },
  37. },
  38. grid: {//网格
  39. // left: 30,
  40. // top:100,
  41. containLabel: true,//grid 区域是否包含坐标轴的刻度标签
  42. },
  43. xAxis: {//横坐标
  44. type: 'category',
  45. // nameTextStyle: {//在name值存在下,设置name的样式
  46. // color: 'white',
  47. // fontStyle: 'normal'
  48. // },
  49. nameLocation:'end',
  50. splitLine: {//坐标轴在 grid 区域中的分隔线。
  51. show: true,
  52. lineStyle: {
  53. type: 'dashed',
  54. color: ['#2B2B2B']
  55. }
  56. },
  57. boundaryGap: false,//1.true 数据点在2个刻度直接 2.false 数据点在分割线上,即刻度值上
  58. data: data.timeData,
  59. axisLine: {onZero: true},
  60. axisLabel: {
  61. textStyle: {
  62. fontSize: 13,
  63. color: '#5D5D5D'
  64. }
  65. }
  66. },
  67. dataZoom: [
  68. {
  69. type: 'slider',
  70. xAxisIndex: 0,
  71. filterMode: 'empty'
  72. },
  73. ],
  74. yAxis: {//纵坐标
  75. type: 'value',
  76. position:'right',
  77. // nameTextStyle:{//在name值存在下,设置name的样式
  78. // color:'red',
  79. // fontStyle:'normal'
  80. // },
  81. splitNumber: 5,//坐标轴的分割段数
  82. scale:true,
  83. splitLine: {//坐标轴在 grid 区域中的分隔线。
  84. show: true,
  85. lineStyle: {
  86. type: 'dashed',
  87. color: ['#2B2B2B']
  88. }
  89. },
  90. axisLabel: {//坐标轴刻度标签
  91. // formatter: function (value) {
  92. // var xLable = [];
  93. // if (value == 20) {
  94. // xLable.push('25,883');
  95. // }
  96. // if (value == 40) {
  97. // xLable.push('26,035');
  98. // }
  99. // if (value == 60) {
  100. // xLable.push('26,187');
  101. // }
  102. // if (value == 80) {
  103. // xLable.push('26,339');
  104. // }
  105. // return xLable
  106. // },
  107. textStyle: {
  108. fontSize: 13,
  109. color: '#5D5D5D',
  110. }
  111. },
  112. // min: 0,
  113. // max: 100,
  114. },
  115. series: [{
  116. name: '实际',
  117. type: 'line',
  118. // smooth:true,
  119. data:data.actual,
  120. symbol: 'none',
  121. areaStyle: {
  122. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  123. offset: 0,
  124. color: '#DF3E3E'
  125. }, {
  126. offset: 1,
  127. color: '#1C1C1C'
  128. }])
  129. },
  130. itemStyle: {
  131. normal: {
  132. lineStyle: {
  133. color: '#DF3E3E'
  134. }
  135. }
  136. }
  137. }, {
  138. name: '预测',
  139. type: 'line',
  140. data: data.prediction,
  141. symbol: 'none',
  142. itemStyle: {
  143. normal: {
  144. lineStyle: {
  145. color: '#80CDF8'
  146. }
  147. }
  148. }
  149. }],
  150. };
  151. chart.setOption(option);
  152. return chart;
  153. }
  154. Page({
  155. data: {
  156. url:'../../images/timg.jpg',
  157. motto: '',
  158. currentTab: 0,
  159. userInfo: {},
  160. hasUserInfo: false,
  161. canIUse: wx.canIUse('button.open-type.getUserInfo'),
  162. currPage:1,//当前页
  163. pages:0,//每页条数
  164. total:0,//总条数
  165. aa:[],//列表
  166. imagewidth: 0,//缩放后的宽
  167. imageheight: 0,//缩放后的高
  168. chartData:{
  169. // actual:[552,586,3555,4454,552,556,4455],
  170. // prediction:[552,546,3585,4424,542,546,35,44,524,56,355,444,2224,421],
  171. // timeData : [
  172. // '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7', '2020/6/8', '2020/6/9', '2020/6/10','2020/6/11',
  173. // '2020/6/12','2020/6/13','2020/6/14',
  174. // ]
  175. },
  176. chartDatas:{
  177. // actual:[572,556,3555,4744,552,576,3555],
  178. // prediction:[352,246,385,2424,542,546,255],
  179. // timeData : [
  180. // '2020/6/1', '2020/6/2', '2020/6/3', '2020/6/4', '2020/6/5', '2020/6/6', '2020/6/7'
  181. // ]
  182. },
  183. ec: {
  184. onInit: initChart,
  185. // lazyLoad: true // 延迟加载
  186. },
  187. // ec: {
  188. // onInit: function (canvas, width, height) {
  189. // chart = echarts.init(canvas, null, {
  190. // width: width,
  191. // height: height
  192. // });
  193. // canvas.setChart(chart);
  194. // return chart;
  195. // },
  196. // lazyLoad: true // 延迟加载
  197. // },
  198. aa:[
  199. // {
  200. // id:'0',
  201. // from:"Investing.com 中文",
  202. // nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
  203. // reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
  204. // time:"6天前"
  205. // },
  206. // {
  207. // id:'1',
  208. // from:"chinese.aljazeera.net",
  209. // nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
  210. // reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
  211. // time:"6天前"
  212. // },
  213. // {
  214. // id:'2',
  215. // from:"Investing.com 中文",
  216. // nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
  217. // reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
  218. // time:"5天前"
  219. // },
  220. // {
  221. // id:'3',
  222. // from:"Investing.com 中文",
  223. // nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
  224. // reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
  225. // time:"6天前"
  226. // },
  227. // {
  228. // id:'4',
  229. // from:"chinese.aljazeera.net",
  230. // nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
  231. // reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
  232. // time:"6天前"
  233. // },
  234. // {
  235. // id:'5',
  236. // from:"Investing.com 中文",
  237. // nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
  238. // reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
  239. // time:"5天前"
  240. // },
  241. // {
  242. // id:'6',
  243. // from:"Investing.com 中文",
  244. // nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
  245. // reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
  246. // time:"6天前"
  247. // },
  248. // {
  249. // id:'7',
  250. // from:"chinese.aljazeera.net",
  251. // nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
  252. // reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
  253. // time:"6天前"
  254. // },
  255. // {
  256. // id:'8',
  257. // from:"Investing.com 中文",
  258. // nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
  259. // reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
  260. // time:"5天前"
  261. // },
  262. // {
  263. // id:'9',
  264. // from:"Investing.com 中文",
  265. // nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
  266. // reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
  267. // time:"6天前"
  268. // },
  269. // {
  270. // id:'10',
  271. // from:"chinese.aljazeera.net",
  272. // nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
  273. // reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
  274. // time:"6天前"
  275. // },
  276. // {
  277. // id:'11',
  278. // from:"Investing.com 中文",
  279. // nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
  280. // reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
  281. // time:"5天前"
  282. // },
  283. // {
  284. // id:'12',
  285. // from:"Investing.com 中文",
  286. // nickName:"买入波音(BA.US)好时机?两个问题没解决之前劝你住手",
  287. // reward:"今年迄今,美股航空板块受到公共卫生事件的冲击.....",
  288. // time:"6天前"
  289. // },
  290. // {
  291. // id:'13',
  292. // from:"chinese.aljazeera.net",
  293. // nickName: "波音裁员超1.2万人与警惕最坏时刻尚未到来",
  294. // reward: "波音公司当地时间27日宣布,将在美国裁减超1...",
  295. // time:"6天前"
  296. // },
  297. // {
  298. // id:'14',
  299. // from:"Investing.com 中文",
  300. // nickName: "美股异动|波音737MAX客机恢复生产,盘前涨逾5%",
  301. // reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
  302. // time:"5天前"
  303. // },
  304. ],
  305. },
  306. //事件处理函数
  307. bindViewTap: function() {
  308. wx.navigateTo({
  309. url: '../logs/logs'
  310. })
  311. },
  312. //上证
  313. getHz:function(){
  314. apiServer.getHz().then((res) =>{
  315. if(res.statusCode == 200){
  316. console.log(res);
  317. this.setData({
  318. chartDatas:this.recursion(res.data.data),
  319. })
  320. }
  321. })
  322. },
  323. //深证
  324. getSz:function(){
  325. apiServer.getSz().then((res) =>{
  326. if(res.statusCode == 200){
  327. console.log(res);
  328. this.setData({
  329. chartData:this.recursion(res.data.data),
  330. })
  331. }
  332. })
  333. },
  334. recursion:function(row,a=[],b=[],c=[],d){
  335. for(let i in row.actuals){
  336. a.unshift(row.actuals[i].industryDate)
  337. b.unshift(row.actuals[i].close)
  338. c.unshift(row.actuals[i].pred)
  339. }
  340. if(row.tag){
  341. d="#D81E06"
  342. }else{
  343. d="#07c160"
  344. }
  345. return {"timeData":a,"actual":b,"prediction":c,"color":d}
  346. },
  347. onReady: function (e) {
  348. this.computeScrollViewHeight();
  349. // var query = wx.createSelectorQuery()
  350. // query.select('#test').boundingClientRect(function (res) {
  351. // console.log(res.top);
  352. // }).exec();
  353. },
  354. onLoad: function (options) {
  355. this.getHz();
  356. this.getSz();
  357. getNewsList(this);
  358. let sysinfo = wx.getSystemInfoSync(),
  359. windowHeight = sysinfo.windowHeight,
  360. statusHeight = sysinfo.statusBarHeight,
  361. isiOS = sysinfo.system.indexOf('iOS') > -1,
  362. navHeight;
  363. if (!isiOS) {
  364. navHeight = 48;
  365. } else {
  366. navHeight = 44;
  367. }
  368. let height = windowHeight-statusHeight-navHeight;
  369. this.setData({
  370. height:height
  371. })
  372. // this.echartsComponnet = this.selectComponent('#mychart');
  373. // console.log(this.echartsComponnet);
  374. // //如果是第一次绘制
  375. // if (!Chart) {
  376. // this.init_echarts(); //初始化图表
  377. // } else {
  378. // this.setOption(Chart); //更新数据
  379. // }
  380. // this.computeScrollViewHeight();
  381. // if (app.globalData.userInfo) {
  382. // this.setData({
  383. // userInfo: app.globalData.userInfo,
  384. // hasUserInfo: true
  385. // })
  386. // } else if (this.data.canIUse){
  387. // // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
  388. // // 所以此处加入 callback 以防止这种情况
  389. // app.userInfoReadyCallback = res => {
  390. // this.setData({
  391. // userInfo: res.userInfo,
  392. // hasUserInfo: true
  393. // })
  394. // }
  395. // } else {
  396. // // 在没有 open-type=getUserInfo 版本的兼容处理
  397. // wx.getUserInfo({
  398. // success: res => {
  399. // app.globalData.userInfo = res.userInfo
  400. // this.setData({
  401. // userInfo: res.userInfo,
  402. // hasUserInfo: true
  403. // })
  404. // }
  405. // })
  406. // }
  407. },
  408. /**
  409. * 页面相关事件处理函数--监听用户下拉动作
  410. */
  411. onPullDownRefresh: function () {
  412. //下拉刷新,重新初始化,isMerge = false
  413. console.log("1312432");
  414. getNewsList(this);
  415. },
  416. /**
  417. * 页面上拉触底事件的处理函数
  418. */
  419. onReachBottom: function () {
  420. console.log("触发")
  421. setPage(this);
  422. },
  423. computeScrollViewHeight() {
  424. var that = this
  425. let query = wx.createSelectorQuery().in(that)
  426. query.select('.swiper-tab').boundingClientRect()
  427. query.select('.chart').boundingClientRect()
  428. query.select('.news').boundingClientRect()
  429. query.exec(res => {
  430. let topHeight = res[0].height
  431. let searchHeight = res[1].height
  432. let titleHeight = res[2].height
  433. let windowHeight = wx.getSystemInfoSync().windowHeight
  434. let windowWidth = wx.getSystemInfoSync().windowWidth
  435. let height = windowHeight - topHeight - searchHeight - titleHeight
  436. let ratio = 750 / windowWidth
  437. let scrollHeight = height * ratio
  438. that.setData({ scrollHeight: scrollHeight})
  439. })
  440. },
  441. imageLoad: function (e) {
  442. var imageSize = imageUtil.imageUtil(e)
  443. this.setData({
  444. imagewidth: imageSize.imageWidth,
  445. imageheight: imageSize.imageHeight
  446. })
  447. this.computeScrollViewHeight();
  448. },
  449. onFold:function(e){
  450. wx.navigateTo({
  451. url:'../news/news?newsId='+e.currentTarget.dataset.id
  452. });
  453. },
  454. choose:function(e){
  455. wx.navigateTo({
  456. url:"../filter/filter"
  457. })
  458. },
  459. swichNav: function(e) {
  460. var that = this;
  461. if (this.data.currentTab === e.target.dataset.current) {
  462. return false;
  463. } else {
  464. that.setData({
  465. currentTab: e.target.dataset.current
  466. })
  467. }
  468. },
  469. // 滑动切换tab
  470. bindChange: function(e) {
  471. var that = this;
  472. that.setData({
  473. currentTab: e.detail.current
  474. });
  475. },
  476. catchTouchMove:function(res){
  477. return false
  478. },
  479. //初始化图表
  480. init_echarts: function () {
  481. this.echartsComponnet.init((canvas, width, height) => {
  482. // 初始化图表
  483. const Chart = echarts.init(canvas, null, {
  484. width: width,
  485. height: height
  486. });
  487. this.setOption(Chart)
  488. // 注意这里一定要返回 chart 实例,否则会影响事件处理等
  489. return Chart
  490. });
  491. },
  492. setOption: function (Chart) {
  493. Chart.clear(); // 清除
  494. Chart.setOption(this.getOption()); //获取新数据
  495. },
  496. // 图表配置项
  497. getOption() {
  498. var self = this;
  499. var option = {
  500. title: {//标题
  501. text: '',
  502. left: 'center'
  503. },
  504. renderAsImage: true, //支持渲染为图片模式
  505. color: ["#DF3E3E", "#80CDF8"],//图例图标颜色
  506. legend: {
  507. // left:'right',
  508. show: true,
  509. itemGap: 25,//每个图例间的间隔
  510. top: 20,
  511. right:20,
  512. x: 100,//水平安放位置,离容器左侧的距离 'left'
  513. z: 100,
  514. textStyle: {
  515. color: '#383838'
  516. },
  517. data: [//图例具体内容
  518. {
  519. name: '实际',
  520. textStyle: {
  521. fontSize: 13,
  522. color: 'white'
  523. },
  524. icon: 'line'
  525. },
  526. {
  527. name: '预测',
  528. textStyle: {
  529. fontSize: 13,
  530. color: 'white'
  531. },
  532. icon: 'line',
  533. }
  534. ]
  535. },
  536. grid: {//网格
  537. // left: 50,
  538. // top:100,
  539. containLabel: true,//grid 区域是否包含坐标轴的刻度标签
  540. },
  541. xAxis: {//横坐标
  542. type: 'category',
  543. // name: '区间',//横坐标名称
  544. nameTextStyle: {//在name值存在下,设置name的样式
  545. color: 'white',
  546. fontStyle: 'normal'
  547. },
  548. nameLocation:'end',
  549. splitLine: {//坐标轴在 grid 区域中的分隔线。
  550. show: true,
  551. lineStyle: {
  552. type: 'dashed',
  553. color: ['#2B2B2B']
  554. }
  555. },
  556. boundaryGap: false,//1.true 数据点在2个刻度直接 2.fals 数据点在分割线上,即刻度值上
  557. data: ['2020/6/29', '2020/6/30', '2020/7/1', '2020/7/2', '2020/7/3'],
  558. axisLine: {onZero: true},
  559. axisLabel: {
  560. textStyle: {
  561. fontSize: 13,
  562. color: '#5D5D5D'
  563. }
  564. }
  565. },
  566. yAxis: {//纵坐标
  567. type: 'value',
  568. position:'right',
  569. name: '股票值',//纵坐标名称
  570. nameTextStyle:{//在name值存在下,设置name的样式
  571. color:'red',
  572. fontStyle:'normal'
  573. },
  574. splitNumber: 5,//坐标轴的分割段数
  575. splitLine: {//坐标轴在 grid 区域中的分隔线。
  576. show: true,
  577. lineStyle: {
  578. type: 'dashed',
  579. color: ['#2B2B2B']
  580. }
  581. },
  582. axisLabel: {//坐标轴刻度标签
  583. // formatter: function (value) {
  584. // var xLable = [];
  585. // if (value == 20) {
  586. // xLable.push('1000');
  587. // }
  588. // if (value == 40) {
  589. // xLable.push('2000');
  590. // }
  591. // if (value == 60) {
  592. // xLable.push('4000');
  593. // }
  594. // if (value == 80) {
  595. // xLable.push('6000');
  596. // }
  597. // return xLable
  598. // },
  599. textStyle: {
  600. fontSize: 13,
  601. color: '#5D5D5D',
  602. }
  603. },
  604. // min: 0,
  605. // max: 100,
  606. },
  607. series: [{
  608. name: '实际',
  609. type: 'line',
  610. // smooth:true,
  611. data: [1888, 3666, 6555, 3000, 7888, 4000, 3333],
  612. symbol: 'none',
  613. areaStyle: {
  614. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  615. {
  616. offset: 0,
  617. color: '#DF3E3E'
  618. },
  619. {
  620. offset: 1,
  621. color: '#1C1C1C'
  622. }
  623. ])
  624. },
  625. itemStyle: {
  626. normal: {
  627. lineStyle: {
  628. color: '#DF3E3E'
  629. }
  630. }
  631. }
  632. }, {
  633. name: '预测',
  634. type: 'line',
  635. data: [1000, 3000, 3111, 5000, 4000, 2000, 1000],
  636. symbol: 'none',
  637. itemStyle: {
  638. normal: {
  639. lineStyle: {
  640. color: '#80CDF8'
  641. }
  642. }
  643. }
  644. }],
  645. }
  646. return option;
  647. },
  648. getUserInfo: function(e) {
  649. console.log(e)
  650. app.globalData.userInfo = e.detail.userInfo
  651. this.setData({
  652. userInfo: e.detail.userInfo,
  653. hasUserInfo: true
  654. })
  655. }
  656. })
  657. /**
  658. * method:分页加载控制函数
  659. *
  660. */
  661. function setPage(that) {
  662. const {
  663. currPage,
  664. pages,
  665. total
  666. } = that.data;
  667. const totalPages = getTotalPages(total,pages);
  668. if (currPage >= totalPages || that.isLoading) {
  669. //控制触底是否加载需要两个条件,满足一下两个条件,都不能调用请求函数
  670. // 1.当前页是最后一页,
  671. // 2. 正在加载中
  672. return
  673. }
  674. //分页加载需要传递isMerge=true参数,表示需要合并到原来的数组上
  675. getList(that,true)
  676. }
  677. /**
  678. * method:得到总页数
  679. * @param {Number,String} total 列表总数
  680. * @param {Number,String} pages 每一页的条数
  681. * @return {Number} totalPages 总页数
  682. */
  683. function getTotalPages(total,pages){
  684. //总数除以每一页条数 如果余数!=0,结果需要+1
  685. const remainder = Number(total) % Number(pages);
  686. const value = Math.floor(total / pages);
  687. const totalPages = remainder == 0 ? value : Number(value) + 1;
  688. return totalPages
  689. }
  690. //获取新闻列表
  691. function getNewsList(that,isMerge){
  692. that.isLoading = true
  693. wx.showLoading({
  694. title: '加载中',
  695. })
  696. const data = {};
  697. data.currPage = Number(that.data.currPage) + 1;
  698. if(!isMerge){
  699. //不合并,页码需要重新设置为1
  700. data.currPage = 1;
  701. }
  702. apiServer.getNewsList(data).then((res)=>{
  703. if(res.statusCode == 200){
  704. let aa = that.data.aa;
  705. if(!isMerge){
  706. aa = [];
  707. }
  708. aa = aa.concat(res.data.data.incInfos)
  709. that.setData({
  710. aa,
  711. currPage:res.data.data.current,
  712. pages: res.data.data.pages,
  713. total: res.data.data.total
  714. })
  715. }
  716. that.isLoading = false
  717. wx.stopPullDownRefresh();
  718. setTimeout(function(){
  719. wx.hideLoading()
  720. },500)
  721. })
  722. }