Browse Source

录入病例

main
kola 6 months ago
parent
commit
1644a35c39
  1. BIN
      .DS_Store
  2. BIN
      src/.DS_Store
  3. 1
      src/components/uploadFile/index.json
  4. 21
      src/components/uploadFile/index.scss
  5. 35
      src/components/uploadFile/index.ts
  6. 10
      src/components/uploadFile/index.wxml
  7. 0
      src/images/audio-left.gif
  8. 0
      src/images/audio-left.png
  9. 0
      src/images/audio-right.gif
  10. 0
      src/images/audio-right.png
  11. 0
      src/images/daub.gif
  12. 0
      src/images/home-bind-doctor-bg.png
  13. 0
      src/images/icon-circle-add.png
  14. BIN
      src/images/icon-file4.png
  15. 0
      src/images/icon-file5.png
  16. 0
      src/images/icon-file6.png
  17. 0
      src/images/icon-file7.png
  18. 0
      src/images/icon-file99.png
  19. 0
      src/images/icon-picture.png
  20. 0
      src/images/icon-video-play.png
  21. 0
      src/images/icon-video.png
  22. 0
      src/images/icon-voice.png
  23. 0
      src/images/wave-white.gif
  24. 23
      src/module1/pages/entryCases/index.scss
  25. 56
      src/module1/pages/entryCases/index.ts
  26. 45
      src/module1/pages/entryCases/index.wxml
  27. 4
      src/pages/cases/index.ts
  28. 1
      typings/index.d.ts

BIN
.DS_Store vendored

Binary file not shown.

BIN
src/.DS_Store vendored

Binary file not shown.

1
src/components/uploadFile/index.json

@ -1,6 +1,7 @@
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-uploader": "@vant/weapp/uploader/index" "van-uploader": "@vant/weapp/uploader/index"
} }
} }

21
src/components/uploadFile/index.scss

@ -7,3 +7,24 @@
outline: none; outline: none;
} }
} }
.popup1 {
position: relative;
width: 580rpx;
height: 590rpx;
box-sizing: border-box;
.bg {
width: 100%;
height: 100%;
}
.sure {
position: absolute;
width: 100%;
bottom: 40rpx;
left: 0;
text-align: center;
font-size: 32rpx;
color: rgba(0, 180, 197, 1);
line-height: 48rpx;
}
}

35
src/components/uploadFile/index.ts

