Commit 4a615296 authored by wangxuelai's avatar wangxuelai

'最新代码提交'

parent 190655b6
......@@ -270,6 +270,29 @@ Page({
if (data.total) {
this.data.viewsList[bigindex][smallindex].info.viewTotal = data.total;
}
data.list.forEach((ele, index) => {
if (ele.behavior.source_type == 3) {
const videoAndImage = JSON.parse(ele.behavior.morph_source_record.video);
const audios = JSON.parse(ele.behavior.morph_source_record.audio);
const videos = videoAndImage.filter(ele => ele.type == 'video');
const images = videoAndImage.filter(ele => ele.type == 'image');
let type = '';
let src = '';
if (videos.length > 0) {
type = 'video';
src = videos[0].src;
} else if (images.length > 0) {
type = 'image';
src = images[0].src;
} else if (audios.length > 0) {
type = 'audio';
} else {
type = 'text';
}
ele.clockDetailType = type;
ele.clockDetailsrc = src;
}
})
switch (type) {
case 'init': // 初始化
this.setData({
......@@ -311,6 +334,7 @@ Page({
default:
break;
}
console.log(this.data.viewsList, 'viewsList');
this.setData({
[`viewsList[${bigindex}][${smallindex}].info.loading`]: false,
[`viewsList[${bigindex}][${smallindex}].info.expand`]: true,
......@@ -554,6 +578,29 @@ Page({
if (data.total) {
this.data.sharesList[bigindex][smallindex].info.shareTotal = data.total;
}
data.list.forEach((ele, index) => {
if (ele.source_type == 3) {
const videoAndImage = JSON.parse(ele.morph_source_record.video);
const audios = JSON.parse(ele.morph_source_record.audio);
const videos = videoAndImage.filter(ele => ele.type == 'video');
const images = videoAndImage.filter(ele => ele.type == 'image');
let type = '';
let src = '';
if (videos.length > 0) {
type = 'video';
src = videos[0].src;
} else if (images.length > 0) {
type = 'image';
src = images[0].src;
} else if (audios.length > 0) {
type = 'audio';
} else {
type = 'text';
}
ele.clockDetailType = type;
ele.clockDetailsrc = src;
}
})
switch (type) {
case 'init': // 初始化
this.setData({
......@@ -636,6 +683,31 @@ Page({
if (data.total){
this.data.clueTotal = data.total;
}
data.list.forEach((ele, index) => {
if (ele.last_behavior.source_type == 3) {
console.log(ele, 'ele');
const videoAndImage = JSON.parse(ele.last_behavior.morph_source_record.video);
const audios = JSON.parse(ele.last_behavior.morph_source_record.audio);
const videos = videoAndImage.filter(ele => ele.type == 'video');
const images = videoAndImage.filter(ele => ele.type == 'image');
let type = '';
let src = '';
if (videos.length > 0) {
type = 'video';
src = videos[0].src;
} else if (images.length > 0) {
type = 'image';
src = images[0].src;
} else if (audios.length > 0) {
type = 'audio';
} else {
type = 'text';
}
ele.clockDetailType = type;
ele.clockDetailsrc = src;
}
})
console.log('ddddddddddddddddd');
switch (type) {
case 'init': //页面进来第一次加载
this.setData({
......
This diff is collapsed.
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