Commit b7d6a7ab by luyt

feat:视频处理

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