1 Star 0 Fork 0

代码织梦师 / uniapp-music-project

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

网易云微信小程序细节

一、设置主题

"window": {
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#c20c0c",
    "navigationBarTitleText": "网易云音乐",
    "navigationBarTextStyle": "white"
  }

二、设置tabber

"tabBar": {
    "color": "#777777",
    "selectedColor": "#c20c0c",
    "list": [
      {
        "pagePath": "pages/SongList/SongList",
        "text": "首页",
        "iconPath": "./image/music1.png",
        "selectedIconPath": "./image/music.png"
      },
      {
        "pagePath": "pages/Find/Find",
        "text": "发现",
        "iconPath": "./image/find1.png",
        "selectedIconPath": "./image/find.png"
      }
    ]
  }

三、封装请求

/* 
  封装 网络请求
*/
class Request {
  request(url, method, data, loading) {
    return new Promise((resolve, reject) => {
      // 判断是否把 loading 状态传递过来了
      if (loading) {
        wx.showLoading({
          title: '数据加载中',
        })
      }
      wx.request({
        url: 'http://localhost:3000' + url,
        data: data || {},
        method: method,
        success: (result) => {
          resolve(result)
        },
        fail: (res) => {
          reject(res)
        },
        complete: (res) => {
          setTimeout(() => {
            // 请求完成的时候 就把 loadding 隐藏了即可
            wx.hideLoading()
          }, 150)
        },
      })
    })
  }

  /* 
    这里携带 laodding 就是通过传递参数来决定是不是 有loadding
  */
  // get 请求
  get(url, data, loadding) {
    return this.request(url, "get", data, loadding)
  }
  // post 请求
  post(url, data, loadding) {
    return this.request(url, "post", data, loadding)
  }
}

// 导出封装实例
export default new Request()

空文件

简介

网易云音乐微信小程序 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/zhao-jingtao-l/uniapp-music-project.git
git@gitee.com:zhao-jingtao-l/uniapp-music-project.git
zhao-jingtao-l
uniapp-music-project
uniapp-music-project
master

搜索帮助