瀏覽代碼

首页添加loading, horizn添加间距

zhashaonan 6 年之前
父節點
當前提交
386d974e5a
共有 4 個文件被更改,包括 22 次插入5 次删除
  1. 2 2
      pages/components/blocks/horizon/horizon.wxml
  2. 13 0
      pages/index/index.js
  3. 6 3
      pages/index/index.wxml
  4. 1 0
      pages/special/special.js

+ 2 - 2
pages/components/blocks/horizon/horizon.wxml

@@ -1,7 +1,7 @@
 <view style="background-image:url('{{specialData.bg_data?specialData.bg_data:''}}');background-size:100% 100%;">
-    <scroll-view scroll-x="true" style="white-space: nowrap; display: flex;justify-content:space-between;">
+    <scroll-view scroll-x="true" style="white-space: nowrap; display: flex;justify-content:space-between;margin-left:10rpx;margin-right:10rpx;">
         <block wx:key="{{item}}" wx:for="{{items}}">
-            <view style="display:inline-block;width:{{(item.width/1080*750)+'rpx'}}; height:{{(item.height/1080*750)+'rpx'}}">
+            <view style="display:inline-block;margin-left:10rpx;margin-right:10rpx;;width:{{(item.width/1080*750)+'rpx'}}; height:{{(item.height/1080*750)+'rpx'}}">
               <blockItem item_data="{{item}}"></blockItem>
             </view>
         </block>

+ 13 - 0
pages/index/index.js

@@ -23,6 +23,7 @@ Page({
 
   onLoad: function () {
     this.req_tabs(); // old
+    // this.getDatas(1383)
   },
   getDatas(special_id) {
     let fromSource = recordSource(app, 'act=special&op=index&special_id=0&page=10&curpage=1&client_type=mini')
@@ -39,6 +40,7 @@ Page({
       from: fromSource
     }, function (res) {
       if (res.code == 200) {
+        console.log('indexres:', res);
         let prop_special = res.datas.special_list;
         let sent_down_special = prop_special.splice(0, 8);
         self.setData({
@@ -110,8 +112,12 @@ Page({
     if (this.data.isSendProp) {
       return;
     }
+   
     let surplus_special_num = this.data.surplus_special.length;
     if (surplus_special_num > 0) {
+      wx.showLoading({
+        title: '加载中'
+      });
       this.setData({
         isSendProp: true
       });
@@ -125,6 +131,13 @@ Page({
       this.setData({
         isSendProp: false
       });
+      setTimeout(function () {
+        wx.hideLoading()
+      }, 1500)
+    }
+    else {
+      return;
     }
+    
   }
 })

+ 6 - 3
pages/index/index.wxml

@@ -1,8 +1,11 @@
 <!--index.wxml-->
 <view>
-  <searchBox></searchBox>
-  <tabs tabs="{{tabs}}" bind:myevent="onMyEvent"></tabs>
-  <view class='clear_fixed'></view> 
+  <view style="height: 140rpx;overflow: hidden;background:#2b2b2b;">
+      <searchBox></searchBox>
+      <tabs tabs="{{tabs}}" bind:myevent="onMyEvent"></tabs>
+  </view>
+  
+  <!-- <view class='clear_fixed'></view>  -->
   <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
   <image bindtap='backTop' style="display:{{isScroll?'block':'none'}}" mode='widthFix' class='back_top_btn' src='../../image/back_top.png'></image> 
 </view>

+ 1 - 0
pages/special/special.js

@@ -40,6 +40,7 @@ Page({
       from: fromSource
     }, function (res) {
       if (res.code == 200) {
+        console.log('special:', res);
         self.setData({
           special_datas: res.datas,
           summery: res.datas.summary,