Commit c51a4f0e authored by 王炽's avatar 王炽

工具修改

parent ed443524
......@@ -18,4 +18,11 @@ export const getGrowthCurveData = (babyData) => api.post('/c/growth/curve/data',
export const getGrowthHistoryList = () => api.post('/c/growth/history/list');
export const getGrowthAssessmentDetail = (assessmentId) => api.get('/c/growth/assessment/detail', { assessmentId });
// export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'});
\ No newline at end of file
// export const fetchHomeJSON = () => api.get('/c/front/content',{type:'home'});
/**
* 获取生长工具配置信息
* @returns
*/
export const fetchShengzhangToolsJSON = () => api.get('/c/front/content',{type:'shengzhang'});
\ No newline at end of file
......@@ -130,7 +130,7 @@
{
"path": "pages/shengzhangTools/shengzhangTools",
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": "生长测评"
}
},
{
......@@ -149,7 +149,7 @@
{
"path": "pages/shengzhangTestResult/shengzhangTestResult",
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": "生长测评"
}
}
],
......
......@@ -2,25 +2,26 @@
<view class="shengzhang-tools-container">
<swiper
class="banner-swiper"
:indicator-dots="swiperData.length > 1"
:autoplay="swiperData.length > 1"
:circular="swiperData.length > 1"
:indicator-dots="swiperData?.length > 1"
:autoplay="swiperData?.length > 1"
:circular="swiperData?.length > 1"
indicator-color="#dfddd9"
indicator-active-color="#b27c1e"
:indicator-top="596"
v-if="swiperData && swiperData?.length > 0"
>
<swiper-item v-for="(item, index) in swiperData" :key="index">
<image
class="banner-img"
:src="`${$baseUrl}${item?.bannerImg}`"
:src="`${$baseUrl}${item?.img}`"
mode="aspectFill"
@click="bannerHandler(item)"
/>
</swiper-item>
</swiper>
<image @tap="backHandler" class="btnback" :src="$baseUrl + `shengzhangTool/1001/backBtn.png`"></image>
<text class="title">生长测评</text>
<!-- <image @tap="backHandler" class="btnback" :src="$baseUrl + `shengzhangTool/1001/backBtn.png`"></image>
<text class="title">生长测评</text> -->
<view class="info-container">
<!-- 顶部宝宝信息区域 -->
<view class="baby-info-section">
......@@ -261,7 +262,7 @@ import BabySwitchPopup from '@/components/BabySwitchPopup.vue'
import BabyFeedSwitchPopup from '@/components/BabyFeedSwitchPopup.vue'
import DatePickerPopup from '@/components/DatePickerPopup.vue'
import BabyTestTipsPopup from '@/components/BabyTestTipsPopup.vue'
import { growthHome, guideCompleted, getGrowthCurveData } from '../../api/shengzhangTools'
import { growthHome, guideCompleted, getGrowthCurveData,fetchShengzhangToolsJSON } from '../../api/shengzhangTools'
import { onLoad,onShow } from "@dcloudio/uni-app";
import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js';
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
......@@ -269,12 +270,6 @@ import { useUserStore } from "@/stores/user";
const isTip = ref(false);
const swiperData = ref([
{ bannerImg: `shengzhangTool/1001/banner1.png` },
{ bannerImg: `shengzhangTool/1001/banner2.png` },
{ bannerImg: `shengzhangTool/1001/banner3.png` }
])
const babyName = ref('宝宝名称')
const babyAge = ref('8月龄')
const babyBirthday = ref('')
......@@ -288,6 +283,13 @@ const showLoading = ref(false);
const bannerHandler = (item) => {
console.log(item)
if(item?.url != ""){
jump({
type: item.type,
url: item.url,
extra: item.extra
})
}
}
// 首页组件逻辑
......@@ -719,8 +721,29 @@ onShow(async () => {
}
})
const shengzhangToolsData = ref({activeInfo:[
{
"img": "shengzhangTool/1001/banner1.png",
"url": "subPackages/shopMainList/topicNew/index?id=1000911",
"type": 2,
"extra": {
"appId": "wx4205ec55b793245e",
"envVersion": "release"
}
}
]
});
const swiperData = ref([]);
onMounted(async () => {
const {data} = await fetchShengzhangToolsJSON();
if(data){
shengzhangToolsData.value = {...data};
}else{
shengzhangToolsData.value = {activeInfo:[]};
}
swiperData.value = shengzhangToolsData?.value?.activeInfo || [];
})
const refreshBabyInfo = async () => {
......@@ -767,18 +790,20 @@ const refreshBabyInfo = async () => {
<style lang="less" scoped>
.shengzhang-tools-container {
width: 100%;
overflow-x: hidden;
overflow-y: auto;
background-color: #fdf6eb;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
background-color: #fdf6eb;
display: flex;
flex-flow: column;
.banner-swiper {
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 191rpx;
position: relative;
width: 687rpx;
margin-left: 32rpx;
height: 176rpx;
padding-bottom: 50rpx;
.banner-img {
width: 100%;
......@@ -808,7 +833,7 @@ const refreshBabyInfo = async () => {
.info-container {
width: 750rpx;
height: 1210rpx;
margin: 414rpx auto 0;
// margin: 414rpx auto 0;
background-color: #ffffff;
border-top-left-radius: 32rpx;
border-top-right-radius: 32rpx;
......
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