Commit c9404aba authored by kisszxc's avatar kisszxc

Merge branch 'showroom-order' of http://gitlab2.dui88.com/fh/20250528_FHQ1 into showroom-order

parents 84ecfcd2 62311f9e
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/person/person",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
"navigationStyle": "custom",
"usingComponents": {
"van-tab": "../../wxcomponents/vant/tab/index",
"van-tabs": "../../wxcomponents/vant/tabs/index"
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"navigationStyle": "custom"
}
},
{
"path": "pages/postnatalCheckUp/postnatalCheckUp",
"style": {
"navigationBarTitleText": "产检提醒"
}
},
{
"path": "pages/person/person",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/search/search",
"style": {
"navigationStyle": "custom",
"usingComponents": {
"van-tab": "../../wxcomponents/vant/tab/index",
"van-tabs": "../../wxcomponents/vant/tabs/index"
}
}
},
{
"path": "pages/product/product",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/library/ContentLibrary",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/goodsDetail/goodsDetail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/rightsDetail/rightsDetail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/naming/naming",
"style": {
"navigationBarTitleText": "星妈起名",
"enablePullDownRefresh": false
}
},
{
"path": "pages/naming/namingResult",
"style": {
"navigationBarTitleText": "星妈起名",
"enablePullDownRefresh": false
}
},
{
"path": "pages/expertTeamPage/expertTeamPage",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/syWebview/syWebview",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/feedingRecord/feedingRecord",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/addPostnatal/addPostnatal",
"style": {
"navigationBarTitleText": "新增产检",
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false
}
},
{
"path": "pages/myReportCard/myReportCard",
"style": {
"navigationBarTitleText": "我的报告单",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/productionCalendar/productionCalendar",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/productionDetails/productionDetails",
"style": {
"navigationBarTitleText": "产检详情",
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false
}
},
{
"path": "pages/editPostnatal/editPostnatal",
"style": {
"navigationBarTitleText": "产检项目",
"navigationBarBackgroundColor": "#ffffff",
"enablePullDownRefresh": false
}
},
{
"path": "pages/shengzhangTools/shengzhangTools",
"style": {
"navigationBarTitleText": "生长测评"
}
},
{
"path": "pages/feedingAnalysis/feedingAnalysis",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "pages/feedingIndex/feedingIndex",
"style": {
"navigationBarTitleText": "添加喂养记录"
}
},
{
"path": "pages/shengzhangTestResult/shengzhangTestResult",
"style": {
"navigationBarTitleText": "生长测评"
}
}
},
{
"path": "pages/product/product",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black"
}
},
{
"path": "pages/library/ContentLibrary",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/goodsDetail/goodsDetail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/rightsDetail/rightsDetail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/naming/naming",
"style": {
"navigationBarTitleText": "宝宝取名",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
],
"subPackages": [
{
"root": "reservation",
"pages": [
{
"path": "home/index",
"style": {
"navigationBarTitleText": "飞鹤奶粉"
}
},
{
"path": "subscribe/index",
"style": {
"navigationBarTitleText": "预约信息"
}
},
{
"path": "record/index",
"style": {
"navigationBarTitleText": "工业游预约记录"
}
},
{
"path": "record/detail",
"style": {
"navigationBarTitleText": "预约详情"
}
},
{
"path": "status/index",
"style": {
"navigationBarTitleText": "预约状态"
}
},
{
"path": "sign/index",
"style": {
"navigationBarTitleText": "签到"
}
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "default"
},
{
"path": "pages/naming/namingResult",
"style": {
"navigationBarTitleText": "AI-宝宝取名",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}
],
"subPackages": [
{
"root": "reservation",
"pages": [
{
"path": "home/index",
"style": {
"navigationBarTitleText": "飞鹤奶粉"
}
},
{
"path": "subscribe/index",
"style": {
"navigationBarTitleText": "预约信息"
}
},
{
"path": "record/index",
"style": {
"navigationBarTitleText": "工业游预约记录"
}
},
{
"path": "record/detail",
"style": {
"navigationBarTitleText": "预约详情"
}
},
{
"path": "status/index",
"style": {
"navigationBarTitleText": "预约状态"
}
},
{
"path": "sign/index",
"style": {
"navigationBarTitleText": "签到"
}
}
]
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8",
"navigationStyle": "default"
},
"uniIdRouter": {}
}
"uniIdRouter": {}
}
\ No newline at end of file
......@@ -146,6 +146,7 @@ import {
// 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue'
import { useUserStore } from "@/stores/user";
import md from '../../md';
// 获取用户信息
const userStore = useUserStore();
......@@ -190,6 +191,11 @@ const onPopupClose2 = () => {
}
// 修改时间
const onChangeTime = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "产检时间选择",
});
visible.value = true;
}
// 选择日期回调确认
......@@ -200,6 +206,11 @@ const handleDateConfirm = (date) => {
}
// 添加项目
const onAdd = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "产检项目添加",
});
wx.setPageStyle({
style: {
overflow: 'hidden'
......@@ -259,6 +270,12 @@ const saveSelection = () => {
// };
// 删除所选产品项目
const onDelete = (id) => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "删除产检项目",
});
listData.value.filter((item, index) => {
if (item.id == id) {
listData.value.splice(index, 1)
......@@ -283,6 +300,12 @@ const onImageDel = (e) => {
}
// 上传图片
const onUpload = throttleTap(() => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "上传报告单",
});
if (bgdImgList.value.length == 15) {
uni.showToast({
title: "最多上传15张图片",
......@@ -322,6 +345,11 @@ const onUpload = throttleTap(() => {
// 保存
const onSave = throttleTap( async () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "保存",
});
if (listData.value.length == 0) {
uni.showToast({
title: '还没有添加产检项哦',
......@@ -363,6 +391,12 @@ const onSave = throttleTap( async () => {
// 查看更多
const onSeeBtn = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "新增产检页",
buttonName: "查看全部",
});
// 跳转
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
......@@ -378,6 +412,10 @@ const getList = async () => {
}
}
onLoad((options) => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "新增产检页"
});
if (Object.keys(options).length > 0 && options.time) {
time.value = options.time
} else {
......
......@@ -93,6 +93,7 @@ import {
hideLoading
} from '@/utils/index.js';
import { onLoad } from '@dcloudio/uni-app'
import md from '../../md';
import {
getUpdate,
......@@ -133,6 +134,12 @@ const onPopupClose2 = () => {
// 添加项目
const onAdd = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "修改产检项目页",
buttonName: "添加产检项目",
});
wx.setPageStyle({
style: {
overflow: 'hidden'
......@@ -192,6 +199,12 @@ const saveSelection = () => {
// };
// 删除所选产品项目
const onDelete = (id) => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "修改产检项目页",
buttonName: "删除产检项目",
});
listData.value.filter((item, index) => {
if (item.id == id) {
listData.value.splice(index, 1)
......@@ -202,6 +215,12 @@ const onDelete = (id) => {
// 保存
const onSave = throttleTap(async () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "修改产检项目页",
buttonName: "保存",
});
if (listData.value.length == 0) {
uni.showToast({
title: '还没有添加产检项哦',
......@@ -249,6 +268,10 @@ const getList = async () => {
}
}
onLoad((options) => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "修改产检项目页"
});
const { id, examinationItems } = JSON.parse(options.item)
console.log(id, examinationItems)
editId.value = id
......
......@@ -189,6 +189,7 @@ import { ref, computed, onMounted, onUnmounted, watch, nextTick, getCurrentInsta
import { onLoad, onShow } from '@dcloudio/uni-app'
import { feedingRecordsStatisticsPeriod, feedingRecordsByDate, feedingRecords as feedingRecordsAPI, feedingRecordsDelete } from '@/api/feeding.js'
import { useUserStore } from '@/stores/user.js'
import md from '../../md';
// API 集成说明:
// 1. 使用 /c/feeding/statistics/period GET 方法查询统计图表数据
......@@ -737,6 +738,11 @@ function calculateBabyAge(birthday) {
// 编辑记录
function editRecord(index) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "修改",
});
console.log('编辑记录:', index)
const record = todayRecords.value[index]
......@@ -811,6 +817,11 @@ function editRecord(index) {
// 删除记录
async function deleteRecord(record) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "删除",
});
console.log('删除记录:', record)
deletingRecord.value = record
showDelPopup.value = true
......@@ -861,6 +872,11 @@ async function confirmDelRecord() {
// 返回上一页
function goBack() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "返回",
});
// uni.navigateBack()
uni.redirectTo({
url: '/pages/feedingRecord/feedingRecord'
......@@ -936,12 +952,22 @@ function generateWeekData(weekOffset = 0, targetDate = null) {
// 上一周
async function prevWeek() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "日期切换按钮左",
});
currentWeek.value--
await updateChartData(false) // 切换周时使用默认选择
}
// 下一周
async function nextWeek() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "日期切换按钮右",
});
currentWeek.value++
await updateChartData(false) // 切换周时使用默认选择
}
......@@ -1011,6 +1037,11 @@ async function updateChartData(keepCurrentSelection = false) {
// 点击柱状图切换日期
async function onBarClick(day) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "统计页",
buttonName: "日期选择按钮",
});
console.log('柱状图点击事件触发:', day)
console.log('当前 chartData:', chartData.value)
console.log('当前 selectedDate:', selectedDate.value)
......@@ -1278,6 +1309,12 @@ async function initializeApiData() {
// 页面挂载时初始化数据
onMounted(async () => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "统计页",
});
// 加载宝宝信息
await userStore.loadBabyInfo()
console.log('宝宝信息加载完成:', userStore.babyInfo)
......
......@@ -34,7 +34,7 @@
<image class="dropdown-icon" :src="feedingIndexRes.icon_arrow_yellow_drop" />
</view>
</view>
<view class="time-section">
<view class="time-section" @click="showTimePicker">
<text class="time-label">喂养时间</text>
<uni-datetime-picker ref="timePickerRef" v-model="currentTime" type="datetime" :clear-icon="false"
:border="false" @change="onTimeChange" :start="earliestDateString" :end="latestDateString"
......@@ -429,6 +429,7 @@ import { fetchFeedingJSON, feedingHome, feedingRecords, feedingFoodsCustom, feed
import { useUserStore } from '@/stores/user.js'
import { jump, JumpType, showLoading } from '../../utils'
import { getHealthField } from "@/api/common";
import md from '../../md'
// 弹窗引用
const addFoodPopup = ref(null)
......@@ -554,10 +555,25 @@ const bannerHandler = (item) => {
return
}
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "banner资源位",
});
console.log(item);
jump({ type: item.jumpType, url: item.url, extra: item.extra })
}
const showTimePicker = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "选择喂养时间",
});
}
const feedingTypes = ref([
{ value: 'breastfeeding', label: '母乳亲喂', icon: feedingIndexRes.icon_muruqinwei },
{ value: 'bottle', label: '母乳瓶喂', icon: feedingIndexRes.icon_murupinwei },
......@@ -734,6 +750,10 @@ const currentBabyId = computed(() => userStore.babyInfo?.content?.id)
// 页面加载时获取数据
onMounted(async () => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "喂养工具首页",
});
console.warn('页面加载,开始初始化数据...')
await loadBabyInfo()
loadFoodsData()
......@@ -1148,6 +1168,35 @@ function selectType(type) {
clearPreviousState()
}
if (type === 'breastfeeding') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳亲喂",
});
}
if (type === 'bottle') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳瓶喂",
});
}
if (type === 'formula') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "奶粉喂养",
});
}
if (type === 'food') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "辅食",
});
}
selectedType.value = type
}
......@@ -1272,12 +1321,44 @@ function clearFeedingData() {
function adjustDuration(side, value) {
const currentData = feedingData.value.breastfeeding
if (side === 'left') {
if (value > 0) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "左侧哺乳时长+",
});
}
if (value < 0) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "左侧哺乳时长-",
});
}
// 限制在0-60分钟范围内
const newValue = currentData.leftDuration + value
if (newValue >= 0 && newValue <= 60) {
currentData.leftDuration = newValue
}
} else {
if (value > 0) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "右侧哺乳时长+",
});
}
if (value < 0) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "右侧哺乳时长-",
});
}
// 限制在0-60分钟范围内
const newValue = currentData.rightDuration + value
if (newValue >= 0 && newValue <= 60) {
......@@ -1337,6 +1418,67 @@ function onPickerChange(e) {
}
function setRecordMethod(method) {
// 手动记录、计时器记录、语音记录
if (method === 'manual') {
if (selectedType.value === 'breastfeeding') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳亲喂手动记录",
});
}
if (selectedType.value === 'bottle') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳瓶喂手动记录",
});
}
if (selectedType.value === 'formula') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "奶粉喂养手动记录",
});
}
}
if (method === 'voice') {
if (selectedType.value === 'breastfeeding') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳亲喂语音记录",
});
}
if (selectedType.value === 'bottle') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳瓶喂语音记录",
});
}
if (selectedType.value === 'formula') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "奶粉喂养语音记录",
});
}
}
if (method === 'timer') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳亲喂计时器记录",
});
}
// 辅食不支持语音模式
if (selectedType.value === 'food' && method === 'voice') {
uni.showToast({
......@@ -1403,6 +1545,11 @@ async function toggleTimer(side) {
// 左侧计时逻辑
if (!isLeftTimerRunning.value) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "左侧计时器开始",
});
// 开始左侧计时
try {
const response = await feedingTimerStart({
......@@ -1420,6 +1567,11 @@ async function toggleTimer(side) {
})
}
} else {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "左侧计时器暂停",
});
// 停止左侧计时
try {
const response = await feedingTimerStop({
......@@ -1449,6 +1601,11 @@ async function toggleTimer(side) {
// 右侧计时逻辑
if (!isRightTimerRunning.value) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "右侧计时器开始",
});
// 开始右侧计时
try {
const response = await feedingTimerStart({
......@@ -1466,6 +1623,11 @@ async function toggleTimer(side) {
})
}
} else {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "右侧计时器暂停",
});
// 停止右侧计时
try {
const response = await feedingTimerStop({
......@@ -1629,6 +1791,8 @@ async function stopAllTimers() {
// 完成记录
async function completeRecord() {
// 防止重复提交
if (isSubmitting.value) {
return
......@@ -1645,6 +1809,37 @@ async function completeRecord() {
return
}
if (selectedType.value === 'breastfeeding') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳亲喂完成记录",
});
}
if (selectedType.value === 'bottle') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "母乳瓶喂完成记录",
});
}
if (selectedType.value === 'formula') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "奶粉喂养完成记录",
});
}
if (selectedType.value === 'food') {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "辅食完成记录",
});
}
try {
isSubmitting.value = true
......@@ -1906,6 +2101,12 @@ function goToFeedingRecord() {
return
}
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "喂养记录",
});
uni.navigateTo({
url: '/pages/feedingRecord/feedingRecord'
})
......@@ -2057,6 +2258,11 @@ function enterEditMode() {
// 如果已经在编辑模式,则取消编辑
cancelEditMode()
} else {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "辅食删除",
});
// 保存原始辅食数据,保持顺序
foodSelectionState.value.originalFoodData = {
selectedItems: [...feedingData.value.food.selectedItems],
......@@ -2120,6 +2326,11 @@ function cancelEditMode() {
}
async function exitEditMode() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "辅食删除完成",
});
// 防连点检查
if (foodSelectionState.value.isDeletingFood) {
console.log('防连点:删除完成按钮被阻止')
......@@ -2190,6 +2401,11 @@ async function exitEditMode() {
}
function showAddFoodPopup(categoryName) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "辅食添加" + categoryName,
});
// 防连点检查
if (foodSelectionState.value.isAddingFood) {
console.log('防连点:添加辅食按钮被阻止')
......@@ -2667,6 +2883,13 @@ function forceResetRecorderManager() {
// 开始录音
async function startRecording() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "语音识别录制开始按钮",
});
console.log('开始录音请求...')
console.log('当前录音状态:', {
isRecording: recordingState.value.isRecording,
......@@ -2767,6 +2990,12 @@ async function startRecording() {
async function stopRecording() {
console.log('停止录音请求...')
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "语音识别录制结束按钮",
});
// 检查录音是否真正开始
if (!recordingState.value.isRecording || !recordingState.value.recordingStartTime) {
console.log('录音未开始或已停止,无需停止')
......@@ -3363,6 +3592,11 @@ function showBabySwitch() {
// 只有当有多个宝宝时才显示切换弹窗
if (babyList.value.length > 1) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养工具首页",
buttonName: "切换宝宝",
});
showBabySwitchPopup.value = true
}
}
......
......@@ -23,7 +23,7 @@
<!-- 日期选择器和统计按钮 -->
<view class="date-stats-row">
<view class="date-selector">
<view class="date-selector" @click="showDatePicker">
<uni-datetime-picker ref="datePickerRef" v-model="currentSelectedDate" type="date" :start="earliestDateString"
:end="todayDateString" @change="onDateChange" :clear-icon="false" :border="false">
<view class="date-display">
......@@ -204,6 +204,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
import BabySwitchPopup from '@/components/BabySwitchPopup.vue'
import { feedingRecordsByDate, feedingRecordsCalendarStatus, feedingRecords as feedingRecordsAPI, feedingRecordsDelete } from '@/api/feeding.js'
import { useUserStore } from '@/stores/user.js'
import md from '../../md'
// API 集成说明:
// 1. 使用 /c/feeding/records GET 方法查询指定日期的喂养记录列表
......@@ -398,6 +399,16 @@ const calendarDates = computed(() => {
return dates
})
function showDatePicker() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "日期下拉按钮",
});
}
function goToFeedingIndex() {
uni.navigateBack()
}
......@@ -515,6 +526,11 @@ function selectDate(dateObj) {
}
function toggleCalendarExpand() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "日历展开按钮",
});
isCalendarExpanded.value = !isCalendarExpanded.value
}
......@@ -629,6 +645,11 @@ function getRecordBgColor(type) {
}
async function deleteRecord(recordId) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "删除",
});
console.log('删除记录:', recordId)
// 设置要删除的记录ID并显示确认弹窗
deletingRecordId.value = recordId
......@@ -636,6 +657,11 @@ async function deleteRecord(recordId) {
}
function editRecord(index) {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "修改",
});
const record = todayRecords.value[index]
if (!record) return
......@@ -870,6 +896,11 @@ async function saveEditRecord() {
}
function goToFeedingAnalysis() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "统计",
});
uni.redirectTo({
url: '/pages/feedingAnalysis/feedingAnalysis'
})
......@@ -877,11 +908,22 @@ function goToFeedingAnalysis() {
// 返回上一页
function goBack() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "返回",
});
uni.navigateBack()
}
// 宝宝切换相关方法
function showBabySwitch() {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "喂养记录页",
buttonName: "切换宝宝",
});
// 只有当有多个宝宝时才显示切换弹窗
if (babyList.value.length > 1) {
showBabySwitchPopup.value = true
......@@ -1496,6 +1538,12 @@ watch(currentDate, (newDate, oldDate) => {
}, { immediate: false })
onMounted(async () => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "喂养记录页",
});
// 组件挂载后的操作
// 加载宝宝信息
await userStore.loadBabyInfo()
......
......@@ -118,6 +118,11 @@ const listData = ref([])
// 跳转小程序
const onJump = async () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "我的报告单页",
buttonName: '专家在线咨询'
});
const res = await getHealthField();
if (!res.success) {
......@@ -172,6 +177,11 @@ const getProject = (projects) => {
// 删除事件
const onDelete = throttleTap((id) => {
console.log(id)
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "我的报告单页",
buttonName: '删除'
});
uni.showModal({
// title: '提示',
content: '确认删除吗?',
......@@ -187,6 +197,11 @@ const onDelete = throttleTap((id) => {
})
// 返回上一页面
const backHandler = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "我的报告单页",
buttonName: '返回'
});
uni.navigateBack();
}
// 删除报告单
......@@ -221,6 +236,10 @@ const getReportListFn = async () => {
}
onLoad(() => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "我的报告单页"
});
// 我的报告单
getReportListFn()
})
......
......@@ -257,6 +257,26 @@ const backHandler = () => {
// 点击轮播图事件
const handleBannerClick = (item, index) => {
console.log(item)
let buttonName = '';
switch(index){
case 0:
buttonName = '第一张焦点图';
break;
case 1:
buttonName = '第二张焦点图';
break;
case 2:
buttonName = '第三张焦点图';
break;
case 3:
buttonName = '第四张焦点图';
break;
}
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检提醒首页",
buttonName: buttonName,
});
// 跳转
if (item?.url != "") {
jump({
......@@ -265,26 +285,15 @@ const handleBannerClick = (item, index) => {
})
}
// let buttonName = '';
// switch(index){
// case 0:
// buttonName = '第一张焦点图';
// break;
// case 1:
// buttonName = '第二张焦点图';
// break;
// case 2:
// buttonName = '第三张焦点图';
// break;
// }
// md.sensorLogTake({
// xcxClick: "产品提醒页-首屏页面点击",
// pageName: "产品提醒页-首屏",
// buttonName: buttonName,
// });
}
// 新增体检
const onAdd = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检提醒首页",
buttonName: '添加'
});
uni.navigateTo({
url: '/pages/addPostnatal/addPostnatal'
})
......@@ -293,24 +302,36 @@ const onAdd = () => {
const onBtn = (type) => {
// const items = JSON.stringify(homeInfo.value)
// type 0 提醒 1 报告单 2 日历
let buttonName = ''
switch (type) {
case 0:
// 如果授权就不弹出提醒
showPicker.value = isWxNotification.value ? true : false
showPicker.value = isWxNotification.value ? true : false
buttonName = '提醒'
break;
case 1:
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
})
buttonName = '报告单'
break;
case 2:
uni.navigateTo({
url: `/pages/productionCalendar/productionCalendar`
})
buttonName = '日历'
break;
default:
break;
}
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检提醒首页",
buttonName: buttonName,
});
}
// 提醒关闭
const close = () => {
......@@ -341,6 +362,12 @@ const handleConfirm = () => {
// 编辑时间
const onEdit = (id, newTime) => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检提醒首页",
buttonName: '选择时间',
});
console.log(id, newTime)
time.value = newTime
visible.value = true
......@@ -503,6 +530,13 @@ onShow(async () => {
console.log('宝宝信息加载完成:', userStore.babyInfo)
publicFn()
})
onMounted(() => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "产检提醒首页"
});
})
</script>
<style lang="less" scoped>
......
......@@ -131,7 +131,8 @@ import {
import {
getInfo
} from '../../api/obstetric.js';
import { console } from 'inspector';
import md from '../../md';
// 获取用户信息
const userStore = useUserStore();
const babyInfo =ref(userStore?.babyInfo || {})
......@@ -379,10 +380,20 @@ const calendarDates = computed(() => {
})
// 返回
const backHandler = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检日历页",
buttonName: '返回'
});
uni.navigateBack()
}
// 跳转新增产检页面
const onAdd = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检日历页",
buttonName: '新增产检'
});
uni.navigateTo({
url: `/pages/addPostnatal/addPostnatal?time=${currentSelectedDate.value}`
})
......@@ -423,17 +434,12 @@ const getInfoFn = async () => {
});
}
}
// onLoad((option) => {
// console.log('option:', option)
// info.value = JSON.parse(option.item)
// // 使用真实的今天日期
// const today = new Date()
// const todayString = formatDateString(today)
// currentSelectedDate.value = todayString
// currentDate.value = new Date(today.getFullYear(), today.getMonth(), 1) // 当前月份的第一天
// currentMonthKey.value = `${today.getFullYear()}-${today.getMonth()}` // 设置月份键
// console.log('初始化今日日期:', todayString, '当前月份:', currentDate.value, '月份键:', currentMonthKey.value)
// })
onLoad((option) => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "产检日历页"
});
})
onShow(() => {
// 使用真实的今天日期
const today = new Date()
......
......@@ -170,6 +170,7 @@ import {
getDeleteReportImg
} from '../../api/obstetric.js';
import { useUserStore } from "@/stores/user";
import md from '../../md';
// 用户信息
const userStore = useUserStore();
const babyId = ref(userStore.babyInfo?.content?.id)
......@@ -288,6 +289,27 @@ const updateActiveTab = (scrollTop) => {
// 点击tab滚动到对应区域
const scrollToSection = (index) => {
let buttonName = ''
switch (index) {
case 0:
buttonName = '产检须知';
break;
case 1:
buttonName = '产检项目';
break;
case 2:
buttonName = '本次报告单';
break;
default:
break;
}
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: buttonName,
});
activeIndex.value = index;
scrolling.value = true;
......@@ -354,6 +376,12 @@ const onImageDel = (id) => {
}
// 上传图片
const onUpload = throttleTap(() => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "上传报告单",
});
if (bgdImgList.value.length == 15) {
uni.showToast({
title: "最多上传15张图片",
......@@ -401,6 +429,12 @@ const onUpload = throttleTap(() => {
// 查看更多
const onSeeBtn = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "查看全部",
})
uni.navigateTo({
url: '/pages/myReportCard/myReportCard'
})
......@@ -408,6 +442,12 @@ const onSeeBtn = () => {
// 打开提醒弹窗
const onRemind = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "提醒",
})
// 产检时间
const checkupDate = new Date(infoData.value.checkupDate)
......@@ -475,6 +515,12 @@ const getWxNotificationFn = async (notificationDate, wxTemplateId, babyId) => {
}
// 完成检查
const onComplete = () => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "完成检查",
})
if (infoData.value.checkupDate == '') {
uni.showToast({
title: '请选择产检日期',
......@@ -495,6 +541,12 @@ const onComplete = () => {
// 修改时间
const onChangeTime = throttleTap((date) => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "选择时间",
})
visible.value = true
time.value = date
})
......@@ -512,6 +564,11 @@ const handleDateConfirm = (date) => {
// 修改项目
const onModify = (item) => {
md.sensorLogTake({
xcxClick: "小程序页面点击事件",
pageName: "产检详情页",
buttonName: "修改项目",
})
console.log(item)
const items = JSON.stringify(item)
uni.navigateTo({
......@@ -582,6 +639,10 @@ const getSettingFn = () => {
}
// 获取传过来的参数
onLoad((options) => {
md.sensorLogTake({
xcxPage: "小程序页面浏览事件",
pageName: "产检详情页"
});
console.log(options)
// 获取传过来的参数:id
editId.value = options.id
......
......@@ -315,6 +315,7 @@ import { getGrowthHistoryList,getGrowthAssessmentDetail } from '../../api/shengz
import ShengzhangQuxianTipsPopup from '../../components/shengzhangQuxianTipsPopup.vue';
import { useUserStore } from "@/stores/user";
import { getHealthField } from "@/api/common";
import md from '../../md';
const isRecords = ref(false);
......@@ -474,6 +475,23 @@ const statusImgMap = {
* @param {string} tab - 要切换的标签名称('latest'|'history')
*/
const switchTab = (tab) => {
switch(tab){
case 'latest':
md.sensorLogTake({
xcxClick: "测评结果页-最新",
pageName: "测评结果页",
buttonName: "测评结果页-最新-点击",
});
break;
case 'history':
md.sensorLogTake({
xcxClick: "测评结果页-历史",
pageName: "测评结果页",
buttonName: "测评结果页-历史-点击",
});
break;
}
activeTab.value = tab
console.log('切换到标签:', tab)
// if(tab === 'latest' && isRecords.value){
......@@ -504,10 +522,25 @@ const switchCurveTab = (tab) => {
// 根据不同的标签更新曲线数据
if (tab === 'height') {
md.sensorLogTake({
xcxClick: "测评结果页-身高",
pageName: "测评结果页",
buttonName: "测评结果页-身高-点击",
});
curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoHeight.userDataPoints,'height');
} else if (tab === 'weight') {
md.sensorLogTake({
xcxClick: "测评结果页-体重",
pageName: "测评结果页",
buttonName: "测评结果页-体重-点击",
});
curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoWeight.userDataPoints,'weight');
} else if (tab === 'head') {
md.sensorLogTake({
xcxClick: "测评结果页-头围",
pageName: "测评结果页",
buttonName: "测评结果页-头围-点击",
});
curveData.value = curveDataConvert(shengzhangStore.getGrowthCurveDataInfoHead.userDataPoints,'head');
}
......@@ -574,6 +607,12 @@ const getYTicks = () => {
* 显示生长曲线说明弹窗
*/
const showCurveTips = () => {
md.sensorLogTake({
xcxClick: "测评结果页-什么是生长曲线",
pageName: "测评结果页",
buttonName: "测评结果页-什么是生长曲线-点击",
});
console.log('显示生长曲线提示')
showTipsPopup.value = true
}
......@@ -591,6 +630,12 @@ const closeTipsPopup = () => {
* 处理专家咨询按钮点击事件
*/
const consultExpert = async () => {
md.sensorLogTake({
xcxClick: "测评结果页-专家在线咨询",
pageName: "测评结果页",
buttonName: "测评结果页-专家在线咨询-点击",
});
console.log('专家在线咨询')
const res = await getHealthField();
......@@ -663,6 +708,12 @@ onShareAppMessage(() => {
const shengzhangStore = useShengzhangStore();
// const headCircumference = ref(0);
onMounted(async () => {
md.sensorLogTake({
xcxPage: "测评结果页",
pageName: "测评结果页"
});
//获取历史记录
const historyListData = await getGrowthHistoryList();
......
......@@ -15,7 +15,7 @@
class="banner-img"
:src="`${$baseUrl}${item?.img}`"
mode="aspectFill"
@click="bannerHandler(item)"
@click="bannerHandler(item, index)"
/>
</swiper-item>
</swiper>
......@@ -267,6 +267,7 @@ import { onLoad,onShow } from "@dcloudio/uni-app";
import { throttleTap,jump, JumpType, formatDate } from '../../utils/index.js';
import { useShengzhangStore } from '../../stores/shengzhangResult.js';
import { useUserStore } from "@/stores/user";
import md from '../../md';
const isTip = ref(false);
......@@ -283,8 +284,30 @@ const showLoading = ref(false);
const bannerHandler = (item) => {
const bannerHandler = (item, index) => {
console.log(item)
let buttonName = '';
switch(index){
case 0:
buttonName = '第一张焦点图';
break;
case 1:
buttonName = '第二张焦点图';
break;
case 2:
buttonName = '第三张焦点图';
break;
case 3:
buttonName = '第四张焦点图';
break;
}
md.sensorLogTake({
xcxClick: "生长曲线首页-banner资源位",
pageName: "生长曲线首页",
buttonName: buttonName,
});
if(item?.url != ""){
jump({
type: item.type,
......@@ -350,6 +373,12 @@ const showDatePickerPopup = ref(false)
const selectedDate = ref()
const showDatePicker = () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-本次测评日期",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-本次测评日期-点击",
});
console.log('显示日期选择器')
showDatePickerPopup.value = true
}
......@@ -362,6 +391,12 @@ const onDateChange = (date) => {
}
const showFeedingPopup = () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-宝宝喂养方式选择",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-宝宝喂养方式选择-点击",
});
console.log('显示喂养方式弹窗')
showFeedSwitchPopup.value = true
currentFeedIndex.value = 1 // 默认选中"母乳+奶粉混合喂养"
......@@ -494,12 +529,24 @@ const onHeadFocus = () => {
// 其他方法保持不变
const changeBaby = () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-切换宝宝",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-切换宝宝-点击",
});
console.log('切换宝宝')
showBabySwitchPopup.value = true
// currentBabyIndex.value = 0 // 默认选中第一个宝宝
}
//测评记录
const viewRecords = () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-测评记录",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-测评记录-点击",
});
jump({
type: JumpType.INNER,
url: "/pages/shengzhangTestResult/shengzhangTestResult?isRecords=false"
......@@ -520,6 +567,12 @@ const convertFeedingType = (type) => {
}
}
const submitData = throttleTap(async () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-确认提交",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-确认提交-点击",
});
showLoading.value = true;
if(headCircumference.value == 0){
......@@ -683,6 +736,12 @@ const pushCount = (val) => {
const showBabyTestTipsPopup = ref(false)
const onClickTips = () => {
md.sensorLogTake({
xcxClick: "生长曲线首页-(如何确认身高、体重、头围)",
pageName: "生长曲线首页",
buttonName: "生长曲线首页-(如何确认身高、体重、头围)-点击",
});
console.log('显示宝宝测评提示弹窗')
showBabyTestTipsPopup.value = true
}
......@@ -749,6 +808,12 @@ const shengzhangToolsData = ref({activeInfo:[
const swiperData = ref([]);
onMounted(async () => {
md.sensorLogTake({
xcxPage: "生长曲线首页",
pageName: "生长曲线首页"
});
const {data} = await fetchShengzhangToolsJSON();
if(data){
shengzhangToolsData.value = {...data};
......
......@@ -113,6 +113,12 @@ onLoad(async (options) => {
const openId = globalStore.openId
const unionId = globalStore.unionId
// scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
// const scene = decodeURIComponent(options.scene)
// options.scene = null
// console.warn("scene", scene)
// 将 options 的所有参数原样作为查询参数传给 H5,并补齐 cuk
const params = { ...(options || {}) }
if (cuk && !params.cuk) params.cuk = cuk
......
......@@ -1023,8 +1023,11 @@
padding-left: 38rpx;
.tools_maintitle {
font-size: 42rpx;
color: #000;
// font-size: 42rpx;
// color: #000;
color: @color-black-deep;
font-size: 38rpx;
font-weight: bold;
}
.tools_subtitle {
......@@ -1151,8 +1154,11 @@
padding-left: 38rpx;
.et_maintitle {
font-size: 42rpx;
color: #000;
// font-size: 42rpx;
// color: #000;
color: @color-black-deep;
font-size: 38rpx;
font-weight: bold;
}
.et_subtitle {
......
......@@ -16,7 +16,7 @@
class="banner-img"
:src="$baseUrl + `integral/${tupianBanben}/${item?.bannerImg}`"
mode="aspectFill"
@click="bannerHandler(item)"
@click="bannerHandler(item, index)"
/>
</swiper-item>
</swiper>
......@@ -1462,12 +1462,27 @@
//banner点击事件
const bannerHandler = (item) => {
const bannerHandler = (item, index) => {
let buttonName = '';
switch(index){
case 0:
buttonName = '第一张焦点图';
break;
case 1:
buttonName = '第二张焦点图';
break;
case 2:
buttonName = '第三张焦点图';
break;
case 3:
buttonName = '第四张焦点图';
break;
}
md.sensorLogTake({
xcxClick: "积分服务页-首屏页面点击",
pageName: "积分服务页-首屏",
buttonName: "第一张焦点图",
buttonName: buttonName,
});
if(item?.url != ""){
......
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