@ -0,0 +1,82 @@ | |||||
// Pages/HGBot/Vote/Vote.js | |||||
Page({ | |||||
/** | |||||
* 页面的初始数据 | |||||
*/ | |||||
data: { | |||||
userName:"洗后提", | |||||
array:[1,2] | |||||
}, | |||||
onOK: function(){ | |||||
wx.redirectTo({ | |||||
url: '/Pages/HGBot/Home/Home', | |||||
}) | |||||
//sumbit到后台保存 | |||||
}, | |||||
onAdd: function(){ | |||||
const length = this.data.array.length | |||||
this.data.array = this.data.array.concat([length + 1]) | |||||
this.setData({ | |||||
array:this.data.array | |||||
}) | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面加载 | |||||
*/ | |||||
onLoad: function (options) { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面初次渲染完成 | |||||
*/ | |||||
onReady: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面显示 | |||||
*/ | |||||
onShow: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面隐藏 | |||||
*/ | |||||
onHide: function () { | |||||
}, | |||||
/** | |||||
* 生命周期函数--监听页面卸载 | |||||
*/ | |||||
onUnload: function () { | |||||
}, | |||||
/** | |||||
* 页面相关事件处理函数--监听用户下拉动作 | |||||
*/ | |||||
onPullDownRefresh: function () { | |||||
}, | |||||
/** | |||||
* 页面上拉触底事件的处理函数 | |||||
*/ | |||||
onReachBottom: function () { | |||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
} | |||||
}) |
@ -0,0 +1,3 @@ | |||||
{ | |||||
"usingComponents": {} | |||||
} |
@ -0,0 +1,33 @@ | |||||
<!--Pages/HGBot/Vote/Vote.wxml--> | |||||
<!--TODO: 添加input后,下方元素向下平移--> | |||||
<view class="ques"> | |||||
<view> {{userName}} 想要我帮忙</view> | |||||
<view style="padding: 0;margin: 0;height: 25px;"></view> | |||||
<view> 统计投票结果吗?</view> | |||||
</view> | |||||
<view class="sent"> | |||||
憨憨,总之先给我几个选项吧! | |||||
</view> | |||||
<view style="display: block;"> | |||||
<view class="choice"> | |||||
<view style="display: flex; margin-bottom: 15px;text-align: center;" wx:for="{{array}}" wx:key="*this"> | |||||
{{item}} 、 | |||||
<input id="{{item}}" type="text" style="height: 28px;width: 200px;" confirm-type="next" placeholder="_________________________________" bindinput="getInput" /> | |||||
</view> | |||||
</view> | |||||
<view class="add"> | |||||
<button bindtap="onAdd"> | |||||
<image src="../../../../asset/img/icon-add.png" style="align-items: center;"></image> | |||||
</button> | |||||
</view> | |||||
<view> | |||||
<button class="button" bindtap="onOK">好了</button> | |||||
</view> | |||||
<view class="hg"> | |||||
<image src="../../../../asset/img/hangou1.png" mode="heightFix"></image> | |||||
</view> | |||||
</view> |
@ -0,0 +1,75 @@ | |||||
/* Pages/HGBot/Vote/Vote.wxss */ | |||||
@import "/Pages/HGBot/Home/Home.wxss"; | |||||
.ques{ | |||||
margin-top: 15%; | |||||
font-size: 22px; | |||||
text-align: center; | |||||
justify-self: center; | |||||
align-items: center; | |||||
color: #000; | |||||
} | |||||
.sent{ | |||||
padding: 10px; | |||||
margin-top: 20px; | |||||
margin-left: 5%; | |||||
font-size: 22px; | |||||
text-align: center; | |||||
color: #000; | |||||
} | |||||
.choice{ | |||||
padding: 10px; | |||||
font-size: 23px; | |||||
align-items: center; | |||||
justify-content: center; | |||||
margin-left: 20%; | |||||
color: #000; | |||||
} | |||||
.add{ | |||||
display: flex; | |||||
padding-left: 20%; | |||||
margin-left: 5px; | |||||
} | |||||
.add button{ | |||||
color: #d8caaf; | |||||
padding: 0; | |||||
margin: 0; | |||||
background-color: inherit; | |||||
} | |||||
.add button:after{ | |||||
content: 0; | |||||
} | |||||
.add button::after{ | |||||
border: 0; | |||||
} | |||||
.add image{ | |||||
width: 23.25px; | |||||
height:23.25px; | |||||
} | |||||
.button{ | |||||
display:flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
width: 102px; | |||||
height: 42px; | |||||
background: #d8caaf; | |||||
font-size: 22px; | |||||
text-align: center; | |||||
color: #000; | |||||
} | |||||
.hg{ | |||||
position: sticky; | |||||
align-items: center; | |||||
justify-content: center; | |||||
text-align: center; | |||||
padding-top: 20px; | |||||
} |