@ -22,12 +22,17 @@ Component({
type: Boolean, type: Boolean,
value: false, value: false,
}, },
edit: {
type: Boolean,
value: false,
},
}, },
/** /**
* *
*/ */
data: { data: {
show1: false,
fileTypeList: { fileTypeList: {
doc: 5, doc: 5,
docx: 5, docx: 5,
@ -36,6 +41,7 @@ Component({
xlsx: 6, xlsx: 6,
ppt: 7, ppt: 7,
}, },
cacheEditParams: {},
}, },
/** /**
@ -50,7 +56,14 @@ Component({
const arr2 = lastString.split("."); // 再以"."作为分隔符 const arr2 = lastString.split("."); // 再以"."作为分隔符
return arr2[arr2.length - 1]; //将后缀名返回出来 return arr2[arr2.length - 1]; //将后缀名返回出来
}, },
handleAfterRead(e) { handleAfterRead(e, editEnd = false) {
if (this.data.edit && !editEnd) {
this.setData({
show1: true,
cacheEditParams: e,
});
return;
}
if (this.data.obscure) { if (this.data.obscure) {
wx.editImage({ wx.editImage({
src: e.detail.file.url || e.detail.file.tempFilePath, src: e.detail.file.url || e.detail.file.tempFilePath,
@ -62,6 +75,11 @@ Component({
this.triggerEvent("file", res as object); this.triggerEvent("file", res as object);
}); });
}, },
fail: () => {
this.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object);
});
},
}); });
} else { } else {
this.uploadFile(e.detail.file).then((res) => { this.uploadFile(e.detail.file).then((res) => {
@ -69,6 +87,12 @@ Component({
}); });
} }
}, },
handleEditEnd() {
this.setData({
show1: false,
});
this.handleAfterRead(this.data.cacheEditParams, true);
},
handleChooseAvatar(e) { handleChooseAvatar(e) {
this.uploadFile({ this.uploadFile({
fileType: "image", fileType: "image",
@ -121,6 +145,7 @@ Component({
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 expandJson = { const expandJson = {
fileId: "", fileId: "",
name: data.data.Url, name: data.data.Url,
@ -129,13 +154,17 @@ Component({
suffix: this.GetExtensionFileName(data.data.Url), suffix: this.GetExtensionFileName(data.data.Url),
type: item.fileType, type: item.fileType,
imgUrl: "", imgUrl: "",
duration: 0,
fileType: this.data.fileTypeList[suffix] || 99,
}; };
if (item.fileType === "image") { if (item.fileType === "image") {
expandJson.imgUrl = data.data.Url; expandJson.imgUrl = data.data.Url;
} } else if (item.fileType === "video") {
if (item.fileType === "video") {
expandJson.imgUrl = data.data.SnapshotUrl; expandJson.imgUrl = data.data.SnapshotUrl;
} else if (item.fileType === "audio") {
expandJson.duration = Number.parseInt(String(item.duration / 1000));
} }
console.log(expandJson);
resolve(expandJson); resolve(expandJson);
}, },
fail() { fail() {

10
src/components/uploadFile/index.wxml

@ -7,3 +7,13 @@
<van-uploader wx:else accept="{{accept}}" max-count="{{1}}" bind:after-read="handleAfterRead"> <van-uploader wx:else accept="{{accept}}" max-count="{{1}}" bind:after-read="handleAfterRead">
<slot></slot> <slot></slot>
</van-uploader> </van-uploader>
<van-popup show="{{ show1 }}" bind:close="onClose" round>
<view class="popup1">
<image class="bg" src="{{imageUrl}}daub.gif?t={{Timestamp}}"></image>
<view class="sure" bind:tap="handleEditEnd">
我知道了 去涂抹
<van-icon name="arrow" />
</view>
</view>
</van-popup>

0
src/images/audio-left.gif

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

0
src/images/audio-left.png

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 985 B

0
src/images/audio-right.gif

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

0
src/images/audio-right.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
src/images/daub.gif

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

0
src/images/home-bind-doctor-bg.png

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

0
src/images/icon-circle-add.png

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/images/icon-file4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
src/images/icon-file1.png → src/images/icon-file5.png

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

0
src/images/icon-file3.png → src/images/icon-file6.png

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
src/images/icon-file2.png → src/images/icon-file7.png

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
src/images/icon-file.png → src/images/icon-file99.png

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
src/images/icon-picture.png

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

0
src/images/icon-video-play.png

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
src/images/icon-video.png

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
src/images/icon-voice.png

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

0
src/images/wave-white.gif

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

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

@ -2,7 +2,7 @@ page {
background-color: rgba(246, 246, 246, 1); background-color: rgba(246, 246, 246, 1);
} }
.page { .page {
padding: 24rpx 32rpx 200rpx; padding: 24rpx 32rpx 300rpx;
.card { .card {
margin-bottom: 24rpx; margin-bottom: 24rpx;
padding: 32rpx; padding: 32rpx;
@ -397,24 +397,3 @@ page {
text-align: center; text-align: center;
} }
} }
.popup3 {
position: relative;
width: 580rpx;
height: 590rpx;
box-sizing: border-box;
.bg {
width: 100%;
height: 100%;
}
.sure {
position: absolute;
width: 100%;
bottom: 40rpx;
left: 0;
text-align: center;
font-size: 32rpx;
color: rgba(0, 180, 197, 1);
line-height: 48rpx;
}
}

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

@ -1,17 +1,47 @@
const _app = getApp<IAppOption>(); const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
show1: false, show1: false,
show2: false, show2: false,
show3: false,
deptList: [] 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: "",
labelIds: [] as any,
},
onLoad() {
app.waitLogin().then(() => {
this.getDoctorDict();
});
},
getDoctorDict() {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/doctor-dict",
data: {},
}).then((res) => {
this.setData({
deptList: res.DoctorSpecialtyLabel,
});
});
},
formatParams() {
const { images, description, audios, files, deptId, labelIds } = this.data;
return {
images: JSON.stringify(images),
description,
audios: JSON.stringify(audios),
files: JSON.stringify(files),
deptId,
labelIds: JSON.stringify(labelIds),
};
}, },
onLoad() {},
handleSubmit() { handleSubmit() {
wx.navigateTo({ wx.navigateTo({
url: "/module1/pages/entryCasesResult/index", url: "/module1/pages/entryCasesResult/index",
@ -61,7 +91,7 @@ Page({
files: [ files: [
...this.data.files, ...this.data.files,
{ {
fileType: 99, fileType: e.detail.fileType,
name: e.detail.name, name: e.detail.name,
url: e.detail.fileUrl, url: e.detail.fileUrl,
size: e.detail.size, size: e.detail.size,
@ -70,6 +100,24 @@ Page({
], ],
}); });
}, },
handleDept(e) {
const { params } = e.currentTarget.dataset;
this.setData({
deptId: params.value,
labelList: params.options,
labelIds: [],
});
},
handleLabel(e) {
const { params } = e.currentTarget.dataset;
const labelIds = this.data.labelIds;
const newLabelId = labelIds.includes(params.value)
? labelIds.filter((item: any) => item !== params.value)
: [...labelIds, ...params.value];
this.setData({
labelIds: newLabelId,
});
},
}); });
export {}; export {};

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

@ -1,3 +1,4 @@
<wxs src="/utils/util.wxs" module="tools" />
<view class="page"> <view class="page">
<view class="card"> <view class="card">
<view class="card-title required"> <view class="card-title required">
@ -15,7 +16,7 @@
<view class="r-title">重复图片</view> <view class="r-title">重复图片</view>
</view> --> </view> -->
</view> </view>
<uploadFile obscure bind:file="handlePhoto"> <uploadFile obscure edit bind:file="handlePhoto">
<view class="upload-file"> <view class="upload-file">
<van-icon class="add" name="plus" /> <van-icon class="add" name="plus" />
</view> </view>
@ -45,7 +46,7 @@
bind:tap="handleDelAudio" bind:tap="handleDelAudio"
data-index="{{index}}" data-index="{{index}}"
></image> ></image>
<view class="trans">转文字</view> <!-- <view class="trans">转文字</view> -->
</view> </view>
</view> </view>
</view> </view>
@ -62,9 +63,9 @@
</uploadFile> </uploadFile>
</view> </view>
<view class="file-list" wx:if="{{files.length}}"> <view class="file-list" wx:if="{{files.length}}">
<view class="fl-row" wx:for="{{files}}"> <view class="fl-row" wx:for="{{files}}" wx:key="name">
<view class="wrap"> <view class="wrap">
<image class="icon" src="{{imageUrl}}icon-file.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon-file{{item.fileType}}.png?t={{Timestamp}}"></image>
<view class="name">{{item.name}}</view> <view class="name">{{item.name}}</view>
</view> </view>
<view class="option"> <view class="option">
@ -83,14 +84,26 @@
<view class="label">标签</view> <view class="label">标签</view>
<view class="wrap"> <view class="wrap">
<view class="tag-wrap"> <view class="tag-wrap">
<view class="tag">消化科</view> <view
<view class="tag">消化科</view> class="tag {{deptId === item.value && 'active'}}"
wx:for="{{deptList}}"
wx:key="value"
bind:tap="handleDept"
data-params="{{item}}"
>
{{item.label}}
</view>
</view>
<view class="sub-tag-wrap" wx:if="{{labelList.length}}">
<view
class="sub-tag {{tools.include(item.value,labelIds) && 'active'}}"
wx:for="{{labelList}}"
wx:key="value"
data-params="{{item}}"
bind:tap="handleLabel"
>
{{item.label}}
</view> </view>
<view class="sub-tag-wrap">
<view class="sub-tag active">心衰</view>
<view class="sub-tag">心衰</view>
<view class="sub-tag">心衰</view>
<view class="sub-tag">心衰</view>
</view> </view>
</view> </view>
</view> </view>
@ -122,13 +135,3 @@
<view class="cancel">返回</view> <view class="cancel">返回</view>
</view> </view>
</van-popup> </van-popup>
<van-popup show="{{ show3 }}" bind:close="onClose" round>
<view class="popup3">
<image class="bg" src="{{imageUrl}}daub.gif?t={{Timestamp}}"></image>
<view class="sure">
我知道了 去涂抹
<van-icon name="arrow" />
</view>
</view>
</van-popup>

4
src/pages/cases/index.ts

@ -307,11 +307,11 @@ Page({
handleLabel(e) { handleLabel(e) {
const { params } = e.currentTarget.dataset; const { params } = e.currentTarget.dataset;
const labelId = this.data.labelId; const labelId = this.data.labelId;
const newDeptId = 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];
this.setData({ this.setData({
labelId: newDeptId, labelId: newLabelId,
}); });
}, },
handleTagSubmit() { handleTagSubmit() {

1
typings/index.d.ts vendored

@ -25,6 +25,7 @@ interface IAgaxParams extends WechatMiniprogram.RequestOption {
declare namespace WechatMiniprogram { declare namespace WechatMiniprogram {
export interface Wx { export interface Wx {
ajax: (arg0: IAgaxParams) => Promise<any>; ajax: (arg0: IAgaxParams) => Promise<any>;
editImage: any;
} }
} }

Loading…
Cancel
Save