Commit e4239b0c2d3289b0abcb1c687487ad3184cfb66b
1 parent
089148e9
新增速溶茶页面
Showing
3 changed files
with
171 additions
and
1 deletions
src/pages/instantTea/instantTea.less
0 → 100644
| 1 | +.instantTea_box{ | |
| 2 | + .div1{ | |
| 3 | + | |
| 4 | + } | |
| 5 | + .div2{ | |
| 6 | + | |
| 7 | + } | |
| 8 | + .div3{ | |
| 9 | + | |
| 10 | + } | |
| 11 | + .div4{ | |
| 12 | + | |
| 13 | + } | |
| 14 | + .div5{ | |
| 15 | + | |
| 16 | + } | |
| 17 | + .div6{ | |
| 18 | + | |
| 19 | + } | |
| 20 | + .div7{ | |
| 21 | + | |
| 22 | + } | |
| 23 | + //返回和分享功能 | |
| 24 | + .top_box{ | |
| 25 | + width: calc(100% - 60px); | |
| 26 | + height: 100px; | |
| 27 | + position: fixed; | |
| 28 | + left: 30px; | |
| 29 | + display: flex; | |
| 30 | + justify-content: space-between; | |
| 31 | + align-items: center; | |
| 32 | + img{ | |
| 33 | + width: 64px; | |
| 34 | + height: 64px; | |
| 35 | + } | |
| 36 | + } | |
| 37 | +} | ... | ... |
src/pages/instantTea/instantTea.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <!-- H5唤起App组件 --> | |
| 4 | + <call-app-box v-if="!isCNLive.value" | |
| 5 | + :callApps="$parent.callApps"> | |
| 6 | + </call-app-box> | |
| 7 | + <div class="instantTea_box"> | |
| 8 | + <div class="div1"> | |
| 9 | + | |
| 10 | + </div> | |
| 11 | + <div class="div2"> | |
| 12 | + | |
| 13 | + </div> | |
| 14 | + <div class="div3"> | |
| 15 | + | |
| 16 | + </div> | |
| 17 | + <div class="div4"> | |
| 18 | + | |
| 19 | + </div> | |
| 20 | + <div class="div5"> | |
| 21 | + | |
| 22 | + </div> | |
| 23 | + <div class="div6"> | |
| 24 | + | |
| 25 | + </div> | |
| 26 | + <div class="div6"> | |
| 27 | + | |
| 28 | + </div> | |
| 29 | + <!--头部返回和分享--> | |
| 30 | + <div v-show="isCNLive.value" :style= "'top:'+ $parent.top.value + 'px'" class="top_box"> | |
| 31 | + <img @click="$parent.back()" src="../../../static/img/back.jpg" alt=""/> | |
| 32 | + <img @click="$parent.toShare('22','1')" src="../../../static/img/share.jpg" alt=""/> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | +</template> | |
| 37 | + | |
| 38 | +<script> | |
| 39 | + import {videoPlayer} from 'vue-video-player'; | |
| 40 | + import 'video.js/dist/video-js.css'; | |
| 41 | + import '../../../static/css/video.css'; | |
| 42 | + import callAppBox from "@/components/callAppBox/callAppBox"; | |
| 43 | + export default { | |
| 44 | + name: 'instantTea', | |
| 45 | + data () { | |
| 46 | + return { | |
| 47 | + callApps: null, // 打开app参数 | |
| 48 | + playsinline: true, | |
| 49 | + playerOptions: { | |
| 50 | + events: [], | |
| 51 | + playbackRates: [0.5, 1.0, 1.5, 2.0], // 播放速度 | |
| 52 | + autoplay: false, // 如果true,浏览器准备好时开始回放。 | |
| 53 | + controls: true, // 控制条 | |
| 54 | + preload: 'auto', // 视频预加载 | |
| 55 | + muted: false, // 默认情况下将会消除任何音频。 | |
| 56 | + loop: false, // 导致视频一结束就重新开始。 | |
| 57 | + language: 'zh-CN', | |
| 58 | + controlBar: { | |
| 59 | + timeDivider: true, | |
| 60 | + durationDisplay: true | |
| 61 | + }, | |
| 62 | + aspectRatio: '16:9', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3") | |
| 63 | + fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。 | |
| 64 | + sources: [{ | |
| 65 | + type: "video/mp4", | |
| 66 | + src: "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/12/30/5e0973f0aa9be.mp4" | |
| 67 | + }], | |
| 68 | + hls: true, // 启用hls? | |
| 69 | + poster: 'https://wjj.ys2.cnliveimg.com/769/shop/img/2020/01/04/5e1068d441b41.jpg', // 你的封面地址 | |
| 70 | + width: document.documentElement.clientWidth || document.body.clientWidth, | |
| 71 | + notSupportedMessage: '此视频暂无法播放,请稍后再试' // 允许覆盖Video.js无法播放媒体源时显示的默认信息。 | |
| 72 | + } | |
| 73 | + } | |
| 74 | + }, | |
| 75 | + components: { | |
| 76 | + videoPlayer, | |
| 77 | + callAppBox | |
| 78 | + }, | |
| 79 | + created(){ | |
| 80 | + document.title = '崇学向善 鼠年有礼'; | |
| 81 | + // 获取并设置分享参数 | |
| 82 | + this.$parent.getShareData({ | |
| 83 | + type: 22, | |
| 84 | + id: this.$route.query.appid || 1, | |
| 85 | + url: "" | |
| 86 | + }); | |
| 87 | + }, | |
| 88 | + methods: { | |
| 89 | + link(){ | |
| 90 | + if(this.isCNLive.value){ | |
| 91 | + let items; | |
| 92 | + items={ | |
| 93 | + "title": "", | |
| 94 | + "type": "2", | |
| 95 | + "shop_type":"2", | |
| 96 | + "to":"9620396", | |
| 97 | + } | |
| 98 | + this.$parent.gotoDetail(items) | |
| 99 | + | |
| 100 | + }else { | |
| 101 | + window.location.href = this.getParams(this.mode).shop.apiAddress + "/html/mall/1/#/pages/main/cultureDetail/cultureDetail?id=9620396" | |
| 102 | + } | |
| 103 | + }, | |
| 104 | + /** | |
| 105 | + * 视频播放 | |
| 106 | + * @param {object} $event [播放器对象] | |
| 107 | + */ | |
| 108 | + onPlayerPlay(event) { | |
| 109 | +// if (event == 1) { | |
| 110 | +// this.playerOptions.sources[0].src = "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/12/30/5e09739a07d18.mp4" | |
| 111 | +// } else { | |
| 112 | +// this.playerOptions.sources[0].src = "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/12/30/5e0973f0aa9be.mp4" | |
| 113 | +// } | |
| 114 | + }, | |
| 115 | + } | |
| 116 | + } | |
| 117 | +</script> | |
| 118 | + | |
| 119 | +<!-- Add "scoped" attribute to limit CSS to this component only --> | |
| 120 | +<style rel="stylesheet/less" lang="less" scoped> | |
| 121 | + @import "instantTea"; | |
| 122 | +</style> | ... | ... |
src/router/index.js
| ... | ... | @@ -17,7 +17,7 @@ const router = new Router({ |
| 17 | 17 | redirect: "/luckywheel", |
| 18 | 18 | children: [ |
| 19 | 19 | { |
| 20 | - // 积分兑换记录 | |
| 20 | + // 首页 | |
| 21 | 21 | path: "/index", |
| 22 | 22 | name: "index", |
| 23 | 23 | component: resolve => { |
| ... | ... | @@ -26,6 +26,17 @@ const router = new Router({ |
| 26 | 26 | meta: { |
| 27 | 27 | requireAuth: false |
| 28 | 28 | } |
| 29 | + }, | |
| 30 | + { | |
| 31 | + // 速溶茶 | |
| 32 | + path: "/instantTea", | |
| 33 | + name: "instantTea", | |
| 34 | + component: resolve => { | |
| 35 | + require(["@/pages/instantTea/instantTea"], resolve); | |
| 36 | + }, | |
| 37 | + meta: { | |
| 38 | + requireAuth: false | |
| 39 | + } | |
| 29 | 40 | } |
| 30 | 41 | ] |
| 31 | 42 | }, | ... | ... |