Browse Source

fix: 修改部分bug

tall
song 4 years ago
parent
commit
a44ce6f97d
  1. 3
      CHANGELOG.md
  2. 89
      src/components/Info/Info.vue
  3. 26
      src/components/Projects/ProjectItem.vue
  4. 4
      src/config/yyInfo.js
  5. 2
      src/mixins/userAuth.js
  6. 2
      src/pages.json
  7. 4
      src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue
  8. 2
      src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue
  9. 2
      src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue
  10. 13
      src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue
  11. 2
      src/pagesProject/project/components/Evaluated/components/ResultLevel.vue
  12. 2
      src/pagesProject/project/components/NotEvaluated/NotEvaluated.vue
  13. 2
      src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue
  14. 2
      src/pagesProject/project/components/TimeLine/component/TimeBoxOut.vue
  15. 6
      src/pagesYanyuan/add-info/add-info.vue
  16. 41
      src/pagesYanyuan/hold-all/hold-all.vue
  17. 5
      src/pagesYanyuan/wifi-binding/wifi-binding.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2022-02-09) # 0.1.0 (2022-02-10)
### 🌟 新功能 ### 🌟 新功能
范围|描述|commitId 范围|描述|commitId
@ -62,6 +62,7 @@
- | 添加时间轴上下滚动 | [2b81bbc](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/2b81bbc) - | 添加时间轴上下滚动 | [2b81bbc](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/2b81bbc)
- | 添加首页弹出按钮及界面 | [edd56cd](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/edd56cd) - | 添加首页弹出按钮及界面 | [edd56cd](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/edd56cd)
- | 添加输入工具码界面 | [8c120bc](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/8c120bc) - | 添加输入工具码界面 | [8c120bc](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/8c120bc)
- | 添加项目列表小红点,查询工具箱使用者 | [d620a54](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/d620a54)
- | 添加项目排序 | [a0b491b](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/a0b491b) - | 添加项目排序 | [a0b491b](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/a0b491b)
- | 添加选择工具接口 | [98ee58e](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/98ee58e) - | 添加选择工具接口 | [98ee58e](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/98ee58e)
- | 添加训练计划详情 | [49f64ca](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/49f64ca) - | 添加训练计划详情 | [49f64ca](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/49f64ca)

89
src/components/Info/Info.vue

