Browse Source

fix: 1.添加血脂小数点 2.修改当前题号缓存机制

develop
song 4 years ago
parent
commit
ce35b311b7
  1. 3
      CHANGELOG.md
  2. 4
      rest/燕园.http
  3. 39
      src/components/Info/Info.vue
  4. 3
      src/components/Upload/Upload.vue
  5. 6
      src/config/yyInfo.js
  6. 6
      src/mixins/tool.js
  7. 10
      src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue
  8. 23
      src/pagesProject/project/components/ConfigInfo/components/FamilyDetail.vue
  9. 2
      src/pagesProject/project/components/Evaluated/EvaluatedNLCP.vue
  10. 12
      src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue
  11. 2
      src/pagesYanyuan/add-info/add-info.vue
  12. 21
      src/pagesYanyuan/assess/assess.vue
  13. 2
      src/pagesYanyuan/assess/components/Test/answerPage.vue
  14. 26
      src/pagesYanyuan/assess/components/Test/components/TestMain.vue
  15. 24
      src/pagesYanyuan/assess/components/Test/components/TitlePosition.vue
  16. 2
      src/pagesYanyuan/assess/components/Test/promptPage.vue
  17. 2
      src/pagesYanyuan/transfer-page/transfer-page.vue
  18. 1
      src/store/yanyuan/actions.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-12-14)
# 0.1.0 (2021-12-16)
### 🌟 新功能
范围|描述|commitId
@ -278,6 +278,7 @@
- | 解决error | [cacbe7f](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/cacbe7f)
- | 解决error | [1a6e513](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/1a6e513)
- | 解决警告 | [c932b09](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c932b09)
- | 设置页面样式调整 | [641dcd1](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/641dcd1)
### chore

4
rest/燕园.http

@ -121,7 +121,7 @@ Authorization: Bearer {{login.response.body.$.data.token}}
{
"param":{
"id":"3"
"id":"2"
}
}
###体验账号升级
@ -172,7 +172,7 @@ Authorization: Bearer {{login.response.body.$.data.token}}
"param":{
"code":"NLCP",
"reportId": "1464155290781618176",
"num": "17"
"num": "22"
}
}

39
src/components/Info/Info.vue

