Browse Source

fix: 多处bug修复

tall
song 4 years ago
parent
commit
853890b60b
  1. 3
      CHANGELOG.md
  2. 6
      src/components/Info/Info.vue
  3. 17
      src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue
  4. 32
      src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue
  5. 1
      src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue
  6. 21
      src/pagesProject/project/components/ConfigInfo/components/Medicine.vue
  7. 34
      src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue
  8. 7
      src/pagesProject/project/project.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2022-02-10)
# 0.1.0 (2022-02-11)
### 🌟 新功能
范围|描述|commitId
@ -208,6 +208,7 @@
- | 卸载stylus | [610b465](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/610b465)
- | 新建长者信息清除数据 | [df5d3f4](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/df5d3f4)
- | 修改报错 | [531c14d](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/531c14d)
- | 修改部分bug | [a44ce6f](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/a44ce6f)
修改部分bug | 修改部分bug | [92bdab1](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/92bdab1)
- | 修改定期任务状态0和4时不加载圆圈 | [30e352f](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/30e352f)
- | 修改合并手机号逻辑 | [5d391a3](https://101.201.226.163:50022/DIGITAL_MEDICAL/yanyuan/commits/5d391a3)

6
src/components/Info/Info.vue

@ -393,11 +393,14 @@ export default {
this.$emit('setEmptyInfo');
setTimeout(() => {
const info = this.$t.storage.getStorageSync('infoList');
console.log('info: ', info);
if (info !== 'null') {
this.infoList = JSON.parse(info);
}
}, 300);
} else {
setTimeout(() => {
this.setDate(this.personalInfo);
}, 300);
}
});
},
@ -1036,6 +1039,7 @@ export default {
destroyed() {
this.setEmptyInfo();
// this.$t.storage.setStorageSync('infoList', null);
},
};
</script>

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