@ -393,6 +393,7 @@ export default {
this.$emit('setEmptyInfo'); this.$emit('setEmptyInfo');
setTimeout(() => { setTimeout(() => {
const info = this.$t.storage.getStorageSync('infoList'); const info = this.$t.storage.getStorageSync('infoList');
console.log('info: ', info);
if (info !== 'null') { if (info !== 'null') {
this.infoList = JSON.parse(info); this.infoList = JSON.parse(info);
} }
@ -404,7 +405,6 @@ export default {
methods: { methods: {
changeVal(e, index, itemIndex) { changeVal(e, index, itemIndex) {
const info = this.infoList[index][itemIndex]; const info = this.infoList[index][itemIndex];
if (info.value === null) { if (info.value === null) {
info.value = e.toString(); info.value = e.toString();
} else { } else {
@ -838,9 +838,13 @@ export default {
async updateTrainee(item) { async updateTrainee(item) {
try { try {
if (!this.validationRequired(item)) return; if (!this.validationRequired(item)) return;
this.$t.ui.showLoading();
const params = this.setParams(item); const params = this.setParams(item);
await this.$u.api.updateTrainee(params); await this.$u.api.updateTrainee(params);
this.$t.ui.hideLoading();
this.$emit('showToast', 'success', `${item.name}修改成功`);
} catch (error) { } catch (error) {
this.$t.ui.hideLoading();
console.error('error: ', error); console.error('error: ', error);
this.$emit('showToast', 'default', `${item.name}修改失败`, false); this.$emit('showToast', 'default', `${item.name}修改失败`, false);
} }
@ -949,6 +953,89 @@ export default {
} }
return params; return params;
}, },
//
setEmptyInfo() {
const array = [...this.infoList];
array.forEach(info => {
info.forEach(item => {
switch (item.type) {
case 14:
if (item.label === 'apoeGene') {
this.$set(item, 'value', '0');
} else if (item.label === 'isStrongFlavour' || item.label === 'isMoreOil') {
this.$set(item, 'value', 0);
} else {
this.$set(item, 'value', null);
}
break;
case 5:
this.$set(item, 'value', []);
item.checkList.forEach(list => {
list.checked = false;
});
break;
case 10:
this.$set(item, 'value', 0);
break;
case 11:
this.$set(item, 'value', 0);
break;
case 12:
this.$set(item, 'value', 0);
break;
case 13:
this.$set(item, 'value', 0);
break;
default:
this.$set(item, 'value', null);
break;
}
if (item.showType === 1) {
item.show = true;
if (item.label === 'physicalAct') {
item.value = '低';
}
if (item.label === 'isLikeMeat') {
item.value = 1;
}
} else {
item.show = false;
}
if (item.otherValue) {
item.otherValue = null;
}
if (item.value1) {
item.value1 = null;
}
if (item.value2) {
item.value2 = null;
}
if (item.value3) {
item.value3 = null;
}
if (item.classesValue) {
item.classesValue = null;
}
if (item.frequencyValue) {
item.frequencyValue = null;
}
if (item.showClasses) {
item.showClasses = false;
item.showOther = false;
item.classesValue = null;
item.frequencyValue = null;
item.otherValue = null;
}
});
});
this.infoList = [...array];
},
},
destroyed() {
this.setEmptyInfo();
}, },
}; };
</script> </script>

26
src/components/Projects/ProjectItem.vue

@ -1,14 +1,12 @@
<template> <template>
<view class="w-full"> <view class="w-full" v-if="item.templateCode === 'yanyuan-user'">
<!-- 有子项目 --> <!-- 有子项目 -->
<view class="flex items-center justify-between p-3"> <view class="flex items-center justify-between p-3">
<u-icon @click="openMenu(item)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon> <u-icon @click="openMenu(item)" class="mover" name="https://www.tall.wiki/staticrec/drag.svg" size="48"></u-icon>
<view @click="openProject(item)" class="flex-1 px-3 relative"> <view @click="openProject(item)" class="flex-1 px-3 relative">
<view class="flex items-center mb-1"> <view class="flex items-center mb-1">
<view class="mr-2"> <view class="mr-2"> {{ item.name }} </view>
{{ item.name }}
</view>
<!-- 状态 TODO:--> <!-- 状态 TODO:-->
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full flex-shrink-0">进行中</view> <view class="px-2 text-xs text-green-400 bg-green-100 rounded-full flex-shrink-0">进行中</view>
</view> </view>
@ -16,13 +14,12 @@
<view class="flex items-center text-xs text-gray-400"> <view class="flex items-center text-xs text-gray-400">
<!-- <view v-if="item.auditNum"> --> <!-- <view v-if="item.auditNum"> -->
<!-- </view> --> <!-- </view> -->
<view class="pr-2">{{ $moment(+item.startTime).format('MM-DD HH:mm') }}</view> <view>{{ $moment(+item.startTime).format('MM-DD HH:mm') }}</view>
<view v-if="item.endTime - 0 !== 0"> <text class="px-2"></text> {{ $moment(+item.endTime).format('MM-DD HH:mm') }}</view>
<view class="pl-2">{{ $moment(+item.endTime).format('MM-DD HH:mm') }}</view>
</view> </view>
<!-- 未读消息 --> <!-- 未读消息 -->
<u-badge v-if="item.auditNum" type="error" :count="item.auditNum" class="font-normal"></u-badge> <view v-if="item.auditNum" class="red-point bg-red-500">{{ item.auditNum }}</view>
</view> </view>
<!-- 箭头 --> <!-- 箭头 -->
@ -168,4 +165,17 @@ export default {
height: 4rpx; height: 4rpx;
margin: 0 20rpx 0 90rpx; margin: 0 20rpx 0 90rpx;
} }
.red-point {
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
text-align: center;
color: #fff;
font-size: 12px;
border-radius: 50%;
position: absolute;
right: 3px;
top: 10px;
}
</style> </style>

4
src/config/yyInfo.js

@ -173,7 +173,7 @@ export const infoList = [
showType: 1, showType: 1,
type: 1, type: 1,
radioList: ['强', '中', '低'], radioList: ['强', '中', '低'],
value: null, value: '低',
show: true, show: true,
}, },
{ {
@ -311,7 +311,7 @@ export const infoList = [
{ id: 0, value: '素菜' }, { id: 0, value: '素菜' },
{ id: 1, value: '荤菜' }, { id: 1, value: '荤菜' },
], ],
value: null, value: 1,
show: true, show: true,
}, },
{ {

2
src/mixins/userAuth.js

@ -22,7 +22,7 @@ export default {
updateUserInfo() { updateUserInfo() {
/* #ifdef MP-WEIXIN */ /* #ifdef MP-WEIXIN */
uni.getUserProfile({ uni.getUserProfile({
desc: 'TALL仅需要获取您的基本用户信息', desc: '仅需要获取您的基本用户信息',
success: async res => { success: async res => {
const { avatarUrl, city, country, gender, language, nickName, province } = res.userInfo; const { avatarUrl, city, country, gender, language, nickName, province } = res.userInfo;
const data = await this.$u.api.updateUserInfo({ const data = await this.$u.api.updateUserInfo({

2
src/pages.json

@ -110,7 +110,7 @@
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "TALL", "navigationBarTitleText": "脑益宝",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8" "backgroundColor": "#F8F8F8"
}, },

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

@ -61,7 +61,7 @@ export default {
data() { data() {
return { return {
itemList: [ itemList: [
{ head: '长者信息', open: true, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' }, { head: '长者信息', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' },
{ head: '药物使用记录', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu2.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: 'Zarit照顾者负担量表', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu3.png' },
{ head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' }, { head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' },
@ -93,6 +93,8 @@ export default {
item.open = false; item.open = false;
} }
}); });
} else {
this.itemList[0].open = true;
} }
}, },

2
src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue

@ -224,8 +224,8 @@ export default {
*/ */
async submit() { async submit() {
try { try {
this.loading = true;
if (!this.validationRequired(this.params)) return; if (!this.validationRequired(this.params)) return;
this.loading = true;
const params = this.params; const params = this.params;
params.projectId = this.projectId; params.projectId = this.projectId;
const data = await this.$u.api.addZarit(params); const data = await this.$u.api.addZarit(params);

2
src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue

@ -186,6 +186,8 @@ export default {
case 2: { case 2: {
// //
const valueDay = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second; const valueDay = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute + ':' + e.second;
console.log('e: ', e);
console.log('valueDay: ', valueDay);
item.value = valueDay; item.value = valueDay;
if (!this.show) { if (!this.show) {
if (item.value === this.originalValue) { if (item.value === this.originalValue) {

13
src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue

@ -9,7 +9,7 @@
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
<view class="flex flex-row-reverse text-xs text-blue-400 mt-1" @click="checkShowMore"> <view class="flex flex-row-reverse text-xs text-blue-400 mt-1" @click="checkShowMore" v-if="train.tools && train.tools.length > 6">
{{ showMore ? '查看更多' : '收起' }} {{ showMore ? '查看更多' : '收起' }}
</view> </view>
</view> </view>
@ -31,9 +31,14 @@
<view v-if="detail.content" class="text-gray-400"> <view v-if="detail.content" class="text-gray-400">
{{ detail.content }} {{ detail.content }}
</view> </view>
<view v-if="detail.supplementaries" class="text-gray-400"> <view v-if="train.supplementaries" class="text-gray-400">
<view v-for="(img, imgIndex) in detail.supplementaries" :key="imgIndex"> <view v-for="(img, imgIndex) in train.supplementaries" :key="imgIndex">
<img :src="img.src" class="w-full" /> <view class="w-full" v-if="train.supplementaries.length === 1">
<image class="w-full" :src="img.url" mode="widthFix" />
</view>
<view v-else>
<image style="width: 50%" :src="img.url" mode="widthFix" />
</view>
</view> </view>
</view> </view>
</view> </view>

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

@ -18,7 +18,7 @@
</view> </view>
</view> </view>
<!-- 时间 --> <!-- 时间 -->
<view class="text-sm text-gray-400 flex flex-nowrap items-center mt-2" v-if="trains.finishTime && showTime"> <view class="text-sm text-gray-400 flex flex-nowrap items-center mt-2" v-if="trains.finishTime - 0 && showTime">
<view class="num mr-2 u-font-12">{{ resultIndex + 1 }}</view> <view class="num mr-2 u-font-12">{{ resultIndex + 1 }}</view>
{{ $moment(trains.finishTime - 0).format('m分钟ss秒') }} {{ $moment(trains.finishTime - 0).format('m分钟ss秒') }}
</view> </view>

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

@ -5,7 +5,7 @@
{{ task.description }} {{ task.description }}
</view> </view>
<view v-if="task.data.type === 0 && task.data.mentalTest.finishStatus === 0"> <view v-if="task.data.type === 0 && task.data.mentalTest.finishStatus === 0">
<view class="flex flex-nowrap my-2" v-if="task.data.mentalTest.finishStatus !== 2"> <view class="flex flex-nowrap my-2">
<u-button type="primary" class="mx-0" @click="handleFinishNum" :loading="loading">开始测评</u-button> <u-button type="primary" class="mx-0" @click="handleFinishNum" :loading="loading">开始测评</u-button>
<view class="flex-1"></view> <view class="flex-1"></view>
</view> </view>

2
src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue

@ -40,7 +40,7 @@
> >
<view slot="body"> <view slot="body">
<view class="p-0 u-col-between"> <view class="p-0 u-col-between">
<NotEvaluated :task="item" v-if="item.data.mentalTest.finishStatus === 0" /> <NotEvaluated :task="item" v-if="item.data.mentalTest.finishStatus === 0 || item.data.mentalTest.finishStatus === 2" />
<view v-else> <view v-else>
<EvaluatedNLCP :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 0" /> <EvaluatedNLCP :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 0" />
<EvaluatedXLJH :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 1" /> <EvaluatedXLJH :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 1" />

2
src/pagesProject/project/components/TimeLine/component/TimeBoxOut.vue

@ -38,7 +38,7 @@
> >
<view slot="body"> <view slot="body">
<view class="p-0 u-col-between"> <view class="p-0 u-col-between">
<NotEvaluated :task="task" v-if="task.data.mentalTest.finishStatus === 0" /> <NotEvaluated :task="task" v-if="task.data.mentalTest.finishStatus === 0 || task.data.mentalTest.finishStatus === 2" />
<view v-else> <view v-else>
<EvaluatedNLCP :task="task" v-if="task.data.type === 0" /> <EvaluatedNLCP :task="task" v-if="task.data.type === 0" />
<EvaluatedXLJH :task="task" v-if="task.data.type === 1" /> <EvaluatedXLJH :task="task" v-if="task.data.type === 1" />

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

@ -92,6 +92,12 @@ export default {
if (item.showType === 1) { if (item.showType === 1) {
item.show = true; item.show = true;
if (item.label === 'physicalAct') {
item.value = '低';
}
if (item.label === 'isLikeMeat') {
item.value = 1;
}
} else { } else {
item.show = false; item.show = false;
} }

41
src/pagesYanyuan/hold-all/hold-all.vue

@ -14,7 +14,7 @@
</view> </view>
</view> --> </view> -->
<view v-if="lists && lists.length" class="px-2"> <view v-if="lists && lists.length" class="px-2">
<view v-for="item in lists" :key="item.toolId"> <view v-for="(item, index) in lists" :key="item.toolId">
<view class="flex justify-between items-center py-3 px-2 border-b"> <view class="flex justify-between items-center py-3 px-2 border-b">
<view class="flex flex-row items-center"> <view class="flex flex-row items-center">
<view class="mr-2"> <view class="mr-2">
@ -22,14 +22,29 @@
</view> </view>
</view> </view>
<view class="flex flex-nowrap items-center"> <view class="flex flex-nowrap items-center">
<view class="flex items-center text-gray-400" v-show="show"> <view class="flex items-center text-gray-400" v-show="item.show">
{{ content }} {{ item.content }}
</view> </view>
<view class=""> <view class="">
<u-button v-if="!show" type="primary" text="查询使用者" size="mini" :plain="true" @click="getUserName(item.equipmentId)"> <u-button
v-if="!item.show"
type="primary"
text="查询使用者"
size="mini"
:plain="true"
@click="getUserName(item.equipmentId, index)"
>
查询使用者 查询使用者
</u-button> </u-button>
<u-icon v-else bold name="reload" color="#1890FF" size="32" class="ml-2" @click="getUserName(item.equipmentId)"></u-icon> <u-icon
v-else
bold
name="reload"
color="#1890FF"
size="32"
class="ml-2"
@click="getUserName(item.equipmentId, index)"
></u-icon>
</view> </view>
</view> </view>
</view> </view>
@ -105,24 +120,26 @@ export default {
* 查询工具箱的使用者 * 查询工具箱的使用者
* @param string equipmentId 设备id * @param string equipmentId 设备id
*/ */
async getUserName(equipmentId) { async getUserName(equipmentId, index) {
try { try {
let arr = this.lists;
this.$t.ui.showLoading(); this.$t.ui.showLoading();
const params = { equipmentId }; const params = { equipmentId };
const data = await this.$u.api.getUserName(params); const data = await this.$u.api.getUserName(params);
this.$t.ui.hideLoading(); this.$t.ui.hideLoading();
if (data.status === -2) { if (data.status === -2) {
this.show = true; arr[index].show = true;
this.content = '使用前请先选择长者!'; arr[index].content = '使用前请先选择长者!';
} }
if (data.status === -1) { if (data.status === -1) {
this.show = true; arr[index].show = true;
this.content = '尚未填写长者信息!'; arr[index].content = '尚未填写长者信息!';
} }
if (data.status === 0) { if (data.status === 0) {
this.show = true; arr[index].show = true;
this.content = `使用者为 ${data.userName}(${data.sex === 1 ? '男' : '女'})`; arr[index].content = `使用者为 ${data.userName}(${data.sex === 1 ? '男' : '女'})`;
} }
this.lists = [...arr];
} catch (error) { } catch (error) {
this.$t.ui.hideLoading(); this.$t.ui.hideLoading();
console.error('error: ', error); console.error('error: ', error);

5
src/pagesYanyuan/wifi-binding/wifi-binding.vue

@ -3,7 +3,6 @@
<view class="wifi-bg my-5"> <view class="wifi-bg my-5">
<u-icon name="wifi"></u-icon> <u-icon name="wifi"></u-icon>
</view> </view>
<view class="font-semibold mb-5 text-base">ccsens_5G</view>
<view class="bg-white w-full flex justify-between items-center py-2 px-3"> <view class="bg-white w-full flex justify-between items-center py-2 px-3">
<text class="mr-3">WIFI名称</text> <text class="mr-3">WIFI名称</text>
<u-input v-model="name" placeholder="请输入" input-align="right" class="text-base" /> <u-input v-model="name" placeholder="请输入" input-align="right" class="text-base" />
@ -19,8 +18,8 @@
<text class="font-bold">联网说明:</text> <text class="font-bold">联网说明:</text>
<text class="mt-2">1.长按点读笔进入配网模式</text> <text class="mt-2">1.长按点读笔进入配网模式</text>
<text class="mt-2">2.切换手机wifi,连接ccsens_pen,输入密码ccsens123</text> <text class="mt-2">2.切换手机wifi,连接ccsens_pen,输入密码ccsens123</text>
<text class="mt-2">3.输入wifi名和密码点击确定</text> <text class="mt-2">3.输入wifi名和密码点击确定(目前仅支持2.4G WiFi网络)</text>
<text class="mt-2">4.配网成功后点读笔有灯闪烁</text> <text class="mt-2">4.配网成功后网络指示灯常亮</text>
</view> </view>
</view> </view>
</template> </template>

Loading…
Cancel
Save