
微信小程序
大可不必_妄
这个作者很懒,什么都没留下…
展开
-
微信小程序请求接口封装
微信小程序请求接口封装原创 2022-10-31 17:23:10 · 1399 阅读 · 1 评论 -
微信小程序 -- 修改checkbox/radio样式
直接把代码粘贴在 .wxss文件内 修改checkbox样式 /* 重写 checkbox 样式 */ /* 未选中的 背景样式 */ checkbox .wx-checkbox-input{ border-radius: 50%;/* 圆角 */ width: 40rpx; /* 背景的宽 */ height: 40rpx; /* 背景的高 */ } /* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */ checkbox .wx-checkbox.转载 2021-06-16 10:03:52 · 291 阅读 · 0 评论 -
web前端 -- 微信小程序总结
3 组建的公共属性 1 id,2 class,3 style 4 hidden, 组件是否显示,类似vue的v-show <view hidden=”{{true}}”>111</view> 5 data-* 自定义属性名,事件传参中使用 <view data-age=”45”>111</view> 4 数据和页面绑定 1 定义data数据 Page({ data:{ age:18 } }) 2 页面中使用data <...原创 2021-06-04 18:36:47 · 882 阅读 · 0 评论 -
微信小程序 -- 长按图片保存到相册
wx.showActionSheet:显示操作菜单; wx.downloadFile:下载文件到本地; wx.saveImageToPhotosAlbum:保存图片到系统相册; wxml: <image src="图片地址" catchlongpress="handleLongPress"></image> js: Page({ data: { }, onLoad: function (options) { }, // 长.原创 2021-05-28 12:05:08 · 243 阅读 · 0 评论 -
微信小程序 -- 分页
js: commentData:存放请求接口的数据的数组; isPageHave:用来判断是否存在下一页; onReachBottom:微信小程序自定义的页面上拉触底事件; 提示: 如果在使用scroll-view时,onReachBottom事件不生效时,使用scroll-view的bindscrolltolower事件来执行页面上拉触底事件。 Page({ data: { // 存放请求接口数据的数组 commentData: [],原创 2021-05-28 11:50:19 · 685 阅读 · 0 评论 -
微信小程序 -- setData(删除)
wxml: 绑定数组元素的id和下标(index) <view data-id="{{item.id}}" data-index="{{index}}" bindtap="handleDel">删除</view> js: listDataDel:原数组数据 listData:删除后并更新的数组数据 handleDel(event){ var idx = event.currentTarget.dataset.index; var _this1 = th原创 2021-05-28 11:30:02 · 1005 阅读 · 0 评论 -
微信小程序 --- setData(点赞)
点赞效果: wxml: 绑定数组元素下标(index)和id,根据接口数据返回是否已点赞状态(like)。 <view class="fabulousBox" bindtap="handleFabulous" data-id="{{item.id}}" data-index="{{index}}"> <原创 2021-05-28 11:23:26 · 183 阅读 · 0 评论 -
微信小程序 -- tab切换(无滑动效果)
wxml: <view> <view class="tab"> <view class="{{ currentIndex == index ? 'tabStyle' : '' }}" wx:for="{{ tabs }}" wx:key="item" bindtap="switchTab" data-index="{{ index }}">{{item}}</view> </view> <view wx:if="...原创 2021-05-27 17:29:32 · 321 阅读 · 0 评论 -
微信小程序 -- tab切换(滑动效果)
wxml: <view> <view class="swiperTab"> <view class="swiperItem {{currentIndex==0 ? 'active' : ''}}" data-index="0" bindtap="swichNav">Tab1</view> <view class="swiperItem {{currentIndex==1 ? 'active' : ''}}" data-index.原创 2021-05-27 17:11:50 · 599 阅读 · 0 评论 -
微信小程序 -- 锚点跳转(scroll-view)
一、前端简介 1、什么是前端? 前端是Web前端开发工程师的简称,主要是利用HTML,CSS,JS等技术,同时结合后台开发技术对产品进行开发。 2、什么是HTML? (1)是超文本标记语言(hyper text marked language)。 (2)是网页的骨架,作用是显示所有能看到的网页元素,包括:文字,图片,超链接,表格,视频,声音等。 (3)具有通用性,不限操作系统。 二、开发工具 简称 三、常用的html标签 1、块级元素 (1)html,网页开始的位置 (2)h.原创 2021-05-27 15:33:45 · 407 阅读 · 0 评论