Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fangkf committed Apr 20, 2019
1 parent 31aa1a0 commit 39a8b97
Show file tree
Hide file tree
Showing 17 changed files with 216 additions and 32 deletions.
27 changes: 25 additions & 2 deletions students/1714080903116/weixin/app.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
{
"pages": [
"pages/index/index",
"pages/logs/logs"
"pages/logs/logs",
"pages/mine/mine"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "西洋跳棋",
"navigationBarTitleText": "日程与随笔",
"navigationBarTextStyle": "black"
},
"tabBar": {
"list": [
{
"iconPath": "pages/images/home.jpg",
"selectedIconPath": "pages/images/home.jpg",
"pagePath": "pages/index/index",
"text": "首页"
},
{
"iconPath": "pages/images/richeng.jpg",
"selectedIconPath": "pages/images/richeng.jpg",
"pagePath": "pages/logs/logs",
"text": "日程"
},
{
"iconPath": "pages/images/suibi.jpg",
"selectedIconPath": "pages/images/suibi.jpg",
"pagePath": "pages/mine/mine",
"text": "随笔"
}
]
},
"sitemapLocation": "sitemap.json"
}
1 change: 1 addition & 0 deletions students/1714080903116/weixin/app.wxss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**app.wxss**/
@import "style/weui.wxss";
.container {
height: 100%;
display: flex;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion students/1714080903116/weixin/pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const app = getApp()

Page({
data: {
//motto: 'Hello World',
welcome: 'Hello WeChat Mini Program',
userInfo: {},
hasUserInfo: false,
canIUse: wx.canIUse('button.open-type.getUserInfo')
Expand Down
19 changes: 11 additions & 8 deletions students/1714080903116/weixin/pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<!--index.wxml-->
<view class="container">
<view class="test-bg">
<view class="userinfo">
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 开始游戏 </button>
<text>\n</text>
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 退出游戏 </button>
<button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
<block wx:else>
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
</block>
<view class="page__bd page__bd_spacing">

<view class="button-sp-area">
<button class="weui-btn" type="primary" plain="true">开始使用</button>

<button class="weui-btn" type="default" plain="true">退出使用</button>
</view>
</view>
</view>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
<view class="usermotto">
<text class="user-motto">{{welcome}}</text>
</view>

<image src="" class="bg-image" mode="scaleToFill"></image>
</view>
</view>
10 changes: 0 additions & 10 deletions students/1714080903116/weixin/pages/index/index.wxss
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
/**index.wxss**/
page{
width: 100%;
height: 100%;
}
.test-bg{
width: 100%;
height: 200%;
background-color: #70c7da;
}

.userinfo {
display: flex;
flex-direction: column;
Expand Down
27 changes: 21 additions & 6 deletions students/1714080903116/weixin/pages/logs/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,28 @@ const util = require('../../utils/util.js')

Page({
data: {
logs: []
inputShowed: false,
inputVal: ""
},
onLoad: function () {
showInput: function () {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
inputShowed: true
});
},
hideInput: function () {
this.setData({
inputVal: "",
inputShowed: false
});
},
clearInput: function () {
this.setData({
inputVal: ""
});
},
inputTyping: function (e) {
this.setData({
inputVal: e.detail.value
});
}
})
2 changes: 1 addition & 1 deletion students/1714080903116/weixin/pages/logs/logs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"navigationBarTitleText": "查看启动日志",
"navigationBarTitleText": "日程",
"usingComponents": {}
}
48 changes: 44 additions & 4 deletions students/1714080903116/weixin/pages/logs/logs.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
<!--logs.wxml-->
<view class="container log-list">
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
<view class="page">
<view class="page__hd">
<view class="page__desc">搜索日程</view>
</view>
<view class="page__bd">
<view class="weui-search-bar">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<icon class="weui-icon-search_in-box" type="search" size="14"></icon>
<input type="text" class="weui-search-bar__input" placeholder="搜索" value="{{inputVal}}" focus="{{inputShowed}}" bindinput="inputTyping" />
<view class="weui-icon-clear" wx:if="{{inputVal.length > 0}}" bindtap="clearInput">
<icon type="clear" size="14"></icon>
</view>
</view>
<label class="weui-search-bar__label" hidden="{{inputShowed}}" bindtap="showInput">
<icon class="weui-icon-search" type="search" size="14"></icon>
<view class="weui-search-bar__text">搜索</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消</view>
</view>
<view class="weui-cells searchbar-result" wx:if="{{inputVal.length > 0}}">
<navigator url="" class="weui-cell" hover-class="weui-cell_active">
<view class="weui-cell__bd">
<view>日程1</view>
</view>
</navigator>
<navigator url="" class="weui-cell" hover-class="weui-cell_active">
<view class="weui-cell__bd">
<view>日程2</view>
</view>
</navigator>
<navigator url="" class="weui-cell" hover-class="weui-cell_active">
<view class="weui-cell__bd">
<view>日程3</view>
</view>
</navigator>
<navigator url="" class="weui-cell" hover-class="weui-cell_active">
<view class="weui-cell__bd">
<view>日程4</view>
</view>
</navigator>
</view>
</view>
</view>
10 changes: 10 additions & 0 deletions students/1714080903116/weixin/pages/logs/logs.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@
.log-item {
margin: 10rpx;
}
.searchbar-result{
margin-top: 0;
font-size: 14px;
}
.searchbar-result:before{
display: none;
}
.weui-cell{
padding: 12px 15px 12px 35px;
}
66 changes: 66 additions & 0 deletions students/1714080903116/weixin/pages/mine/mine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// pages/mine/mine.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {

},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})
4 changes: 4 additions & 0 deletions students/1714080903116/weixin/pages/mine/mine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "随笔",
"usingComponents": {}
}
17 changes: 17 additions & 0 deletions students/1714080903116/weixin/pages/mine/mine.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--pages/mine/mine.wxml-->
<view class="page">
<view class="page__hd">
<view class="page__desc">随心染墨,下笔从心</view>
</view>
<view class="page__bd page__bd_spacing">

<view class="button-sp-area">
<button class="weui-btn" type="primary" plain="true">提笔</button>

<button class="weui-btn" type="default" plain="true">收墨</button>

<button class="weui-btn mini-btn" type="primary" size="mini">管理</button>
<button class="weui-btn mini-btn" type="default" size="mini">设置</button>
</view>
</view>
</view>
9 changes: 9 additions & 0 deletions students/1714080903116/weixin/pages/mine/mine.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* pages/mine/mine.wxss */
.button-sp-area{
margin: 0 auto;
padding-top: 15px;
width: 60%;
}
.mini-btn{
margin-right: 5px;
}
6 changes: 6 additions & 0 deletions students/1714080903116/weixin/style/weui.wxss

Large diffs are not rendered by default.

0 comments on commit 39a8b97

Please sign in to comment.