Browse Source

患者演示模式展示

210plan
aBin 3 years ago
parent
commit
191b289e82
  1. 71
      src/components/Demonstration/Demonstration.vue
  2. 2
      src/components/Service/Service.vue
  3. 29
      src/pages/index/index.vue
  4. 6
      src/pages/info/info.vue
  5. 7
      src/pages/inner/inner.vue
  6. 5
      src/pages/outside/outside.vue
  7. 8
      src/pages/patient/patient.vue
  8. 8
      src/store/carbasics/mutations.js
  9. 1
      src/store/carbasics/state.js

71
src/components/Demonstration/Demonstration.vue

@ -0,0 +1,71 @@
<template>
<div
class="demonstration-box w-full flex flex-nowrap"
style="padding: 0 16px"
:style="{ backgroundColor: detailValueType === 1 ? '#40a9ff' : '#6ea4d1' }"
:class="patientInfo && patientInfo.isInfo ? 'justify-between' : 'justify-center'"
>
<template v-if="patientInfo && patientInfo.isInfo">
<div class="flex">
<div style="margin-right: 16px">
{{ patientInfo.name ? patientInfo.name : '无名氏' }}
</div>
<div style="margin-right: 16px">
<span v-if="patientInfo && (patientInfo.gender || patientInfo.gender === 0)">
{{ patientInfo.gender === 0 ? '女' : '男' }}
</span>
<span v-else>-</span>
</div>
<div>
{{ patientInfo.age ? patientInfo.age + '岁' : '-' }}
</div>
</div>
</template>
<div>
<span v-if="detailValueType === 1"> 当前为演示模式 </span>
</div>
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex';
export default {
name: 'Demonstration',
data() {
return {};
},
computed: mapState('carbasics', ['patientInfo', 'firstAidId', 'detailValueType']),
async created() {
await this.getData();
},
methods: {
...mapMutations('carbasics', ['setPatientInfo']),
//
async getData() {
try {
const param = { firstAidId: this.firstAidId };
const data = await this.$u.api.getPatient(param);
const info = {
name: data.name,
gender: data.gender,
age: data.age,
isInfo: true,
};
this.setPatientInfo(info);
} catch (error) {
console.log('error: ', error);
}
},
},
};
</script>
<style scoped>
.demonstration-box {
height: 28px;
line-height: 28px;
text-align: center;
position: fixed;
color: #fff;
top: 0;
z-index: 99;
}
</style>

2
src/components/Service/Service.vue

@ -9,7 +9,7 @@
<!-- 客服 -->
<img style="height: 28px; width: 28px" src="./icon/tel-we.png" alt="" />
</button>
<view class="edition">v3.0.0</view>
<view class="edition">v3.1.0</view>
</div>
</template>
<script>

29
src/pages/index/index.vue

@ -124,8 +124,33 @@ export default {
},
//
jumpDetail(item) {
if (item.articleUrl) {
uni.navigateTo({ url: `/pages/detail-webview/detail-webview?jumpUrl=${item.articleUrl}` });
// if (item.articleUrl) {
// uni.navigateTo({ url: `/pages/detail-webview/detail-webview?jumpUrl=${item.articleUrl}` });
// }
const data = item;
if (data.articleUrl) {
const jumpType = data.jumpType;
if (jumpType === 1) {
uni.navigateTo({ url: `/pages/detail-webview/detail-webview?jumpUrl=${data.articleUrl}` });
} else if (jumpType === 2) {
uni.downloadFile({
url: data.articleUrl,
success: function (res) {
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
});
},
});
} else if (jumpType === 3) {
uni.previewImage({
urls: [data.articleUrl],
longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'],
},
});
}
}
},
async getNotice() {

6
src/pages/info/info.vue

@ -1,5 +1,6 @@
<template>
<div class="info">
<div class="info" style="padding-top: 28px">
<Demonstration />
<div bordered class="list-box bg-white mb-2" v-for="(item, index) in list" :key="index">
<template v-for="(listItem, listIndex) in item">
<div class="list-item" :key="listIndex" v-if="getRadioValue(listItem.Fcode) === listItem.isShow">
@ -59,9 +60,10 @@
<script>
import { mapState } from 'vuex';
import Demonstration from 'components/Demonstration/Demonstration';
export default {
components: {},
components: { Demonstration },
data: () => ({
timeSelectparams: {
//

7
src/pages/inner/inner.vue

@ -1,6 +1,6 @@
<template>
<div class="inner">
<!-- :style="{ paddingTop: detailValueType === 1 ? '28px' : '' }" -->
<div class="inner" :style="{ paddingTop: detailValueType === 1 ? '28px' : '' }">
<Demonstration />
<div class="w-full" v-for="(item, index) in testList" :key="index">
<template v-if="item.testType === 1">
<Test
@ -58,9 +58,10 @@
import { mapState } from 'vuex';
import Mixin from './mixin';
import cloneDeep from 'lodash/cloneDeep';
import Demonstration from 'components/Demonstration/Demonstration';
export default {
components: {},
components: { Demonstration },
mixins: [Mixin],
data: () => ({
testList: [],

5
src/pages/outside/outside.vue

@ -1,5 +1,6 @@
<template>
<div class="w-full flex flex-col flex-wrap" style="padding-bottom: 20px">
<div class="w-full flex flex-col flex-wrap" style="padding-bottom: 20px; padding-top: 28px">
<Demonstration />
<div class="w-full" v-for="(item, index) in testList" :key="index">
<template v-if="item.testType === 1">
<Test
@ -58,10 +59,12 @@
import { mapState } from 'vuex';
import Mixin from './mixin';
import cloneDeep from 'lodash/cloneDeep';
import Demonstration from 'components/Demonstration/Demonstration';
export default {
name: 'outside',
mixins: [Mixin],
components: { Demonstration },
data() {
return {
type: 'RYPG', // RYPG(),ZYJC(),SSXG(),CYJL(),TSCX()

8
src/pages/patient/patient.vue

@ -1,5 +1,6 @@
<template>
<div class="establish bg-gray-100">
<div class="establish bg-gray-100" style="padding-top: 28px">
<Demonstration />
<div bordered class="list-box bg-white" v-for="(item, index) in list" :key="index">
<div
class="list-item"
@ -74,9 +75,10 @@
<script>
import { mapState, mapGetters, mapMutations } from 'vuex';
import Demonstration from 'components/Demonstration/Demonstration';
export default {
components: {},
components: { Demonstration },
data: () => ({
action: '',
codeValue: {
@ -134,7 +136,7 @@ export default {
}),
computed: {
...mapGetters('project', ['projectId']),
...mapState('carbasics', ['globalData', 'firstAidId']),
...mapState('carbasics', ['globalData', 'firstAidId', 'detailValueType']),
},
onLoad(options) {

8
src/store/carbasics/mutations.js

@ -53,6 +53,14 @@ const mutations = {
setBasicData(state, data) {
state.basicData = data;
},
/**
* 存储当前查看的患者信息
* @param { object } state
* @param { object } data
*/
setPatientInfo(state, data) {
state.patientInfo = { ...data };
},
};
export default mutations;

1
src/store/carbasics/state.js

@ -6,6 +6,7 @@ const state = {
InputCode: 'RYPG', // 当前试题录入的类型
isRefresh: 0, // 是否刷新当前试题界面 监听数值,每次改变一次刷新一次
basicData: null, // ocr识别到的试题及答案的数据
patientInfo: {},
};
export default state;

Loading…
Cancel
Save