提交 f9ba04ee 作者: e

feat: 优化农机图片

上级 df7ef32d
......@@ -20,8 +20,7 @@
videoApi.getList(params).then((res) => {
if (res.records.length > 0) {
const { records } = res;
console.log("*************************")
console.log(res);
let scale:any = 0;
for(let i = 0; i < records.length;i++){
if(records[i].width){
......
......@@ -95,6 +95,7 @@
function postMachineryQueryById(){
NongjifuwuAPI.postMachineryQueryById({enterpriseId:enterpriseId}).then((res) => {
pageData.enterpriseProduct = res;
console.log(res);
})
}
// 文件上传
......@@ -260,7 +261,7 @@
<view class="module_separate"></view>
<view class="business_item" v-for="item in pageData.enterpriseProduct" :key="item.id">
<image class="business_img" src="/static/images/test/test.jpg" />
<image class="business_img" :src="item.image" />
<view class="yr-right">
<view>
<view class="product-name">{{item.name}}</view>
......
......@@ -30,8 +30,6 @@ onLoad(() => {
/*#endif*/
// 关闭启动页并检查更新
closeSplashscreenAndChechUpgrade();
// 农技课堂
getAgricultureClassList();
})
onShow(() => {
......@@ -147,6 +145,9 @@ onShow(() => {
getServiceStatsList()
// 预警信息
getWarning()
// 农技课堂
getAgricultureClassList();
})
// 下拉刷新
......@@ -336,7 +337,7 @@ function getAgricultureClassList() {
getVideoList({ pageNo: 1, pageSize: 10, status: 1 }).then((res) => {
const { records } = res;
/* let scale:any = 0;
let scale:any = 0;
for(let i = 0; i < records.length;i++){
if(records[i].width){
scale = (340 / records[i].width).toFixed(1);
......@@ -346,17 +347,17 @@ function getAgricultureClassList() {
records[i].videoWidth = 0;
records[i].videoHeight = 0;
}
} */
}
pageData.videoDataLen = records.length;
/* pageData.videoDataLen = records.length;
if(pageData.isApp){
let videwHtmlList = '';
for(let i = 0; i < pageData.videoDataLen;i++){
videwHtmlList += '<video class="htmlvideo" data-index="'+i+'" src="'+records[i].url+'"></video>'
}
pageData.videwHtmlList = videwHtmlList;
}
} */
pageData.agricultureClass.videoList = records;
})
......@@ -782,7 +783,7 @@ export default {
<text class="font_7 text_33" @click="onViewMoreClass">查看全部</text>
</view>
<view v-if="pageData.videoListIsShow" class="codefun-flex-col section_13 !relative rounded-lg" style="margin-left: -28rpx;">
<!-- <view v-if="pageData.videoListIsShow" class="codefun-flex-col section_13 !relative rounded-lg" style="margin-left: -28rpx;">
<fui-waterfall topGap="20" leftGap="20" rightGap="20" bottomGap="20">
<fui-waterfall-item :imgWidth="video.videoWidth" :imgHeight="video.videoHeight" :videoDuration="video.totalTime" v-for="(video, index) in pageData.agricultureClass.videoList" :key="index"
:src="video.thumbnailPath" @click="playVideo(index)">
......@@ -811,10 +812,10 @@ export default {
</view>
<view v-else style="width:0px;height:0px;display:none;" v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<video :src="video.url" @loadedmetadata="handleMetadataLoaded($event, video)"></video>
</view>
</view> -->
<!-- <view class="codefun-flex-col section_13 !relative rounded-lg" style="margin-left: -28rpx;">
<view class="codefun-flex-col section_13 !relative rounded-lg" style="margin-left: -28rpx;">
<fui-waterfall topGap="20" leftGap="20" rightGap="20" bottomGap="20">
<fui-waterfall-item :imgWidth="video.videoWidth" :imgHeight="video.videoHeight" :videoDuration="video.totalTime" v-for="(video, index) in pageData.agricultureClass.videoList" :key="index"
:src="video.thumbnailPath" @click="playVideo(index)">
......@@ -836,7 +837,7 @@ export default {
@fullscreenchange="handleFullscreenChange($event, index)" class="!hidden"></video>
</fui-waterfall-item>
</fui-waterfall>
</view> -->
</view>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论