微信小程序_简单页面
2016-12-16 15:44
267 查看
这篇文章主要是用微信小程序的一些基本组件,做了一个简单的页面来和小伙伴们一起分享,如果有问题欢迎留言。
先看下效果图:
js代码部分:
wxml代码部分:
wxss代码部分:
实例代码demo:
https://pan.baidu.com/s/1hrPJ4A4
感谢观看,学以致用更感谢~
先看下效果图:
js代码部分:
Page({ data: { names: [ '处置列表', '约诊', '消息', '顾客信息' ], navsText: [ '../appointment/appointment', '../customer/customer', '../disposalList/disposalList', '../message/message', ] }, //事件处理函数 changeMotto: function(btn) { //获取button的target下的id参数 var path; var num = btn.target.id; switch(num) { case '0': path = '../appointment/appointment' break; case '1': path = '../customer/customer' break; case '2': path = '../disposalList/disposalList' break; case '3': path = '../message/message' break; default: break; } wx.navigateTo({ // switch url: path }) } })
wxml代码部分:
<view class="downView"> <image class="topImage" src="/image/图片1.png"></image> <view class="nameBoard"> <block wx:for="{{names}}" wx:for-index="index" > <swiper-item> <button class="nameBoard-btn" bindtap="changeMotto" id="{{index}}"> <image class="nameBoard-image" src="/image/icon_API_HL.png"></image> <text class="nameBoard-text">{{item}}</text> </button> </swiper-item> </block> </view> </view>
wxss代码部分:
.topImage { width: 100%; } .nameBoard { display: flex; margin-right: 20rpx; margin-left: 20rpx; margin-top: 10rpx; } .nameBoard swiper-item{ flex: 1; margin: 10rpx; /*边框: 1的宽度 实线 颜色*/ border: 1rpx solid #98bf21; } .nameBoard-btn { line-height: 1; padding-left: 0; padding-right: 0; } .nameBoard-image{ margin-top: 20rpx; height: 84rpx; width: 84rpx; } .nameBoard-text{ display: block; font-size: 26rpx; margin-top: 20rpx; margin-bottom: 20rpx; /*文字居中*/ text-align:center; /*强制不换行*/ /*white-space: nowrap;*/ }
实例代码demo:
https://pan.baidu.com/s/1hrPJ4A4
感谢观看,学以致用更感谢~
相关文章推荐
- wsSearchView:一个简单方便的微信小程序搜索框页面组件
- 【代码】微信小程序 简单一个页面,网上图片展示
- 微信小程序入门-简单页面编写
- 微信小程序开发 -页面布局介绍- 附简单小程序实例(底部)
- 微信小程序--简单页面跳转
- 简单快速开发C\S架构程序用最简单的不分层最快的效率达到功能要求的例子程序FrmUserEdit 添加评论功能页面效果
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- 微信小程序简单demo
- [导入]AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- 在SharePoint页面嵌入简单的Silverlight程序
- 微信小程序(应用号)简单实例应用及实例详解
- 求助,C#开发微信怎么弄啊?我只要简单的自定义菜单和菜单所对应的页面就行
- 微信小程序简单教程
- 一个简单的下载html页面的程序
- 一个简单的用javascript实现的页面内容过滤显示小程序源码
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)
- AjaxPanel自定义控件实现页面无刷新数据交互(做了个示例程序, 效果确实比较Cool, 用法非常简单! )(示例代码下载)