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. 19
      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. 374
      src/pages/cases/index.ts
  29. 298
      src/pages/cases/index.wxml
  30. 32
      src/utils/component.ts
  31. 12
      src/utils/util.wxs

1
2024-10-31.md

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

5
dist.nu

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

2
package.json

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

58
pnpm-lock.yaml

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

3
project.private.config.json

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

2
src/components/customAudioBar/index.wxml

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

144
src/components/customRecord/index.ts

@ -1,6 +1,4 @@
import { isQualifiedName } from 'typescript' const app = getApp<IAppOption>();
const _app = getApp<IAppOption>()
// pages/story/a.ts // pages/story/a.ts
Component({ Component({
@ -21,11 +19,11 @@ Component({
lifetimes: { lifetimes: {
attached() { attached() {
const recorderManager = wx.getRecorderManager() const recorderManager = wx.getRecorderManager();
this.setData({ this.setData({
recorderManager, recorderManager,
}) });
this.recorderManagerListen(recorderManager) this.recorderManagerListen(recorderManager);
}, },
}, },
/** /**
@ -36,90 +34,154 @@ Component({
this.checkRecordPermission(() => { this.checkRecordPermission(() => {
this.setData({ this.setData({
startShow: true, startShow: true,
}) });
}) });
}, },
handleShow() { handleShow() {
const { recorderManager } = this.data const { recorderManager } = this.data;
this.setData({ this.setData({
show: true, show: true,
}) });
recorderManager?.start({ recorderManager?.start({
format: 'mp3', format: "mp3",
}) });
}, },
handleHide() { handleHide() {
const { recorderManager } = this.data const { recorderManager } = this.data;
recorderManager?.stop() recorderManager?.stop();
this.setData({ this.setData({
startShow: false, startShow: false,
show: false, show: false,
}) });
}, },
recorderManagerListen(recorderManager: WechatMiniprogram.RecorderManager) { recorderManagerListen(recorderManager: WechatMiniprogram.RecorderManager) {
recorderManager.onError(() => { recorderManager.onError(() => {
wx.showToast({ wx.showToast({
title: '录音失败', title: "录音失败",
icon: 'none', icon: "none",
}) });
}) });
recorderManager.onStart(() => { recorderManager.onStart(() => {
this.handleTiem() this.handleTiem();
}) });
recorderManager.onStop((res) => { recorderManager.onStop((res) => {
this.handleHide() this.handleHide();
console.log(res) this.uploadFile({
}) fileType: "audio",
tempFilePath: res.tempFilePath,
size: res.fileSize,
duration: res.duration,
}).then((res) => {
this.triggerEvent("file", res as object);
});
});
}, },
checkRecordPermission(callback: () => void) { checkRecordPermission(callback: () => void) {
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting['scope.record']) { if (!res.authSetting["scope.record"]) {
wx.authorize({ wx.authorize({
scope: 'scope.record', scope: "scope.record",
success() { success() {
// 用户已同意授权 // 用户已同意授权
}, },
fail() { fail() {
// 用户拒绝了授权 // 用户拒绝了授权
wx.showModal({ wx.showModal({
title: '提示', title: "提示",
content: '需要获取录音权限,请点击确定进入设置页面进行授权。', content: "需要获取录音权限,请点击确定进入设置页面进行授权。",
showCancel: false, showCancel: false,
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.openSetting({ wx.openSetting({
success(res) { success(res) {
// 用户在设置页面设置了录音权限 // 用户在设置页面设置了录音权限
if (res.authSetting['scope.record']) { if (res.authSetting["scope.record"]) {
// 用户在设置页面设置了录音权限 // 用户在设置页面设置了录音权限
} else { } else {
// 用户在设置页面未设置录音权限 // 用户在设置页面未设置录音权限
} }
}, },
}) });
} }
}, },
}) });
}, },
}) });
} else { } else {
// 已经有录音权限 // 已经有录音权限
callback() callback();
} }
}, },
}) });
}, },
handleTiem() { handleTiem() {
const time = setTimeout(() => { const time = setTimeout(() => {
clearInterval(time) clearInterval(time);
if (!this.data.show) return if (!this.data.show) return;
this.setData({ this.setData({
time: this.data.time + 1, time: this.data.time + 1,
}) });
console.log(this.data.time) this.handleTiem();
this.handleTiem() }, 1000);
}, 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]; //将后缀名返回出来
}, },
}, },
}) });

19
src/components/uploadFile/index.ts

@ -10,6 +10,14 @@ Component({
type: Boolean, type: Boolean,
value: false, value: false,
}, },
accept: {
type: String,
value: "image",
},
obscure: {
type: Boolean,
value: false,
},
}, },
/** /**
@ -30,9 +38,20 @@ Component({
return arr2[arr2.length - 1]; //将后缀名返回出来 return arr2[arr2.length - 1]; //将后缀名返回出来
}, },
handleAfterRead(e) { handleAfterRead(e) {
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.uploadFile(e.detail.file).then((res) => {
this.triggerEvent("file", res as object); this.triggerEvent("file", res as object);
}); });
}
}, },
handleChooseAvatar(e) { handleChooseAvatar(e) {
this.uploadFile({ this.uploadFile({

2
src/components/uploadFile/index.wxml

@ -1,6 +1,6 @@
<button class="button" wx:if="{{chooseAvatar}}" open-type="chooseAvatar" bindchooseavatar="handleChooseAvatar"> <button class="button" wx:if="{{chooseAvatar}}" open-type="chooseAvatar" bindchooseavatar="handleChooseAvatar">
<slot></slot> <slot></slot>
</button> </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> <slot></slot>
</van-uploader> </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 @@
const _app = getApp<IAppOption>() const _app = getApp<IAppOption>();
Page({ Page({
data: { data: {
show1: false, show1: false,
show2: false, show2: false,
show3: false, show3: false,
images: [] as any,
description: "",
audios: [] as any,
}, },
onLoad() {}, onLoad() {},
handleChooseFile() { handleChooseFile() {
wx.chooseMessageFile({ wx.chooseMessageFile({
count: 1, count: 1,
success(res) { success(res) {
console.log(res) console.log(res);
}, },
fail() { fail() {
wx.showToast({ wx.showToast({
icon: 'none', icon: "none",
title: '取消选择', title: "取消选择",
}) });
}, },
}) });
}, },
handleSubmit() { handleSubmit() {
wx.navigateTo({ 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 @@
<text class="limit">(0/9)</text> <text class="limit">(0/9)</text>
</view> </view>
<view class="image-files"> <view class="image-files">
<view class="photo"> <view class="photo" wx:for="{{images}}" wx:key="index">
<image <image class="p-img" src="{{item.url}}" mode="aspectFill"></image>
class="p-img" <view class="del" bind:tap="handleDelPhoto" data-index="{{index}}">
src="https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567"
mode="aspectFill"
></image>
<view class="del">
<van-icon name="cross" /> <van-icon name="cross" />
</view> </view>
<view class="repeat"> <!-- <view class="repeat">
<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>
</view> <uploadFile obscure bind:file="handlePhoto">
<uploadFile>
<view class="upload-file"> <view class="upload-file">
<van-icon class="add" name="plus" /> <van-icon class="add" name="plus" />
</view> </view>
@ -31,6 +27,7 @@
<view class="remark"> <view class="remark">
<textarea <textarea
class="textarea" class="textarea"
model:value="{{description}}"
placeholder-style="color:rgba(205, 205, 205, 1);" placeholder-style="color:rgba(205, 205, 205, 1);"
placeholder="请输入您的病历备注" placeholder="请输入您的病历备注"
auto-height auto-height
@ -39,8 +36,8 @@
<view class="limit">0/3000</view> <view class="limit">0/3000</view>
</view> </view>
<view class="audio-list"> <view class="audio-list">
<view class="row"> <view class="row" wx:for="{{audios}}" wx:key="index">
<customAudioBar class="audio-bar"></customAudioBar> <customAudioBar class="audio-bar" url="{{item.url}}" time="{{item.duration}}"></customAudioBar>
<view class="options"> <view class="options">
<image class="del" src="{{imageUrl}}icon-del.png?t={{Timestamp}}"></image> <image class="del" src="{{imageUrl}}icon-del.png?t={{Timestamp}}"></image>
<view class="trans">转文字</view> <view class="trans">转文字</view>
@ -48,7 +45,7 @@
</view> </view>
</view> </view>
<view class="record"> <view class="record">
<customRecord class="record-btn"></customRecord> <customRecord class="record-btn" bind:file="handleAudio"></customRecord>
<view class="r-title">您也可以长按录入语音</view> <view class="r-title">您也可以长按录入语音</view>
</view> </view>
</view> </view>

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

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

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

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

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

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

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

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

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

@ -4,7 +4,7 @@ Page({
data: { data: {
applyDoctorInfo: null, applyDoctorInfo: null,
applyHostipalInfo: null, applyHostipalInfo: null,
invite: false, inviteName: "",
DoctorLevel: {}, DoctorLevel: {},
DoctorTitleType: {}, DoctorTitleType: {},
@ -30,6 +30,10 @@ Page({
this.getApplyDoctor(); this.getApplyDoctor();
this.getLoastApplyHostipal(); this.getLoastApplyHostipal();
this.getDoctorDict(); this.getDoctorDict();
const doctorId = app.globalData.scene?.doctorId;
if (doctorId) {
this.getDoctorInfo(doctorId);
}
}); });
}, },
getApplyDoctor() { getApplyDoctor() {
@ -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() { getLoastApplyHostipal() {
wx.ajax({ wx.ajax({
method: "GET", method: "GET",

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

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

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

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

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

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

4
src/pages/cases/index.json

@ -3,6 +3,8 @@
"navigationStyle": "default", "navigationStyle": "default",
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index", "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 {
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);
} }
} }
@ -56,10 +56,16 @@ page {
} }
} }
.form { .form {
margin: 32rpx 32rpx 0; margin: 32rpx 32rpx;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
gap: 18rpx 28rpx; gap: 18rpx 28rpx;
overflow: hidden;
max-height: 400rpx;
&.fold {
max-height: 0;
margin: 0;
}
.row { .row {
display: flex; display: flex;
align-items: center; align-items: center;
@ -90,6 +96,20 @@ page {
text-overflow: ellipsis; 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 { .station {
@ -157,7 +177,7 @@ page {
color: rgba(153, 153, 153, 1); color: rgba(153, 153, 153, 1);
} }
.list-item { .list-item {
padding-bottom: 16rpx; margin-bottom: 24rpx;
position: relative; position: relative;
border-radius: 16rpx 16rpx 16rpx 16rpx; border-radius: 16rpx 16rpx 16rpx 16rpx;
border: 2rpx solid #ffffff; border: 2rpx solid #ffffff;
@ -175,7 +195,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;
@ -430,8 +450,12 @@ page {
border: 2rpx solid #f8f9f9; border: 2rpx solid #f8f9f9;
font-size: 32rx; font-size: 32rx;
} }
.sub-title {
padding: 32rpx 0 16rpx;
font-size: 32rpx;
color: #141515;
}
.tags { .tags {
margin-top: 32rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 20rpx; gap: 20rpx;
@ -450,6 +474,11 @@ page {
color: rgba(1, 180, 197, 1); color: rgba(1, 180, 197, 1);
} }
} }
&.tags1 {
.tag {
border-radius: 90rpx;
}
}
} }
.submit { .submit {
margin-top: 32rpx; margin-top: 32rpx;

374
src/pages/cases/index.ts

@ -1,25 +1,385 @@
const _app = getApp<IAppOption>() const app = getApp<IAppOption>();
Page({ Page({
data: { data: {
fold: true,
show1: false, show1: false,
show2: false, show2: false,
show3: 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() { onLoad() {
this.getTabBar().setData({ this.getTabBar().setData({
active: 2, 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) { handleImagePreview(e) {
const { url } = e.currentTarget.dataset const { url } = e.currentTarget.dataset;
wx.previewImage({ wx.previewImage({
urls: [url], urls: [url],
}) });
}, },
handleDetail() { handleDetail() {
wx.navigateTo({ 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 {};

298
src/pages/cases/index.wxml

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

32
src/utils/component.ts

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

12
src/utils/util.wxs

@ -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