Commit 6d330942 authored by weishengfei's avatar weishengfei

Merge branch 'dev' of gitlab2.dui88.com:fh/20250528_FHQ1 into dev

parents 6dd738ff 1e0f526e
...@@ -147,4 +147,4 @@ export const feedingVoiceResult = (data) => api.get('/c/feeding/voice/result', { ...@@ -147,4 +147,4 @@ export const feedingVoiceResult = (data) => api.get('/c/feeding/voice/result', {
// export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'}); export const fetchFeedingJSON = () => api.get('/c/front/content',{type:'feeding'});
\ No newline at end of file \ No newline at end of file
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<view class="feeding-record-add-page"> <view class="feeding-record-add-page">
<!-- 可滚动内容区域 --> <!-- 可滚动内容区域 -->
<!-- 广告横幅 --> <!-- 广告横幅 -->
<swiper class="banner-swiper" :indicator-dots="swiperData.length > 1" :autoplay="swiperData.length > 1" <swiper class="banner-swiper" v-if="swiperData.length > 0" :indicator-dots="swiperData.length > 1"
:circular="swiperData.length > 1" indicator-color="#dfddd9" indicator-active-color="#b27c1e" :autoplay="swiperData.length > 1" :circular="swiperData.length > 1" indicator-color="#dfddd9"
:indicator-top="596"> indicator-active-color="#b27c1e" :indicator-top="596">
<swiper-item v-for="(item, index) in swiperData" :key="index"> <swiper-item v-for="(item, index) in swiperData" :key="index">
<image class="banner-img" :src="`${item?.bannerImg}`" mode="aspectFill" @click="bannerHandler(item)" /> <image class="banner-img" :src="`${item?.bannerImg}`" mode="aspectFill" @click="bannerHandler(item)" />
</swiper-item> </swiper-item>
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
import { ref, computed, onMounted, onUnmounted, getCurrentInstance } from 'vue' import { ref, computed, onMounted, onUnmounted, getCurrentInstance } from 'vue'
import { onShow, onLoad, onHide } from '@dcloudio/uni-app' import { onShow, onLoad, onHide } from '@dcloudio/uni-app'
import BabySwitchPopup from '@/components/BabySwitchPopup.vue' import BabySwitchPopup from '@/components/BabySwitchPopup.vue'
import { feedingHome, feedingRecords, feedingFoodsCustom, feedingFoodsCustomAdd, feedingFoodsCustomDelete, feedingTimerStart, feedingTimerStop, feedingVoiceUpload, feedingVoiceResult } from '@/api/feeding.js' import { fetchFeedingJSON, feedingHome, feedingRecords, feedingFoodsCustom, feedingFoodsCustomAdd, feedingFoodsCustomDelete, feedingTimerStart, feedingTimerStop, feedingVoiceUpload, feedingVoiceResult } from '@/api/feeding.js'
import { useUserStore } from '@/stores/user.js' import { useUserStore } from '@/stores/user.js'
import { jump, JumpType } from '../../utils' import { jump, JumpType } from '../../utils'
import { getHealthField } from "@/api/common"; import { getHealthField } from "@/api/common";
...@@ -510,27 +510,9 @@ const feedingIndexRes = { ...@@ -510,27 +510,9 @@ const feedingIndexRes = {
icon_btn_cancel: $baseUrl + `feedingIndex/${version}/icon_btn_cancel.png`, icon_btn_cancel: $baseUrl + `feedingIndex/${version}/icon_btn_cancel.png`,
} }
const swiperData = ref([{ const swiperData = ref([
bannerImg: feedingIndexRes.banner,
jumpType: JumpType.H5, ]);
url: 'https://www.baidu.com'
}, {
bannerImg: feedingIndexRes.banner,
jumpType: JumpType.MINI,
extra: {
appId: 'wx4205ec55b793245e',
envVersion: 'release',
success: () => {
console.log('跳转成功')
},
},
url: 'subPackages/xmhMainProcess/member/index?entrySource=xmh_wechatmp_points_recgoodsbot'
}, {
bannerImg: feedingIndexRes.banner,
jumpType: JumpType.INNER,
url: '/pages/index/index'
}]);
const indicatorStyle = `height: 40px; border: none;` const indicatorStyle = `height: 40px; border: none;`
// 当前时间,使用 home 接口的 timestamp // 当前时间,使用 home 接口的 timestamp
...@@ -987,6 +969,22 @@ async function loadHomeData() { ...@@ -987,6 +969,22 @@ async function loadHomeData() {
icon: 'none' icon: 'none'
}) })
} }
swiperData.value =
// 获取轮播图数据
try {
const feedingResponse = await fetchFeedingJSON()
console.log('轮播图数据:', feedingResponse)
if (feedingResponse && feedingResponse.data) {
swiperData.value = feedingResponse.data.swiperData
}
} catch (error) {
console.error('获取轮播图数据失败:', error)
// 使用默认的轮播图数据作为fallback
swiperData.value = []
}
} }
// 根据接口数据初始化页面状态 // 根据接口数据初始化页面状态
...@@ -3461,7 +3459,7 @@ function loadDefaultFoodsData() { ...@@ -3461,7 +3459,7 @@ function loadDefaultFoodsData() {
/* ===== 广告横幅 ===== */ /* ===== 广告横幅 ===== */
.banner-swiper { .banner-swiper {
position: absolute; position: relative;
top: 0; top: 0;
left: 16rpx; left: 16rpx;
width: 718rpx; width: 718rpx;
...@@ -3476,8 +3474,8 @@ function loadDefaultFoodsData() { ...@@ -3476,8 +3474,8 @@ function loadDefaultFoodsData() {
/* ===== 喂养时间区域 ===== */ /* ===== 喂养时间区域 ===== */
.feeding-time { .feeding-time {
position: absolute; position: relative;
top: 174rpx; // margin-top: 174rpx;
left: 0; left: 0;
right: 0; right: 0;
display: flex; display: flex;
...@@ -3564,8 +3562,8 @@ function loadDefaultFoodsData() { ...@@ -3564,8 +3562,8 @@ function loadDefaultFoodsData() {
/* ===== 喂养记录链接 ===== */ /* ===== 喂养记录链接 ===== */
.feeding-records { .feeding-records {
position: absolute; position: relative;
top: 270rpx; // margin-top: 270rpx;
left: 0; left: 0;
right: 0; right: 0;
display: flex; display: flex;
...@@ -3595,8 +3593,8 @@ function loadDefaultFoodsData() { ...@@ -3595,8 +3593,8 @@ function loadDefaultFoodsData() {
/* ===== 喂养类型选择 ===== */ /* ===== 喂养类型选择 ===== */
.feeding-types { .feeding-types {
position: absolute; position: relative;
top: 320rpx; // margin-top: 320rpx;
left: 0; left: 0;
right: 0; right: 0;
display: flex; display: flex;
...@@ -3663,8 +3661,8 @@ function loadDefaultFoodsData() { ...@@ -3663,8 +3661,8 @@ function loadDefaultFoodsData() {
/* ===== 温馨提示 ===== */ /* ===== 温馨提示 ===== */
.warm-tip { .warm-tip {
position: absolute; position: relative;
top: 20rpx; // margin-top: 20rpx;
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
...@@ -4467,8 +4465,7 @@ function loadDefaultFoodsData() { ...@@ -4467,8 +4465,7 @@ function loadDefaultFoodsData() {
/* ===== 下半部分背景区域 ===== */ /* ===== 下半部分背景区域 ===== */
.bottom-section { .bottom-section {
position: absolute; position: relative;
top: 460rpx;
left: 0; left: 0;
right: 0; right: 0;
width: 100%; width: 100%;
......
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