<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                可修改式基礎地址 config.js ~~~ var config={ base_api_url:"http://douban.uieee.com/v2/" } export { config } ~~~ Promise封裝HTTP utils/http.js ~~~ import { config } from "../config"; class HTTP { request({url,method="GET",data={}}) { const promise = new Promise((resolve, reject) => { wx.request({ url: config.base_api_url + url, data, method, header: { 'Content-Type': 'json', }, success: (res=>{ const statusCode = res.statusCode.toString(); if (statusCode.startsWith("2")) { resolve(res.data); } else { this._show_error(); } }), fail: (err=> { reject(err); this._show_error(); }) }) }) return promise; } _show_error() { wx.showToast({ title: '網絡錯誤', icon: 'none' }) } } export { HTTP }; ~~~ 繼承類MovieModel再次封裝 models/movie.js ~~~ import {HTTP} from "../utils/http"; class MovieModel extends HTTP{ getInTheaters(){ return this.request({ url:"in_theaters" }) } getTop250(){ return this.request({ url:"top250" }) } getComingSoon(){ return this.request({ url:"coming_soon" }) } } export {MovieModel}; ~~~ 頁面調用HTTP Promise.all().then(res=>{}),res會生成一個數組,需要用數組裝載 ~~~ import {MovieModel} from "../../models/movie-p"; const movieModel = new MovieModel(); Page({ onLoad(){ const inTheaters = movieModel.getInTheaters() const top250 = movieModel.getTop250(); const comingSoon = movieModel.getComingSoon(); Promise.all([inTheaters,top250,comingSoon]).then(res=>{ let [inTheaters,top250,comingSoon] = res; console.log(inTheaters); console.log(top250); console.log(comingSoon); }) } }) ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看