bx-wx-utils

微信小程序开发工具函数

Usage no npm install needed!

<script type="module">
  import bxWxUtils from 'https://cdn.skypack.dev/bx-wx-utils';
</script>

README

微信小程序开发工具函数

bxGlobalData(env)

  • env: 小程序 app,page,component 对象引用 this
  • return 小程序 globalData 对象

bxFetchImageList(srcList, pathOnly)

  • srcList: 图片资源地址列表
  • pathOnly: 控制返回本地临时图片对象数组,还是  路径数组
    • 默认为 false,返回本地临时文件路径数组
  • return [path1, path2, ...]

bxRequest(params, loading)

  • params:
    • url
    • data: 对象
    • method: GET / POST
    • header
  • loading:true / false
    • 是否显示 loading