摘要: 1、async是什么 async用于声明异步的,常常用于处理回调函数。 async返回一个promise的对象,可以直接用.then,.catch来处理结果。 onLoad: function (options) { // 声明该方法为异步方法,会返回一个Promise对象 async functi 阅读全文
posted @ 2021-01-08 23:22 RainstormDy 阅读(1482) 评论(0) 推荐(0)
摘要: onLoad: /** * 生命周期函数--监听页面加载 */ // 打开当前页面就执行,并且只执行一次,从其他页面跳过来时不会执行 // 常用作列表页跳转详情页,options接受参数 onLoad: function (options) { wx.showToast({ title: '成功', 阅读全文
posted @ 2020-11-12 12:02 RainstormDy 阅读(349) 评论(0) 推荐(0)
摘要: 跳转页面方法1:wxml文件中跳转 <navigator url="/pages/index2/index2" hover-class="navigator-hover">跳转到新页面</navigator> 跳转页面方法2:js文件中跳转 // 跳转页面 nav:function(){ wx.na 阅读全文
posted @ 2020-11-08 20:30 RainstormDy 阅读(85) 评论(0) 推荐(0)
摘要: 通过表单提交数据到云数据库 //wxml文件 <form bindsubmit="bindFromsubmit"> <view> <text>你的姓名</text> <input type="text" placeholder="请输入你的姓名" bindinput="nameinput"></in 阅读全文
posted @ 2020-10-23 16:57 RainstormDy 阅读(591) 评论(0) 推荐(0)
摘要: 轮播图功能 //wxml文件 <swiper class="swiper" indicator-dots="true" autoplay="false" circular="false" interval="3000" duration="1000"> <block wx:for="{{banner 阅读全文
posted @ 2020-10-21 22:59 RainstormDy 阅读(89) 评论(0) 推荐(0)