zhengxuhua преди 5 години
родител
ревизия
b621f227f7
променени са 10 файла, в които са добавени 141 реда и са изтрити 14 реда
  1. 1 1
      app.wxss
  2. BIN
      images/search.png
  3. BIN
      images/tabBar001.png
  4. BIN
      images/tabBar011.png
  5. 38 3
      pages/drop/drop.js
  6. 19 2
      pages/drop/drop.wxml
  7. 42 1
      pages/drop/drop.wxss
  8. 8 2
      pages/index/index.wxml
  9. 32 4
      pages/index/index.wxss
  10. 1 1
      project.config.json

+ 1 - 1
app.wxss

@@ -7,5 +7,5 @@
   justify-content: space-between;
   /* padding: 200rpx 0; */
   box-sizing: border-box;
-  /* background-color: #000000; */
+  background-color: #000000;
 } 

BIN
images/search.png


BIN
images/tabBar001.png


BIN
images/tabBar011.png


+ 38 - 3
pages/drop/drop.js

@@ -5,14 +5,30 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    winWidth: 0,
+    winHeight: 0,
+    currentTab: 0,    
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    var that = this;
+
+        /**
+         * 获取当前设备的宽高
+         */
+        wx.getSystemInfo( {
+
+            success: function( res ) {
+                that.setData( {
+                    winWidth: res.windowWidth,
+                    winHeight: res.windowHeight
+                });
+            }
 
+        });
   },
 
   /**
@@ -62,5 +78,24 @@ Page({
    */
   onShareAppMessage: function () {
 
-  }
-})
+  },
+      swichNav: function( e ) {
+
+        var that = this;
+
+        if( this.data.currentTab === e.target.dataset.current ) {
+            return false;
+        } else {
+            that.setData( {
+                currentTab: e.target.dataset.current
+            })
+        }
+    },
+
+    bindChange: function( e ) {
+
+        var that = this;
+        that.setData( { currentTab: e.detail.current });
+
+    },
+})

+ 19 - 2
pages/drop/drop.wxml

@@ -1,2 +1,19 @@
-<!--pages/drop/drop.wxml-->
-<text></text>
+<view class="bground">
+  <!-- <view class="dropTop">跌幅榜</view> -->
+  <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>
+
+<swiper current="{{currentTab}}" class="swiper-box" duration="300" style="height:{{winHeight - 31}}px" bindchange="bindChange">
+    <swiper-item>
+        <view>上周实际数据</view>
+    </swiper-item>
+    <swiper-item>
+        <view>上周预测数据</view>
+    </swiper-item>
+    
+</swiper>
+
+</view>

+ 42 - 1
pages/drop/drop.wxss

@@ -1 +1,42 @@
-/* pages/drop/drop.wxss */
+/* pages/drop/drop.wxss */
+.bground{
+  background:#000;
+  color:white;
+  height:100%;
+  width:100%;
+}
+.dropTop{
+  font-size:1.8rem;
+  position:relative;
+  color:red;
+  top:0;
+  left:0;
+  height:58px;
+  line-height:58px;
+  border-bottom:1px solid #fff;
+}
+.swiper-tab{
+  width: 100%;
+  text-align: center;
+  line-height: 80rpx;
+}
+.swiper-tab-list{ 
+   font-size: 30rpx;
+   display: inline-block;
+   width: 33.33%;
+   color: #777777;
+}
+.on{ 
+  color:#D81E06;
+  border-bottom: 3rpx solid #D81E06;
+}
+.swiper-box{ 
+  display: block; 
+  height: 100%;
+  width: 100%; 
+  overflow: hidden; 
+}
+.swiper-box view{
+
+  text-align: center;
+}

+ 8 - 2
pages/index/index.wxml

@@ -8,7 +8,13 @@
     </block> -->
     <image class="imageSize" src="{{url}}" mode="widthFix"></image>
   </view>
-  <view class="usermotto">
-    <text class="user-motto">{{motto}}</text>
+  <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="news">
+    <text class="news-today">今日快讯</text>
   </view>
 </view>

+ 32 - 4
pages/index/index.wxss

@@ -1,20 +1,48 @@
 /**index.wxss**/
 .userinfo {
   width:100%;
-  /* display: flex; */
-  /* flex-direction: column; */
-  /* align-items: center; */
+  display: flex;
+  flex-direction: column;
+  align-items: center;
 }
 .imageSize{
   width: 100%;
 }
+.search{
+  margin-top: -50rpx;
+  background-color: #fff;
+  border: 1rpx solid #fff;
+  border-radius: 10rpx;
+  align-items: center;
+  width:90%;
+  height: 80rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content:space-between;
+  align-items: center;
+  
+}
+.weui-input{
+  margin-left: 30rpx;
+  height: 100%;
+}
+.weui-search-bar__cancel-btn{
+  margin-right: 40rpx;
+}
+.news{
+  margin-top:20rpx;
+  width:90%;
+}
+.news-today{
+  color: #fff;
+  font-size: 40rpx;
+}
 .userinfo-avatar {
   width: 128rpx;
   height: 128rpx;
   margin: 20rpx;
   border-radius: 50%;
 }
-
 .userinfo-nickname {
   color: #aaa;
 }

+ 1 - 1
project.config.json

@@ -10,8 +10,8 @@
 		"preloadBackgroundData": false,
 		"minified": true,
 		"newFeature": true,
-		"autoAudits": false,
 		"coverView": true,
+		"autoAudits": false,
 		"showShadowRootInWxmlPanel": true,
 		"scopeDataCheck": false,
 		"checkInvalidKey": true,