fanfan 3 months ago
parent 15fa91af50
commit 2170a39cec
  1. 7
      pages.json
  2. 138
      pages/merchantTutorial/lookVideo.vue
  3. 20
      pages/merchantTutorial/tutorial.vue
  4. 3
      pages/user/index.vue

@ -1193,6 +1193,13 @@
"enablePullDownRefresh": true,
"navigationBarTitleText": "商家教程"
}
},{
"path": "lookVideo",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true,
"navigationBarTitleText": "观看视频"
}
}]
},
{

@ -0,0 +1,138 @@
<template>
<view class="park">
<!-- <view class="park-navbar">
<u-navbar title="观看视频" :border-bottom="false" :background="background"></u-navbar>
</view> -->
<u-mask :show="show">
<view class="warp" @click.stop="pauseVideo">
<video @tap.stop style="width: 100%;" :loop='true' id="myVideo" :src="video_url"></video>
<view class="share">
<button @click.stop="lookVideo" class="buttons"> 复制视频链接</button>
</view>
</view>
</u-mask>
</view>
</template>
<script>
import * as api from '@/api/tutorial'
export default {
data() {
return {
background: {
background: 'none'
},
video_url: ''
}
},
onLoad(options) {
this.show = true;
let videoContext = wx.createVideoContext('myVideo')
videoContext.seek(0);
this.video_url = options.url
},
onShow() {
},
onShareAppMessage(res) {
let that = this
return {
path: "/pages/merchantTutorial/lookVideo?url=" + that.video_url,
imageUrl: that.video_url,
success: function(res) {
//
if (res.errMsg == 'shareAppMessage:ok') {
that.$toast('分享成功')
}
},
fail: function() {
//
if (res.errMsg == 'shareAppMessage:fail cancel') {
that.$toast('取消分享')
} else if (res.errMsg == 'shareAppMessage:fail') {
that.$toast('分享失败')
}
}
}
},
methods: {
lookVideo() {
let str =
`【App内视频教程】:如何用易创相机开启抖音直播\n【点开学习】\n${this.video_url}(温馨提示:App教程内可以搜索你想要的内容,让你学习更加方便)`
uni.setClipboardData({
data: str, // value
success: function() {
//
uni.showToast({
title: '复制成功',
icon: 'none',
duration: 2000
})
}
})
},
pauseVideo() {
uni.createSelectorQuery().select('#myVideo').boundingClientRect(function(rect) {
uni.createVideoContext('myVideo', this).pause();
}).exec();
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style>
page {
background: #fff;
}
</style>
<style>
.park {
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 1);
}
.warp {
width: 100%;
height: 100%;
background: #fff;
/* padding-top: 170rpx; */
/* height: calc(100% - 170rpx);
*/
}
.share {
width: 100%;
height: 150rpx;
color: white;
text-align: center;
vertical-align: top;
margin-top: 30rpx;
}
.buttons {
margin-top: 30rpx;
border-radius: 42rpx;
text-align: center;
width: 300rpx;
background: linear-gradient(125.45deg, #ff8a66 0%, #f34a40 100%);
margin: 0 auto;
border: none !important;
padding: 0;
line-height: 80rpx;
height: 80rpx;
font-size: 34rpx;
font-family: PingFang SC,
PingFang SC;
font-weight: 700;
color: white;
}
#myVideo {
background-color: #fff !important;
height: calc(100% - 150rpx);
}
</style>

@ -27,7 +27,7 @@
{{a.course_name}}
</view>
<view class="subtitle">
{{a.course_detail}}
{{a.course_subheading}}
</view>
</view>
<view class="look">
@ -104,10 +104,13 @@
},
onLookCord(url) {
if (url) {
this.show = true;
let videoContext = wx.createVideoContext('myVideo')
videoContext.seek(0);
this.video_url = url
uni.navigateTo({
url: "/pages/merchantTutorial/lookVideo?url=" + url
})
// this.show = true;
// let videoContext = wx.createVideoContext('myVideo')
// videoContext.seek(0);
// this.video_url = url
} else {
this.$toast('暂无可观看的视频')
}
@ -229,8 +232,8 @@
border-radius: 28rpx;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(250, 177, 173, 0.07) 59.66%, rgba(243, 74, 64, 0.06) 100%);
display: flex;
align-items: center;
padding: 30rpx 20rpx;
// align-items: center;
padding: 20rpx;
margin-bottom: 50rpx;
.look {
@ -282,12 +285,13 @@
/* 超出部分显示省略号 */
white-space: normal;
/* 使用正常的白空格处理方式,允许换行 */
margin-top: 5rpx;
}
.subtitle {
margin-top: 10rpx;
/** 文本1 */
font-size: 26rpx;
font-size: 28rpx;
font-weight: 400;
letter-spacing: 0rpx;
color: rgba(102, 102, 102, 1);

@ -537,7 +537,8 @@
</view>
</view>
<!-- course -->
<view class="serveIcon" v-if="userInfo.user_type == 40"
<!-- v-if="userInfo.user_type == 40" -->
<view class="serveIcon"
@click="goJump('/pages/merchantTutorial/tutorial')">
<image :src="$picUrl+'/static/user/course.png'" class="icons"></image>
<view class="serveInfo">

Loading…
Cancel
Save