Commit b7d6a7ab by luyt

feat:视频处理

1 parent 9c7927c3
// pages/tab/index/components/indexProduct/indexProduct.js
import { IMG_URL } from "~/utils/constantData.js";
// 导入方法
import { behavior as computedBehavior } from '~/utils/lib/miniprogram-computed'
import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed";
const videoBaseUrl =
"https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/";
......@@ -21,38 +21,38 @@ Component({
computed: {
// 特色产品
prodList(data) {
if(data.mainActiveIndex == 0){
return data.senceData[data.tabActive].productList
}else{
let type = data.items[data.mainActiveIndex].type
return data.senceData[data.tabActive].productList.filter(item=>item.type == type )
if (data.mainActiveIndex == 0) {
return data.senceData[data.tabActive].productList;
} else {
let type = data.items[data.mainActiveIndex].type;
return data.senceData[data.tabActive].productList.filter(
(item) => item.type == type
);
}
},
// 视频
prodVideoList(data){
return data.senceData[data.tabActive].videoList
prodVideoList(data) {
return data.senceData[data.tabActive].videoList;
},
// 海报
prodPosterList(data){
return data.senceData[data.tabActive].posterList
prodPosterList(data) {
return data.senceData[data.tabActive].posterList;
},
// 通知文字
scrollText(data){
let {tabActive,senceData} = data
return senceData[tabActive].scrollText
}
scrollText(data) {
let { tabActive, senceData } = data;
return senceData[tabActive].scrollText;
},
},
// 默认已深度监听
// 默认已深度监听
watch: {
'tabActive': function (a, b) {
tabActive: function (a, b) {
// console.log('变化',a)
this.setData({
mainActiveIndex:0
})
this.setProType()
}
mainActiveIndex: 0,
});
this.setProType();
},
},
/**
......@@ -63,7 +63,7 @@ Component({
IMG_URL,
// 头部tab
tabActive: 3,
tabHeaderShow:false,
tabHeaderShow: false,
items: [
{
text: "全部",
......@@ -75,14 +75,14 @@ Component({
// 视频海报
videoActive: 0,
overlayShow: false,
checkPosterItem:{
src:`${IMG_URL}index/poster/poster3-0.png`
checkPosterItem: {
src: `${IMG_URL}index/poster/poster3-0.png`,
},
// checkVideoItem:{}
},
lifetimes: {
attached() {
this.setProType()
this.setProType();
},
ready() {
// console.log('lifetimes',this)
......@@ -107,16 +107,16 @@ Component({
//头部tab显示
setTimeout(() => {
this.setData({
tabHeaderShow:true
})
},200)
tabHeaderShow: true,
});
}, 200);
},
},
/**
* 组件的方法列表
*/
methods: {
setProType(){
setProType() {
let { tabActive } = this.data;
let typeItems = this.getAllTypePro(tabActive, "productList");
typeItems.unshift({
......@@ -131,7 +131,7 @@ Component({
// getAllTypePro(3,'productList')
getAllTypePro(index, type) {
// console.log('senceData[index]',senceData[index])
let {senceData} = this.data
let { senceData } = this.data;
//获取所有分类
let res = []; //[ { text: '美容类',type:xxx }, { text: '轻改类',type:xxx } ]
let list = senceData[index][type];
......@@ -155,7 +155,7 @@ Component({
// 开通
openPro() {},
openBus() {
wx.$router.go('/packagesList/apply/pages/apply')
wx.$router.go("/packagesList/apply/pages/apply");
},
onClickHide() {
this.setData({ overlayShow: false });
......@@ -179,47 +179,57 @@ Component({
// 头部tab回调
onTabChange(event) {
// console.log("event: ", event);
let index = event.detail.index
let index = event.detail.index;
this.setData({
tabActive:index
})
tabActive: index,
});
},
checkImgProd() {
let { tabActive } = this.data;
let userInfo = wx.$storage.get("userInfo");
let obj = {
actNum: tabActive, //选中的场景
activeNavIdx: 0, //选中的产品
phone: userInfo.phone,
};
wx.$router.go("/pages/viewProd/index", obj);
},
checkProd(e){
let {tabActive} = this.data
let userInfo = wx.$storage.get('userInfo')
checkProd(e) {
let { tabActive } = this.data;
let userInfo = wx.$storage.get("userInfo");
// let item = e.currentTarget.dataset.item
let index = e.currentTarget.dataset.index
let index = e.currentTarget.dataset.index;
let obj = {
actNum:tabActive, //选中的场景
activeNavIdx:index, //选中的产品
phone: userInfo.phone
}
wx.$router.go("/pages/viewProd/index",obj)
actNum: tabActive, //选中的场景
activeNavIdx: index, //选中的产品
phone: userInfo.phone,
};
wx.$router.go("/pages/viewProd/index", obj);
},
// 查看海报 视频
checkVideo(e){
checkVideo(e) {
// console.log('e: ', e);
let {tabActive} = this.data
let { tabActive } = this.data;
// let item = e.currentTarget.dataset.item
let index = e.currentTarget.dataset.index
let index = e.currentTarget.dataset.index;
// this.setData({
// checkVideoItem:item
// })
let obj = {
tabActive,
videoIndex:index
}
wx.$router.go("/pages/viewVideo/index",obj)
videoIndex: index,
};
wx.$router.go("/pages/viewVideo/index", obj);
},
checkPoster(e){
checkPoster(e) {
// console.log('e: ', e);
let item = e.currentTarget.dataset.item
let item = e.currentTarget.dataset.item;
this.setData({
checkPosterItem:item,
overlayShow:true
})
checkPosterItem: item,
overlayShow: true,
});
},
// 选车场景切换
......
......@@ -2,7 +2,7 @@
<view class="pro-head">
<van-tabs active="{{ tabActive }}" class="{{tabHeaderShow?'':'pro-head-hidden'}}" bind:change="onTabChange">
<van-tab wx:for="{{senceData}}" wx:key="index" title="{{item.tabname}}">
<image class="pro-banner" src="{{item.banner}}?v={{img_version}}" />
<image class="pro-banner" src="{{item.banner}}?v={{img_version}}" bindtap="checkImgProd" />
</van-tab>
</van-tabs>
</view>
......
......@@ -22,7 +22,7 @@ page {
font-weight: 500;
font-size: 32rpx;
color: #323436;
line-height: 48rpx;
// line-height: 48rpx;
}
.check {
margin-left: 30rpx;
......
......@@ -18,9 +18,10 @@
display: flex;
}
.down{
margin-right: 32rpx;
// margin-right: 32rpx;
}
.forward-btn{
margin-left: 32rpx;
padding: 0;
background-color: #fff;
line-height: 1;
......
......@@ -9,14 +9,19 @@
margin-left: 32rpx;
margin-right: 32rpx;
display:flex;
align-items:center;
align-items:flex-start;
.title{
width: 564rpx;
height: 48rpx;
// height: 48rpx;
font-weight: 500;
font-size: 32rpx;
color: #323436;
line-height: 48rpx;
// line-height: 48rpx;
}
.check-wrap{
display: flex;
align-items: center;
height: 42rpx;
}
.check{
margin-left: 30rpx;
......
......@@ -6,12 +6,14 @@
<view class="title" >
{{videoitem.name}}
</view>
<image class="check" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num">
{{videoitem.view}}
<view class="check-wrap">
<image class="check" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num">
{{videoitem.view}}
</view>
</view>
</view>
<view class="gus-like">
<view class="gus-like" wx:if="{{videoLeft.length != 1}}">
猜你喜欢
</view>
<view class="gus-list">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!