-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
225 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
//app.js | ||
var util = require('./utils/util.js') | ||
App({ | ||
onLaunch: function () { | ||
//调用API从本地缓存中获取数据 | ||
var logs = wx.getStorageSync('logs') || [] | ||
logs.unshift(Date.now()) | ||
wx.setStorageSync('logs', logs) | ||
|
||
}, | ||
getUserInfo:function(cb){ | ||
var that = this; | ||
if(this.globalData.userInfo){ | ||
typeof cb == "function" && cb(this.globalData.userInfo) | ||
}else{ | ||
//调用登录接口 | ||
wx.login({ | ||
success: function () { | ||
wx.getUserInfo({ | ||
success: function (res) { | ||
that.globalData.userInfo = res.userInfo; | ||
typeof cb == "function" && cb(that.globalData.userInfo) | ||
} | ||
}) | ||
} | ||
}); | ||
} | ||
onShow: function () { | ||
}, | ||
globalData:{ | ||
userInfo:null | ||
onHide: function () { | ||
}, | ||
globalData: { | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,62 @@ | ||
<view class="page-loading {{showLoading ? '' : 'hide'}}"> | ||
<text class="weui-loading"/><text class="loading-text">玩命加载中</text> | ||
</view> | ||
<scroll-view style="height: 100%;" scroll-y="true" class="container film-list" bindscroll="scroll"> | ||
<block wx:for-items="{{films}}" wx:for-item="film"> | ||
<view class="film-item" bindtap="viewDetail" data-id="{{film.id}}" data-title="{{film.title}}"> | ||
<view class="film-image"> | ||
<image src="{{film.images.medium}}"></image> | ||
</view> | ||
<view class="film-info"> | ||
<view> | ||
<text class="film-title">{{film.title}}</text> | ||
<text class="film-year">{{film.year}}</text> | ||
<block wx:if="{{showLoading}}"> | ||
<view class="page-loading"> | ||
<text class="weui-loading"/><text class="loading-text">玩命加载中</text> | ||
</view> | ||
</block> | ||
<block wx:else> | ||
<scroll-view style="height: 100%;" scroll-y="true" class="container film-list" bindscroll="scroll"> | ||
<block wx:for-items="{{films}}" wx:for-item="film"> | ||
<view class="film-item" bindtap="viewDetail" data-id="{{film.id}}" data-title="{{film.title}}"> | ||
<view class="film-image"> | ||
<image src="{{film.images.medium}}"></image> | ||
</view> | ||
<view class="film-rating"> | ||
<block wx:if="{{film.rating.average > 0}}"> | ||
<text class="label">评分</text> | ||
<text class="rating">{{film.rating.average}}</text> | ||
<view class="film-info"> | ||
<view> | ||
<text class="film-title">{{film.title}}</text> | ||
<text class="film-year">{{film.year}}</text> | ||
</view> | ||
<view class="film-rating"> | ||
<block wx:if="{{film.rating.average > 0}}"> | ||
<text class="label">评分</text> | ||
<text class="rating">{{film.rating.average}}</text> | ||
</block> | ||
<block wx:else> | ||
<text class="label">暂无评分</text> | ||
</block> | ||
</view> | ||
<view class="directors"> | ||
<text class="label">导演</text> | ||
<block wx:for-items="{{film.directors}}" wx:for-item="director"> | ||
<text class="person">{{director.name}}</text> | ||
</block> | ||
</view> | ||
<view class="casts"> | ||
<text class="label">主演</text> | ||
<block wx:for-items="{{film.casts}}" wx:for-item="cast"> | ||
<text class="person">{{cast.name}}</text> | ||
</block> | ||
</view> | ||
</view> | ||
</view> | ||
</block> | ||
<view class="load-more-wrap"> | ||
<block wx:if="{{hasMore}}"> | ||
<block wx:if="{{loadMoreLoading}}"> | ||
<view class="load-content"> | ||
<text class="weui-loading"/><text class="loading-text">玩命加载中</text> | ||
</view> | ||
</block> | ||
<block wx:else> | ||
<text class="label">暂无评分</text> | ||
</block> | ||
</view> | ||
<view class="directors"> | ||
<text class="label">导演</text> | ||
<block wx:for-items="{{film.directors}}" wx:for-item="director"> | ||
<text class="person">{{director.name}}</text> | ||
<view class="btn-load-more" bindtap="loadMore"> | ||
<text>点击加载更多</text> | ||
</view> | ||
</block> | ||
</view> | ||
<view class="casts"> | ||
<text class="label">主演</text> | ||
<block wx:for-items="{{film.casts}}" wx:for-item="cast"> | ||
<text class="person">{{cast.name}}</text> | ||
</block> | ||
</view> | ||
</view> | ||
</view> | ||
</block> | ||
</scroll-view> | ||
</block> | ||
<block wx:else> | ||
<view class="load-content"> | ||
<text>没有更多内容了</text> | ||
</view> | ||
</block> | ||
</view> | ||
</scroll-view> | ||
</block> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.