hqchart 1.1.12687 → 1.1.12706

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/lib/umychart.vue.js +94 -50
  2. package/package.json +15 -47
  3. package/src/jscommon/umychart.resource/js/codemirror/javascript.js +1 -1
  4. package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +409 -115
  5. package/src/jscommon/umychart.vue/umychart.vue.js +409 -115
  6. package/.babelrc +0 -6
  7. package/.vscode/settings.json +0 -4
  8. package/Makefile +0 -9
  9. package/README.md +0 -452
  10. package/index.js +0 -17
  11. package/postcss.config.js +0 -5
  12. package/src/index.html +0 -18
  13. package/src/jscommon/backup/announcement.png +0 -0
  14. package/src/jscommon/backup/announcement2.png +0 -0
  15. package/src/jscommon/backup/blocktrading.png +0 -0
  16. package/src/jscommon/backup/investor.png +0 -0
  17. package/src/jscommon/backup/pforecast.png +0 -0
  18. package/src/jscommon/backup/research.png +0 -0
  19. package/src/jscommon/backup/tradedetail.png +0 -0
  20. package/src/jscommon/backup/umychart - backup.js +0 -17631
  21. package/src/jscommon/backup/umychart.macro.js +0 -4
  22. package/src/jscommon/backup/umychart.macro.vue.js +0 -3
  23. package/src/jscommon/commonindextree.json +0 -92
  24. package/src/jscommon/index.html +0 -13
  25. package/src/jscommon/jschinamapdata.js +0 -3
  26. package/src/jscommon/umychart.NetworkFilterTest.js +0 -48803
  27. package/src/jscommon/umychart.aliYunnetwork.js +0 -47
  28. package/src/jscommon/umychart.cninfo.components/readme.txt +0 -1
  29. package/src/jscommon/umychart.complier.js +0 -25291
  30. package/src/jscommon/umychart.complier.node/umychart.complier.controller.js +0 -559
  31. package/src/jscommon/umychart.complier.node/umychart.complier.node.js +0 -7043
  32. package/src/jscommon/umychart.complier.node/umychart.data.node.js +0 -816
  33. package/src/jscommon/umychart.console.js +0 -12
  34. package/src/jscommon/umychart.deal.js +0 -1452
  35. package/src/jscommon/umychart.dragdiv.js +0 -48
  36. package/src/jscommon/umychart.index.data.js +0 -4132
  37. package/src/jscommon/umychart.js +0 -90257
  38. package/src/jscommon/umychart.keyboard.js +0 -1659
  39. package/src/jscommon/umychart.listctrl.js +0 -690
  40. package/src/jscommon/umychart.mind.js +0 -2203
  41. package/src/jscommon/umychart.network.js +0 -44
  42. package/src/jscommon/umychart.news.js +0 -823
  43. package/src/jscommon/umychart.node.build/buildall.bat +0 -1
  44. package/src/jscommon/umychart.node.build/umychart.node.bat +0 -1
  45. package/src/jscommon/umychart.node.build/umychart.node.export.js +0 -40
  46. package/src/jscommon/umychart.regressiontest.js +0 -400
  47. package/src/jscommon/umychart.report.js +0 -5803
  48. package/src/jscommon/umychart.scrollbar.js +0 -1345
  49. package/src/jscommon/umychart.stock.js +0 -4218
  50. package/src/jscommon/umychart.style.js +0 -618
  51. package/src/jscommon/umychart.testdata.js +0 -150
  52. package/src/jscommon/umychart.uniapp.build/buildall.bat +0 -1
  53. package/src/jscommon/umychart.uniapp.build/umychart.bat +0 -1
  54. package/src/jscommon/umychart.uniapp.build/umychart.export.js +0 -70
  55. package/src/jscommon/umychart.user.js +0 -137
  56. package/src/jscommon/umychart.version.js +0 -30
  57. package/src/jscommon/umychart.vue/umychart.aliYunnetwork.vue.js +0 -56
  58. package/src/jscommon/umychart.vue.build/buildall.bat +0 -4
  59. package/src/jscommon/umychart.vue.build/copy_codemirror.bat +0 -2
  60. package/src/jscommon/umychart.vue.build/umychart.aliYunnetwork.vue.export.js +0 -9
  61. package/src/jscommon/umychart.vue.build/umychart.dragdiv.bat +0 -1
  62. package/src/jscommon/umychart.vue.build/umychart.dragdiv.export.js +0 -6
  63. package/src/jscommon/umychart.vue.build/umychart.index.data.bat +0 -1
  64. package/src/jscommon/umychart.vue.build/umychart.index.data.export.js +0 -4
  65. package/src/jscommon/umychart.vue.build/umychart.listctrl.vue.export.js +0 -15
  66. package/src/jscommon/umychart.vue.build/umychart.regressiontest.vue.export.js +0 -7
  67. package/src/jscommon/umychart.vue.build/umychart.regressiontest.wechat.export.js +0 -12
  68. package/src/jscommon/umychart.vue.build/umychart.stock.bat +0 -1
  69. package/src/jscommon/umychart.vue.build/umychart.stock.vue.export.js +0 -16
  70. package/src/jscommon/umychart.vue.build/umychart.testdata.bat +0 -3
  71. package/src/jscommon/umychart.vue.build/umychart.testdata.vue.export.js +0 -7
  72. package/src/jscommon/umychart.vue.build/umychart.vue.bat +0 -8
  73. package/src/jscommon/umychart.vue.build/umychart.vue.export.js +0 -112
  74. package/src/jscommon/umychart.vue.components/empyt.vue +0 -51
  75. package/src/jscommon/umychart.vue.components/historydayline.vue +0 -240
  76. package/src/jscommon/umychart.vue.components/jsloader.adddialog.vue +0 -315
  77. package/src/jscommon/umychart.vue.components/jsloader.vue +0 -93
  78. package/src/jscommon/umychart.vue.components/jsvuecontainer.vue +0 -160
  79. package/src/jscommon/umychart.vue.components/jsvuecontainer2.0.vue +0 -391
  80. package/src/jscommon/umychart.vue.components/login.vue +0 -178
  81. package/src/jscommon/umychart.vue.components/queryContent.vue +0 -750
  82. package/src/jscommon/umychart.vue.components/readme.txt +0 -8
  83. package/src/jscommon/umychart.vue.components/searchsymbol.vue +0 -299
  84. package/src/jscommon/umychart.vue.components/simulatetrade.vue +0 -1471
  85. package/src/jscommon/umychart.vue.components/stockchart.vue +0 -343
  86. package/src/jscommon/umychart.vue.components/stockchartV2.vue +0 -195
  87. package/src/jscommon/umychart.vue.components/stockdeal.vue +0 -358
  88. package/src/jscommon/umychart.vue.components/stockdealcount.vue +0 -262
  89. package/src/jscommon/umychart.vue.components/stockdeallastest.vue +0 -316
  90. package/src/jscommon/umychart.vue.components/stockdrawtool.vue +0 -343
  91. package/src/jscommon/umychart.vue.components/stockfull.vue +0 -355
  92. package/src/jscommon/umychart.vue.components/stockinfo.demo.vue +0 -153
  93. package/src/jscommon/umychart.vue.components/stockinfo.vue +0 -685
  94. package/src/jscommon/umychart.vue.components/stockkline.demo.vue +0 -1904
  95. package/src/jscommon/umychart.vue.components/stockmultiorder.vue +0 -174
  96. package/src/jscommon/umychart.vue.components/stockmultiperiod.vue +0 -222
  97. package/src/jscommon/umychart.vue.components/stockorder.vue +0 -320
  98. package/src/jscommon/umychart.vue.components/stocktradeinfo.demo.vue +0 -250
  99. package/src/jscommon/umychart.vue.components/stocktradeinfo.vue +0 -1907
  100. package/src/jscommon/umychart.vue.components/test.vue +0 -0
  101. package/src/jscommon/umychart.wechat/getDate.wechat.js +0 -91
  102. package/src/jscommon/umychart.wechat/lighter.news.wechat.js +0 -262
  103. package/src/jscommon/umychart.wechat/readme.txt +0 -3
  104. package/src/jscommon/umychart.wechat/umychart.analyze.wechat.js +0 -551
  105. package/src/jscommon/umychart.wechat/umychart.apidraw.wechat.js +0 -126
  106. package/src/jscommon/umychart.wechat/umychart.bigV.wechat.js +0 -2510
  107. package/src/jscommon/umychart.wechat/umychart.chartframe.wechat.js +0 -2931
  108. package/src/jscommon/umychart.wechat/umychart.chartpaint.wechat.js +0 -9752
  109. package/src/jscommon/umychart.wechat/umychart.charttitle.wechat.js +0 -2023
  110. package/src/jscommon/umychart.wechat/umychart.complier.wechat.js +0 -14726
  111. package/src/jscommon/umychart.wechat/umychart.console.wechat.js +0 -8
  112. package/src/jscommon/umychart.wechat/umychart.coordinatedata.wechat.js +0 -3654
  113. package/src/jscommon/umychart.wechat/umychart.data.wechat.js +0 -2243
  114. package/src/jscommon/umychart.wechat/umychart.element.wechart.js +0 -132
  115. package/src/jscommon/umychart.wechat/umychart.explainer.wechat.js +0 -1077
  116. package/src/jscommon/umychart.wechat/umychart.extendchart.wechat.js +0 -1140
  117. package/src/jscommon/umychart.wechat/umychart.framesplit.wechat.js +0 -2247
  118. package/src/jscommon/umychart.wechat/umychart.hqIndexformula.wechat.js +0 -941
  119. package/src/jscommon/umychart.wechat/umychart.index.data.wechat.js +0 -3628
  120. package/src/jscommon/umychart.wechat/umychart.index.wechat.js +0 -4074
  121. package/src/jscommon/umychart.wechat/umychart.klineinfo.wechat.js +0 -836
  122. package/src/jscommon/umychart.wechat/umychart.markethot.js +0 -50
  123. package/src/jscommon/umychart.wechat/umychart.network.wechart.js +0 -62
  124. package/src/jscommon/umychart.wechat/umychart.news.wechat.js +0 -3568
  125. package/src/jscommon/umychart.wechat/umychart.regressiontest.wechat.js +0 -412
  126. package/src/jscommon/umychart.wechat/umychart.report.wechat.js +0 -3983
  127. package/src/jscommon/umychart.wechat/umychart.resource.wechat.js +0 -919
  128. package/src/jscommon/umychart.wechat/umychart.shareimage.wechat.js +0 -681
  129. package/src/jscommon/umychart.wechat/umychart.simulatetrade.wechat.js +0 -238
  130. package/src/jscommon/umychart.wechat/umychart.stock.wechat.js +0 -4035
  131. package/src/jscommon/umychart.wechat/umychart.style.wechat.js +0 -419
  132. package/src/jscommon/umychart.wechat/umychart.uniapp.canvas.helper.js +0 -99
  133. package/src/jscommon/umychart.wechat/umychart.user.wechat.js +0 -588
  134. package/src/jscommon/umychart.wechat/umychart.userlog.wechat.js +0 -240
  135. package/src/jscommon/umychart.wechat/umychart.vedio.wechat.js +0 -112
  136. package/src/jscommon/umychart.wechat/umychart.version.wechat.js +0 -36
  137. package/src/jscommon/umychart.wechat/umychart.wechat.3.0.js +0 -12051
  138. package/src/jscommon/umychart.wechat/umychart.wechat.js +0 -15460
  139. package/src/jscommon/umychart.worker.js +0 -114
  140. package/src/jscommon/umychart.ws.stock.js +0 -110
  141. package/src/jscommon/umychart_python/.vscode/launch.json +0 -15
  142. package/src/jscommon/umychart_python/__init__.py +0 -4
  143. package/src/jscommon/umychart_python/build.cmd +0 -2
  144. package/src/jscommon/umychart_python/setup.py +0 -25
  145. package/src/jscommon/umychart_python/umychart_cache_testcase.py +0 -165
  146. package/src/jscommon/umychart_python/umychart_complier_data.py +0 -781
  147. package/src/jscommon/umychart_python/umychart_complier_help.py +0 -175
  148. package/src/jscommon/umychart_python/umychart_complier_job.py +0 -193
  149. package/src/jscommon/umychart_python/umychart_complier_jsalgorithm.py +0 -4144
  150. package/src/jscommon/umychart_python/umychart_complier_jscomplier.py +0 -177
  151. package/src/jscommon/umychart_python/umychart_complier_jsexecute.py +0 -517
  152. package/src/jscommon/umychart_python/umychart_complier_jsparser.py +0 -864
  153. package/src/jscommon/umychart_python/umychart_complier_jssymboldata.py +0 -1238
  154. package/src/jscommon/umychart_python/umychart_complier_jssymboldata_cache.py +0 -146
  155. package/src/jscommon/umychart_python/umychart_complier_jssymboldata_json.py +0 -106
  156. package/src/jscommon/umychart_python/umychart_complier_pandas_help.py +0 -80
  157. package/src/jscommon/umychart_python/umychart_complier_scanner.py +0 -554
  158. package/src/jscommon/umychart_python/umychart_complier_testcase.py +0 -362
  159. package/src/jscommon/umychart_python/umychart_complier_util.py +0 -30
  160. package/src/jscommon/umychart_python/umychart_webtemplate.py +0 -131
  161. package/src/jscommon/umychart_python/updatehqchartweb.bat +0 -5
  162. package/src/jscommon/vendor.js +0 -2
  163. package/src/pages/block.list.demo.page/App.vue +0 -117
  164. package/src/pages/block.list.demo.page/index.js +0 -12
  165. package/src/pages/brushTool.demo.page/App.vue +0 -19
  166. package/src/pages/brushTool.demo.page/index.js +0 -12
  167. package/src/pages/container.demo.page/App.vue +0 -118
  168. package/src/pages/container.demo.page/index.js +0 -18
  169. package/src/pages/dataZoom.demo.page/App.vue +0 -265
  170. package/src/pages/dataZoom.demo.page/components/dataZoom.vue +0 -303
  171. package/src/pages/dataZoom.demo.page/index.js +0 -12
  172. package/src/pages/historydayline.demo.page/App.vue +0 -57
  173. package/src/pages/historydayline.demo.page/index.js +0 -12
  174. package/src/pages/hq.demo.page/App.vue +0 -163
  175. package/src/pages/hq.demo.page/index.js +0 -12
  176. package/src/pages/hqchart.black/App.vue +0 -90
  177. package/src/pages/hqchart.black/components/searchsymbol.vue +0 -299
  178. package/src/pages/hqchart.black/components/stockdrawtool.vue +0 -300
  179. package/src/pages/hqchart.black/components/stockfull.vue +0 -313
  180. package/src/pages/hqchart.black/components/stockinfo.vue +0 -428
  181. package/src/pages/hqchart.black/components/stockkline.demo.vue +0 -1652
  182. package/src/pages/hqchart.black/components/stocktradeinfo.vue +0 -1337
  183. package/src/pages/hqchart.black/index.js +0 -30
  184. package/src/pages/hqchart.black/router/candlestickChart.vue +0 -108
  185. package/src/pages/hqchart.black/router/pricePointsTable.vue +0 -294
  186. package/src/pages/hqchart.black/router/stockDeallas.vue +0 -417
  187. package/src/pages/hqchart.black/router/timeShareChart.vue +0 -108
  188. package/src/pages/hqchart.page/App.vue +0 -101
  189. package/src/pages/hqchart.page/index.js +0 -18
  190. package/src/pages/index/App.vue +0 -1408
  191. package/src/pages/index/index.js +0 -7
  192. package/src/pages/indexHq/App.vue +0 -110
  193. package/src/pages/indexHq/index.js +0 -18
  194. package/src/pages/login.demo.page/App.vue +0 -22
  195. package/src/pages/login.demo.page/index.js +0 -12
  196. package/src/pages/queryContent.demo.page/App.vue +0 -29
  197. package/src/pages/queryContent.demo.page/index.js +0 -18
  198. package/src/pages/ranking.black/App.vue +0 -199
  199. package/src/pages/ranking.black/index.js +0 -18
  200. package/src/pages/search.demo.page/App.vue +0 -28
  201. package/src/pages/search.demo.page/index.js +0 -12
  202. package/src/pages/simulatetrade.demo.page/app.vue +0 -121
  203. package/src/pages/simulatetrade.demo.page/index.js +0 -17
  204. package/src/pages/stockdeal.demo.page/App.vue +0 -63
  205. package/src/pages/stockdeal.demo.page/index.js +0 -19
  206. package/src/pages/stockdealcount.demo.page/App.vue +0 -37
  207. package/src/pages/stockdealcount.demo.page/index.js +0 -12
  208. package/src/pages/stockdeallastest.demo.page/App.vue +0 -74
  209. package/src/pages/stockdeallastest.demo.page/index.js +0 -18
  210. package/src/pages/stockinfo.demo.page/App.vue +0 -92
  211. package/src/pages/stockinfo.demo.page/index.html +0 -13
  212. package/src/pages/stockinfo.demo.page/index.js +0 -19
  213. package/src/pages/stockkline.demo.page/App.vue +0 -55
  214. package/src/pages/stockkline.demo.page/index.js +0 -18
  215. package/src/pages/stockmultiorder.demo.page/App.vue +0 -149
  216. package/src/pages/stockmultiorder.demo.page/index.js +0 -18
  217. package/src/pages/stockmultiperiod.demo.page/App.vue +0 -87
  218. package/src/pages/stockmultiperiod.demo.page/index.js +0 -18
  219. package/src/pages/stockorder.demo.page/App.vue +0 -69
  220. package/src/pages/stockorder.demo.page/index.js +0 -18
  221. package/src/pages/test/App.vue +0 -22
  222. package/src/pages/test/index.js +0 -7
  223. package/src/pages/tradeinfopage/app.vue +0 -40
  224. package/src/pages/tradeinfopage/index.js +0 -7
  225. package/src/pages/tradeinfopage/tradeinfo.html +0 -12
  226. package/src/utils/urlObj.js +0 -81
  227. package/src/vendor.js +0 -2
  228. package/webpack.config.js +0 -104
