diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6598fb7 Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store index 42d6340..5c63566 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/components/uploadFile/index.json b/src/components/uploadFile/index.json index c7967a3..5625d07 100644 --- a/src/components/uploadFile/index.json +++ b/src/components/uploadFile/index.json @@ -1,6 +1,7 @@ { "component": true, "usingComponents": { + "van-popup": "@vant/weapp/popup/index", "van-uploader": "@vant/weapp/uploader/index" } } diff --git a/src/components/uploadFile/index.scss b/src/components/uploadFile/index.scss index 14fd646..d70d62d 100644 --- a/src/components/uploadFile/index.scss +++ b/src/components/uploadFile/index.scss @@ -7,3 +7,24 @@ 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; + } +} diff --git a/src/components/uploadFile/index.ts b/src/components/uploadFile/index.ts index b5fbdd1..6e75f06 100644 --- a/src/components/uploadFile/index.ts +++ b/src/components/uploadFile/index.ts @@ -22,12 +22,17 @@ Component({ type: Boolean, value: false, }, + edit: { + type: Boolean, + value: false, + }, }, /** * 组件的初始数据 */ data: { + show1: false, fileTypeList: { doc: 5, docx: 5, @@ -36,6 +41,7 @@ Component({ xlsx: 6, ppt: 7, }, + cacheEditParams: {}, }, /** @@ -50,7 +56,14 @@ Component({ const arr2 = lastString.split("."); // 再以"."作为分隔符 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) { wx.editImage({ src: e.detail.file.url || e.detail.file.tempFilePath, @@ -62,6 +75,11 @@ Component({ this.triggerEvent("file", res as object); }); }, + fail: () => { + this.uploadFile(e.detail.file).then((res) => { + this.triggerEvent("file", res as object); + }); + }, }); } else { 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) { this.uploadFile({ fileType: "image", @@ -121,6 +145,7 @@ Component({ success: (res) => { wx.hideLoading(); const data = JSON.parse(res.data); + const suffix = this.GetExtensionFileName(data.data.Url); const expandJson = { fileId: "", name: data.data.Url, @@ -129,13 +154,17 @@ Component({ suffix: this.GetExtensionFileName(data.data.Url), type: item.fileType, imgUrl: "", + duration: 0, + fileType: this.data.fileTypeList[suffix] || 99, }; if (item.fileType === "image") { expandJson.imgUrl = data.data.Url; - } - if (item.fileType === "video") { + } else if (item.fileType === "video") { expandJson.imgUrl = data.data.SnapshotUrl; + } else if (item.fileType === "audio") { + expandJson.duration = Number.parseInt(String(item.duration / 1000)); } + console.log(expandJson); resolve(expandJson); }, fail() { diff --git a/src/components/uploadFile/index.wxml b/src/components/uploadFile/index.wxml index 4fcc942..2ed103b 100644 --- a/src/components/uploadFile/index.wxml +++ b/src/components/uploadFile/index.wxml @@ -7,3 +7,13 @@ + + + + + + 我知道了 去涂抹 + + + + diff --git a/src/images/audio-left.gif b/src/images/audio-left.gif old mode 100644 new mode 100755 diff --git a/src/images/audio-left.png b/src/images/audio-left.png old mode 100644 new mode 100755 diff --git a/src/images/audio-right.gif b/src/images/audio-right.gif old mode 100644 new mode 100755 diff --git a/src/images/audio-right.png b/src/images/audio-right.png old mode 100644 new mode 100755 diff --git a/src/images/daub.gif b/src/images/daub.gif old mode 100644 new mode 100755 diff --git a/src/images/home-bind-doctor-bg.png b/src/images/home-bind-doctor-bg.png old mode 100644 new mode 100755 diff --git a/src/images/icon-circle-add.png b/src/images/icon-circle-add.png old mode 100644 new mode 100755 diff --git a/src/images/icon-file4.png b/src/images/icon-file4.png index 0511511..6b4a6c3 100644 Binary files a/src/images/icon-file4.png and b/src/images/icon-file4.png differ diff --git a/src/images/icon-file1.png b/src/images/icon-file5.png similarity index 100% rename from src/images/icon-file1.png rename to src/images/icon-file5.png diff --git a/src/images/icon-file3.png b/src/images/icon-file6.png similarity index 100% rename from src/images/icon-file3.png rename to src/images/icon-file6.png diff --git a/src/images/icon-file2.png b/src/images/icon-file7.png similarity index 100% rename from src/images/icon-file2.png rename to src/images/icon-file7.png diff --git a/src/images/icon-file.png b/src/images/icon-file99.png similarity index 100% rename from src/images/icon-file.png rename to src/images/icon-file99.png diff --git a/src/images/icon-picture.png b/src/images/icon-picture.png old mode 100644 new mode 100755 diff --git a/src/images/icon-video-play.png b/src/images/icon-video-play.png old mode 100644 new mode 100755 diff --git a/src/images/icon-video.png b/src/images/icon-video.png old mode 100644 new mode 100755 diff --git a/src/images/icon-voice.png b/src/images/icon-voice.png old mode 100644 new mode 100755 diff --git a/src/images/wave-white.gif b/src/images/wave-white.gif old mode 100644 new mode 100755 diff --git a/src/module1/pages/entryCases/index.scss b/src/module1/pages/entryCases/index.scss index 9774595..ec5435a 100644 --- a/src/module1/pages/entryCases/index.scss +++ b/src/module1/pages/entryCases/index.scss @@ -2,7 +2,7 @@ page { background-color: rgba(246, 246, 246, 1); } .page { - padding: 24rpx 32rpx 200rpx; + padding: 24rpx 32rpx 300rpx; .card { margin-bottom: 24rpx; padding: 32rpx; @@ -397,24 +397,3 @@ page { 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; - } -} diff --git a/src/module1/pages/entryCases/index.ts b/src/module1/pages/entryCases/index.ts index 0ea6a64..7cf62cc 100644 --- a/src/module1/pages/entryCases/index.ts +++ b/src/module1/pages/entryCases/index.ts @@ -1,17 +1,47 @@ -const _app = getApp(); +const app = getApp(); Page({ data: { show1: false, show2: false, - show3: false, + + deptList: [] as any, + labelList: [] as any, images: [] as any, description: "", audios: [] 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() { wx.navigateTo({ url: "/module1/pages/entryCasesResult/index", @@ -61,7 +91,7 @@ Page({ files: [ ...this.data.files, { - fileType: 99, + fileType: e.detail.fileType, name: e.detail.name, url: e.detail.fileUrl, 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 {}; diff --git a/src/module1/pages/entryCases/index.wxml b/src/module1/pages/entryCases/index.wxml index ee0b10e..1b00512 100644 --- a/src/module1/pages/entryCases/index.wxml +++ b/src/module1/pages/entryCases/index.wxml @@ -1,3 +1,4 @@ + @@ -15,7 +16,7 @@ 重复图片 --> - + @@ -45,7 +46,7 @@ bind:tap="handleDelAudio" data-index="{{index}}" > - 转文字 + @@ -62,9 +63,9 @@ - + - + {{item.name}} @@ -83,14 +84,26 @@ 标签 - 消化科 - 消化科 + + {{item.label}} + - - 心衰 - 心衰 - 心衰 - 心衰 + + + {{item.label}} + @@ -122,13 +135,3 @@ 返回 - - - - - - 我知道了 去涂抹 - - - - diff --git a/src/pages/cases/index.ts b/src/pages/cases/index.ts index a00fb32..5e9cd2f 100644 --- a/src/pages/cases/index.ts +++ b/src/pages/cases/index.ts @@ -307,11 +307,11 @@ Page({ handleLabel(e) { const { params } = e.currentTarget.dataset; const labelId = this.data.labelId; - const newDeptId = labelId.includes(params.value) + const newLabelId = labelId.includes(params.value) ? labelId.filter((item) => item !== params.value) : [...labelId, ...params.value]; this.setData({ - labelId: newDeptId, + labelId: newLabelId, }); }, handleTagSubmit() { diff --git a/typings/index.d.ts b/typings/index.d.ts index 08f5883..aceb8c6 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -25,6 +25,7 @@ interface IAgaxParams extends WechatMiniprogram.RequestOption { declare namespace WechatMiniprogram { export interface Wx { ajax: (arg0: IAgaxParams) => Promise; + editImage: any; } }