-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from hzuzkt/master
- Loading branch information
Showing
22 changed files
with
349 additions
and
160 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,12 @@ | ||
{ | ||
"pages": [ | ||
"pages":[ | ||
"pages/index/index", | ||
"pages/logs/logs", | ||
"pages/comp/view", | ||
"pages/comp/scroll", | ||
"pages/comp/form", | ||
"pages/example/button/button", | ||
"pages/demo/scrollView", | ||
"pages/form/form" | ||
"pages/logs/logs" | ||
], | ||
"window": { | ||
"backgroundTextStyle": "light", | ||
"navigationBarBackgroundColor": "#000000", | ||
"navigationBarTitleText": "我的小程序", | ||
"navigationBarTextStyle": "white" | ||
}, | ||
"tabBar": { | ||
"color": "#000000", | ||
"selectedColor": "#009444", | ||
"list": [ | ||
{ | ||
"pagePath": "pages/index/index", | ||
"text": "首页" | ||
}, | ||
{ | ||
"pagePath": "pages/logs/logs", | ||
"text": "我" | ||
} | ||
] | ||
"window":{ | ||
"backgroundTextStyle":"light", | ||
"navigationBarBackgroundColor": "#fff", | ||
"navigationBarTitleText": "WeChat", | ||
"navigationBarTextStyle":"black" | ||
} | ||
} | ||
} |
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,7 +1,4 @@ | ||
/**app.wxss**/ | ||
@import 'style/weui.wxss'; | ||
|
||
/* . 表示 类 class */ | ||
.container { | ||
height: 100%; | ||
display: flex; | ||
|
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,30 +1,25 @@ | ||
<view class="page"> | ||
<view class="page__hd"> | ||
</view> | ||
<view class="page__bd"> | ||
<view class="weui-cells__title">组件示例</view> | ||
<view class="weui-cells weui-cells_after-title"> | ||
<navigator url="/pages/comp/view?" class="weui-cell weui-cell_access" hover-class="weui-cell_active"> | ||
<view class="weui-cell__hd"> | ||
<image src="../example/images/a.png" style="margin-right: 5px;vertical-align: middle;width:20px; height: 20px;"></image> | ||
</view> | ||
<view class="weui-cell__bd">view示例</view> | ||
<view class="weui-cell__ft weui-cell__ft_in-access">打开</view> | ||
</navigator> | ||
<navigator wx:if="{{showScroll}}" url="/pages/demo/scrollView" class="weui-cell weui-cell_access" hover-class="weui-cell_active"> | ||
<view class="weui-cell__hd"> | ||
<image src="{{icon}}" style="margin-right: 5px;vertical-align: middle;width:20px; height: 20px;"></image> | ||
</view> | ||
<view class="weui-cell__bd">scroll-view示例</view> | ||
<view class="weui-cell__ft weui-cell__ft_in-access">说明文字</view> | ||
</navigator> | ||
<navigator url="/pages/form/form" class="weui-cell weui-cell_access" hover-class="weui-cell_active"> | ||
<view class="weui-cell__hd"> | ||
<image src="{{icon}}" style="margin-right: 5px;vertical-align: middle;width:20px; height: 20px;"></image> | ||
</view> | ||
<view class="weui-cell__bd">form示例</view> | ||
<view class="weui-cell__ft weui-cell__ft_in-access">说明文字</view> | ||
</navigator> | ||
</view> | ||
</view> | ||
<view class="row"> | ||
|
||
<view class="row0"> | ||
<image src="../images/dog2.png" style="height:80px;width:80px;" id="dogimage" /> | ||
</view> | ||
<view class="row1"> | ||
<image src="../images/1.png" style="height:40px;width:40px;" id="image" /> | ||
<view id="sign_in"> sign in</view> | ||
</view> | ||
|
||
<view class="row2"> | ||
<view id="accounttext">account</view> | ||
<input id="account"/> | ||
</view> | ||
|
||
<view class="row3"> | ||
<view id="passwordtext">password</view> | ||
<input id="passwd"/> | ||
</view> | ||
|
||
<view class="row4"> | ||
<button id="confirmbutton"> Go</button> | ||
</view> | ||
|
||
</view> |
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,31 +1,79 @@ | ||
/**index.wxss**/ | ||
.userinfo { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
.row{ | ||
display:flex; | ||
flex-direction:column; | ||
align-items: center; | ||
margin-top:130px; | ||
} | ||
.row0{ | ||
|
||
.userinfo-avatar { | ||
width: 128rpx; | ||
height: 128rpx; | ||
margin: 20rpx; | ||
border-radius: 50%; | ||
height:90px; | ||
width:90px; | ||
background-color:#00ccff; | ||
border-radius: 120px; | ||
margin-bottom:50px; | ||
} | ||
|
||
.userinfo-nickname { | ||
color: blue; | ||
#dogimage{ | ||
margin-top:1px; | ||
margin-left:1px; | ||
border-radius: 70px; | ||
} | ||
|
||
.usermotto { | ||
margin-top: 20px; | ||
color: #009A89; | ||
text-decoration: underline; | ||
font-weight: bold; | ||
} | ||
.description { | ||
color: red; | ||
font-size: 18px; | ||
} | ||
.blue { | ||
color: blue; | ||
.row1{ | ||
height:40px; | ||
width:250px; | ||
background-color: greenyellow; | ||
} | ||
#image{ | ||
float:left; | ||
} | ||
#sign_in{ | ||
line-height: 40px; | ||
margin-left:110px; | ||
|
||
} | ||
.row2{ | ||
height:40px; | ||
width:250px; | ||
background-color: #cccccc; | ||
border-radius: 7px; | ||
margin-top:3px; | ||
} | ||
#accounttext{ | ||
float:left; | ||
margin-top:4px; | ||
} | ||
#account{ | ||
border:1px solid #003333; | ||
margin-top:4px; | ||
width:161px; | ||
margin-left:85px; | ||
border-radius: 3px; | ||
} | ||
.row3{ | ||
height:40px; | ||
width:250px; | ||
background-color: #cccccc; | ||
border-radius: 7px; | ||
margin-top:3px; | ||
} | ||
#passwordtext{ | ||
float:left; | ||
margin-top:4px; | ||
} | ||
#passwd{ | ||
border:1px solid #003333; | ||
margin-top:4px; | ||
width:146px; | ||
margin-left:100px; | ||
border-radius: 3px; | ||
} | ||
.row4{ | ||
height:40px; | ||
width:250px; | ||
margin-top:20px; | ||
} | ||
#confirmbutton{ | ||
height:35px; | ||
width:80px; | ||
line-height:35px; | ||
float:right; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//index.js | ||
//获取应用实例 | ||
const app = getApp() | ||
|
||
Page({ | ||
data: { | ||
background:[ | ||
'../images/1.jpg', | ||
'../images/2.jpg', | ||
'../images/3.jpg', | ||
'../images/4.jpg' | ||
] | ||
} | ||
|
||
}) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<view class="container"> | ||
|
||
|
||
<swiper indicator-dots="true" autoplay="true" interval="1000"> | ||
<view wx:for="{{background}}" wx-item="item"> | ||
<swiper-item> | ||
<image src="{{item}}" /> | ||
</swiper-item> | ||
</view> | ||
</swiper> | ||
|
||
</view> |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.container{ | ||
height:100%; | ||
width:100%; | ||
|
||
display:flex; | ||
align-items:center; | ||
margin-top:120px; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//index.js | ||
//获取应用实例 | ||
const app = getApp() | ||
|
||
Page({ | ||
|
||
data: { | ||
motto: 'Hello World', | ||
userInfo: {}, | ||
hasUserInfo: false, | ||
canIUse: wx.canIUse('button.open-type.getUserInfo'), | ||
}, | ||
//事件处理函数 | ||
bindViewTap: function() { | ||
wx.navigateTo({ | ||
url: '../logs/logs' | ||
}) | ||
}, | ||
onLoad: function () { | ||
if (app.globalData.userInfo) { | ||
this.setData({ | ||
userInfo: app.globalData.userInfo, | ||
hasUserInfo: true | ||
}) | ||
} else if (this.data.canIUse){ | ||
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 | ||
// 所以此处加入 callback 以防止这种情况 | ||
app.userInfoReadyCallback = res => { | ||
this.setData({ | ||
userInfo: res.userInfo, | ||
hasUserInfo: true | ||
}) | ||
} | ||
} else { | ||
// 在没有 open-type=getUserInfo 版本的兼容处理 | ||
wx.getUserInfo({ | ||
success: res => { | ||
app.globalData.userInfo = res.userInfo | ||
this.setData({ | ||
userInfo: res.userInfo, | ||
hasUserInfo: true | ||
}) | ||
} | ||
}) | ||
} | ||
}, | ||
getUserInfo: function(e) { | ||
console.log(e) | ||
app.globalData.userInfo = e.detail.userInfo | ||
this.setData({ | ||
userInfo: e.detail.userInfo, | ||
hasUserInfo: true | ||
}) | ||
} | ||
}) |
Oops, something went wrong.