Skip to content

Commit

Permalink
update the market page
Browse files Browse the repository at this point in the history
add pull down to refresh and add loading item before show the data
  • Loading branch information
Cha0s0000 committed Apr 22, 2018
1 parent f2225a7 commit 550fd69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions pages/market/market.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Page({
/**
* The initial data of the page
*/
data: {
data: {
hidden: false,

},

Expand Down Expand Up @@ -51,6 +52,8 @@ Page({
* Page correlation event handler - listen to the user to pull.
*/
onPullDownRefresh: function () {
this.setData({ hidden:false})
this.onLoad();

},

Expand Down Expand Up @@ -264,7 +267,7 @@ Page({
sbdPrice.time.push(that.getTime(data[i].time * 1000));
}
console.log(sbdPrice);
that.setData({ sbdPrice: sbdPrice });
that.setData({ sbdPrice: sbdPrice,hidden:true});
}
},
})
Expand Down
9 changes: 6 additions & 3 deletions pages/market/market.wxml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!--pages/market/market.wxml-->
<view class="chart-container">
<view class="chart-container" hidden="{{!hidden}}">
<view class="chart-title">
STEEM/SBD price history
</view>
<canvas canvas-id="priceHistory" disable-scroll="true" class="canvas" bindtouchstart="touchHandler"></canvas>
<button type="primary" bindtap="updateData">更新数据</button>
</view>
<view class="table-container">
<view class="table-container" hidden="{{!hidden}}">
<view class="instruction">STEEM SBD 单位为 /USD</view>
<view class="table">
<view class="tr">
Expand All @@ -22,4 +22,7 @@
<view class="td"> {{sbdPrice.price[priceHistory.time.length-index-1]}} </view>
</view>
</view>
</view>
</view>
<loading hidden="{{hidden}}">
Loading...
</loading>

0 comments on commit 550fd69

Please sign in to comment.