Browse Source

病历支持上传视频

dev
kola-web 3 months ago
parent
commit
a15f804830
  1. 1
      2024-10-31.md
  2. 1
      eslint.config.mjs
  3. 16
      project.private.config.json
  4. 98
      src/components/uploadFile/index.ts
  5. BIN
      src/images/video-sign.png
  6. 63
      src/module1/pages/casesDetail/index.scss
  7. 15
      src/module1/pages/casesDetail/index.ts
  8. 46
      src/module1/pages/casesDetail/index.wxml
  9. 19
      src/module1/pages/casesFeedback/index.scss
  10. 31
      src/module1/pages/casesFeedback/index.ts
  11. 16
      src/module1/pages/casesFeedback/index.wxml
  12. 54
      src/module1/pages/chatRoom/index.scss
  13. 15
      src/module1/pages/chatRoom/index.ts
  14. 38
      src/module1/pages/chatRoom/index.wxml
  15. 22
      src/module1/pages/entryCases/index.scss
  16. 143
      src/module1/pages/entryCases/index.ts
  17. 16
      src/module1/pages/entryCases/index.wxml
  18. 33
      src/pages/cases/index.scss
  19. 193
      src/pages/cases/index.ts
  20. 17
      src/pages/cases/index.wxml

1
2024-10-31.md

@ -1 +0,0 @@ @@ -1 +0,0 @@
# 2024-10-31

1
eslint.config.mjs

@ -22,6 +22,7 @@ export default antfu( @@ -22,6 +22,7 @@ export default antfu(
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'ts/no-require-imports': 'off',
'eqeqeq': 'off',
},
},
prettierConfig,

16
project.private.config.json

@ -9,6 +9,13 @@ @@ -9,6 +9,13 @@
"miniprogram": {
"list": [
{
"name": "病历反馈",
"pathName": "module1/pages/casesFeedback/index",
"query": "id=317&rid=undefined",
"launchMode": "default",
"scene": null
},
{
"name": "帮助中心",
"pathName": "module1/pages/help/index",
"query": "",
@ -128,13 +135,6 @@ @@ -128,13 +135,6 @@
"scene": null
},
{
"name": "病历反馈",
"pathName": "module1/pages/casesFeedback/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "录入病历结果",
"pathName": "module1/pages/entryCasesResult/index",
"query": "",
@ -256,5 +256,5 @@ @@ -256,5 +256,5 @@
]
}
},
"libVersion": "3.6.3"
"libVersion": "3.7.7"
}

98
src/components/uploadFile/index.ts

