Skip to content

Commit

Permalink
加入新的朋友板块,附带基于weui改的实时搜索框简易demo,加入了picker和switch的示例,加入查看系统信息
Browse files Browse the repository at this point in the history
  • Loading branch information
liujians committed Oct 11, 2016
1 parent 42eba3b commit 36e70ef
Show file tree
Hide file tree
Showing 16 changed files with 307 additions and 39 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,45 @@
weApp for wechat
<hr/>

###注意:
- 10月08日之后的版本被我分离成了服务端和客户端2个demo
- 如果想要继续留有之前静态demo的请备份
<br/>
- server 部分为单独一个项目,装载着此项目需要的数据,需要下载跑起来才能运行此项目
<br/>
- 项目链接:
> [https://github.com/liujians/WeApp-server](https://github.com/liujians/WeApp-server)

跑起服务器之后,在app.js中设置自己的Ip地址
<br/>
![image](https://github.com/liujians/WeApp/blob/master/ipconfig.png)
###作者声明:
基于微信小程序开发的**仿微信demo**
<br/>
不定期更新中...
整合了ionic的样式库和weui的样式库(ionic的样式库跟自带的播放器组件有点冲突)
<br/>


目前功能

查看消息
微信地图
发送图片
查看朋友圈
查看系统信息
新的朋友

<br/>
目前每天更新中...
<br/>
欢迎一起学习交流
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=9bcf9f7be59b471456c1feec466dab4d54da7ab35c834b8e821ec17177fb33b3"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="前端群居所" title="前端群居所"></a>

<br/>
为学习微信小程序而开发,转发请附地址
> [https://github.com/liujians/WeApp](https://github.com/liujians/WeApp)
###运行必读:
- 10月08日之后的版本被我分离成了服务端和客户端2个demo
- 如果想要继续留有之前静态demo的请备份
<br/>
- server 部分为单独一个项目,装载着此项目需要的数据,需要下载跑起来才能运行此项目
<br/>
- 项目链接:
> [https://github.com/liujians/WeApp-server](https://github.com/liujians/WeApp-server)
###项目目标:
1. 界面相似度要高(练习它的布局)
2. 聊天列表,查看对话内容
3. 相关小应用API的使用(例:音乐、相册、视频)
跑起服务器之后,在app.js中设置自己的Ip地址
<br/>
![image](https://github.com/liujians/WeApp/blob/master/ipconfig.png)

###项目历程:
- 9月29日——初步架构搭建完成,四个tab页,一张效果图
- 9月30日——加入聊天界面,聊天界面基本数据,聊天头像绑定,新效果图
- 10月09日——项目分离(详情查看server项目),消息界面美化,消息面板菜单,加入图片选择功能
- 10月10日——新加入朋友圈模块布局,数据从示例服务端获取,聊条界面加入位置,读取消息mark清零

###项目展示:
![image](https://github.com/liujians/WeApp/blob/master/GIF.gif)
Expand All @@ -44,11 +49,6 @@ weApp for wechat
> 克隆本项目 -> 在微信开发工具中添加项目 -> 选择项目目录
###相关资源:
- [weapp-ide-crack](https://github.com/gavinkwoe/weapp-ide-crack/blob/master/README.md) - 微信小应用资源破解
- [weapp-ide&weapp-api](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1474632113_xQVCl&token=&lang=zh_CN) - 微信小应用官方IDE和官方文档
- [WeApp-server](https://github.com/liujians/WeApp-server) - 项目的server示例服务器



###感谢:
- 张佳音小朋友提供的icon图标

2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ App({
},
globalData:{
userInfo:null,
ip:"http://"+"192.168.1.104"+":8999"
ip:"http://"+"192.168.1.106"+":8999"
}
})
9 changes: 4 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"pages": [



"pages": [
"pages/wechat/wechat",
"pages/note/note",
"pages/find/find",
"pages/mine/mine",
"pages/message/message",
"pages/audio/audio",
"pages/moments/moments",
"pages/info/info",
"pages/info/info",
"pages/newfriend/newfriend",
"pages/picker/picker",
"pages/index/index",
"pages/logs/logs"
],
Expand Down
5 changes: 4 additions & 1 deletion pages/audio/audio.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<scroll-view scroll-y="true">
<view class="padding">
<text>播放器示例</text>
<text>播放器示例(样式被ionic干扰,可以注释掉引入的ionic再刷新)</text>
</view>
<view>
<audio class="flex-center" src="{{src}}" poster="{{poster}}" name="{{name}}" author="{{author}}" action="{{audioAction}}" controls></audio>
Expand All @@ -9,4 +9,7 @@
<button type="primary" bindtap="audioPause">暂停</button>
</view>-->
</view>
<view class="section tc">
<video src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400" binderror="videoErrorCallback"></video>
</view>
</scroll-view>
5 changes: 3 additions & 2 deletions pages/mine/mine.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Page({
},
{
img:"../../image/card.png",
name:"卡包"
name:"卡包(picker&switch)",
url:"../picker/picker"
}
]
},
Expand All @@ -36,7 +37,7 @@ Page({
},
{
img:"../../image/setting.png",
name:"设置",
name:"设置(系统信息)",
url:"../info/info"
}
]
Expand Down
101 changes: 101 additions & 0 deletions pages/newfriend/newfriend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Page({
data:{
// text:"这是一个页面"
list:[
{
img:"/image/adam.jpg",
name:"王浩",
message:"你好",
type:true,
id:"1"
},
{
img:"/image/ben.png",
name:"成凤杰",
message:"我是成凤杰",
type:true,
id:"2"
},
{
img:"/image/max.png",
name:"梁雨",
message:"加个好友",
type:true,
id:"3"
},
{
img:"/image/mike.png",
name:"廖芳樱",
message:"+++++",
type:true,
id:"4"
},
{
img:"/image/perry.png",
name:"邓福滨",
message:"...",
type:true,
id:"5"
}
],
textList:[
{
text:"实时搜索文本"
},
{
text:"不像angular有过滤器"
},
{
text:"只能从服务端过滤"
}
],
type:true,
inputValue: ''
},
onLoad:function(options){
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
},
onHide:function(){
// 页面隐藏
},
onUnload:function(){
// 页面关闭
},
goPage:function(e){
// console.log(e.currentTarget.dataset.index)
// console.log(e.target.dataset.name)
wx.navigateTo({
url: '../message/message?name='+e.currentTarget.dataset.name+"&id="+e.currentTarget.dataset.id
})
// console.log(test);
},
inputFun:function(e){
var _self = this;
console.log(e);
if(e.detail.cursor){
_self.setData({
type:false
})
}else{
_self.setData({
type:true
})
}
},
inputclear:function(e){
// e.detail={
// cursor:0,
// value:""
// }
// var _self = this;
// _self.setData({
// inputValue: ''
// })
}
})
3 changes: 3 additions & 0 deletions pages/newfriend/newfriend.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "新的朋友"
}
40 changes: 40 additions & 0 deletions pages/newfriend/newfriend.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<scroll-view>
<view class="weui-search-bar weui-search-bar_focusing" id="search_bar">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<text class="weui-icon-search"></text>
<input type="text" class="weui-search-bar__input" id="search_input" placeholder="搜索" bindinput="inputFun" bindblur="inputclear" value="{{inputValue}}"/>
<text class="weui-icon-clear" id="search_clear"></text>
</view>
<view for="search_input" class="weui-search-bar__label" id="search_text">
<text class="weui-icon-search"></text>
<text>搜索</text>
</view>
</view>
<!--<text class="weui-search-bar__cancel-btn" id="search_cancel" bindtap="inputclear">取消</text>-->
</view>
<view class="weui-cells weui-cells_access search_show" hidden="{{type}}" id="search_show">
<view class="weui-cell" wx:for="{{textList}}" wx:for-item="i">
<view class="weui-cell__bd weui-cell_primary">
<text>{{i.text}}</text>
</view>
</view>

</view>
<view class="item-avatar-md" wx:for="{{list}}" wx:for-item="i" data-name="{{i.name}}" data-id="{{i.id}}" bindtap="goPage">
<image src="{{i.img}}"></image>
<view class="item-text">
<view class="text_box">
<view class="flex">
<text class="title">{{i.name}}</text>
</view>
<view class="flex" style="color:#3ccccc">
<text class="message">{{i.message}}</text>
</view>
</view>
</view>
<view class="item-time padding_half" style="color:#3ccccc">
<text class="message">{{i.type?"已添加":"未添加"}}</text>
</view>
</view>
</scroll-view>
6 changes: 6 additions & 0 deletions pages/newfriend/newfriend.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.weui-cells_access{
position:fixed;
width: 100%;
z-index:999;
margin-top: 0;
}
9 changes: 8 additions & 1 deletion pages/note/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Page({
list_tool:[
{
img:"../../image/newFriend.png",
name:"新的朋友"
name:"新的朋友",
url:"../newfriend/newfriend"
},
{
img:"../../image/friends.png",
Expand Down Expand Up @@ -63,5 +64,11 @@ Page({
]
}
]
},
goPage:function(e){
var url = e.currentTarget.dataset.url;
wx.navigateTo({
url: url
})
}
})
2 changes: 1 addition & 1 deletion pages/note/note.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view class="graySpace" wx:if="{{item.text}}">
<text>{{item.text}}</text>
</view>
<view class="item-avatar-sm" wx:for="{{item.list_tool}}" wx:for-item="i">
<view class="item-avatar-sm" wx:for="{{item.list_tool}}" wx:for-item="i" data-url="{{i.url}}" bindtap="goPage">
<image src="{{i.img}}" />
<view class="padding_half">
<text class="title">{{i.name}}</text>
Expand Down
45 changes: 45 additions & 0 deletions pages/picker/picker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Page({
data: {
array: ['美国', '中国', '巴西', '日本'],
index: 0,
date: '2016-09-01',
time: '12:01'
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
index: e.detail.value
})
},
bindDateChange: function(e) {
this.setData({
date: e.detail.value
})
},
bindTimeChange: function(e) {
this.setData({
time: e.detail.value
})
},
switch1Change: function (e){
console.log('switch1 发生 change 事件,携带值为', e.detail.value)
},
switch2Change: function (e){
console.log('switch2 发生 change 事件,携带值为', e.detail.value)
},
onLoad:function(options){
// 页面初始化 options为页面跳转所带来的参数
},
onReady:function(){
// 页面渲染完成
},
onShow:function(){
// 页面显示
},
onHide:function(){
// 页面隐藏
},
onUnload:function(){
// 页面关闭
}
})
3 changes: 3 additions & 0 deletions pages/picker/picker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "选择器"
}
Loading

0 comments on commit 36e70ef

Please sign in to comment.