摘要: wxml 1 <view bindtap="uploadImage">请上传图片</view> 2 <view class="container"> 3 <image wx:for="{{imageList}}" src="{{item}}"</image> 4 </view> js data: { 阅读全文
posted @ 2020-05-11 14:07 南啾 阅读(145) 评论(0) 推荐(0) 编辑
摘要: wxml <text>商品列表</text> <view> <view wx:for="{{dataList}}">{{index}}-{{item}}</view> <view wx:for="{{dataList}}" wx:for-index="idx" wx:for-item="x">{{i 阅读全文
posted @ 2020-05-11 13:24 南啾 阅读(174) 评论(0) 推荐(0) 编辑
摘要: wxml <button open-type="getUserInfo" bindgetuserinfo="fetchInfo">获取位置</button> <view bindtap="getLocalPath">{{localPath}}</view> js data: { "localPath 阅读全文
posted @ 2020-05-11 12:26 南啾 阅读(427) 评论(0) 推荐(0) 编辑
摘要: 方式一 wxml <view bindtap="getUserName">获取当前用户名</view> js getUserName:function(){ //调用微信提供的接口获取用户信息 wx.getUserInfo({ success:function(res){ //调用成功后触发 }, 阅读全文
posted @ 2020-05-11 12:09 南啾 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 一、对标签绑定点击事件 在wxml文件中绑定事件名称及需要传的参数 <view bindtap="clickMe" data-id="1" data-name="csk">点我</view> 在wxjs文件中添加函数 Page({ ... clickMe:function(e){ var nid = 阅读全文
posted @ 2020-05-11 10:50 南啾 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 一、搭建环境 二、全局配置 pages window tabbar 三、页面 json js wxml wxss 四、flex布局 display:flex; flex-direction:row/column; justify-content: align-item: 五、小程序开发 1)组件(标 阅读全文
posted @ 2020-05-11 10:20 南啾 阅读(138) 评论(0) 推荐(0) 编辑
摘要: flex布局:一种非常方便的布局 常用以下4个样式: { //设置flex布局 display: flex; // flex-direction表示规定主轴的方向 flex-direction: row; // row 规定主轴方向为水平 // column 规定主轴方向为垂直 //元素在主轴方向的 阅读全文
posted @ 2020-05-11 09:43 南啾 阅读(148) 评论(0) 推荐(0) 编辑