rise.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. import * as echarts from '../../ec-canvas/echarts';
  2. var Api = require('../../utils/api.js');
  3. var wxRequest = require('../../utils/wxRequest.js')
  4. var app = getApp()
  5. function initChart(canvas, width, height, dpr, data) {
  6. const chart = echarts.init(canvas, null, {
  7. width: width,
  8. height: height,
  9. devicePixelRatio: dpr // new
  10. });
  11. canvas.setChart(chart);
  12. var option = {
  13. xAxis : {
  14. type : 'category',
  15. splitNumber: 2,
  16. scale: true,
  17. show:false,
  18. splitLine:{
  19.     show:false
  20.   }
  21. },
  22. yAxis : {
  23. type : 'value',
  24. splitNumber: 2,
  25. scale: true,
  26. show:false,
  27. splitLine:{
  28.     show:false
  29.    }
  30. },
  31. series: [{
  32. type: 'line',
  33. smooth: true,
  34. symbol: 'none',
  35. lineStyle: {
  36. color: '#D81E06',
  37. },
  38. data:data,
  39. areaStyle: {
  40. color: '#D81E06',
  41. },
  42. }]
  43. };
  44. chart.setOption(option);
  45. return chart;
  46. }
  47. Page({
  48. data: {
  49. // 页面配置
  50. winWidth: 0,
  51. winHeight: 0,
  52. // tab切换
  53. currentTab: 0,
  54. ec: {
  55. onInit: initChart
  56. },
  57. array:[
  58. {
  59. title:'BK0422',
  60. subtitle:"交运物流",
  61. Increase:"+1.22",
  62. digital:"33",
  63. color:'crimson',
  64. keep:"已关注",
  65. data:[52,56,355,444]
  66. },
  67. {
  68. title:'BK0738',
  69. subtitle:"多元金融",
  70. Increase:"+1.22",
  71. digital:"33",
  72. color:'crimson',
  73. keep:"已关注",
  74. data:[52,56,355,444]
  75. },
  76. {
  77. title:'BK0450',
  78. subtitle:"港口水运",
  79. Increase:"+1.22",
  80. digital:"33",
  81. color:'crimson',
  82. keep:"已关注",
  83. data:[52,56,355,444,52,56,355,444,52,56,355,444,2]
  84. },
  85. {
  86. title:'BK0734',
  87. subtitle:"珠宝首饰",
  88. Increase:"+1.22",
  89. digital:"33",
  90. color:'crimson',
  91. keep:"关注",
  92. data:[52,56,355,44554]
  93. },
  94. {
  95. title:'BK0471',
  96. subtitle:"化纤行业",
  97. Increase:"+1.22",
  98. digital:"33",
  99. keep:"关注",
  100. color:'crimson',
  101. data:[52,56,355,444]
  102. },
  103. {
  104. title:'BK0485',
  105. subtitle:"旅游酒店",
  106. Increase:"+1.22",
  107. digital:"33",
  108. color:'crimson',
  109. keep:"关注",
  110. data:[52,56,355,444]
  111. },
  112. {
  113. title:'BK0475',
  114. subtitle:"银行",
  115. Increase:"+1.22",
  116. digital:"33",
  117. keep:"关注",
  118. color:'crimson',
  119. data:[52,56,355,44554]
  120. },
  121. {
  122. title:'BK0473',
  123. subtitle:"券商信托",
  124. Increase:"+1.22",
  125. digital:"33",
  126. color:'crimson',
  127. keep:"关注",
  128. data:[52,56,355,444]
  129. },
  130. {
  131. title:'BK0474',
  132. subtitle:"保险",
  133. Increase:"+1.22",
  134. color:'crimson',
  135. keep:"关注",
  136. digital:"33",
  137. data:[52,56,355,444]
  138. },
  139. {
  140. title:'BK0478',
  141. subtitle:"有色金属",
  142. Increase:"+1.22",
  143. keep:"关注",
  144. digital:"33",
  145. color:'crimson',
  146. data:[52,56,355,44554]
  147. },
  148. {
  149. title:'BK0738',
  150. subtitle:"多元金融",
  151. Increase:"+1.22",
  152. digital:"33",
  153. keep:"关注",
  154. color:'crimson',
  155. data:[52,56,355,44554]
  156. }
  157. ]
  158. },
  159. onLoad: function() {
  160. var that = this;
  161. // 获取系统信息
  162. wx.getSystemInfo({
  163. success: function(res) {
  164. let navHeight,
  165. isiOS = res.system.indexOf('iOS') > -1
  166. if(isiOS){
  167. navHeight=44
  168. }else{
  169. navHeight=48
  170. }
  171. that.setData({
  172. winWidth: res.windowWidth,
  173. winHeight: res.windowHeight - res.statusBarHeight - navHeight
  174. });
  175. }
  176. });
  177. var getinclast = wxRequest.postRequest(Api.getinclast());
  178. getinclast.then((res)=>{
  179. console.log(res)
  180. })
  181. },
  182. // 滑动切换tab
  183. bindChange: function(e) {
  184. var that = this;
  185. that.setData({
  186. currentTab: e.detail.current
  187. });
  188. },
  189. // 点击tab切换
  190. swichNav: function(e) {
  191. var that = this;
  192. if (this.data.currentTab === e.target.dataset.current) {
  193. return false;
  194. } else {
  195. that.setData({
  196. currentTab: e.target.dataset.current
  197. })
  198. }
  199. },
  200. open: function (e) {
  201. console.log(e)
  202. wx.navigateTo({
  203. url: '../item/item?row='+JSON.stringify(e.currentTarget.dataset.row)
  204. });
  205. }
  206. })