Skip to content

Commit

Permalink
新增load动画
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavehong committed Oct 20, 2016
1 parent 098287d commit a49d97d
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 57 deletions.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"navigationBarBackgroundColor": "#f85f48",
"navigationBarTitleText": "分答 - 付费语音问答",
"navigationBarTextStyle":"white",
"enablePullDownRefresh":true
"enablePullDownRefresh":false
},
"tabBar": {
"color": "#231815",
Expand Down
17 changes: 12 additions & 5 deletions pages/feeds/feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var app = getApp()
Page({
data: {
hidden: true,
motto: 'Hello World',
userInfo: {},
feedList: []
Expand All @@ -13,9 +14,6 @@ Page({
url: '../logs/logs'
})
},
onPullDownRefreash: function() {
console.info("xiala")
},
onLoad: function() {
var that = this
console.log('onLoad')
Expand All @@ -34,6 +32,9 @@ Page({
}
})
},
onPullDownRefresh: function() {
console.info("被拉下了")
},
toPerson: function(e) {
console.log(e)
wx.navigateTo({
Expand All @@ -47,8 +48,11 @@ Page({
console.log("到底啦")
if (this.requestFlag === false) {
this.requestFlag = true
this.setData({
hidden: false
})
var that = this
setTimeout(that.getFeeds, 1000)
setTimeout(that.getFeeds, 3000)
}
},
requestFlag: false,
Expand All @@ -60,6 +64,10 @@ Page({
'Content-Type': 'application/json'
},
success: function(res) {
that.requestFlag = false
that.setData({
hidden: true
})
var feedsStrorage = wx.getStorageSync('feeds') || []
feedsStrorage = feedsStrorage.concat(res.data)
that.setData({
Expand All @@ -68,7 +76,6 @@ Page({
try {
wx.setStorageSync('feeds', feedsStrorage)
} catch (e) {}
that.requestFlag = false
console.log("同步成功啦")
}
})
Expand Down
2 changes: 1 addition & 1 deletion pages/feeds/feeds.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"navigationBarTitleText": "收听",
"enablePullDownRefresh":true
}
}
10 changes: 7 additions & 3 deletions pages/feeds/feeds.wxml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<!--index.wxml-->
<scroll-view scroll-y="true" style="height: 100%;" bindscrolltoupper="upper" bindscrolltolower="lower">
<block wx:for="{{feedList}}">
<navigator class="scroll-view-item" url="../issue/issue?stamp={{item.stamp}}">
<block wx:for="{{feedList}}">
<navigator class="scroll-view-item" url="../issue/issue?stamp={{item.stamp}}">
<text class="item-ques">{{item.question}}</text>
<view class="item-ans">
<image src="/img/avatar/{{item.masterAvatar}}" mode="aspectFill" catchtap="toPerson" data-master="{{item.masterID}}"></image>
<view class="item-voice">1元偷偷听</view>
<view class="item-pv">{{item.pv}}</view>
</view>
</navigator>
</block>
</block>
</scroll-view>

<loading hidden="{{hidden}}">
加载中...
</loading>
2 changes: 1 addition & 1 deletion pages/feeds/feeds.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@
height: 80rpx;
line-height: 80rpx;
color: #aaa;
}
}
2 changes: 1 addition & 1 deletion pages/issue/issue.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"navigationBarTitleText": "问题详情"
}
}
2 changes: 1 addition & 1 deletion pages/issue/issue.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
</view>
<view class="master-follow">收听</view>
</view>
</view>
</view>
1 change: 0 additions & 1 deletion pages/mine/mine.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var app = getApp()
Page({
data: {
userInfo: {},
myProfile: ["我的分币", "我问", "我听"],
myProfile: [{ "desc": "我的分币", "id": "coin" }, { "desc": "我问", "id": "myQues" }, { "desc": "我听", "id": "myHeared" }],
myAccount: ["手机号码", "帮助", "结算说明", "关于分答"]
},
Expand Down
2 changes: 1 addition & 1 deletion pages/mine/mine.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
</view>
</view>
<button type="default" class="btn-quit"> 退出登录 </button>
</view>
</view>
86 changes: 47 additions & 39 deletions pages/mine/mine.wxss
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
/**mine.wxss**/

.userinfo {
display: flex;
flex-direction: column;
align-items: center;
background-color: #fff;
margin-bottom: 20rpx;
display: flex;
flex-direction: column;
align-items: center;
background-color: #fff;
margin-bottom: 20rpx;
}

.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 30rpx;
border-radius: 50%;
width: 128rpx;
height: 128rpx;
margin: 30rpx;
border-radius: 50%;
}

.userinfo-nickname {
margin: 20rpx;
color: #666;
}
.userinfo-dig{
margin: 15rpx auto;
padding: 20rpx 25rpx;
border-radius: 10rpx;
background-color: #f85f48;
color: #fff;
letter-spacing: 1px;
}
.userinfo-desc{
color: #bbb;
font-size: 14rpx;
margin-bottom: 20rpx;
}
.profile-wrapper,.account-wrapper{
background-color: #fff;
margin-bottom: 20rpx;
}
.profile,.account{
display: flex;
margin: 20rpx;
color: #300e0e;
}

.userinfo-dig {
margin: 15rpx auto;
padding: 20rpx 25rpx;
border-radius: 10rpx;
background-color: #f85f48;
color: #fff;
letter-spacing: 1px;
}

.userinfo-desc {
color: #bbb;
font-size: 14rpx;
margin-bottom: 20rpx;
}

.profile-wrapper, .account-wrapper {
background-color: #fff;
margin-bottom: 20rpx;
}

.profile, .account {
display: flex;
padding: 30rpx;
align-items: center;
flex-direction: row;
border-bottom: 1rpx solid #f0f0f0;
}
.profile-item,.account-item{
flex: 1;
font-size: 24rpx;

.profile-item, .account-item {
flex: 1;
font-size: 24rpx;
}
.profile-arrow,.account-arrow{
width: 32rpx;

.profile-arrow, .account-arrow {
width: 32rpx;
height: 32rpx;
}
.btn-quit{
margin: 15rpx;
}

.btn-quit {
margin: 15rpx;
}
9 changes: 6 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
- [如何把握「微信小程序」这一波红利? by 小道消息](http://mp.weixin.qq.com/s?src=3&timestamp=1476084572&ver=1&signature=9iql2gUC5J7Ore2nR-vE*H0gMx-FPnvh7tg-59H5QWMBRqIVFVSiJ*1d4P9Ynvx*jzG4x*-cw8VWd0zSXCy5JaC0Og6HZ0HOzPn0si-g2g-cdqwlcc46JxXsfUPfh5U5SjG6Jhwc2gHoN7hj4WkbQ-K-E-w0t6Hrb3YC-d7h*aw=)
- [微信小程序,仅仅是 Web App 么? by MacTalk](http://mp.weixin.qq.com/s?src=3&timestamp=1476084683&ver=1&signature=rI*ApZSTzdk20BrHyMgaF9eKgT77oadaMtoePyV-BXJIoHrWVpbxGeRnuoYv5B3cIVH2BPb5vx-4WI3JCrZm1m32V17Hqs6W1k7i2xtrU*iDM5FIvOHPSNb1UBzlh6Dfec6G3W2zNN57OXEtYWB*V4ENdABAgw*p*lItuVWU9Hc=)
- [为什么你觉得只开发微信号是不行的? By 可能吧](https://kenengba.com/post/3517.html)

---
- [wept](https://github.com/chemzqm/wept):非常好用的一个「微信小程序」实时开发环境,可以对wxml, wxss, javascript 和页面json自动热更新,炸裂!

`一些想法`[个人关于「微信小程序」的一些见解](http://elephstor.com/blog/390)

---

###feature

- flex布局
Expand All @@ -21,7 +22,9 @@

- 动态刷新

tabBar的第一个菜单「收听」使用了微信提供的组件scroll-view可滚动视图区域,页面加载后从网络上拉取数据填入视图层同时写入Storage(应该就是html5中的localStorage),滚动到底部时触发更新事件,同时设置标志位防止重复触发。
tabBar的第一个菜单「收听」使用了微信提供的组件scroll-view可滚动视图区域,页面加载后从网络上拉取数据填入视图层同时写入Storage(应该就是html5中的localStorage),滚动到底部时触发更新事件,同时设置标志位防止重复触发。应用官方的加载提示动画。

`tip`:滚动视图组件的上下滚动用鼠标滚轮,使用鼠标拖动的话很容易触发下拉事件,哪怕并没有到达顶部。滚动视图组件内不要放与内容无关的元素

- 带参切换页面

Expand Down

0 comments on commit a49d97d

Please sign in to comment.