lx 5 년 전
부모
커밋
2f200b59c1
5개의 변경된 파일27개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 0
      api/request.js
  2. 1 0
      api/urls.js
  3. 16 3
      pages/index/index.js
  4. 3 2
      pages/index/index.wxml
  5. 1 1
      project.config.json

+ 6 - 0
api/request.js

@@ -40,6 +40,12 @@ const service = {
   }
 }
 module.exports = {
+  //沪深
+  getHushen:(data) =>{
+    return new Promise((resolve,reject)=> {
+      resolve(service.get(urls.hushen,data))
+    })
+  },
   // 获取新闻列表
   getNewsList: (data) => {
     return new Promise((resolve,reject)=> {

+ 1 - 0
api/urls.js

@@ -1,6 +1,7 @@
 const host = 'http://192.168.1.73:28002';
 
 const urls ={
+    hushen:host + '/api/his/hushen',
     newsList:host + '/api/news/list',
     detail:host +'/api/news/details',
     search: host + '/api/news/search',

+ 16 - 3
pages/index/index.js

@@ -161,6 +161,7 @@ Page({
     userInfo: {},
     hasUserInfo: false,
     canIUse: wx.canIUse('button.open-type.getUserInfo'),
+
     imagewidth: 0,//缩放后的宽 
     imageheight: 0,//缩放后的高 
     chartData:{
@@ -179,7 +180,8 @@ Page({
         ]
       },
       ec: {
-        onInit: initChart
+        onInit: initChart,
+        // lazyLoad: true // 延迟加载
       },
     // ec: {
     //   onInit: function (canvas, width, height) {
@@ -316,6 +318,18 @@ Page({
       url: '../logs/logs'
     })
   },
+  //沪深
+  getHushen:function(){
+    apiServer.getHushen().then((res) =>{
+      if(res.statusCode == 200){
+        console.log(res);
+        
+        this.setData({
+
+        })
+      }
+    })
+  },
   onReady: function (e) {
     this.computeScrollViewHeight();
     // var query = wx.createSelectorQuery()
@@ -325,6 +339,7 @@ Page({
  },
   onLoad: function () {
     this.getNewsList();
+    this.getHushen();
     let sysinfo = wx.getSystemInfoSync(),
     windowHeight = sysinfo.windowHeight,
     statusHeight = sysinfo.statusBarHeight, 
@@ -433,8 +448,6 @@ Page({
     catchTouchMove:function(res){
       return false
     },
-
-
   //初始化图表
   init_echarts: function () {
     this.echartsComponnet.init((canvas, width, height) => {

+ 3 - 2
pages/index/index.wxml

@@ -5,8 +5,9 @@
 <navBar></navBar>
 <view class="container" style="height:{{height}}px" >
   <view class="swiper-tab">
-    <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">沪深</view>
-    <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">港股</view>
+    <!-- <view class="swiper-tab-list {{currentTab==0 ? 'on' : ''}}" data-current="0" bindtap="swichNav">沪深</view>
+    <view class="swiper-tab-list {{currentTab==1 ? 'on' : ''}}" data-current="1" bindtap="swichNav">港股</view> -->
+    <view class="swiper-tab-list">沪深</view>
     <image class="image" src="./images/001.png" bindtap='choose'></image>
   </view>
   <!-- <view class="userinfo">

+ 1 - 1
project.config.json

@@ -25,7 +25,7 @@
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useCompilerModule": false,
+		"useCompilerModule": true,
 		"userConfirmedUseCompilerModuleSwitch": false,
 		"compileHotReLoad": false,
 		"useIsolateContext": true