@ -314,6 +314,23 @@
:area-code="colItem.defaultValue"
></u-picker>
</view>
<!-- 带小数点的数字键盘 -->
<view v-if="colItem.type === 15" class="pr-3">
<view @click="change($event, index, itemIndex, colItem.type)" class="w-24 text-right" v-if="colItem.value">
{{ colItem.value }}
</view>
<view @click="change($event, index, itemIndex, colItem.type)" class="w-full text-right text-gray-350" v-else>
{{ colItem.placeholder }}
</view>
<u-keyboard
mode="number"
:mask="false"
:show-tips="false"
v-model="colItem.show"
@change="changeVal($event, index, itemIndex)"
@backspace="backspace($event, index, itemIndex)"
></u-keyboard>
</view>
</view>
</template>
<view class="w-full h-2 bg-gray-100" v-if="index !== infoList.length - 1"></view>
@ -377,6 +394,23 @@ export default {
},
methods: {
changeVal(e, index, itemIndex) {
const info = this.infoList[index][itemIndex];
info.value += e;
if (this.isEdit) {
this.updateTrainee(info);
}
},
// 退
backspace(e, index, itemIndex) {
const info = this.infoList[index][itemIndex];
// value
if (info.value.length) info.value = info.value.substr(0, info.value.length - 1);
if (this.isEdit) {
this.updateTrainee(info);
}
},
changeShow(index, itemIndex) {
this.infoList[index][itemIndex].show = !this.infoList[index][itemIndex].show;
},
@ -431,6 +465,11 @@ export default {
info.defaultValue = [e.province.value, e.city.value];
break;
}
case 15: {
//
info.show = !info.show;
break;
}
case 99: {
//
info.otherValue = e;

3
src/components/Upload/Upload.vue

@ -151,7 +151,8 @@ export default {
*/
async submit(toolCode) {
try {
const params = { toolCode };
const code = toolCode.substring(toolCode.length - 10);
const params = { toolCode: code };
await this.getBindTool(params);
setTimeout(() => {
this.$t.ui.showToast('工具箱绑定成功');

6
src/config/yyInfo.js

@ -25,7 +25,8 @@ const educateYears = () => {
/**
* 基本信息
* 展示类型: showType: 1 标题+折叠, 2 直接展示
* 试题类型, type:1 单选,2 日期(年月日),3 数字输入框,4 单列下拉框,5 多选,6 日期(年月日时),7 多列下拉选框, 8 文本输入框, 9 多列地区选择, 11 吸烟11 饮酒12 饮茶, 13 失眠, 14 有id的单选 99 其他
* 试题类型, type:1 单选,2 日期(年月日),3 数字输入框,4 单列下拉框,5 多选,6 日期(年月日时),7 多列下拉选框, 8 文本输入框,
* 9 多列地区选择, 10 吸烟11 饮酒12 饮茶, 13 失眠, 14 有id的单选, 15 带小数点的数字键盘 99 其他
*/
export const infoList = [
[
@ -159,9 +160,10 @@ export const infoList = [
name: '血脂(低密度脂蛋白)',
label: 'bloodFat',
showType: 2,
type: 3,
type: 15,
value: null,
show: false,
placeholder: '请输入',
},
],
[

6
src/mixins/tool.js

@ -80,15 +80,15 @@ export default {
becomeFamily(bindUserId) {
console.log('判断是否成为家属');
this.$t.ui
.showModal('提示', '是否申请成为家属?')
.showModal('提示', '工具箱已经被绑定,是否申请成为家属?')
.then(async () => {
const params = { bindUserId };
const res = await this.getCreateTrainee(params);
if (!res.length) {
this.$t.ui.showToast('提醒工具箱拥有者添加使用者信息');
this.$t.ui.showToast('您的亲属还没有添加老人信息,提醒他添加老人信息进行使用吧。');
setTimeout(() => {
uni.redirectTo({ url: '/pages/index/index' });
}, 2000);
}, 3000);
} else {
this.showElder = true;
// this.setShowChooseElder(true);

10
src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue

@ -4,8 +4,8 @@
<view class="px-3 bg-white">
<view v-for="(item, index) in itemList" :key="index" :style="headStyle" class="py-3">
<!-- 头部 -->
<view class="w-full flex flex-row items-center justify-between">
<view class="flex flex-1 items-center" @click="changeOpen(index)">
<view class="w-full flex flex-row items-center justify-between" @click="changeOpen(index)">
<view class="flex flex-1 items-center">
<img class="w-5 h-5 mr-2" :src="item.img" alt="" />
{{ item.head }}
</view>
@ -16,8 +16,8 @@
<view v-if="index === 1 || index === 2" class="mr-4">
<u-icon name="plus" @click="add(index)"></u-icon>
</view>
<u-icon name="arrow-up" v-if="item.open" @click="changeOpen(index)"></u-icon>
<u-icon name="arrow-down" v-else @click="changeOpen(index)"></u-icon>
<u-icon name="arrow-up" v-if="item.open"></u-icon>
<u-icon name="arrow-down" v-else></u-icon>
</view>
</view>
<!-- 内容区 -->
@ -53,7 +53,7 @@ export default {
data() {
return {
itemList: [
{ head: '基本信息', open: true, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' },
{ head: '长者信息', open: true, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' },
{ head: '药物使用记录', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu2.png' },
{ head: 'Zarit照顾者负担量表', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu3.png' },
{ head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' },

23
src/pagesProject/project/components/ConfigInfo/components/FamilyDetail.vue

@ -1,5 +1,6 @@
<template>
<view style="border: 1px solid #e5e5e5">
<view style="border: 1px solid #e5e5e5" class="flex flex-col">
<view v-if="detail && detail.familyId">
<view class="flex flex-col text-sm mx-4" v-for="(family, index) in familyInfo" :key="index">
<view class="flex justify-between items-center py-3 border-b">
<text>{{ family.name }}</text>
@ -10,16 +11,26 @@
<text v-else class="text-gray-400">{{ family.value }}</text>
</view>
</view>
<view v-if="detail.auditPrivilege === 1">
<view class="flex flex-col p-4" v-if="detail.auditStatus === '0'">
<u-button type="primary" class="mb-4" @click="auditFamily(1)">通过</u-button>
<u-button type="error" @click="auditFamily(2)">不通过</u-button>
</view>
<view class="flex flex-col p-4" v-else>
<u-button :plain="true">
{{ detail.auditStatus === '0' ? '未审核' : detail.auditStatus === '1' ? '审核通过' : '审核未通过' }}
</u-button>
</view>
</view>
<view class="flex flex-col p-4" v-else>
<u-button :plain="true">
{{ detail.auditStatus === '1' ? '审核通过' : '审核未通过' }}
{{ detail.auditStatus === '0' ? '未审核' : detail.auditStatus === '1' ? '审核通过' : '审核未通过' }}
</u-button>
</view>
</view>
<u-empty v-else text="暂无家属成员" mode="list" class="my-10"></u-empty>
</view>
</template>
<script>
@ -36,6 +47,14 @@ export default {
computed: mapGetters('project', ['projectId']),
watch: {
detail(val) {
if (val && val.familyId) {
this.setDate(this.detail);
}
},
},
mounted() {
if (this.detail && this.detail.familyId) {
this.setDate(this.detail);

2
src/pagesProject/project/components/Evaluated/EvaluatedNLCP.vue

@ -18,7 +18,7 @@
<u-icon name="arrow-down" color="#909399" v-else></u-icon>
</view>
<view class="bg-white flex flex-col" v-if="obj && obj.id && task.data.showDetail">
<view :style="{ width: '100%', height: cHeight + 'px' }">
<view :style="{ width: '100%', height: cHeight + 'px' }" class="flex flex-col items-center">
<UCharts
:canvas-id="obj.id"
:chartType="obj.chartType"

12
src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue

@ -6,7 +6,7 @@
</view>
<view v-if="task.data.type === 0 && task.data.mentalTest.finishStatus === 0">
<view class="flex flex-nowrap my-2">
<u-button type="primary" size="mini" class="mx-0" @click="startAssess">开始测评</u-button>
<u-button type="primary" class="mx-0" @click="startAssess">开始测评</u-button>
<view class="flex-1"></view>
</view>
<text class="text-xs text-gray-300">每两个周可进行一次测评</text>
@ -15,11 +15,13 @@
</template>
<script>
import { mapActions, mapMutations } from 'vuex';
import { mapActions, mapMutations, mapGetters } from 'vuex';
export default {
props: { task: { type: Object, default: () => {} } },
computed: mapGetters('project', ['projectId']),
methods: {
...mapActions('yanyuan', ['handleQuestion']),
...mapMutations('yanyuan', ['setCode']),
@ -36,7 +38,10 @@ export default {
const { task } = this;
this.setTask(task);
this.setCode('NLCP');
const num = this.$t.storage.getStorageSync('NLCPNum');
const arr = this.$t.storage.getStorageSync('NLCPNum').split('+');
const pid = arr[0];
const num = pid === this.projectId ? arr[1] : 0;
const params = {
code: 'NLCP',
reportId: task.id,
@ -45,6 +50,7 @@ export default {
await this.handleQuestion(params);
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });
} catch (error) {
this.$t.ui.showToast(error.msg || '查询失败');
console.error('error: ', error);
}
},

2
src/pagesYanyuan/add-info/add-info.vue

@ -27,6 +27,7 @@ export default {
try {
this.infoList = infoList;
await this.$u.api.addTrainee(params);
this.$t.storage.setStorageSync('infoList', null);
if (this.isApplying) {
this.$refs.uTips.show({
title: '用户信息添加成功, 即将申请成为家属',
@ -45,7 +46,6 @@ export default {
this.setEmptyInfo();
}, 2000);
}
this.$t.storage.setStorageSync('infoList', null);
} catch (error) {
console.error('error: ', error);
}

21
src/pagesYanyuan/assess/assess.vue

@ -1,5 +1,6 @@
<template>
<view class="flex flex-col p-3">
<u-button @click="aaa">清缓存</u-button>
<!-- 全局提示框 -->
<u-top-tips ref="uTips"></u-top-tips>
@ -42,12 +43,21 @@ export default {
...mapState('yanyuan', ['questionInfo', 'optionId', 'code', 'reportId']),
...mapState('task', ['task']),
...mapGetters('user', ['userId']),
...mapGetters('project', ['projectId']),
},
methods: {
...mapMutations('task', ['setIsEvaluated', 'setTimeNode']),
...mapMutations('yanyuan', ['setQuestionInfo', 'setAssessResult', 'setOptionId', 'setIsTest']),
...mapActions('yanyuan', ['handleQuestion']),
aaa() {
if (this.code === 'NLCP') {
this.$t.storage.setStorageSync('NLCPNum', this.projectId + '+' + 0);
}
if (this.code === 'ZARIT') {
this.$t.storage.setStorageSync('ZARITNum', this.projectId + '+' + 0);
}
},
//
openAnswerPage() {
@ -85,10 +95,10 @@ export default {
this.$refs.child.closeLoading();
//
if (this.code === 'NLCP') {
this.$t.storage.setStorageSync('NLCPNum', this.questionInfo.num);
this.$t.storage.setStorageSync('NLCPNum', this.projectId + '+' + this.questionInfo.num);
}
if (this.code === 'ZARIT') {
this.$t.storage.setStorageSync('ZARITNum', this.questionInfo.num);
this.$t.storage.setStorageSync('ZARITNum', this.projectId + '+' + this.questionInfo.num);
}
await this.next();
} catch (error) {
@ -123,6 +133,13 @@ export default {
const params = { mentalTestId: this.task.id };
const data = await this.$u.api.mentalTestCalculate(params);
this.setAssessResult(data);
//
if (this.code === 'NLCP') {
this.$t.storage.setStorageSync('NLCPNum', this.projectId + '+' + 0);
}
if (this.code === 'ZARIT') {
this.$t.storage.setStorageSync('ZARITNum', this.projectId + '+' + 0);
}
this.$refs.uTips.show({
title: '答案提交成功, 即将返回上一页',
type: 'success',

2
src/pagesYanyuan/assess/components/Test/answerPage.vue

@ -3,7 +3,7 @@
<view v-for="(item, index) in question.positions" :key="index" class="flex flex-col">
<!-- title -->
<view v-if="item.position === 0" class="flex flex-col">
<view v-for="(con, conIndex) in item.contents" :key="conIndex">
<view v-for="(con, conIndex) in item.contents" :key="conIndex" class="text-base">
<text v-if="questionInfo.num && turnPages && conIndex === 0">{{ questionInfo.num }}.</text>{{ con.content }}
</view>
<u-line class="my-2" color="#c8c7cc" />

26
src/pagesYanyuan/assess/components/Test/components/TestMain.vue

@ -10,8 +10,14 @@
>
<u-radio @change="radioChange" v-for="(item, index) in option.contents" :key="index" :name="item.id" class="my-1">
<!-- :class="[`col-span-${item.col}`]" -->
<text v-if="item.showType === 0">{{ item.content }}</text>
<image :style="{ width: options[0].contents.length === 1 ? '200px' : '100px' }" :src="item.content" mode="widthFix" v-else />
<text v-if="item.showType === 0" class="text-base">{{ item.content }}</text>
<image
:style="{ width: options[0].contents.length === 1 ? '200px' : '100px' }"
:src="item.content"
mode="widthFix"
v-else
@click="clickImg(item.content)"
/>
</u-radio>
</view>
</u-radio-group>
@ -63,6 +69,22 @@ export default {
console.log('e: ', e);
this.setOptionId(e);
},
clickImg(src) {
wx.previewImage({
urls: [src], //httpurl
current: '', // http
success: function (res) {
console.log('success res: ', res);
},
fail: function (res) {
console.log('fail res: ', res);
},
complete: function (res) {
console.log('complete res: ', res);
},
});
},
},
};
</script>

24
src/pagesYanyuan/assess/components/Test/components/TitlePosition.vue

@ -3,15 +3,15 @@
<view class="flex flex-col">
<view v-for="(con, conIndex1) in item.contents" :key="conIndex1">
<view v-if="con.showType === 0">
<view class="mb-2">{{ con.content }}</view>
<view class="mb-2 text-base">{{ con.content }}</view>
</view>
</view>
</view>
<view class="grid" :class="item.contents.length > 4 ? 'grid-cols-3' : item.contents.length > 1 ? 'grid-cols-2' : ''">
<view v-for="(con, conIndex1) in item.contents" :key="conIndex1">
<view v-if="con.showType === 1" class="w-full h-full flex items-center">
<image class="w-full" :src="con.content" mode="widthFix" />
<view v-if="con.showType === 1" class="w-full h-full flex items-center content">
<image class="w-full" :src="con.content" mode="widthFix" @click="clickImg(con.content)" />
</view>
</view>
</view>
@ -26,6 +26,24 @@ export default {
default: () => {},
},
},
methods: {
clickImg(src) {
wx.previewImage({
urls: [src], //httpurl
current: '', // http
success: function (res) {
console.log('success res: ', res);
},
fail: function (res) {
console.log('fail res: ', res);
},
complete: function (res) {
console.log('complete res: ', res);
},
});
},
},
};
</script>

2
src/pagesYanyuan/assess/components/Test/promptPage.vue

@ -3,7 +3,7 @@
<view v-for="(item, index) in question.positions" :key="index" class="flex flex-col">
<!-- title -->
<view v-if="item.position === 0" class="flex flex-col">
<view v-for="(con, conIndex) in item.contents" :key="conIndex">
<view v-for="(con, conIndex) in item.contents" :key="conIndex" class="text-base">
<text v-if="questionInfo.num">{{ questionInfo.num }}.</text>{{ con.content }}
</view>
<u-line class="my-2" color="#c8c7cc" />

2
src/pagesYanyuan/transfer-page/transfer-page.vue

@ -18,7 +18,7 @@ export default {
onLoad(options) {
if (options.type === 'manyuan') {
this.content = '工具已绑定';
this.content = '工具已绑定';
}
if (options.type === 'jiashu') {
this.openApplyModal();

1
src/store/yanyuan/actions.js

@ -52,6 +52,7 @@ const actions = {
async handleQuestion({ commit }, params) {
try {
const data = await uni.$u.api.getQuestion(params);
console.log('试题查询data: ', data);
commit('setQuestionInfo', data);
return data;
} catch (error) {

Loading…
Cancel
Save