Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/组队信息.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//һ���ָ���
�˳���
����Դ
���Fݻ
���Ľ�
15 changes: 8 additions & 7 deletions src/app.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"pages":[
"pages/index/index",
"pages": [
"pages/logs/index",
"pages/logs/logs"
],
"window":{
"backgroundTextStyle":"light",
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
"navigationBarTitleText": "报名信息填写",
"navigationBarTextStyle": "black"
}
}

}
72 changes: 27 additions & 45 deletions src/pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,34 @@
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'
})


//确认按钮把数据上传后台
back_houtai: function (e) {
var that = this;
var total_score = e.detail.value.name;
var major_score = e.detail.value.idcard;
var enroll_date = e.detail.value.phone;
var self_intro = e.detail.value.self_intro;
console.log(name)
console.log(idcard)
console.log(phone)
console.log(self_intro)
},
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
})
}
})
}

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
getUserInfo: function(e) {
console.log(e)
app.globalData.userInfo = e.detail.userInfo
this.setData({
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}
})

})
4 changes: 1 addition & 3 deletions src/pages/index/index.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
"usingComponents": {}
}
{}
51 changes: 40 additions & 11 deletions src/pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,13 +1,42 @@
<!--index.wxml-->
<view class="container">
<view class="userinfo">
<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>
<view class="usermotto">
<text class="user-motto">{{motto}}</text>
</view>
<view class='index_seach'>

<form bindsubmit="back_houtai">

<view class='input_w professional'>
<text class='left'>姓名</text>
<view class='input left'>
<input placeholder='请输入姓名' cursor-spacing='20' name='name'></input>
</view>
</view>

<view class='input_w professional'>
<text class='left'>学号</text>
<view class='input left'>
<input placeholder='请输入正确的学号' cursor-spacing='20' name='idcard'></input>
</view>
</view>

<view class='input_w professional'>
<text class='left'>性别</text>
<radio-group>
<label><radio value='0'>男</radio></label>
<label><radio value='1'>女</radio></label>
</radio-group>
</view>

<view class='input_w professional'>
<text class='left'>手机号</text>
<view class='input left'>
<input placeholder='请输入正确的手机号' cursor-spacing='20' name='phone'></input>
</view>
</view>
<view class='textarea_w'>
<text class='left'>参与理由</text>
<view class='textarea left'>
<textarea placeholder='自由发挥' cursor-spacing='20' name="self_intro"></textarea>
</view>
</view>
<button class='subClass_btn2' formType="submit">申请提交</button>
</form>
</view>
89 changes: 76 additions & 13 deletions src/pages/index/index.wxss
Original file line number Diff line number Diff line change
@@ -1,21 +1,84 @@
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
page{
font-size: 30rpx;
}
.left{ float: left}
.right{float: right}
.index_seach {
width: 100%;
margin-top: 20rpx;
height: auto;
margin-bottom: 30rpx;
}
/* 表单类通用 表单类通用 表单类通用*/
.input_w {
width: 100%;
height: 90rpx;
line-height: 90rpx;
/* background: lightblue; */
}

.input_w text {
display: block;
width: 20%;
text-align: center;
/* background: red; */
}

.input_w .input {
width: 75%;
height: 70rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
box-sizing: border-box;
}

.input input {
margin-top: 10rpx;
margin-left: 10rpx;
/* background: lightblue; */
}

.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;

.textarea_w {
display: block;
width: 100%;
height: 180rpx;
overflow: hidden;
}

.textarea_w text {
display: block;
width: 20%;
text-align: center;
line-height: 90rpx;
}

.textarea {
width: 75%;
height: 140rpx;
margin-top: 10rpx;
border: 1px solid #ccc;
padding: 8rpx;
/* background: lightblue; */
overflow: hidden;
}

.userinfo-nickname {
color: #aaa;
.textarea textarea {
width: 100%;
height: 130rpx;
/* background: lightcoral; */
}

.usermotto {
margin-top: 200px;



.subClass_btn2 {
margin-top: 40rpx;
width: 80%;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
color: #fff;
background: #20bd03;
}
84 changes: 84 additions & 0 deletions src/pages/logs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
0// pages/logs/index.js
const app = getApp() //必写
Page({
data: {
list: {
id: 6,
name: '第四届微观摄影大赛',
publisher: '植物保护学院',
startTime: '2019-3-11 8:00:00',
endTime: '2019-3-22 8:00:00-22:00:00'
}
},

//事件处理函数
onLoad: function () {
var that = this
wx.request({
url: 'https://www.turing-cup.online/voteapp/activity',
method: 'GET',

header: {
'Content-Type': 'application/json'
},

success: function (res) {
that.setData({
list: res.Data,
})
},
fail: function (res) {
console.log(res.Data)
}
})
},

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

},

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

},

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

},

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

},

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

},

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

},

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

}
})
8 changes: 8 additions & 0 deletions src/pages/logs/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}
}
4 changes: 4 additions & 0 deletions src/pages/logs/index.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<navigator url="../logs/logs?id=1" view wx:for="{{list}}" wx:key="list">
<view class='title_style'>活动:{{item.name}}</view>
<view class='date_style'>主办方:{{item.publisher}}</view>
</navigator>
10 changes: 10 additions & 0 deletions src/pages/logs/index.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.title_style {
color: #000;
line-height: 40px;
}

.date_style {
color:blue;
font-size: 36rpx;
line-height: 20px;
}
Loading