
小程序
迷失在广东的靓仔中了
这个作者很懒,什么都没留下…
展开
-
小程序请求基于Promise处理
新建一个http.js文件/** * 封装http 请求方法 */const BASEURL = 'https://*********'; //服务器api地址export const http = (params) => { const TOKEN = wx.getStorageSync('token') || ''; // 获取token var header = { "Content-Type": "application/x-www-form-u原创 2020-11-13 18:08:54 · 352 阅读 · 0 评论 -
微信小程序批量收集formid
首先我们封装成一个组件起来,收集用户每一次点击的formid组件的wxml的部分<!--components/formId/formId.wxml--><form report-submit="{{true}}" catchsubmit="submitFormId" class='form'> <button form-type="submit" ...原创 2019-07-24 17:16:25 · 578 阅读 · 0 评论 -
自己封装小程序的路由拦截
第一步 我们创建一个拦截的文件intercept.jsfunction identityFilter(pageObj) { if (pageObj.onShow) { let _onShow = pageObj.onShow; pageObj.onShow = function () { wx.getSetting({ ...原创 2019-08-20 13:27:44 · 1737 阅读 · 0 评论 -
小程序基于wx.request做二次请求封装,主要是起到请求拦截作用
第一步建一个封装wx.request的文件const devUrl = "https://xxxxxx"; // 基准路径/** * * @param {路径} url * @param {请求方式} method * @param {数据} data * @param {请求头} header */function request(url, method = 'G...原创 2019-08-27 11:40:00 · 802 阅读 · 0 评论