@@ -1,3568 +0,0 @@
1
- /*
2
- 微信接口的个股新闻
3
- */
4
- import {
5
- JSCommonDate
6
- } from "getDate.wechat.js"; //获取时间
7
-
8
- function JSNewsResource() {
9
- this.Domain = "https://opensource.zealink.com"; //API域名 opensource.zealink.com apitest.zealink.com
10
- this.CacheDomain = "https://opensourcecache.zealink.com"; //缓存域名
11
- this.JavaDomain = "https://javaweb7.zealink.com"; //java API域名
12
- }
13
-
14
- var g_JSNewsResource = new JSNewsResource();
15
-
16
-
17
- function JSNews() {
18
-
19
- }
20
-
21
- JSNews.SetDomain = function (domain, cacheDomain) {
22
- if (domain) g_JSNewsResource.Domain = domain;
23
- if (cacheDomain) g_JSNewsResource.CacheDomain = cacheDomain;
24
- }
25
-
26
- //获取新闻列表
27
- JSNews.GetNews = function (symbol, newsType) {
28
- switch (newsType) {
29
- case NEWS_TYPE.STOCK_NEWS:
30
- return new StockNews(symbol);
31
- case NEWS_TYPE.ANNOUNCEMENT_ANALYSE:
32
- return new AnnouncementAnalyse(symbol);
33
- case NEWS_TYPE.STOCK_INTERACT:
34
- return new StockInteract(symbol);
35
- case NEWS_TYPE.MARKET_SEARCH:
36
- return new MarketSearch(symbol);
37
- case NEWS_TYPE.STOCK_NEGATIVE:
38
- return new StockNegative(symbol);
39
- case NEWS_TYPE.STOCK_REPORT:
40
- return new StockReport(symbol);
41
- case NEWS_TYPE.NEW_STOCK_NEGATIVE:
42
- return new newStockReport(symbol);
43
- case NEWS_TYPE.OFFICIAL_WEBSITE_NEWS:
44
- return new OfficialWebsiteNews(symbol);
45
- case NEWS_TYPE.SENIOR_EXECUTIVE_NEWS:
46
- return new SeniorExecutiveNews(symbol);
47
- case NEWS_TYPE.VIEWPOINTS_BY_VIP:
48
- return new ViewpointsByVIP(symbol);
49
- case NEWS_TYPE.TOP_MANAGERS_RISK_NEWS:
50
- return new TopManagersRiskNews(symbol);
51
- case NEWS_TYPE.FAILURE_REGROUP_NEWS:
52
- return new FailureRegroupNews(symbol);
53
- case NEWS_TYPE.TOP_MANAGERS_RISK_LIST:
54
- return new TopManagersRiskList(symbol);
55
- case NEWS_TYPE.SEARCH_NOTICE:
56
- return new SearchNotice(symbol);
57
- }
58
- }
59
- //获取新闻内容
60
- JSNews.GetContent = function (id, newsType) {
61
- switch (newsType) {
62
- case NEWS_TYPE.STOCK_NEWS:
63
- return new StockNewsContent(id);
64
- break;
65
- case NEWS_TYPE.MARKET_SEARCH:
66
- return new marketSearchInfo(id);
67
- break;
68
- case NEWS_TYPE.NEW_STOCK_NEGATIVE:
69
- return new stockReportInfo(id);
70
- break;
71
-
72
- case NEWS_TYPE.OFFICIAL_WEBSITE_NEWS:
73
- return new OfficialWebsiteInfo(id);
74
- break;
75
- case NEWS_TYPE.SENIOR_EXECUTIVE_NEWS:
76
- return new SeniorExecutiveInfo(id);
77
- break;
78
- case NEWS_TYPE.VIEWPOINTS_BY_VIP:
79
- return new ViewpointsByVIPInfo(id);
80
- break;
81
- case NEWS_TYPE.TOP_MANAGERS_RISK_NEWS:
82
- return new TopManagersRiskNewsInfo(id);
83
- break;
84
- }
85
- }
86
-
87
- //新闻类型
88
- var NEWS_TYPE = {
89
- STOCK_NEWS: 1, //个股新闻
90
- ANNOUNCEMENT_ANALYSE: 2, //公告解读
91
- STOCK_INTERACT: 3, //互动易
92
- MARKET_SEARCH: 4, //调研
93
- STOCK_NEGATIVE: 5, //负面新闻
94
- STOCK_REPORT: 6, //公告
95
- NEW_STOCK_NEGATIVE: 7, //新的负面新闻接口 NewsAllByES
96
- OFFICIAL_WEBSITE_NEWS: 8, //官网新闻
97
- SENIOR_EXECUTIVE_NEWS: 9, //高管新闻
98
- VIEWPOINTS_BY_VIP: 10, //大V观点新闻
99
- TOP_MANAGERS_RISK_NEWS: 11, //高管风险新闻
100
- FAILURE_REGROUP_NEWS: 12, //重组失败
101
- TOP_MANAGERS_RISK_LIST: 13, //高管风险类型新闻
102
- SEARCH_NOTICE: 14, //公告搜索(uts/服务/公告)
103
- }
104
-
105
- //新闻资讯基类
106
- function INewsBase(symbol) {
107
- this.Symbol = symbol; //股票代码
108
- this.Name; //股票名称
109
- this.Callback; //回调 function(info,news) info: {Start:请求的新闻起始位置 , End:新闻的结束位置 } , news 对应的 新闻类
110
-
111
- this.Data = new Array(); //新闻数据 { Date:日期, Title:标题 , Source:来源, ID:新闻ID}
112
- this.Count; //一共的新闻个数
113
- this.CacheCount; //已下载的新闻个数
114
- this.PageSize = 10; //每页的新闻个数
115
- this.ApiUrl; //数据请求地址
116
-
117
- this.StartDate; //开始时间
118
- this.SndDate; //结束时间
119
-
120
- this.Aggregate = 10; //统计排名
121
-
122
- //设置默认的查询区间
123
- this.SetDefautQueryDate = function () {
124
- // 取最近1年的数据
125
- let date = new Date();
126
- this.StartDate = (date.getFullYear() - 1) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
127
- this.EndDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
128
- }
129
-
130
- //把查询的股票统一转化为数组
131
- this.GetQuerySymbol = function () {
132
- let arySymbol = new Array();
133
- if (typeof(this.Symbol) == 'string') arySymbol.push(this.Symbol); //单个股票
134
- else arySymbol = this.Symbol.slice(0);
135
-
136
- return arySymbol;
137
- }
138
-
139
- //是否是最后一页
140
- this.IsEndPage = function () {
141
- if (this.Count == null || this.Count <= 0) return true;
142
-
143
- return this.CacheCount >= this.Count;
144
-
145
- }
146
-
147
- //获取第1页
148
- this.GetFirstPage = function () {
149
-
150
- }
151
-
152
- //下拉获取下一页
153
- this.GetNextPage = function () {
154
-
155
- }
156
- }
157
-
158
- //新闻详情基类
159
- function INewsContent(id) {
160
- this.ID = id; //新闻id
161
- this.Symbol; //股票代码
162
- this.Name; //股票名称
163
- this.ApiUrl;
164
- this.Callback; //回调 function(this)
165
- this.Data; //数据 { Symbol:代码, Name:名称, Title:标题, Content:内容, Date:日期 .....}
166
- this.Error; //如果调用失败 把错误信息写这里
167
-
168
- this.GetContent = function () {
169
-
170
- }
171
- }
172
-
173
- var RECV_DATA_TYPE = {
174
- NEWS_DATA: 1, //个股新闻数据
175
- }
176
-
177
-
178
- //个股新闻
179
- function StockNews(symbol) {
180
- this.newMethod = INewsBase; //派生
181
- this.newMethod(symbol);
182
- delete this.newMethod;
183
-
184
- var date = new Date();
185
- this.EndDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate(); //获取结束时间
186
- this.StartDate = (date.getFullYear() - 1) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
187
-
188
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsStockListByES';
189
-
190
- var self = this;
191
-
192
- //获取第1页
193
- this.GetFirstPage = function () {
194
- //清空数据
195
- this.Data = [];
196
- this.Count = 0;
197
- this.CacheCount = 0;
198
- let arySymbol = this.GetQuerySymbol();
199
- wx.request({
200
- url: this.ApiUrl,
201
- data: {
202
- "filter": {
203
- "querydate": {
204
- "StartDate": this.StartDate,
205
- "EndDate": this.EndDate
206
- },
207
- "symbollist": arySymbol,
208
- "searchkey": null,
209
- },
210
- "pageinfo": {
211
- "pageindex": 1,
212
- "pagesize": this.PageSize
213
- },
214
- "userid": null
215
- },
216
- method: "POST",
217
- dataType: "json",
218
- success: function (data) {
219
- self.RecvData(data);
220
- },
221
- error: function (request) {
222
- this.RecvError(request);
223
- }
224
- })
225
- }
226
-
227
-
228
- this.RecvData = function (recvData) {
229
- console.log("个股新闻", recvData)
230
- var data = recvData.data;
231
- if (this.Count <= 0)
232
- this.Count = data.count;
233
-
234
- var info = {};
235
- info.Start = this.Data.length;
236
- info.End = this.Data.length;
237
-
238
- for (var i in data.list) {
239
- var item = data.list[i];
240
- this.Data.push({
241
- ID: item.id,
242
- Name: item.name,
243
- Releasedate: item.date,
244
- Source: item.source,
245
- Symbol: item.symbol,
246
- Title: item.title
247
- })
248
- if (i > 0) ++info.End;
249
- }
250
-
251
- this.CacheCount = this.Data.length;
252
- this.InvokeCallback(info); //通知页面
253
- }
254
-
255
- this.RecvError = function (request) {
256
- console.log("[StockInteract::RecvError] ", request)
257
- }
258
-
259
- this.InvokeCallback = function (info) {
260
- if (typeof(this.Callback) != 'function') return;
261
-
262
- this.Callback(info, this);
263
- }
264
-
265
-
266
- //下拉获取下一页
267
- this.GetNextPage = function () {
268
- var self = this;
269
-
270
- let pageIndex = (this.Data.length / this.PageSize) + 1;
271
- let arySymbol = this.GetQuerySymbol();
272
-
273
- wx.request({
274
- url: this.ApiUrl,
275
- data: {
276
- "filter": {
277
- "querydate": {
278
- "StartDate": this.StartDate,
279
- "EndDate": this.EndDate
280
- },
281
- "symbollist": arySymbol,
282
- "searchkey": null,
283
- },
284
- "pageinfo": {
285
- "pageindex": pageIndex,
286
- "pagesize": this.PageSize
287
- },
288
- "userid": null
289
- },
290
- method: "POST",
291
- dataType: "json",
292
- success: function (data) {
293
- self.RecvData(data);
294
- },
295
- error: function (request) {
296
- self.RecvError(request);
297
- }
298
- })
299
- }
300
- }
301
-
302
- //调研
303
- function MarketSearch(symbol) {
304
- this.newMethod = INewsBase; //派生
305
- this.newMethod(symbol);
306
- delete this.newMethod;
307
-
308
- this.Data = {
309
- Search: [],
310
- Aggregate: []
311
- };
312
-
313
- var date = new Date();
314
- this.EndDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate(); //获取结束时间
315
- this.StartDate = (date.getFullYear() - 1) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
316
-
317
- this.ApiUrl = g_JSNewsResource.Domain + '/API/InvestorRelationsList';
318
- this.SearchKey = null;
319
-
320
- //获取第1页
321
- this.GetFirstPage = function () {
322
- var self = this;
323
- //清空数据
324
- this.Data = {
325
- Search: [],
326
- Aggregate: []
327
- };
328
- this.Count = 0;
329
- this.CacheCount = 0;
330
-
331
- if (typeof(this.Symbol) == "string") {
332
- var data = {
333
- "symbol": [this.Symbol],
334
- "filed": ["name", "symbol", "releasedate", "title", "id", "researchdate", "level", "type", "researcher"],
335
- "querydate": {
336
- "StartDate": this.StartDate,
337
- "EndDate": this.EndDate
338
- },
339
- "calccount": 1,
340
- "start": 0,
341
- "end": this.PageSize,
342
- "userid": "qiuyh"
343
- }
344
- } else {
345
- var data = {
346
- "symbol": this.Symbol,
347
- "filed": ["name", "symbol", "releasedate", "title", "id", "researchdate", "level", "type", "researcher"],
348
- "querydate": {
349
- "StartDate": this.StartDate,
350
- "EndDate": this.EndDate
351
- },
352
- "search": this.SearchKey,
353
- "calccount": 1,
354
- "start": 0,
355
- "end": this.PageSize,
356
- "userid": "qiuyh",
357
- "aggregate": this.Aggregate
358
- }
359
- }
360
- wx.request({
361
- url: this.ApiUrl,
362
- data: data,
363
- method: "POST",
364
- dataType: "json",
365
- success: function (data) {
366
- if (data.data.code != 0) {
367
- wx.showModal({
368
- title: '提示',
369
- content: data.data.message,
370
- })
371
- return;
372
- }
373
- self.RecvData(data);
374
- },
375
- fail: function (request) {
376
- self.RecvError(request);
377
- }
378
- })
379
- }
380
-
381
- this.RecvData = function (recvData) {
382
- // console.log("调研", recvData)
383
- var data = recvData.data;
384
- if (this.Count <= 0)
385
- this.Count = data.count;
386
-
387
- var info = {};
388
- info.Start = this.Data.length;
389
- info.End = this.Data.length;
390
-
391
- if (data.aggregate) {
392
- for (var i in data.aggregate) {
393
- this.Data.Aggregate.push({
394
- Name: data.aggregate[i].value2,
395
- Symbol: data.aggregate[i].value,
396
- Count: data.aggregate[i].count
397
- });
398
- }
399
- // this.Data.Aggregate = data.aggregate;
400
- }
401
-
402
- for (var i in data.list) {
403
- var item = data.list[i];
404
- this.Data.Search.push({
405
- ID: item.id,
406
- Name: item.name,
407
- Symbol: item.symbol,
408
- Releasedate: item.releasedate,
409
- Researchdate: item.researchdate,
410
- Title: item.title,
411
- Type: item.type,
412
- Researcher: item.researcher,
413
- Level: item.level
414
- })
415
- if (i > 0) ++info.End;
416
- }
417
-
418
- this.CacheCount = this.Data.Search.length;
419
- this.InvokeCallback(info); //通知页面
420
- }
421
-
422
- this.RecvError = function (request) {
423
- console.log("[StockInteract::RecvError] ", request)
424
- }
425
-
426
- this.InvokeCallback = function () {
427
- if (typeof(this.Callback) != 'function') return;
428
-
429
- var info = {};
430
- this.Callback(info, this);
431
- }
432
-
433
- //下拉获取下一页
434
- this.GetNextPage = function () {
435
- var self = this;
436
-
437
- var start = this.Data.Search.length;
438
- var end = start + this.PageSize;
439
-
440
- var data = {
441
- "symbol": [this.Symbol],
442
- "filed": ["name", "symbol", "releasedate", "title", "id", "researchdate", "level", "type", "researcher"],
443
- "querydate": {
444
- "StartDate": this.StartDate,
445
- "EndDate": this.EndDate
446
- },
447
- "calccount": 1,
448
- "start": start,
449
- "end": end,
450
- "userid": "qiuyh"
451
- };
452
-
453
- var start = this.Data.Search.length;
454
- var end = start + this.PageSize;
455
-
456
- if (typeof(this.Symbol) == "string") {
457
- var data = {
458
- "symbol": [this.Symbol],
459
- "filed": ["name", "symbol", "releasedate", "title", "id", "researchdate", "level", "type", "researcher"],
460
- "querydate": {
461
- "StartDate": this.StartDate,
462
- "EndDate": this.EndDate
463
- },
464
- "calccount": 1,
465
- "start": start,
466
- "end": end,
467
- "userid": "qiuyh"
468
- };
469
- } else {
470
- var data = {
471
- "symbol": this.Symbol,
472
- "filed": ["name", "symbol", "releasedate", "title", "id", "researchdate", "level", "type", "researcher"],
473
- "querydate": {
474
- "StartDate": this.StartDate,
475
- "EndDate": this.EndDate
476
- },
477
- "search": this.SearchKey,
478
- "calccount": 1,
479
- "start": start,
480
- "end": end,
481
- "userid": "qiuyh",
482
- "aggregate": this.Aggregate
483
- }
484
- }
485
- if (this.Data.Search.length < this.Count) {
486
- wx.request({
487
- url: this.ApiUrl,
488
- data: data,
489
- method: "POST",
490
- dataType: "json",
491
- success: function (data) {
492
- if (data.data.code != 0) {
493
- wx.showModal({
494
- title: '提示',
495
- content: data.data.message,
496
- })
497
- return;
498
- }
499
- self.RecvData(data);
500
- },
501
- error: function (request) {
502
- this.RecvError(request);
503
- }
504
- })
505
- } else {
506
- wx.showToast({
507
- title: "数据已全部加载",
508
- icon: 'success',
509
- duration: 1000
510
- })
511
- }
512
-
513
- }
514
- }
515
-
516
-
517
- //个股公告分析
518
- function AnnouncementAnalyse(symbol) {
519
- this.newMethod = INewsBase; //派生
520
- this.newMethod(symbol);
521
- delete this.newMethod;
522
-
523
- this.ApiUrl = g_JSNewsResource.Domain + '/API/AnnualReportAllType';
524
- this.Error = null;
525
-
526
- this.GetFirstPage = function () {
527
- this.Error = null; //清空错误信息
528
- this.Data = [];
529
- this.Name = null;
530
-
531
- var self = this;
532
- var date = new Date();
533
-
534
- // 取最近3年的数据
535
- var start = (date.getFullYear() - 3) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
536
- var end = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
537
-
538
- wx.request({
539
- url: this.ApiUrl,
540
- data: {
541
- "symbol": this.Symbol,
542
- "querydate": {
543
- "StartDate": start,
544
- "EndDate": end
545
- }
546
- },
547
- method: "POST",
548
- dataType: "json",
549
- success: function (data) {
550
- self.RecvData(data);
551
- },
552
- error: function (request) {
553
- self.RecvError(request)
554
- }
555
- })
556
- }
557
-
558
- this.RecvData = function (recvData) {
559
- //console.log(recvData);
560
- var data = recvData.data;
561
- if (data.list == null) return this.InvokeCallback();
562
-
563
- for (var i in data.list) {
564
- var item = data.list[i];
565
- if (item == null || item.info == null || item.info.length <= 0) continue;
566
-
567
- var analyseData = {
568
- Name: item.typename,
569
- Data: new Array()
570
- };
571
-
572
- for (var j in item.info) {
573
- var subItem = item.info[j];
574
- analyseData.Data.push({
575
- Date: subItem.date,
576
- Content: subItem.abstract
577
- });
578
-
579
- if (this.Name == null) this.Name = subItem.name;
580
- }
581
-
582
- this.Data.push(analyseData);
583
- }
584
-
585
- this.InvokeCallback(); //通知页面
586
- }
587
-
588
- this.RecvError = function (request) {
589
- console.log('[AnnouncementAnalyse:RecvError] ', "request");
590
- this.Error = "请求失败";
591
- }
592
-
593
- this.InvokeCallback = function () {
594
- if (typeof(this.Callback) != 'function') return;
595
-
596
- var info = {};
597
- this.Callback(info, this);
598
- }
599
-
600
- }
601
-
602
- //互动易
603
- function StockInteract(symbol) {
604
- this.newMethod = INewsBase; //派生
605
- this.newMethod(symbol);
606
- delete this.newMethod;
607
-
608
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsInteract';
609
-
610
- this.Data = {
611
- News: [],
612
- Aggregate: []
613
- };
614
- this.SearchKey = "";
615
- this.userid = null;
616
-
617
-
618
- //获取第1页
619
- this.GetFirstPage = function () {
620
- //清空数据
621
- this.Data = {
622
- News: [],
623
- Aggregate: []
624
- };
625
- this.Count = 0;
626
- this.CacheCount = 0;
627
-
628
- var self = this;
629
- // 取最近1年的数据
630
- // var date = new Date();
631
- // var startDate = (date.getFullYear() - 1) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
632
- // var endDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
633
-
634
- if (typeof(this.Symbol) == "string") {
635
- var data = {
636
- "symbol": [this.Symbol],
637
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
638
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
639
- "querydate": {
640
- "StartDate": this.StartDate,
641
- "EndDate": this.EndDate
642
- },
643
- "search": this.SearchKey,
644
- "calccount": 1, //返回一共的数据个数
645
- "start": 0,
646
- "end": this.PageSize,
647
- "userid": this.userid
648
- }
649
- } else {
650
- var data = {
651
- "symbol": this.Symbol,
652
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
653
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
654
- "querydate": {
655
- "StartDate": this.StartDate,
656
- "EndDate": this.EndDate
657
- },
658
- "search": this.SearchKey,
659
- "calccount": 1, //返回一共的数据个数
660
- "start": 0,
661
- "end": this.PageSize,
662
- "userid": this.userid,
663
- "aggregate": this.Aggregate
664
- }
665
- }
666
-
667
- wx.request({
668
- url: this.ApiUrl,
669
- data: data,
670
- method: "POST",
671
- dataType: "json",
672
- success: function (data) {
673
- self.RecvData(data);
674
- },
675
- error: function (request) {
676
- self.RecvError(request);
677
- }
678
- })
679
- }
680
-
681
- this.RecvData = function (recvData) {
682
- // console.log("recvDatainteract", recvData.data.list)
683
- var data = recvData.data;
684
- if (this.Count <= 0)
685
- this.Count = data.count; //一共的新闻个数
686
-
687
- var info = {};
688
- info.Start = this.Data.length;
689
- info.End = this.Data.length;
690
-
691
- if (data.aggregate) {
692
- for (var i in data.aggregate) {
693
- this.Data.Aggregate.push({
694
- Name: data.aggregate[i].value2,
695
- Symbol: data.aggregate[i].value,
696
- Count: data.aggregate[i].count
697
- });
698
- }
699
- // this.Data.Aggregate = data.aggregate;
700
- }
701
-
702
- for (var i in data.list) {
703
- var item = data.list[i];
704
- this.Data.News.push({
705
- ID: item.id,
706
- Data: item.questondate,
707
- Title: item.question,
708
- Author: item.questioner,
709
-
710
- Data2: item.answerdate,
711
- Author2: item.answerer,
712
- Content: item.answer,
713
- Symbol: item.symbol
714
- });
715
-
716
- if (i > 0) ++info.End;
717
- }
718
-
719
- this.CacheCount = this.Data.News.length;
720
- this.InvokeCallback(info);
721
- }
722
-
723
- this.RecvError = function (request) {
724
- console.log("[StockInteract::RecvError] ", request)
725
- }
726
-
727
- this.InvokeCallback = function (info) {
728
- if (typeof(this.Callback) != 'function') return;
729
-
730
- this.Callback(info, this);
731
- }
732
-
733
- //下拉获取下一页
734
- this.GetNextPage = function () {
735
- var self = this;
736
- // 取最近1年的数据
737
- // var date = new Date();
738
- // var startDate = (date.getFullYear() - 1) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
739
- // var endDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
740
-
741
- var start = this.Data.News.length;
742
- var end = start + this.PageSize;
743
-
744
- if (typeof(this.Symbol) == "string") {
745
- var data = {
746
- "symbol": [this.Symbol],
747
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
748
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
749
- "querydate": {
750
- "StartDate": this.StartDate,
751
- "EndDate": this.EndDate
752
- },
753
- "search": this.SearchKey,
754
- "calccount": 1, //返回一共的数据个数
755
- "start": start,
756
- "end": end,
757
- "userid": this.userid
758
- }
759
- } else {
760
- var data = {
761
- "symbol": this.Symbol,
762
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
763
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
764
- "querydate": {
765
- "StartDate": this.StartDate,
766
- "EndDate": this.EndDate
767
- },
768
- "search": this.SearchKey,
769
- "calccount": 1, //返回一共的数据个数
770
- "start": start,
771
- "end": end,
772
- "userid": this.userid,
773
- "aggregate": this.Aggregate
774
- }
775
- }
776
-
777
- wx.request({
778
- url: this.ApiUrl,
779
- data: data,
780
- method: "POST",
781
- dataType: "json",
782
- success: function (data) {
783
- self.RecvData(data);
784
- },
785
- error: function (request) {
786
- self.RecvError(request);
787
- }
788
- })
789
- }
790
-
791
- //模块搜索
792
- this.ModuleSearch = function (search) {
793
- var self = this;
794
-
795
- //清空数据
796
- this.Data = {
797
- News: [],
798
- Aggregate: []
799
- };
800
- this.Count = 0;
801
- this.CacheCount = 0;
802
- // // 取最近1年的数据
803
- // var date = new Date();
804
- // var startDate = (date.getFullYear()) * 10000 + (date.getMonth() - 2) * 100 + date.getDate();
805
- // var endDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
806
-
807
- if (this.Symbol == null) {
808
- var data = {
809
- "symbol": [],
810
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
811
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
812
- "querydate": {
813
- "StartDate": this.StartDate,
814
- "EndDate": this.EndDate
815
- },
816
- "search": search,
817
- "calccount": 1, //返回一共的数据个数
818
- "start": 0,
819
- "end": this.PageSize,
820
- "userid": this.userid,
821
- "aggregate": this.Aggregate
822
- }
823
- } else {
824
- var data = {
825
- "symbol": [this.Symbol],
826
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
827
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
828
- "querydate": {
829
- "StartDate": this.StartDate,
830
- "EndDate": this.EndDate
831
- },
832
- "search": search,
833
- "calccount": 1, //返回一共的数据个数
834
- "start": 0,
835
- "end": this.PageSize,
836
- "userid": this.userid
837
- }
838
- }
839
-
840
- wx.request({
841
- url: this.ApiUrl,
842
- data: data,
843
- method: "POST",
844
- dataType: "json",
845
- success: function (data) {
846
- self.RecvData(data);
847
- },
848
- error: function (request) {
849
- self.RecvError(request);
850
- }
851
- })
852
- }
853
-
854
- //模块搜索获取下一页
855
- this.ModuleGetNextPage = function (search) {
856
- var self = this;
857
- // 取最近1年的数据
858
- // var date = new Date();
859
- // var startDate = (date.getFullYear()) * 10000 + (date.getMonth() - 2) * 100 + date.getDate();
860
- // var endDate = date.getFullYear() * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
861
-
862
- var start = this.Data.News.length;
863
- var end = start + this.PageSize;
864
-
865
- if (this.Symbol == null) {
866
- var data = {
867
- "symbol": [],
868
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
869
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
870
- "querydate": {
871
- "StartDate": this.StartDate,
872
- "EndDate": this.EndDate
873
- },
874
- "search": search,
875
- "calccount": 1, //返回一共的数据个数
876
- "start": start,
877
- "end": end,
878
- "userid": this.userid
879
- }
880
- } else {
881
- var data = {
882
- "symbol": [this.Symbol],
883
- "filed": ["symbol", "questioner", "question", "questondate", "answerer", "answer", "answerdate", "id"],
884
- // "querydate": {"StartDate": startDate, "EndDate": endDate},
885
- "querydate": {
886
- "StartDate": this.StartDate,
887
- "EndDate": this.EndDate
888
- },
889
- "search": search,
890
- "calccount": 1, //返回一共的数据个数
891
- "start": start,
892
- "end": end,
893
- "userid": this.userid
894
- }
895
- }
896
-
897
- wx.request({
898
- url: this.ApiUrl,
899
- data: data,
900
- method: "POST",
901
- dataType: "json",
902
- success: function (data) {
903
- self.RecvData(data);
904
- },
905
- error: function (request) {
906
- self.RecvError(request);
907
- }
908
- })
909
- }
910
- }
911
-
912
-
913
- //新闻详情
914
- function StockNewsContent(id) {
915
- this.newMethod = INewsContent; //派生
916
- this.newMethod(id);
917
- delete this.newMethod;
918
-
919
- this.ApiUrl = g_JSNewsResource.Domain + "/API/NewsStockDetail2"
920
-
921
- this.GetContent = function () {
922
- var self = this;
923
- //清空数据
924
- this.Name = null;
925
- this.Error = null;
926
- this.Data = null;
927
-
928
- wx.request({
929
- url: this.ApiUrl,
930
- data: {
931
- "userid": null,
932
- "id": this.ID,
933
- "symbol": this.Symbol,
934
- "filed": ["name", "symbol", "releasedate", "title", "id", "content", "link", "source"]
935
- },
936
- method: "POST",
937
- dataType: "json",
938
- success: function (data) {
939
- self.RecvData(data);
940
- },
941
- error: function (request) {
942
- self.RecvError(request);
943
- }
944
- })
945
- }
946
-
947
- this.RecvData = function (recvData) {
948
- // console.log("[StockNewsContent::RecvData] ",recvData);
949
- var data = recvData.data;
950
- var detail = data.detail;
951
- if (detail == null) return this.InvokeCallback();
952
-
953
- //把API数据格式 转换成自己的对外的统一格式,
954
- this.Data = {};
955
- this.Data.Date = detail.releasedate;
956
- this.Data.Content = detail.content;
957
- this.Data.Title = detail.title;
958
- this.Data.Source = detail.source;
959
-
960
- //新闻关联的其他股票列表
961
- var relation = new Array();
962
- for (var i in data.stocklist) {
963
- var item = data.stocklist[i];
964
- relation.push({
965
- Symbol: item.symbol,
966
- Name: item.name
967
- });
968
- }
969
- this.Data.Relation = relation;
970
-
971
- this.Name = detail.name;
972
-
973
- this.InvokeCallback();
974
- }
975
-
976
- this.RecvError = function (reqeust) {
977
- this.Error = "请求失败";
978
- this.InvokeCallback();
979
- }
980
-
981
- this.InvokeCallback = function () {
982
- if (typeof(this.Callback) != 'function') return;
983
-
984
- this.Callback(this);
985
- }
986
- }
987
-
988
- //调研详情
989
- function marketSearchInfo(id) {
990
- this.newMethod = INewsContent; //派生
991
- this.newMethod(id);
992
- delete this.newMethod;
993
-
994
- this.ApiUrl = g_JSNewsResource.Domain + "/API/InvestorRelationsDetail"
995
-
996
- this.GetContent = function () {
997
- var self = this;
998
- //清空数据
999
- this.Name = null;
1000
- this.Error = null;
1001
- this.Data = null;
1002
-
1003
- wx.request({
1004
- url: this.ApiUrl,
1005
- data: {
1006
- "userid": null,
1007
- "id": this.ID,
1008
- "filed": ["name", "symbol", "releasedate", "id", "content", "level", "researchdate", "type","researcher"]
1009
- },
1010
- method: "POST",
1011
- dataType: "json",
1012
- success: function (data) {
1013
- if (data.data.code != 0) {
1014
- wx.showModal({
1015
- title: '提示',
1016
- content: data.data.message,
1017
- })
1018
- return;
1019
- }
1020
- self.RecvData(data);
1021
- },
1022
- error: function (request) {
1023
- self.RecvError(request);
1024
- }
1025
- })
1026
- }
1027
-
1028
- this.RecvData = function (recvData) {
1029
- // console.log("[StockNewsContent::RecvData] ",recvData);
1030
- var data = recvData.data;
1031
- var detail = data.list[0];
1032
- if (detail == null) return this.InvokeCallback();
1033
- //把API数据格式 转换成自己的对外的统一格式,
1034
- this.Data = {};
1035
- this.Data.Releasedate = detail.releasedate;
1036
- this.Data.Researchdate = detail.researchdate;
1037
- this.Data.Content = detail.content;
1038
- this.Data.Name = detail.name;
1039
- this.Data.Symbol = detail.symbol;
1040
- this.Data.Type = detail.type;
1041
- this.Data.Level = detail.level;
1042
- this.Data.Id = detail.id;
1043
- this.Data.Researcher = detail.researcher;
1044
-
1045
- this.InvokeCallback();
1046
- }
1047
-
1048
- this.RecvError = function (reqeust) {
1049
- this.Error = "请求失败";
1050
- this.InvokeCallback();
1051
- }
1052
-
1053
- this.InvokeCallback = function () {
1054
- if (typeof(this.Callback) != 'function') return;
1055
-
1056
- this.Callback(this);
1057
- }
1058
- }
1059
-
1060
-
1061
- //负面新闻
1062
- function StockNegative(symbol) {
1063
- this.newMethod = INewsBase; //派生
1064
- this.newMethod(symbol);
1065
- delete this.newMethod;
1066
-
1067
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsNegativeList';
1068
-
1069
- //获取第1页
1070
- this.GetFirstPage = function () {
1071
- //清空数据
1072
- this.Data = [];
1073
- this.Count = 0;
1074
- this.CacheCount = 0;
1075
-
1076
- var self = this;
1077
- let arySymbol = this.GetQuerySymbol();
1078
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1079
-
1080
- wx.request({
1081
- url: this.ApiUrl,
1082
- data: {
1083
- "symbol": arySymbol,
1084
- "filed": ["symbol", "name", "releasedate", "title", "id", "source"],
1085
- "querydate": {
1086
- "startDate": this.StartDate,
1087
- "endDate": this.EndDate
1088
- },
1089
- "search": null,
1090
- "calccount": 1, //返回一共的数据个数
1091
- "start": 0,
1092
- "end": this.PageSize,
1093
- "userid": null
1094
- },
1095
- method: "POST",
1096
- dataType: "json",
1097
- success: function (data) {
1098
- self.RecvData(data);
1099
- },
1100
- error: function (request) {
1101
- self.RecvError(request);
1102
- }
1103
- })
1104
- }
1105
-
1106
- this.RecvData = function (recvData) {
1107
- var data = recvData.data;
1108
- if (this.Count <= 0)
1109
- this.Count = data.count; //一共的新闻个数
1110
-
1111
- var info = {};
1112
- info.Start = this.Data.length;
1113
- info.End = this.Data.length;
1114
-
1115
- for (var i in data.list) {
1116
- var item = data.list[i];
1117
- this.Data.push({
1118
- Name: item.name,
1119
- Symbol: item.symbol,
1120
- ID: item.id,
1121
- Data: item.releasedate,
1122
- Title: item.title,
1123
- Source: item.source
1124
- });
1125
-
1126
- if (i > 0) ++info.End;
1127
- }
1128
-
1129
- this.CacheCount = this.Data.length;
1130
- this.InvokeCallback(info);
1131
- }
1132
-
1133
- this.RecvError = function (request) {
1134
- console.log("[StockNegative::RecvError] ", request)
1135
- }
1136
-
1137
- this.InvokeCallback = function (info) {
1138
- if (typeof(this.Callback) != 'function') return;
1139
-
1140
- this.Callback(info, this);
1141
- }
1142
-
1143
- //下拉获取下一页
1144
- this.GetNextPage = function () {
1145
- var self = this;
1146
-
1147
- let arySymbol = this.GetQuerySymbol();
1148
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1149
-
1150
- var start = this.Data.length;
1151
- var end = start + this.PageSize;
1152
- wx.request({
1153
- url: this.ApiUrl,
1154
- data: {
1155
- "symbol": arySymbol,
1156
- "filed": ["symbol", "name", "releasedate", "title", "id", "source"],
1157
- "querydate": {
1158
- "startDate": startDate,
1159
- "endDate": endDate
1160
- },
1161
- "search": null,
1162
- "calccount": 0, //下页页不需要统计个数了
1163
- "start": start,
1164
- "end": end,
1165
- "userid": null
1166
- },
1167
- method: "POST",
1168
- dataType: "json",
1169
- success: function (data) {
1170
- self.RecvData(data);
1171
- },
1172
- error: function (request) {
1173
- self.RecvError(request);
1174
- }
1175
- })
1176
- }
1177
-
1178
- }
1179
-
1180
- //公告类型
1181
- var STOCK_REPORT_TYPE_ID = {
1182
- REPORT_GOOD: '利好公告',
1183
- REPORT_BAD: '利空公告'
1184
- };
1185
-
1186
- //公告
1187
- function StockReport(symbol) {
1188
- this.newMethod = INewsBase; //派生
1189
- this.newMethod(symbol);
1190
- delete this.newMethod;
1191
-
1192
- this.ApiUrl = g_JSNewsResource.Domain + '/API/ReportListByES'; //走公司内网查询接口
1193
- this.ReportType = []; //公告类型数组
1194
-
1195
- //获取第1页
1196
- this.GetFirstPage = function () {
1197
- //清空数据
1198
- this.Data = [];
1199
- this.Count = 0;
1200
- this.CacheCount = 0;
1201
-
1202
- var self = this;
1203
- let arySymbol = this.GetQuerySymbol();
1204
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1205
- let reportType = null;
1206
- if (this.ReportType && this.ReportType.length > 0) reportType = this.ReportType[0]; //暂时只支持1个类型
1207
-
1208
- wx.request({
1209
- url: this.ApiUrl,
1210
- data: {
1211
- "symbol": arySymbol,
1212
- "filed": ["symbol", "name", "releasedate", "title", "id", "source"],
1213
- "querydate": {
1214
- "startDate": this.StartDate,
1215
- "endDate": this.EndDate
1216
- },
1217
- "search": null,
1218
- "calccount": 1, //返回一共的数据个数
1219
- "start": 0,
1220
- "end": this.PageSize,
1221
- "userid": null,
1222
- 'type': reportType
1223
- },
1224
- method: "POST",
1225
- dataType: "json",
1226
- success: function (data) {
1227
- self.RecvData(data);
1228
- },
1229
- error: function (request) {
1230
- self.RecvError(request);
1231
- }
1232
- })
1233
- }
1234
-
1235
- this.RecvData = function (recvData) {
1236
- var data = recvData.data;
1237
- if (this.Count <= 0)
1238
- this.Count = data.count; //一共的新闻个数
1239
-
1240
- var info = {};
1241
- info.Start = this.Data.length;
1242
- info.End = this.Data.length;
1243
-
1244
- for (let i in data.report) {
1245
- let item = data.report[i];
1246
- this.Data.push({
1247
- Name: item.name,
1248
- Symbol: item.symbol,
1249
- ID: item.id,
1250
- Data: item.releasedate.substring(0, 4) + "-" + item.releasedate.substring(4, 6) + "-" + item.releasedate.substring(6, 8),
1251
- Title: item.title,
1252
- Source: item.source,
1253
- Type: item.type,
1254
- Showurl: item.showurl
1255
- });
1256
-
1257
- if (i > 0) ++info.End;
1258
- }
1259
-
1260
- this.CacheCount = this.Data.length;
1261
- // this.InvokeCallback(info);
1262
- this.InvokeCallback(this.Data);
1263
- }
1264
-
1265
- this.RecvError = function (request) {
1266
- console.log("[StockReport::RecvError] ", request)
1267
- }
1268
-
1269
- this.InvokeCallback = function (info) {
1270
- if (typeof(this.Callback) != 'function') return;
1271
-
1272
- this.Callback(info, this);
1273
- }
1274
-
1275
- //下拉获取下一页
1276
- this.GetNextPage = function () {
1277
- var self = this;
1278
- let arySymbol = this.GetQuerySymbol();
1279
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1280
-
1281
- var start = this.Data.length;
1282
- var end = start + this.PageSize;
1283
- wx.request({
1284
- url: this.ApiUrl,
1285
- data: {
1286
- "symbol": arySymbol,
1287
- "filed": ["symbol", "name", "releasedate", "title", "id", "source"],
1288
- "querydate": {
1289
- "startDate": self.StartDate,
1290
- "endDate": self.EndDate
1291
- },
1292
- "search": null,
1293
- "calccount": 0, //下页页不需要统计个数了
1294
- "start": start,
1295
- "end": end,
1296
- "userid": null
1297
- },
1298
- method: "POST",
1299
- dataType: "json",
1300
- success: function (data) {
1301
- self.RecvData(data);
1302
- },
1303
- error: function (request) {
1304
- self.RecvError(request);
1305
- }
1306
- })
1307
- }
1308
-
1309
- }
1310
-
1311
- //新的负面新闻接口 NewsAllByES
1312
- function newStockReport(symbol) {
1313
- this.newMethod = INewsBase; //派生
1314
- this.newMethod(symbol);
1315
- delete this.newMethod;
1316
-
1317
- this.ApiUrl = g_JSNewsResource.Domain + '/api/NewsAllByES_V2'; //走公司内网查询接口
1318
- this.ReportType = []; //公告类型数组
1319
- this.PageIndex = 1;
1320
- this.PageSize = 10;
1321
- this.SearchKey = "";
1322
- this.Count;
1323
-
1324
- //获取第1页
1325
- this.GetFirstPage = function () {
1326
- //清空数据
1327
- this.Data = [];
1328
- this.Count = 0;
1329
- this.CacheCount = 0;
1330
-
1331
- var self = this;
1332
- let arySymbol = this.GetQuerySymbol();
1333
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1334
- let reportType = null;
1335
- if (this.ReportType && this.ReportType.length > 0) reportType = this.ReportType[0]; //暂时只支持1个类型
1336
-
1337
- wx.request({
1338
- url: this.ApiUrl,
1339
- data: {
1340
- "PageInfo": {
1341
- "PageIndex": 1,
1342
- "PageSize": this.PageSize
1343
- },
1344
- "Filter": {
1345
- "QueryDate": {
1346
- "StartDate": this.StartDate,
1347
- "EndDate": this.EndDate
1348
- },
1349
- "SymbolList": arySymbol,
1350
- "TypeList": this.ReportType, //["利空公告"],
1351
- "NegativeType": 10,
1352
- "SearchKey": this.SearchKey
1353
- }
1354
- },
1355
- method: "POST",
1356
- dataType: "json",
1357
- success: function (data) {
1358
- self.RecvData(data);
1359
- },
1360
- error: function (request) {
1361
- self.RecvError(request);
1362
- }
1363
- })
1364
- }
1365
-
1366
- this.RecvData = function (recvData) {
1367
- // console.log("recvData", recvData);
1368
- var data = recvData.data;
1369
- if (this.Count <= 0)
1370
- this.Count = data.count; //一共的新闻个数
1371
-
1372
- var info = {};
1373
- info.Start = this.Data.length;
1374
- info.End = this.Data.length;
1375
-
1376
- for (let i in data.list) {
1377
- let item = data.list[i];
1378
- this.Data.push({
1379
- Name: item.stocklist[0].name,
1380
- Symbol: item.stocklist[0].symbol,
1381
- ID: item.id,
1382
- Data: item.date,
1383
- Title: item.title,
1384
- Source: item.source,
1385
- Type: item.type,
1386
- Showurl: item.showurl,
1387
- Negativetype: item.negativetype
1388
- });
1389
-
1390
- if (i > 0) ++info.End;
1391
- }
1392
-
1393
- this.CacheCount = this.Data.length;
1394
- // this.InvokeCallback(info);
1395
- this.InvokeCallback(this.Data);
1396
- }
1397
-
1398
- this.RecvError = function (request) {
1399
- console.log("[StockReport::RecvError] ", request)
1400
- }
1401
-
1402
- this.InvokeCallback = function (info) {
1403
- if (typeof(this.Callback) != 'function') return;
1404
-
1405
- this.Callback(info, this);
1406
- }
1407
-
1408
- //下拉获取下一页
1409
- this.GetNextPage = function () {
1410
-
1411
- console.log("this.PageIndex * this.PageSize", this.PageIndex * this.PageSize, this.Count)
1412
- if (this.PageIndex * this.PageSize < this.Count) {
1413
- this.PageIndex++;
1414
- var self = this;
1415
- let arySymbol = this.GetQuerySymbol();
1416
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1417
-
1418
- wx.request({
1419
- url: this.ApiUrl,
1420
- data: {
1421
- "PageInfo": {
1422
- "PageIndex": this.PageIndex,
1423
- "PageSize": this.PageSize
1424
- },
1425
- "Filter": {
1426
- "QueryDate": {
1427
- "StartDate": this.StartDate,
1428
- "EndDate": this.EndDate
1429
- },
1430
- "SymbolList": arySymbol,
1431
- "TypeList": this.ReportType, //["利空公告"],
1432
- "NegativeType": 10,
1433
- "SearchKey": this.SearchKey
1434
- }
1435
- },
1436
- method: "POST",
1437
- dataType: "json",
1438
- success: function (data) {
1439
- self.RecvData(data);
1440
- },
1441
- error: function (request) {
1442
- self.RecvError(request);
1443
- }
1444
- })
1445
- } else {
1446
- wx.showToast({
1447
- title: "数据已全部加载",
1448
- icon: 'success',
1449
- duration: 1000
1450
- })
1451
- }
1452
-
1453
- }
1454
- }
1455
-
1456
- //新的负面新闻详情 接口NewsNegativeDetail
1457
- function stockReportInfo(id) {
1458
- this.newMethod = INewsBase; //派生
1459
- this.newMethod(id);
1460
- delete this.newMethod;
1461
-
1462
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsNegativeDetail';
1463
-
1464
- this.GetContent = function () {
1465
- var self = this;
1466
- //清空数据
1467
- this.Name = null;
1468
- this.Error = null;
1469
- this.Data = null;
1470
-
1471
- wx.request({
1472
- url: this.ApiUrl,
1473
- data: {
1474
- "id": this.ID,
1475
- "filed": ["name", "symbol", "releasedate", "title", "id", "content", "source"]
1476
- },
1477
- method: "POST",
1478
- dataType: "json",
1479
- success: function (data) {
1480
- self.RecvData(data);
1481
- },
1482
- error: function (request) {
1483
- self.RecvError(request);
1484
- }
1485
- })
1486
- }
1487
-
1488
- this.RecvData = function (recvData) {
1489
- // console.log("stockNew recvData",recvData);
1490
- var data = recvData.data;
1491
- var detail = data.list;
1492
- if (detail.length == 0) return this.InvokeCallback();
1493
-
1494
- //把API数据格式 转换成自己的对外的统一格式,
1495
- this.Data = {};
1496
- this.Data.Date = detail[0].releasedate;
1497
- this.Data.Content = clcontent(detail[0].content);
1498
- this.Data.Title = detail[0].title;
1499
- this.Data.Source = detail[0].source;
1500
- this.Data.Symbol = detail[0].symbol;
1501
- this.Data.Name = detail[0].name;
1502
-
1503
- //新闻关联的其他股票列表
1504
- // var relation = new Array();
1505
- // for (var i in data.stocklist) {
1506
- // var item = data.stocklist[i];
1507
- // relation.push({ Symbol: item.symbol, Name: item.name });
1508
- // }
1509
- // this.Data.Relation = relation;
1510
-
1511
- // this.Name = detail.name;
1512
-
1513
- this.InvokeCallback();
1514
- }
1515
-
1516
- this.RecvError = function (reqeust) {
1517
- this.Error = "请求失败";
1518
- this.InvokeCallback();
1519
- }
1520
-
1521
- this.InvokeCallback = function () {
1522
- if (typeof(this.Callback) != 'function') return;
1523
-
1524
- this.Callback(this);
1525
- }
1526
-
1527
- }
1528
-
1529
- //处理新的负面新闻详情 内容的格式
1530
- function clcontent(content) {
1531
- console.log("处理新的负面新闻详情 内容的格式");
1532
- // console.log(content);
1533
- var reg = new RegExp("\r\n\r\n", "g");
1534
- var regs = new RegExp("\r\n", "g");
1535
- var regs1 = new RegExp("<br/><br/>", "g");
1536
- var regs2 = new RegExp("\n", "g");
1537
- var regs3 = new RegExp(" ", "g");
1538
- var regs4 = new RegExp("\r", "g");
1539
- content = content.replace(reg, '\r\n').replace(regs, '<br/>').replace(regs2, '<br/>').replace(regs1, '<br/>').replace(regs4, '<br/>').replace(regs3, ''); //&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1540
- var contentArr = content.split("<br/>");
1541
-
1542
- for (var i = contentArr.length - 1; i > 0; i--) {
1543
- if (contentArr[i] == '') {
1544
- contentArr.splice(i, 1);
1545
- }
1546
- }
1547
-
1548
- return contentArr;
1549
- }
1550
- // 处理官网新闻详情数据格式
1551
- function formatContent(content) {
1552
- var reg = new RegExp("\n", "g");
1553
- content = content.replace(reg, '<br/>');
1554
- var contentArr = content.split("<br/>");
1555
- for (let i = contentArr.length - 1; i > 0; i--) {
1556
- if (contentArr[i] == '') {
1557
- contentArr.splice(i, 1);
1558
- }
1559
- }
1560
- return contentArr.map(e => e.trim());
1561
- }
1562
-
1563
- //官网新闻
1564
- function OfficialWebsiteNews(symbol) {
1565
- this.newMethod = INewsBase; //派生
1566
- this.newMethod(symbol);
1567
- delete this.newMethod;
1568
-
1569
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsCompanyList';
1570
- this.PageIndex = 0;
1571
- this.SearchKey = "";
1572
- this.GetFirstPage = function () {
1573
- //清空数据
1574
- this.Data = [];
1575
- this.Count = 0;
1576
- this.CacheCount = 0;
1577
-
1578
- var self = this;
1579
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1580
- wx.request({
1581
- url: this.ApiUrl,
1582
- data: {
1583
- "symbol": this.Symbol,
1584
- "filed": ["symbol", "name", "releasedate", "title", "id", "source", "link", "content"],
1585
- "querydate": {
1586
- "startDate": this.StartDate,
1587
- "endDate": this.EndDate
1588
- },
1589
- "calccount": 1,
1590
- "start": 0,
1591
- "search": this.SearchKey,
1592
- "aggregate": this.Aggregate
1593
- },
1594
- method: "POST",
1595
- dataType: "json",
1596
- success: function (data) {
1597
- self.RecvData(data);
1598
- },
1599
- error: function (request) {
1600
- self.RecvError(request);
1601
- }
1602
- })
1603
- }
1604
-
1605
- this.RecvData = function (recvData) {
1606
- let data = recvData.data, formatData = [];
1607
- if (data.list && data.list.length > 0) {
1608
- formatData = data.list.map(e => Object.assign(e, {
1609
- releasedate: e.releasedate.substring(0, 16)
1610
- }));
1611
- } else {
1612
- formatData = [];
1613
- }
1614
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
1615
- this.Data = this.Data.concat(formatData);
1616
- if (this.Callback) this.Callback(this);
1617
- }
1618
-
1619
- this.RecvError = function (request) {
1620
- console.log("[StockReport::RecvError] ", request)
1621
- }
1622
-
1623
- this.GetNextPage = function () {
1624
- this.PageIndex++;
1625
- var self = this;
1626
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1627
-
1628
- if (this.PageSize * this.PageIndex <= this.Count) {
1629
- wx.request({
1630
- url: this.ApiUrl,
1631
- data: {
1632
- "symbol": this.Symbol,
1633
- "filed": ["symbol", "name", "releasedate", "title", "id", "source", "link", "content"],
1634
- "querydate": {
1635
- "startDate": this.StartDate,
1636
- "endDate": this.EndDate
1637
- },
1638
- "calccount": 1,
1639
- "search": this.SearchKey,
1640
- "aggregate": this.Aggregate,
1641
- "start": this.PageSize * this.PageIndex,
1642
- "end": this.PageSize * (this.PageIndex + 1),
1643
- },
1644
- method: "POST",
1645
- dataType: "json",
1646
- success: function (data) {
1647
- self.RecvData(data);
1648
- },
1649
- error: function (request) {
1650
- self.RecvError(request);
1651
- }
1652
- })
1653
- } else {
1654
- wx.showToast({
1655
- title: "数据已全部加载",
1656
- icon: 'success',
1657
- duration: 1000
1658
- })
1659
- }
1660
- }
1661
- }
1662
-
1663
- //高管新闻
1664
- function SeniorExecutiveNews(symbol) {
1665
- this.newMethod = INewsBase; //派生
1666
- this.newMethod(symbol);
1667
- delete this.newMethod;
1668
-
1669
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsTopManagersList';
1670
- this.PageIndex = 0;
1671
- this.SearchKey = "";
1672
- this.GetFirstPage = function () {
1673
- //清空数据
1674
- this.Data = [];
1675
- this.Count = 0;
1676
- this.CacheCount = 0;
1677
-
1678
- var self = this;
1679
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1680
- wx.request({
1681
- url: this.ApiUrl,
1682
- data: {
1683
- "symbol": this.Symbol,
1684
- "filed": ["symbol", "name", "releasedate", "title", "id", "source"],
1685
- "querydate": {
1686
- "startDate": this.StartDate,
1687
- "endDate": this.EndDate
1688
- },
1689
- "calccount": 1,
1690
- "start": 0,
1691
- "search": this.SearchKey,
1692
- "aggregate": this.Aggregate
1693
- },
1694
- method: "POST",
1695
- dataType: "json",
1696
- success: function (data) {
1697
- self.RecvData(data);
1698
- },
1699
- error: function (request) {
1700
- self.RecvError(request);
1701
- }
1702
- })
1703
- }
1704
-
1705
- this.RecvData = function (recvData) {
1706
- let data = recvData.data, formatData = [];
1707
- if (data.list && data.list.length > 0) {
1708
- formatData = data.list.map(e => Object.assign(e, {
1709
- releasedate: e.releasedate.substring(0, 16)
1710
- }));
1711
- } else {
1712
- formatData = [];
1713
- }
1714
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
1715
- this.Data = this.Data.concat(formatData);
1716
- if (this.Callback) this.Callback(this);
1717
- }
1718
-
1719
- this.RecvError = function (request) {
1720
- console.log("[StockReport::RecvError] ", request)
1721
- }
1722
-
1723
- this.GetNextPage = function () {
1724
- this.PageIndex++;
1725
- var self = this;
1726
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1727
-
1728
- if (this.PageSize * this.PageIndex <= this.Count) {
1729
- wx.request({
1730
- url: this.ApiUrl,
1731
- data: {
1732
- "symbol": this.Symbol,
1733
- "filed": ["symbol", "name", "releasedate", "title", "id", "source", "link", "content"],
1734
- "querydate": {
1735
- "startDate": this.StartDate,
1736
- "endDate": this.EndDate
1737
- },
1738
- "calccount": 1,
1739
- "search": this.SearchKey,
1740
- "aggregate": this.Aggregate,
1741
- "start": this.PageSize * this.PageIndex,
1742
- "end": this.PageSize * (this.PageIndex + 1),
1743
- },
1744
- method: "POST",
1745
- dataType: "json",
1746
- success: function (data) {
1747
- self.RecvData(data);
1748
- },
1749
- error: function (request) {
1750
- self.RecvError(request);
1751
- }
1752
- })
1753
- } else {
1754
- wx.showToast({
1755
- title: "数据已全部加载",
1756
- icon: 'success',
1757
- duration: 1000
1758
- })
1759
- }
1760
- }
1761
- }
1762
-
1763
- //大V观点新闻
1764
- function ViewpointsByVIP(symbol) {
1765
- this.newMethod = INewsBase; //派生
1766
- this.newMethod(symbol);
1767
- delete this.newMethod;
1768
-
1769
- this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsBigVList';
1770
- this.PageIndex = 0;
1771
- this.GetFirstPage = function () {
1772
- //清空数据
1773
- this.Data = [];
1774
- this.Count = 0;
1775
- this.CacheCount = 0;
1776
-
1777
- var self = this;
1778
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1779
- wx.request({
1780
- url: this.ApiUrl,
1781
- data: {
1782
- "PageInfo": {
1783
- "PageIndex": this.PageIndex,
1784
- "PageSize": this.PageSize
1785
- },
1786
- "Filter": {
1787
- "QueryDate": {
1788
- "StartDate": this.StartDate,
1789
- "EndDate": this.EndDate
1790
- },
1791
- "CategoryList": []
1792
- }
1793
- },
1794
- method: "POST",
1795
- dataType: "json",
1796
- success: function (data) {
1797
- self.RecvData(data);
1798
- },
1799
- error: function (request) {
1800
- self.RecvError(request);
1801
- }
1802
- })
1803
- }
1804
-
1805
- this.RecvData = function (recvData) {
1806
- let data = recvData.data, formatData = [];
1807
- if (data.list && data.list.length > 0) {
1808
- formatData = data.list.map(e => Object.assign(e, {
1809
- date: e.date.substring(0, 16)
1810
- }));
1811
- } else {
1812
- formatData = [];
1813
- }
1814
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
1815
- this.Data = this.Data.concat(formatData);
1816
- if (this.Callback) this.Callback(this);
1817
- }
1818
-
1819
- this.RecvError = function (request) {
1820
- console.log("[StockReport::RecvError] ", request)
1821
- }
1822
-
1823
- this.GetNextPage = function () {
1824
- this.PageIndex++;
1825
- var self = this;
1826
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1827
-
1828
- if (this.PageSize * this.PageIndex <= this.Count) {
1829
- wx.request({
1830
- url: this.ApiUrl,
1831
- data: {
1832
- "PageInfo": {
1833
- "PageIndex": this.PageIndex,
1834
- "PageSize": this.PageSize
1835
- },
1836
- "Filter": {
1837
- "QueryDate": {
1838
- "StartDate": this.StartDate,
1839
- "EndDate": this.EndDate
1840
- },
1841
- "CategoryList": []
1842
- }
1843
- },
1844
- method: "POST",
1845
- dataType: "json",
1846
- success: function (data) {
1847
- self.RecvData(data);
1848
- },
1849
- error: function (request) {
1850
- self.RecvError(request);
1851
- }
1852
- })
1853
- } else {
1854
- wx.showToast({
1855
- title: "数据已全部加载",
1856
- icon: 'success',
1857
- duration: 1000
1858
- })
1859
- }
1860
- }
1861
- }
1862
-
1863
- //高管风险新闻概览
1864
- function TopManagersRiskNews(symbol) {
1865
- this.newMethod = INewsBase; //派生
1866
- this.newMethod(symbol);
1867
- delete this.newMethod;
1868
-
1869
- this.ApiUrl = g_JSNewsResource.Domain + '/API/TopManagersRiskType';
1870
- this.PageIndex = 0;
1871
- this.GetFirstPage = function () {
1872
- //清空数据
1873
- this.Data = [];
1874
- this.Count = 0;
1875
- this.CacheCount = 0;
1876
-
1877
- var self = this;
1878
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1879
- wx.request({
1880
- url: this.ApiUrl,
1881
- data: {
1882
- "Filter": {
1883
- "QueryDate": {
1884
- "StartDate": this.StartDate,
1885
- "EndDate": this.EndDate
1886
- },
1887
- "SymbolList": this.Symbol
1888
- }
1889
- },
1890
- method: "POST",
1891
- dataType: "json",
1892
- success: function (data) {
1893
- self.RecvData(data);
1894
- },
1895
- error: function (request) {
1896
- self.RecvError(request);
1897
- }
1898
- })
1899
- }
1900
-
1901
- this.RecvData = function (recvData) {
1902
- let data = recvData.data;
1903
- this.Data = data.list || [];
1904
- if (this.Callback) this.Callback(this);
1905
- }
1906
-
1907
- this.RecvError = function (request) {
1908
- console.log("[StockReport::RecvError] ", request)
1909
- }
1910
-
1911
- this.GetNextPage = function () {
1912
- this.PageIndex++;
1913
- var self = this;
1914
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
1915
-
1916
- if (this.PageSize * this.PageIndex <= this.Count) {
1917
- wx.request({
1918
- url: this.ApiUrl,
1919
- data: {
1920
- "PageInfo": {
1921
- "PageIndex": this.PageIndex,
1922
- "PageSize": this.PageSize
1923
- },
1924
- "Filter": {
1925
- "QueryDate": {
1926
- "StartDate": this.StartDate,
1927
- "EndDate": this.EndDate
1928
- },
1929
- "SymbolList": this.Symbol
1930
- }
1931
- },
1932
- method: "POST",
1933
- dataType: "json",
1934
- success: function (data) {
1935
- self.RecvData(data);
1936
- },
1937
- error: function (request) {
1938
- self.RecvError(request);
1939
- }
1940
- })
1941
- } else {
1942
- wx.showToast({
1943
- title: "数据已全部加载",
1944
- icon: 'success',
1945
- duration: 1000
1946
- })
1947
- }
1948
- }
1949
- }
1950
-
1951
- //官网新闻详情
1952
- function OfficialWebsiteInfo(id) {
1953
- this.newMethod = INewsContent; //派生
1954
- this.newMethod(id);
1955
- delete this.newMethod;
1956
-
1957
- this.ApiUrl = g_JSNewsResource.Domain + "/API/NewsCompanyDetail";
1958
-
1959
- this.GetContent = function () {
1960
- var self = this;
1961
- //清空数据
1962
- this.Name = null;
1963
- this.Error = null;
1964
- this.Data = null;
1965
-
1966
- wx.request({
1967
- url: this.ApiUrl,
1968
- data: {
1969
- "userid": null,
1970
- "id": this.ID,
1971
- "filed": ["name", "symbol", "releasedate", "title", "id", "content", "link"]
1972
- },
1973
- method: "POST",
1974
- dataType: "json",
1975
- success: function (data) {
1976
- self.RecvData(data);
1977
- },
1978
- error: function (request) {
1979
- self.RecvError(request);
1980
- }
1981
- })
1982
- };
1983
-
1984
- this.RecvData = function (recvData) {
1985
- console.log("[StockNewsContent::RecvData] ", recvData);
1986
- var data = recvData.data, detail = [];
1987
- if (data.list && data.list.length > 0) {
1988
- detail = data.list.map(e => Object.assign(e, {
1989
- releasedate: e.releasedate.substring(0, 16),
1990
- content: formatContent(e.content)
1991
- }));
1992
- } else {
1993
- detail = [];
1994
- }
1995
- if (detail.length === 0) return this.InvokeCallback();
1996
- this.Data = detail[0];
1997
- console.log("this.Data", this.Data);
1998
- this.InvokeCallback();
1999
- };
2000
-
2001
- this.RecvError = function (reqeust) {
2002
- this.Error = "请求失败";
2003
- this.InvokeCallback();
2004
- };
2005
-
2006
- this.InvokeCallback = function () {
2007
- if (typeof(this.Callback) != 'function') return;
2008
-
2009
- this.Callback(this);
2010
- };
2011
- }
2012
-
2013
- //高管新闻详情
2014
- function SeniorExecutiveInfo(id) {
2015
- this.newMethod = INewsContent; //派生
2016
- this.newMethod(id);
2017
- delete this.newMethod;
2018
-
2019
- this.ApiUrl = g_JSNewsResource.Domain + "/API/NewsTopManagersDetail";
2020
-
2021
- this.GetContent = function () {
2022
- var self = this;
2023
- //清空数据
2024
- this.Name = null;
2025
- this.Error = null;
2026
- this.Data = null;
2027
-
2028
- wx.request({
2029
- url: this.ApiUrl,
2030
- data: {
2031
- "userid": null,
2032
- "id": this.ID,
2033
- "filed": ["name", "symbol", "releasedate", "title", "id", "content", "link"]
2034
- },
2035
- method: "POST",
2036
- dataType: "json",
2037
- success: function (data) {
2038
- self.RecvData(data);
2039
- },
2040
- error: function (request) {
2041
- self.RecvError(request);
2042
- }
2043
- })
2044
- };
2045
-
2046
- this.RecvData = function (recvData) {
2047
- console.log("[StockNewsContent::RecvData] ", recvData);
2048
- var data = recvData.data, detail = [];
2049
- if (data.list && data.list.length > 0) {
2050
- detail = data.list.map(e => Object.assign(e, {
2051
- releasedate: e.releasedate.substring(0, 16),
2052
- content: formatContent(e.content)
2053
- }));
2054
- } else {
2055
- detail = [];
2056
- }
2057
- if (detail.length === 0) return this.InvokeCallback();
2058
- this.Data = detail[0];
2059
- this.InvokeCallback();
2060
- };
2061
-
2062
- this.RecvError = function (reqeust) {
2063
- this.Error = "请求失败";
2064
- this.InvokeCallback();
2065
- };
2066
-
2067
- this.InvokeCallback = function () {
2068
- if (typeof(this.Callback) != 'function') return;
2069
-
2070
- this.Callback(this);
2071
- };
2072
- }
2073
-
2074
- //大V观点新闻详情
2075
- function ViewpointsByVIPInfo(id) {
2076
- this.newMethod = INewsContent; //派生
2077
- this.newMethod(id);
2078
- delete this.newMethod;
2079
-
2080
- this.ApiUrl = g_JSNewsResource.Domain + "/API/NewsBigVDetail";
2081
-
2082
- this.GetContent = function () {
2083
- var self = this;
2084
- //清空数据
2085
- this.Name = null;
2086
- this.Error = null;
2087
- this.Data = null;
2088
-
2089
- wx.request({
2090
- url: this.ApiUrl,
2091
- data: {
2092
- "NewsId": this.ID,
2093
- },
2094
- method: "POST",
2095
- dataType: "json",
2096
- success: function (data) {
2097
- self.RecvData(data);
2098
- },
2099
- error: function (request) {
2100
- self.RecvError(request);
2101
- }
2102
- })
2103
- };
2104
-
2105
- this.RecvData = function (recvData) {
2106
- console.log("[StockNewsContent::RecvData] ", recvData);
2107
- var data = recvData.data;
2108
- if (data.code !== 0) return this.InvokeCallback();
2109
- this.Data = {
2110
- date: data.date.substring(0, 16),
2111
- title: data.title,
2112
- source: data.source,
2113
- content: formatContent(data.content)
2114
- };
2115
- console.log("this.Data", this.Data);
2116
- this.InvokeCallback();
2117
- };
2118
-
2119
- this.RecvError = function (reqeust) {
2120
- this.Error = "请求失败";
2121
- this.InvokeCallback();
2122
- };
2123
-
2124
- this.InvokeCallback = function () {
2125
- if (typeof(this.Callback) != 'function') return;
2126
-
2127
- this.Callback(this);
2128
- };
2129
- }
2130
- //高管风险新闻详情
2131
- function TopManagersRiskNewsInfo(id) {
2132
- this.newMethod = INewsContent; //派生
2133
- this.newMethod(id);
2134
- delete this.newMethod;
2135
-
2136
- this.ApiUrl = g_JSNewsResource.Domain + "/API/NewsTopManagersRiskDetail";
2137
-
2138
- this.GetContent = function () {
2139
- var self = this;
2140
- //清空数据
2141
- this.Name = null;
2142
- this.Error = null;
2143
- this.Data = null;
2144
-
2145
- wx.request({
2146
- url: this.ApiUrl,
2147
- data: {
2148
- "NewsId": this.ID,
2149
- },
2150
- method: "POST",
2151
- dataType: "json",
2152
- success: function (data) {
2153
- self.RecvData(data);
2154
- },
2155
- error: function (request) {
2156
- self.RecvError(request);
2157
- }
2158
- })
2159
- };
2160
-
2161
- this.RecvData = function (recvData) {
2162
- console.log("[StockNewsContent::RecvData] ", recvData);
2163
- var data = recvData.data;
2164
- if (data.code !== 0) return this.InvokeCallback();
2165
- this.Data = {
2166
- date: data.date.substring(0, 16),
2167
- title: data.title,
2168
- name: data.name,
2169
- source: data.source,
2170
- symbol: data.symbol,
2171
- content: formatContent(data.content)
2172
- };
2173
- console.log("this.Data", this.Data);
2174
- this.InvokeCallback();
2175
- };
2176
-
2177
- this.RecvError = function (reqeust) {
2178
- this.Error = "请求失败";
2179
- this.InvokeCallback();
2180
- };
2181
-
2182
- this.InvokeCallback = function () {
2183
- if (typeof(this.Callback) != 'function') return;
2184
-
2185
- this.Callback(this);
2186
- };
2187
- }
2188
-
2189
-
2190
- //重组失败
2191
- function FailureRegroupNews(symbol) {
2192
- this.newMethod = INewsBase; //派生
2193
- this.newMethod(symbol);
2194
- delete this.newMethod;
2195
-
2196
- this.ApiUrl = g_JSNewsResource.Domain + '/API/ReportListByES_V2';
2197
- this.PageIndex = 1;
2198
- this.SearchKey = "";
2199
- this.GetFirstPage = function () {
2200
- //清空数据
2201
- this.Data = [];
2202
- this.Count = 0;
2203
- this.CacheCount = 0;
2204
-
2205
- var self = this;
2206
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
2207
- wx.request({
2208
- url: this.ApiUrl,
2209
- data: {
2210
- PageInfo: {
2211
- PageIndex: this.PageIndex,
2212
- PageSize: 10
2213
- },
2214
- Filter: {
2215
- SymbolList: this.Symbol,
2216
- QueryDate: {
2217
- StartDate: this.StartDate,
2218
- EndDate: this.EndDate
2219
- },
2220
- Search: {
2221
- OrList: [
2222
- "终止重组",
2223
- "重组终止",
2224
- "重组失败",
2225
- "重组取消"
2226
- ],
2227
- AndList: this.SearchKey ? [this.SearchKey] : []
2228
- }
2229
- }
2230
- },
2231
- method: "POST",
2232
- dataType: "json",
2233
- success: function (data) {
2234
- self.RecvData(data);
2235
- },
2236
- error: function (request) {
2237
- self.RecvError(request);
2238
- }
2239
- })
2240
- }
2241
-
2242
- this.RecvData = function (recvData) {
2243
- let data = recvData.data, formatData = [];
2244
- if (data.list && data.list.length > 0) {
2245
- formatData = data.list.map(e => Object.assign(e, {
2246
- showurl: e.showurl ? e.showurl.replace('http://rpt.zealink.com', 'https://reporth5.zealink.com') : ''
2247
- }));
2248
- } else {
2249
- formatData = [];
2250
- }
2251
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
2252
- this.Data = this.Data.concat(formatData);
2253
- if (this.Callback) this.Callback(this);
2254
- }
2255
-
2256
- this.RecvError = function (request) {
2257
- console.log("[StockReport::RecvError] ", request)
2258
- }
2259
-
2260
- this.GetNextPage = function () {
2261
- this.PageIndex++;
2262
- var self = this;
2263
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
2264
-
2265
- var pages = this.Count / this.PageSize,
2266
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
2267
- if (this.PageIndex <= totalPages) {
2268
- wx.request({
2269
- url: this.ApiUrl,
2270
- data: {
2271
- PageInfo: {
2272
- PageIndex: this.PageIndex,
2273
- PageSize: 10
2274
- },
2275
- Filter: {
2276
- SymbolList: this.Symbol,
2277
- QueryDate: {
2278
- StartDate: this.StartDate,
2279
- EndDate: this.EndDate
2280
- },
2281
- Search: {
2282
- OrList: [
2283
- "终止重组",
2284
- "重组终止",
2285
- "重组失败",
2286
- "重组取消"
2287
- ],
2288
- AndList: this.SearchKey ? [this.SearchKey] : []
2289
- }
2290
- }
2291
- },
2292
- method: "POST",
2293
- dataType: "json",
2294
- success: function (data) {
2295
- self.RecvData(data);
2296
- },
2297
- error: function (request) {
2298
- self.RecvError(request);
2299
- }
2300
- })
2301
- } else {
2302
- wx.showToast({
2303
- title: "数据已全部加载",
2304
- icon: 'success',
2305
- duration: 1000
2306
- })
2307
- }
2308
- }
2309
- }
2310
-
2311
- //请求动态数据
2312
- function GetNews() {
2313
- // this.ApiUrl = g_JSNewsResource.Domain + '/api/NewsFlashListByES';
2314
-
2315
- var date = new Date();
2316
- var today = (date.getFullYear()) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
2317
- date.setDate(date.getDate() - 5);
2318
- var fiveDaysAgo = (date.getFullYear()) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
2319
-
2320
- this.Count; //一共的新闻个数
2321
- this.PageSize = 20; //每页的新闻个数
2322
- this.CacheCount; //已下载的新闻个数
2323
- this.StartDate = "";
2324
- this.EndDate = "";
2325
- this.SymbolList = [];
2326
- this.PageIndex = 1;
2327
- this.TypeList = [];
2328
- this.ElseTypeList = [];
2329
- this.SearchKey = "";
2330
- this.NowData = 0; //当前展示第几页的数据
2331
- this.IsAutoUpdate = true; //定时刷新
2332
- this.ShowValue = 1,
2333
-
2334
-
2335
- this.Stop = function () {
2336
- // console.log("[JSStock::Stop] stop update.")
2337
- this.IsAutoUpdate = false;
2338
- if (this.Timeout) clearTimeout(this.Timeout); //清空定时器
2339
- }
2340
-
2341
- this.Start = function () {
2342
- // console.log("[JSStock::Start] start auto update.");
2343
- this.IsAutoUpdate = true;
2344
- this.GetFirstPage();
2345
- }
2346
-
2347
- //请求数据
2348
- this.GetFirstPage = function () {
2349
- this.NowData = 0;
2350
-
2351
- var self = this;
2352
- //清空数据
2353
- this.Data = [];
2354
- this.Count = 0;
2355
- this.CacheCount = 0;
2356
- // this.ShowValue = 1,
2357
- wx.request({
2358
- url: g_JSNewsResource.Domain + '/api/NewsFlashListByES_V2',
2359
- // url: 'https://apitest.zealink.com/api/NewsFlashListByES_V2',
2360
- data: {
2361
- "ShowValue": self.ShowValue,
2362
- "PageInfo": {
2363
- "PageIndex": self.PageIndex,
2364
- "PageSize": self.PageSize
2365
- },
2366
- "Filter": {
2367
- "QueryDate": {
2368
- "StartDate": self.StartDate,
2369
- "EndDate": self.EndDate
2370
- },
2371
- "SymbolList": self.SymbolList,
2372
- "Typelist": self.TypeList,
2373
- "SearchKey": self.SearchKey
2374
- }
2375
- },
2376
- method: "POST",
2377
- dataType: "json",
2378
- success: function (data) {
2379
- // if (data.data.code != 0) {
2380
- // wx.showModal({
2381
- // title: '提示',
2382
- // content: data.data.message,
2383
- // })
2384
- // // 隐藏加载框
2385
- // wx.hideLoading();
2386
- // return;
2387
- // }
2388
- self.RecvData(data);
2389
- },
2390
- fail: function (request) {
2391
- self.RecvError(request);
2392
- }
2393
- })
2394
- },
2395
-
2396
- this.RecvData = function (recvData) {
2397
- // console.log(recvData.data,"快讯recvData")
2398
- if (recvData.data.isshow == false) return this.InvokeCallback();
2399
- if (recvData.data.code !== 0) return this.InvokeCallback();
2400
- if (recvData.data.list.length <= 0) return this.InvokeCallback();
2401
-
2402
- for (var i in recvData.data.list) {
2403
- var item = recvData.data.list[i];
2404
- var info = {};
2405
- info.Date = item.date;
2406
- info.Time = item.time;
2407
- info.Sourceid = item.sourceid;
2408
- info.Stock = item.stock;
2409
- info.Summary = item.summary;
2410
- info.Title = item.title;
2411
- info.Type = item.type;
2412
- info.Image = item.image;
2413
- this.Data.push(info);
2414
- }
2415
-
2416
- if (this.Count <= 0) this.Count = recvData.data.count; //一共的新闻个数
2417
-
2418
- this.InvokeCallback();
2419
-
2420
- var self = this;
2421
- if (this.IsAutoUpdate) {
2422
- if (this.Timeout) clearTimeout(this.Timeout); //清空定时器
2423
- this.Timeout = setTimeout(function () {
2424
- self.GetFirstPage();
2425
- }, 5000);
2426
- }
2427
- },
2428
-
2429
- this.RecvError = function (reqeust) {
2430
- this.Error = "请求失败";
2431
- this.InvokeCallback();
2432
- },
2433
-
2434
- this.InvokeCallback = function () {
2435
- if (typeof(this.Callback) != 'function') return;
2436
-
2437
- this.Callback(this);
2438
- },
2439
- this.GetNextPage = function () {
2440
- this.PageIndex++;
2441
- var self = this;
2442
- this.NowData = 1;
2443
- var pages = this.Count / this.PageSize,
2444
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
2445
- if (this.PageIndex <= totalPages) {
2446
- wx.request({
2447
- url: g_JSNewsResource.Domain + '/api/NewsFlashListByES_V2',
2448
- // url: 'https://apitest.zealink.com/api/NewsFlashListByES_V2',
2449
- data: {
2450
- "ShowValue": self.ShowValue,
2451
- "PageInfo": {
2452
- "PageIndex": self.PageIndex,
2453
- "PageSize": self.PageSize
2454
- },
2455
- "Filter": {
2456
- "QueryDate": {
2457
- "StartDate": self.StartDate,
2458
- "EndDate": self.EndDate
2459
- },
2460
- "SymbolList": self.SymbolList,
2461
- "Typelist": self.TypeList,
2462
- "SearchKey": self.SearchKey
2463
- }
2464
- },
2465
- method: "POST",
2466
- dataType: "json",
2467
- success: function (data) {
2468
- self.RecvData(data);
2469
- wx.hideLoading();
2470
- },
2471
- error: function (request) {
2472
- self.RecvError(request);
2473
- }
2474
- })
2475
- } else {
2476
- wx.showToast({
2477
- title: "数据已全部加载",
2478
- icon: 'success',
2479
- duration: 1000
2480
- })
2481
- }
2482
- }
2483
- }
2484
- GetNews.init = function () {
2485
- var news = new GetNews();
2486
- return news;
2487
- }
2488
-
2489
-
2490
- //请求新闻联播列表
2491
- function GetCCTVList() {
2492
- this.Count; //一共的新闻个数
2493
- this.CacheCount; //已下载的新闻个数
2494
- this.SearchKey = ""; //搜索关键词
2495
- this.PageIndex = 1; //请求第几页
2496
- this.PageSize = 10; //每页数量
2497
- var date = new Date();
2498
- var nowDate = (date.getFullYear()) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
2499
- this.Date = nowDate; //查询日期
2500
- this.Url = g_JSNewsResource.JavaDomain + "/news/list";
2501
-
2502
-
2503
- //请求第一页数据
2504
- this.GetFirstPage = function () {
2505
- //清空数据
2506
- this.Data = [];
2507
- this.Count = 0;
2508
- this.CacheCount = 0;
2509
-
2510
- var self = this;
2511
-
2512
- wx.request({
2513
- url: self.Url,
2514
- data: {
2515
- "key": self.SearchKey,
2516
- "page": 1,
2517
- "rows": self.PageSize,
2518
- "sdate": self.Date,
2519
- "edate": self.Date
2520
- },
2521
- method: "POST",
2522
- dataType: "json",
2523
- success: function (res) {
2524
- if (res.data.code != 0) {
2525
- wx.showModal({
2526
- title: '提示',
2527
- content: res.data.msg,
2528
- })
2529
- return;
2530
- }
2531
- self.RecvData(res);
2532
- },
2533
- fail: function (request) {
2534
- self.RecvError(request);
2535
- }
2536
- })
2537
- }
2538
-
2539
- this.RecvData = function (recvData) {
2540
- // console.log(recvData.data,"新闻列表")
2541
- var data = recvData.data;
2542
- if (data.data.count) this.Count = data.data.count;
2543
- if (data.data.newslist.length != 0 && data.data.newslist.length != undefined) {
2544
- for (var i in data.data.newslist) {
2545
- var item = data.data.newslist[i];
2546
- var info = {};
2547
- info.Index = item.f001N;
2548
- info.Title = item.f002V;
2549
- info.Content = item.f003V;
2550
- info.Date = item.tdate;
2551
-
2552
- this.Data.push(info);
2553
- }
2554
- }
2555
-
2556
- if (this.Callback) this.Callback(this);
2557
- }
2558
-
2559
- this.RecvError = function (reqeust) {
2560
- console.log(reqeust, "error:")
2561
- }
2562
-
2563
- this.GetNextPage = function () {
2564
- this.PageIndex++;
2565
-
2566
- var self = this;
2567
-
2568
- var pages = this.Count / this.PageSize,
2569
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
2570
- if (this.PageIndex <= totalPages) {
2571
- wx.request({
2572
- url: self.Url,
2573
- data: {
2574
- "key": self.SearchKey,
2575
- "page": self.PageIndex,
2576
- "rows": self.PageSize,
2577
- "sdate": self.Date,
2578
- "edate": self.Date
2579
- },
2580
- method: "POST",
2581
- dataType: "json",
2582
- success: function (res) {
2583
- if (res.data.code != 0) {
2584
- wx.showModal({
2585
- title: '提示',
2586
- content: res.data.msg,
2587
- })
2588
- return;
2589
- }
2590
- self.RecvData(res);
2591
- },
2592
- fail: function (request) {
2593
- self.RecvError(request);
2594
- }
2595
- })
2596
- } else {
2597
- wx.showToast({
2598
- title: "数据已全部加载",
2599
- icon: 'success',
2600
- duration: 1000
2601
- })
2602
- }
2603
- }
2604
-
2605
- }
2606
-
2607
- GetCCTVList.init = function () {
2608
- var news = new GetCCTVList();
2609
- return news;
2610
- }
2611
-
2612
- //请求 CCTV 热点
2613
- function GetCCTVHot() {
2614
- var date = new Date();
2615
- var newDate = (date.getFullYear()) * 10000 + (date.getMonth() + 1) * 100 + date.getDate();
2616
- this.Date = newDate.toString(); //查询日期
2617
-
2618
- this.requestData = function () {
2619
- //清空数据
2620
- this.Data = [];
2621
- var self = this;
2622
-
2623
- wx.request({
2624
- url: g_JSNewsResource.JavaDomain + "/cctv/getHotWords",
2625
- data: {
2626
- "date": self.Date
2627
- },
2628
- method: "POST",
2629
- dataType: "json",
2630
- success: function (res) {
2631
- if (res.data.code != 0) {
2632
- wx.showModal({
2633
- title: '提示',
2634
- content: res.data.msg,
2635
- })
2636
- return;
2637
- }
2638
- self.RecvData(res);
2639
- },
2640
- fail: function (request) {
2641
- self.RecvError(request);
2642
- }
2643
- })
2644
- }
2645
-
2646
- this.RecvData = function (recvData) {
2647
- // console.log(recvData.data, "CCTV热点:")
2648
- var data = recvData.data;
2649
- var info = {};
2650
- if (data.data.PreSevenHotWords) {
2651
- var SevenHotWords = [];
2652
- for (var i in data.data.PreSevenHotWords) {
2653
- var item = data.data.PreSevenHotWords[i];
2654
- var SevenWord = {};
2655
- SevenWord.Name = item.f001v;
2656
- SevenWord.Count = item.f002n;
2657
- SevenHotWords.push(SevenWord);
2658
- }
2659
- info.PreSevenHotWords = SevenHotWords;
2660
- }
2661
- if (data.data.PreTenHotWords) {
2662
- var TenHotWords = [];
2663
- for (var i in data.data.PreTenHotWords) {
2664
- var item = data.data.PreTenHotWords[i];
2665
- var TenWord = {};
2666
- TenWord.Name = item.f001v;
2667
- TenWord.Count = item.f002n;
2668
- TenWord.Date = item.tdate;
2669
- TenHotWords.push(TenWord);
2670
- }
2671
- info.PreTenHotWords = TenHotWords;
2672
- }
2673
- this.Data = info;
2674
-
2675
- if (this.Callback) this.Callback(this);
2676
- }
2677
-
2678
- this.RecvError = function (reqeust) {
2679
- console.log(reqeust, "error:")
2680
- }
2681
- }
2682
-
2683
- GetCCTVHot.init = function () {
2684
- var news = new GetCCTVHot();
2685
- return news;
2686
- }
2687
-
2688
- //获取最近三个月的数量统计和新闻列表
2689
- function GetThreeMonthNews() {
2690
- this.Count; //一共的新闻个数
2691
- this.CacheCount; //已下载的新闻个数
2692
- this.SearchKey; //搜索关键词
2693
- this.PageIndex = 1; //请求第几页
2694
- this.PageSize = 10; //每页数量
2695
- this.Url = g_JSNewsResource.JavaDomain + "/news/hotNews";
2696
- this.GetNum = 0; //请求第几页的数据
2697
-
2698
- var startData = JSCommonDate.startDate(null, -3, "m");
2699
- var today = JSCommonDate.endTime();
2700
-
2701
- this.startData = startData;
2702
- this.endData = today;
2703
-
2704
- //请求第一页数据
2705
- this.GetFirstPage = function () {
2706
- this.GetNum = 0;
2707
- //清空数据
2708
- this.Data = {
2709
- HotwordList: [],
2710
- NewsList: []
2711
- };
2712
- this.Count = 0;
2713
- this.CacheCount = 0;
2714
- var self = this;
2715
-
2716
- wx.request({
2717
- url: self.Url,
2718
- data: {
2719
- "key": self.SearchKey,
2720
- "page": 1,
2721
- "rows": self.PageSize,
2722
- "sdate": this.startData,
2723
- "edate": this.endData
2724
- },
2725
- method: "POST",
2726
- dataType: "json",
2727
- success: function (res) {
2728
- if (res.data.code != 0) {
2729
- wx.showModal({
2730
- title: '提示',
2731
- content: res.data.msg,
2732
- })
2733
- return;
2734
- }
2735
- self.RecvData(res);
2736
- },
2737
- fail: function (request) {
2738
- self.RecvError(request);
2739
- }
2740
- })
2741
- }
2742
-
2743
- this.RecvData = function (recvData) {
2744
- // console.log(recvData.data,"recvData最近三个月")
2745
- var data = recvData.data;
2746
- if (data.data.count) this.Count = data.data.count;
2747
- if (this.GetNum == 0) {
2748
- if (data.data.hotwordlist) this.Data.HotwordList = data.data.hotwordlist;
2749
- }
2750
-
2751
- if (data.data.newslist) {
2752
- for (var i in data.data.newslist) {
2753
- var item = data.data.newslist[i];
2754
- var info = {};
2755
- info.Index = item.f001N;
2756
- info.Title = item.f002V;
2757
- info.Content = item.f003V;
2758
- info.Date = item.tdate;
2759
-
2760
- this.Data.NewsList.push(info);
2761
- }
2762
- }
2763
-
2764
- if (this.Callback) this.Callback(this);
2765
- }
2766
-
2767
- this.RecvError = function (reqeust) {
2768
- console.log(reqeust, "error:")
2769
- }
2770
-
2771
- this.GetNextPage = function () {
2772
- this.GetNum = 1;
2773
- this.PageIndex++;
2774
-
2775
- var pages = this.Count / this.PageSize,
2776
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
2777
- var self = this;
2778
- if (this.PageIndex <= totalPages) {
2779
- wx.request({
2780
- url: self.Url,
2781
- data: {
2782
- "key": self.SearchKey,
2783
- "page": self.PageIndex,
2784
- "rows": self.PageSize,
2785
- "sdate": this.startData,
2786
- "edate": this.endData
2787
- },
2788
- method: "POST",
2789
- dataType: "json",
2790
- success: function (res) {
2791
- if (res.data.code != 0) {
2792
- wx.showModal({
2793
- title: '提示',
2794
- content: res.data.msg,
2795
- })
2796
- return;
2797
- }
2798
- self.RecvData(res);
2799
- },
2800
- fail: function (request) {
2801
- self.RecvError(request);
2802
- }
2803
- })
2804
- } else {
2805
- wx.showToast({
2806
- title: "数据已全部加载",
2807
- icon: 'success',
2808
- duration: 1000
2809
- })
2810
- }
2811
- }
2812
-
2813
- }
2814
-
2815
- GetThreeMonthNews.init = function () {
2816
- var news = new GetThreeMonthNews();
2817
- return news;
2818
- }
2819
-
2820
- //请求 原创 数据
2821
- function GetOriginal() {
2822
- this.Count; //一共的新闻个数
2823
- this.CacheCount; //已下载的新闻个数
2824
- this.PageIndex = 1; //请求第几页
2825
- this.PageSize = 10; //每页数量
2826
- var startData = JSCommonDate.startDate(null, -3, "m");
2827
- var today = JSCommonDate.endTime();
2828
- this.StartDate = startData; //查询开始日期
2829
- this.EndDate = today; //查询结束日期
2830
- this.Url = g_JSNewsResource.Domain + '/api/NewsFlashOriginalList';
2831
-
2832
- //请求数据
2833
- this.GetFirstPage = function () {
2834
- this.NowData = 0;
2835
-
2836
- var self = this;
2837
- //清空数据
2838
- this.Data = [];
2839
- this.Count = 0;
2840
- this.CacheCount = 0;
2841
- wx.request({
2842
- url: this.Url,
2843
- data: {
2844
- "PageInfo": {
2845
- "PageIndex": 1,
2846
- "PageSize": self.PageSize
2847
- },
2848
- "Filter": {
2849
- "QueryDate": {
2850
- "StartDate": self.StartDate,
2851
- "EndDate": self.EndDate
2852
- }
2853
- }
2854
- },
2855
- method: "POST",
2856
- dataType: "json",
2857
- success: function (data) {
2858
- if (data.data.code != 0) {
2859
- wx.showModal({
2860
- title: '提示',
2861
- content: data.data.message,
2862
- })
2863
- // 隐藏加载框
2864
- wx.hideLoading();
2865
- return;
2866
- }
2867
- self.RecvData(data);
2868
- },
2869
- fail: function (request) {
2870
- self.RecvError(request);
2871
- }
2872
- })
2873
- }
2874
-
2875
- this.RecvData = function (recvData) {
2876
- // console.log(recvData.data,"原创recvData")
2877
- if (recvData.data.list.length <= 0) return this.InvokeCallback();
2878
- if (this.Count <= 0) this.Count = recvData.data.count; //一共的新闻个数
2879
-
2880
- for (var i in recvData.data.list) {
2881
- var item = recvData.data.list[i];
2882
- var info = {};
2883
- info.Date = item.date;
2884
- info.ID = item.id;
2885
- info.Summary = item.summary;
2886
- info.Title = item.title;
2887
- info.Image = item.image;
2888
- info.URL = item.url;
2889
- this.Data.push(info);
2890
- }
2891
-
2892
- this.InvokeCallback();
2893
- }
2894
-
2895
- this.RecvError = function (reqeust) {
2896
- this.Error = "请求失败";
2897
- this.InvokeCallback();
2898
- }
2899
-
2900
- this.InvokeCallback = function () {
2901
- if (typeof (this.Callback) != 'function') return;
2902
-
2903
- this.Callback(this);
2904
- }
2905
-
2906
- this.GetNextPage = function () {
2907
- this.PageIndex++;
2908
- var self = this;
2909
- var pages = this.Count / this.PageSize,
2910
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
2911
-
2912
- if (this.PageIndex <= totalPages) {
2913
- wx.request({
2914
- url: this.Url,
2915
- data: {
2916
- "PageInfo": {
2917
- "PageIndex": self.PageIndex,
2918
- "PageSize": self.PageSize
2919
- },
2920
- "Filter": {
2921
- "QueryDate": {
2922
- "StartDate": self.StartDate,
2923
- "EndDate": self.EndDate
2924
- }
2925
- }
2926
- },
2927
- method: "POST",
2928
- dataType: "json",
2929
- success: function (data) {
2930
- if (data.data.code != 0) {
2931
- wx.showModal({
2932
- title: '提示',
2933
- content: data.data.message,
2934
- })
2935
- // 隐藏加载框
2936
- wx.hideLoading();
2937
- return;
2938
- }
2939
- self.RecvData(data);
2940
- },
2941
- fail: function (request) {
2942
- self.RecvError(request);
2943
- }
2944
- })
2945
- } else {
2946
- wx.showToast({
2947
- title: "数据已全部加载",
2948
- icon: 'success',
2949
- duration: 1000
2950
- })
2951
- }
2952
- }
2953
- }
2954
-
2955
- GetOriginal.init = function () {
2956
- var news = new GetOriginal();
2957
- return news;
2958
- }
2959
-
2960
- //条件选股
2961
- function PickStock(){
2962
- this.Count; //总数
2963
- this.CacheCount; //已下载的个数
2964
- this.StartSize = 0; //请求开始数据
2965
- this.PageSize = 20; //每页显示数据
2966
- this.ID = "";
2967
- this.Block = ""; //block
2968
- this.Index = []; //index
2969
- this.Condition = []; //condition
2970
- this.Orderfield = "price";
2971
- this.Order = -1;
2972
-
2973
- this.Url = g_JSNewsResource.Domain + '/api/conditionStock';
2974
-
2975
- this.getFirstData = function(){
2976
- var self = this;
2977
- //清空数据
2978
- this.Data = {list:[],count:0};
2979
- this.Count = 0;
2980
- this.CacheCount = 0;
2981
-
2982
- var data;
2983
- if (this.Index.length == 0 && this.Condition.length == 0) {
2984
- data = {
2985
- "userid": this.ID,
2986
- "block": this.Block,
2987
- "field": ["price","amount", "increase"],
2988
- "orderfield": this.Orderfield,
2989
- "order": this.Order,
2990
- "start": this.StartSize,
2991
- "end": this.PageSize
2992
- }
2993
- } else if (this.Index.length > 0 && this.Condition.length == 0) {
2994
- data = {
2995
- "userid": this.ID,
2996
- "block": this.Block,
2997
- "index": this.Index,
2998
- "field": ["price","amount", "increase"],
2999
- "orderfield": this.Orderfield,
3000
- "order": this.Order,
3001
- "start": this.StartSize,
3002
- "end": this.PageSize
3003
- }
3004
- } else if (this.Index.length == 0 && this.Condition.length > 0) {
3005
- data = {
3006
- "userid": this.ID,
3007
- "block": this.Block,
3008
- "condition": this.Condition,
3009
- "field": ["price","amount", "increase"],
3010
- "orderfield": this.Orderfield,
3011
- "order": this.Order,
3012
- "start": this.StartSize,
3013
- "end": this.PageSize
3014
- }
3015
- } else if (this.Index.length > 0 && this.Condition.length > 0) {
3016
- data = {
3017
- "userid": this.ID,
3018
- "block": this.Block,
3019
- "index": this.Index,
3020
- "condition": this.Condition,
3021
- "field": ["price","amount", "increase"],
3022
- "orderfield": this.Orderfield,
3023
- "order": this.Order,
3024
- "start": this.StartSize,
3025
- "end": this.PageSize
3026
- }
3027
- }
3028
-
3029
- wx.request({
3030
- url: this.Url,
3031
- data: data,
3032
- method: "POST",
3033
- dataType: "json",
3034
- success: function (data) {
3035
- if (data.data.code != 0) {
3036
- wx.showModal({
3037
- title: '提示',
3038
- content: data.data.message,
3039
- })
3040
- // 隐藏加载框
3041
- wx.hideLoading();
3042
- return;
3043
- }
3044
- self.RecvData(data);
3045
- },
3046
- fail: function (request) {
3047
- self.RecvError(request);
3048
- }
3049
- })
3050
- }
3051
-
3052
- this.RecvData = function (recvData) {
3053
- // console.log(recvData.data,"条件选股recvData")
3054
- if (recvData.data.list == null) return this.InvokeCallback();
3055
- if (this.Count <= 0) {
3056
- this.Count = recvData.data.count; //一共个数
3057
- this.Data.count = recvData.data.count;
3058
- }
3059
-
3060
- for (var i in recvData.data.list) {
3061
- var item = recvData.data.list[i];
3062
- var info = {};
3063
- info.Name = item.name;
3064
- info.Symbol = item.symbol;
3065
- for (var j in item.field){
3066
- var ite = item.field[j];
3067
- if (ite.name == "price") {
3068
- info.Price = ite.value;
3069
- } else if (ite.name == "amount"){
3070
- info.Amount = ite.value;
3071
- } else if (ite.name == "increase"){
3072
- info.Increase = ite.value;
3073
- }
3074
- }
3075
- this.Data.list.push(info);
3076
- }
3077
-
3078
- this.InvokeCallback();
3079
- }
3080
-
3081
- this.RecvError = function (reqeust) {
3082
- this.Error = "请求失败";
3083
- this.InvokeCallback();
3084
- }
3085
-
3086
- this.InvokeCallback = function () {
3087
- if (typeof (this.Callback) != 'function') return;
3088
-
3089
- this.Callback(this);
3090
- }
3091
-
3092
- this.getNextData = function(){
3093
- var self = this;
3094
- var start = this.Data.list.length;
3095
- var end = start + this.PageSize;
3096
-
3097
- var data;
3098
- if (this.Index.length == 0 && this.Condition.length == 0) {
3099
- data = {
3100
- "userid": this.ID,
3101
- "block": this.Block,
3102
- "field": ["price","amount", "increase"],
3103
- "orderfield": this.Orderfield,
3104
- "order": this.Order,
3105
- "start": start,
3106
- "end": end
3107
- }
3108
- } else if (this.Index.length > 0 && this.Condition.length == 0) {
3109
- data = {
3110
- "userid": this.ID,
3111
- "block": this.Block,
3112
- "index": this.Index,
3113
- "field": ["price","amount", "increase"],
3114
- "orderfield": this.Orderfield,
3115
- "order": this.Order,
3116
- "start": start,
3117
- "end": end
3118
- }
3119
- } else if (this.Index.length == 0 && this.Condition.length > 0) {
3120
- data = {
3121
- "userid": this.ID,
3122
- "block": this.Block,
3123
- "condition": this.Condition,
3124
- "field": ["price","amount", "increase"],
3125
- "orderfield": this.Orderfield,
3126
- "order": this.Order,
3127
- "start": start,
3128
- "end": end
3129
- }
3130
- } else if (this.Index.length > 0 && this.Condition.length > 0) {
3131
- data = {
3132
- "userid": this.ID,
3133
- "block": this.Block,
3134
- "index": this.Index,
3135
- "condition": this.Condition,
3136
- "field": ["price","amount", "increase"],
3137
- "orderfield": this.Orderfield,
3138
- "order": this.Order,
3139
- "start": start,
3140
- "end": end
3141
- }
3142
- }
3143
-
3144
- if (this.Data.list.length < this.Count){
3145
- wx.request({
3146
- url: this.Url,
3147
- data: data,
3148
- method: "POST",
3149
- dataType: "json",
3150
- success: function (data) {
3151
- self.RecvData(data);
3152
- },
3153
- fail: function (request) {
3154
- self.RecvError(request);
3155
- }
3156
- })
3157
- }else{
3158
- wx.showToast({
3159
- title: "数据已全部加载",
3160
- icon: 'success',
3161
- duration: 1000
3162
- })
3163
- }
3164
-
3165
- }
3166
- }
3167
-
3168
- PickStock.init = function () {
3169
- var news = new PickStock();
3170
- return news;
3171
- }
3172
-
3173
- //添加策略
3174
- function AddCondition(){
3175
- this.ID = "";
3176
- this.PolicyName = "", //策略名称
3177
- this.MarketList = ""; //市场集合
3178
- this.IndexList = []; //指标集合
3179
- this.ConditionList = []; //条件集合
3180
- this.Url = g_JSNewsResource.Domain + '/api/SP_AddUserPolicy';
3181
-
3182
- this.requestData = function(){
3183
- var data = {
3184
- "UserId": this.ID,
3185
- "PolicyName": this.PolicyName,
3186
- "Market": this.MarketList,
3187
- "ConditionList": this.ConditionList,
3188
- "IndexList": this.IndexList
3189
- }
3190
-
3191
- wx.request({
3192
- url: this.Url,
3193
- data: data,
3194
- method: "POST",
3195
- dataType: "json",
3196
- success: function (data) {
3197
- if (data.data.code != 0) {
3198
- wx.showModal({
3199
- title: '提示',
3200
- content: data.data.message,
3201
- })
3202
- return;
3203
- }
3204
- // self.RecvData(data);
3205
- },
3206
- fail: function (request) {
3207
- // self.RecvError(request);
3208
- }
3209
- })
3210
- }
3211
- }
3212
-
3213
- AddCondition.init = function () {
3214
- var news = new AddCondition();
3215
- return news;
3216
- }
3217
-
3218
- function GetCondition(){
3219
- this.Count; //总数
3220
- this.CacheCount; //已下载的个数
3221
- this.ID = "";
3222
- this.PageIndex = 1;
3223
- this.PageSize = 20;
3224
-
3225
- this.Url = g_JSNewsResource.Domain + '/api/SP_UserPolicyList';
3226
-
3227
- this.getFirstData = function(){
3228
- var self = this;
3229
- //清空数据
3230
- this.Data = [];
3231
- this.Count = 0;
3232
- this.CacheCount = 0;
3233
-
3234
- wx.request({
3235
- url: this.Url,
3236
- data: {
3237
- "UserId": this.ID,
3238
- "PageInfo": {
3239
- "PageIndex": 1,
3240
- "PageSize": this.PageSize
3241
- }
3242
- },
3243
- method: "POST",
3244
- dataType: "json",
3245
- success: function (data) {
3246
- if (data.data.code != 0) {
3247
- wx.showModal({
3248
- title: '提示',
3249
- content: data.data.message,
3250
- })
3251
- return;
3252
- }
3253
- self.RecvData(data);
3254
- },
3255
- fail: function (request) {
3256
- self.RecvError(request);
3257
- }
3258
- })
3259
- }
3260
-
3261
- this.RecvData = function (recvData) {
3262
- // console.log(recvData.data,"获取自建策略recvData")
3263
- if (recvData.data.list.length == 0) return this.InvokeCallback();
3264
- if (this.Count <= 0) this.Count = recvData.data.count; //一共个数
3265
-
3266
- for (var i in recvData.data.list) {
3267
- var item = recvData.data.list[i];
3268
- var info = {};
3269
- info.Guid = item.guid;
3270
- info.Indexlist = item.indexlist;
3271
- info.Market = item.market;
3272
- info.Policyname = item.policyname;
3273
- info.Conditionlist = item.conditionlist;
3274
-
3275
- this.Data.push(info);
3276
- }
3277
-
3278
-
3279
- this.InvokeCallback();
3280
- }
3281
-
3282
- this.RecvError = function (reqeust) {
3283
- this.Error = "请求失败";
3284
- this.InvokeCallback();
3285
- }
3286
-
3287
- this.InvokeCallback = function () {
3288
- if (typeof (this.Callback) != 'function') return;
3289
-
3290
- this.Callback(this);
3291
- }
3292
-
3293
- this.getNextData = function(){
3294
- this.PageIndex++;
3295
- var self = this;
3296
- var pages = this.Count / this.PageSize,
3297
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
3298
-
3299
- if (this.PageIndex <= totalPages){
3300
- wx.request({
3301
- url: this.Url,
3302
- data: {
3303
- "UserId": this.ID,
3304
- "PageInfo": {
3305
- "PageIndex": this.PageIndex,
3306
- "PageSize": this.PageSize
3307
- }
3308
- },
3309
- method: "POST",
3310
- dataType: "json",
3311
- success: function (data) {
3312
- self.RecvData(data);
3313
- },
3314
- fail: function (request) {
3315
- self.RecvError(request);
3316
- }
3317
- })
3318
- }else{
3319
- wx.showToast({
3320
- title: "数据已全部加载",
3321
- icon: 'success',
3322
- duration: 1000
3323
- })
3324
- }
3325
- }
3326
- }
3327
-
3328
- GetCondition.init = function () {
3329
- var news = new GetCondition();
3330
- return news;
3331
- }
3332
-
3333
-
3334
- //高管风险类型新闻
3335
- function TopManagersRiskList(symbol) {
3336
- this.newMethod = INewsBase; //派生
3337
- this.newMethod(symbol);
3338
- delete this.newMethod;
3339
-
3340
- // this.ApiUrl = g_JSNewsResource.Domain + '/API/NewsTopManagersRiskList';
3341
- this.ApiUrl = 'https://apitest.zealink.com/API/NewsTopManagersRiskList';
3342
- this.PageIndex = 0;
3343
- this.TypeList = [];
3344
- this.GetFirstPage = function () {
3345
- //清空数据
3346
- this.Data = [];
3347
- this.Count = 0;
3348
- this.CacheCount = 0;
3349
-
3350
- var self = this;
3351
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
3352
- wx.request({
3353
- url: this.ApiUrl,
3354
- data: {
3355
- "PageInfo": {
3356
- "PageIndex": this.PageIndex,
3357
- "PageSize": this.PageSize
3358
- },
3359
- "Filter": {
3360
- "QueryDate": {
3361
- "StartDate": this.StartDate,
3362
- "EndDate": this.EndDate
3363
- },
3364
- "SymbolList": this.Symbol,
3365
- "TypeList": this.TypeList
3366
- }
3367
- },
3368
- method: "POST",
3369
- dataType: "json",
3370
- success: function (data) {
3371
- self.RecvData(data);
3372
- },
3373
- error: function (request) {
3374
- self.RecvError(request);
3375
- }
3376
- })
3377
- }
3378
-
3379
- this.RecvData = function (recvData) {
3380
- let data = recvData.data;
3381
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
3382
- this.Data = this.Data.concat(data.list);
3383
- console.log("this.Data上拉", this.Data);
3384
- if (this.Callback) this.Callback(this);
3385
- }
3386
-
3387
- this.RecvError = function (request) {
3388
- console.log("[StockReport::RecvError] ", request)
3389
- }
3390
-
3391
- this.GetNextPage = function () {
3392
- this.PageIndex++;
3393
- var self = this;
3394
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
3395
-
3396
- if (this.PageSize * this.PageIndex <= this.Count) {
3397
- wx.request({
3398
- url: this.ApiUrl,
3399
- data: {
3400
- "PageInfo": {
3401
- "PageIndex": this.PageIndex,
3402
- "PageSize": this.PageSize
3403
- },
3404
- "Filter": {
3405
- "QueryDate": {
3406
- "StartDate": this.StartDate,
3407
- "EndDate": this.EndDate
3408
- },
3409
- "SymbolList": this.Symbol,
3410
- "TypeList": this.TypeList
3411
- }
3412
- },
3413
- method: "POST",
3414
- dataType: "json",
3415
- success: function (data) {
3416
- self.RecvData(data);
3417
- },
3418
- error: function (request) {
3419
- self.RecvError(request);
3420
- }
3421
- })
3422
- } else {
3423
- wx.showToast({
3424
- title: "数据已全部加载",
3425
- icon: 'success',
3426
- duration: 1000
3427
- })
3428
- }
3429
- }
3430
- }
3431
-
3432
- // 公告搜索
3433
- function SearchNotice(symbol) {
3434
- this.newMethod = INewsBase; //派生
3435
- this.newMethod(symbol);
3436
- delete this.newMethod;
3437
-
3438
- this.ApiUrl = g_JSNewsResource.Domain + '/API/reportStockList'; // g_JSNewsResource.Domain + '/API/reportStockList' ; 'http://web7.umydata.com/API/reportStockList'
3439
- this.PageIndex = 0;
3440
- this.SearchKey = "";
3441
- this.userid = "";
3442
- this.Aggregate = [];
3443
- this.GetFirstPage = function () {
3444
- //清空数据
3445
- this.Data = [];
3446
- this.Count = 0;
3447
- this.CacheCount = 0;
3448
-
3449
- var self = this;
3450
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
3451
- wx.request({
3452
- url: this.ApiUrl,
3453
- data: {
3454
- symbol: this.symbol,
3455
- filed: ["name", "symbol", "releasedate", "title", "id"],
3456
- querydate: {
3457
- "StartDate": this.StartDate,
3458
- "EndDate": this.EndDate
3459
- },
3460
- calccount: 1,
3461
- start: this.PageSize * this.PageIndex,
3462
- end: this.PageSize * (this.PageIndex + 1),
3463
- search: this.SearchKey,
3464
- userid: this.userid,
3465
- aggregate: 10
3466
- },
3467
- method: "POST",
3468
- dataType: "json",
3469
- success: function (data) {
3470
- self.RecvData(data);
3471
- },
3472
- error: function (request) {
3473
- self.RecvError(request);
3474
- }
3475
- })
3476
- }
3477
-
3478
- this.RecvData = function (recvData) {
3479
- // console.log(recvData.data.list,"前");
3480
- let data = recvData.data,
3481
- aggregate = data.aggregate,
3482
- formatData = data.report.map(e => Object.assign(e, {
3483
- showurl: e.showurl ? e.showurl.replace('http://rpt.zealink.com', 'https://reporth5.zealink.com') : '',
3484
- releasedate: e.releasedate.substring(0, 4) + "-" + e.releasedate.substring(4, 6) + "-" + e.releasedate.substring(6, 8)
3485
- }));
3486
- console.log(formatData, "后");
3487
- if (this.Count <= 0) this.Count = data.count; //一共的新闻个数
3488
-
3489
- if (aggregate) {
3490
- for (let i in aggregate) {
3491
- this.Aggregate.push({
3492
- Name: aggregate[i].value2,
3493
- Symbol: aggregate[i].value,
3494
- Count: aggregate[i].count
3495
- });
3496
- }
3497
- }
3498
-
3499
- this.Data = this.Data.concat(formatData);
3500
- //console.log("this.Data上拉",this.Data);
3501
- if (this.Callback) this.Callback(this);
3502
- }
3503
-
3504
- this.RecvError = function (request) {
3505
- console.log("[StockReport::RecvError] ", request)
3506
- }
3507
-
3508
- this.GetNextPage = function () {
3509
- this.PageIndex++;
3510
- var self = this;
3511
- if (!this.StartDate || !this.EndDate) this.SetDefautQueryDate();
3512
-
3513
- var pages = this.Count / this.PageSize,
3514
- totalPages = (this.Count % this.PageSize) > 0 ? Math.floor(pages) + 1 : Math.floor(pages);
3515
- if (this.PageIndex <= totalPages) {
3516
- wx.request({
3517
- url: this.ApiUrl,
3518
- data: {
3519
- symbol: this.symbol,
3520
- filed: ["name", "symbol", "releasedate", "title", "id"],
3521
- querydate: {
3522
- "StartDate": this.StartDate,
3523
- "EndDate": this.EndDate
3524
- },
3525
- calccount: 1,
3526
- start: this.PageSize * this.PageIndex,
3527
- end: this.PageSize * (this.PageIndex + 1),
3528
- search: this.SearchKey,
3529
- userid: this.userid,
3530
- aggregate: 10
3531
- },
3532
- method: "POST",
3533
- dataType: "json",
3534
- success: function (data) {
3535
- self.RecvData(data);
3536
- },
3537
- error: function (request) {
3538
- self.RecvError(request);
3539
- }
3540
- })
3541
- } else {
3542
- wx.showToast({
3543
- title: "数据已全部加载",
3544
- icon: 'success',
3545
- duration: 1000
3546
- })
3547
- }
3548
- }
3549
- }
3550
-
3551
-
3552
- module.exports = {
3553
- JSCommonNews: {
3554
- JSNews: JSNews,
3555
- StockNews: StockNews,
3556
- StockInteract: StockInteract,
3557
- NEWS_TYPE: NEWS_TYPE,
3558
- STOCK_REPORT_TYPE_ID: STOCK_REPORT_TYPE_ID,
3559
- GetNews: GetNews,
3560
- GetCCTVList: GetCCTVList,
3561
- GetCCTVHot: GetCCTVHot,
3562
- GetThreeMonthNews: GetThreeMonthNews,
3563
- GetOriginal: GetOriginal,
3564
- PickStock: PickStock,
3565
- AddCondition: AddCondition,
3566
- GetCondition: GetCondition
3567
- }
3568
- };