zjh 5 gadi atpakaļ
vecāks
revīzija
e639910af2

+ 22 - 1
app.js

@@ -6,6 +6,22 @@ App({
     logs.unshift(Date.now())
     wx.setStorageSync('logs', logs)
 
+    let menuButtonObject = wx.getMenuButtonBoundingClientRect();
+    wx.getSystemInfo({
+      success: res => {
+        let statusBarHeight = res.statusBarHeight,
+          navTop = menuButtonObject.top,//胶囊按钮与顶部的距离
+          navHeight = statusBarHeight + menuButtonObject.height + (menuButtonObject.top - statusBarHeight)*2;//导航高度
+        this.statusBarHeight = statusBarHeight;
+        this.globalData.navHeight = navHeight;
+        this.globalData.navTop = navTop;
+        this.globalData.windowHeight = res.windowHeight;
+      },
+      fail(err) {
+        console.log(err);
+      }
+    })
+
     // 登录
     wx.login({
       success: res => {
@@ -21,7 +37,6 @@ App({
             success: res => {
               // 可以将 res 发送给后台解码出 unionId
               this.globalData.userInfo = res.userInfo
-
               // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
               // 所以此处加入 callback 以防止这种情况
               if (this.userInfoReadyCallback) {
@@ -29,10 +44,16 @@ App({
               }
             }
           })
+        }else{
+           // 未授权,跳转到授权页面
+           wx.reLaunch({
+            url: '/pages/auth/auth',
+          })
         }
       }
     })
   },
+  
   globalData: {
     userInfo: null
   }

+ 6 - 1
app.json

@@ -8,13 +8,18 @@
     "pages/details/details",
     "pages/next/next",
     "pages/news/news",
+<<<<<<< HEAD
     "pages/filter/filter",
     "pages/item/item"
+=======
+    "pages/auth/auth",
+    "pages/search/search"
+>>>>>>> 15f5b8681680a916eb0b7a3f7428147f83b8558e
   ],
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "首页",
+    "navigationBarTitleText": "证券分析",
     "navigationBarTextStyle": "black"
   },
   "tabBar": {

+ 109 - 0
components/navBar/navBar.js

@@ -0,0 +1,109 @@
+// pages/navBar/navBar.js
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        background: {
+            type: String,
+            value: 'rgba(255, 255, 255, 1)'
+        },
+        color: {
+            type: String,
+            value: 'rgba(0, 0, 0, 1)'
+        },
+        titleText: {
+            type: String,
+            value: '请输入板块代码'
+        },
+        titleImg: {
+            type: String,
+            value: ''
+        },
+        backIcon: {
+            type: String,
+            value: ''
+        },
+        homeIcon: {
+            type: String,
+            value: ''
+        },
+        fontSize: {
+            type: Number,
+            value: 16
+        },
+        iconHeight: {
+            type: Number,
+            value: 19
+        },
+        iconWidth: {
+            type:Number,
+            value: 58
+        }
+    },
+    attached: function(){
+        var that = this;
+        that.setNavSize();
+        that.setStyle();
+    },
+    data: {
+
+    },
+    methods: {
+        // 通过获取系统信息计算导航栏高度
+        setNavSize: function() {
+            var that = this
+                , sysinfo = wx.getSystemInfoSync()
+                , statusHeight = sysinfo.statusBarHeight
+                , isiOS = sysinfo.system.indexOf('iOS') > -1
+                , navHeight;
+            if (!isiOS) {
+                navHeight = 48;
+            } else {
+                navHeight = 44;
+            }
+            that.setData({
+                status: statusHeight,
+                navHeight: navHeight
+            })
+        },
+        setStyle: function() {
+            var that  = this
+                , containerStyle
+                , textStyle
+                , iconStyle;
+            containerStyle = [
+                'background:' + that.data.background
+                ].join(';');
+            textStyle = [
+                'color:' + that.data.color,
+                'font-size:' + that.data.fontSize + 'px'
+            ].join(';');
+            iconStyle = [
+                'width: ' + that.data.iconWidth + 'px',
+                'height: ' + that.data.iconHeight + 'px'
+            ].join(';');
+            that.setData({
+                containerStyle: containerStyle,
+                textStyle: textStyle,
+                iconStyle: iconStyle
+            })
+        },
+        // 返回事件
+        back: function(){
+            wx.navigateBack({
+                delta: 1
+            })
+            this.triggerEvent('back', {back: 1})
+        },
+        home: function() {
+            this.triggerEvent('home', {});
+        },
+        search: function() {
+            wx.navigateTo({
+              url: '../search/search'
+            })
+          },
+
+    }
+})

