商家教程

pifa
fanfan 5 months ago
parent 78e6b82392
commit 14b973ee34
  1. 7
      pages.json
  2. 141
      pages/merchantTutorial/lookVideo.vue
  3. 25
      pages/merchantTutorial/tutorial.vue
  4. 2
      pages/news1/MerchantSettlement.vue
  5. 4
      pages/news3/JoinDistribution.vue

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

@ -0,0 +1,141 @@
<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>
<addShuiyin />
</view>
</template>
<script>
import * as api from '@/api/tutorial'
export default {
data() {
return {
background: {
background: 'none'
},
video_url: '',
title: ''
}
},
onLoad(options) {
this.show = true;
let videoContext = wx.createVideoContext('myVideo')
videoContext.seek(0);
this.video_url = options.url;
this.title = options.title
},
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 =
`【小程序内商家教程视频】:${this.title}\n【点开学习】\n${this.video_url}(温馨提示:小程序商家教程内可以搜索你想要的内容,让你学习更加方便)`
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>

@ -20,14 +20,15 @@
bar-width="55" bar-height="6" :current="current" @change="change">
</u-tabs>
<view class="center-box" v-if="courseList.length>0">
<view class="list" v-for="(a,i) in courseList" :key="i" @click="onLookCord(a.video_url.external_url)">
<view class="list" v-for="(a,i) in courseList" :key="i"
@click="onLookCord(a.video_url.external_url,a.course_name)">
<image :src="a.image_url?a.image_url.external_url:''" mode="heightFix" class="img"></image>
<view class="infor">
<view class="title">
{{a.course_name}}
</view>
<view class="subtitle">
{{a.course_detail}}
{{a.course_subheading}}
</view>
</view>
<view class="look">
@ -103,12 +104,15 @@
this.current = index;
this.getCourseList()
},
onLookCord(url) {
onLookCord(url, title) {
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 + "&title=" + title
})
// this.show = true;
// let videoContext = wx.createVideoContext('myVideo')
// videoContext.seek(0);
// this.video_url = url
} else {
this.$toast('暂无可观看的视频')
}
@ -230,8 +234,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 {
@ -283,12 +287,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);

@ -519,7 +519,7 @@ page {
font-size: 26upx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FF4C3C;
color: #002280;
width: 236upx;
}

@ -70,10 +70,10 @@
<image :src="$picUrl+'/static/news3/fx4.png'" mode="widthFix"></image>
<text>我的团队</text>
</view>
<view class="gridItem" @click="$navTo('pages/dealer/poster')">
<!-- <view class="gridItem" @click="$navTo('pages/dealer/poster')">
<image :src="$picUrl+'/static/news3/fx5.png'" mode="widthFix"></image>
<text>推广二维码</text>
</view>
</view> -->
</view>
<addShuiyin />
</view>

Loading…
Cancel
Save