Skip to content

Commit

Permalink
Merge pull request #718 from KuhnHuge/master
Browse files Browse the repository at this point in the history
#6 #47  实验6+README.md
  • Loading branch information
zengsn authored Jan 10, 2018
2 parents 105fecf + 0730a34 commit a87b770
Show file tree
Hide file tree
Showing 36 changed files with 477 additions and 263 deletions.
26 changes: 26 additions & 0 deletions 1514080901236/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 实验分组

## 二维码:
![image](https://github.com/KuhnHuge/web-wechat-2017/blob/master/1514080901236/%E6%8D%95%E8%8E%B76.PNG)

## 说明:
在现有分组中加入分组事件,然后加入其中的分组就可以实现分组。

## 页面设计:
首页是已加入的分组。

第二页是已有的分组。

第三页是反馈。


## 主要截图
### 首页
![image](https://github.com/KuhnHuge/web-wechat-2017/blob/master/1514080901236/%E6%8D%95%E8%8E%B7.PNG)

### 第二页
![image](https://github.com/KuhnHuge/web-wechat-2017/blob/master/1514080901236/%E6%8D%95%E8%8E%B72.PNG)
![image](https://github.com/KuhnHuge/web-wechat-2017/blob/master/1514080901236/%E6%8D%95%E8%8E%B75.PNG)

### 反馈界面
![image](https://github.com/KuhnHuge/web-wechat-2017/blob/master/1514080901236/%E6%8D%95%E8%8E%B73.PNG)
19 changes: 13 additions & 6 deletions 1514080901236/实验分组/app.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"pages":[
"pages/index/index",
"pages/logs/logs",
"pages/list/list"
"pages/list/list",
"pages/feedback/feedback",
"pages/button/button"
],
"window":{
"backgroundTextStyle":"light",
Expand All @@ -11,23 +12,29 @@
"navigationBarTextStyle":"black"
}
,"tabBar":{
"color": "#a9b7b7"
,"selectedColor":"eb4f38"
"color": "#9a9a9a"
,"selectedColor":"333333"
,"borderStyle": "white"
,"backgroundColor": "#ffffff"
,"list":[
{
"pagePath":"pages/index/index"
,"text":"index"
,"text":"我的分组"
,"iconPath":"images/自己的.png"
,"selectedIconPath":"images/自己的2.png"

}
,{
"pagePath":"pages/list/list"
,"text":"分组列表"
,"iconPath": "images/列表.png"
,"selectedIconPath": "images/列表2.png"
}
,{
"pagePath":"pages/from/from"
"pagePath":"pages/feedback/feedback"
,"text":"个人"
,"iconPath": "images/自己.png"
,"selectedIconPath": "images/自己2.png"
}
]
}
Expand Down
Binary file added 1514080901236/实验分组/images/列表.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/列表2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/加.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/头像1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/头像2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/头像3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/自己.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/自己2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/自己的.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 1514080901236/实验分组/images/自己的2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions 1514080901236/实验分组/pages/button/button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
const app = getApp()
Page({
onLoad: function (options) {
var GroupKey = options.GroupKey
console.log(GroupKey)
if(GroupKey=="2"||GroupKey=="4")
{
this.setData({
button_status: !this.data.primary,
text: "已加入",
num: "21",
})
}
wx.showModal({
title: '提示',
content: '这是一个模态弹窗,Key=' + GroupKey,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
}
}
})
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
})
}
})
}
}
,
data:{
button_status:"primary",
text:"加入",
detail: "4人一组",
num:"20",
group_1:[
{ name: "小明", key: "1" }, { name: "王强", key: "2" }, { name: "小可", key: "3"}
]
}

,
join:function(e){
var ddd;
this.setData({
button_status: !this.data.primary,
text:"已加入" ,
num:"21",
})
wx.showModal({
title: '提示',
content: '这是一个假的已加入',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
}
}
})
try {
wx.setStorageSync('userin', 'userin')
} catch (e) {
}
}
,
getUserInfo: function (e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}

});
1 change: 1 addition & 0 deletions 1514080901236/实验分组/pages/button/button.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
24 changes: 24 additions & 0 deletions 1514080901236/实验分组/pages/button/button.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<view class="page">
<view class="page__bd page__bd_spacing">
<view class="button-sp-area">
<button class="weui-btn" type="{{button_status}}" plain="true" bindtap='join'>{{text}}</button>
<view class='num'>当前人数:{{num}}
</view>
</view>
<view class="details">
{{detail}}
</view>
<view class='group'>
<block wx:for="{{group_1}}" wx:key="*this">
<view class='pepole_list'>
<image class='id_image' src='../../images/头像{{item.key}}.jpg'></image>
<view class='namelist'>{{item.name}}</view>
</view>
</block>
<view class='pepole_list'>
<image class='id_image' src='../../images/加.png'></image>
<view class='namelist'>{{onname}}</view>
</view>
</view>
</view>
</view>
47 changes: 47 additions & 0 deletions 1514080901236/实验分组/pages/button/button.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.button-sp-area{
margin: 0 auto;
padding-top: 15px;
width: 90%;
}
.mini-btn{
margin-right: 5px;
}
.num{
font-size: 15px;
float: right;
}
.details{
clear: both;
width: 90%;
margin: 0 auto;
padding-bottom: 5px;
border-bottom:solid 1px #777 ;
}
.id_image{
width: 40px;
height: 40px;
float: left;
margin-right: 8px;
border-radius: 50%;
}
.namelist{
float: left;
}
.group{
width: 90%;
margin: 20px 0 0 5%;
border: solid 1px #777;
float: left;
border-radius: 2px;
}
.pepole_list{
float: left;
width: 90%;
margin: 7px 5% 7px 5%;
padding: 2px 0 2px 0;
border-bottom: solid 1px #777;
}
block{
width: 100%;
float: left;
}
62 changes: 62 additions & 0 deletions 1514080901236/实验分组/pages/feedback/feedback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
//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'
})
},
submit_1: function (e) {
wx.showToast({
title: "提交成功"
});
},
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
})
}


})
4 changes: 4 additions & 0 deletions 1514080901236/实验分组/pages/feedback/feedback.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "用户反馈",
"enablePullDownRefresh":false
}
12 changes: 12 additions & 0 deletions 1514080901236/实验分组/pages/feedback/feedback.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<view class="container">
<view class='row text_box'>
<textarea class='text' name="content" value="{{content}}" placeholder="请输入您的反馈" />
</view>
<view class='row btn_box'>
<button bindtap="submit_1" class='submit'>提交反馈</button>
</view>
<view class='row version'>
<view class='txt'>版本1.0</view>
</view>
</view>
49 changes: 49 additions & 0 deletions 1514080901236/实验分组/pages/feedback/feedback.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

page{
height: 100%;
}
.container{
height: 100%;
flex-flow:column nowrap;
align-items:center;
justify-content: center;
}
.container .row{
width: 100%;
}

.text{
width: 90%;
height: 400rpx;
flex-shrink:1;
margin: 0 auto;
border-radius: 10rpx;
color: #999;
font-size: 14px;
padding: 10px;
background: #ffffff;
box-sizing: border-box;
}
.btn_box{
margin-top: 100rpx;
}
.submit{
width: 180px;
background: #444;
border: none;
color: #fff;
font-size: 16px;
margin-top: 20px;
}
.version{
margin-top: 100rpx;
}
.version .txt{
text-align: center;
font-size: 14px;
color: #999;
}
.text_box{
border: solid 1px #bbb;
border-radius: 3px;
}
Loading

0 comments on commit a87b770

Please sign in to comment.