+ 4 - 0
components/navBar/navBar.json

@@ -0,0 +1,4 @@
+{
+    "component": true,
+    "usingComponents": {}
+}

+ 25 - 0
components/navBar/navBar.wxml

@@ -0,0 +1,25 @@
+<view class='nav' style='height: {{status + navHeight}}px'>
+    <view class='status' style='height:{{status}}px;{{containerStyle}}'></view>
+    <view class='navbar' style='height:{{navHeight}}px;{{containerStyle}}'>
+        <!-- <view class='back-icon' wx:if="{{backIcon}}" bindtap='back'>
+            <image src='{{backIcon}}'></image>
+        </view>
+        <view class='home-icon' wx:if="{{homeIcon}}" bindtap='home'>
+            <image src='{{homeIcon}}'></image>
+        </view>
+        <view class='nav-icon' wx:if="{{titleImg}}">
+            <image src='{{titleImg}}' style='{{iconStyle}}'></image>
+        </view> -->
+        <!-- <view class='nav-title' wx:if="{{titleText && !titleImg}}">
+            <text style='{{textStyle}}'>{{titleText}}</text>
+        </view> -->
+        <view class='nav-title'>
+           <view class="input-box row">
+               <!-- <input placeholder="请输入板块代码" bindtap="search" /> -->
+               <input placeholder="请输入板块代码" bindtap="search" disabled="true" />
+               <icon class="weui-icon-search_in-box" type="search" size="20"></icon>
+            </view>
+            <!-- <input placeholder="请输入板块代码" style='{{textStyle}}'/> -->
+        </view>
+    </view>
+</view>

+ 61 - 0
components/navBar/navBar.wxss

@@ -0,0 +1,61 @@
+.navbar{
+    position: relative
+}
+.back-icon, .home-icon{
+    width: 28px;
+    height: 100%;
+    position: absolute;
+    transform: translateY(-50%);
+    top: 50%;
+    display: flex;
+}
+.back-icon{
+    left: 16px;
+}
+.home-icon{
+    left: 44px
+}
+.back-icon image{
+    width: 28px;
+    height: 28px;
+    margin: auto;
+}
+.home-icon image{
+    width: 20px;
+    height: 20px;
+    margin: auto;
+}
+.nav-title, .nav-icon{
+    position: absolute;
+    transform: translate(-50%, -50%);
+    left: 30%;
+    top: 50%;
+    font-size: 0;
+    font-weight: bold;
+    width: 60%;
+}
+.input-box {
+    width: 100%;
+    height: 100%;
+    /* background-color: #eee; */
+    justify-content: center;
+    align-items: center;
+    float: left;
+    margin-left: 3%;
+    display: flex;
+  }
+   
+  .input-box input {
+    font-size: 12px;
+    color: #333;
+    width: 90%;
+    height: 30px;
+    background-color: #ffffff;
+    border-radius: 44rpx;
+    padding-left: 7%;
+    padding-right: 3%;
+    border: 1rpx solid #E5E5E5;
+  }
+  .weui-icon-search_in-box{
+      margin-left: -60rpx;
+  }

BIN
images/000001.png


BIN
images/back@3x.png


BIN
images/home_icon@3x.png


BIN
images/nav_logo@3x.png


+ 81 - 0
pages/auth/auth.js

