12 2019 档案
摘要:my.js onLoad: function (options) { setTimeout(res=>{ wx.showLoading({ title: '10s后出现', }) }, 10000) }, 点击my页面后,再点击进入get-score页面,过一会儿,get-score页面会出现这个w
阅读全文
摘要:app.js return new Promise的同时带着.then()方法会出错 return出去的这个Promise,整体状态会显示pending,虽然详细里状态显示resolve,但是没有resolve的值 调用这个Promise,再调用.then()方法后,回调res的值会出现undefi
阅读全文
摘要:return new Promise((resolve, reject) => { resolve({ status: 2 }) if (true) { resolve({ status: 1 }) } } Promise中,只要遇到resolve,就会将resolve状态凝固,后边再出现其他的re
阅读全文
摘要:app.isLogin() // 判断是否登录后 .then(res=>{ this.setData({ login: true }, res2=>{ // 清空临时积分 return app.clearTempScore() // 返回Promise }) }) .then(res => { co
阅读全文
摘要:B页面:B页面分享函数中,跳转到A页面带参数id onShareAppMessage: function () { return { title: "小程序", path: "/pages/A/A?id=1" } } A页面:点击分享卡片进入A页面,A页面可以获取B页面分享函数中跳转带的参数id,并
阅读全文