Commit 091c9fa1 authored by 黄奎's avatar 黄奎

11

parent 0c94d53d
......@@ -520,15 +520,11 @@
{
"root": "pages/video",
"pages": [{
"path": "index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "video"
"path": "index",
"style": {
"navigationStyle": "custom"
}
]
}]
},
//九寨沟分包
{
......@@ -591,78 +587,12 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "videoinfo"
}
]
},
//韩国馆项目
{
"root": "pages/kotra",
"pages": [{
"path": "contanctus"
}, {
"path": "contanctDetail"
}, {
"path": "compInformation"
}, {
"path": "activeInner"
}, {
"path": "investment" //投资
}, {
"path": "procurement" //采购
}, {
"path": "news" //最新动向
}, {
"path": "fat" //fat资讯
}, {
"path": "procurementList" //采购申请
}, {
"path": "investmentList" //投资申请
}, {
"path": "zixunList" //咨询信息
}, {
"path": "activeInnerDetail" //活动详情
}, {
"path": "newsInDetail" //新闻详情
}, {
"path": "procurementDetail" //采购查看详情
}, {
"path": "investmentDetail" //投资详情
}, {
"path": "activityList" //我的活动
}, {
"path": "zixunDetail" //咨询详情
}, {
"path": "typeList" //类型
}, {
"path": "companyInfo" //企业信息
}, {
"path": "activitysignUp" //活动报名 相亲模式
}, {
"path": "baomingorder" //报名订单
}, {
"path": "brand/list" //品牌列表
}, {
"path": "brand/detail", //品牌详情
"enablePullDownRefresh": true,
"style": {
"navigationStyle": "custom"
}
}, {
"path": "carrier/detail", //品牌列表
"enablePullDownRefresh": true,
"style": {
"navigationStyle": "custom"
}
}, {
"path": "carrier/list" //品牌详情
}, {
"path": "identification" //身份识别
}, {
"path": "firstShop/firstShop"
}, {
"path": "firstShop/list"
}]
},
//餐厅
{
"root": "pages/restaurant",
......@@ -795,6 +725,5 @@
"subscribe-msg": "plugin://subscribeMsg/subscribe-msg"
// #endif
}
}
}
}
\ No newline at end of file
......@@ -192,6 +192,7 @@
tcid: 0, //线路带过来字段
configId: 0, //线路带过来字段
cityId: 0, //线路带来字段
videoId: 0, //视频字段
};
},
components: {
......@@ -241,14 +242,6 @@
});
let c = this.$uiConfig.is_bang ? 78 : 50;
this.contentHeight = this.$utils.calcContentHeight(c);
if(options&&options.lxyType&&options.lxyType==1)
{
//跳转到视频详情
uni.navigateTo({
url: "/pages/video/video?vId=" + options.vId,
});
}
if (options && options.page_id) {
this.pageId = options.page_id;
let queryString = "";
......@@ -415,7 +408,6 @@
if (options && options.cityId) {
this.cityId = options.cityId;
}
that.u = uni.getStorageSync("mall_UserInfo");
if (!that.u) {
that.u = {
......@@ -426,7 +418,7 @@
} else {
that.sharejump(); //4-9新加
}
// #endif
let set = uni.getStorageSync("basedata") ?
......@@ -445,7 +437,7 @@
let now = new Date();
let nowtime =
now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
if (!uni.getStorageSync("Startup_page")) {
//获取启动页信息1、没有记录日期
this.getstartModel(nowtime);
......@@ -465,7 +457,6 @@
// #ifdef MP-WEIXIN
onShareTimeline() {
setTimeout(() => {
// console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo") ?
......@@ -498,7 +489,6 @@
},
onShareAppMessage(res) {
setTimeout(() => {
// console.log("分享调用");
this.getReceive();
}, 2500);
let uid = uni.getStorageSync("mall_UserInfo") ?
......@@ -637,7 +627,6 @@
}
},
getphonenumber(e) {
console.log(e);
uni.checkSession({
//检查登录状态是否过期
success: (x) => {
......@@ -826,7 +815,6 @@
});
} else if (that.JumpType == 7) {
//线下服务门店详情
uni.navigateTo({
url: "/pages/reserve/storeDetails?id=" + that.GoodsId,
});
......@@ -913,7 +901,7 @@
"&cityId=" +
that.cityId,
});
}
}
}, 500);
},
updateuserinfo(msg) {
......@@ -965,7 +953,6 @@
},
},
(res) => {
console.log(res.data.detail.path);
uni.setStorageSync("pid", {
pid: res.data.detail.user_id ? res.data.detail.user_id : 0,
}); //存储上级的id
......@@ -1241,7 +1228,6 @@
},
},
(res) => {
console.log(res, "res");
if (res.couponResultCode == 1) {
this.couponMessage = res.couponMessage;
this.showCoupons = true;
......
<style>
.nvideo_Page {
width: 100%;
height: 100%;
}
.container {
position: absolute;
}
.videoTitle {
width: 100%;
height: 200rpx;
position: absolute;
top: 10rpx;
left: 20rpx;
font-size: 25rpx;
color: white;
z-index: 1;
}
.play-img {
width: 114rpx;
height: 114rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -62%);
z-index: 2;
}
.video-view {
width: 100vw;
height: 100vh;
}
.videoControlsContainer {
position: fixed;
left: 50%;
bottom: 60rpx;
transform: translateX(-50%);
display: flex;
justify-content: space-between;
align-items: center;
width: 704rpx;
height: 88rpx;
border-radius: 20rpx;
/* background: rgba(255, 255, 255, 0.5); */
/* backdrop-filter: blur(20rpx); */
padding: 0 31rpx;
box-sizing: border-box;
}
.play-icon {
padding-top: 4rpx;
width: 57rpx;
height: 57rpx;
}
.pause-icon {
padding-top: 4rpx;
width: 57rpx;
height: 57rpx;
}
.custdownTime {
font-size: 22rpx;
font-weight: normal;
color: white;
}
.slideBox {
width: 481rpx;
}
</style>
<template>
<view class="nvideo_Page">
<view class="container">
<!--播放按钮-->
<image v-if="!isPlay" class="play-img" @click="videoPlayed" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_pause.png"
mode=""></image>
<view class="videoTitle">{{videoName}}</view>
<video :show-center-play-btn="false" class="video-view" id="myVideo" ref="myVideo" :src="videoUrl" :poster="videoCoverImg"
:controls="controls" :show-loading="true" @timeupdate="handleTimeUpdate" @loadedmetadata="loadedmetadata"
@fullscreenchange="fullscreenchange" @play="playChange" @pause="pauseChange" @ended="ended" :autoplay="false">
<view class="videoControlsContainer flex justify-center">
<image v-if="!isPlay" class="play-icon" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_pause.png"
@click="videoPlayed" mode="aspectFill"></image>
<image v-else class="pause-icon" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/v_start.png"
@click="videoPause" mode="aspectFill"></image>
<view class="slideBox">
<!--slider自定义播放控件-->
<slider @changing="sliderDown" style="margin: 0;" :value="value" @change="sliderChange" activeColor="#FFFFFF"
backgroundColor="rgba(245, 245, 245, 0.45)" block-color="#F5F5F5" :block-size="14" />
</view>
<!--播放时间-->
<p class="custdownTime">{{computedTime(nowPlayTime)}}</p>
</view>
</video>
</view>
</view>
</template>
<script>
export default {
data() {
return {
videoName: "", //视频名称
videoUrl: "", //视频地址
videoCoverImg: "", //封面图
vid: "", //视频Id
vWidth: "", //视频宽
vHeight: "", //视频高
videoPlay: 0,
videoContext: null,
videoDuration: 0, //总播放时长
isPlay: false, //判断是否播放
nowPlayTime: 0, //当前播放时间
value: 0, //当前滑块的值
controls: false, //是否隐藏默认控制器
isEnd: false, //播放是否结束
sliderAble: true,
isSliderIng: false
}
},
components: {
},
onReady() {
},
onLoad(option) {
console.log("video", option)
if (option && option.scene) {
var tempSceneStr = decodeURIComponent(option.scene);
console.log("tempSceneStr", tempSceneStr)
if (tempSceneStr && tempSceneStr != '') {
let vId = 0;
tempSceneStr.split('&').forEach(item => {
let tempArray = item.split('=');
if (tempArray && tempArray.length == 2) {
if (tempArray[0] == "vId") {
vId = tempArray[1];
}
}
});
console.log("vId", vId);
this.vid = vId;
this.getVideoInfo();
}
}
if (option && option.vId) {
console.log("option.vId", option.vId)
this.vid = option.vId;
this.getVideoInfo();
}
},
methods: {
getVideoInfo() {
this.videoUrl = "";
this.videoCoverImg = "";
this.videoName = "";
this.vWidth = "";
this.vHeight = "";
var postMsg = {
vid: this.vid
};
this.apipost(
"Video_get_GetLXYVideoInfo",
postMsg,
res => {
if (res.resultCode == 1) {
var tempData = res.data;
console.log("video_tempData", tempData);
this.videoUrl = tempData.VideoAddress;
this.videoCoverImg = tempData.Cover;
this.videoName = tempData.Name;
if (tempData && tempData.VideoWH && tempData.VideoWH != '') {
var tempArray = tempData.VideoWH.split(',')
if (tempArray && tempArray.length == 2) {
this.vWidth = tempArray[0];
this.vHeight = tempArray[1];
}
}
}
uni.hideLoading();
},
err => {
this.loading = false
}
);
},
//回到首页
goHome() {
uni.redirectTo({
url: "/pages/index/index"
});
},
/**
* 播放
*/
videoPlayed() {
this.videoContext.play()
},
/**
* 暂停
*/
videoPause() {
this.videoContext.pause()
},
/**
* 滑块进行拖动进度播放
*/
sliderChange(e) {
this.isSliderIng = false
const t = e.detail.value / 100
this.videoContext.seek(t * this.videoDuration);
this.nowPlayTime = t * this.videoDuration
console.log(t * this.videoDuration);
},
/**
* 播放后触发方法,获得播放总时长
*/
handleTimeUpdate(e) {
// 设置滑块位置
if (!this.isEnd && !this.isSliderIng) {
this.value = this.nowPlayTime / this.videoDuration * 100
}
// 设置当前时间
this.nowPlayTime = e.detail.currentTime
// 首次获取到duration时存储它
if (this.videoDuration === 0 && e.detail.duration > 0) {
this.videoDuration = e.detail.duration;
}
},
/**
* 初始化获得视频总时长
*/
loadedmetadata(e) {
this.nowPlayTime = e.detail.duration
},
computedTime(minutesAndSeconds) {
let totalSeconds = Math.floor(minutesAndSeconds) * 60 + Math.round((minutesAndSeconds % 1) * 60);
let hours = Math.floor(totalSeconds / 3600);
let minutes = Math.floor((totalSeconds % 3600) / 60);
hours = hours.toString().padStart(2, '0');
minutes = minutes.toString().padStart(2, '0');
return `${hours}:${minutes}`;
},
/**
* 监听是否为全屏,默认控制器是否显示
*/
fullscreenchange(e) {
if (e.detail.fullScreen) {
this.controls = true
} else {
this.controls = false
}
},
/**
* 监听是否播放
*/
playChange() {
this.isPlay = true
this.isEnd = false
this.sliderAble = false
},
/**
* 监听是否暂停
*/
pauseChange() {
this.isPlay = false
this.sliderAble = true
},
/**
* 是否播放完毕
*/
ended(e) {
this.isEnd = true
this.isPlay = false
this.value = 0
this.videoContext.seek(0);
this.videoContext.pause();
},
/**
* 滑块滑动期间
*/
sliderDown(e) {
this.isSliderIng = true
const t = e.detail.value / 100
this.videoContext.seek(t * this.videoDuration);
this.nowPlayTime = t * this.videoDuration
}
},
mounted() {
this.videoContext = uni.createVideoContext('myVideo', this);
this.videoContext.stop();
},
created() {
uni.setNavigationBarTitle({
title: "视频分享"
})
},
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment