首页 > 小程序教程 > 微信小程序V2EX社区帖子发布页设计制作开发教程

微信小程序V2EX社区帖子发布页设计制作开发教程

上一篇 下一篇
本文给大家带来的是微信小程序V2EX社区帖子发布页设计制作开发教程,制作好以后效果图如下:
一、wxml页面代码如下:
<include src="/components/header.wxml" />

<view class="container">
  <view class="commentbox">
    <view>你在想什么?
      <text>{{words}}</text>
    </view>
    <form>
      <textarea maxlength="500" disabled="{{inputDisabled}}" bindinput="countWords"></textarea>
      <button>发布</button>
    </form>
  </view>
  <view class="timeline">
    <view class="tab-bar">
      <text id="timeline" bindtap="toggleBar" class="{{isTimeLine ? 'active' : ''}}">TimeLine</text>
      <text id="mentions" bindtap="toggleBar" class="{{isTimeLine ? '' : 'active'}}">Mentions</text>
    </view>
    <navigator>浏览时间轴更多内容</navigator>
  </view>
</view>

<include src="/components/footer.wxml" />
 
二、wxss样式文件代码如下:
/*******容器********/
.container {
  display: flex;
  flex-direction: column;
  width: 95%;
  margin: 0 auto;
}

.container > view {
  margin-bottom: 15rpx;
  border-radius: 10rpx;
  background-color: #fefefe;
  box-shadow: 2px 2px 3px #00343f;
}
/*******容器********/

/*******评论框******/
.commentbox > view{
  display: flex;
  justify-content: space-between;
  color: #999;
  font-size: 23rpx;
  padding: 10rpx;
}

.commentbox textarea{
  width: 100%;
  border-top: 1px solid #999;
  border-bottom: 1px solid #999;
  background-color: #eee;
  padding: 20rpx;
  box-sizing: border-box;
}

.commentbox button {
  font-size: 28rpx;
  font-weight: bold;
}
/*******评论框******/

/*******时间线********/
.tab-bar{
  border-bottom: 1px solid #999;
  padding: 10rpx;
}

.tab-bar text{
  margin: 0 10rpx;
  font-size: 26rpx;
  padding: 5rpx 10rpx;
  border-radius: 5rpx;
}

.tab-bar text.active{
  background-color: #00343f;
  color: #f2efe6;
}

.timeline navigator{
  padding: 10rpx;
  display: flex;
  justify-content: flex-end;
  font-size: 25rpx;
}

.timeline navigator::after{
  content: '➤'
}
/*******时间线********/
三、js页面代码如下:
Page({
  data:{
    words: 500,
    isTimeLine: true,
    inputDisabled: false
  },
  toggleBar(e) {
    if (e.target.id === 'timeline') {
      this.setData({ isTimeLine: true })
    } else {
      this.setData({ isTimeLine: false })
    }
  },
  countWords(e) {
    let wordsLen = e.detail.value.length
    this.setData({ words: 500 - wordsLen })
  }
})

模板简介:该模板名称为【微信小程序V2EX社区帖子发布页设计制作开发教程】,大小是,文档格式为.,推荐使用打开,作品中的图片,文字等数据均可修改,图片请在作品中选中图片替换即可,文字修改直接点击文字修改即可,您也可以新增或修改作品中的内容,该模板来自用户分享,如有侵权行为请联系网站客服处理。欢迎来懒人模板【小程序教程】栏目查找您需要的精美模板。

相关搜索
  • 下载密码 lanrenmb
  • 下载次数 25,670次
  • 使用软件
  • 文件格式
  • 文件大小
  • 上传时间 07-23
  • 作者 网友投稿
  • 肖像权 人物画像及字体仅供参考
栏目分类 更多 >
热门推荐 更多 >
微信模板 html5 自适应 响应式 微信图片 微信文章 微信公众平台 企业网站 单页式简历模板 微信素材
您可能会喜欢的其他模板