@ -6,22 +6,26 @@ Component({ @@ -6,22 +6,26 @@ Component({
*
*/
properties: {
// 是否获取用户头像
chooseAvatar: {
type: Boolean,
value: false,
},
// 从聊天记录选择问就爱你
chooseMessage: {
type: Boolean,
value: false,
},
accept: {
type: String,
value: "image",
value: 'image',
},
// 是否编辑图片,只对图片生效
obscure: {
type: Boolean,
value: false,
},
// 是否显示引导用户编辑图片引导
edit: {
type: Boolean,
value: false,
@ -34,9 +38,12 @@ Component({ @@ -34,9 +38,12 @@ Component({
data: {
show1: false,
fileTypeList: {
image: 1,
audio: 2,
video: 3,
pdf: 4,
doc: 5,
docx: 5,
pdf: 4,
xls: 6,
xlsx: 6,
ppt: 7,
@ -48,15 +55,16 @@ Component({ @@ -48,15 +55,16 @@ Component({
*
*/
methods: {
GetExtensionFileName(pathfilename) {
GetExtensionFileName(pathfilename: string) {
const reg = /(\\+)/g;
const pString = pathfilename.replace(reg, "#"); //用正则表达式来将\或\\替换成#
const arr = pString.split("#"); // 以“#”为分隔符,将字符分解为数组 例如 D Program Files bg.png
const pString = pathfilename.replace(reg, '#'); //用正则表达式来将\或\\替换成#
const arr = pString.split('#'); // 以“#”为分隔符,将字符分解为数组 例如 D Program Files bg.png
const lastString = arr[arr.length - 1]; //取最后一个字符
const arr2 = lastString.split("."); // 再以"."作为分隔符
const arr2 = lastString.split('.'); // 再以"."作为分隔符
return arr2[arr2.length - 1]; //将后缀名返回出来
},
handleAfterRead(e, editEnd = false) {
handleAfterRead(e: any, editEnd = false) {
const file = { tempFilePath: e.detail.file.url, fileType: e.detail.file.type, ...e.detail.file };
if (this.data.edit && !editEnd) {
this.setData({
show1: true,
@ -64,28 +72,28 @@ Component({ @@ -64,28 +72,28 @@ Component({
});
return;
}
if (this.data.obscure) {
if (this.data.obscure && file.type === 'image') {
wx.editImage({
src: e.detail.file.url || e.detail.file.tempFilePath,
src: file.tempFilePath,
success: (res: any) => {
this.uploadFile({
...e.detail.file,
...file,
tempFilePath: res.tempFilePath,
}).then((res) => {
this.triggerEvent("file", res as object);
this.triggerEvent('file', res as object);
});
},
fail: (err) => {
if (err.errMsg.includes("开发者工具")) {
this.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object);
if (err.errMsg.includes('开发者工具')) {
this.uploadFile(file).then((res) => {
this.triggerEvent('file', res as object);
});
}
},
});
} else {
this.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object);
this.uploadFile(file).then((res) => {
this.triggerEvent('file', res as object);
});
}
},
@ -95,18 +103,18 @@ Component({ @@ -95,18 +103,18 @@ Component({
});
this.handleAfterRead(this.data.cacheEditParams, true);
},
handleChooseAvatar(e) {
handleChooseAvatar(e: any) {
this.uploadFile({
fileType: "image",
fileType: 'image',
tempFilePath: e.detail.avatarUrl,
size: 0,
}).then((res) => {
this.triggerEvent("file", res as object);
this.triggerEvent('file', res as object);
});
},
handleChooseFile() {
wx.chooseMessageFile({
type: "file",
type: 'file',
count: 1,
success: (res) => {
this.uploadFile({
@ -114,66 +122,68 @@ Component({ @@ -114,66 +122,68 @@ Component({
fileType: res.tempFiles[0].type,
tempFilePath: res.tempFiles[0].path,
}).then((res) => {
this.triggerEvent("file", res as object);
this.triggerEvent('file', res as object);
});
},
fail() {
wx.showToast({
icon: "none",
title: "取消选择",
icon: 'none',
title: '取消选择',
});
},
});
},
uploadFile(item) {
uploadFile(item: { tempFilePath: string; fileType: string; size: number; name?: string; duration?: number }) {
const { fileTypeList } = this.data;
wx.showLoading({
title: "正在上传",
title: '正在上传',
});
return new Promise((resolve, reject) => {
let url = `${app.globalData.upFileUrl}?r=file-service/upload-`;
if (item.fileType === "image") {
url += "img";
} else if (item.fileType === "video" || item.type === "video") {
url += "video";
item.tempFilePath = item.url;
} else if (item.fileType === "audio") {
url += "audio";
if (item.fileType === 'image') {
url += 'img';
} else if (item.fileType === 'video') {
url += 'video';
} else if (item.fileType === 'audio') {
url += 'audio';
} else {
url += "doc";
url += 'doc';
}
wx.uploadFile({
filePath: item.tempFilePath,
name: "file",
name: 'file',
url,
success: (res) => {
wx.hideLoading();
const data = JSON.parse(res.data);
const suffix = this.GetExtensionFileName(data.data.Url);
const expandJson = {
fileId: "",
fileId: '',
name: item.name || `病历相关文件.${suffix}`,
size: (item.size / 1024).toFixed(2),
fileUrl: data.data.Url,
imgUrl: '',
suffix,
type: item.fileType,
imgUrl: "",
duration: 0,
fileType: this.data.fileTypeList[suffix] || 99,
videoUrl: "",
hash: "",
hash: '',
fileType: fileTypeList[suffix] || 99,
};
if (item.fileType === "image") {
if (item.fileType === 'image') {
expandJson.fileType = fileTypeList.image;
expandJson.imgUrl = data.data.Url;
} else if (item.fileType === "video" || item.type === "video") {
} else if (item.fileType === 'video') {
expandJson.fileType = fileTypeList.video;
expandJson.imgUrl = data.data.SnapshotUrl;
} else if (item.fileType === "audio") {
expandJson.duration = Number.parseInt(String(item.duration / 1000));
} else if (item.fileType === 'audio') {
expandJson.fileType = fileTypeList.audio;
expandJson.duration = item.duration ? Number.parseInt(String(item.duration / 1000)) : 0;
}
resolve(expandJson);
},
fail() {
wx.hideLoading();
reject(new Error("上传失败"));
reject(new Error('上传失败'));
},
});
});

BIN
src/images/video-sign.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

63
src/module1/pages/casesDetail/index.scss

@ -28,7 +28,7 @@ page { @@ -28,7 +28,7 @@ page {
justify-content: space-between;
&::before {
flex-shrink: 0;
content: "";
content: '';
width: 10rpx;
height: 40rpx;
background: #00b4c5;
@ -230,10 +230,33 @@ page { @@ -230,10 +230,33 @@ page {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12rpx;
.photo {
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
border-radius: 8rpx;
.photo {
width: 100%;
height: 128rpx;
border-radius: 8rpx;
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {
@ -381,7 +404,7 @@ page { @@ -381,7 +404,7 @@ page {
position: absolute;
bottom: -12rpx;
left: 45%;
content: "";
content: '';
width: 0;
height: 0;
border-style: solid;
@ -406,7 +429,7 @@ page { @@ -406,7 +429,7 @@ page {
&::before {
margin-right: 22rpx;
flex-shrink: 0;
content: "";
content: '';
width: 10rpx;
height: 40rpx;
background: #00b4c5;
@ -561,10 +584,33 @@ page { @@ -561,10 +584,33 @@ page {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12rpx;
.photo {
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
border-radius: 8rpx;
.photo {
width: 100%;
height: 128rpx;
border-radius: 8rpx;
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {
@ -775,6 +821,7 @@ page { @@ -775,6 +821,7 @@ page {
position: fixed;
bottom: 0;
left: 0;
z-index: 10;
width: 100%;
padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx);
box-sizing: border-box;
@ -880,7 +927,7 @@ page { @@ -880,7 +927,7 @@ page {
position: absolute;
bottom: -12rpx;
left: 20rpx;
content: "";
content: '';
width: 0;
height: 0;
border-style: solid;

15
src/module1/pages/casesDetail/index.ts

@ -193,11 +193,16 @@ Page({ @@ -193,11 +193,16 @@ Page({
},
handleImagePreview(e) {
const { url, parent } = e.currentTarget.dataset;
const urls = parent.map((item) => item.url);
wx.previewImage({
urls,
current: url,
const { index, parent } = e.currentTarget.dataset;
const sources = parent.map((item) => {
return {
url: item.fileType == 3 ? item.videoUrl : item.url,
type: item.fileType == 3 ? 'video' : 'image',
};
});
wx.previewMedia({
sources,
current: index,
});
},

46
src/module1/pages/casesDetail/index.wxml

@ -56,16 +56,19 @@ @@ -56,16 +56,19 @@
</view>
</view>
<view class="photos">
<image
class="photo"
src="{{item.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{item.url}}"
data-parent="{{detail.caseImages}}"
<view
class="photo-wrap"
wx:for="{{detail.caseImages}}"
wx:key="url"
></image>
bind:tap="handleImagePreview"
data-parent="{{detail.caseImages}}"
data-index="{{index}}"
>
<image class="photo" src="{{item.url}}" mode="aspectFill"></image>
<view class="video-sign" wx:if="{{item.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
</view>
<view class="remark" wx:if="{{detail.description}}">
<view class="r-title">病历备注</view>
@ -75,9 +78,7 @@ @@ -75,9 +78,7 @@
<view class="audio-row" wx:for="{{detail.caseAudios}}" wx:key="url">
<customAudioBar class="audio-bar" url="{{item.url}}" time="{{item.duration}}"></customAudioBar>
<view class="options">
<customAudioText class="trans" url="{{item.url}}" map1="BTN_CASEDETAILVOICETOTEXT">
转文字
</customAudioText>
<customAudioText class="trans" url="{{item.url}}" map1="BTN_CASEDETAILVOICETOTEXT">转文字</customAudioText>
</view>
</view>
</view>
@ -171,24 +172,25 @@ @@ -171,24 +172,25 @@
<view class="audio-row" wx:for="{{item.feedbackAudios}}" wx:key="url" wx:for-item="aItem">
<customAudioBar class="audio-bar" url="{{aItem.url}}" time="{{aItem.duration}}"></customAudioBar>
<view class="options">
<customAudioText class="trans" url="{{aItem.url}}" map1="BTN_CASEDETAILVOICETOTEXT">
转文字
</customAudioText>
<customAudioText class="trans" url="{{aItem.url}}" map1="BTN_CASEDETAILVOICETOTEXT">转文字</customAudioText>
</view>
</view>
</view>
<view class="photos" wx:if="{{item.feedbackImages.length}}">
<image
class="photo"
src="{{cItem.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{cItem.url}}"
data-parent="{{item.feedbackImages}}"
<view
class="photo-wrap"
wx:for="{{item.feedbackImages}}"
wx:for-item="cItem"
wx:key="url"
></image>
bind:tap="handleImagePreview"
data-parent="{{item.feedbackImages}}"
data-index="{{index}}"
>
<image class="photo" src="{{cItem.url}}" mode="aspectFill"></image>
<view class="video-sign" wx:if="{{cItem.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
</view>
<view class="files" wx:if="{{item.feedbackFiles.length}}">
<view class="f-title">补充文件</view>

19
src/module1/pages/casesFeedback/index.scss

@ -98,6 +98,24 @@ page { @@ -98,6 +98,24 @@ page {
color: rgba(237, 79, 57, 1);
}
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {
@ -291,6 +309,7 @@ page { @@ -291,6 +309,7 @@ page {
position: fixed;
bottom: 0;
left: 0;
z-index: 10;
padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx);
width: 100%;
box-sizing: border-box;

31
src/module1/pages/casesFeedback/index.ts

@ -48,7 +48,7 @@ Page({ @@ -48,7 +48,7 @@ Page({
handleMapPhoto() {
app.mpBehavior({ PageName: "BTN_FEEDBACKSELECTIMAGE" });
},
handlePhoto(e) {
handleMedia(e) {
const detail = e.detail;
const images = this.data.images;
this.setData({
@ -56,13 +56,17 @@ Page({ @@ -56,13 +56,17 @@ Page({
...images,
{
name: detail.name,
url: detail.fileUrl,
url: detail.fileType == 3 ? detail.imgUrl : detail.fileUrl,
isRepeat: 2,
hash: "",
hash: '',
fileType: detail.fileType,
videoUrl: detail.fileType == 3 ? detail.fileUrl : '',
},
],
});
this.imageVerify(detail.fileUrl);
if (detail.fileType == 1) {
this.imageVerify(detail.fileUrl);
}
this.handleCache();
},
handleDelPhoto(e) {
@ -345,12 +349,21 @@ Page({ @@ -345,12 +349,21 @@ Page({
showMsg: false,
});
},
handlePreviewImage(e) {
const { url } = e.currentTarget.dataset;
handlePreviewMedia(e) {
const { index } = e.currentTarget.dataset;
const { images } = this.data;
wx.previewImage({
urls: images.map((item) => item.url),
current: url,
const sources = images.reduce((pre, cur) => {
return [
...pre,
{
url: cur.fileType === 3 ? cur.videoUrl : cur.url,
type: cur.fileType === 3 ? 'video' : 'image',
},
];
}, []);
wx.previewMedia({
sources,
current: index,
});
},
});

16
src/module1/pages/casesFeedback/index.wxml

@ -23,12 +23,7 @@ @@ -23,12 +23,7 @@
data-index="{{index}}"
></image>
<view class="options">
<customAudioText
class="trans"
url="{{item.url}}"
map1="BTN_FEEDBACKVOICETOTEXT"
map2="BTN_FEEDBACKCOPYTEXT"
>
<customAudioText class="trans" url="{{item.url}}" map1="BTN_FEEDBACKVOICETOTEXT" map2="BTN_FEEDBACKCOPYTEXT">
转文字
</customAudioText>
</view>
@ -41,11 +36,11 @@ @@ -41,11 +36,11 @@
</view>
<view class="card">
<view class="card-title">
上传图片建议
上传图片/视频建议
<text class="limit">({{images.length}}/9)</text>
</view>
<view class="image-files">
<view class="photo" wx:for="{{images}}" wx:key="index" bind:tap="handlePreviewImage" data-url="{{item.url}}">
<view class="photo" wx:for="{{images}}" wx:key="index" bind:tap="handlePreviewMedia" data-index="{{index}}">
<image class="p-img" src="{{item.url}}" mode="aspectFill"></image>
<view class="del" catch:tap="handleDelPhoto" data-index="{{index}}">
<van-icon name="cross" />
@ -54,8 +49,11 @@ @@ -54,8 +49,11 @@
<image class="icon" src="{{imageUrl}}icon-error.png?t={{Timestamp}}"></image>
<view class="r-title">重复图片</view>
</view>
<view class="video-sign" wx:if="{{item.fileType === 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
<uploadFile bind:file="handlePhoto" bind:tap="handleMapPhoto">
<uploadFile accept="media" bind:file="handleMedia" bind:tap="handleMapPhoto" wx:if="{{images.length<9}}">
<view class="upload-file">
<van-icon class="add" name="plus" />
</view>

54
src/module1/pages/chatRoom/index.scss

@ -936,10 +936,33 @@ page { @@ -936,10 +936,33 @@ page {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12rpx;
.photo {
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
border-radius: 8rpx;
.photo {
width: 100%;
height: 128rpx;
border-radius: 8rpx;
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {
@ -1219,10 +1242,33 @@ page { @@ -1219,10 +1242,33 @@ page {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12rpx;
.photo {
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
border-radius: 8rpx;
.photo {
width: 100%;
height: 128rpx;
border-radius: 8rpx;
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {

15
src/module1/pages/chatRoom/index.ts

@ -774,11 +774,16 @@ Page({ @@ -774,11 +774,16 @@ Page({
});
},
handleImagePreview(e) {
const { url, parent } = e.currentTarget.dataset;
const urls = parent.map((item) => item.url);
wx.previewImage({
urls,
current: url,
const { index, parent } = e.currentTarget.dataset;
const sources = parent.map((item) => {
return {
url: item.fileType == 3 ? item.videoUrl : item.url,
type: item.fileType == 3 ? 'video' : 'image',
};
});
wx.previewMedia({
sources,
current: index,
});
},
});

38
src/module1/pages/chatRoom/index.wxml

@ -366,16 +366,19 @@ @@ -366,16 +366,19 @@
</view>
</view>
<view class="photos">
<image
class="photo"
src="{{item.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{item.url}}"
data-parent="{{detail.caseImages}}"
<view
class="photo-wrap"
wx:for="{{detail.caseImages}}"
wx:key="url"
></image>
bind:tap="handleImagePreview"
data-index="{{index}}"
data-parent="{{detail.caseImages}}"
>
<image class="photo" src="{{item.url}}" mode="aspectFill"></image>
<view class="video-sign" wx:if="{{item.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
</view>
<view class="remark" wx:if="{{detail.description}}">
<view class="r-title">病历备注</view>
@ -481,17 +484,20 @@ @@ -481,17 +484,20 @@
</view>
</view>
<view class="photos" wx:if="{{item.feedbackImages.length}}">
<image
class="photo"
src="{{cItem.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{cItem.url}}"
data-parent="{{item.feedbackImages}}"
<view
class="photo-wrap"
wx:for="{{item.feedbackImages}}"
wx:for-item="cItem"
wx:key="url"
></image>
bind:tap="handleImagePreview"
data-index="{{index}}"
data-parent="{{item.feedbackImages}}"
>
<image class="photo" src="{{cItem.url}}" mode="aspectFill"></image>
<view class="video-sign" wx:if="{{cItem.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
</view>
<view class="files" wx:if="{{item.feedbackFiles.length}}">
<view class="f-title">补充文件</view>

22
src/module1/pages/entryCases/index.scss

@ -29,7 +29,7 @@ page { @@ -29,7 +29,7 @@ page {
&.required {
&::before {
display: inline;
content: "*";
content: '*';
color: rgba(255, 87, 51, 1);
}
}
@ -66,7 +66,7 @@ page { @@ -66,7 +66,7 @@ page {
position: absolute;
top: 0;
right: 0;
z-index: 1;
z-index: 3;
color: #fff;
width: 32rpx;
height: 32rpx;
@ -98,6 +98,24 @@ page { @@ -98,6 +98,24 @@ page {
color: rgba(237, 79, 57, 1);
}
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
.remark {

143
src/module1/pages/entryCases/index.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import Toast from "@vant/weapp/toast/toast";
import Toast from '@vant/weapp/toast/toast';
const app = getApp<IAppOption>();
Page({
@ -12,15 +12,15 @@ Page({ @@ -12,15 +12,15 @@ Page({
labelList: [] as any,
images: [] as any,
description: "",
description: '',
audios: [] as any,
files: [] as any,
deptId: "",
deptId: '',
labelIds: [] as any,
DoctorLevel: 1,
caseId: "",
caseId: '',
edit: true,
DeleteAttachmentIds: [] as any,
@ -47,8 +47,8 @@ Page({ @@ -47,8 +47,8 @@ Page({
},
getVisit() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/is-visit",
method: 'GET',
url: '?r=takeda/case/is-visit',
data: {},
}).then((res) => {
this.setData({
@ -58,15 +58,15 @@ Page({ @@ -58,15 +58,15 @@ Page({
},
postVisit() {
wx.ajax({
method: "POST",
url: "?r=takeda/case/visit",
method: 'POST',
url: '?r=takeda/case/visit',
data: {},
});
},
getDetail() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/get-case-detail",
method: 'GET',
url: '?r=takeda/case/get-case-detail',
data: {
caseId: this.data.caseId,
},
@ -76,7 +76,7 @@ Page({ @@ -76,7 +76,7 @@ Page({
description: res.description,
audios: res.caseAudios,
files: res.caseFiles,
deptId: res.caseDeptId[0] || "",
deptId: res.caseDeptId[0] || '',
labelIds: res.caseLabels.map((item) => item.labelId),
labelList: this.data.deptList.find((item) => item.value === res.caseDeptId[0])?.options || [],
});
@ -85,8 +85,8 @@ Page({ @@ -85,8 +85,8 @@ Page({
getDoctorDict() {
return wx
.ajax({
method: "GET",
url: "?r=takeda/reg/doctor-dict",
method: 'GET',
url: '?r=takeda/reg/doctor-dict',
data: {},
})
.then((res) => {
@ -97,8 +97,8 @@ Page({ @@ -97,8 +97,8 @@ Page({
},
getInviteDoctorList() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/get-invite-doctor-list",
method: 'GET',
url: '?r=takeda/case/get-invite-doctor-list',
data: {},
}).then((res) => {
this.setData({
@ -107,9 +107,9 @@ Page({ @@ -107,9 +107,9 @@ Page({
});
},
handleMapPhoto() {
app.mpBehavior({ PageName: "BTN_INPUTCASEUPLOADIMAGE" });
app.mpBehavior({ PageName: 'BTN_INPUTCASEUPLOADIMAGE' });
},
handlePhoto(e) {
handleMedia(e) {
const detail = e.detail;
const { images, edit } = this.data;
if (edit) {
@ -123,13 +123,17 @@ Page({ @@ -123,13 +123,17 @@ Page({
...images,
{
name: detail.name,
url: detail.fileUrl,
url: detail.fileType == 3 ? detail.imgUrl : detail.fileUrl,
isRepeat: 2,
hash: "",
hash: '',
fileType: detail.fileType,
videoUrl: detail.fileType == 3 ? detail.fileUrl : '',
},
],
});
this.imageVerify(detail.fileUrl);
if (detail.fileType === 1) {
this.imageVerify(detail.fileUrl);
}
},
handleDelPhoto(e: any) {
const { index } = e.currentTarget.dataset;
@ -151,8 +155,8 @@ Page({ @@ -151,8 +155,8 @@ Page({
}
});
wx.ajax({
method: "POST",
url: "?r=takeda/common/image-verify",
method: 'POST',
url: '?r=takeda/common/image-verify',
data: {
ImageUrl: url,
LastImagesHash,
@ -167,7 +171,7 @@ Page({ @@ -167,7 +171,7 @@ Page({
if (res.code === 1001) {
wx.showToast({
title: res.msg,
icon: "none",
icon: 'none',
});
imageItem.repeat = true;
}
@ -177,7 +181,7 @@ Page({ @@ -177,7 +181,7 @@ Page({
});
},
handleMapAudio() {
app.mpBehavior({ PageName: "BTN_INPUTCASERECORDVOICE" });
app.mpBehavior({ PageName: 'BTN_INPUTCASERECORDVOICE' });
},
handleAudio(e) {
this.setData({
@ -194,9 +198,9 @@ Page({ @@ -194,9 +198,9 @@ Page({
},
handleDelAudio(e) {
wx.showModal({
title: "确认删除?",
confirmColor: "#00B4C5",
cancelColor: "#141515",
title: '确认删除?',
confirmColor: '#00B4C5',
cancelColor: '#141515',
success: (res) => {
if (res.confirm) {
const { index } = e.currentTarget.dataset;
@ -208,7 +212,7 @@ Page({ @@ -208,7 +212,7 @@ Page({
});
},
handleMapFile() {
app.mpBehavior({ PageName: "BTN_INPUTCASESELECTFILE" });
app.mpBehavior({ PageName: 'BTN_INPUTCASESELECTFILE' });
},
handleFile(e) {
this.setData({
@ -228,9 +232,9 @@ Page({ @@ -228,9 +232,9 @@ Page({
},
handleDelFile(e) {
wx.showModal({
title: "确认删除?",
confirmColor: "#00B4C5",
cancelColor: "#141515",
title: '确认删除?',
confirmColor: '#00B4C5',
cancelColor: '#141515',
success: (res) => {
if (res.confirm) {
const { index } = e.currentTarget.dataset;
@ -252,8 +256,8 @@ Page({ @@ -252,8 +256,8 @@ Page({
showMenu: true,
fail() {
wx.showToast({
title: "该文件无法预览",
icon: "none",
title: '该文件无法预览',
icon: 'none',
});
},
});
@ -264,12 +268,12 @@ Page({ @@ -264,12 +268,12 @@ Page({
const { index } = e.currentTarget.dataset;
const item = this.data.files[index];
wx.showModal({
title: "文件名",
title: '文件名',
content: item.name,
confirmColor: "#00B4C5",
cancelColor: "#141515",
confirmColor: '#00B4C5',
cancelColor: '#141515',
showCancel: false,
confirmText: "关闭",
confirmText: '关闭',
});
},
handleDownloadFile(e) {
@ -286,15 +290,15 @@ Page({ @@ -286,15 +290,15 @@ Page({
tempFilePath,
success() {
wx.showToast({
title: "下载成功",
icon: "none",
title: '下载成功',
icon: 'none',
mask: true,
});
},
fail() {
wx.showToast({
title: "下载失败,请重新尝试",
icon: "none",
title: '下载失败,请重新尝试',
icon: 'none',
mask: true,
});
},
@ -304,7 +308,7 @@ Page({ @@ -304,7 +308,7 @@ Page({
});
},
handleDept(e) {
app.mpBehavior({ PageName: "BTN_INPUTCASETAG" });
app.mpBehavior({ PageName: 'BTN_INPUTCASETAG' });
const { params } = e.currentTarget.dataset;
this.setData({
deptId: params.value,
@ -313,7 +317,7 @@ Page({ @@ -313,7 +317,7 @@ Page({
});
},
handleLabel(e) {
app.mpBehavior({ PageName: "BTN_INPUTCASETAG" });
app.mpBehavior({ PageName: 'BTN_INPUTCASETAG' });
const { params } = e.currentTarget.dataset;
const labelIds = this.data.labelIds;
const newLabelId = labelIds.includes(params.value)
@ -344,15 +348,15 @@ Page({ @@ -344,15 +348,15 @@ Page({
const { caseId, images, description, audios, files, deptId, labelIds } = this.data;
if (!images.length && !description && !audios.length && !files.length && !deptId && !labelIds.length) {
wx.showToast({
title: "请完善信息",
icon: "none",
title: '请完善信息',
icon: 'none',
});
return;
}
const params = this.formatParams();
const url = caseId ? "?r=takeda/case/save-case" : "?r=takeda/case/create-case";
const url = caseId ? '?r=takeda/case/save-case' : '?r=takeda/case/create-case';
wx.ajax({
method: "POST",
method: 'POST',
url,
data: {
...params,
@ -368,22 +372,22 @@ Page({ @@ -368,22 +372,22 @@ Page({
const { deptId, labelIds, images } = this.data;
if (images.length === 0) {
wx.showToast({
title: "请上传病历图片",
icon: "none",
title: '请上传病历图片',
icon: 'none',
});
return;
}
if (deptId && !labelIds.length) {
wx.showToast({
title: "请选择标签",
icon: "none",
title: '请选择标签',
icon: 'none',
});
return;
}
wx.navigateTo({
url: `/module1/pages/setCaseDoctor/index`,
success: (res) => {
res.eventChannel.emit("acceptDataFromOpenerPage", {
res.eventChannel.emit('acceptDataFromOpenerPage', {
caseId: this.data.caseId,
params,
});
@ -391,7 +395,7 @@ Page({ @@ -391,7 +395,7 @@ Page({
});
},
handleNoInvite() {
Toast("您还没有合作医生,无法邀请医生讨论病历,可暂时存为草稿");
Toast('您还没有合作医生,无法邀请医生讨论病历,可暂时存为草稿');
},
handleSave() {},
handleSubmit() {},
@ -406,11 +410,11 @@ Page({ @@ -406,11 +410,11 @@ Page({
return;
}
wx.showModal({
confirmColor: "#00B4C5",
cancelColor: "#141515",
title: "您的病历还未保存,是否要存为草稿?",
confirmText: "存为草稿",
cancelText: "退出",
confirmColor: '#00B4C5',
cancelColor: '#141515',
title: '您的病历还未保存,是否要存为草稿?',
confirmText: '存为草稿',
cancelText: '退出',
success: (res) => {
if (res.confirm) {
this.handleCache();
@ -420,18 +424,27 @@ Page({ @@ -420,18 +424,27 @@ Page({
},
});
},
handlePreviewImage(e) {
const { url } = e.currentTarget.dataset;
handlePreviewMedia(e) {
const { index } = e.currentTarget.dataset;
const { images } = this.data;
wx.previewImage({
urls: images.map((item) => item.url),
current: url,
const sources = images.reduce((pre, cur) => {
return [
...pre,
{
url: cur.fileType === 3 ? cur.videoUrl : cur.url,
type: cur.fileType === 3 ? 'video' : 'image',
},
];
}, []);
wx.previewMedia({
sources,
current: index,
});
},
getAuth() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/get-case-detail-op-auth",
method: 'GET',
url: '?r=takeda/case/get-case-detail-op-auth',
data: {
caseId: this.data.caseId,
},

16
src/module1/pages/entryCases/index.wxml

@ -5,11 +5,11 @@ @@ -5,11 +5,11 @@
<view class="page" style="padding-top:{{menuButtonInfo.top + 60}}px;">
<view class="card">
<view class="card-title required">
上传病历图片
上传病历图片/视频
<text class="limit">({{images.length}}/9)</text>
</view>
<view class="image-files">
<view class="photo" wx:for="{{images}}" wx:key="index" bind:tap="handlePreviewImage" data-url="{{item.url}}">
<view class="photo" wx:for="{{images}}" wx:key="index" bind:tap="handlePreviewMedia" data-index="{{index}}">
<image class="p-img" src="{{item.url}}" mode="aspectFill"></image>
<view class="del" catch:tap="handleDelPhoto" data-index="{{index}}">
<van-icon name="cross" />
@ -18,8 +18,18 @@ @@ -18,8 +18,18 @@
<image class="icon" src="{{imageUrl}}icon-error.png?t={{Timestamp}}"></image>
<view class="r-title">重复图片</view>
</view>
<view class="video-sign" wx:if="{{item.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
<uploadFile obscure edit="{{edit}}" bind:file="handlePhoto" bind:tap="handleMapPhoto" wx:if="{{images.length<9}}">
<uploadFile
obscure
accept="media"
edit="{{edit}}"
bind:file="handleMedia"
bind:tap="handleMapPhoto"
wx:if="{{images.length<9}}"
>
<view class="upload-file">
<van-icon class="add" name="plus" />
</view>

33
src/pages/cases/index.scss

@ -29,7 +29,7 @@ page { @@ -29,7 +29,7 @@ page {
width: 48rpx;
height: 8rpx;
border-radius: 8rpx 8rpx 0 0;
content: "";
content: '';
background-color: rgba(0, 180, 197, 1);
}
}
@ -198,7 +198,7 @@ page { @@ -198,7 +198,7 @@ page {
align-items: center;
&::before {
flex-shrink: 0;
content: "";
content: '';
width: 10rpx;
height: 40rpx;
background: #00b4c5;
@ -264,7 +264,7 @@ page { @@ -264,7 +264,7 @@ page {
position: absolute;
bottom: -12rpx;
left: 45%;
content: "";
content: '';
width: 0;
height: 0;
border-style: solid;
@ -335,10 +335,33 @@ page { @@ -335,10 +335,33 @@ page {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12rpx;
.photo {
.photo-wrap {
position: relative;
width: 100%;
height: 148rpx;
border-radius: 8rpx;
.photo {
width: 100%;
height: 100%;
border-radius: 8rpx;
}
.video-sign {
position: absolute;
top: 0;
right: 0;
z-index: 1;
width: 100%;
height: 100%;
font-size: 20rpx;
border-radius: 8rpx;
background: rgba(9, 9, 9, 0.3);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 48rpx;
height: 48rpx;
}
}
}
}
}

193
src/pages/cases/index.ts

@ -8,9 +8,9 @@ Page({ @@ -8,9 +8,9 @@ Page({
show2: false,
show3: false,
showArea: false,
fieldNames: { text: "label", value: "value", children: "children" },
fieldNames: { text: 'label', value: 'value', children: 'children' },
nav: "0",
nav: '0',
area: [],
caseStatusList: {},
@ -24,7 +24,7 @@ Page({ @@ -24,7 +24,7 @@ Page({
},
list: [],
hostilatSearch: "",
hostilatSearch: '',
hostipalList: [],
hospitalClassification: {},
hospitalLevel: {},
@ -37,32 +37,32 @@ Page({ @@ -37,32 +37,32 @@ Page({
deptList: [] as any,
labelList: [] as any,
caseStatusName: "全部",
hospitalName: "全部",
deptName: "全部",
labelName: "全部",
provinceName: "",
cityName: "",
countyName: "",
caseStatusName: '全部',
hospitalName: '全部',
deptName: '全部',
labelName: '全部',
provinceName: '',
cityName: '',
countyName: '',
search: "",
search: '',
caseStatus: [] as any,
hospitalId: [] as any,
submitTimeBegin: "",
submitTimeEnd: "",
feedbackTimeBegin: "",
feedbackTimeEnd: "",
submitTimeBegin: '',
submitTimeEnd: '',
feedbackTimeBegin: '',
feedbackTimeEnd: '',
deptId: [] as any,
labelId: [] as any,
provinceId: "",
cityId: "",
countyId: "",
isReject: "",
isHighQuality: "",
isOpen: "",
needDeal: "",
newFeedback: "",
orderType: "feedbackTime",
provinceId: '',
cityId: '',
countyId: '',
isReject: '',
isHighQuality: '',
isOpen: '',
needDeal: '',
newFeedback: '',
orderType: 'feedbackTime',
myCaseCount: 0,
@ -92,20 +92,20 @@ Page({ @@ -92,20 +92,20 @@ Page({
},
});
this.setData({
caseStatus: app.globalData.caseStatus ? app.globalData.caseStatus.split(",") : "",
caseStatus: app.globalData.caseStatus ? app.globalData.caseStatus.split(',') : '',
caseStatusName: app.globalData.caseStatusName,
newFeedback: app.globalData.newFeedback,
});
app.globalData.caseNav = "0";
app.globalData.caseStatus = "";
app.globalData.caseStatusName = "全部";
app.globalData.newFeedback = "";
app.globalData.caseNav = '0';
app.globalData.caseStatus = '';
app.globalData.caseStatusName = '全部';
app.globalData.newFeedback = '';
this.setData({
needDeal: app.globalData.needDeal,
});
app.globalData.needDeal = "";
app.globalData.needDeal = '';
app.waitLogin().then(() => {
app.mpBehavior({ PageName: "PG_CASELIST" });
app.mpBehavior({ PageName: 'PG_CASELIST' });
this.getBaseInfo();
this.getList();
this.getHospitalsList();
@ -122,8 +122,8 @@ Page({ @@ -122,8 +122,8 @@ Page({
},
getNotice() {
wx.ajax({
method: "GET",
url: "?r=takeda/doctor/todo",
method: 'GET',
url: '?r=takeda/doctor/todo',
data: {},
}).then((res) => {
this.getTabBar().setData({
@ -133,8 +133,8 @@ Page({ @@ -133,8 +133,8 @@ Page({
},
getBaseInfo() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/get-base-info",
method: 'GET',
url: '?r=takeda/case/get-base-info',
data: {},
}).then((res) => {
this.setData({
@ -146,8 +146,8 @@ Page({ @@ -146,8 +146,8 @@ Page({
},
getArea() {
wx.ajax({
method: "GET",
url: "/js/area.json",
method: 'GET',
url: '/js/area.json',
isJSON: true,
}).then((res) => {
this.setData({
@ -159,16 +159,16 @@ Page({ @@ -159,16 +159,16 @@ Page({
const { nav, noSearch } = e.currentTarget.dataset;
this.setData({
nav,
isOpen: nav === "1" ? "1" : "",
isHighQuality: nav === "2" ? "1" : "",
isReject: "",
isOpen: nav === '1' ? '1' : '',
isHighQuality: nav === '2' ? '1' : '',
isReject: '',
});
if (noSearch) return;
this.handleSearch();
},
getList(newPage = 1) {
wx.ajax({
method: "POST",
method: 'POST',
url: `?r=takeda/case/get-list&type=${Number(this.data.nav) + 1}&page=${newPage}`,
data: {
search: this.data.search,
@ -210,7 +210,7 @@ Page({ @@ -210,7 +210,7 @@ Page({
}
},
handleSearchFocus() {
app.mpBehavior({ PageName: "BTN_CASELISTSEARCH" });
app.mpBehavior({ PageName: 'BTN_CASELISTSEARCH' });
},
handleSearch() {
this.getList();
@ -223,7 +223,7 @@ Page({ @@ -223,7 +223,7 @@ Page({
handleCancel(e) {
const { key } = e.currentTarget.dataset;
this.setData({
[key]: "",
[key]: '',
});
this.handleSearch();
},
@ -233,7 +233,7 @@ Page({ @@ -233,7 +233,7 @@ Page({
if (!value) {
this.setData({
caseStatus: [],
caseStatusName: "全部",
caseStatusName: '全部',
});
return;
}
@ -244,12 +244,12 @@ Page({ @@ -244,12 +244,12 @@ Page({
caseStatus
.filter((item) => item !== value)
.map((item) => caseStatusList[item])
.join(",") || "全部",
.join(',') || '全部',
});
} else {
this.setData({
caseStatus: [...caseStatus, value],
caseStatusName: [...caseStatus, value].map((item) => caseStatusList[item]).join(",") || "全部",
caseStatusName: [...caseStatus, value].map((item) => caseStatusList[item]).join(',') || '全部',
});
}
},
@ -269,19 +269,19 @@ Page({ @@ -269,19 +269,19 @@ Page({
});
if (show2) {
this.setData({
hospitalId: "",
hospitalName: "全部",
hospitalId: '',
hospitalName: '全部',
});
this.handleSearch();
}
if (showArea) {
this.setData({
provinceId: "",
cityId: "",
countyId: "",
provinceName: "",
cityName: "",
countyName: "",
provinceId: '',
cityId: '',
countyId: '',
provinceName: '',
cityName: '',
countyName: '',
});
this.handleSearch();
}
@ -289,23 +289,28 @@ Page({ @@ -289,23 +289,28 @@ Page({
this.setData({
deptId: [],
labelId: [],
deptName: "全部",
labelName: "全部",
deptName: '全部',
labelName: '全部',
});
this.handleSearch();
}
},
handleImagePreview(e) {
const { url, parent } = e.currentTarget.dataset;
const urls = parent.map((item) => item.url);
wx.previewImage({
urls,
current: url,
const { index, parent } = e.currentTarget.dataset;
const sources = parent.map((item) => {
return {
url: item.fileType == 3 ? item.videoUrl : item.url,
type: item.fileType == 3 ? 'video' : 'image',
};
});
wx.previewMedia({
sources,
current: index,
});
},
handleDetail(e) {
const { params } = e.currentTarget.dataset;
app.mpBehavior({ PageName: "BTN_CASECARD" });
app.mpBehavior({ PageName: 'BTN_CASECARD' });
this.setData({
entryDetail: true,
});
@ -322,8 +327,8 @@ Page({ @@ -322,8 +327,8 @@ Page({
},
getHostipalDict() {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/hospital-dict",
method: 'GET',
url: '?r=takeda/reg/hospital-dict',
data: {},
}).then((res) => {
this.setData({
@ -337,8 +342,8 @@ Page({ @@ -337,8 +342,8 @@ Page({
},
getHospitalsList(newPage = 1) {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/hospitals",
method: 'GET',
url: '?r=takeda/reg/hospitals',
data: {
page: newPage,
Search: this.data.hostilatSearch,
@ -357,7 +362,7 @@ Page({ @@ -357,7 +362,7 @@ Page({
},
handleHostipalBottom(e) {
const hostipalPagination = this.data.hostipalPagination;
if (e.detail.direction === "botttom" && hostipalPagination.page < hostipalPagination.pages) {
if (e.detail.direction === 'botttom' && hostipalPagination.page < hostipalPagination.pages) {
this.getHospitalsList(Number(hostipalPagination.page) + 1);
}
},
@ -366,15 +371,15 @@ Page({ @@ -366,15 +371,15 @@ Page({
this.setData({
show2: false,
hospitalId: this.data.hospitalId.includes(params.HospitalId) ? [] : [params.HospitalId],
hospitalName: this.data.hospitalId.includes(params.HospitalId) ? "全部" : params.Name,
hospitalName: this.data.hospitalId.includes(params.HospitalId) ? '全部' : params.Name,
});
this.handleSearch();
},
getDoctorDict() {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/doctor-dict",
method: 'GET',
url: '?r=takeda/reg/doctor-dict',
data: {},
}).then((res) => {
this.setData({
@ -396,7 +401,7 @@ Page({ @@ -396,7 +401,7 @@ Page({
const newDeptName = this.data.deptList
.filter((item) => newDeptId.includes(item.value))
.map((item) => item.label)
.join(",");
.join(',');
const labelList = this.data.deptList
.filter((item) => newDeptId.includes(item.value))
.reduce((pre, cur) => {
@ -404,10 +409,10 @@ Page({ @@ -404,10 +409,10 @@ Page({
}, []);
this.setData({
deptId: newDeptId,
deptName: newDeptName || "全部",
deptName: newDeptName || '全部',
labelList,
labelId: [],
labelName: "全部",
labelName: '全部',
});
},
handleLabel(e) {
@ -416,24 +421,24 @@ Page({ @@ -416,24 +421,24 @@ Page({
const newLabelId = labelId.includes(params.value)
? labelId.filter((item) => item !== params.value)
: [...labelId, params.value];
let labelName = "";
let labelName = '';
labelList.forEach((item) => {
if (newLabelId.includes(item.value)) {
labelName = `${labelName}${labelName ? "," : ""}${item.label}`;
labelName = `${labelName}${labelName ? ',' : ''}${item.label}`;
}
});
this.setData({
labelId: newLabelId,
labelName: labelName || "全部",
labelName: labelName || '全部',
});
},
handleTagSubmit() {
const { deptId, labelId } = this.data;
if (deptId.length && !labelId.length) {
wx.showToast({
title: "请选择标签",
icon: "none",
title: '请选择标签',
icon: 'none',
});
return;
}
@ -464,16 +469,16 @@ Page({ @@ -464,16 +469,16 @@ Page({
handleRadio(e) {
const { key } = e.currentTarget.dataset;
const PageName = {
isReject: "BTN_CASELISTREJECTFILTER",
isHighQuality: "BTN_CASELISTQUALITYFILTER",
isOpen: "BTN_CASELISTPUBLIC",
newFeedback: "BTN_CASELISTUPDATE",
isReject: 'BTN_CASELISTREJECTFILTER',
isHighQuality: 'BTN_CASELISTQUALITYFILTER',
isOpen: 'BTN_CASELISTPUBLIC',
newFeedback: 'BTN_CASELISTUPDATE',
}[key];
if (PageName) {
app.mpBehavior({ PageName });
}
this.setData({
[key]: this.data[key] === "1" ? "" : "1",
[key]: this.data[key] === '1' ? '' : '1',
});
this.handleSearch();
},
@ -485,7 +490,7 @@ Page({ @@ -485,7 +490,7 @@ Page({
this.handleSearch();
},
handleFold() {
app.mpBehavior({ PageName: "BTN_CASELISTFILTERTOGGLE" });
app.mpBehavior({ PageName: 'BTN_CASELISTFILTERTOGGLE' });
this.setData({
fold: !this.data.fold,
});
@ -494,14 +499,14 @@ Page({ @@ -494,14 +499,14 @@ Page({
const { index } = e.currentTarget.dataset;
const params: any = this.data.list[index];
wx.showModal({
confirmColor: "#00B4C5",
cancelColor: "#141515",
title: "确认删除该病历?",
confirmColor: '#00B4C5',
cancelColor: '#141515',
title: '确认删除该病历?',
success: (e) => {
if (e.confirm) {
wx.ajax({
method: "POST",
url: "?r=takeda/case/delete-case",
method: 'POST',
url: '?r=takeda/case/delete-case',
data: {
caseId: params.caseId,
},
@ -518,14 +523,14 @@ Page({ @@ -518,14 +523,14 @@ Page({
handleQuestion(e) {
const { index } = e.currentTarget.dataset;
const message = {
1: "设为公开的病历,公开病历平台所有医生均可访问",
2: "标为优质的病历,病历所在科室医生均可访问",
3: "属于您所在科室的所有病历",
1: '设为公开的病历,公开病历平台所有医生均可访问',
2: '标为优质的病历,病历所在科室医生均可访问',
3: '属于您所在科室的所有病历',
}[index];
wx.showModal({
confirmColor: "#00B4C5",
confirmColor: '#00B4C5',
showCancel: false,
confirmText: "知道了",
confirmText: '知道了',
content: message,
});
},

17
src/pages/cases/index.wxml

@ -244,17 +244,20 @@ @@ -244,17 +244,20 @@
</view>
</view>
<view class="photos" wx:if="{{item.caseImages.length}}">
<image
<view
class="photo-wrap"
wx:for="{{item.caseImages}}"
wx:for-item="photoItem"
class="photo"
mode="aspectFill"
src="{{photoItem.url}}"
wx:for-index="photoIndex"
catch:tap="handleImagePreview"
data-url="{{photoItem.url}}"
data-index="{{photoIndex}}"
data-parent="{{item.caseImages}}"
wx:key="index"
></image>
>
<image class="photo" mode="aspectFill" src="{{photoItem.url}}"></image>
<view class="video-sign" wx:if="{{photoItem.fileType == 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</view>
</view>
<block wx:if="{{item.caseFeedback.feedbackId}}">
<view class="li-row">

Loading…
Cancel
Save