Commit 48329f8d authored by 王炽's avatar 王炽

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

parents 4063e012 c88545da
...@@ -58,10 +58,16 @@ export const getAdd = (data) => api.post('/c/maternityCheckup/add',data); ...@@ -58,10 +58,16 @@ export const getAdd = (data) => api.post('/c/maternityCheckup/add',data);
* @returns * @returns
*/ */
export const getReportList = () => api.get('/c/maternityCheckup/reportList'); export const getReportList = (data) => api.get('/c/maternityCheckup/reportList', data);
/** /**
* 保存订阅消息 * 保存订阅消息
* @returns * @returns
*/ */
export const getWxNotification = (data) => api.post('/c/wxNotification/save',data); export const getWxNotification = (data) => api.post('/c/wxNotification/save',data);
\ No newline at end of file
/**
* 修改报告单
* @returns
*/
export const getDeleteReportImg = (data) => api.post('/c/maternityCheckup/deleteReportImg',data);
\ No newline at end of file
...@@ -137,6 +137,7 @@ import { onLoad } from '@dcloudio/uni-app' ...@@ -137,6 +137,7 @@ import { onLoad } from '@dcloudio/uni-app'
import { import {
uploadImage uploadImage
} from "../../api/common.js"; } from "../../api/common.js";
import { import {
getAdd, getAdd,
getExaminationItems getExaminationItems
...@@ -144,6 +145,11 @@ import { ...@@ -144,6 +145,11 @@ import {
// 导入日期选择器组件 // 导入日期选择器组件
import DatePicker from '@/components/DatePicker.vue' import DatePicker from '@/components/DatePicker.vue'
import { useUserStore } from "@/stores/user";
// 获取用户信息
const userStore = useUserStore();
const babyId = ref(userStore.babyInfo?.content?.id)
// 默认产检时间 // 默认产检时间
const time = ref(''); const time = ref('');
...@@ -334,9 +340,10 @@ const onSave = throttleTap( async () => { ...@@ -334,9 +340,10 @@ const onSave = throttleTap( async () => {
const param = { const param = {
checkupDate: time.value, checkupDate: time.value,
checkupItems: ids, checkupItems: ids,
reportImages: bgdImgList.value reportImages: bgdImgList.value,
babyId: babyId.value
} }
console.log(param, '参数') console.log(param, '新增产检保存参数')
showLoading(); showLoading();
const {success, data } = await getAdd(param); const {success, data } = await getAdd(param);
hideLoading(); hideLoading();
...@@ -365,6 +372,7 @@ const onSeeBtn = () => { ...@@ -365,6 +372,7 @@ const onSeeBtn = () => {
// 获取产检项目列表 // 获取产检项目列表
const getList = async () => { const getList = async () => {
const {success, data, message } = await getExaminationItems() const {success, data, message } = await getExaminationItems()
console.log(success, data, message, '获取产检项目列表')
if (success) { if (success) {
examinationList.value = data examinationList.value = data
} }
......
...@@ -214,7 +214,7 @@ const onSave = throttleTap(async () => { ...@@ -214,7 +214,7 @@ const onSave = throttleTap(async () => {
id: editId.value, id: editId.value,
checkupItems: ids checkupItems: ids
} }
console.log(param, '参数') console.log(param, '产检项目编辑保存参数')
showLoading(); showLoading();
const {success, data} = await getUpdate(param); const {success, data} = await getUpdate(param);
hideLoading(); hideLoading();
...@@ -243,6 +243,7 @@ const onSave = throttleTap(async () => { ...@@ -243,6 +243,7 @@ const onSave = throttleTap(async () => {
// 获取产检项目列表 // 获取产检项目列表
const getList = async () => { const getList = async () => {
const {success, data, message} = await getExaminationItems() const {success, data, message} = await getExaminationItems()
console.log(success, data, message, '获取产检项目列表')
if (success) { if (success) {
examinationList.value = data examinationList.value = data
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -148,36 +148,10 @@ ...@@ -148,36 +148,10 @@
<image :src="feedingRecordRes.add_btn" class="add-btn-img" /> <image :src="feedingRecordRes.add_btn" class="add-btn-img" />
</view> </view>
<!-- 添加记录弹窗 -->
<view class="popup-mask" v-if="showPopup" @click="closePopup">
<view class="popup-content" @click.stop>
<view class="popup-title">添加喂养记录</view>
<view class="form-item">
<text class="label">时间:</text>
<picker mode="time" :value="newRecord.time" @change="onTimeChange">
<view class="picker">{{ newRecord.time || '请选择时间' }}</view>
</picker>
</view>
<view class="form-item">
<text class="label">类型:</text>
<picker :range="feedingTypes" @change="onTypeChange">
<view class="picker">{{ newRecord.type || '请选择类型' }}</view>
</picker>
</view>
<view class="form-item">
<text class="label">内容:</text>
<input class="input" v-model="newRecord.content" placeholder="请输入具体内容" maxlength="50" />
</view>
<view class="popup-buttons">
<button class="cancel-btn" @click="closePopup">取消</button>
<button class="confirm-btn" @click="saveRecord">保存</button>
</view>
</view>
</view>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<view class="popup-mask" v-if="showEditPopup" @click="closeEditPopup"> <view class="popup-mask" v-if="showEditPopup" @click="closeEditPopup" @touchmove.prevent>
<view class="popup-content" @click.stop> <view class="popup-content" @click.stop @touchmove.stop>
<view class="popup-title">修改喂养记录</view> <view class="popup-title">修改喂养记录</view>
<view class="form-item"> <view class="form-item">
<text class="label">时间:</text> <text class="label">时间:</text>
...@@ -193,12 +167,14 @@ ...@@ -193,12 +167,14 @@
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">喂养详情:</text> <text class="label">喂养详情:</text>
<input class="input" v-model="editForm.content" placeholder="请输入具体内容" maxlength="20" /> <view class="input-container">
<text class="char-count">{{ editForm.content.length }}/20</text> <input class="input" v-model="editForm.content" placeholder="请输入具体内容" maxlength="20" />
<text class="char-count">{{ editForm.content.length }}/20</text>
</view>
</view> </view>
<view class="popup-buttons"> <view class="popup-buttons">
<button class="cancel-btn" @click="closeEditPopup">取消</button> <button class="cancel-btn" @click="closeEditPopup">取消</button>
<button class="confirm-btn" @click="saveEditRecord">保存</button> <button class="confirm-btn" @click="saveEditRecord">保存修改</button>
</view> </view>
</view> </view>
</view> </view>
...@@ -392,6 +368,10 @@ const calendarDates = computed(() => { ...@@ -392,6 +368,10 @@ const calendarDates = computed(() => {
return dates return dates
}) })
function goToFeedingIndex() {
uni.navigateBack()
}
// 方法 // 方法
function createDateObject(date) { function createDateObject(date) {
const today = new Date() const today = new Date()
...@@ -622,7 +602,7 @@ function editRecord(index) { ...@@ -622,7 +602,7 @@ function editRecord(index) {
const record = todayRecords.value[index] const record = todayRecords.value[index]
if (!record) return if (!record) return
editForm.value = { editForm.value = {
time: record.time || '', time: record.time || getCurrentTime(), // 使用记录的原始时间,如果没有则使用当前时间
type: record.type || '', type: record.type || '',
content: record.foodDetails || record.content || '' // 优先使用foodDetails content: record.foodDetails || record.content || '' // 优先使用foodDetails
} }
...@@ -1120,8 +1100,14 @@ function formatTimeFromTimestamp(timestamp) { ...@@ -1120,8 +1100,14 @@ function formatTimeFromTimestamp(timestamp) {
function formatDuration(seconds) { function formatDuration(seconds) {
if (!seconds || seconds <= 0) return '' if (!seconds || seconds <= 0) return ''
const minutes = Math.floor(seconds / 60) const minutes = seconds / 60
return `${minutes}min` if (minutes < 1) {
// 不足1分钟时显示小数,保留2位小数
return `${minutes.toFixed(2)}min`
} else {
// 1分钟以上时显示整数
return `${Math.floor(minutes)}min`
}
} }
function getFeedingTypeLabel(type) { function getFeedingTypeLabel(type) {
...@@ -1149,7 +1135,18 @@ function formatDateTimeString(dateString, timeString) { ...@@ -1149,7 +1135,18 @@ function formatDateTimeString(dateString, timeString) {
const [hours, minutes] = timeString.split(':'); const [hours, minutes] = timeString.split(':');
date.setHours(parseInt(hours, 10)); date.setHours(parseInt(hours, 10));
date.setMinutes(parseInt(minutes, 10)); date.setMinutes(parseInt(minutes, 10));
return date.toISOString(); // 使用ISO格式的时间戳 date.setSeconds(0);
date.setMilliseconds(0);
// 使用本地时间而不是UTC时间,避免时区问题
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hour = String(date.getHours()).padStart(2, '0');
const minute = String(date.getMinutes()).padStart(2, '0');
const second = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}T${hour}:${minute}:${second}`;
} }
function loadBabyFeedingRecords(baby) { function loadBabyFeedingRecords(baby) {
...@@ -1910,6 +1907,8 @@ function testApiIntegration() { ...@@ -1910,6 +1907,8 @@ function testApiIntegration() {
z-index: 1000; z-index: 1000;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
overflow: hidden;
touch-action: none;
} }
.popup-content { .popup-content {
...@@ -1939,6 +1938,11 @@ function testApiIntegration() { ...@@ -1939,6 +1938,11 @@ function testApiIntegration() {
display: block; display: block;
} }
.input-container {
position: relative;
width: 100%;
}
.picker, .picker,
.input { .input {
width: 100%; width: 100%;
...@@ -1946,11 +1950,27 @@ function testApiIntegration() { ...@@ -1946,11 +1950,27 @@ function testApiIntegration() {
background: #f8f9fa; background: #f8f9fa;
border-radius: 12rpx; border-radius: 12rpx;
font-size: 28rpx; font-size: 28rpx;
min-height: 88rpx;
color: #333; color: #333;
border: 1rpx solid #e9ecef; border: 1rpx solid #e9ecef;
box-sizing: border-box; box-sizing: border-box;
} }
.char-count {
position: absolute;
right: 20rpx;
top: 50%;
transform: translateY(-50%);
font-size: 24rpx;
color: #999;
pointer-events: none;
z-index: 1;
background: rgba(248, 249, 250, 0.8);
padding: 2rpx 8rpx;
border-radius: 4rpx;
}
.picker { .picker {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -1966,7 +1986,7 @@ function testApiIntegration() { ...@@ -1966,7 +1986,7 @@ function testApiIntegration() {
button { button {
flex: 1; flex: 1;
height: 88rpx; height: 88rpx;
border-radius: 12rpx; border-radius: 50rpx;
font-size: 32rpx; font-size: 32rpx;
border: none; border: none;
font-weight: 600; font-weight: 600;
......
...@@ -95,6 +95,11 @@ import { ...@@ -95,6 +95,11 @@ import {
getDelete getDelete
} from '../../api/obstetric.js'; } from '../../api/obstetric.js';
import md from '../../md'; import md from '../../md';
import { useUserStore } from "@/stores/user";
// 获取用户信息
const userStore = useUserStore();
const babyId = ref(userStore.babyInfo?.content?.id)
// 控制查看更多图片 // 控制查看更多图片
const showMore = ref(false) const showMore = ref(false)
...@@ -166,8 +171,8 @@ const getDeleteFn = async (id) => { ...@@ -166,8 +171,8 @@ const getDeleteFn = async (id) => {
} }
// 获取报告单 // 获取报告单
const getReportListFn = async () => { const getReportListFn = async () => {
console.log('获取报告单') const { code, message, data, success } = await getReportList({babyId: babyId.value})
const { code, message, data, success } = await getReportList() console.log('报告单列表', code, message, data, success)
if (success) { if (success) {
listData.value = data listData.value = data
} else { } else {
......
...@@ -107,6 +107,7 @@ import { ...@@ -107,6 +107,7 @@ import {
throttleTap throttleTap
} from '@/utils/index.js'; } from '@/utils/index.js';
import md from '../../md'; import md from '../../md';
import { useUserStore } from "@/stores/user";
import { import {
getInfo, getInfo,
getUpdate, getUpdate,
...@@ -118,6 +119,10 @@ const { ...@@ -118,6 +119,10 @@ const {
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl; const $baseUrl = proxy.$baseUrl;
const userStore = useUserStore();
const babyId = ref(userStore.babyInfo?.content?.id)
const back_btn = ref('') const back_btn = ref('')
// 时间弹窗控制 // 时间弹窗控制
...@@ -165,7 +170,7 @@ const getSrcUrl = (status) => { ...@@ -165,7 +170,7 @@ const getSrcUrl = (status) => {
const imageMap = { const imageMap = {
'pending': `${$baseUrl}chanjianTool/1001/icon4.png`, 'pending': `${$baseUrl}chanjianTool/1001/icon4.png`,
'expired': `${$baseUrl}chanjianTool/1001/icon5.png`, 'expired': `${$baseUrl}chanjianTool/1001/icon5.png`,
'completed': `${$baseUrl}chanjianTool/1001/icon6.png` 'completed': `${$baseUrl}chanjianTool/1001/icon30.png`
}; };
return imageMap[status]; return imageMap[status];
...@@ -269,11 +274,12 @@ const onEditTime = async () => { ...@@ -269,11 +274,12 @@ const onEditTime = async () => {
} }
// 获取信息接口 // 获取信息接口
const getInfoFn = async () => { const getInfoFn = async () => {
console.log('获取信息')
// 获取信息 // 获取信息
const { code, success, message, data } = await getInfo() const { code, success, message, data } = await getInfo({babyId: babyId.value})
console.log('产检提醒首页获取信息', code, success, message, data)
if (success) { if (success) {
homeInfo.value = data homeInfo.value = data
uni.setStorageSync('dueDate', data.dueDate); uni.setStorageSync('dueDate', data.dueDate);
} else { } else {
uni.showToast({ uni.showToast({
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<image @tap="backHandler" class="btnback" :src="`${$baseUrl}chanjianTool/1001/back.png`"></image> <image @tap="backHandler" class="btnback" :src="`${$baseUrl}chanjianTool/1001/back.png`"></image>
<view class="page_title"> <view class="page_title">
<view class="info-l"> <view class="info-l">
<image :src="$baseUrl + 'common/default_avatar.png'"></image> <image :src="babyInfo?.content?.babyAvatar || $baseUrl + 'common/default_avatar.png'"></image>
</view> </view>
<view class="info-r"> <view class="info-r">
<view class="info-r-t"> <view class="info-r-t">
</view> </view>
<view class="info-r-b"> <view class="info-r-b">
怀孕{{ info.gestationalWeeks }} 怀孕{{ info.gestationalWeeks }}
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<text class="empty-text">当日暂无记录</text> <text class="empty-text">当日暂无记录</text>
</view> </view>
<view class="con-list-item" v-for="(item, index) in todayRecords" :key="index" <view class="con-list-item" v-for="(item, index) in todayRecords" :key="index"
@click="onDetails(item.id)"> @click="onDetails(item)">
<view class="item-time"> <view class="item-time">
<view class=""> <view class="">
第{{ item.index }}次产检 第{{ item.index }}次产检
...@@ -122,6 +122,7 @@ import { ...@@ -122,6 +122,7 @@ import {
onLoad, onLoad,
onShow onShow
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { useUserStore } from "@/stores/user";
import { import {
throttleTap, throttleTap,
dateFormatter dateFormatter
...@@ -130,7 +131,10 @@ import { ...@@ -130,7 +131,10 @@ import {
import { import {
getInfo getInfo
} from '../../api/obstetric.js'; } from '../../api/obstetric.js';
import { console } from 'inspector';
// 获取用户信息
const userStore = useUserStore();
const babyInfo =ref(userStore?.babyInfo || {})
// 新增日历组件 start------- // 新增日历组件 start-------
const currentSelectedDate = ref('') const currentSelectedDate = ref('')
const currentDate = ref(new Date()) const currentDate = ref(new Date())
...@@ -389,7 +393,10 @@ const getProject = (projects) => { ...@@ -389,7 +393,10 @@ const getProject = (projects) => {
} }
// 跳转产检详情页面 // 跳转产检详情页面
const onDetails = (id) => { const onDetails = (item) => {
const { id, type } = item
// 如果是新增的就不跳转
if(type === '1') return
uni.navigateTo({ uni.navigateTo({
url: `/pages/productionDetails/productionDetails?id=${id}` url: `/pages/productionDetails/productionDetails?id=${id}`
}) })
...@@ -397,11 +404,18 @@ const onDetails = (id) => { ...@@ -397,11 +404,18 @@ const onDetails = (id) => {
// 获取信息接口 // 获取信息接口
const getInfoFn = async () => { const getInfoFn = async () => {
console.log('获取信息')
// 获取信息 // 获取信息
const {code,success, message, data } = await getInfo() const {code,success, message, data } = await getInfo({babyId: babyInfo.value?.content?.id})
console.log('日历页面获取信息', code, success, message, data)
if (success) { if (success) {
info.value = data // 保留 data 里面 checkupList 里面 status 等于 completed 的数据
info.value = {
...data,
checkupList: data.checkupList.filter(item => item.status === 'completed')
}
console.log('日历获取数据:', info.value)
} else { } else {
uni.showToast({ uni.showToast({
title: message, title: message,
......
...@@ -27,9 +27,10 @@ ...@@ -27,9 +27,10 @@
<image v-else :src="`${$baseUrl}chanjianTool/1001/icon25.png`"></image> <image v-else :src="`${$baseUrl}chanjianTool/1001/icon25.png`"></image>
完成检查 完成检查
</view> </view>
<view class="r-remind" @click="onRemind"> <!-- 提醒按钮 -->
<!-- <view class="r-remind" @click="onRemind">
<image :src="`${$baseUrl}chanjianTool/1001/icon26.png`"></image> <image :src="`${$baseUrl}chanjianTool/1001/icon26.png`"></image>
</view> </view> -->
</view> </view>
</view> </view>
...@@ -57,8 +58,8 @@ ...@@ -57,8 +58,8 @@
</view> </view>
<view class="project-content"> <view class="project-content">
<rich-text class="desc" :nodes="infoData.content"></rich-text> <!-- <rich-text class="desc" :nodes="infoData.content"></rich-text> -->
<mp-html :content="infoData.content" ></mp-html>
</view> </view>
</view> </view>
<!-- 产检项目 --> <!-- 产检项目 -->
...@@ -168,7 +169,8 @@ import { uploadImage } from '../../api/common.js' ...@@ -168,7 +169,8 @@ import { uploadImage } from '../../api/common.js'
import { import {
getDetail, getDetail,
getUpdate, getUpdate,
getWxNotification getWxNotification,
getDeleteReportImg
} from '../../api/obstetric.js'; } from '../../api/obstetric.js';
// 提醒选择器相关状态 // 提醒选择器相关状态
...@@ -341,9 +343,9 @@ const onImageDel = (id) => { ...@@ -341,9 +343,9 @@ const onImageDel = (id) => {
// 直接保存 // 直接保存
const params = { const params = {
id: editId.value, id: editId.value,
reportImages: bgdImgList.value keepImages: bgdImgList.value
} }
onEditTime(params) getDeleteReportImgFn(params)
} }
// 上传图片 // 上传图片
const onUpload = throttleTap(() => { const onUpload = throttleTap(() => {
...@@ -521,11 +523,25 @@ const onEditTime = async (params) => { ...@@ -521,11 +523,25 @@ const onEditTime = async (params) => {
}) })
} }
} }
// 修改报告单
const getDeleteReportImgFn = async (params) => {
console.log(params)
const { code, success, message } = await getDeleteReportImg(params)
if (success) {
// 重新获取信息
getDetailFn(editId.value)
} else {
uni.showToast({
title: message,
icon: 'none'
})
}
}
// 获取详情接口 // 获取详情接口
const getDetailFn = async (id) => { const getDetailFn = async (id) => {
console.log('获取信息', id)
// 获取信息 // 获取信息
const {code, success, message, data } = await getDetail({id}) const {code, success, message, data } = await getDetail({id})
console.log('详情页面获取信息', code, success, message, data)
if (success) { if (success) {
infoData.value = data infoData.value = data
bgdImgList.value = data.reportImages == null ? [] : data.reportImages bgdImgList.value = data.reportImages == null ? [] : data.reportImages
......
## 为减小组件包的大小,默认组件包中不包含编辑、latex 公式等扩展功能,需要使用扩展功能的请参考下方的 插件扩展 栏的说明
## 功能介绍
- 全端支持(含 `v3、NVUE`
- 支持丰富的标签(包括 `table``video``svg` 等)
- 支持丰富的事件效果(自动预览图片、链接处理等)
- 支持设置占位图(加载中、出错时、预览时)
- 支持锚点跳转、长按复制等丰富功能
- 支持大部分 *html* 实体
- 丰富的插件(关键词搜索、内容编辑、`latex` 公式等)
- 效率高、容错性强且轻量化
查看 [功能介绍](https://jin-yufeng.github.io/mp-html/#/overview/feature) 了解更多
## 使用方法
- `uni_modules` 方式
1. 点击右上角的 `使用 HBuilder X 导入插件` 按钮直接导入项目或点击 `下载插件 ZIP` 按钮下载插件包并解压到项目的 `uni_modules/mp-html` 目录下
2. 在需要使用页面的 `(n)vue` 文件中添加
```html
<!-- 不需要引入,可直接使用 -->
<mp-html :content="html" />
```
```javascript
export default {
data() {
return {
html: '<div>Hello World!</div>'
}
}
}
```
3. 需要更新版本时在 `HBuilder X` 中右键 `uni_modules/mp-html` 目录选择 `从插件市场更新` 即可
- 源码方式
1.[github](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app)[gitee](https://gitee.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 下载源码
插件市场的 **非 uni_modules 版本** 无法更新,不建议从插件市场获取
2. 在需要使用页面的 `(n)vue` 文件中添加
```html
<mp-html :content="html" />
```
```javascript
import mpHtml from '@/components/mp-html/mp-html'
export default {
// HBuilderX 2.5.5+ 可以通过 easycom 自动引入
components: {
mpHtml
},
data() {
return {
html: '<div>Hello World!</div>'
}
}
}
```
- npm 方式
1. 在项目根目录下执行
```bash
npm install mp-html
```
2. 在需要使用页面的 `(n)vue` 文件中添加
```html
<mp-html :content="html" />
```
```javascript
import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
export default {
// 不可省略
components: {
mpHtml
},
data() {
return {
html: '<div>Hello World!</div>'
}
}
}
```
3. 需要更新版本时执行以下命令即可
```bash
npm update mp-html
```
使用 *cli* 方式运行的项目,通过 *npm* 方式引入时,需要在 *vue.config.js* 中配置 *transpileDependencies*,详情可见 [#330](https://github.com/jin-yufeng/mp-html/issues/330#issuecomment-913617687)
如果在 **nvue** 中使用还要将 `dist/uni-app/static` 目录下的内容拷贝到项目的 `static` 目录下,否则无法运行
查看 [快速开始](https://jin-yufeng.github.io/mp-html/#/overview/quickstart) 了解更多
## 组件属性
| 属性 | 类型 | 默认值 | 说明 |
|:---:|:---:|:---:|---|
| container-style | String | | 容器的样式([2.1.0+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v210)) |
| content | String | | 用于渲染的 html 字符串 |
| copy-link | Boolean | true | 是否允许外部链接被点击时自动复制 |
| domain | String | | 主域名(用于链接拼接) |
| error-img | String | | 图片出错时的占位图链接 |
| lazy-load | Boolean | false | 是否开启图片懒加载 |
| loading-img | String | | 图片加载过程中的占位图链接 |
| pause-video | Boolean | true | 是否在播放一个视频时自动暂停其他视频 |
| preview-img | Boolean | true | 是否允许图片被点击时自动预览 |
| scroll-table | Boolean | false | 是否给每个表格添加一个滚动层使其能单独横向滚动 |
| selectable | Boolean | false | 是否开启文本长按复制 |
| set-title | Boolean | true | 是否将 title 标签的内容设置到页面标题 |
| show-img-menu | Boolean | true | 是否允许图片被长按时显示菜单 |
| tag-style | Object | | 设置标签的默认样式 |
| use-anchor | Boolean | false | 是否使用锚点链接 |
查看 [属性](https://jin-yufeng.github.io/mp-html/#/basic/prop) 了解更多
## 组件事件
| 名称 | 触发时机 |
|:---:|---|
| load | dom 树加载完毕时 |
| ready | 图片加载完毕时 |
| error | 发生渲染错误时 |
| imgtap | 图片被点击时 |
| linktap | 链接被点击时 |
| play | 音视频播放时 |
查看 [事件](https://jin-yufeng.github.io/mp-html/#/basic/event) 了解更多
## api
组件实例上提供了一些 `api` 方法可供调用
| 名称 | 作用 |
|:---:|---|
| in | 将锚点跳转的范围限定在一个 scroll-view 内 |
| navigateTo | 锚点跳转 |
| getText | 获取文本内容 |
| getRect | 获取富文本内容的位置和大小 |
| setContent | 设置富文本内容 |
| imgList | 获取所有图片的数组 |
| pauseMedia | 暂停播放音视频([2.2.2+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v222)) |
| setPlaybackRate | 设置音视频播放速率([2.4.0+](https://jin-yufeng.github.io/mp-html/#/changelog/changelog#v240)) |
查看 [api](https://jin-yufeng.github.io/mp-html/#/advanced/api) 了解更多
## 插件扩展
除基本功能外,本组件还提供了丰富的扩展,可按照需要选用
| 名称 | 作用 |
|:---:|---|
| audio | 音乐播放器 |
| editable | 富文本 **编辑**[示例项目](https://mp-html.oss-cn-hangzhou.aliyuncs.com/editable.zip)) |
| emoji | 解析 emoji |
| highlight | 代码块高亮显示 |
| markdown | 渲染 markdown |
| search | 关键词搜索 |
| style | 匹配 style 标签中的样式 |
| txv-video | 使用腾讯视频 |
| img-cache | 图片缓存 by [@PentaTea](https://github.com/PentaTea) |
| latex | 渲染 latex 公式 by [@Zeng-J](https://github.com/Zeng-J) |
从插件市场导入的包中 **不含有** 扩展插件,使用插件需通过微信小程序 `富文本插件` 获取或参考以下方法进行打包:
1. 获取完整组件包
```bash
npm install mp-html
```
2. 编辑 `tools/config.js` 中的 `plugins` 项,选择需要的插件
3. 生成新的组件包
`node_modules/mp-html` 目录下执行
```bash
npm install
npm run build:uni-app
```
4. 拷贝 `dist/uni-app` 中的内容到项目根目录
查看 [插件](https://jin-yufeng.github.io/mp-html/#/advanced/plugin) 了解更多
## 关于 nvue
`nvue` 使用原生渲染,不支持部分 `css` 样式,为实现和 `html` 相同的效果,组件内部通过 `web-view` 进行渲染,性能上差于原生,根据 `weex` 官方建议,`web` 标签仅应用在非常规的降级场景。因此,如果通过原生的方式(如 `richtext`)能够满足需要,则不建议使用本组件,如果有较多的富文本内容,则可以直接使用 `vue` 页面
由于渲染方式与其他端不同,有以下限制:
1. 不支持 `lazy-load` 属性
2. 视频不支持全屏播放
3. 如果在 `flex-direction: row` 的容器中使用,需要给组件设置宽度或设置 `flex: 1` 占满剩余宽度
`nvue` 模式下,[此问题](https://ask.dcloud.net.cn/question/119678) 修复前,不支持通过 `uni_modules` 引入,需要本地引入(将 [dist/uni-app](https://github.com/jin-yufeng/mp-html/tree/master/dist/uni-app) 中的内容拷贝到项目根目录下)
## 问题反馈
遇到问题时,请先查阅 [常见问题](https://jin-yufeng.github.io/mp-html/#/question/faq)[issue](https://github.com/jin-yufeng/mp-html/issues) 中是否已有相同的问题
可通过 [issue](https://github.com/jin-yufeng/mp-html/issues/new/choose) 、插件问答或发送邮件到 [mp_html@126.com](mailto:mp_html@126.com) 提问,不建议在评论区提问(不方便回复)
提问请严格按照 [issue 模板](https://github.com/jin-yufeng/mp-html/issues/new/choose) ,描述清楚使用环境、`html` 内容或可复现的 `demo` 项目以及复现方式,对于 **描述不清****无法复现** 或重复的问题将不予回复
欢迎加入 `QQ` 交流群:
群1(已满):`699734691`
群2(已满):`778239129`
群3:`960265313`
查看 [问题反馈](https://jin-yufeng.github.io/mp-html/#/question/feedback) 了解更多
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"id": "mp-html",
"displayName": "mp-html 富文本组件【全端支持,支持编辑、latex等扩展】",
"version": "v2.5.1",
"description": "一个强大的富文本组件,高效轻量,功能丰富",
"keywords": [
"富文本",
"编辑器",
"html",
"rich-text",
"editor"
],
"repository": "https://github.com/jin-yufeng/mp-html",
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/mp-html",
"type": "component-vue"
},
"uni_modules": {
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-harmony": "u",
"app-uvue": "u"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "u",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
\ No newline at end of file
...@@ -270,6 +270,9 @@ const handleToolClick = async (item) => { ...@@ -270,6 +270,9 @@ const handleToolClick = async (item) => {
buttonName: item.title, buttonName: item.title,
}); });
// 跳转产检提醒页面判断
let listData = userStore.babyInfo.allBabyBaseInfo || []
if (item.title === "医生问诊") { if (item.title === "医生问诊") {
if (!cfgStatus.value.isRegister) return; if (!cfgStatus.value.isRegister) return;
...@@ -301,8 +304,20 @@ const handleToolClick = async (item) => { ...@@ -301,8 +304,20 @@ const handleToolClick = async (item) => {
}, },
}, },
}); });
} else if(item.title === "产检提醒"){
if(listData.length > 0){
const hasPregnancy = listData.some(item => item.typeName === "孕中" && item.selected === true )
console.log(hasPregnancy, 'hasPregnancy')
if(hasPregnancy){
jump({ type: item.link.type, url: item.link.url});
} else{
uni.showToast({
title: "需要是孕中状态哦",
icon: "none",
});
}
}
} else { } else {
const extra = item.link.extra; const extra = item.link.extra;
if(extra && extra.babyId){ if(extra && extra.babyId){
jump({ type: item.link.type, url: item.link.url+'?babyId='+extra.babyId}); jump({ type: item.link.type, url: item.link.url+'?babyId='+extra.babyId});
...@@ -338,7 +353,7 @@ const handleEditProfile = (e) => { ...@@ -338,7 +353,7 @@ const handleEditProfile = (e) => {
)?.id; )?.id;
if (type === "edit") { if (type === "edit") {
navigateTo(`/pages/person/person?type=${type}&id=${babyId}`); navigateTo(`/pages/person/person?type=${type}&id=${babyId.value}`);
} else { } else {
navigateTo(`/pages/person/person?type=${type}`); navigateTo(`/pages/person/person?type=${type}`);
} }
......
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