添加接口

This commit is contained in:
zoujiandong 2025-03-17 15:13:19 +08:00
parent c29e61e0d6
commit 5c3525daa3
6 changed files with 35 additions and 11 deletions

View File

@ -6,6 +6,9 @@ const login = (data) => {
const getProjectList = (data) => { const getProjectList = (data) => {
return http.get("/project/page", data); return http.get("/project/page", data);
}; };
const getProjectDetail = (id) => {
return http.get("/project/"+id);
};
const getCaseList = (data) => { const getCaseList = (data) => {
return http.get("/case/page", data); return http.get("/case/page", data);
}; };
@ -56,6 +59,6 @@ export default {
getScore, getScore,
getConfig, getConfig,
completeCase, completeCase,
behaviorRecord behaviorRecord,
getProjectDetail
} }

View File

@ -52,6 +52,17 @@ const route = useRoute();
let origin=route.query.source?route.query.source:''; let origin=route.query.source?route.query.source:'';
const source=ref(origin); const source=ref(origin);
const freshkey = ref(0); const freshkey = ref(0);
const props=defineProps({
project_id:{
type:String,
default:''
}
})
const envVersion=computed(()=>{
if(source.value==3){
return 'release'
}
})
const goHome = () => { const goHome = () => {
if(source.value==3){ if(source.value==3){
// try { // try {
@ -72,7 +83,8 @@ const goHome = () => {
}); });
}else{ }else{
router.push({ router.push({
path: "/home", path: "/caseList",
query: { project_id: props.project_id },
}); });
} }

View File

@ -21,7 +21,7 @@
<caseDetail v-for="(item, index) in pageList" :pageIndex="index" :step="step" @switchPage="switchPage" :pageItem="item" :pageNum="pageList.length" @getAllAnswer="getAllAnswer" :start_time="start_time" :case_id="case_id"></caseDetail> <caseDetail v-for="(item, index) in pageList" :pageIndex="index" :step="step" @switchPage="switchPage" :pageItem="item" :pageNum="pageList.length" @getAllAnswer="getAllAnswer" :start_time="start_time" :case_id="case_id"></caseDetail>
<comment v-show="!showIntro && step==pageList.length" ref="commentRef" :countTime="countTime" @initPage="initPage" :start_time="entry_time" :allAnswer="allAnswer" :is_welfare="is_welfare"></comment> <comment v-show="!showIntro && step==pageList.length" ref="commentRef" :countTime="countTime" @initPage="initPage" :start_time="entry_time" :allAnswer="allAnswer" :is_welfare="is_welfare"></comment>
<totop></totop> <totop></totop>
<back></back> <back :project_id="caseObj.project_id"></back>
</template> </template>
<script setup> <script setup>

View File

@ -29,14 +29,23 @@ import { ref} from "vue";
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { WXSHARE } from "../utils/wxshare-1.6.0"; import { WXSHARE } from "../utils/wxshare-1.6.0";
import host from "../utils/host" import host from "../utils/host"
import api from '../api/user.js';
const route = useRoute(); const route = useRoute();
//0: 1: 2: //0: 1: 2:
const activeName = ref(2); const activeName = ref(2);
const img_url=ref(route.query.img_url) const img_url=ref('')
const case_num=ref(route.query.case_num) const case_num=ref('');
const getDetail=async()=>{
const {code,data}=await api.getProjectDetail(route.query.project_id);
if(code==200){
img_url.value=data.project_image;
case_num.value=data.case_count;
let link=host+'/web/caseList?project_id='+route.query.project_id;
WXSHARE(data.project_name,"肝胆相照-肝胆病在线公共服务平台",link,'');
}
}
onMounted(() => { onMounted(() => {
let link=host+'/web/home'; getDetail();
WXSHARE('“佳动例”等你来挑战,精彩福利享不停',"肝胆相照-肝胆病在线公共服务平台",link,'');
}) })
</script> </script>

View File

@ -36,7 +36,7 @@ const finished = ref(false);
const goCase = (id,img,num) => { const goCase = (id,img,num) => {
router.push({ router.push({
path: 'caseList', path: 'caseList',
query: { project_id: id,img_url:img,case_num: num} query: { project_id: id}
}) })
} }
const getList = async () => { const getList = async () => {
@ -66,7 +66,7 @@ const onLoad = () => {
}; };
onMounted(() => { onMounted(() => {
let link=host+'/web/home'; let link=host+'/web/home';
WXSHARE('“佳动例”等你来挑战,精彩福利享不停',"肝胆相照-肝胆病在线公共服务平台",link,''); WXSHARE('肝胆相照互动病例等你来挑战,福利享不停',"肝胆相照-肝胆病在线公共服务平台",link,'');
}) })
</script> </script>

View File

@ -11,7 +11,7 @@
<pageunit v-for="(item, index) in pageList" :pageIndex="index" :pageItem="item" :imgList="imgList" @changeImg="changeImg"></pageunit> <pageunit v-for="(item, index) in pageList" :pageIndex="index" :pageItem="item" :imgList="imgList" @changeImg="changeImg"></pageunit>
</div> </div>
<totop></totop> <totop></totop>
<back></back> <back :project_id="project_id"></back>
</div> </div>
<!-- < ref="ImagePreview" v-model:show="showImg" closeable :images="imgList" @change="onChange"> <!-- < ref="ImagePreview" v-model:show="showImg" closeable :images="imgList" @change="onChange">