@@ -0,0 +1,81 @@
+// pages/auth/auth.js
+const app = getApp();
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    canIUse: wx.canIUse('button.open-type.getUserInfo')
+  },
+  onAuth() {
+    wx.getSetting({
+      success: (res) => {
+        if (res.authSetting['scope.userInfo']) {
+          wx.reLaunch({
+            url: '/pages/index/index',
+          })
+        }
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    wx.hideHomeButton({
+      success: function() {
+      },
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 4 - 0
pages/auth/auth.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "用户授权",
+  "usingComponents": {}
+}

+ 9 - 0
pages/auth/auth.wxml

@@ -0,0 +1,9 @@
+<!--pages/auth/auth.wxml-->
+<view class="auth">
+  <!-- <image src="https://res.wx.qq.com/wxopenres/htmledition/images/favicon32f740.ico" class="img" mode="aspectFill"></image> -->
+  <image src="./images/logo.jpg" class="img" mode="aspectFill"></image>
+  <view class="title">微信授权页面</view>
+  <view class="describe">此页面是微信授权页面,点击下方按钮弹出授权或跳转页面</view>
+  <button class="btn" open-type='getUserInfo' wx:if="{{canIUse}}" bindgetuserinfo='onAuth'>点击微信授权</button>
+  <navigator wx:if="{{!canIUse}}" class="btn" url="/pages/auth/auth" open-type="reLaunch" hover-class="other-navigator-hover">已经授权点击调转</navigator>
+</view>

+ 70 - 0
pages/auth/auth.wxss

@@ -0,0 +1,70 @@
+/* pages/auth/auth.wxss */
+/* 开始 */
+page {
+  height: 100%;
+  display: table;
+}
+ 
+.auth {
+  margin-top: 0;
+  text-align: center;
+  display: table-cell;
+  flex-direction: column;
+  flex-wrap: wrap;
+  justify-content: center;
+  align-items: flex-start;
+  padding: 100rpx;
+  vertical-align: middle;
+}
+ 
+.img {
+  border-radius: 50%;
+  /* border: 1px solid #fff; */
+  /* background-color: #fff; */
+  margin: 0 0 60rpx;
+  display: inline-block;
+  width: 200rpx;
+  height: 200rpx;
+  line-height: 0;
+}
+ 
+.title {
+  display: inline-block;
+  width: 100%;
+  margin: 0 0 60rpx;
+}
+ 
+.describe {
+  color: #a7aaa9;
+  font-size: 26rpx;
+  margin: 0 0 60rpx;
+  border-radius: 50%;
+  text-align: center;
+  display: inline-block;
+  width: 100%;
+}
+ 
+.btn {
+  padding: 0 60rpx;
+  background-color: #19be6b;
+  color: #ffffff;
+  margin: 20rpx 0 200rpx;
+  text-align: center;
+  vertical-align: middle;
+  touch-action: manipulation;
+  cursor: pointer;
+  background-image: none;
+  white-space: nowrap;
+  user-select: none;
+  font-size: 14px;
+  border: 0 !important;
+  position: relative;
+  text-decoration: none;
+  height: 44px;
+  line-height: 44px;
+  box-shadow: inset 0 0 0 1px #19be6b;  
+  /* background: #fff !important; */
+  /* color: #19be6b !important; */
+  display: inline-block;
+  border-radius: 10rpx;
+}

BIN
pages/auth/images/logo.jpg


BIN
pages/index/images/001.png


+ 195 - 5
pages/index/index.js

@@ -1,17 +1,31 @@
 //index.js
 //获取应用实例
+import * as echarts from '../../ec-canvas/echarts';
 var imageUtil = require('../../utils/window.js'); 
+var Chart=null;
 const app = getApp()
 
 Page({
   data: {
     url:'../../images/timg.jpg',
     motto: '',
+    currentTab: 0,
     userInfo: {},
     hasUserInfo: false,
     canIUse: wx.canIUse('button.open-type.getUserInfo'),
     imagewidth: 0,//缩放后的宽 
     imageheight: 0,//缩放后的高 
+    ec: {
+      onInit: function (canvas, width, height) {
+        chart = echarts.init(canvas, null, {
+          width: width,
+          height: height
+        });
+        canvas.setChart(chart);
+        return chart;
+      },
+      lazyLoad: true // 延迟加载
+    },
     aa:[
       {
         id:'0',
@@ -118,8 +132,6 @@ Page({
         reward: "Reuters.美股异动|波音(BA.US)737MAX客...",
         time:"5天前"
       },
-
- 
     ],
 
   },
@@ -130,13 +142,22 @@ Page({
     })
   },
   onReady: function (e) {
-    // this.computeScrollViewHeight();
+    this.computeScrollViewHeight();
     // var query = wx.createSelectorQuery()
     // query.select('#test').boundingClientRect(function (res) {
     //    console.log(res.top);
     // }).exec();
 },
+
   onLoad: function () {
+    this.echartsComponnet = this.selectComponent('#mychart');
+    console.log(this.echartsComponnet);
+    //如果是第一次绘制
+    if (!Chart) {
+      this.init_echarts(); //初始化图表
+    } else {
+      this.setOption(Chart); //更新数据
+    }
     // this.computeScrollViewHeight();
     // if (app.globalData.userInfo) {
     //   this.setData({
@@ -168,8 +189,8 @@ Page({
   computeScrollViewHeight() {
     var that = this
     let query = wx.createSelectorQuery().in(that)
-    query.select('.userinfo').boundingClientRect()
-    query.select('.search').boundingClientRect()
+    query.select('.swiper-tab').boundingClientRect()
+    query.select('.chart').boundingClientRect()
     query.select('.news').boundingClientRect()
     query.exec(res => {
       let topHeight = res[0].height
@@ -197,6 +218,175 @@ Page({
       url:"../news/news"
       });
   },
+  choose:function(e){
+    wx.navigateTo({
+      url:"../news/news"
+      })
+  },
+  swichNav: function(e) {
+    var that = this;
+    if (this.data.currentTab === e.target.dataset.current) {
+      return false;
+    } else {
+      that.setData({
+        currentTab: e.target.dataset.current
+      })
+    }
+  },
+  //初始化图表
+  init_echarts: function () {
+    this.echartsComponnet.init((canvas, width, height) => {
+       // 初始化图表
+       const Chart = echarts.init(canvas, null, {
+         width: width,
+         height: height
+       });
+       this.setOption(Chart)
+       // 注意这里一定要返回 chart 实例,否则会影响事件处理等
+       return Chart
+     });
+   },
+ 
+   setOption: function (Chart) {
+     Chart.clear();  // 清除
+     Chart.setOption(this.getOption());  //获取新数据
+   },
+ 
+   // 图表配置项
+   getOption() {
+     var self = this;
+     var option = { 
+       title: {//标题 
+         text: '', 
+         left: 'center' 
+       }, 
+       renderAsImage: true, //支持渲染为图片模式 
+       color: ["#DF3E3E", "#1AFA29"],//图例图标颜色 
+       legend: { 
+         show: true, 
+         itemGap: 25,//每个图例间的间隔 
+         top: 30, 
+         x: 30,//水平安放位置,离容器左侧的距离  'left' 
+         z: 100, 
+         textStyle: { 
+           color: '#383838'
+         }, 
+         data: [//图例具体内容 
+           { 
+             name: '实际', 
+             textStyle: { 
+               fontSize: 13, 
+               color: 'white' 
+             },
+             icon: 'roundRect'
+           }, 
+           { 
+             name: '预测', 
+             textStyle: {
+               fontSize: 13, 
+               color: 'white'
+             }, 
+             icon: 'roundRect'
+           } 
+         ] 
+       }, 
+       grid: {//网格 
+         left: 30, 
+         top:100, 
+         containLabel: true,//grid 区域是否包含坐标轴的刻度标签 
+       }, 
+       xAxis: {//横坐标
+         type: 'category',
+         name: '区间',//横坐标名称
+         nameTextStyle: {//在name值存在下,设置name的样式 
+           color: 'white',
+           fontStyle: 'normal' 
+         }, 
+         nameLocation:'end',
+         splitLine: {//坐标轴在 grid 区域中的分隔线。 
+           show: true,
+           lineStyle: {
+             type: 'dashed'
+           }
+         },
+         boundaryGap: false,//1.true 数据点在2个刻度直接  2.fals 数据点在分割线上,即刻度值上
+         data: ['10', '11', '12', '13', '14', '15', '16'],
+         axisLabel: {
+             textStyle: {
+             fontSize: 13,
+             color: '#5D5D5D'
+           }
+         }
+       },
+       yAxis: {//纵坐标
+         type: 'value',
+         position:'right',
+         name: '股票值',//纵坐标名称
+         nameTextStyle:{//在name值存在下,设置name的样式
+           color:'red',
+           fontStyle:'normal'
+         },
+         splitNumber: 5,//坐标轴的分割段数
+         splitLine: {//坐标轴在 grid 区域中的分隔线。
+           show: true,
+           lineStyle: {
+             type: 'dashed'
+           }
+         },
+         axisLabel: {//坐标轴刻度标签
+           formatter: function (value) {
+             var xLable = [];
+             if (value == 20) {
+               xLable.push('25,883');
+             }
+             if (value == 40) {
+               xLable.push('26,035');
+             }
+             if (value == 60) {
+               xLable.push('26,187');
+             }
+             if (value == 80) {
+               xLable.push('26,339');
+             }
+             return xLable
+           },
+           textStyle: {
+             fontSize: 13,
+             color: '#5D5D5D',
+           }
+         },
+         min: 0,
+         max: 100,
+       },
+       series: [{
+         name: '实际',
+         type: 'line',
+         smooth:true,
+         data: [18, 36, 65, 30, 78, 40, 33],
+         symbol: 'none',
+         itemStyle: {
+           normal: {
+             lineStyle: {
+               color: '#DF3E3E'
+             }
+           }
+         }
+       }, {
+         name: '预测',
+         type: 'line',
+         data: [10, 30, 31, 50, 40, 20, 10],
+         symbol: 'none',
+         itemStyle: {
+           normal: {
+             lineStyle: {
+               color: '#1AFA29'
+             }
+           }
+         }
+       }],
+     }
+     return option;
+   },
   getUserInfo: function(e) {
     console.log(e)
     app.globalData.userInfo = e.detail.userInfo

+ 5 - 1
pages/index/index.json

@@ -1,3 +1,7 @@
 {
-  "usingComponents": {}
+  "navigationStyle": "custom",
+  "usingComponents": {
+    "navBar": "/components/navBar/navBar",
+    "ec-canvas": "../../ec-canvas/ec-canvas"
+  }
 }

+ 34 - 8
pages/index/index.wxml

@@ -1,26 +1,52 @@
 <!--index.wxml-->
+<!-- <view>
+  <component-tag-name inner-text="Some text"></component-tag-name>
+</view> -->
+
+<navBar></navBar>
 <view class="container">
-  <view class="userinfo">
-    <!-- <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
+  <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>
+    <image class="image" src="./images/001.png" bindtap='choose'></image>
+  </view>
+  <!-- <view class="userinfo">
+    <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
     <block wx:else>
       <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
       <text class="userinfo-nickname">{{userInfo.nickName}}</text>
-    </block> -->
-    <!-- <image class="imageSize" src="{{url}}" mode="widthFix"></image> -->
+    </block>
+    <image class="imageSize" src="{{url}}" mode="widthFix"></image>
     <image class="image" style="width: {{imagewidth}}px; height: {{imageheight}}px;" src="{{url}}" bindload="imageLoad"></image> 
-  </view>
-  <view class="search">
+  </view> -->
+  <!-- <view class="search">
     <input class="weui-input" placeholder="请输入板块代码"/>
     <view class="weui-search-bar__cancel-btn" bindtap='方法名a'>
       <icon class="weui-icon-search_in-box" type="search" size="20"></icon>
     </view>
+  </view> -->
+  <view class="chart">
+         <!-- <view class="top">
+            <view class="topTitle">
+              <text class="titleBig">DOWN J</text>
+              <text class="titleSmall">xxxxxxxxxxxxxxx</text>
+            </view>
+            <view class="line"></view>
+            <view class="topText">
+              <text class="textOne">1111111</text>
+              <text class="textTwo">+527.4</text>
+            </view>
+          </view> -->
+        <view class="middleCharts">
+          <ec-canvas id="mychart" canvas-id="mychart-line" ec="{{ ec }}"></ec-canvas>
+        </view>
   </view>
   <view class="news">
     <text class="news-today">今日快讯</text>
   </view>
-  <view class="line">
+  <!-- <view class="line">
     1
-  </view>
+  </view> -->
     <!-- <swiper class="tab-right"  id="test" vertical="true" autoplay="true" circular="true" interval="2000" display-multiple-items='6'>
       <view class="right-item">
         <block wx:for-index="idx" wx:for='{{aa}}'>

+ 73 - 9
pages/index/index.wxss

@@ -1,4 +1,66 @@
 /**index.wxss**/
+.chart{
+  background:#000;
+  color:white;
+  height:50%;
+  width:100%;
+  /* position:fixed;
+  top:100rpx;
+  left:0;
+  right:0; */
+}
+.middleCharts{
+  width:100%;
+  height:90%;
+  background:#1C1C1C;
+  /* position:relative;
+  top:50px; */
+  margin:5% auto; 
+  border-radius:3px;
+}
+#mychart{
+  margin:0 auto;
+}
+.buttonText{
+  width:95%;
+  height:20%;
+  background:#1C1C1C;
+  /* position:relative;
+  top:50px; */
+  margin:5% auto; 
+  border-radius:3px;
+}
+.nextText{
+  /* width:90%; */
+  /* height:5%; */
+  background:#1C1C1C;  
+  border-radius:3px;
+  margin:0 auto;
+}
+.swiper-tab {
+  width: 100%;
+  text-align: center;
+  line-height: 80rpx;
+  position: relative;
+}
+
+.swiper-tab-list {
+  font-size: 30rpx;
+  display: inline-block;
+  width: 20%;
+  color: #777;
+}
+.on {
+  color: #D81E06;
+  border-bottom: 5rpx solid #D81E06;
+}
+.image{
+  position:absolute;
+  width: 40rpx;
+  height:40rpx;
+  right: 20rpx;
+  top:20rpx;
+}
 .userinfo {
   width:100%;
   /* display: flex;
@@ -31,8 +93,8 @@
   right:20rpx;
 }
 .news{
-  margin-top:20rpx;
   width:90%;
+  margin-bottom: 20rpx;
 }
 .line{
   background: #E0E3DA;
@@ -69,13 +131,13 @@
   float: left;
 }
 .tab{
-  width: 90%;
+  width: 100%;
   background-color:#1C1C1C ;
   color: #fff;
 }
 .content-item {
   /* height: 50rpx; */
-  border-bottom: 1rpx solid #ede1d4;
+  /* border-bottom: 1rpx solid #ede1d4; */
   width: 100%;
   display: flex;
   flex-direction: column;
@@ -83,7 +145,7 @@
 }
 .from{
   font-size: 24rpx;
-  margin-left: 10rpx;
+  margin-left: 20rpx;
   color: #999;
   margin-top:10rpx;
 }
@@ -91,14 +153,15 @@
   font-size: 30rpx;
   /* line-height: 100rpx; */
   color: #fff;
-  margin:10rpx;
-  width: 100%;
+  margin:10rpx 20rpx;
+  /* width: 100%; */
   height:100%;
   overflow: hidden;
+  /* border: 1rpx solid red; */
 }
 .wawa {
   font-size: 26rpx;
-  margin-left:10rpx;
+  margin-left:20rpx;
   /* float: right; */
   /* line-height: 100rpx; */
   /* margin-right: 20rpx; */
@@ -106,8 +169,9 @@
 }
 .time{
   font-size: 24rpx;
-  margin-left:10rpx;
+  margin-left:20rpx;
   color: #999;
   margin-top:10rpx;
   margin-bottom: 10rpx;
-}
+}
+

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 4 - 5
pages/news/news.js


+ 3 - 3
pages/news/news.wxml

@@ -1,14 +1,14 @@
 <!--pages/news/news.wxml-->
 <view class="news-detail-container">
-  <!-- <image class="head-img" src="../{{ currentNews.image }}"></image> -->
    <text class="title">{{ currentNews.title }}</text>
    <view class="author-time">
     <!-- <image class="author-avatar" src="../{{currentNews.icon}}"></image> -->
     <text class="author-name">{{ currentNews.author }}</text>
-    <!-- <text class="const-text">发表于</text> -->
+    <text class="const-text">发表于</text>
     <text class="time">{{ currentNews.time }}</text>
   </view>
-  <view class="horizon"></view>
+  <image class="head-img" src="../{{ currentNews.image }}"></image>
+  <!-- <view class="horizon"></view> -->
   <view class="tool">
     <!-- <view class="circle-img">
       <image src="../../../image/sch.png" ></image> 

+ 11 - 5
pages/news/news.wxss

@@ -6,13 +6,15 @@
 }
 
 .head-img{
-  width: 100%;
+  width: 90%;
+  margin:0 auto
 }
 
 .author-time{
   flex-direction: row;
   margin-left: 30rpx;
   margin-top: 20rpx;
+  margin-bottom: 20rpx;
 }
 
 .author-avatar{
@@ -44,7 +46,8 @@
 }
 
 .title{
-  margin-left: 40rpx;
+  margin-left: 10rpx;
+  margin-right: 10rpx;
   font-size: 36rpx;
   font-weight: 700;
   margin-top: 30rpx;
@@ -55,7 +58,10 @@
 
 .tool{
   margin-top: 20rpx;
-  margin-left: 10rpx;
+  margin-bottom: 30rpx;
+  padding-left: 20rpx;
+  padding-right: 6rpx;
+  
 }
 
 .circle-img{
@@ -87,8 +93,8 @@
 .detail{
   /* color:#666; */
   margin-top: 20rpx;
-  margin-right: 30rpx;
-  margin-left: 30rpx;
+  /* margin-right: 20rpx; */
+  /* margin-left: 30rpx; */
   /* margin-bottom: 50rpx; */
   line-height: 44rpx;
   letter-spacing: 2px;

+ 0 - 1
pages/rise/rise.json

@@ -1,6 +1,5 @@
 {
   "navigationBarTitleText": "涨幅",
-
   "usingComponents": {
     "ec-canvas": "../../ec-canvas/ec-canvas"
   }

BIN
pages/search/images/del.png


BIN
pages/search/images/delete.png


+ 83 - 0
pages/search/search.js

@@ -0,0 +1,83 @@
+// pages/search/search.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list: [],
+    inputValue: null,
+    resultList:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+  blur: function (e) {
+    this.setData({
+      inputValue: e.detail.value
+    })
+    // this.search();
+  },
+  clean:function(){
+    var _this=this
+   setTimeout(function () {
+     _this.setData({
+       inputValue: '',
+     })
+   },100)
+ },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+ 
+})

+ 5 - 0
pages/search/search.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "搜索",
+  "usingComponents": {}
+}
+

+ 42 - 0
pages/search/search.wxml

@@ -0,0 +1,42 @@
+<!--pages/search/search.wxml-->
+<view class='container2'>
+  <view  class='search_input'>
+    <icon type="search" size="15" class='search_icon' />
+    <input placeholder='请输入板块代码' placeholder-class="search_placeholder" value="{{inputValue}}" bindinput="blur"></input>
+    <!-- <image src='../images/del.png' class='cancle_btn' wx:if="{{inputValue}}" bindtap='clean'></image> -->
+    <image src='./images/del.png' class='cancle_btn'  wx:if="{{inputValue}}" bindtap='clean'></image>
+  </view>
+  <view class='flex space_between align_center search_title'>
+     <view>
+        搜索记录
+     </view>
+     <!-- <image src='../images/delete.png' wx:if="{{list.length!=0}}"  catchtap='remove'></image> -->
+     <image src='./images/delete.png'  catchtap='remove'></image>
+  </view>
+
+  <view class='list'>
+     <view class="key" wx:if="{{list.length==0}}">暂无搜索记录</view>
+     <!-- <view class="key" wx:for="{{list}}" wx:key="" bindtap='searchName' data-value='{{item}}'>{{item}}</view> -->
+  </view>
+  <view style="clear:both"></view>
+   <view  class='search_result' wx:if="{{inputValue}}">
+       <!-- <view wx:for="{{resultList}}" wx:key="" bindtap='detail' data-id='{{item.projectCode}}'>
+          {{item.projectName}}
+       </view> -->
+      <view class='no_more' wx:if="{{resultList.length==0}}">暂无相关内容</view>
+  </view>
+  <view class="flex space_between align_center search_title">
+     <view>
+        热门搜索
+     </view>
+  </view>
+  <view class='list'>
+      <view class="key">中国移动</view>
+      <view class="key">中国联通</view>
+      <view class="key">中国电信</view>
+  </view>
+
+</view>
+  
+
+

+ 136 - 0
pages/search/search.wxss

@@ -0,0 +1,136 @@
+/* pages/news/search.wxss */
+.key{
+  width:auto;
+  height:48rpx;
+  line-height: 48rpx;
+  background:rgba(246,246,246,1);
+  border-radius:30rpx;
+  padding: 5rpx 30rpx;
+  font-weight:300;
+  color: #4A4A4A;
+  float:left;
+  margin-right: 10rpx;
+  margin-bottom: 30rpx;
+  margin-left: 10rpx;
+}
+
+.list{
+  padding-left: 10rpx;
+}
+
+.search_title{
+   margin: 40rpx 20rpx 40rpx 30rpx;
+}
+.search_title image{
+    width: 48rpx;
+    height: 48rpx;
+}
+
+.search_result{
+  position:fixed;
+  left:0;
+  right:0;
+  top:100rpx;
+  bottom:0;
+  /* background:#ffffff; */
+  background:#000000;
+  font-size: 26rpx;
+  overflow: scroll;
+  padding-bottom: 30rpx;
+}
+
+.search_result>view{
+  width: 690rpx;
+  border-bottom:1rpx solid rgba(239,239,239,1);
+  margin: auto;
+  padding:30rpx 0;
+  /* color: #070707; */
+  color: #ffffff;
+  font-weight:400;
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.search_result>view:nth-last-child(1){
+   border-bottom: none;
+}
+
+.cancle_btn{
+  position: absolute;
+  right: 40rpx;
+  top:15rpx;
+  width: 48rpx;
+  height: 48rpx;
+  z-index: 999;
+}
+
+.search_input {
+  width: 620rpx;
+  height: 72rpx;
+  background: rgba(247, 247, 247, 1);
+  border-radius: 36rpx;
+  padding-left: 80rpx;
+  margin:20rpx auto;
+  font-size: 24rpx;
+}
+
+.search_input input{
+  line-height:72rpx;
+  height:72rpx;
+  width:500rpx;
+}
+
+.search_icon {
+  position: absolute;
+  left: 60rpx;
+  top: 43rpx;
+}
+
+.search_placeholder {
+  /* color: #cacaca; */
+}
+
+.cancle_btn{
+  position: absolute;
+  right: 40rpx;
+  top:30rpx;
+  width: 48rpx;
+  height: 48rpx;
+  z-index: 999;
+}
+
+.container2 {
+  padding: 0 0 50rpx;
+  font-size: 29rpx;
+  overflow: scroll;
+}
+
+.no_more {
+  text-align: center;
+  font-weight: 400;
+  color: rgba(107, 107, 107, 1);
+  margin-bottom: 30rpx;
+}
+
+
+.flex {
+  display: flex;
+  color: #ffffff;
+}
+
+.space_between {
+  justify-content: space-between;
+}
+
+.space_around {
+  justify-content: space-around;
+}
+
+.align_center {
+  align-items: center;
+}
+.hot_search{
+  margin: 10rpx 20rpx 40rpx 30rpx;
+  color: #ffffff;
+}

+ 3 - 3
project.config.json

@@ -20,15 +20,15 @@
 		"checkInvalidKey": true,
 		"checkSiteMap": true,
 		"uploadWithSourceMap": true,
-		"compileHotReLoad": false,
 		"babelSetting": {
 			"ignore": [],
 			"disablePlugins": [],
 			"outputPath": ""
 		},
-		"useIsolateContext": true,
 		"useCompilerModule": true,
-		"userConfirmedUseCompilerModuleSwitch": false
+		"userConfirmedUseCompilerModuleSwitch": false,
+		"compileHotReLoad": false,
+		"useIsolateContext": true
 	},
 	"compileType": "miniprogram",
 	"libVersion": "2.11.1",

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels