Browse Source

小程序联调

main
kola-web 4 months ago
parent
commit
1484c95117
  1. 1
      2024-10-31.md
  2. 5
      dist.nu
  3. 2
      package.json
  4. 58
      pnpm-lock.yaml
  5. 3
      project.private.config.json
  6. 2
      src/components/customAudioBar/index.wxml
  7. 144
      src/components/customRecord/index.ts
  8. 25
      src/components/uploadFile/index.ts
  9. 2
      src/components/uploadFile/index.wxml
  10. BIN
      src/images/empty-3.png
  11. BIN
      src/images/empty-4.png
  12. BIN
      src/images/empty-5.png
  13. BIN
      src/images/new.png
  14. BIN
      src/images/none_1.png
  15. BIN
      src/images/user.png
  16. 55
      src/module1/pages/entryCases/index.ts
  17. 23
      src/module1/pages/entryCases/index.wxml
  18. 6
      src/module1/pages/loginProtool/index.scss
  19. 7
      src/module1/pages/loginProtool/index.ts
  20. 2
      src/module1/pages/sHostipal/index.wxml
  21. 20
      src/module1/pages/setInfo/index.scss
  22. 19
      src/module1/pages/setInfo/index.ts
  23. 3
      src/module1/pages/setInfo/index.wxml
  24. 3
      src/module1/pages/setInfoResult/index.ts
  25. 9
      src/module1/pages/setInfoResult/index.wxml
  26. 4
      src/pages/cases/index.json
  27. 39
      src/pages/cases/index.scss
  28. 378
      src/pages/cases/index.ts
  29. 318
      src/pages/cases/index.wxml
  30. 38
      src/utils/component.ts
  31. 12
      src/utils/util.wxs

1
2024-10-31.md

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

5
dist.nu

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
cd ./src/images/
svn add . --no-ignore --force
svn ci -m "版本更新"
cd ..
cd ..

2
package.json

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
"@antfu/eslint-config": "^3.7.3",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"miniprogram-api-typings": "^2.8.3-1",
"miniprogram-api-typings": "^4.0.1",
"prettier": "^3.3.3"
}
}

58
pnpm-lock.yaml

@ -31,8 +31,8 @@ importers: @@ -31,8 +31,8 @@ importers:
specifier: ^9.1.0
version: 9.1.0(eslint@9.12.0)
miniprogram-api-typings:
specifier: ^2.8.3-1
version: 2.12.0
specifier: ^4.0.1
version: 4.0.1
prettier:
specifier: ^3.3.3
version: 3.3.3
@ -95,25 +95,29 @@ packages: @@ -95,25 +95,29 @@ packages:
resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==}
engines: {node: '>=6.9.0'}
'@babel/helper-string-parser@7.25.7':
resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==}
'@babel/helper-string-parser@7.25.9':
resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==}
engines: {node: '>=6.9.0'}
'@babel/helper-validator-identifier@7.25.7':
resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==}
engines: {node: '>=6.9.0'}
'@babel/helper-validator-identifier@7.25.9':
resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==}
engines: {node: '>=6.9.0'}
'@babel/highlight@7.25.7':
resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==}
engines: {node: '>=6.9.0'}
'@babel/parser@7.25.8':
resolution: {integrity: sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==}
'@babel/parser@7.26.2':
resolution: {integrity: sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==}
engines: {node: '>=6.0.0'}
hasBin: true
'@babel/types@7.25.8':
resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==}
'@babel/types@7.26.0':
resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==}
engines: {node: '>=6.9.0'}
'@clack/core@0.3.4':
@ -1071,8 +1075,8 @@ packages: @@ -1071,8 +1075,8 @@ packages:
resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
engines: {node: '>=16 || 14 >=14.17'}
miniprogram-api-typings@2.12.0:
resolution: {integrity: sha512-ibvbqeslVFur0IAvTxLMvsbtvVcMo6gwvOnj0YZHV7aeDLu091VQRrETT2QuiG9P6aZWRcxeNGJChRKVPCp9VQ==}
miniprogram-api-typings@4.0.1:
resolution: {integrity: sha512-Ok4SSNCYnNLgbAhHCpIeqx6XICZ3aUxZ2iQDExmwKEinWaQQFzzxobK5JP9skrEOWn9PoKodjw4iUdF8Um0i/A==}
miniprogram-licia@1.43.0:
resolution: {integrity: sha512-NTQxO0LaoIv66I7civEqyUwtF36My7S0TwGyvMAFUpUqGXcQZsM9Ng2OWwHaBvlqdjjPHSacTMH3XqGpnieEow==}
@ -1163,6 +1167,9 @@ packages: @@ -1163,6 +1167,9 @@ packages:
picocolors@1.1.0:
resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==}
picocolors@1.1.1:
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
@ -1343,10 +1350,6 @@ packages: @@ -1343,10 +1350,6 @@ packages:
tinyexec@0.3.0:
resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==}
to-fast-properties@2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
@ -1526,10 +1529,12 @@ snapshots: @@ -1526,10 +1529,12 @@ snapshots:
'@babel/highlight': 7.25.7
picocolors: 1.1.0
'@babel/helper-string-parser@7.25.7': {}
'@babel/helper-string-parser@7.25.9': {}
'@babel/helper-validator-identifier@7.25.7': {}
'@babel/helper-validator-identifier@7.25.9': {}
'@babel/highlight@7.25.7':
dependencies:
'@babel/helper-validator-identifier': 7.25.7
@ -1537,15 +1542,14 @@ snapshots: @@ -1537,15 +1542,14 @@ snapshots:
js-tokens: 4.0.0
picocolors: 1.1.0
'@babel/parser@7.25.8':
'@babel/parser@7.26.2':
dependencies:
'@babel/types': 7.25.8
'@babel/types': 7.26.0
'@babel/types@7.25.8':
'@babel/types@7.26.0':
dependencies:
'@babel/helper-string-parser': 7.25.7
'@babel/helper-validator-identifier': 7.25.7
to-fast-properties: 2.0.0
'@babel/helper-string-parser': 7.25.9
'@babel/helper-validator-identifier': 7.25.9
'@clack/core@0.3.4':
dependencies:
@ -1777,7 +1781,7 @@ snapshots: @@ -1777,7 +1781,7 @@ snapshots:
'@vue/compiler-core@3.5.12':
dependencies:
'@babel/parser': 7.25.8
'@babel/parser': 7.26.2
'@vue/shared': 3.5.12
entities: 4.5.0
estree-walker: 2.0.2
@ -1790,7 +1794,7 @@ snapshots: @@ -1790,7 +1794,7 @@ snapshots:
'@vue/compiler-sfc@3.5.12':
dependencies:
'@babel/parser': 7.25.8
'@babel/parser': 7.26.2
'@vue/compiler-core': 3.5.12
'@vue/compiler-dom': 3.5.12
'@vue/compiler-ssr': 3.5.12
@ -2737,7 +2741,7 @@ snapshots: @@ -2737,7 +2741,7 @@ snapshots:
dependencies:
brace-expansion: 2.0.1
miniprogram-api-typings@2.12.0: {}
miniprogram-api-typings@4.0.1: {}
miniprogram-licia@1.43.0: {}
@ -2826,6 +2830,8 @@ snapshots: @@ -2826,6 +2830,8 @@ snapshots:
picocolors@1.1.0: {}
picocolors@1.1.1: {}
picomatch@2.3.1: {}
picomatch@4.0.2: {}
@ -2846,7 +2852,7 @@ snapshots: @@ -2846,7 +2852,7 @@ snapshots:
postcss@8.4.47:
dependencies:
nanoid: 3.3.7
picocolors: 1.1.0
picocolors: 1.1.1
source-map-js: 1.2.1
prelude-ls@1.2.1: {}
@ -2987,8 +2993,6 @@ snapshots: @@ -2987,8 +2993,6 @@ snapshots:
tinyexec@0.3.0: {}
to-fast-properties@2.0.0: {}
to-regex-range@5.0.1:
dependencies:
is-number: 7.0.0

