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. 55
      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. 29
      src/module1/pages/casesFeedback/index.ts
  11. 16
      src/module1/pages/casesFeedback/index.wxml
  12. 46
      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. 141
      src/module1/pages/entryCases/index.ts
  17. 16
      src/module1/pages/entryCases/index.wxml
  18. 31
      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 @@
# 2024-10-31

1
eslint.config.mjs

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

16
project.private.config.json

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

98
src/components/uploadFile/index.ts

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

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

@ -28,7 +28,7 @@ page {
justify-content: space-between; justify-content: space-between;
&::before { &::before {
flex-shrink: 0; flex-shrink: 0;
content: ""; content: '';
width: 10rpx; width: 10rpx;
height: 40rpx; height: 40rpx;
background: #00b4c5; background: #00b4c5;
@ -230,11 +230,34 @@ page {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 12rpx; gap: 12rpx;
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
.photo { .photo {
width: 100%; width: 100%;
height: 128rpx; height: 128rpx;
border-radius: 8rpx; 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 { .remark {
.r-title { .r-title {
@ -381,7 +404,7 @@ page {
position: absolute; position: absolute;
bottom: -12rpx; bottom: -12rpx;
left: 45%; left: 45%;
content: ""; content: '';
width: 0; width: 0;
height: 0; height: 0;
border-style: solid; border-style: solid;
@ -406,7 +429,7 @@ page {
&::before { &::before {
margin-right: 22rpx; margin-right: 22rpx;
flex-shrink: 0; flex-shrink: 0;
content: ""; content: '';
width: 10rpx; width: 10rpx;
height: 40rpx; height: 40rpx;
background: #00b4c5; background: #00b4c5;
@ -561,11 +584,34 @@ page {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 12rpx; gap: 12rpx;
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
.photo { .photo {
width: 100%; width: 100%;
height: 128rpx; height: 128rpx;
border-radius: 8rpx; 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 { .remark {
.r-title { .r-title {
@ -775,6 +821,7 @@ page {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 10;
width: 100%; width: 100%;
padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx); padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx);
box-sizing: border-box; box-sizing: border-box;
@ -880,7 +927,7 @@ page {
position: absolute; position: absolute;
bottom: -12rpx; bottom: -12rpx;
left: 20rpx; left: 20rpx;
content: ""; content: '';
width: 0; width: 0;
height: 0; height: 0;
border-style: solid; border-style: solid;

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

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

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

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

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

@ -98,6 +98,24 @@ page {
color: rgba(237, 79, 57, 1); 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 { .remark {
@ -291,6 +309,7 @@ page {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 10;
padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx); padding: 32rpx 32rpx calc(env(safe-area-inset-bottom) + 32rpx);
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;

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

@ -48,7 +48,7 @@ Page({
handleMapPhoto() { handleMapPhoto() {
app.mpBehavior({ PageName: "BTN_FEEDBACKSELECTIMAGE" }); app.mpBehavior({ PageName: "BTN_FEEDBACKSELECTIMAGE" });
}, },
handlePhoto(e) { handleMedia(e) {
const detail = e.detail; const detail = e.detail;
const images = this.data.images; const images = this.data.images;
this.setData({ this.setData({
@ -56,13 +56,17 @@ Page({
...images, ...images,
{ {
name: detail.name, name: detail.name,
url: detail.fileUrl, url: detail.fileType == 3 ? detail.imgUrl : detail.fileUrl,
isRepeat: 2, isRepeat: 2,
hash: "", hash: '',
fileType: detail.fileType,
videoUrl: detail.fileType == 3 ? detail.fileUrl : '',
}, },
], ],
}); });
if (detail.fileType == 1) {
this.imageVerify(detail.fileUrl); this.imageVerify(detail.fileUrl);
}
this.handleCache(); this.handleCache();
}, },
handleDelPhoto(e) { handleDelPhoto(e) {
@ -345,12 +349,21 @@ Page({
showMsg: false, showMsg: false,
}); });
}, },
handlePreviewImage(e) { handlePreviewMedia(e) {
const { url } = e.currentTarget.dataset; const { index } = e.currentTarget.dataset;
const { images } = this.data; const { images } = this.data;
wx.previewImage({ const sources = images.reduce((pre, cur) => {
urls: images.map((item) => item.url), return [
current: url, ...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 @@
data-index="{{index}}" data-index="{{index}}"
></image> ></image>
<view class="options"> <view class="options">
<customAudioText <customAudioText class="trans" url="{{item.url}}" map1="BTN_FEEDBACKVOICETOTEXT" map2="BTN_FEEDBACKCOPYTEXT">
class="trans"
url="{{item.url}}"
map1="BTN_FEEDBACKVOICETOTEXT"
map2="BTN_FEEDBACKCOPYTEXT"
>
转文字 转文字
</customAudioText> </customAudioText>
</view> </view>
@ -41,11 +36,11 @@
</view> </view>
<view class="card"> <view class="card">
<view class="card-title"> <view class="card-title">
上传图片建议 上传图片/视频建议
<text class="limit">({{images.length}}/9)</text> <text class="limit">({{images.length}}/9)</text>
</view> </view>
<view class="image-files"> <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> <image class="p-img" src="{{item.url}}" mode="aspectFill"></image>
<view class="del" catch:tap="handleDelPhoto" data-index="{{index}}"> <view class="del" catch:tap="handleDelPhoto" data-index="{{index}}">
<van-icon name="cross" /> <van-icon name="cross" />
@ -54,8 +49,11 @@
<image class="icon" src="{{imageUrl}}icon-error.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon-error.png?t={{Timestamp}}"></image>
<view class="r-title">重复图片</view> <view class="r-title">重复图片</view>
</view> </view>
<view class="video-sign" wx:if="{{item.fileType === 3}}">
<image class="icon" src="{{imageUrl}}video-sign.png?t={{Timestamp}}"></image>
</view>
</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"> <view class="upload-file">
<van-icon class="add" name="plus" /> <van-icon class="add" name="plus" />
</view> </view>

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

@ -936,11 +936,34 @@ page {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 12rpx; gap: 12rpx;
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
.photo { .photo {
width: 100%; width: 100%;
height: 128rpx; height: 128rpx;
border-radius: 8rpx; 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 { .remark {
.r-title { .r-title {
@ -1219,11 +1242,34 @@ page {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
gap: 12rpx; gap: 12rpx;
.photo-wrap {
position: relative;
width: 100%;
height: 128rpx;
.photo { .photo {
width: 100%; width: 100%;
height: 128rpx; height: 128rpx;
border-radius: 8rpx; 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 { .remark {
.r-title { .r-title {

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

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

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

@ -366,16 +366,19 @@
</view> </view>
</view> </view>
<view class="photos"> <view class="photos">
<image <view
class="photo" class="photo-wrap"
src="{{item.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{item.url}}"
data-parent="{{detail.caseImages}}"
wx:for="{{detail.caseImages}}" wx:for="{{detail.caseImages}}"
wx:key="url" 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>
<view class="remark" wx:if="{{detail.description}}"> <view class="remark" wx:if="{{detail.description}}">
<view class="r-title">病历备注</view> <view class="r-title">病历备注</view>
@ -481,17 +484,20 @@
</view> </view>
</view> </view>
<view class="photos" wx:if="{{item.feedbackImages.length}}"> <view class="photos" wx:if="{{item.feedbackImages.length}}">
<image <view
class="photo" class="photo-wrap"
src="{{cItem.url}}"
mode="aspectFill"
bind:tap="handleImagePreview"
data-url="{{cItem.url}}"
data-parent="{{item.feedbackImages}}"
wx:for="{{item.feedbackImages}}" wx:for="{{item.feedbackImages}}"
wx:for-item="cItem" wx:for-item="cItem"
wx:key="url" 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>
<view class="files" wx:if="{{item.feedbackFiles.length}}"> <view class="files" wx:if="{{item.feedbackFiles.length}}">
<view class="f-title">补充文件</view> <view class="f-title">补充文件</view>

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

@ -29,7 +29,7 @@ page {
&.required { &.required {
&::before { &::before {
display: inline; display: inline;
content: "*"; content: '*';
color: rgba(255, 87, 51, 1); color: rgba(255, 87, 51, 1);
} }
} }
@ -66,7 +66,7 @@ page {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
z-index: 1; z-index: 3;
color: #fff; color: #fff;
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
@ -98,6 +98,24 @@ page {
color: rgba(237, 79, 57, 1); 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 { .remark {

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

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

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

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

31
src/pages/cases/index.scss

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

17
src/pages/cases/index.wxml

@ -244,17 +244,20 @@
</view> </view>
</view> </view>
<view class="photos" wx:if="{{item.caseImages.length}}"> <view class="photos" wx:if="{{item.caseImages.length}}">
<image <view
class="photo-wrap"
wx:for="{{item.caseImages}}" wx:for="{{item.caseImages}}"
wx:for-item="photoItem" wx:for-item="photoItem"
class="photo" wx:for-index="photoIndex"
mode="aspectFill"
src="{{photoItem.url}}"
catch:tap="handleImagePreview" catch:tap="handleImagePreview"
data-url="{{photoItem.url}}" data-index="{{photoIndex}}"
data-parent="{{item.caseImages}}" 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> </view>
<block wx:if="{{item.caseFeedback.feedbackId}}"> <block wx:if="{{item.caseFeedback.feedbackId}}">
<view class="li-row"> <view class="li-row">

Loading…
Cancel
Save