Commit e906e461 authored by miaojiale's avatar miaojiale

基本页面

parent d94d92a1
...@@ -18,11 +18,7 @@ ...@@ -18,11 +18,7 @@
<META HTTP-EQUIV="expires" CONTENT="0"> <META HTTP-EQUIV="expires" CONTENT="0">
<!-- 标签图标 --> <!-- 标签图标 -->
<!-- <link type="favicon" rel="shortcut icon" href="./static/favicon.ico" /> --> <!-- <link type="favicon" rel="shortcut icon" href="./static/favicon.ico" /> -->
<title>国家重大疾病</title> <title>视频诊断</title>
<link rel="stylesheet" href="./static/swiper/idangerous.swiper.css">
<script src="./static/swiper/idangerous.swiper.min.js"></script>
<!-- <script src="./static/iSlider.js"></script> -->
<script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script> <script src="https://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var _hmt = _hmt || []; var _hmt = _hmt || [];
......
<template> <template>
<div <div id="app">
id="app"
:class="{'is-ipx':isIPX == 1}"
>
<transition :name="routerAnimate"> <transition :name="routerAnimate">
<keep-alive :include="keepAlive"> <keep-alive>
<router-view class="app-content"></router-view> <router-view
class="app-content"
v-if="$route.meta.keepAlive"
></router-view>
</keep-alive> </keep-alive>
</transition> </transition>
<!-- <transition :name="routerAnimate"> <transition :name="routerAnimate">
<router-view class="app-content" v-if="!$route.meta.keepAlive"></router-view> <router-view
</transition> --> class="app-content"
<!--底部导航 路由 --> v-if="!$route.meta.keepAlive"
<footer ></router-view>
class="app-footer" </transition>
v-if="$route.meta.index == 1 && carTabFlag!=2"
>
<wx-tab :tab="tabIndex"></wx-tab>
</footer>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapState } from 'vuex'
import wxTab from '@/components/common/tab'
export default { export default {
name: 'app', name: 'app',
components: {
wxTab,
},
data () { data () {
return { return {
"tabIndex": 1, aliveRoute: [],
"pageName": "", routerAnimate: ''
"routerAnimate": "",
keepAlive: ['cHome'],
aliveRoute: ['screeningMap', 'screeningFiles']
} }
}, },
watch: { watch: {
// 监听 $route 为内页设置不同的过渡效果 // 监听 $route 为内页设置不同的过渡效果
"$route" (to, from) { "$route" (to, from) {
/*动态设置路由缓存 start*/
if (this.aliveRoute.includes(to.name)) {
to.meta.keepAlive = true
}
let aliveRoute = this.$router.options.routes.filter(e => e.meta && e.meta.keepAlive).map(e => e.name)
this.keepAlive = aliveRoute
/*动态设置路由缓存 end*/
// console.log(aliveRoute);
if (to.path == "/homePageIdx") {
this.tabIndex = 0
this.setCarTabFlagData(1);
this.$forceUpdate();
} else if (to.path == "/categoryIdx") {
this.tabIndex = 1
this.setCarTabFlagData(1);
} else if (to.path == "/carIndex") {
this.tabIndex = 2
this.$forceUpdate();
} else if (to.path == "/userIndex") {
this.setCarTabFlagData(1);
this.tabIndex = 3
}
this.routerAnimate = ""
if (to.meta.index === from.meta.index) { if (to.meta.index === from.meta.index) {
return; return;
// this.routerAnimate = "slide-left" // this.routerAnimate = "slide-left"
...@@ -88,21 +53,12 @@ export default { ...@@ -88,21 +53,12 @@ export default {
}, },
}, },
computed: { computed: {
isIPX () {
// console.log(this.$store.state.isLogin)
return this.$store.state.isIPX
},
userInfo () { userInfo () {
return this.$store.state.userInfo || {} return this.$store.state.userInfo || {}
}, },
carTabFlag () {
return this.$store.state.carTabFlag
}
}, },
methods: { methods: {
...mapActions(['setIsFromShareAction', 'setCarTabFlagData']),
}, },
created () { created () {
......
<template> <template>
<div></div> <!-- 筛查地图 -->
<div class="index-wrap">
<!-- <x-header :left-options="{ backText: '', showBack: false }">
登录
</x-header> -->
<v-content
:has-header="false"
:has-footer="false"
>
<van-form @submit="onSubmit">
<div class="title">登录</div>
<van-field
v-model="username"
name="username"
label=""
placeholder="用户名"
:rules="[{ required: true, message: '请填写用户名' }]"
/>
<van-field
v-model="password"
type="password"
name="password"
label=""
placeholder="密码"
:rules="[{ required: true, message: '请填写密码' }]"
/>
<div style="margin: 16px;">
<van-button
round
block
type="info"
class="btn"
native-type="submit"
@click="$router.push('/peopleList')"
>提交</van-button>
</div>
</van-form>
</v-content>
</div>
</template> </template>
<script> <script>
export default { export default {
name: 'login',
data () { data () {
return {} return {
username: '',
password: '',
};
}, },
methods: {}, methods: {
mounted () { }, onSubmit (values) {
watch: {} console.log('submit', values);
} },
}
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content {
position: relative;
padding: 0 5px;
}
.van-form {
width: 100%;
position: absolute;
top: 30%;
transform: translateY(-50%);
.title{
text-align: center;
font-size: 20px;
margin: 20px 0;
}
.van-field{
// height: 44px;
}
.btn{
height: 44px;
border-radius: 22px !important;
}
}
</style> </style>
This diff is collapsed.
<template> <template>
<div> <div>
<x-header :left-options="{backText: '',showBack:true}"> <x-header :left-options="{backText: '',showBack:true}">
预约类型 内镜视频
<div
class="uploadBtn"
slot="right"
>
<van-uploader>
<van-button type="text">上传文件</van-button>
</van-uploader>
</div>
</x-header> </x-header>
<!-- 列表 --> <!-- 列表 -->
<v-content <v-content
has-header has-header
has-footer :has-footer="false"
> >
<div class="list_content"> <div class="list_content">
<van-cell-group <van-row
inset type="flex"
v-for="(item,index) in typeList" justify="space-between"
>
<van-col
v-for="(item,index) in videoList"
:key="index" :key="index"
class="col"
> >
<van-cell <!-- 视频 -->
center <video
:title="item.name" id="video"
:label="item.address" controls
is-link preload="auto"
@click="jumpTo(index)" loop="loop"
x5-video-player-fullscreen="true"
x5-video-orientation="portraint"
playsinline="true"
x5-video-player-type="h5"
style="object-fit:fill"
> >
<template #icon> <!-- :poster="'https://img1.baidu.com/it/u=3009731526,373851691&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'" -->
456 <source src="../assets/img/video.mp4">
</template> </video>
</van-cell>
</van-cell-group> <div class="label">
{{item.name}}
</div>
<div class="label">
{{item.time}}
</div>
<div class="label">
<a>诊断详情</a>
<a
style="color:#127BFF;"
@click="showPop(item.describe)"
>点击查看</a>
</div>
</van-col>
</van-row>
</div> </div>
</v-content> </v-content>
<van-popup
v-model="show"
position="bottom"
round
:style="{ height: '40%' }"
>
<div class="pop_content">
<div class="item">
<div class="label">
诊断日期:
</div>
<div class="value">
{{ describe.date }}
</div>
</div>
<div class="item">
<div class="label">
诊断所见:
</div>
<div class="value">
{{ describe.see }}
</div>
</div>
<div class="item">
<div class="label">
诊断结果:
</div>
<div class="value">
{{ describe.result }}
</div>
</div>
</div>
</van-popup>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data () { data () {
return { return {
typeList: [ show: false,
describe: {},//诊断详情
videoList: [
{ {
name: '门诊预约', name: '视频',
address: '看病看医生', url: 'https://docs.egret.com/engine/img/engine2d.mp4',
time: '2022-01-04',
describe: {
date: '2022-01-08',
see: '大肿瘤',
result: '倒计时20天'
}
}, },
{ {
name: '医技预约', name: '视频',
address: '检验检查、无需等待', url: 'https://docs.egret.com/engine/img/engine2d.mp4',
time: '2022-01-04',
describe: {
date: '2022-01-08',
see: '大肿瘤',
result: '倒计时20天'
} }
] },
{
name: '视频',
url: 'https://docs.egret.com/engine/img/engine2d.mp4',
time: '2022-01-04',
describe: {
date: '2022-01-08',
see: '大肿瘤',
result: '倒计时20天'
} }
}, },
methods: { {
jumpTo (i) { name: '视频',
if (i == 0) { url: 'https://docs.egret.com/engine/img/engine2d.mp4',
this.$API.getEncryptedInfo( time: '2022-01-04',
this.$route.query.id describe: {
).then(res => { date: '2022-01-08',
if (res.code == 1) { see: '大肿瘤',
let str = res.object result: '倒计时20天'
// console.log(str);
// let url
// if (process.env.NODE_ENV === 'development') {
// url = `https://ih.wzaijk.com/patient-wenzhou-h5/#/projects/wenzhou/pages/yygh/yyghHome?content=${str}&app=yygh`
// } else {
// url = `https://ih.wzaijk.com.cn/patient-wenzhou-h5/#/projects/wenzhou/pages/yygh/yyghHome?content=${str}&app=yygh`
// }
// console.log(url);
window.open(str, '_self');
} }
})
} }
],
} }
}, },
methods: {
jumpTo () {
console.log('双穿视屏');
},
showPop (data) {
this.show = true
this.describe = data
},
},
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
from.meta.keepAlive = true from.meta.keepAlive = true
next() next()
}, },
mounted () { }, mounted () {
},
watch: {} watch: {}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content {
background: rgb(246, 246, 246);
}
.list_content { .list_content {
padding: 14px 14px;
.col {
width: 48%;
padding: 10px; padding: 10px;
background: #fff;
margin-bottom: 10px;
.label {
display: flex;
justify-content: space-between;
font-size: 12px;
}
}
}
#video {
width: 100%;
height: 150px;
} }
::v-deep .van-cell-group { .uploadBtn {
margin: 10px 0; transform: translateY(-16px) translatex(12px);
color: #fff;
}
.pop_content {
padding: 20px;
.item {
display: flex;
margin-bottom: 10px;
.label {
color: #127bff;
}
.value {
color: #444;
}
}
} }
</style> </style>
\ No newline at end of file
...@@ -5,11 +5,17 @@ Vue.use(Router); ...@@ -5,11 +5,17 @@ Vue.use(Router);
const page = [ const page = [
{ {
path: "/", path: "/",
redirect: "/peopleList" //调试 redirect: "/login" //调试
},
{
path: "/login",
meta: { index: 1, keepAlive: false },
name: "login",
component: () => import("@/pages/login")
}, },
{ {
path: "/peopleList", path: "/peopleList",
meta: { index: 1, keepAlive: true }, meta: { index: 1, keepAlive: true, scrollTop: 0 },
name: "peopleList", name: "peopleList",
component: () => import("@/pages/peopleList") component: () => import("@/pages/peopleList")
}, },
...@@ -29,6 +35,12 @@ const router = new Router({ ...@@ -29,6 +35,12 @@ const router = new Router({
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (from.meta.keepAlive) {
const $wrapper = document.querySelector(".list_content"); // 列表的外层容器 注意找到滚动的盒子
const scrollTop = $wrapper ? $wrapper.scrollTop : 0;
// console.log("scrollTop=", scrollTop);
from.meta.scrollTop = scrollTop;
}
next(); next();
}); });
// 解决编程式路由往同一地址跳转时会报错的情况 // 解决编程式路由往同一地址跳转时会报错的情况
......
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