Commit 0bb7feb2 authored by 张娇(东信)'s avatar 张娇(东信)

乡村旅居视频播放 筑农详情顶部优化

parent a22e20c1
...@@ -174,7 +174,10 @@ ...@@ -174,7 +174,10 @@
{ {
"path": "pages/assistingAgriculture/detail/detail", "path": "pages/assistingAgriculture/detail/detail",
"style": { "style": {
"navigationBarTitleText": "详情页" "navigationBarTitleText": "商品详情",
"navigationBarBackgroundColor": "#ffffff",
"navigationStyle": "custom",
"onReachBottomDistance": 50,
} }
}, },
{ {
...@@ -264,4 +267,4 @@ ...@@ -264,4 +267,4 @@
"globalStyle": { "globalStyle": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
} }
\ No newline at end of file
...@@ -55,15 +55,16 @@ ...@@ -55,15 +55,16 @@
style="width: 32rpx; height: 32rpx" style="width: 32rpx; height: 32rpx"
/> />
<video <video
:class="{ 'no-progress-bar': !isFullScreen }"
:show-fullscreen-btn="true"
:show-play-btn="true"
:show-enter-play-btn="true"
class="spe-img1" class="spe-img1"
id="videoId" id="videoId"
:src="videoList[0].videoUrl" :src="videoList[0].videoUrl"
@error="videoErrorCallback" @error="videoErrorCallback"
:danmu-list="danmuList"
enable-danmu
danmu-btn
@play="play" @play="play"
@fullscreenchange="fullscreenchange" @fullscreenchange="handleFullscreenChange"
></video> ></video>
<!-- <img--> <!-- <img-->
<!-- class="spe-img"--> <!-- class="spe-img"-->
...@@ -188,6 +189,7 @@ ...@@ -188,6 +189,7 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="!hasMoreData" class="no-more-data">没有更多了</view>
</view> </view>
</view> </view>
<fab position="3" /> <fab position="3" />
...@@ -230,7 +232,7 @@ const screenRef = ref(null); ...@@ -230,7 +232,7 @@ const screenRef = ref(null);
const backgroundBox = ref(''); const backgroundBox = ref('');
const border = ref(''); const border = ref('');
const videoList = ref([]); const videoList = ref([]);
const isFullScreen = ref(false);
const locationFiltering = (index) => { const locationFiltering = (index) => {
switch (index) { switch (index) {
case 0: case 0:
...@@ -311,6 +313,9 @@ function fullscreenchange(e) { ...@@ -311,6 +313,9 @@ function fullscreenchange(e) {
uni.createVideoContext('videoId').pause(); uni.createVideoContext('videoId').pause();
} }
} }
function handleFullscreenChange(event) {
isFullScreen.value = !isFullScreen.value;
}
// //退出全屏时停止 // //退出全屏时停止
// function fullscreenchange (e){ // function fullscreenchange (e){
// if(!e.detail.fullScreen){ // if(!e.detail.fullScreen){
...@@ -362,16 +367,15 @@ const screenParams = (selectedItems, type) => { ...@@ -362,16 +367,15 @@ const screenParams = (selectedItems, type) => {
} }
}; };
// 搜索 // 搜索
// 搜索
const toSearch = () => { const toSearch = () => {
xma.navigateTo({ url: '/pages/assistingAgriculture/searchPage/searchPage?prodTypes=10' }); xma.navigateTo({ url: '/pages/assistingAgriculture/searchPage/searchPage?prodTypes=10' });
}; };
const currentPage = ref(1);
// 查询列表 // 查询列表
const getProd = (searchKeyword = '') => { const getProd = (searchKeyword = '') => {
const params = { const params = {
current: 1, current: currentPage.value,
size: 10, size: 3,
...(sortType.value && { sortType: sortType.value.sortMode }), ...(sortType.value && { sortType: sortType.value.sortMode }),
...(attractionIdList.value && ...(attractionIdList.value &&
attractionIdList.value.length > 0 && attractionIdList.value.length > 0 &&
...@@ -394,9 +398,25 @@ const getProd = (searchKeyword = '') => { ...@@ -394,9 +398,25 @@ const getProd = (searchKeyword = '') => {
item.img = import.meta.env.VITE_APP_IMG_URL + item.pic; item.img = import.meta.env.VITE_APP_IMG_URL + item.pic;
item.serveList = item.serviceList.slice(0, 3); item.serveList = item.serviceList.slice(0, 3);
}); });
cardList.value = res.data.records; if (currentPage.value === 1) {
cardList.value = res.data.records;
} else {
cardList.value = cardList.value.concat(res.data.records);
}
// 判断是否还有更多数据
if (res.data.records.length < params.size) {
hasMoreData.value = false; // 没有更多数据
}
}); });
}; };
// 页面滚动到底部触发加载更多
onReachBottom(() => {
if (hasMoreData.value) {
currentPage.value++;
getProd();
}
});
const hasMoreData = ref(true);
const resetParams = () => { const resetParams = () => {
if (sortRef.value || departureDateRef.value || scenicSpotsRef.value || screenRef.value) { if (sortRef.value || departureDateRef.value || scenicSpotsRef.value || screenRef.value) {
sortType.value = null; sortType.value = null;
...@@ -639,6 +659,10 @@ page { ...@@ -639,6 +659,10 @@ page {
font-weight: normal; font-weight: normal;
line-height: 30rpx; line-height: 30rpx;
color: #666666; color: #666666;
height: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} }
.tag .wd-tag { .tag .wd-tag {
margin-right: 10px; margin-right: 10px;
...@@ -653,11 +677,12 @@ page { ...@@ -653,11 +677,12 @@ page {
color: #0974f5; color: #0974f5;
} }
.price { .price {
position: absolute;
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
line-height: 28rpx; line-height: 28rpx;
color: #fa5151; color: #fa5151;
margin-left: 160rpx; margin-left: 300rpx;
} }
.venue { .venue {
display: flex; display: flex;
...@@ -721,4 +746,18 @@ uni-video { ...@@ -721,4 +746,18 @@ uni-video {
left: 20rpx; left: 20rpx;
border-radius: 16rpx; border-radius: 16rpx;
} }
.no-more-data {
text-align: center;
padding: 20rpx;
color: #999;
}
/* 默认隐藏进度条 */
.spe-img1::-webkit-media-controls-progress-panel {
display: none;
}
/* 当全屏时显示进度条 */
.spe-img1.no-progress-bar::-webkit-media-controls-progress-panel {
display: block;
}
</style> </style>
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
<!-- 顶部搜索框--> <!-- 顶部搜索框-->
<view class="top"> <view class="top">
<view class="top"> <view class="top">
<Search <Search style="z-index: 99; width: 100%" :type="2" backgroundBox="#fff">
background="rgba(255, 255, 255, 0.8)" <view style="width: 100%; text-align: center; font-size: 36rpx; font-weight: bold">
backIcon="black" 商品详情
iconSrc="/static/assistingAgriculture/assets/blackLeft.png" </view>
placeholderText="请输入要搜索的内容" </Search>
></Search>
</view> </view>
</view> </view>
<!-- 图片--> <!-- 图片-->
...@@ -97,7 +96,6 @@ ...@@ -97,7 +96,6 @@
</template> </template>
<script setup> <script setup>
import Search from '../../../components/assistingAgriculture/index/Search.vue';
import { ref } from 'vue'; import { ref } from 'vue';
import { onShow } from '@dcloudio/uni-app'; import { onShow } from '@dcloudio/uni-app';
import { import {
...@@ -237,18 +235,6 @@ function toSettle() { ...@@ -237,18 +235,6 @@ function toSettle() {
page { page {
background-color: #f3f3f3; background-color: #f3f3f3;
} }
.container {
position: relative;
left: 0rpx;
top: -45rpx;
opacity: 1;
}
.top {
width: 750rpx;
height: 128rpx;
margin-top: 40rpx;
background: #ffffff;
}
.nav { .nav {
width: 750rpx; width: 750rpx;
} }
...@@ -470,8 +456,4 @@ page { ...@@ -470,8 +456,4 @@ page {
margin-top: -90rpx; margin-top: -90rpx;
margin-left: 400rpx; margin-left: 400rpx;
} }
::v-deep.icon {
width: 56rpx;
height: 56rpx;
}
</style> </style>
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