lx 5 gadi atpakaļ
vecāks
revīzija
1a244761db
3 mainītis faili ar 70 papildinājumiem un 6 dzēšanām
  1. 22 1
      pages/search/search.js
  2. 12 3
      pages/search/search.wxml
  3. 36 2
      pages/search/search.wxss

+ 22 - 1
pages/search/search.js

@@ -7,7 +7,22 @@ Page({
   data: {
     list: [],
     inputValue: null,
-    resultList:[]
+    resultList:[
+      {
+        title:'AppL',
+        subtitle:"APPL INC",
+        Increase:"1.22",
+        digital:"33",
+        data:[52,56,355,444]
+      },
+      {
+        title:'AppL',
+        subtitle:"APPL INC",
+        Increase:"1.22",
+        digital:"33",
+        data:[52,56,355,44554]
+      },
+    ]
   },
 
   /**
@@ -29,6 +44,12 @@ Page({
        inputValue: '',
      })
    },100)
+ },
+ detail:function(e){
+  wx.navigateTo({
+    url: '../item/item'
+  });
+
  },
 
   /**

+ 12 - 3
pages/search/search.wxml

@@ -19,10 +19,19 @@
      <!-- <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  class='search_result' wx:if="{{inputValue}}">
-       <!-- <view wx:for="{{resultList}}" wx:key="" bindtap='detail' data-id='{{item.projectCode}}'>
-          {{item.projectName}}
-       </view> -->
+       <view wx:for="{{resultList}}"class="swiper-box-view" wx:key="key" bindtap='detail' data-index="{{index}}">
+          <view class="swiper-box-left">
+          <view>{{item.title}}</view>
+          <view class="swiper-box-subtitle">{{item.subtitle}}</view>
+        </view>
+        <view class="swiper-box-right">
+          <view class="swiper-box-button">
+            <button  class="mini-btn" type="warn" size="mini" >+{{item.Increase}}</button>
+          </view>
+        </view>
+       </view>
       <view class='no_more' wx:if="{{resultList.length==0}}">暂无相关内容</view>
   </view>
   <view class="flex space_between align_center search_title">

+ 36 - 2
pages/search/search.wxss

@@ -52,9 +52,9 @@
   text-overflow: ellipsis;
 }
 
-.search_result>view:nth-last-child(1){
+/* .search_result>view:nth-last-child(1){
    border-bottom: none;
-}
+} */
 
 .cancle_btn{
   position: absolute;
@@ -134,3 +134,37 @@
   margin: 10rpx 20rpx 40rpx 30rpx;
   color: #ffffff;
 }
+  
+.swiper-box {
+  display: block;
+  height: 100%;
+  width: 100%;
+  overflow: hidden;
+  color: #fff;
+}
+
+ .swiper-box-view {
+ display: flex;
+ justify-content: space-between ;
+ align-items: center;
+ margin: 10rpx;
+ border-bottom: 1rpx slategray solid;
+}
+  .swiper-box-view .swiper-box-left .swiper-box-subtitle{
+    color: slategray;
+  }
+ .swiper-box-view .swiper-box-right{
+    display: flex;
+    align-items: center;
+  }
+ .swiper-box-view .swiper-box-right .swiper-box-canvas {
+  height: 120rpx;
+  width: 300rpx;
+}
+ .swiper-box-view .swiper-box-right .swiper-box-button{
+  text-align: right;
+}
+ .swiper-box-view .swiper-box-right .swiper-box-button button{
+  color: #fff;
+  background: #D81E06;
+}