更新
This commit is contained in:
@@ -356,6 +356,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted,getCurrentInstance } from "vue";
|
||||
import { onShow, onShareAppMessage } from '@dcloudio/uni-app'
|
||||
// 2. 获取组件实例,通过 proxy 访问全局属性
|
||||
const { proxy } = getCurrentInstance()
|
||||
const formData = ref({
|
||||
@@ -433,7 +434,21 @@ onMounted(() => {
|
||||
getDictOptions();
|
||||
loadDiagnosisDetail();
|
||||
});
|
||||
|
||||
onShareAppMessage((res) =>{
|
||||
return {
|
||||
title: '诊单确认',
|
||||
path: '/pages/order/monad/monad?id='+diagnosisId+'&share_user_id='+share_user_id,
|
||||
imageUrl: '',
|
||||
desc: '诊单确认',
|
||||
success() {
|
||||
uni.showToast({ title: '分享成功', icon: 'success' });
|
||||
},
|
||||
fail(err) {
|
||||
console.log('分享失败:', err);
|
||||
uni.showToast({ title: '分享失败', icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
// 获取字典数据
|
||||
const getDictOptions = async () => {
|
||||
try {
|
||||
@@ -518,7 +533,8 @@ const getDictData = async (type) => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
let diagnosisId=''
|
||||
let share_user_id='';
|
||||
// 加载诊单详情
|
||||
const loadDiagnosisDetail = async () => {
|
||||
// 从页面参数获取诊单ID
|
||||
@@ -526,7 +542,8 @@ const loadDiagnosisDetail = async () => {
|
||||
const currentPage = pages[pages.length - 1];
|
||||
const params = proxy.$parsePageParams(currentPage.options);
|
||||
dingdan_ok.value=uni.getStorageSync('dingdan_ok');
|
||||
const diagnosisId = params.id;
|
||||
diagnosisId = params.id;
|
||||
share_user_id = params.share_user_id;
|
||||
console.log('进入onMounted:', params, '诊单ID:', diagnosisId);
|
||||
|
||||
if (!diagnosisId) {
|
||||
|
||||
Reference in New Issue
Block a user