rise.js 4.2 KB

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