diff --git a/src/app.wpy b/src/app.wpy index d5b9abf..a0f4220 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -36,6 +36,7 @@ export default class extends wepy.app { 'pages/search', 'pages/jumppage', 'pages/video', + 'pages/webview', ], window: { backgroundTextStyle: 'light', diff --git a/src/mixins/cfg.js b/src/mixins/cfg.js index 9375d82..ff7d84a 100644 --- a/src/mixins/cfg.js +++ b/src/mixins/cfg.js @@ -27,11 +27,16 @@ export default class cfgMixin extends wepy.mixin { } return result; } - /*获取成就达成人数要求的配置*/ + /*帮助视频地址*/ $getHelpVideoLink() { let cfgObj = wepy.getStorageSync('cfg'); return cfgObj.help_video; } + /*电影播放页面地址*/ + $getMovieUrl() { + let cfgObj = wepy.getStorageSync('cfg'); + return cfgObj.movieurl; + } $getExtCfg(name) { let cfgObj = wepy.getStorageSync('cfg'); let price = cfgObj.ext_json_cfg; diff --git a/src/mixins/nav.js b/src/mixins/nav.js index 0657c17..89126f4 100644 --- a/src/mixins/nav.js +++ b/src/mixins/nav.js @@ -27,4 +27,16 @@ export default class navMixin extends wepy.mixin { url: '/pages/video?link=' + encodeURIComponent(link) + '&title=' + encodeURIComponent(title) }) } + /** + * 电影播放页面 + * @param {string} movieUrl 视频地址 + * @param {string} title 页面标题,可为空 + * */ + $toMovie(movieUrl, title) { + let obj = `{"url": "${movieUrl}","name":"${title}"}`; + const link = `${this.$getMovieUrl()}?param=${encodeURIComponent(obj)}`; + wepy.navigateTo({ + url: '/pages/webview?link=' + encodeURIComponent(link) + '&title=' + encodeURIComponent(title) + }) + } } diff --git a/src/pages/index.wpy b/src/pages/index.wpy index 548a04e..381b6b3 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -134,9 +134,11 @@ this.$toGameInfo(gid); }, async toSearch() { - wepy.navigateTo({ - url: '/pages/search' - }) + // wepy.navigateTo({ + // url: '/pages/search' + // }) + let movie = 'http://iqiyi.kuyun-bofang.com/20190208/eebojrT3/index.m3u8' + this.$toMovie(movie, '流浪地球'); }, async showInviteView() { await this.updateInviteViewData(); diff --git a/src/pages/webview.wpy b/src/pages/webview.wpy new file mode 100644 index 0000000..5ef3881 --- /dev/null +++ b/src/pages/webview.wpy @@ -0,0 +1,98 @@ + + + +