![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
微信小程序
陈橙橙成大事
这个作者很懒,什么都没留下…
展开
-
微信小程序Cannot read property ‘forceUpdate‘ of undefined 是怎么回事?
Cannot read property解决方法:微信小程序配置一个AppID就可以了原创 2021-05-07 15:55:58 · 512 阅读 · 0 评论 -
微信小程序分类页面左右布局
<view class="container"> <view class="left"> <view class="item" {{activeIndex===index? 'active' : ''}}" wx:for="{{}}" wx:key="index" bindtap="clickType" data-i="{{index}}">111</view> </view> <view class="right"&g原创 2021-03-06 14:56:00 · 2205 阅读 · 0 评论 -
Promise
<button id="btn">请求数据</button><div id="ret"></div>//Promise对象,是SE6里面新增的,处理异步请求的对象//async表示当前方法是异步方法,里面可能包含异步请求$('#btn').click(async function(){ //调用异步方法时,添加await关键字,表示等待,是等待方法体里面执行resolve() await $get('./data/a.json') await $原创 2021-03-05 11:54:21 · 48 阅读 · 0 评论 -
微信小程序定义删除的方法
del(e){ //确认框 wx.showModal({ title:'确定删除吗', success:({confirm}) => { if(confirm){ //获取组件传递的参数i(i是索引) let i = e.target.dataset.i //根据指定的索引,从数组中,删除对应的数据 this.data.goodList.splice(i,1) //数组中的数据删除后,还要触发页面更新 this.setData({原创 2021-03-05 09:03:42 · 411 阅读 · 2 评论 -
微信小程序轮播图
indicator-dots booleanautoplay 自动播放interval 设置时间circular 是否衔接滑动<swiper indicator-dots indicator-color="#ffffff" indicator-active-color="#248067"autoplay circular interval="{{3000}}"> <swiper-item> <image src="http://p1.music.126.n原创 2021-03-04 19:07:23 · 76 阅读 · 1 评论 -
微信小程序拨打电话&扫二维码
<view class="flex j-s ss"> <view>{{msg}}</view> <van-icon size="20px" name="scan" bindtap="scan" /></view><view data-phone="{{item.phone}}" bindtap="call">电话:{{item.phone}}</view>// 打电话的方法call(e){ // 震动原创 2021-03-02 09:19:54 · 605 阅读 · 0 评论 -
事件绑定
1.需要给input标签绑定 input事件 绑定关键字 bindinput2.如何获取 输入框的值 通过事件源对象来获取 e.detail.value3.把输入框的值 赋值到 data当中不能直接:(1)this.data.num=e.detail.value(2)this.num=e.detail.value正确写法this.setData({num:e.detail.value})4.需要加入一个点击事件1.bindtap2.无法在小程序当中的 事件中 直接传参例如:3.通原创 2021-02-26 10:01:23 · 41 阅读 · 0 评论 -
下拉刷新
"window": { //开启下拉刷新的小圆点 "backgroundvextstyle":"dark" , "navigationBarBackgroundCoLor": "#0094ff", "navigationBarTitLeText":"我的应用", "navigationEarTextStyLe":"black", //开启下拉刷新 "enablePulLDownRefresh":true, //下拉刷新的背景 "backgraundcaLor" : "yellow",}原创 2021-02-25 18:43:39 · 49 阅读 · 0 评论 -
微信小程序上拉下拉操作
//开启上拉刷新"enablePullDownRefresh":true,"backgroundColor":"#248067"async getDataList(){ let dataList = await wx.$get('/Subject/GetSubjects',{ pageSize:15, pageIndex:this.data.pageIndex }) //判断如果是首页,清空之前数组中的数据 if(this.data.pageIndex===1) this.dat原创 2021-02-21 17:53:21 · 753 阅读 · 0 评论 -
微信小程序切换分类获取数据
<view class="container"> <scroll-view scroll-y class="left"> <view class="item {{activeIndex===index?'active':''}}" wx:for="{{typeList}}" wx:key="index" bindtap="clickType" data-index="{{index}}" data-id="{{item.Id}}">{{item.Name原创 2021-02-21 14:37:18 · 634 阅读 · 0 评论 -
微信小程序循环数组+删除
//通过插值表达式{{}},可以执行显示data里面的数据//view组件,相当于html中的div标签//wx:for指令用于循环数组数据,生成组件,item就是循环出来的每一项,index是每一项对应的索引。item和index可以重命名,方式是wx:for-item="xxx" wx:for-index="xxx"<view> <view class="flex j-s a-c" wx:for="{{goodList}}" wx:for-index="goods" wx:fo原创 2021-02-20 22:01:17 · 1349 阅读 · 1 评论 -
微信小程序如何跳转页面
navigator组件,用于页面链接,默认只能跳转普通页面,如果要跳转tabBar页面,需要设置open-type=“switchTab”!<navigator url="/pages/details/details">详情</navigator><navigator open-type="switchTab" url="/pages/menu/menu">菜单</navigator><view class="btn" size="mini" bi原创 2021-02-20 16:42:47 · 296 阅读 · 0 评论 -
认识小程序项目结构
pages里面都是放页面的details详情页utils里面放一些工具包app.json全局配置文件 windows配置一些全局的参数app.js是小程序的全局入口文件xxx.wxss文件其实就是css文件project.config.json项目配置文件sitemap.json是小程序的SEO优化文件,方便用户搜索到该小程序新建页面里面有两个步骤:1.在pages文件夹中新建页面文件夹2.在页面文件中新建page微信的一个页面由4个文件组成1.xxx.wxml文件,该文件设置内容,原创 2021-02-18 15:10:35 · 50 阅读 · 0 评论