提交 53d9ac7f 作者: 方治民

fix: 修复图片地址、接口前缀、界面链接交互等问题

上级 c7c8d68a
# API 接口地址 # API 接口地址
# VITE_GLOB_API_URL=http://111.22.182.169:49600 VITE_GLOB_API_URL=http://111.22.182.169:49600
VITE_GLOB_API_URL=http://36.133.16.81:42111 # VITE_GLOB_API_URL=http://36.133.16.81:42111
# API 接口地址前缀 # API 接口地址前缀
VITE_GLOB_API_URL_PREFIX=/jeecg-boot VITE_GLOB_API_URL_PREFIX=/jeecg-boot
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
title="服务协议及隐私保护" title="服务协议及隐私保护"
:buttons="[ :buttons="[
{ text: '不同意', plain: true }, { text: '不同意', plain: true },
{ text: '同意', plain: false }, { text: '同意', plain: false, color: '#fff' },
]" ]"
@click="onReadConfirm" @click="onReadConfirm"
> >
......
...@@ -286,6 +286,10 @@ ...@@ -286,6 +286,10 @@
function onBaseManagementClick(item: any) { function onBaseManagementClick(item: any) {
console.log('点击基地管理项:', item) console.log('点击基地管理项:', item)
// 在这里添加具体的基地管理点击逻辑 // 在这里添加具体的基地管理点击逻辑
uni.navigateTo({
url: '/pages/jidiguanli/jidiguanli',
})
} }
// 查看更多监测预警 // 查看更多监测预警
...@@ -311,7 +315,7 @@ ...@@ -311,7 +315,7 @@
// 在这里添加具体的查看逻辑 // 在这里添加具体的查看逻辑
// 跳转到灵活用工界面 // 跳转到灵活用工界面
Navigate.to('/pages/linghuoyonggong/linghuoyonggong?type=' + type) Navigate.to(`/pages/linghuoyonggong/linghuoyonggong?type=${type}`)
} }
// 查看金融服务 // 查看金融服务
...@@ -345,9 +349,9 @@ ...@@ -345,9 +349,9 @@
} }
// 解决轮播视频切换时,上一个视频不停止播放的问题 // 解决轮播视频切换时,上一个视频不停止播放的问题
const handleVideoPlay = (currentIndex) => { function handleVideoPlay(currentIndex) {
pageData.agricultureClass.videoList.forEach((_, index) => { pageData.agricultureClass.videoList.forEach((_, index) => {
if (index != currentIndex) { if (index !== currentIndex) {
const videoContext = uni.createVideoContext(`video${index}`) const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause() videoContext.pause()
} }
...@@ -477,7 +481,7 @@ ...@@ -477,7 +481,7 @@
<view class="codefun-flex-col group_15"> <view class="codefun-flex-col group_15">
<view class="codefun-flex-row codefun-justify-between codefun-items-baseline"> <view class="codefun-flex-row codefun-justify-between codefun-items-baseline">
<text class="font text_28">基地管理</text> <text class="font text_28">基地管理</text>
<text class="font_6 text_29">更多</text> <text class="font_6 text_29" @click="onBaseManagementClick">更多</text>
</view> </view>
<view class="codefun-flex-row equal-division_5 mt-17"> <view class="codefun-flex-row equal-division_5 mt-17">
<view <view
...@@ -679,7 +683,7 @@ ...@@ -679,7 +683,7 @@
> >
<swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index"> <swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<video <video
:id="'video' + index" :id="`video${index}`"
:src="video.media_video" :src="video.media_video"
:poster="video.cover_image" :poster="video.cover_image"
:controls="false" :controls="false"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<text class="font_2 text_3">选择市县乡镇</text> <text class="font_2 text_3">选择市县乡镇</text>
<image <image
class="codefun-shrink-0 image_7 codefun-ml-4" class="codefun-shrink-0 image_7 codefun-ml-4"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=774cfe989f8417dc655fb301635f5893.png" src="/static/images/codefun/774cfe989f8417dc655fb301635f5893.png"
/> />
</view> </view>
</view> </view>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<view class="codefun-flex-row group_6"> <view class="codefun-flex-row group_6">
<image <image
class="codefun-shrink-0 codefun-self-center image_8" class="codefun-shrink-0 codefun-self-center image_8"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=1f4e4111336d0f182201176d8c761a37.png" src="/static/images/codefun/1f4e4111336d0f182201176d8c761a37.png"
/> />
<view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center group_4"> <view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-self-center group_4">
<text class="font text_6">大联合收割机</text> <text class="font text_6">大联合收割机</text>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center"> <view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center">
<image <image
class="codefun-shrink-0 image_8" class="codefun-shrink-0 image_8"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=e3f873f79cdddaee3655c048852302e3.png" src="/static/images/codefun/e3f873f79cdddaee3655c048852302e3.png"
/> />
<view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12"> <view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12">
<text class="font text_9">小麦播种机</text> <text class="font text_9">小麦播种机</text>
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center"> <view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center">
<image <image
class="codefun-shrink-0 image_8" class="codefun-shrink-0 image_8"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=da314c458ad5d6714cfe7ee8524ccd9c.png" src="/static/images/codefun/da314c458ad5d6714cfe7ee8524ccd9c.png"
/> />
<view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12"> <view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12">
<text class="font text_12">多功能拖拉机</text> <text class="font text_12">多功能拖拉机</text>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center"> <view class="codefun-flex-row codefun-items-center codefun-flex-1 codefun-self-center">
<image <image
class="codefun-shrink-0 image_8" class="codefun-shrink-0 image_8"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=3500502108a998fe7f49363a276af806.png" src="/static/images/codefun/3500502108a998fe7f49363a276af806.png"
/> />
<view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12"> <view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-12">
<text class="font">水稻插秧机</text> <text class="font">水稻插秧机</text>
...@@ -143,51 +143,36 @@ ...@@ -143,51 +143,36 @@
<view class="grid"> <view class="grid">
<view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item"> <view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item">
<text class="font_3 text_19">农机类型</text> <text class="font_3 text_19">农机类型</text>
<image <image class="image_10" src="/static/images/codefun/a13c36a46232de65d09f43b1720ba29d.png" />
class="image_10"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=a13c36a46232de65d09f43b1720ba29d.png"
/>
</view> </view>
<view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item_2"> <view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item_2">
<view class="codefun-flex-row codefun-items-center"> <view class="codefun-flex-row codefun-items-center">
<image <image
class="codefun-shrink-0 image_9" class="codefun-shrink-0 image_9"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=bf7b1672e65ba021aa79827f30014280.png" src="/static/images/codefun/bf7b1672e65ba021aa79827f30014280.png"
/> />
<text class="font_3 text_20 codefun-ml-8">作业地点</text> <text class="font_3 text_20 codefun-ml-8">作业地点</text>
</view> </view>
<image <image class="image_10" src="/static/images/codefun/a13c36a46232de65d09f43b1720ba29d.png" />
class="image_10"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=a13c36a46232de65d09f43b1720ba29d.png"
/>
</view> </view>
<view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item_4"> <view class="codefun-flex-row codefun-justify-between codefun-items-center grid-item_4">
<view class="codefun-flex-row codefun-items-center"> <view class="codefun-flex-row codefun-items-center">
<image <image
class="codefun-shrink-0 image_11" class="codefun-shrink-0 image_11"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=206576465476f031295c48dcef261286.png" src="/static/images/codefun/206576465476f031295c48dcef261286.png"
/> />
<text class="font_3 text_21 codefun-ml-4">作业时间</text> <text class="font_3 text_21 codefun-ml-4">作业时间</text>
</view> </view>
<image <image class="image_10" src="/static/images/codefun/a13c36a46232de65d09f43b1720ba29d.png" />
class="image_10"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=a13c36a46232de65d09f43b1720ba29d.png"
/>
</view> </view>
<view class="codefun-flex-row codefun-items-center grid-item_4"> <view class="codefun-flex-row codefun-items-center grid-item_4">
<image <image class="image_12" src="/static/images/codefun/43220b5bebf6a41ff3f05e6ec94ce9f0.png" />
class="image_12"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=43220b5bebf6a41ff3f05e6ec94ce9f0.png"
/>
<text class="font_3 text_22 codefun-ml-4">联系方式</text> <text class="font_3 text_22 codefun-ml-4">联系方式</text>
</view> </view>
</view> </view>
<view class="codefun-flex-col codefun-mt-12"> <view class="codefun-flex-col codefun-mt-12">
<view class="codefun-flex-row codefun-items-center grid-item group_12"> <view class="codefun-flex-row codefun-items-center grid-item group_12">
<image <image class="image_13" src="/static/images/codefun/a83082710831140b897349a7f3bd46d9.png" />
class="image_13"
src="https://ide.code.fun/api/image?token=6902c43a9520a30011f4e723&name=a83082710831140b897349a7f3bd46d9.png"
/>
<text class="font_3 text_23 codefun-ml-8">简要说明作业需求</text> <text class="font_3 text_23 codefun-ml-8">简要说明作业需求</text>
</view> </view>
<view <view
...@@ -203,7 +188,7 @@ ...@@ -203,7 +188,7 @@
<style scoped lang="scss"> <style scoped lang="scss">
.page { .page {
padding-bottom: 64rpx; padding-bottom: 12rpx;
background-color: #e6f5e8; background-color: #e6f5e8;
mix-blend-mode: NOTTHROUGH; mix-blend-mode: NOTTHROUGH;
width: 100%; width: 100%;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
onLoad(() => { onLoad(() => {
uni.getLocation({ uni.getLocation({
type: 'wgs84', type: 'wgs84',
success: function (res) { success(res) {
pageData.weather.lon = res.longitude pageData.weather.lon = res.longitude
pageData.weather.lat = res.latitude pageData.weather.lat = res.latitude
uni.setStorageSync('location', { uni.setStorageSync('location', {
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
lat: res.latitude, lat: res.latitude,
}) })
}, },
fail: function (error) { fail() {
uni.showToast({ uni.showToast({
title: '获取地址失败,将导致部分功能不可用', title: '获取地址失败,将导致部分功能不可用',
icon: 'none', icon: 'none',
...@@ -243,7 +243,9 @@ ...@@ -243,7 +243,9 @@
}) })
} }
function getWarningInfo() { function getWarningInfo() {
if (!pageData.weather.lon || !pageData.weather.lat) return if (!pageData.weather.lon || !pageData.weather.lat) {
return
}
HomeAPI.warningInfo({ HomeAPI.warningInfo({
lon: pageData.weather.lon, lon: pageData.weather.lon,
...@@ -319,9 +321,9 @@ ...@@ -319,9 +321,9 @@
pageData.agricultureClass.time = e.target.duration pageData.agricultureClass.time = e.target.duration
} }
// 解决轮播视频切换时,上一个视频不停止播放的问题 // 解决轮播视频切换时,上一个视频不停止播放的问题
const handleVideoPlay = (currentIndex) => { function handleVideoPlay(currentIndex) {
pageData.agricultureClass.videoList.forEach((_, index) => { pageData.agricultureClass.videoList.forEach((_, index) => {
if (index != currentIndex) { if (index !== currentIndex) {
const videoContext = uni.createVideoContext(`video${index}`) const videoContext = uni.createVideoContext(`video${index}`)
videoContext.pause() videoContext.pause()
} }
...@@ -367,12 +369,12 @@ ...@@ -367,12 +369,12 @@
/> />
<view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-10"> <view class="codefun-flex-col codefun-items-start codefun-flex-1 codefun-ml-10">
<text class="text_5">{{ pageData.weather.temperature }}</text> <text class="text_5">{{ pageData.weather.temperature }}</text>
<text class="font_2 text_8 !text-26rpx codefun-mt-16">{{ <text class="font_2 text_8 !text-24rpx codefun-mt-16">{{
pageData.weather.condition pageData.weather.condition
}}</text> }}</text>
</view> </view>
</view> </view>
<view class="codefun-flex-col group_6 codefun-ml-22"> <view class="codefun-flex-col group_6 ml-2">
<view class="codefun-flex-row codefun-justify-between group_7"> <view class="codefun-flex-row codefun-justify-between group_7">
<!-- <image <!-- <image
class="image_9" class="image_9"
...@@ -587,7 +589,7 @@ ...@@ -587,7 +589,7 @@
> >
<swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index"> <swiper-item v-for="(video, index) in pageData.agricultureClass.videoList" :key="index">
<video <video
:id="'video' + index" :id="`video${index}`"
:src="video.media_video" :src="video.media_video"
:poster="video.cover_image" :poster="video.cover_image"
:controls="false" :controls="false"
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
margin-left: 18rpx; margin-left: 18rpx;
} }
.page { .page {
padding-bottom: 148rpx; padding-bottom: 28rpx;
background-color: #e6f5e8; background-color: #e6f5e8;
mix-blend-mode: NOTTHROUGH; mix-blend-mode: NOTTHROUGH;
width: 100%; width: 100%;
......
...@@ -9,6 +9,9 @@ const PROXY_LIST: [[string, string]?] = [ ...@@ -9,6 +9,9 @@ const PROXY_LIST: [[string, string]?] = [
// ['http://10.111.117.15:18100', `http://proxy.yiring.com:42180`], // ['http://10.111.117.15:18100', `http://proxy.yiring.com:42180`],
// eg: 生产环境 // eg: 生产环境
// [`http://192.168.0.100:18100`, `https://oss.beta.app.yiring.com`], // [`http://192.168.0.100:18100`, `https://oss.beta.app.yiring.com`],
// 开发环境(预览)
[`http://192.168.0.156:18100`, `http://111.22.182.169:49091`],
] ]
/** /**
...@@ -47,9 +50,15 @@ export function getIntranetUrl(url: string): string { ...@@ -47,9 +50,15 @@ export function getIntranetUrl(url: string): string {
*/ */
export function handleResponseResource<T>(body: T, options: Recordable) { export function handleResponseResource<T>(body: T, options: Recordable) {
for (const [intranet, extranet] of PROXY_LIST) { for (const [intranet, extranet] of PROXY_LIST) {
// FIXME: 临时处理,解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
const host = options.apiUrl.replace(/https?:\/\/(.*):\d+/, '$1')
const isIntranet = intranet.includes(host)
const isExtranet = extranet.includes(host)
// console.log('handleResponseResource', body, options.apiUrl, host, isIntranet, isExtranet)
// 当需要处理内外网资源地址映射时,进行内容处理 // 当需要处理内外网资源地址映射时,进行内容处理
const isIntranet = options.apiUrl.includes(intranet) // const isIntranet = options.apiUrl.includes(intranet)
const isExtranet = options.apiUrl.includes(extranet) // const isExtranet = options.apiUrl.includes(extranet)
if (isIntranet || isExtranet) { if (isIntranet || isExtranet) {
const isString = typeof body === 'string' const isString = typeof body === 'string'
const isObject = typeof body === 'object' const isObject = typeof body === 'object'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论