@ -33,8 +33,8 @@
<view style="border: 1px solid #e5e5e5" v-if="index === 0">
<Info @showToast="showToast" :personalInfo="personalInfo" :isEdit="true" />
</view>
<Medicine @showToast="showToast" ref="medicineChild" v-if="index === 1" />
<Caregiver @showToast="showToast" ref="caregiverChild" v-if="index === 2" />
<Medicine @showToast="showToast" ref="medicineChild" v-if="index === 1" :showAdd="showAdd" @changeCloseAdd="changeCloseAdd" />
<Caregiver @showToast="showToast" ref="caregiverChild" v-if="index === 2" :showAdd="showAdd" @changeCloseAdd="changeCloseAdd" />
<Family @showToast="showToast" v-if="index === 3" />
</view>
</view>
@ -72,6 +72,7 @@ export default {
width: '100%',
},
personalInfo: null,
showAdd: false,
};
},
@ -130,18 +131,24 @@ export default {
//
add(index) {
this.changeCloseAdd(true);
if (!this.itemList[index].open) {
this.changeOpen(index);
} else {
if (index === 1) {
if (this.itemList[index].open) {
this.$refs.medicineChild[0].add();
}
}
if (index === 2) {
if (this.itemList[index].open) {
this.$refs.caregiverChild[0].add();
}
}
},
//
changeCloseAdd(show) {
this.showAdd = show;
},
/**
* 查询个人信息
*/

32
src/pagesProject/project/components/ConfigInfo/components/Caregiver.vue

@ -1,6 +1,13 @@
<template>
<view>
<CaregiverDetail :detail="zaritDetail" :disabled="false" @showToast="showToast" v-if="show" @closeAdd="closeAdd" />
<CaregiverDetail
:detail="zaritDetail"
:disabled="false"
@showToast="showToast"
v-if="show"
@closeAdd="closeAdd"
@changeAdd="changeAdd"
/>
<view>
<view v-for="(item, index) in itemList" :key="index" :style="headStyle" class="py-3">
<!-- 头部 -->
@ -21,7 +28,7 @@
</view>
<!-- 内容区 -->
<view v-if="item.open" class="w-full mt-3">
<CaregiverDetail @showToast="showToast" v-if="item && item.id" :detail="item" :disabled="true" />
<CaregiverDetail @showToast="showToast" v-if="item && item.id" :detail="item" :disabled="true" @changeAdd="changeAdd" />
</view>
</view>
</view>
@ -35,6 +42,7 @@ import CaregiverDetail from './CaregiverDetail';
export default {
name: 'Info',
components: { CaregiverDetail },
props: { showAdd: { type: Boolean, default: false } },
data() {
return {
show: false,
@ -63,14 +71,20 @@ export default {
...mapGetters('project', ['projectId']),
},
mounted() {
async mounted() {
if (!this.showAdd) {
this.queryZaritList();
} else {
await this.queryZaritList();
this.add();
}
},
methods: {
...mapMutations('yanyuan', ['setIsTest']),
//
changeOpen(index) {
this.$emit('changeCloseAdd', false);
this.index = index;
this.show = false;
this.itemList.forEach((item, i) => {
@ -104,6 +118,11 @@ export default {
console.log('关闭添加窗口');
this.show = false;
await this.queryZaritList();
this.$emit('changeCloseAdd', false);
},
changeAdd() {
this.$emit('changeCloseAdd', false);
},
/**
@ -119,6 +138,7 @@ export default {
await this.queryZaritHistory();
} else {
this.show = false;
if (!this.showAdd) {
date.forEach((item, index) => {
if (index === this.index) {
item.open = true;
@ -126,6 +146,7 @@ export default {
item.open = false;
}
});
}
this.itemList = date;
}
} catch (error) {
@ -149,6 +170,11 @@ export default {
this.$t.ui.showToast(error.msg || '负担量表历史记录查询失败');
}
},
destroyed() {
console.log('555d');
this.$emit('changeCloseAdd', false);
},
},
};
</script>

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

@ -229,6 +229,7 @@ export default {
const params = this.params;
params.projectId = this.projectId;
const data = await this.$u.api.addZarit(params);
this.$emit('changeAdd', false);
this.loading = false;
if (data) {
await this.handleFinishNum(data);

21
src/pagesProject/project/components/ConfigInfo/components/Medicine.vue

@ -5,9 +5,7 @@
<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 text-sm text-gray-500" @click="changeOpen(index)">
<view class="flex flex-row items-center font-bold">
{{ item.createAt }}
</view>
<view class="flex flex-row items-center font-bold"> {{ item.createAt }} </view>
<view class="flex flex-row">
<u-icon name="arrow-up" v-if="item.open"></u-icon>
<u-icon name="arrow-down" v-else></u-icon>
@ -29,6 +27,7 @@ import MedicineDetail from './MedicineDetail';
export default {
name: 'Info',
components: { MedicineDetail },
props: { showAdd: { type: Boolean, default: false } },
data() {
return {
show: false,
@ -45,13 +44,19 @@ export default {
computed: mapGetters('project', ['projectId']),
mounted() {
async mounted() {
if (!this.showAdd) {
this.queryMedicine();
} else {
await this.queryMedicine();
this.add();
}
},
methods: {
//
changeOpen(index) {
this.$emit('changeCloseAdd', false);
this.index = index;
this.show = false;
this.itemList.forEach((item, i) => {
@ -81,9 +86,9 @@ export default {
//
async closeAdd() {
console.log('关闭添加窗口');
this.show = false;
await this.queryMedicine();
this.$emit('changeCloseAdd', false);
},
/**
@ -99,6 +104,7 @@ export default {
this.show = true;
} else {
this.show = false;
if (!this.showAdd) {
date.forEach((item, index) => {
if (index === this.index) {
item.open = true;
@ -106,6 +112,7 @@ export default {
item.open = false;
}
});
}
this.itemList = [...date];
}
} catch (error) {
@ -113,6 +120,10 @@ export default {
}
},
},
destroyed() {
this.$emit('changeCloseAdd', false);
},
};
</script>

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

@ -13,6 +13,11 @@
{{ showMore ? '查看更多' : '收起' }}
</view>
</view>
<view v-if="train.supplementaries.length" class="text-gray-400 flex flex-col">
<view v-for="(img, imgIndex) in train.supplementaries" :key="imgIndex" class="w-full">
<image class="w-full mb-2" :src="img.url" mode="widthFix" @click="clickImg(img.url)" />
</view>
</view>
<view v-if="train.contentDetails.length" class="text-xs mb-2">
<!-- 训练目标 训练元素 训练原理 训练步骤 -->
<view v-for="(purpose, purposeIndex) in train.contentDetails" :key="purposeIndex" class="mb-2">
@ -29,16 +34,11 @@
}}</view>
<view v-for="detail in purpose.details" :key="detail.id" style="line-height: 1.25rem">
<view v-if="detail.content" class="text-gray-400">
{{ detail.content }}
</view>
<view v-if="train.supplementaries" class="text-gray-400">
<view v-for="(img, imgIndex) in train.supplementaries" :key="imgIndex">
<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 v-html="detail.content"></view>
</view>
<view v-if="detail.supplementaries.length" class="text-gray-400 flex flex-col">
<view v-for="(img, imgIndex) in detail.supplementaries" :key="imgIndex" class="w-full">
<image class="w-full mb-2" :src="img.url" mode="widthFix" @click="clickImg(img.url)" />
</view>
</view>
</view>
@ -124,6 +124,22 @@ export default {
checkShowMore() {
this.showMore = !this.showMore;
},
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>

7
src/pagesProject/project/project.vue

@ -83,7 +83,7 @@ export default {
this.templateCode = options.code;
if (options.share && options.share === '1') {
// TODO:
this.queryGuide(options.code);
// this.queryGuide(options.code);
this.shareInit(options);
} else {
if ((this.scene === 1007 || this.scene === 1008) && !this.showGuide) {
@ -96,7 +96,7 @@ export default {
}, 300);
} else {
// TODO:
this.queryGuide(options.code);
// this.queryGuide(options.code);
this.init(options);
}
}
@ -411,6 +411,9 @@ export default {
// id
this.getRoles({ projectId: options.p, num: 0, templateCode: options.code });
// TODO:
await this.queryGuide(options.code);
}
},

Loading…
Cancel
Save