3
project.private.config.json

@ -199,5 +199,6 @@ @@ -199,5 +199,6 @@
}
]
}
}
},
"libVersion": "3.6.3"
}

2
src/components/customAudioBar/index.wxml

@ -9,5 +9,5 @@ @@ -9,5 +9,5 @@
<image wx:else class="wave" src="{{imageUrl}}wave.png?t={{Timestamp}}"></image>
</view>
</view>
<view class="time">45”</view>
<view class="time">{{time}}”</view>
</view>

144
src/components/customRecord/index.ts

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
import { isQualifiedName } from 'typescript'
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>();
// pages/story/a.ts
Component({
@ -21,11 +19,11 @@ Component({ @@ -21,11 +19,11 @@ Component({
lifetimes: {
attached() {
const recorderManager = wx.getRecorderManager()
const recorderManager = wx.getRecorderManager();
this.setData({
recorderManager,
})
this.recorderManagerListen(recorderManager)
});
this.recorderManagerListen(recorderManager);
},
},
/**
@ -36,90 +34,154 @@ Component({ @@ -36,90 +34,154 @@ Component({
this.checkRecordPermission(() => {
this.setData({
startShow: true,
})
})
});
});
},
handleShow() {
const { recorderManager } = this.data
const { recorderManager } = this.data;
this.setData({
show: true,
})
});
recorderManager?.start({
format: 'mp3',
})
format: "mp3",
});
},
handleHide() {
const { recorderManager } = this.data
recorderManager?.stop()
const { recorderManager } = this.data;
recorderManager?.stop();
this.setData({
startShow: false,
show: false,
})
});
},
recorderManagerListen(recorderManager: WechatMiniprogram.RecorderManager) {
recorderManager.onError(() => {
wx.showToast({
title: '录音失败',
icon: 'none',
})
})
title: "录音失败",
icon: "none",
});
});
recorderManager.onStart(() => {
this.handleTiem()
})
this.handleTiem();
});
recorderManager.onStop((res) => {
this.handleHide()
console.log(res)
})
this.handleHide();
this.uploadFile({
fileType: "audio",
tempFilePath: res.tempFilePath,
size: res.fileSize,
duration: res.duration,
}).then((res) => {
this.triggerEvent("file", res as object);
});
});
},
checkRecordPermission(callback: () => void) {
wx.getSetting({
success(res) {
if (!res.authSetting['scope.record']) {
if (!res.authSetting["scope.record"]) {
wx.authorize({
scope: 'scope.record',
scope: "scope.record",
success() {
// 用户已同意授权
},
fail() {
// 用户拒绝了授权
wx.showModal({
title: '提示',
content: '需要获取录音权限,请点击确定进入设置页面进行授权。',
title: "提示",
content: "需要获取录音权限,请点击确定进入设置页面进行授权。",
showCancel: false,
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
// 用户在设置页面设置了录音权限
if (res.authSetting['scope.record']) {
if (res.authSetting["scope.record"]) {
// 用户在设置页面设置了录音权限
} else {
// 用户在设置页面未设置录音权限
}
},
})
});
}
},
})
});
},
})
});
} else {
// 已经有录音权限
callback()
callback();
}
},
})
});
},
handleTiem() {
const time = setTimeout(() => {
clearInterval(time)
if (!this.data.show) return
clearInterval(time);
if (!this.data.show) return;
this.setData({
time: this.data.time + 1,
})
console.log(this.data.time)
this.handleTiem()
}, 1000)
});
this.handleTiem();
}, 1000);
},
uploadFile(item) {
wx.showLoading({
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") {
url += "video";
} else if (item.fileType === "audio") {
url += "audio";
} else {
url += "doc";
}
wx.uploadFile({
filePath: item.tempFilePath,
name: "file",
url,
success: (res) => {
wx.hideLoading();
const data = JSON.parse(res.data);
const expandJson = {
fileId: "",
name: data.data.Url,
size: (item.size / 1024).toFixed(2),
fileUrl: data.data.Url,
suffix: this.GetExtensionFileName(data.data.Url),
type: item.fileType,
imgUrl: "",
duration: "",
};
if (item.fileType === "image") {
expandJson.imgUrl = data.data.Url;
}
if (item.fileType === "video") {
expandJson.imgUrl = data.data.SnapshotUrl;
}
if (item.fileType === "audio") {
expandJson.duration = item.duration;
}
resolve(expandJson);
},
fail() {
wx.hideLoading();
reject(new Error("上传失败"));
},
});
});
},
GetExtensionFileName(pathfilename) {
const reg = /(\\+)/g;
const pString = pathfilename.replace(reg, "#"); //用正则表达式来将\或\\替换成#
const arr = pString.split("#"); // 以“#”为分隔符,将字符分解为数组 例如 D Program Files bg.png
const lastString = arr[arr.length - 1]; //取最后一个字符
const arr2 = lastString.split("."); // 再以"."作为分隔符
return arr2[arr2.length - 1]; //将后缀名返回出来
},
},
})
});

25
src/components/uploadFile/index.ts

@ -10,6 +10,14 @@ Component({ @@ -10,6 +10,14 @@ Component({
type: Boolean,
value: false,
},
accept: {
type: String,
value: "image",
},
obscure: {
type: Boolean,
value: false,
},
},
/**
@ -30,9 +38,20 @@ Component({ @@ -30,9 +38,20 @@ Component({
return arr2[arr2.length - 1]; //将后缀名返回出来
},
handleAfterRead(e) {
this.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object);
});
if (this.data.obscure) {
wx.editImage({
src: e.detail.file.url || e.detail.file.tempFilePath,
success: (res:any) => {
this.uploadFile(res.detail.file).then((res) => {
this.triggerEvent("file", res as object);
});
},
});
} else {
this.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object);
});
}
},
handleChooseAvatar(e) {
this.uploadFile({

2
src/components/uploadFile/index.wxml

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
<button class="button" wx:if="{{chooseAvatar}}" open-type="chooseAvatar" bindchooseavatar="handleChooseAvatar">
<slot></slot>
</button>
<van-uploader wx:else max-count="{{1}}" bind:after-read="handleAfterRead">
<van-uploader wx:else accept="{{accept}}" max-count="{{1}}" bind:after-read="handleAfterRead">
<slot></slot>
</van-uploader>

BIN
src/images/empty-3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

BIN
src/images/empty-4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
src/images/empty-5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
src/images/new.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

BIN
src/images/none_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

BIN
src/images/user.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

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

@ -1,29 +1,66 @@ @@ -1,29 +1,66 @@
const _app = getApp<IAppOption>()
const _app = getApp<IAppOption>();
Page({
data: {
show1: false,
show2: false,
show3: false,
images: [] as any,
description: "",
audios: [] as any,
},
onLoad() {},
handleChooseFile() {
wx.chooseMessageFile({
count: 1,
success(res) {
console.log(res)
console.log(res);
},
fail() {
wx.showToast({
icon: 'none',
title: '取消选择',
})
icon: "none",
title: "取消选择",
});
},
})
});
},
handleSubmit() {
wx.navigateTo({
url: '/module1/pages/entryCasesResult/index',
})
url: "/module1/pages/entryCasesResult/index",
});
},
handlePhoto(e) {
const detail = e.detail;
const images = this.data.images;
this.setData({
images: [
...images,
{
name: detail.name,
url: detail.fileUrl,
isRepeat: 2,
},
],
});
},
handleDelPhoto(e) {
const { index } = e.currentTarget.dataset;
this.setData({
images: this.data.images.filter((_, i) => i !== Number(index)),
});
},
handleAudio(e) {
this.setData({
audios: [
...this.data.audios,
{
name: e.detail.name,
url: e.detail.fileUrl,
duration: e.detail.duration,
isRepeat: 2,
},
],
});
},
})
});

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

@ -5,21 +5,17 @@ @@ -5,21 +5,17 @@
<text class="limit">(0/9)</text>
</view>
<view class="image-files">
<view class="photo">
<image
class="p-img"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
mode="aspectFill"
></image>
<view class="del">
<view class="photo" wx:for="{{images}}" wx:key="index">
<image class="p-img" src="{{item.url}}" mode="aspectFill"></image>
<view class="del" bind:tap="handleDelPhoto" data-index="{{index}}">
<van-icon name="cross" />
</view>
<view class="repeat">
<!-- <view class="repeat">
<image class="icon" src="{{imageUrl}}icon-error.png?t={{Timestamp}}"></image>
<view class="r-title">重复图片</view>
</view>
</view> -->
</view>
<uploadFile>
<uploadFile obscure bind:file="handlePhoto">
<view class="upload-file">
<van-icon class="add" name="plus" />
</view>
@ -31,6 +27,7 @@ @@ -31,6 +27,7 @@
<view class="remark">
<textarea
class="textarea"
model:value="{{description}}"
placeholder-style="color:rgba(205, 205, 205, 1);"
placeholder="请输入您的病历备注"
auto-height
@ -39,8 +36,8 @@ @@ -39,8 +36,8 @@
<view class="limit">0/3000</view>
</view>
<view class="audio-list">
<view class="row">
<customAudioBar class="audio-bar"></customAudioBar>
<view class="row" wx:for="{{audios}}" wx:key="index">
<customAudioBar class="audio-bar" url="{{item.url}}" time="{{item.duration}}"></customAudioBar>
<view class="options">
<image class="del" src="{{imageUrl}}icon-del.png?t={{Timestamp}}"></image>
<view class="trans">转文字</view>
@ -48,7 +45,7 @@ @@ -48,7 +45,7 @@
</view>
</view>
<view class="record">
<customRecord class="record-btn"></customRecord>
<customRecord class="record-btn" bind:file="handleAudio"></customRecord>
<view class="r-title">您也可以长按录入语音</view>
</view>
</view>

6
src/module1/pages/loginProtool/index.scss

@ -31,13 +31,13 @@ @@ -31,13 +31,13 @@
box-shadow: 0 -10rpx 20rpx #ccc;
.cancel {
flex: 1;
height: 88rpx;
height: 84rpx;
text-align: center;
line-height: 88rpx;
line-height: 84rpx;
font-size: 32rpx;
color: rgba(1, 180, 197, 1);
border-radius: 96rpx 96rpx 96rpx 96rpx;
border: 1rpx solid #01b4c5;
border: 1px solid #01b4c5;
}
.sure {
flex: 1;

7
src/module1/pages/loginProtool/index.ts

@ -12,6 +12,11 @@ Page({ @@ -12,6 +12,11 @@ Page({
}
},
handleCancel() {
const pages = getCurrentPages(); //获取当前页面js里面的pages里的所有信息。
const prevPage = pages[pages.length - 2];
prevPage.setData({
protool: false,
});
wx.navigateBack();
},
handleOk() {
@ -20,7 +25,7 @@ Page({ @@ -20,7 +25,7 @@ Page({
prevPage.setData({
protool: true,
});
this.handleCancel();
wx.navigateBack();
},
});

2
src/module1/pages/sHostipal/index.wxml

@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
{{item.CityName}}{{item.CountyName}}{{item.Address}}
</view>
</view>
<view class="empty" wx:if="{{(search || ProvinceId ) && pagination.count===0}}">
<view class="empty" wx:if="{{(search || ProvinceId ) && pagination.count==0}}">
<image class="e-img" src="{{imageUrl}}empty-1.png?t={{Timestamp}}"></image>
<view class="e-tip">没有找到您搜索的医院哦!</view>
<view class="e-submit" bind:tap="handlePushDoctor">提交新医院</view>

20
src/module1/pages/setInfo/index.scss

@ -20,12 +20,16 @@ @@ -20,12 +20,16 @@
.row {
padding: 32rpx 0;
display: flex;
align-items: top;
border-bottom: 1px solid rgba(224, 224, 224, 0.5);
line-height: 1;
.label {
padding-right: 10rpx;
flex-shrink: 0;
width: 5.5rem;
font-size: 32rpx;
color: rgba(133, 133, 133, 1);
line-height: 1;
&.required {
position: relative;
display: flex;
@ -50,6 +54,8 @@ @@ -50,6 +54,8 @@
.content {
flex: 1;
.input {
padding: 0;
line-height: 1;
font-size: 32rpx;
color: #000;
}
@ -126,7 +132,7 @@ @@ -126,7 +132,7 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 20rpx;
gap: 20rpx 10rpx;
.upload {
padding: 16rpx;
background: #f6f6f6;
@ -172,18 +178,8 @@ @@ -172,18 +178,8 @@
justify-content: space-between;
background-color: #fff;
box-shadow: 0 -10rpx 20rpx rgba(0, 0, 0, 0.1);
.cancel {
width: 332rpx;
height: 84rpx;
text-align: center;
line-height: 88rpx;
font-size: 32rpx;
color: rgba(1, 180, 197, 1);
border-radius: 96rpx 96rpx 96rpx 96rpx;
border: 1rpx solid #01b4c5;
}
.submit {
width: 330rpx;
flex: 1;
height: 88rpx;
text-align: center;
line-height: 88rpx;

19
src/module1/pages/setInfo/index.ts

@ -4,7 +4,7 @@ Page({ @@ -4,7 +4,7 @@ Page({
data: {
applyDoctorInfo: null,
applyHostipalInfo: null,
invite: false,
inviteName: "",
DoctorLevel: {},
DoctorTitleType: {},
@ -30,6 +30,10 @@ Page({ @@ -30,6 +30,10 @@ Page({
this.getApplyDoctor();
this.getLoastApplyHostipal();
this.getDoctorDict();
const doctorId = app.globalData.scene?.doctorId;
if (doctorId) {
this.getDoctorInfo(doctorId);
}
});
},
getApplyDoctor() {
@ -55,6 +59,19 @@ Page({ @@ -55,6 +59,19 @@ Page({
}
});
},
getDoctorInfo(dId) {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/doctor-info",
data: {
DoctorId: dId,
},
}).then((res) => {
this.setData({
inviteName: res.Name,
});
});
},
getLoastApplyHostipal() {
wx.ajax({
method: "GET",

3
src/module1/pages/setInfo/index.wxml

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
style="background: url({{imageUrl}}set-info-bg.png?r={{Timestamp}}) no-repeat top center/100% 356rpx;"
>
<view class="container">
<view class="invite" wx:if="{{invite}}">刘玉医生为您的邀约医生</view>
<view class="invite" wx:if="{{inviteName}}">{{inviteName}}医生为您的邀约医生</view>
<view class="card">
<view class="row">
<view class="label required">您的姓名</view>
@ -97,7 +97,6 @@ @@ -97,7 +97,6 @@
</view>
</view>
<view class="footer">
<view class="cancel">取消</view>
<view class="submit" bind:tap="handleSubmit">提交</view>
</view>
</view>

3
src/module1/pages/setInfoResult/index.ts

@ -7,12 +7,11 @@ Page({ @@ -7,12 +7,11 @@ Page({
codeUrl: "",
},
onLoad(options) {
console.log("DEBUGPRINT[6]: index.ts:9: options=", options)
app.waitLogin(true).then(() => {
const { url, loginState } = app.globalData;
this.setData({
isFollow: Number(options.isf),
InviteDoctorName: options.iname,
InviteDoctorName: options.iname === "null" ? "" : options.iname,
codeUrl: `${url}?r=takeda/common/get-channel-wx-code&ChannelType=2&loginState=${loginState}`,
});
if (!options.iname) {

9
src/module1/pages/setInfoResult/index.wxml

@ -2,17 +2,18 @@ @@ -2,17 +2,18 @@
class="page"
style="background: url({{imageUrl}}invite-bg.png?r={{Timestamp}}) no-repeat top right/832rpx 1714rpx;padding-top:{{menuButtonInfo.bottom}}px;"
>
<image class="p-title" src="{{imageUrl}}set-info-result-title.png?r={{Timestamp}}"></image>
<view class="container">
<image class="result" src="{{imageUrl}}c-doctor-result.png?t={{Timestamp}}"></image>
<view class="title">医院信息提交成功</view>
<image class="result" src="{{imageUrl}}c-doctor-result.png?r={{Timestamp}}"></image>
<view class="title">提交成功</view>
<view class="notice">
<view wx:if="{{InviteDoctorName}}">
已将信息提交给
<text class="link">{{InviteDoctorName}}医生</text>
<text class="link">王大志医生</text>
</view>
审核通过后,您可进入罕心守护项目
</view>
<image class="code" src="{{codeUrl}}" show-menu-by-longpress></image>
<image class="code" show-menu-by-longpress src="{{codeUrl}}"></image>
<view class="tip">
<view>扫码关注公众号</view>
<view>获取审核通知</view>

4
src/pages/cases/index.json

@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
"navigationStyle": "default",
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-popup": "@vant/weapp/popup/index"
"van-popup": "@vant/weapp/popup/index",
"pagination": "/components/pagination/index",
"van-cascader": "@vant/weapp/cascader/index"
}
}

39
src/pages/cases/index.scss

@ -28,7 +28,7 @@ page { @@ -28,7 +28,7 @@ page {
width: 48rpx;
height: 8rpx;
border-radius: 8rpx 8rpx 0 0;
content: '';
content: "";
background-color: rgba(0, 180, 197, 1);
}
}
@ -56,10 +56,16 @@ page { @@ -56,10 +56,16 @@ page {
}
}
.form {
margin: 32rpx 32rpx 0;
margin: 32rpx 32rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 18rpx 28rpx;
overflow: hidden;
max-height: 400rpx;
&.fold {
max-height: 0;
margin: 0;
}
.row {
display: flex;
align-items: center;
@ -90,6 +96,20 @@ page { @@ -90,6 +96,20 @@ page {
text-overflow: ellipsis;
}
}
.range {
display: flex;
align-items: center;
.date {
flex: 1;
.date-content {
text-align: center;
width: 3em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
.station {
@ -157,7 +177,7 @@ page { @@ -157,7 +177,7 @@ page {
color: rgba(153, 153, 153, 1);
}
.list-item {
padding-bottom: 16rpx;
margin-bottom: 24rpx;
position: relative;
border-radius: 16rpx 16rpx 16rpx 16rpx;
border: 2rpx solid #ffffff;
@ -175,7 +195,7 @@ page { @@ -175,7 +195,7 @@ page {
align-items: center;
&::before {
flex-shrink: 0;
content: '';
content: "";
width: 10rpx;
height: 40rpx;
background: #00b4c5;
@ -430,8 +450,12 @@ page { @@ -430,8 +450,12 @@ page {
border: 2rpx solid #f8f9f9;
font-size: 32rx;
}
.sub-title {
padding: 32rpx 0 16rpx;
font-size: 32rpx;
color: #141515;
}
.tags {
margin-top: 32rpx;
display: flex;
flex-wrap: wrap;
gap: 20rpx;
@ -450,6 +474,11 @@ page { @@ -450,6 +474,11 @@ page {
color: rgba(1, 180, 197, 1);
}
}
&.tags1 {
.tag {
border-radius: 90rpx;
}
}
}
.submit {
margin-top: 32rpx;

378
src/pages/cases/index.ts

@ -1,25 +1,385 @@ @@ -1,25 +1,385 @@
const _app = getApp<IAppOption>()
const app = getApp<IAppOption>();
Page({
data: {
fold: true,
show1: false,
show2: false,
show3: false,
showArea: false,
fieldNames: { text: "label", value: "value", children: "children" },
nav: "0",
area: [],
caseStatusList: {},
fileTypeList: {},
reasonList: {},
pagination: {
page: 1,
pages: 1,
count: 1,
},
list: [],
hostilatSearch: "",
hostipalList: [],
hospitalClassification: {},
hospitalLevel: {},
hostipalPagination: {
page: 1,
pages: 1,
count: 1,
},
deptList: [] as any,
labelList: [] as any,
caseStatusName: "全部",
hospitalName: "全部",
deptName: "全部",
provinceName: "",
cityName: "",
countyName: "",
search: "",
caseStatus: [] as any,
hospitalId: [] as any,
submitTimeBegin: "",
submitTimeEnd: "",
feedbackTimeBegin: "",
feedbackTimeEnd: "",
deptId: [] as any,
labelId: [] as any,
provinceId: "",
cityId: "",
countyId: "",
isReject: "",
isHighQuality: "",
isOpen: "",
needDeal: "",
orderType: "",
},
onLoad() {
this.getTabBar().setData({
active: 2,
})
});
app.waitLogin().then(() => {
this.getBaseInfo();
this.getList();
this.getHospitalsList();
this.getHostipalDict();
this.getDoctorDict();
this.getArea();
});
},
getBaseInfo() {
wx.ajax({
method: "GET",
url: "?r=takeda/case/get-base-info",
data: {},
}).then((res) => {
this.setData({
caseStatusList: res.caseStatusList,
fileTypeList: res.fileTypeList,
reasonList: res.reasonList,
});
});
},
getArea() {
wx.ajax({
method: "GET",
url: "/js/area.json",
isJSON: true,
}).then((res) => {
this.setData({
area: res,
});
});
},
handleNav(e) {
const { nav } = e.currentTarget.dataset;
this.setData({
nav,
isOpen: nav === "1" ? "1" : "",
isHighQuality: nav === "2" ? "1" : "",
});
this.handleSearch();
},
getList(newPage = 1) {
wx.ajax({
method: "POST",
url: "?r=takeda/case/get-list",
data: {
page: newPage,
search: this.data.search,
caseStatus: this.data.caseStatus,
submitTimeBegin: this.data.submitTimeBegin,
submitTimeEnd: this.data.submitTimeEnd,
feedbackTimeBegin: this.data.feedbackTimeBegin,
feedbackTimeEnd: this.data.feedbackTimeEnd,
deptId: this.data.deptId,
labelId: this.data.labelId,
provinceId: this.data.provinceId,
cityId: this.data.cityId,
countyId: this.data.countyId,
hospitalId: this.data.hospitalId,
isReject: this.data.isReject,
isHighQuality: this.data.isHighQuality,
isOpen: this.data.isOpen,
needDeal: this.data.needDeal,
orderType: this.data.orderType,
},
}).then((res) => {
const list = res.page === 1 ? res.list : [...this.data.list, ...res.list];
this.setData({
list,
pagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
});
});
},
onReachBottom() {
const { page, pages } = this.data.pagination;
if (pages > page) {
this.getList(page + 1);
}
},
handleSearch() {
this.getList();
},
handleCaseShow() {
this.setData({
show1: true,
});
},
handleCase(e) {
const { value } = e.currentTarget.dataset;
const { caseStatus, caseStatusList } = this.data;
if (!value) {
this.setData({
caseStatus: [],
caseStatusName: "全部",
});
return;
}
if (caseStatus.includes(value)) {
this.setData({
caseStatus: caseStatus.filter((item) => item !== value),
caseStatusName: caseStatus
.filter((item) => item !== value)
.map((item) => caseStatusList[item])
.join(","),
});
} else {
this.setData({
caseStatus: [...caseStatus, value],
caseStatusName: [...caseStatus, value].map((item) => caseStatusList[item]).join(","),
});
}
},
handleCaseSubmit() {
this.setData({
show1: false,
});
this.handleSearch();
},
onClose() {
this.setData({
show1: false,
show2: false,
show3: false,
showArea: false,
});
},
handleImagePreview(e) {
const { url } = e.currentTarget.dataset
const { url } = e.currentTarget.dataset;
wx.previewImage({
urls: [url],
})
});
},
handleDetail(){
handleDetail() {
wx.navigateTo({
url:"/module1/pages/casesDetail/index"
})
}
})
url: "/module1/pages/casesDetail/index",
});
},
// 医院选择弹窗
handleHostipalShow() {
this.setData({
show2: true,
});
},
getHostipalDict() {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/hospital-dict",
data: {},
}).then((res) => {
this.setData({
hospitalClassification: res.hospitalClassification,
hospitalLevel: res.hospitalLevel,
});
});
},
handleSearchHostipal() {
this.getHospitalsList();
},
getHospitalsList(newPage = 1) {
wx.ajax({
method: "GET",
url: "?r=takeda/reg/hospitals",
data: {
page: newPage,
Search: this.data.hostilatSearch,
},
}).then((res) => {
const hostipalList = res.page === 1 ? res.list : [...this.data.hostipalList, ...res.list];
this.setData({
hostipalList,
hostipalPagination: {
page: res.page,
pages: res.pages,
count: res.count,
},
});
});
},
handleHostipalBottom(e) {
const hostipalPagination = this.data.hostipalPagination;
if (e.detail.direction === "botttom" && hostipalPagination.page < hostipalPagination.pages) {
this.getHospitalsList(Number(hostipalPagination.page) + 1);
}
},
handleHostipal(e) {
const { params } = e.currentTarget.dataset;
this.setData({
show2: false,
hospitalId: this.data.hospitalId.includes(params.HospitalId) ? [] : [params.HospitalId],
hospitalName: this.data.hospitalId.includes(params.HospitalId) ? "全部" : params.Name,
});
},
getDoctorDict() {
wx.ajax({
method: "POST",
url: "?r=takeda/reg/doctor-dict",
data: {},
}).then((res) => {
this.setData({
deptList: res.DoctorSpecialtyLabel,
});
});
},
handleTagShow() {
this.setData({
show3: true,
});
},
handleDept(e) {
const { params } = e.currentTarget.dataset;
const deptId = this.data.deptId;
const newDeptId: any = deptId.includes(params.value)
? deptId.filter((item) => item !== params.value)
: [...deptId, params.value];
const newDeptName = this.data.deptList
.filter((item) => newDeptId.includes(item.value))
.map((item) => item.label)
.join(",");
const labelList = this.data.deptList
.filter((item) => newDeptId.includes(item.value))
.reduce((pre, cur) => {
return [...pre, ...cur.options];
}, []);
this.setData({
deptId: newDeptId,
deptName: newDeptName || "全部",
labelList,
labelId: [],
});
},
handleLabel(e) {
const { params } = e.currentTarget.dataset;
const labelId = this.data.labelId;
const newDeptId = labelId.includes(params.value)
? labelId.filter((item) => item !== params.value)
: [...labelId, ...params.value];
this.setData({
labelId: newDeptId,
});
},
handleTagSubmit() {
this.setData({
show3: false,
});
this.handleSearch();
},
handleArea() {
this.setData({
showArea: true,
});
},
onFinish(e: any) {
this.setData({
provinceId: e.detail.selectedOptions[0].value,
provinceName: e.detail.selectedOptions[0].label,
cityId: e.detail.selectedOptions[1].value,
cityName: e.detail.selectedOptions[1].label,
countyId: e.detail.selectedOptions[2].value,
countyName: e.detail.selectedOptions[2].label,
showArea: false,
});
this.handleSearch();
},
handleRadio(e) {
const { key } = e.currentTarget.dataset;
this.setData({
[key]: this.data[key] === "1" ? "" : "1",
});
this.handleSearch();
},
handleOrder(e) {
const { value } = e.currentTarget.dataset;
this.setData({
orderType: value,
});
this.handleSearch();
},
handleFold() {
this.setData({
fold: !this.data.fold,
});
},
handleDel(e) {
const { index } = e.currentTarget.dataset;
const params: any = this.data.list[index];
wx.showModal({
title: "确认删除该病历?",
success: (e) => {
if (e.confirm) {
wx.ajax({
method: "POST",
url: "?r=takeda/case/delete-case",
data: {
caseId: params.caseId,
},
}).then(() => {
this.setData({
list: this.data.list.filter((item: any) => item.caseId !== params.caseId),
});
});
}
},
});
},
});
export {};

318
src/pages/cases/index.wxml

@ -1,168 +1,244 @@ @@ -1,168 +1,244 @@
<wxs src="/utils/util.wxs" module="tools" />
<view class="page">
<view class="header">
<view class="navbar">
<view class="nav active">我的病历</view>
<view class="nav">
<view class="nav {{nav==='0' && 'active'}}" bind:tap="handleNav" data-nav="0">我的病历</view>
<view class="nav {{nav==='1' && 'active'}}" bind:tap="handleNav" data-nav="1">
公开病历
<van-icon name="question" color="rgba(224, 224, 224, 1)" />
</view>
<view class="nav">
<view class="nav {{nav==='2' && 'active'}}" bind:tap="handleNav" data-nav="2">
优质病历
<van-icon name="question" color="rgba(224, 224, 224, 1)" />
</view>
</view>
<view class="search">
<image class="icon" src="{{imageUrl}}icon-search.png?t={{Timestamp}}"></image>
<input class="input" placeholder-class="place-input" type="text" placeholder="支持档案编号、医生姓名进行搜索" />
<input
class="input"
model:value="{{search}}"
confirm-type="search"
bindconfirm="handleSearch"
placeholder-class="place-input"
type="text"
placeholder="支持档案编号、医生姓名进行搜索"
/>
</view>
<view class="form">
<view class="form {{fold && 'fold'}}">
<view class="row">
<view class="label">状态</view>
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<view class="picker-content" bind:tap="handleCaseShow">
<view class="content">{{caseStatusName}}</view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="row">
<view class="label">医院</view>
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<view class="picker-content" bind:tap="handleHostipalShow">
<view class="content">{{hospitalName}}</view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="row">
<view class="label">创建</view>
<picker class="picker">
<view class="picker">
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<view class="range">
<picker
class="date"
end="{{submitTimeEnd}}"
model:value="{{submitTimeBegin}}"
mode="date"
bind:change="handleSearch"
>
<view class="date-content">{{submitTimeBegin||'开始'}}</view>
</picker>
-
<picker
class="date"
start="{{submitTimeBegin}}"
model:value="{{submitTimeEnd}}"
mode="date"
bind:change="handleSearch"
>
<view class="date-content">{{submitTimeEnd || '结束'}}</view>
</picker>
</view>
<van-icon name="arrow-down" />
</view>
</picker>
</view>
</view>
<view class="row">
<view class="label">更新</view>
<picker class="picker">
<view class="picker">
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<view class="range">
<picker
class="date"
end="{{feedbackTimeEnd}}"
model:value="{{feedbackTimeBegin}}"
mode="date"
bind:change="handleSearch"
>
<view class="date-content">{{feedbackTimeBegin||'开始'}}</view>
</picker>
-
<picker
class="date"
start="{{feedbackTimeBegin}}"
model:value="{{feedbackTimeEnd}}"
mode="date"
bind:change="handleSearch"
>
<view class="date-content">{{feedbackTimeEnd || '结束'}}</view>
</picker>
</view>
<van-icon name="arrow-down" />
</view>
</picker>
</view>
</view>
<view class="row">
<view class="label">标签</view>
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<view class="picker-content" bind:tap="handleTagShow">
<view class="content">{{deptName}}</view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="row">
<view class="label">地区</view>
<picker class="picker">
<view class="picker-content">
<view class="content">全全部全部全部全部全部全部全部全部全部全部部</view>
<van-icon name="arrow-down" />
</view>
</picker>
<view class="picker-content" bind:tap="handleArea">
<view class="content">{{cityName+countyName || '地区'}}</view>
<van-icon name="arrow-down" />
</view>
</view>
</view>
<view class="station">
<view class="wrap">
<view class="item">
<radio class="radio"></radio>
<radio class="radio" checked="{{isReject==='1'}}" bind:tap="handleRadio" data-key="isReject"></radio>
驳回
</view>
<view class="item">
<radio class="radio"></radio>
<view class="item" wx:if="{{nav!=='2'}}">
<radio
class="radio"
checked="{{isHighQuality==='1'}}"
bind:tap="handleRadio"
data-key="isHighQuality"
></radio>
优质
</view>
<view class="item">
<radio class="radio"></radio>
<view class="item" wx:if="{{nav!=='1'}}">
<radio class="radio" checked="{{isOpen==='1'}}" bind:tap="handleRadio" data-key="isOpen"></radio>
公开
</view>
</view>
<view class="fold">
收起
<van-icon class="v-icon" name="arrow-down" />
<view class="fold" bind:tap="handleFold">
{{fold ? '展开' : '收起'}}
<van-icon class="v-icon" name="{{fold? 'arrow-down' :'arrow-up'}}" />
</view>
</view>
</view>
<view class="sort-line">
<view class="wrap">
<view class="btn active">更新时间排序</view>
<view class="btn">提交时间排序</view>
<view class="btn {{orderType==='feedbackTime' && 'active'}}" bind:tap="handleOrder" data-value="feedbackTime">
更新时间排序
</view>
<view class="btn {{orderType==='submitTime' && 'active'}}" bind:tap="handleOrder" data-value="submitTime">
提交时间排序
</view>
</view>
<radio class="feedback" color="rgba(0, 180, 197, 1)">待我反馈</radio>
<radio
class="feedback"
color="rgba(0, 180, 197, 1)"
checked="{{needDeal==='1'}}"
bind:tap="handleRadio"
data-key="needDeal"
>
待我反馈
</radio>
</view>
<view class="list">
<view class="list-total">共有290条病历</view>
<view class="list-item" bind:tap="handleDetail">
<image class="quality" src="{{imageUrl}}quality.png?t={{Timestamp}}"></image>
<view class="list-total" wx:if="{{pagination.count}}">共有{{pagination.count}}条病历</view>
<view class="list-item" wx:for="{{list}}" bind:tap="handleDetail" wx:key="caseId">
<image wx:if="{{item.isHighQuality==='1'}}" class="quality" src="{{imageUrl}}quality.png?t={{Timestamp}}"></image>
<view class="li-header">
<view class="wrap">
<view class="id">ID:2024020913049204001</view>
<view class="status status1">讨论中</view>
<view class="status status3">已公开</view>
<view class="id">ID:{{item.caseId}}</view>
<view class="status status3" wx:if="{{item.caseStatus==='1'}}">{{item.statusName}}</view>
<view class="status status2" wx:elif="{{item.caseStatus==='2'}}">{{item.statusName}}</view>
<view class="status status1" wx:elif="{{item.caseStatus==='3'}}">{{item.statusName}}</view>
<view class="status status1" wx:elif="{{item.caseStatus==='4'}}">{{item.statusName}}</view>
<view class="status status3" wx:if="{{item.isOpen==='1'}}">已公开</view>
</view>
<image class="option" src="{{imageUrl}}icon-gather.png?t={{Timestamp}}"></image>
<image
wx:if="{{item.canDel===1}}"
class="option"
src="{{imageUrl}}icon-gather.png?t={{Timestamp}}"
catch:tap="handleDel"
data-index="{{index}}"
></image>
</view>
<view class="li-row">
<view class="li-row" wx:if="{{item.caseSubmitTime}}">
<view class="label">提交时间</view>
<view class="content">2024-02-09 12:04:23</view>
<view class="content">{{item.caseSubmitTime}}</view>
</view>
<view class="li-row">
<view class="label">提交人</view>
<view class="content">
王军
{{item.doctorName}}
<text class="line">|</text>
四川大学华西医院 副主任医师
{{item.hospitalName}} {{item.doctorTitleName}}
</view>
</view>
<view class="li-row">
<view class="label">标签</view>
<view class="tags">
<view class="tag">心律失常</view>
<view class="tag">心律失常</view>
<view class="tag">心律失常</view>
<view class="tag" wx:for="{{item.caseLabels}}" wx:key="labelId" wx:for-item="caseItem">
{{caseItem.labelName}}
</view>
</view>
</view>
<view class="photos">
<view class="photos" wx:if="{{item.caseImages.length}}">
<image
wx:for="{{item.caseImages}}"
wx:for-item="photoItem"
class="photo"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
bind:tap="handleImagePreview"
data-url="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
></image>
<image
class="photo"
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
mode="aspectFill"
src="{{photoItem.url}}"
catch:tap="handleImagePreview"
data-url="{{photoItem.url}}"
wx:key="index"
></image>
</view>
<view class="li-row">
<view class="label">更新时间</view>
<view class="content">
2024-02-09 12:04:23
<view class="new">new</view>
<view class="reject">已驳回</view>
<block wx:if="{{item.caseFeedback.feedbackId}}">
<view class="li-row">
<view class="label">更新时间</view>
<view class="content">
{{item.caseFeedback.createTime}}
<view class="new" wx:if="{{item.caseFeedback.isRead==='2'}}">new</view>
<view class="reject" wx:if="{{item.isReject==='1'}}">已驳回</view>
</view>
</view>
</view>
<view class="li-row">
<view class="label">反馈人</view>
<view class="content">
王军
<text class="line">|</text>
四川大学华西医院 副主任医师
<view class="li-row">
<view class="label">反馈人</view>
<view class="content">
{{item.caseFeedback.doctorName}}
<text class="line">|</text>
{{item.caseFeedback.hospitalName}}
</view>
</view>
</view>
</block>
</view>
</view>
<view class="empty-1">
<view class="empty-1" wx:if="{{pagination.count==0 && search}}">
<image class="e-img" src="{{imageUrl}}empty-1.png?t={{Timestamp}}"></image>
<view class="e-tip">没有找到您搜索的医院哦!</view>
</view>
<view class="empty-2">
<view class="empty-2" wx:elif="{{nav==='0' && pagination.count==0}}">
<image class="e-img" src="{{imageUrl}}empty-2.png?t={{Timestamp}}"></image>
<view class="e-tip">没有找到您搜索的医院哦!</view>
<view class="e-tip">你还没有病例哦!</view>
</view>
<pagination wx:else pagination="{{pagination}}"></pagination>
</view>
<van-popup show="{{ show1 }}" position="bottom" bind:close="onClose" z-index="10000" round closeable>
@ -170,14 +246,19 @@ @@ -170,14 +246,19 @@
<view class="title">病历状态</view>
<view class="scroll">
<view class="list">
<view class="list-item active">全部</view>
<view class="list-item">新病历</view>
<view class="list-item">讨论中</view>
<view class="list-item">已归档</view>
<view class="list-item">已归档</view>
<view class="list-item {{!caseStatus.length && 'active'}}" bind:tap="handleCase">全部</view>
<view
class="list-item {{tools.include(index,caseStatus) && 'active'}}"
wx:for="{{caseStatusList}}"
bind:tap="handleCase"
data-value="{{index}}"
wx:key="index"
>
{{item}}
</view>
</view>
</view>
<view class="submit">保存</view>
<view class="submit" bind:tap="handleCaseSubmit">保存</view>
</view>
</van-popup>
@ -186,26 +267,39 @@ @@ -186,26 +267,39 @@
<view class="title">选择医院</view>
<view class="search">
<image class="icon" src="{{imageUrl}}icon-search.png?t={{Timestamp}}"></image>
<input class="input" placeholder-class="place-input" type="text" placeholder="支持档案编号、医生姓名进行搜索" />
<input
class="input"
model:value="{{hostilatSearch}}"
placeholder-class="place-input"
type="text"
confirm-type="search"
bindconfirm="handleSearchHostipal"
placeholder="搜索医院名称"
/>
</view>
<view class="scroll">
<scroll-view class="scroll" scroll-y="{{true}}" bindscrolltolower="handleHostipalBottom">
<view class="list">
<view class="list-item active">
<view
class="list-item {{tools.include(item.HospitalId,hospitalId) && 'active'}}"
wx:for="{{hostipalList}}"
wx:key="HospitalId"
bind:tap="handleHostipal"
data-params="{{item}}"
>
<view class="hostipal">
中山大学附属第一医院
<view class="tag">三甲</view>
{{item.Name}}
<view class="tag">
{{hospitalClassification[item.HospitalClassification]}}{{hospitalLevel[item.HospitalLevel]}}
</view>
</view>
<view class="site">广东省广州市越秀区中山二路58号</view>
</view>
<view class="list-item">
<view class="hostipal">
中山大学附属第一医院
<view class="tag">三甲</view>
<view class="site">
{{item.ProvinceName === item.CityName ? '':item.ProvinceName}}
{{item.CityName}}{{item.CountyName}}{{item.Address}}
</view>
<view class="site">广东省广州市越秀区中山二路58号</view>
</view>
<pagination pagination="{{hostipalPagination}}"></pagination>
</view>
</view>
</scroll-view>
</view>
</van-popup>
@ -220,12 +314,42 @@ @@ -220,12 +314,42 @@
>
<view class="popup3">
<view class="title">选择标签</view>
<view class="sub-title">所属科室</view>
<view class="tags tags1">
<view
class="tag {{tools.include(item.value,deptId) && 'active'}}"
wx:for="{{deptList}}"
wx:key="value"
bind:tap="handleDept"
data-params="{{item}}"
>
{{item.label}}
</view>
</view>
<view class="sub-title" wx:if="{{labelList.length}}">标签</view>
<view class="tags">
<view class="tag active">瓣膜病</view>
<view class="tag">心律失常</view>
<view class="tag">心衰</view>
<view class="tag">心肌病</view>
<view
class="tag {{tools.include(item.value,labelId) && 'active'}}"
wx:for="{{labelList}}"
wx:key="value"
bind:tap="handleLabel"
data-params="{{item}}"
>
{{item.label}}
</view>
</view>
<view class="submit">保存</view>
<view class="submit" bind:tap="handleTagSubmit">保存</view>
</view>
</van-popup>
<van-popup show="{{ showArea }}" round position="bottom">
<van-cascader
wx:if="{{ showArea }}"
value="{{ cascaderValue }}"
title="请选择所在地区"
options="{{ area }}"
field-names="{{fieldNames}}"
bind:close="onClose"
bind:finish="onFinish"
/>
</van-popup>

38
src/utils/component.ts

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
* 2app.js onLaunch Page = page
*/
const originalComponent = Component
const originalComponent = Component;
function component(
config: WechatMiniprogram.Component.Instance<
@ -14,17 +14,29 @@ function component( @@ -14,17 +14,29 @@ function component(
WechatMiniprogram.Component.BehaviorOption
>,
) {
const originalOnAttached = config.attached
config.attached = function (options) {
setImageParams(this)
getApp().getMenuInfo(this)
if (config?.lifetimes?.attached) {
const originalOnAttached = config.lifetimes.attached;
config.lifetimes.attached = function (options) {
setImageParams(this);
getApp().getMenuInfo(this);
if (originalOnAttached) {
originalOnAttached.call(this, options)
}
if (originalOnAttached) {
originalOnAttached.call(this, options);
}
};
} else {
const originalOnAttached = config.attached;
config.attached = function (options) {
setImageParams(this);
getApp().getMenuInfo(this);
if (originalOnAttached) {
originalOnAttached.call(this, options);
}
};
}
return originalComponent(config)
return originalComponent(config);
}
function setImageParams(
@ -35,12 +47,12 @@ function setImageParams( @@ -35,12 +47,12 @@ function setImageParams(
WechatMiniprogram.Component.BehaviorOption
>,
) {
const date = new Date()
const Timestamp = date.getTime()
const date = new Date();
const Timestamp = date.getTime();
currPage.setData({
imageUrl: getApp().globalData.imageUrl,
Timestamp,
})
});
}
export default component
export default component;

12
src/utils/util.wxs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
function include(value, arr) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] === value) {
return true;
}
}
return false;
}
module.exports = {
include: include,
};
Loading…
Cancel
Save