小程序?qū)崿F(xiàn)留言板
更新時間:2018年11月02日 08:33:27 作者:煥想
這篇文章主要為大家詳細介紹了微信小程序?qū)崿F(xiàn)留言板,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了小程序?qū)崿F(xiàn)留言板的具體代碼,供大家參考,具體內(nèi)容如下
wxml
<view class='section'> <textarea class='message1' type='text' placeholder="請選擇或者輸入捎話(60字以內(nèi))" maxlength='80' style="word- wrap:break-word" onfocus="this.blur()" bindtap=''></textarea> </view> <view class='fast'>快速捎話:{{neirong}}</view> <view class="item" wx:for="{{msgData}}" wx:key="{{index}}"> <view class='circle'></view> <text data-nr='{{item.msg}}' class='message_font' bindtap='clickMe'>{{item.msg}}</text> </view> <button class='submit'>捎話</button>
index.js
var nr = ''; Page({ /** * 頁面的初始數(shù)據(jù) */ data: { msgData: [ { msg: "泡澡水不要太熱。" },//雙引號 { msg: "面部比較干,想補個水。" }, { msg: "我只有2小時,您看著安排吧。" }, { msg: "我想把眉毛在修下。" }, { msg: "給我清個痘痘。" }, { msg: "頭疼,能輕點按。" } ], neirong: '', }, clickMe: function (e) { var that = this; console.log(e); nr = e.currentTarget.dataset.nr; that.setData({ neirong: nr }) }, /** * 生命周期函數(shù)--監(jiān)聽頁面加載 */ onLoad: function (options) { }, /** * 生命周期函數(shù)--監(jiān)聽頁面初次渲染完成 */ onReady: function () { }, /** * 生命周期函數(shù)--監(jiān)聽頁面顯示 */ onShow: function () { }, /** * 生命周期函數(shù)--監(jiān)聽頁面隱藏 */ onHide: function () { }, /** * 生命周期函數(shù)--監(jiān)聽頁面卸載 */ onUnload: function () { }, /** * 頁面相關(guān)事件處理函數(shù)--監(jiān)聽用戶下拉動作 */ onPullDownRefresh: function () { }, /** * 頁面上拉觸底事件的處理函數(shù) */ onReachBottom: function () { }, /** * 用戶點擊右上角分享 */ onShareAppMessage: function () { } })
wx.css
/*捎話wx.css */ .section{ width:96%; height:220rpx; margin-left:5px; } .message1{ width:96%; height:210rpx; margin-top: 30rpx; font-size: 90%; margin-left:20px; } .circle{ height:35rpx; width:35rpx; border-radius: 50%; border: 1px solid #ccc; display:inline-block; margin:28rpx 45rpx auto 50rpx; } .fast{ position:relative; top:-50rpx; font-size:90%; background:#f4f4f4; line-height:100rpx; text-indent:2em; } .item{ position:relative; border-bottom:1px solid #f4f4f4; padding-bottom:10px; top: -60rpx; } .message_font{ font-size:80%; font-family:"微軟雅黑"; font-weight:blod; display:inline-block; position:relative; top:-5rpx; } .submit{ width:100%; height: 100rpx; background: #fed1d6; position: relative; top:168rpx; line-height: 100rpx; } button::after{ border:none; }
但是上面的textarea還可以自由去編寫,但是想實現(xiàn)在快速留言后面,再添加內(nèi)容
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
JavaScript與Java正則表達式寫法的區(qū)別介紹
這篇文章主要介紹了JavaScript與Java正則表達式寫法的區(qū)別介紹,需要的朋友可以參考下2017-08-08關(guān)于ES6尾調(diào)用優(yōu)化的使用
這篇文章主要介紹了關(guān)于ES6尾調(diào)用優(yōu)化的使用,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-09-09Layui表格行內(nèi)動態(tài)編輯數(shù)據(jù)
本文主要介紹經(jīng)典前端框架 layui 中的動態(tài)表格數(shù)據(jù)操作,結(jié)合 JQuery 動態(tài)編輯單元格中的數(shù)據(jù),具有一定的參考價值,感興趣的可以了解一下2021-08-08微信小程序?qū)崿F(xiàn)圖片上傳功能實例(前端+PHP后端)
這篇文章主要給大家介紹了關(guān)于微信小程序?qū)崿F(xiàn)圖片上傳功能的相關(guān)內(nèi)容,文中詳細介紹了前端+PHP后端的示例代碼,對大家的理解和學習具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧。2018-01-01