提交 53d9ac7f 作者: 方治民

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

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