提交 e1feb94d 作者: 吴佳伟

Merge branch 'dev' of https://gitlab.yiring.com/digital-agri/agri-app into dev

{
"name": "数字农服",
"version": "1.0.10",
"version": "1.0.14",
"description": "数字农服",
"keywords": [
"app",
......
<template>
<iframe :onload="onloadCode" style="width: 100%; height: 100%; border: 1px solid #fff; background: #000"></iframe>
</template>
<script>
export default {
props: {
src: {},
},
data() {
return {
onloadCode: '',
}
},
created() {
this.onloadCode = `this.contentWindow.document.body.innerHTML = '<video style="width: 100%;height: 100%" controls="controls" src="${this.src}"></video>';`
},
}
</script>
<style lang="scss"></style>
......@@ -40,12 +40,12 @@
{
"path": "pages/nongchang/nongchang",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "农场",
"backgroundColorTop": "#e6f5e8",
"backgroundColorBottom": "#e6f5e8",
"enablePullDownRefresh": true,
"app-plus": {
"titleNView": false,
"titleNView": true,
"bounce": false
}
}
......@@ -65,13 +65,13 @@
{
"path": "pages/chanxiao/chanxiao",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "产销",
"backgroundColorTop": "#e6f5e8",
"backgroundColorBottom": "#e6f5e8",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false,
"titleNView": true,
"bounce": false
}
}
......@@ -118,12 +118,12 @@
{
"path": "pages/fuwu/fuwu",
"style": {
"navigationBarTitleText": "",
"navigationBarTitleText": "服务",
"backgroundColorTop": "#e6f5e8",
"backgroundColorBottom": "#e6f5e8",
"enablePullDownRefresh": true,
"app-plus": {
"titleNView": false,
"titleNView": true,
"bounce": false
}
}
......@@ -146,7 +146,7 @@
"style": {
"navigationBarTitleText": "我的",
"app-plus": {
"titleNView": false,
"titleNView": true,
"bounce": false
}
}
......@@ -292,13 +292,12 @@
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {
"titleSize": "20",
"buttons": [
{
"text": "+ 添加基地",
"fontSrc": "/static/uni.ttf",
"color": "#fff",
"fontSize": "28rpx",
"fontSize": "26rpx",
"width": "auto"
}
]
......@@ -408,13 +407,12 @@
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {
"titleSize": "20",
"buttons": [
{
"text": "+ 添加设备",
"fontSrc": "/static/uni.ttf",
"color": "#fff",
"fontSize": "28rpx",
"fontSize": "26rpx",
"width": "auto"
}
]
......@@ -432,13 +430,12 @@
"backgroundColorBottom": "#F2F2F2",
"app-plus": {
"titleNView": {
"titleSize": "20",
"buttons": [
{
"text": "+ 添加资源",
"fontSrc": "/static/uni.ttf",
"color": "#fff",
"fontSize": "28rpx",
"fontSize": "26rpx",
"width": "auto"
}
]
......@@ -469,7 +466,7 @@
"app-plus": {
"scrollIndicator": "none",
"titleNView": {
"titleSize": "20"
"titleSize": "18"
}
}
},
......
......@@ -129,10 +129,8 @@
pageData.search.pageNo = 1
pageData.purchaseDemands = []
pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1)
getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
if (pageData.currentTransactionTab === 1) getPurchaseList()
if (pageData.currentTransactionTab === 2) getSupplyList()
}
// 采购/供应标签点击事件
......@@ -142,10 +140,8 @@ getSupplyList()
pageData.search.pageNo = 1
pageData.purchaseDemands = []
pageData.supplyInfos = []
if (pageData.currentTransactionTab === 1)
getPurchaseList()
if (pageData.currentTransactionTab === 2)
getSupplyList()
if (pageData.currentTransactionTab === 1) getPurchaseList()
if (pageData.currentTransactionTab === 2) getSupplyList()
}
// 新需求提醒点击事件
......@@ -190,14 +186,12 @@ getSupplyList()
onReachBottom(() => {
console.log('触底了')
if (pageData.currentTransactionTab === 1) {
if (pageData.total <= pageData.purchaseDemands.length)
return
if (pageData.total <= pageData.purchaseDemands.length) return
pageData.search.pageNo++
getPurchaseList()
}
if (pageData.currentTransactionTab === 2) {
if (pageData.total <= pageData.supplyInfos.length)
return
if (pageData.total <= pageData.supplyInfos.length) return
pageData.search.pageNo++
getSupplyList()
}
......@@ -207,9 +201,8 @@ return
<template>
<view class="codefun-flex-col page">
<view class="codefun-flex-col section">
<view class="codefun-mt-22 codefun-flex-col">
<text class="codefun-self-center text">{{ pageData.header.title }}</text>
<view class="codefun-mt-22 codefun-flex-col codefun-self-stretch">
<view class="codefun-flex-col">
<view class="codefun-flex-col codefun-self-stretch">
<image class="image_5" :src="pageData.header.bannerImage" />
<view class="codefun-mt-14 codefun-flex-row gap-1">
<view
......@@ -439,7 +432,7 @@ return
overflow-x: hidden;
padding-bottom: 32rpx;
.section {
padding: 28rpx 28rpx 8rpx;
padding: 0 28rpx 8rpx;
background-image: url('/static/images/codefun/7a5dc4ee864fe55da98b41c14ee3b931.png');
background-size: 100% 100%;
background-repeat: no-repeat;
......
......@@ -142,8 +142,7 @@
}
function getCurrentAddressInfo() {
if (!uni.getStorageSync('location'))
return
if (!uni.getStorageSync('location')) return
const { lon, lat } = uni.getStorageSync('location')
UserInfoAPI.location({
......@@ -722,4 +721,6 @@ return
margin-bottom: 0;
padding: 0;
}
}
}
</style>
......@@ -296,7 +296,7 @@
<view class="codefun-flex-col section">
<view class="codefun-flex-col group_2">
<view class="codefun-flex-col">
<view
<!-- <view
class="codefun-flex-row codefun-justify-center codefun-items-center codefun-relative group_3"
>
<text class="font text">{{ pageData.header.title }}</text>
......@@ -304,8 +304,8 @@
class="image_6 pos_2"
src="/static/images/codefun/2d7ca3ba49afaa9f885afb0ba601a403.png"
/>
</view>
<view class="codefun-flex-col mt-15">
</view> -->
<view class="codefun-flex-col">
<view class="codefun-flex-row codefun-items-center section_2">
<text class="codefun-shrink-0 font_2">岗位</text>
<text class="codefun-shrink-0 font_3 codefun-ml-2">{{
......@@ -747,7 +747,6 @@
}
}
.group_2 {
margin-top: 74rpx;
.group_3 {
padding: 9.04rpx 0 5.46rpx;
.text {
......
......@@ -36,7 +36,7 @@
],
data: {
phone: '',
password: '',
password: '123@2025',
code: '',
},
},
......@@ -51,7 +51,7 @@
// 注册参数
const params = {
phone: model.form.data.phone,
password: model.form.data.password || '123@2025',
password: model.form.data.password,
code: model.form.data.code,
}
......
......@@ -210,7 +210,7 @@
<template>
<view class="main page-bg">
<view class="w-full h-250 flex flex-row items-center avatar pt-44px pl-6">
<view class="w-full h-170 flex flex-row items-center avatar pl-6">
<CacheImage
:src="model.avatar"
width="150"
......@@ -232,14 +232,14 @@
</view>
</view>
</view>
<view class="px-6 pt-6">
<view class="px-6 pt-4">
<fui-list class="rd-3 overflow-hidden shadow" :top-border="false">
<fui-list-cell
arrow
v-for="(item, index) in items.slice(0, 2)"
:key="index"
:bottom-border="false"
:class="{ disabled: item.disabled }"
:class="{ disabled: item.disabled, '!hidden': index === 1 && pageData.farmsListTotal === 0 }"
v-show="item.show"
@tap="item.handle(item)"
>
......@@ -249,13 +249,11 @@
height="42"
background="transparent"
/>
<text class="ml-3.5 text-30 text-#67c17a font-bold">{{ item.title }}</text>
<text v-show="index === 0 && pageData.farmsListTotal === 0" class="text-red"
>({{ pageData.farmsListTotal || 0 }})</text
>
<view v-show="index === 0 && pageData.farmsListTotal === 0" class="text-red flex-1 text-right"
>去添加
</view>
<text class="ml-3.5 text-30">{{ item.title }}</text>
<text v-show="index === 0" class="text-#67c17a text-28 font-bold" style="letter-spacing: 4rpx">
{{ pageData.farmsListTotal || 0 }}
</text>
<view v-show="index === 0" class="text-#67c17a flex-1 text-right text-28">去添加 </view>
</fui-list-cell>
</fui-list>
<fui-list class="rd-3 overflow-hidden shadow !mt-20rpx" :top-border="false">
......@@ -309,7 +307,7 @@
width: 100%;
height: 100%;
// #ifdef H5
height: calc(100vh - 60px);
height: calc(100vh - 60px - 44px);
// #endif
}
......
......@@ -355,34 +355,35 @@
// 轮播视频切换的时候触发
function handleChangeVideo(e: any) {
const currentIndex = e.detail.current
const prevIndex = pageData.current
pageData.current = currentIndex
pageData.agricultureClass.title = pageData.agricultureClass.videoList[currentIndex]?.title
// 延迟处理视频切换,避免卡顿
setTimeout(() => {
// 停止所有其他视频的播放(只暂停,不重置位置)
pageData.agricultureClass.videoList.forEach((_, index) => {
if (index !== currentIndex) {
try {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause()
// 不重置到开头,保留播放位置
} catch (error) {
console.log('停止视频失败:', error)
}
} else {
// 当前视频:尝试播放
try {
const videoContext = uni.createVideoContext(`video${index}`)
// 自动播放当前视频
videoContext.play()
} catch (error) {
console.log('播放视频失败:', error)
}
}
})
}, 100)
console.log('当前索引:', currentIndex)
// // 延迟处理视频切换,避免卡顿
// setTimeout(() => {
// // 停止所有其他视频的播放(只暂停,不重置位置)
// pageData.agricultureClass.videoList.forEach((_, index) => {
// if (index !== currentIndex) {
// try {
// const videoContext = uni.createVideoContext(`video${index}`)
// videoContext.pause()
// // 不重置到开头,保留播放位置
// } catch (error) {
// console.log('停止视频失败:', error)
// }
// } else {
// // 当前视频:尝试播放
// try {
// const videoContext = uni.createVideoContext(`video${index}`)
// // 自动播放当前视频
// videoContext.play()
// } catch (error) {
// console.log('播放视频失败:', error)
// }
// }
// })
// }, 100)
}
// 处理swiper过渡动画
......@@ -414,20 +415,47 @@
function handleVideoPause(currentIndex) {
console.log(`视频${currentIndex}暂停`)
}
function playVideo(index) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.requestFullScreen()
videoContext.play()
}
function handleFullscreenChange(e: any, index) {
console.log(`视频${index}全屏状态改变`)
if (!e.detail.fullScreen) {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause()
}
}
onHide(() => {
// 停止所有其他视频的播放(只暂停,不重置位置)
pageData.agricultureClass.videoList.forEach((_, index) => {
try {
const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause()
// 不重置到开头,保留播放位置
} catch (error) {
console.log('停止视频失败:', error)
}
})
})
</script>
<template>
<view class="codefun-flex-col page">
<view class="codefun-flex-col group">
<view class="codefun-flex-col section">
<view class="codefun-flex-col mt-52rpx">
<text class="codefun-self-center font text">{{ pageData.header.title }}</text>
<view class="codefun-flex-col codefun-self-stretch mt-19">
<view class="codefun-flex-col">
<!-- <text class="codefun-self-center font text">{{ pageData.header.title }}</text> -->
<view class="codefun-flex-col codefun-self-stretch">
<!-- <view class="codefun-flex-row codefun-items-center section_2">
<image class="image_5" src="/static/images/codefun/b8d30fcc0b08b881a41c8b3e35b7f8ac.png" />
<text class="codefun-ml-8 font_2 text_2">{{ pageData.header.searchPlaceholder }}</text>
</view> -->
<view class="codefun-mt-14 codefun-flex-row equal-division section_3">
<view class="codefun-flex-row equal-division section_3">
<view
v-for="item in pageData.menuItems"
:key="item.id"
......@@ -717,7 +745,7 @@
<text class="font text_66">农技学习</text>
<text class="font_6 text_43 text_67" @click="onViewMoreClass">查看更多</text>
</view>
<view class="codefun-flex-col section_20">
<view class="codefun-flex-col section_20 !relative">
<fui-swiper-dot
:items="pageData.agricultureClass.videoList"
:current="pageData.current"
......@@ -743,23 +771,32 @@
@transition="handleTransition"
>
<swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<image
:src="video.cover_image"
mode="scaleToFill"
class="w-654rpx h-358rpx"
@click="playVideo(index)"
/>
<video
:id="`video${index}`"
:src="video.media_video"
:poster="video.cover_image"
:controls="false"
:title="video.title"
:controls="true"
style="width: 654rpx; height: 358rpx"
:autoplay="false"
:autoplay="true"
:muted="false"
:loop="false"
:loop="true"
:show-play-btn="true"
:show-center-play-btn="true"
:enable-progress-gesture="false"
:show-progress="false"
:enable-progress-gesture="true"
:show-progress="true"
object-fit="contain"
@loadedmetadata="handleMetadataLoaded"
@play="handleVideoPlay(index)"
@pause="handleVideoPause(index)"
@fullscreenchange="handleFullscreenChange($event, index)"
class="!hidden"
></video>
</swiper-item>
</swiper>
......@@ -885,7 +922,7 @@
.group {
.section {
padding: 28rpx 28rpx 116rpx;
padding: 0 28rpx 116rpx;
background-image: url('/static/images/codefun/7a5dc4ee864fe55da98b41c14ee3b931.png');
background-size: 100% 100%;
background-repeat: no-repeat;
......@@ -1836,6 +1873,7 @@
position: absolute;
bottom: 52rpx;
left: 40rpx;
z-index: 1;
.text_34 {
color: #ffffff;
......
......@@ -478,7 +478,7 @@
</view>
</view>
</view>
<view class="codefun-flex-col section_9 codefun-mt-12">
<view class="codefun-flex-col section_9 codefun-mt-12 !hidden">
<view
class="codefun-flex-row codefun-justify-between codefun-items-center"
v-for="service in pageData.support.services"
......
......@@ -11,7 +11,7 @@ const PROXY_LIST: [[string, string]?] = [
// [`http://192.168.0.100:18100`, `https://oss.beta.app.yiring.com`],
// 开发环境(预览)
[`http://192.168.0.156:18100`, `http://36.133.16.81:42112`],
[`http://192.168.0.156:18100`, `http://111.22.182.169:49091`],
]
/**
......
......@@ -44,7 +44,7 @@ export function closeSplashscreenAndChechUpgrade() {
reject(e)
}
},
isAndroid ? 1000 : 50,
isAndroid ? 200 : 50,
)
})
// #endif
......
......@@ -144,6 +144,7 @@ declare module 'vue' {
FuiWhiteSpace: typeof import('./../src/components/FirstUI/fui-white-space/fui-white-space.vue')['default']
FuiWingBlank: typeof import('./../src/components/FirstUI/fui-wing-blank/fui-wing-blank.vue')['default']
Icon: typeof import('./../src/components/Icon/index.vue')['default']
IframeVideo: typeof import('./../src/components/IframeVideo/index.vue')['default']
ThumbnailPreview: typeof import('./../src/components/ThumbnailPreview/index.vue')['default']
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论