@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org |
||||
|
||||
# top-most EditorConfig file |
||||
root = true |
||||
|
||||
[*] |
||||
indent_style = space |
||||
indent_size = 2 |
||||
end_of_line = lf |
||||
charset = utf-8 |
||||
trim_trailing_whitespace = true |
||||
insert_final_newline = true |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
node_modules |
||||
src/images/.svn |
||||
.idea |
||||
.DS_Store |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
{ |
||||
"emmet_language_server": { |
||||
"init_options": { |
||||
"preferences": { |
||||
"css.intUnit": "rpx", |
||||
"css.floatUnitr": "rpx" |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
{ |
||||
"$schema": "https://json.schemastore.org/prettierrc.json", |
||||
"printWidth": 120, |
||||
"tabWidth": 2, |
||||
"useTabs": false, |
||||
"semi": true, |
||||
"singleQuote": true, |
||||
"bracketSpacing": true, |
||||
"trailingComma": "all", |
||||
"arrowParens": "always", |
||||
"endOfLine": "auto", |
||||
"htmlWhitespaceSensitivity": "ignore", |
||||
"singleAttributePerLine": false, |
||||
"jsxSingleQuote": true, |
||||
"overrides": [ |
||||
{ |
||||
"files": "*.wxml", |
||||
"options": { |
||||
"parser": "html" |
||||
} |
||||
}, |
||||
{ |
||||
"files": "*.wxss", |
||||
"options": { |
||||
"parser": "css" |
||||
} |
||||
}, |
||||
{ |
||||
"files": "*.wxs", |
||||
"options": { |
||||
"parser": "babel" |
||||
} |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
{ |
||||
"path-autocomplete.pathMappings": { |
||||
"@": "${folder}/src", |
||||
"/": "${folder}/src", |
||||
}, |
||||
"emmet.preferences": { |
||||
"css.intUnit": "rpx", |
||||
"css.floatUnit": "rpx" |
||||
}, |
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
1. user 打开小程序进入 身份认证页面 |
||||
2. 判断图片是否涂抹 |
||||
3. 图像识别模糊 可以反向确认 通过ocr识别接口 接入ocr同时识别不到 姓名,年龄等字样,及判断该病历已被涂抹 |
||||
|
||||
<!--占位图像--> |
||||
|
||||
https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567 |
||||
|
||||
images svn 地址 |
||||
svn://39.106.86.127:28386/projects/takeda/proj_src/shop/frontend/web/wt |
||||
|
||||
(/images/)(\S\*(?=["|'])) |
||||
{{imageUrl}}$2?t={{Timestamp}} |
||||
|
||||
ui问题 |
||||
|
||||
1. 首页绑定医生弹窗需要重新切图 |
||||
2. 播放语音条图片没切 |
||||
|
||||
showModel颜色统一 |
||||
|
||||
```ts |
||||
wx.showModal({ |
||||
confirmColor: '#00B4C5', |
||||
cancelColor: '#141515', |
||||
}); |
||||
``` |
||||
|
||||
审核账号 |
||||
18910233000 1111 |
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
cd ./src/images/; |
||||
svn add . --no-ignore --force; |
||||
svn ci -m "版本更新"; |
||||
cd ..; |
||||
cd ..; |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
# Change to the src/images directory, or exit if the directory doesn't exist |
||||
Set-Location -Path ./src/images/ -ErrorAction Stop |
||||
|
||||
# Add all files to svn, including ignored files and forced additions |
||||
svn add . --no-ignore --force |
||||
|
||||
# Commit the changes with a message |
||||
svn ci -m "版本更新" |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash |
||||
cd ./src/images/ || exit |
||||
svn add . --no-ignore --force |
||||
svn ci -m "版本更新" |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
// eslint.config.mjs
|
||||
import antfu from '@antfu/eslint-config' |
||||
import prettierConfig from 'eslint-config-prettier' |
||||
|
||||
export default antfu( |
||||
{ |
||||
env: { |
||||
es6: true, |
||||
}, |
||||
stylistic: false, |
||||
parserOptions: { project: ['./tsconfig.json'] }, |
||||
globals: { |
||||
wx: true, |
||||
App: true, |
||||
Page: true, |
||||
getCurrentPages: true, |
||||
getApp: true, |
||||
Component: true, |
||||
requirePlugin: true, |
||||
requireMiniProgram: true, |
||||
}, |
||||
rules: { |
||||
'eslint-comments/no-unlimited-disable': 'off', |
||||
'ts/no-require-imports': 'off', |
||||
}, |
||||
}, |
||||
prettierConfig, |
||||
) |
@ -0,0 +1,316 @@
@@ -0,0 +1,316 @@
|
||||
[ |
||||
// emmet |
||||
{ |
||||
"key": "alt+e", |
||||
"command": "workbench.action.showEmmetCommands" |
||||
}, |
||||
// console |
||||
{ |
||||
"key": "ctrl+shift+l", |
||||
"command": "js-console.insertConsoleLog", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+alt+l", |
||||
"command": "-js-console.insertConsoleLog", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+shift+t", |
||||
"command": "js-console.insertConsoleTable", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+alt+t", |
||||
"command": "-js-console.insertConsoleTable", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+shift+w", |
||||
"command": "js-console.insertConsoleWarn", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+alt+w", |
||||
"command": "-js-console.insertConsoleWarn", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+shift+d", |
||||
"command": "workbench.debug.panel.action.clearReplAction" |
||||
}, |
||||
{ |
||||
"key": "ctrl+shift+e", |
||||
"command": "js-console.insertConsoleError", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+alt+e", |
||||
"command": "-js-console.insertConsoleError", |
||||
"when": "editorTextFocus" |
||||
}, |
||||
// Explorer |
||||
{ |
||||
"key": "enter", |
||||
"command": "list.select", |
||||
"when": "listFocus && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "a", |
||||
"command": "explorer.newFile", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+a", |
||||
"command": "explorer.newFolder", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "y", |
||||
"command": "filesExplorer.copy", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "x", |
||||
"command": "filesExplorer.cut", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "p", |
||||
"command": "filesExplorer.paste", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "r", |
||||
"command": "renameFile", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "m", |
||||
"command": "workbench.files.action.refreshFilesExplorer", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
// { |
||||
// "key": "m", |
||||
// "command": "editor.action.showContextMenu", |
||||
// "when": "explorerViewletVisible && filesExplorerFocus && !inputFocus" |
||||
// }, |
||||
{ |
||||
"key": "q", |
||||
"command": "workbench.action.toggleSidebarVisibility", |
||||
"when": "explorerResourceMoveableToTrash && explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
// "command": "workbench.files.action.refreshFilesExplorer", |
||||
{ |
||||
"key": "d", |
||||
"command": "moveFileToTrash", |
||||
"when": "explorerResourceMoveableToTrash && explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+d", |
||||
"command": "deleteFile", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "c", |
||||
"command": "workbench.files.action.collapseExplorerFolders", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "s", |
||||
"command": "explorer.openToSide", |
||||
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "f", |
||||
"command": "revealFileInOS", |
||||
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "t", |
||||
"command": "openInTerminal", |
||||
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "u", |
||||
"command": "copyFilePath", |
||||
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus" |
||||
}, |
||||
{ |
||||
"key": "i", |
||||
"command": "copyRelativeFilePath", |
||||
"when": "explorerViewletFocus && explorerViewletVisible && !inputFocus" |
||||
}, |
||||
// select |
||||
{ |
||||
"key": "ctrl+n", |
||||
"command": "selectNextSuggestion", |
||||
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+n", |
||||
"command": "workbench.action.quickOpenSelectNext", |
||||
"when": "inQuickOpen" |
||||
}, |
||||
{ |
||||
"key": "ctrl+p", |
||||
"command": "selectPrevSuggestion", |
||||
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+p", |
||||
"command": "workbench.action.quickOpenSelectPrevious", |
||||
"when": "inQuickOpen" |
||||
}, |
||||
// focus |
||||
{ |
||||
"key": "ctrl+h", |
||||
"command": "workbench.action.navigateLeft", |
||||
"when": "terminalFocus || sideBarFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+l", |
||||
"command": "workbench.action.navigateRight", |
||||
"when": "terminalFocus || sideBarFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+p", |
||||
"command": "workbench.action.navigateUp", |
||||
"when": "terminalFocus || sideBarFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+n", |
||||
"command": "workbench.action.navigateDown", |
||||
"when": "terminalFocus || sideBarFocus" |
||||
}, |
||||
// changeCase |
||||
{ |
||||
"key": "alt+;", |
||||
"command": "extension.changeCase.commands" |
||||
}, |
||||
// focus |
||||
{ |
||||
"key": "alt+`", |
||||
"command": "workbench.action.toggleSidebarVisibility" |
||||
}, |
||||
{ |
||||
"key": "alt+1", |
||||
"command": "workbench.view.explorer" |
||||
}, |
||||
{ |
||||
"key": "alt-2", |
||||
"command": "outline.focus" |
||||
}, |
||||
{ |
||||
"key": "alt-3", |
||||
"command": "workbench.view.extension.project-manager" |
||||
}, |
||||
{ |
||||
"key": "alt-4", |
||||
"command": "todo-tree-view.focus" |
||||
}, |
||||
{ |
||||
"key": "alt-5", |
||||
"command": "workbench.view.extension.dockerView" |
||||
}, |
||||
{ |
||||
"key": "alt+9", |
||||
"command": "workbench.view.scm" |
||||
}, |
||||
{ |
||||
"key": "alt-0", |
||||
"command": "workbench.action.toggleActivityBarVisibility" |
||||
}, |
||||
{ |
||||
"key": "tab", |
||||
"command": "markdown.extension.onTabKey", |
||||
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown' && vim.mode =='Insert'" |
||||
}, |
||||
{ |
||||
"key": "tab", |
||||
"command": "-markdown.extension.onTabKey", |
||||
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'" |
||||
}, |
||||
{ |
||||
"key": "shift+tab", |
||||
"command": "-markdown.extension.onShiftTabKey", |
||||
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown'" |
||||
}, |
||||
{ |
||||
"key": "shift+tab", |
||||
"command": "markdown.extension.onShiftTabKey", |
||||
"when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !suggestWidgetVisible && editorLangId == 'markdown' && vim.mode =='Insert'" |
||||
}, |
||||
// nav buffer |
||||
{ |
||||
"key": "tab", |
||||
"command": "workbench.action.nextEditor", |
||||
"when": "vim.mode != 'Insert' && vim.mode != 'CommandlineInProgress' && !panelFocus" |
||||
}, |
||||
{ |
||||
"key": "shift+tab", |
||||
"command": "workbench.action.previousEditor", |
||||
"when": "vim.mode != 'Insert' && vim.mode != 'CommandlineInProgress' && !panelFocus" |
||||
}, |
||||
// 转换色值格式 |
||||
{ |
||||
"key": "alt+-", |
||||
"command": "color-conversion.colorConversion", |
||||
"when": "editorTextFocus && editorHasSelection" |
||||
}, |
||||
// whichkey |
||||
{ |
||||
"key": "space", |
||||
"command": "whichkey.show", |
||||
"when": "!inputFocus" |
||||
}, |
||||
{ |
||||
"key": "e", |
||||
"command": "whichkey.triggerKey", |
||||
"args": { |
||||
"key": "e", |
||||
"when": "sideBarVisible && explorerViewletVisible" |
||||
}, |
||||
"when": "whichkeyVisible && sideBarVisible && explorerViewletVisible" |
||||
}, |
||||
// 编辑器大小 |
||||
{ |
||||
"key": "shift+ctrl+0", |
||||
"command": "workbench.action.evenEditorWidths" |
||||
}, |
||||
{ |
||||
"key": "ctrl+down", |
||||
"command": "workbench.action.decreaseViewHeight" |
||||
}, |
||||
{ |
||||
"key": "ctrl+up", |
||||
"command": "workbench.action.increaseViewHeight" |
||||
}, |
||||
{ |
||||
"key": "ctrl+right", |
||||
"command": "workbench.action.decreaseViewWidth" |
||||
}, |
||||
{ |
||||
"key": "ctrl+left", |
||||
"command": "workbench.action.increaseViewWidth" |
||||
}, |
||||
{ |
||||
"key": "alt+j", |
||||
"command": "workbench.action.togglePanel" |
||||
}, |
||||
{ |
||||
"key": "ctrl+j", |
||||
"command": "-workbench.action.togglePanel" |
||||
}, |
||||
// replace vim C-d C-u |
||||
{ |
||||
"key": "ctrl+d", |
||||
"command": "cursorPageDown", |
||||
"when": "textInputFocus" |
||||
}, |
||||
{ |
||||
"key": "ctrl+u", |
||||
"command": "cursorPageUp", |
||||
"when": "textInputFocus" |
||||
} |
||||
] |
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
{ |
||||
"name": "shizhong", |
||||
"version": "1.0.0", |
||||
"description": "", |
||||
"author": "", |
||||
"license": "", |
||||
"keywords": [], |
||||
"scripts": { |
||||
"lint:fix": "eslint . --fix" |
||||
}, |
||||
"dependencies": { |
||||
"@vant/weapp": "^1.11.6", |
||||
"crypto-js": "^4.2.0", |
||||
"dayjs": "^1.11.13", |
||||
"miniprogram-licia": "^1.39.2", |
||||
"mp-html": "^2.5.0", |
||||
"typescript": "^5.3.3" |
||||
}, |
||||
"devDependencies": { |
||||
"@antfu/eslint-config": "^3.7.3", |
||||
"eslint": "^9.12.0", |
||||
"eslint-config-prettier": "^9.1.0", |
||||
"miniprogram-api-typings": "^4.0.1", |
||||
"prettier": "3.3.3" |
||||
} |
||||
} |
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
{ |
||||
"description": "项目配置文件", |
||||
"miniprogramRoot": "src/", |
||||
"compileType": "miniprogram", |
||||
"setting": { |
||||
"useCompilerPlugins": [ |
||||
"typescript", |
||||
"sass" |
||||
], |
||||
"babelSetting": { |
||||
"ignore": [], |
||||
"disablePlugins": [], |
||||
"outputPath": "" |
||||
}, |
||||
"coverView": false, |
||||
"postcss": false, |
||||
"minified": false, |
||||
"enhance": true, |
||||
"showShadowRootInWxmlPanel": false, |
||||
"packNpmManually": true, |
||||
"packNpmRelationList": [ |
||||
{ |
||||
"packageJsonPath": "package.json", |
||||
"miniprogramNpmDistDir": "./src" |
||||
} |
||||
], |
||||
"ignoreUploadUnusedFiles": true, |
||||
"compileHotReLoad": false, |
||||
"skylineRenderEnable": true, |
||||
"es6": true |
||||
}, |
||||
"simulatorType": "wechat", |
||||
"simulatorPluginLibVersion": {}, |
||||
"condition": {}, |
||||
"srcMiniprogramRoot": "src/", |
||||
"editorSetting": { |
||||
"tabIndent": "insertSpaces", |
||||
"tabSize": 2 |
||||
}, |
||||
"libVersion": "2.32.3", |
||||
"ignore": [], |
||||
"packOptions": { |
||||
"ignore": [ |
||||
{ |
||||
"value": "/images/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "/images/**/*.*", |
||||
"type": "glob" |
||||
}, |
||||
{ |
||||
"value": "/images/**/**/*.*", |
||||
"type": "glob" |
||||
} |
||||
], |
||||
"include": [ |
||||
{ |
||||
"value": "/images/tabbar/*.*", |
||||
"type": "glob" |
||||
} |
||||
] |
||||
}, |
||||
"appid": "wxbdf6f933281b1eb4" |
||||
} |
@ -0,0 +1,99 @@
@@ -0,0 +1,99 @@
|
||||
{ |
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", |
||||
"projectname": "shizhong-miniprogram", |
||||
"setting": { |
||||
"compileHotReLoad": true, |
||||
"urlCheck": true |
||||
}, |
||||
"condition": { |
||||
"miniprogram": { |
||||
"list": [ |
||||
{ |
||||
"name": "pages/classify/index", |
||||
"pathName": "pages/classify/index", |
||||
"query": "id=9", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "pages/article/index", |
||||
"pathName": "pages/article/index", |
||||
"query": "id=8", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "文章详情", |
||||
"pathName": "pages/article/index", |
||||
"query": "id=8", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "个人信息", |
||||
"pathName": "pages/userInfo/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "隐私协议", |
||||
"pathName": "pages/protocol/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "搜索", |
||||
"pathName": "pages/search/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "分类列表", |
||||
"pathName": "pages/classify/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "我的收藏", |
||||
"pathName": "pages/collection/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "我的", |
||||
"pathName": "pages/my/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "首页", |
||||
"pathName": "pages/home/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "调研", |
||||
"pathName": "pages/topic/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
}, |
||||
{ |
||||
"name": "登录", |
||||
"pathName": "pages/login/index", |
||||
"query": "", |
||||
"launchMode": "default", |
||||
"scene": null |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"libVersion": "3.7.7" |
||||
} |
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
{ |
||||
"$schema": "https://dldir1.qq.com/WechatWebDev/editor-extension/wx-json/app.schema.json", |
||||
"pages": [ |
||||
"pages/home/index", |
||||
"pages/login/index", |
||||
"pages/switchLogin/index", |
||||
"pages/my/index", |
||||
"pages/topic/index", |
||||
"pages/collection/index", |
||||
"pages/classify/index", |
||||
"pages/article/index", |
||||
"pages/search/index", |
||||
"pages/protocol/index", |
||||
"pages/userInfo/index", |
||||
"pages/longPicture/index" |
||||
], |
||||
"preloadRule": {}, |
||||
"window": { |
||||
"backgroundTextStyle": "light", |
||||
"navigationBarBackgroundColor": "#fff", |
||||
"navigationBarTitleText": "Weixin", |
||||
"navigationBarTextStyle": "black", |
||||
"navigationStyle": "custom" |
||||
}, |
||||
"tabBar": { |
||||
"custom": false, |
||||
"color": "#4E5969", |
||||
"selectedColor": "#3FAFFA", |
||||
"borderStyle": "white", |
||||
"list": [ |
||||
{ |
||||
"iconPath": "/images/tabbar/tab1.png", |
||||
"selectedIconPath": "/images/tabbar/tab-active1.png", |
||||
"pagePath": "pages/home/index", |
||||
"text": "首页" |
||||
}, |
||||
{ |
||||
"iconPath": "/images/tabbar/tab2.png", |
||||
"selectedIconPath": "/images/tabbar/tab-active2.png", |
||||
"pagePath": "pages/my/index", |
||||
"text": "我的" |
||||
} |
||||
] |
||||
}, |
||||
"resolveAlias": { |
||||
"@/*": "/*" |
||||
}, |
||||
"rendererOptions": { |
||||
"skyline": { |
||||
"defaultDisplayBlock": true, |
||||
"disableABTest": true, |
||||
"sdkVersionBegin": "3.0.0", |
||||
"sdkVersionEnd": "15.255.255" |
||||
} |
||||
}, |
||||
"componentFramework": "glass-easel", |
||||
"sitemapLocation": "sitemap.json", |
||||
"lazyCodeLoading": "requiredComponents", |
||||
"requiredBackgroundModes": ["audio"] |
||||
} |
@ -0,0 +1,109 @@
@@ -0,0 +1,109 @@
|
||||
import component from '@/utils/component'; |
||||
import relativeTime from '@/utils/dayjs/relativeTime.js'; |
||||
import page from '@/utils/page'; |
||||
import { request } from '@/utils/request'; |
||||
import { parseScene } from './utils/util'; |
||||
const dayjs = require('dayjs'); |
||||
const licia = require('miniprogram-licia'); |
||||
|
||||
require('/utils/dayjs/day-zh-cn.js'); |
||||
|
||||
dayjs.locale('zh-cn'); // 全局使用
|
||||
dayjs.extend(relativeTime); |
||||
|
||||
App<IAppOption>({ |
||||
globalData: { |
||||
// 测试号 wx2b0bb13edf717c1d
|
||||
// dev
|
||||
// appid:wxbdf6f933281b1eb4
|
||||
url: 'https://m.shizhong.hbraas.com', |
||||
upFileUrl: 'https://m.shizhong.hbraas.com/', |
||||
imageUrl: 'https://m.shizhong.hbraas.com/api/shizhong/', |
||||
// pro
|
||||
// appid:wxa4a28b299df7d921
|
||||
// url: 'https://m.shizhong.hbsaas.com',
|
||||
// upFileUrl: 'https://m.shizhong.hbsaas.com/',
|
||||
// imageUrl: 'https://m.shizhong.hbsaas.com/api/shizhong/',
|
||||
|
||||
loginState: '', |
||||
isLogin: 0, |
||||
isAnswer: '0', |
||||
|
||||
scene: null, |
||||
|
||||
backPath: '', |
||||
}, |
||||
onLaunch() { |
||||
Page = page as WechatMiniprogram.Page.Constructor; |
||||
Component = component as WechatMiniprogram.Component.Constructor; |
||||
|
||||
wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }); |
||||
|
||||
wx.login({ |
||||
success: (res) => { |
||||
wx.ajax({ |
||||
method: 'GET', |
||||
url: '?r=shizhong/user/init-login', |
||||
data: { |
||||
code: res.code, |
||||
}, |
||||
}).then((res) => { |
||||
this.globalData.loginState = res.loginState; |
||||
this.globalData.isLogin = res.isLogin || 999; |
||||
}); |
||||
}, |
||||
}); |
||||
|
||||
wx.setInnerAudioOption({ |
||||
obeyMuteSwitch: false, |
||||
mixWithOther: false, |
||||
}); |
||||
}, |
||||
onShow(options) { |
||||
if (options.query.scene) { |
||||
this.globalData.scene = parseScene(options.query.scene); |
||||
} |
||||
}, |
||||
waitLogin(waitLoginState = false, requireLogin = false, bakcPath = '') { |
||||
let time: number; |
||||
return new Promise((resolve) => { |
||||
time = setInterval(() => { |
||||
const { isLogin, loginState } = this.globalData; |
||||
if (loginState) { |
||||
clearInterval(time); |
||||
if (waitLoginState) { |
||||
resolve(true); |
||||
} else if (isLogin === 0 || !isLogin) { |
||||
this.globalData.backPath = bakcPath; |
||||
wx.reLaunch({ url: '/pages/login/index' }); |
||||
} else if (requireLogin && isLogin === 999) { |
||||
this.globalData.backPath = bakcPath; |
||||
wx.reLaunch({ url: '/pages/login/index' }); |
||||
} else { |
||||
resolve(true); |
||||
} |
||||
} |
||||
}, 500); |
||||
}); |
||||
}, |
||||
getUserInfo(self: WechatMiniprogram.Page.Instance<any, any>, callback?: (res: any) => void) { |
||||
wx.ajax({ |
||||
method: 'GET', |
||||
url: '?r=shizhong/account/get-info', |
||||
data: {}, |
||||
}).then((res) => { |
||||
if (self) { |
||||
self.setData({ |
||||
userInfo: res, |
||||
}); |
||||
} |
||||
callback?.(res); |
||||
}); |
||||
}, |
||||
getMenuInfo(self) { |
||||
const menuButtonInfo = wx.getMenuButtonBoundingClientRect(); |
||||
self.setData({ |
||||
menuButtonInfo, |
||||
}); |
||||
}, |
||||
}); |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-popup": "@vant/weapp/popup/index" |
||||
} |
||||
} |
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
.popup1 { |
||||
padding: 110rpx 0 0; |
||||
width: 651rpx; |
||||
height: 820rpx; |
||||
box-sizing: border-box; |
||||
|
||||
.title { |
||||
font-size: 40rpx; |
||||
color: #222222; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
} |
||||
|
||||
.code { |
||||
margin: 48rpx auto 0; |
||||
display: block; |
||||
width: 304rpx; |
||||
height: 304rpx; |
||||
} |
||||
|
||||
.tip { |
||||
margin-top: 40rpx; |
||||
font-size: 32rpx; |
||||
color: #65686c; |
||||
text-align: center; |
||||
} |
||||
.close { |
||||
margin: 120rpx auto 0; |
||||
display: block; |
||||
width: 72rpx; |
||||
height: 72rpx; |
||||
} |
||||
} |
||||
|
||||
.popup3 { |
||||
.badge { |
||||
position: relative; |
||||
z-index: 1; |
||||
display: block; |
||||
margin: 0 auto; |
||||
width: 264rpx; |
||||
height: 264rpx; |
||||
} |
||||
.container { |
||||
margin-top: -130rpx; |
||||
padding: 136rpx 44rpx 0; |
||||
width: 622rpx; |
||||
height: 632rpx; |
||||
box-sizing: border-box; |
||||
background: linear-gradient(180deg, #e7f8ff 0%, #ffffff 100%); |
||||
border-radius: 36rpx 36rpx 36rpx 36rpx; |
||||
.title { |
||||
font-size: 48rpx; |
||||
color: #222222; |
||||
font-weight: bold; |
||||
text-align: center; |
||||
} |
||||
.tip { |
||||
margin-top: 24rpx; |
||||
font-size: 36rpx; |
||||
color: #65686c; |
||||
line-height: 56rpx; |
||||
} |
||||
.btn1 { |
||||
margin-top: 44rpx; |
||||
font-size: 36rpx; |
||||
color: #ffffff; |
||||
height: 88rpx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
background: #3795f7; |
||||
border-radius: 96rpx 96rpx 96rpx 96rpx; |
||||
} |
||||
.btn2 { |
||||
margin-top: 16rpx; |
||||
padding: 16rpx 32rpx; |
||||
font-size: 32rpx; |
||||
color: #3795f7; |
||||
text-align: center; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
const _app = getApp<IAppOption>(); |
||||
|
||||
// pages/story/a.ts
|
||||
Component({ |
||||
/** |
||||
* 组件的属性列表 |
||||
*/ |
||||
properties: { |
||||
show: { |
||||
type: Boolean, |
||||
value: false, |
||||
}, |
||||
type: { |
||||
type: Number, |
||||
value: 0, |
||||
}, |
||||
params: { |
||||
type: Object, |
||||
value: {}, |
||||
}, |
||||
}, |
||||
|
||||
/** |
||||
* 组件的初始数据 |
||||
*/ |
||||
data: {}, |
||||
|
||||
/** |
||||
* 组件的方法列表 |
||||
*/ |
||||
methods: { |
||||
handleConform() { |
||||
this.triggerEvent('conform'); |
||||
}, |
||||
handleClose() { |
||||
this.triggerEvent('close'); |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
<van-popup show="{{ show }}" wx:if="{{type===1}}" custom-style="background: transparent;" bind:close="handleClose"> |
||||
<view |
||||
class="popup1" |
||||
style="background: url('{{imageUrl}}popup1-bg.png?t={{Timestamp}}') no-repeat top center/100% 691rpx" |
||||
> |
||||
<view class="title">关注适中信息微信公众号</view> |
||||
<image class="code" src="{{imageUrl}}{{params.mpPicture}}?t={{Timestamp}}" show-menu-by-longpress></image> |
||||
<view class="tip">长按识别二维码关注</view> |
||||
<image class="close" src="{{imageUrl}}icon-close.png?t={{Timestamp}}" bind:tap="handleClose"></image> |
||||
</view> |
||||
</van-popup> |
||||
|
||||
<van-popup show="{{ show }}" wx:if="{{type===2}}" custom-style="background: transparent;" bind:close="handleClose"> |
||||
<view class="popup1" style="background: url('{{imageUrl}}popup1-bg.png?t={{Timestamp}}') no-repeat top center/100%"> |
||||
<view class="title">添加适中信息企业微信</view> |
||||
<image class="code" src="{{imageUrl}}{{params.qwPicture}}?t={{Timestamp}}" show-menu-by-longpress></image> |
||||
<view class="tip">长按识别二维码添加</view> |
||||
<image class="close" src="{{imageUrl}}icon-close.png?t={{Timestamp}}" bind:tap="handleClose"></image> |
||||
</view> |
||||
</van-popup> |
||||
|
||||
<van-popup show="{{ show }}" wx:if="{{type===3}}" custom-style="background: transparent;" bind:close="handleClose"> |
||||
<view class="popup3"> |
||||
<image class="badge" src="{{imageUrl}}badge.png?t={{Timestamp}}" show-menu-by-longpress></image> |
||||
<view class="container"> |
||||
<view class="title">该账号未开通阅读权益</view> |
||||
<view class="tip">此小程序暂时仅供经邀请的企业用户使用,请使用有权益的手机号登录。</view> |
||||
<view class="btn1" bind:tap="handleConform">换个手机号登录</view> |
||||
<view class="btn2" bind:tap="handleClose">取消</view> |
||||
</view> |
||||
</view> |
||||
</van-popup> |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
const app = getApp(); |
||||
|
||||
Component({ |
||||
properties: { |
||||
pagination: { |
||||
type: Object, |
||||
value() { |
||||
return {}; |
||||
}, |
||||
}, |
||||
}, |
||||
data: { |
||||
imageUrl: app.globalData.imageUrl, |
||||
}, |
||||
methods: { |
||||
handleTouchmove() { |
||||
return false; |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-divider": "@vant/weapp/divider/index" |
||||
} |
||||
} |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
/* components/pagination/index.wxss */ |
||||
.none { |
||||
display: block; |
||||
margin: 30rpx auto; |
||||
width: 80%; |
||||
} |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
<image class="none" src="{{imageUrl}}none.png?t={{Timestamp}}" wx:if="{{pagination.count==0}}"></image> |
||||
<van-divider contentPosition="center" wx:elif="{{pagination.page<pagination.pages}}"> |
||||
<van-loading /> |
||||
加载中... |
||||
</van-divider> |
||||
<van-divider contentPosition="center" wx:elif="{{pagination.page>=pagination.pages}}">没有更多了</van-divider> |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-popup": "@vant/weapp/popup/index", |
||||
"van-uploader": "@vant/weapp/uploader/index" |
||||
} |
||||
} |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
.button { |
||||
padding: 0; |
||||
line-height: 1; |
||||
background-color: transparent; |
||||
&::after { |
||||
border: none; |
||||
outline: none; |
||||
} |
||||
} |
||||
|
||||
.popup1 { |
||||
position: relative; |
||||
width: 580rpx; |
||||
height: 590rpx; |
||||
box-sizing: border-box; |
||||
.bg { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.sure { |
||||
position: absolute; |
||||
width: 100%; |
||||
bottom: 40rpx; |
||||
left: 0; |
||||
text-align: center; |
||||
font-size: 32rpx; |
||||
color: rgba(0, 180, 197, 1); |
||||
line-height: 48rpx; |
||||
} |
||||
} |
@ -0,0 +1,132 @@
@@ -0,0 +1,132 @@
|
||||
const app = getApp<IAppOption>(); |
||||
|
||||
// pages/story/a.ts
|
||||
Component({ |
||||
/** |
||||
* 组件的属性列表 |
||||
*/ |
||||
properties: { |
||||
chooseAvatar: { |
||||
type: Boolean, |
||||
value: false, |
||||
}, |
||||
chooseMessage: { |
||||
type: Boolean, |
||||
value: false, |
||||
}, |
||||
accept: { |
||||
type: String, |
||||
value: 'image', |
||||
}, |
||||
}, |
||||
|
||||
/** |
||||
* 组件的初始数据 |
||||
*/ |
||||
data: { |
||||
cacheEditParams: {}, |
||||
}, |
||||
|
||||
/** |
||||
* 组件的方法列表 |
||||
*/ |
||||
methods: { |
||||
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]; //将后缀名返回出来
|
||||
}, |
||||
handleAfterRead(e) { |
||||
this.uploadFile(e.detail.file).then((res) => { |
||||
this.triggerEvent('file', res as object); |
||||
}); |
||||
}, |
||||
handleChooseAvatar(e) { |
||||
this.uploadFile({ |
||||
fileType: 'image', |
||||
tempFilePath: e.detail.avatarUrl, |
||||
size: 0, |
||||
}).then((res) => { |
||||
this.triggerEvent('file', res as object); |
||||
}); |
||||
}, |
||||
handleChooseFile() { |
||||
wx.chooseMessageFile({ |
||||
type: 'file', |
||||
count: 1, |
||||
success: (res) => { |
||||
this.uploadFile({ |
||||
...res.tempFiles[0], |
||||
fileType: res.tempFiles[0].type, |
||||
tempFilePath: res.tempFiles[0].path, |
||||
}).then((res) => { |
||||
this.triggerEvent('file', res as object); |
||||
}); |
||||
}, |
||||
fail() { |
||||
wx.showToast({ |
||||
icon: 'none', |
||||
title: '取消选择', |
||||
}); |
||||
}, |
||||
}); |
||||
}, |
||||
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' || item.type === 'video') { |
||||
url += 'video'; |
||||
item.tempFilePath = item.url; |
||||
} 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 suffix = this.GetExtensionFileName(data.data.Url); |
||||
const expandJson = { |
||||
fileId: '', |
||||
name: item.name || `病历相关文件.${suffix}`, |
||||
size: (item.size / 1024).toFixed(2), |
||||
fileUrl: data.data.Url, |
||||
suffix, |
||||
type: item.fileType, |
||||
imgUrl: '', |
||||
duration: 0, |
||||
videoUrl: '', |
||||
hash: '', |
||||
}; |
||||
if (item.fileType === 'image') { |
||||
expandJson.imgUrl = data.data.Url; |
||||
} else if (item.fileType === 'video' || item.type === 'video') { |
||||
expandJson.imgUrl = data.data.SnapshotUrl; |
||||
} else if (item.fileType === 'audio') { |
||||
expandJson.duration = Number.parseInt(String(item.duration / 1000)); |
||||
} |
||||
resolve(expandJson); |
||||
}, |
||||
fail() { |
||||
wx.hideLoading(); |
||||
reject(new Error('上传失败')); |
||||
}, |
||||
}); |
||||
}); |
||||
}, |
||||
}, |
||||
}); |
||||
|
||||
export {}; |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
<button class="button" wx:if="{{chooseAvatar}}" open-type="chooseAvatar" bindchooseavatar="handleChooseAvatar"> |
||||
<slot></slot> |
||||
</button> |
||||
<button class="button" wx:elif="{{chooseMessage}}" bind:tap="handleChooseFile"> |
||||
<slot></slot> |
||||
</button> |
||||
<van-uploader wx:else accept="{{accept}}" max-count="{{1}}" bind:after-read="handleAfterRead"> |
||||
<slot></slot> |
||||
</van-uploader> |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": {} |
||||
} |
@ -0,0 +1,130 @@
@@ -0,0 +1,130 @@
|
||||
.tabbar { |
||||
padding: 0 0 calc(env(safe-area-inset-bottom) + 12rpx); |
||||
display: flex; |
||||
justify-content: space-between; |
||||
background-color: #fff; |
||||
box-shadow: 0rpx 3rpx 27rpx 0rpx rgba(40, 48, 49, 0.1); |
||||
.custom { |
||||
flex-shrink: 0; |
||||
position: relative; |
||||
width: 94rpx; |
||||
height: 64rpx; |
||||
.add { |
||||
position: absolute; |
||||
top: -42rpx; |
||||
width: 94rpx; |
||||
height: 94rpx; |
||||
} |
||||
.popup-tip { |
||||
padding: 20rpx 34rpx 28rpx; |
||||
position: absolute; |
||||
top: -60rpx; |
||||
left: 50%; |
||||
transform: translate(-50%, -100%); |
||||
border-radius: 16rpx; |
||||
background: linear-gradient(90deg, #00b4c5 0%, #54e2b4 100%); |
||||
box-shadow: 0 4rpx 11rpx rgba(0, 0, 0, 0.08); |
||||
.close { |
||||
position: absolute; |
||||
top: -10rpx; |
||||
right: -10rpx; |
||||
width: 40rpx; |
||||
height: 40rpx; |
||||
} |
||||
.content { |
||||
text-align: center; |
||||
font-size: 32rpx; |
||||
color: #fff; |
||||
white-space: nowrap; |
||||
line-height: 48rpx; |
||||
.plus { |
||||
color: #fff; |
||||
font-size: 48rpx; |
||||
font-weight: bold; |
||||
} |
||||
} |
||||
.pt-footer { |
||||
margin-top: 16rpx; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
gap: 24rpx; |
||||
white-space: nowrap; |
||||
.ok { |
||||
padding: 16rpx 42rpx; |
||||
font-size: 24rpx; |
||||
color: #00b4c5; |
||||
font-size: 32rpx; |
||||
line-height: 32rpx; |
||||
border-radius: 120rpx; |
||||
background: #fff; |
||||
} |
||||
} |
||||
&::after { |
||||
position: absolute; |
||||
content: ""; |
||||
bottom: -10rpx; |
||||
left: 50%; |
||||
transform: translateX(-50%); |
||||
width: 0; |
||||
height: 0; |
||||
border-style: solid; |
||||
border-width: 12rpx 12rpx 0 12rpx; |
||||
border-color: #56cabb transparent transparent transparent; |
||||
} |
||||
} |
||||
} |
||||
.tab-item { |
||||
position: relative; |
||||
padding-top: 10rpx; |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
align-items: center; |
||||
|
||||
.icon-wrap { |
||||
position: relative; |
||||
width: 48rpx; |
||||
height: 48rpx; |
||||
.icon { |
||||
display: block; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.icon-active { |
||||
display: none; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.dot { |
||||
position: absolute; |
||||
top: 0; |
||||
right: 0; |
||||
width: 16rpx; |
||||
height: 16rpx; |
||||
border-radius: 50%; |
||||
background-color: #ed4f39; |
||||
} |
||||
} |
||||
.name { |
||||
margin-top: 8rpx; |
||||
font-size: 22rpx; |
||||
color: rgba(20, 21, 21, 1); |
||||
line-height: 21rpx; |
||||
} |
||||
&.active { |
||||
.icon-wrap { |
||||
.icon { |
||||
display: none; |
||||
} |
||||
.icon-active { |
||||
display: block; |
||||
} |
||||
} |
||||
.name { |
||||
color: rgba(0, 180, 197, 1); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
const _app = getApp<IAppOption>(); |
||||
|
||||
// pages/story/a.ts
|
||||
Component({ |
||||
/** |
||||
* 组件的属性列表 |
||||
*/ |
||||
properties: {}, |
||||
|
||||
/** |
||||
* 组件的初始数据 |
||||
*/ |
||||
data: { |
||||
showEntryCase: false, |
||||
active: 0, |
||||
notice: false, |
||||
tabbar: [ |
||||
{ |
||||
path: "/pages/home/index", |
||||
name: "首页", |
||||
icon: "tab1.png", |
||||
iconActive: "tab-active1.png", |
||||
activeIndex: 1, |
||||
}, |
||||
{ |
||||
path: "/pages/cases/index", |
||||
name: "病历", |
||||
icon: "tab2.png", |
||||
iconActive: "tab-active2.png", |
||||
activeIndex: 2, |
||||
}, |
||||
{ |
||||
custom: true, |
||||
path: "/module1/pages/entryCases/index", |
||||
}, |
||||
{ |
||||
path: "/pages/chatRoomList/index", |
||||
name: "学习窗", |
||||
icon: "tab3.png", |
||||
iconActive: "tab-active3.png", |
||||
activeIndex: 3, |
||||
}, |
||||
{ |
||||
path: "/pages/my/index", |
||||
name: "我的", |
||||
icon: "tab4.png", |
||||
iconActive: "tab-active4.png", |
||||
activeIndex: 4, |
||||
}, |
||||
], |
||||
userInfo: {}, |
||||
}, |
||||
/** |
||||
* 组件的方法列表 |
||||
*/ |
||||
methods: { |
||||
handleTab(e: any) { |
||||
const { index } = e.currentTarget.dataset; |
||||
const tab = this.data.tabbar[index]; |
||||
if (tab.custom) { |
||||
this.handleClsoeCaseTip(); |
||||
wx.navigateTo({ |
||||
url: tab.path, |
||||
}); |
||||
} else { |
||||
wx.switchTab({ |
||||
url: tab.path, |
||||
}); |
||||
} |
||||
}, |
||||
}, |
||||
}); |
||||
|
||||
export {}; |
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
<view class="tabbar"> |
||||
<block wx:for="{{tabbar}}" wx:key="index"> |
||||
<view class="custom" wx:if="{{item.custom && userInfo.DoctorLevel<3}}" bind:tap="handleTab" data-index="{{index}}"> |
||||
<image class="add" src="{{imageUrl}}tabbar/add.png?t={{Timestamp}}"></image> |
||||
<view class="popup-tip" wx:if="{{showEntryCase}}"> |
||||
<image class="close" catch:tap="handleClsoeCaseTip" src="{{imageUrl}}icon-close-white.png?t={{Timestamp}}"></image> |
||||
<view class="content"> |
||||
点击 |
||||
<text class="plus">+</text> |
||||
,可录入病历 |
||||
<view></view> |
||||
邀约合作医生一起讨论哦 |
||||
</view> |
||||
<view class="pt-footer"> |
||||
<view class="ok">去录入</view> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
<view |
||||
class="tab-item {{active===item.activeIndex && 'active'}}" |
||||
wx:elif="{{!item.custom}}" |
||||
bind:tap="handleTab" |
||||
data-index="{{index}}" |
||||
> |
||||
<view class="icon-wrap"> |
||||
<view class="dot" wx:if="{{notice && index===3}}"></view> |
||||
<image class="icon" src="{{imageUrl}}tabbar/{{item.icon}}?t={{Timestamp}}"></image> |
||||
<image class="icon-active" src="{{imageUrl}}tabbar/{{item.iconActive}}?t={{Timestamp}}"></image> |
||||
</view> |
||||
<view class="name">{{item.name}}</view> |
||||
</view> |
||||
</block> |
||||
</view> |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 436 B |
After Width: | Height: | Size: 329 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 551 B |
After Width: | Height: | Size: 479 B |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 487 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 123 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 270 KiB |
After Width: | Height: | Size: 200 KiB |
After Width: | Height: | Size: 206 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 117 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 220 KiB |
After Width: | Height: | Size: 6.4 KiB |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export {}; |
@ -0,0 +1,78 @@
@@ -0,0 +1,78 @@
|
||||
"use strict"; |
||||
Object.defineProperty(exports, "__esModule", { value: true }); |
||||
var component_1 = require("../common/component"); |
||||
var button_1 = require("../mixins/button"); |
||||
(0, component_1.VantComponent)({ |
||||
classes: ['list-class'], |
||||
mixins: [button_1.button], |
||||
props: { |
||||
show: Boolean, |
||||
title: String, |
||||
cancelText: String, |
||||
description: String, |
||||
round: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, |
||||
zIndex: { |
||||
type: Number, |
||||
value: 100, |
||||
}, |
||||
actions: { |
||||
type: Array, |
||||
value: [], |
||||
}, |
||||
overlay: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, |
||||
closeOnClickOverlay: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, |
||||
closeOnClickAction: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, |
||||
safeAreaInsetBottom: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, |
||||
rootPortal: { |
||||
type: Boolean, |
||||
value: false, |
||||
}, |
||||
}, |
||||
methods: { |
||||
onSelect: function (event) { |
||||
var _this = this; |
||||
var index = event.currentTarget.dataset.index; |
||||
var _a = this.data, actions = _a.actions, closeOnClickAction = _a.closeOnClickAction, canIUseGetUserProfile = _a.canIUseGetUserProfile; |
||||
var item = actions[index]; |
||||
if (item) { |
||||
this.$emit('select', item); |
||||
if (closeOnClickAction) { |
||||
this.onClose(); |
||||
} |
||||
if (item.openType === 'getUserInfo' && canIUseGetUserProfile) { |
||||
wx.getUserProfile({ |
||||
desc: item.getUserProfileDesc || ' ', |
||||
complete: function (userProfile) { |
||||
_this.$emit('getuserinfo', userProfile); |
||||
}, |
||||
}); |
||||
} |
||||
} |
||||
}, |
||||
onCancel: function () { |
||||
this.$emit('cancel'); |
||||
}, |
||||
onClose: function () { |
||||
this.$emit('close'); |
||||
}, |
||||
onClickOverlay: function () { |
||||
this.$emit('click-overlay'); |
||||
this.onClose(); |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-icon": "../icon/index", |
||||
"van-popup": "../popup/index", |
||||
"van-loading": "../loading/index" |
||||
} |
||||
} |
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" /> |
||||
|
||||
<van-popup |
||||
show="{{ show }}" |
||||
position="bottom" |
||||
round="{{ round }}" |
||||
z-index="{{ zIndex }}" |
||||
overlay="{{ overlay }}" |
||||
custom-class="van-action-sheet custom-class" |
||||
safe-area-inset-bottom="{{ safeAreaInsetBottom }}" |
||||
close-on-click-overlay="{{ closeOnClickOverlay }}" |
||||
root-portal="{{ rootPortal }}" |
||||
bind:close="onClickOverlay" |
||||
> |
||||
<view wx:if="{{ title }}" class="van-action-sheet__header"> |
||||
{{ title }} |
||||
<van-icon |
||||
name="cross" |
||||
custom-class="van-action-sheet__close" |
||||
bind:click="onClose" |
||||
/> |
||||
</view> |
||||
<view wx:if="{{ description }}" class="van-action-sheet__description van-hairline--bottom"> |
||||
{{ description }} |
||||
</view> |
||||
<view wx:if="{{ actions && actions.length }}" class="list-class"> |
||||
<!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 --> |
||||
<button |
||||
wx:for="{{ actions }}" |
||||
wx:key="index" |
||||
open-type="{{ item.disabled || item.loading || (canIUseGetUserProfile && item.openType === 'getUserInfo') ? '' : item.openType }}" |
||||
style="{{ item.color ? 'color: ' + item.color : '' }}" |
||||
class="{{ utils.bem('action-sheet__item', { disabled: item.disabled || item.loading }) }} {{ item.className || '' }}" |
||||
hover-class="van-action-sheet__item--hover" |
||||
data-index="{{ index }}" |
||||
bindtap="{{ item.disabled || item.loading ? '' : 'onSelect' }}" |
||||
bindgetuserinfo="onGetUserInfo" |
||||
bindcontact="onContact" |
||||
bindgetphonenumber="onGetPhoneNumber" |
||||
binderror="onError" |
||||
bindlaunchapp="onLaunchApp" |
||||
bindopensetting="onOpenSetting" |
||||
lang="{{ lang }}" |
||||
session-from="{{ sessionFrom }}" |
||||
send-message-title="{{ sendMessageTitle }}" |
||||
send-message-path="{{ sendMessagePath }}" |
||||
send-message-img="{{ sendMessageImg }}" |
||||
show-message-card="{{ showMessageCard }}" |
||||
app-parameter="{{ appParameter }}" |
||||
> |
||||
<block wx:if="{{ !item.loading }}"> |
||||
{{ item.name }} |
||||
<view wx:if="{{ item.subname }}" class="van-action-sheet__subname" >{{ item.subname }}</view> |
||||
</block> |
||||
<van-loading wx:else custom-class="van-action-sheet__loading" size="22px" /> |
||||
</button> |
||||
</view> |
||||
<slot /> |
||||
<block wx:if="{{ cancelText }}"> |
||||
<view class="van-action-sheet__gap" /> |
||||
<view |
||||
class="van-action-sheet__cancel" |
||||
hover-class="van-action-sheet__cancel--hover" |
||||
hover-stay-time="70" |
||||
bind:tap="onCancel" |
||||
> |
||||
{{ cancelText }} |
||||
</view> |
||||
</block> |
||||
</van-popup> |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-action-sheet{color:var(--action-sheet-item-text-color,#323233);max-height:var(--action-sheet-max-height,90%)!important}.van-action-sheet__cancel,.van-action-sheet__item{background-color:var(--action-sheet-item-background,#fff);font-size:var(--action-sheet-item-font-size,16px);line-height:var(--action-sheet-item-line-height,22px);padding:14px 16px;text-align:center}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5}.van-action-sheet__cancel:after,.van-action-sheet__item:after{border-width:0}.van-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,#646566)}.van-action-sheet__gap{background-color:var(--action-sheet-cancel-padding-color,#f7f8fa);display:block;height:var(--action-sheet-cancel-padding-top,8px)}.van-action-sheet__item--disabled{color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{color:var(--action-sheet-subname-color,#969799);font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.van-action-sheet__header{font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--font-weight-bold,500);line-height:var(--action-sheet-header-height,48px);text-align:center}.van-action-sheet__description{color:var(--action-sheet-description-color,#969799);font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.van-action-sheet__close{color:var(--action-sheet-close-icon-color,#c8c9cc);font-size:var(--action-sheet-close-icon-size,22px)!important;line-height:inherit!important;padding:var(--action-sheet-close-icon-padding,0 16px);position:absolute!important;right:0;top:0}.van-action-sheet__loading{display:flex!important} |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export {}; |
@ -0,0 +1,235 @@
@@ -0,0 +1,235 @@
|
||||
"use strict"; |
||||
var __assign = (this && this.__assign) || function () { |
||||
__assign = Object.assign || function(t) { |
||||
for (var s, i = 1, n = arguments.length; i < n; i++) { |
||||
s = arguments[i]; |
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) |
||||
t[p] = s[p]; |
||||
} |
||||
return t; |
||||
}; |
||||
return __assign.apply(this, arguments); |
||||
}; |
||||
Object.defineProperty(exports, "__esModule", { value: true }); |
||||
var component_1 = require("../common/component"); |
||||
var shared_1 = require("../picker/shared"); |
||||
var utils_1 = require("../common/utils"); |
||||
var EMPTY_CODE = '000000'; |
||||
(0, component_1.VantComponent)({ |
||||
classes: ['active-class', 'toolbar-class', 'column-class'], |
||||
props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: { |
||||
type: Boolean, |
||||
value: true, |
||||
}, value: { |
||||
type: String, |
||||
observer: function (value) { |
||||
this.code = value; |
||||
this.setValues(); |
||||
}, |
||||
}, areaList: { |
||||
type: Object, |
||||
value: {}, |
||||
observer: 'setValues', |
||||
}, columnsNum: { |
||||
type: null, |
||||
value: 3, |
||||
}, columnsPlaceholder: { |
||||
type: Array, |
||||
observer: function (val) { |
||||
this.setData({ |
||||
typeToColumnsPlaceholder: { |
||||
province: val[0] || '', |
||||
city: val[1] || '', |
||||
county: val[2] || '', |
||||
}, |
||||
}); |
||||
}, |
||||
} }), |
||||
data: { |
||||
columns: [{ values: [] }, { values: [] }, { values: [] }], |
||||
typeToColumnsPlaceholder: {}, |
||||
}, |
||||
mounted: function () { |
||||
var _this = this; |
||||
(0, utils_1.requestAnimationFrame)(function () { |
||||
_this.setValues(); |
||||
}); |
||||
}, |
||||
methods: { |
||||
getPicker: function () { |
||||
if (this.picker == null) { |
||||
this.picker = this.selectComponent('.van-area__picker'); |
||||
} |
||||
return this.picker; |
||||
}, |
||||
onCancel: function (event) { |
||||
this.emit('cancel', event.detail); |
||||
}, |
||||
onConfirm: function (event) { |
||||
var index = event.detail.index; |
||||
var value = event.detail.value; |
||||
value = this.parseValues(value); |
||||
this.emit('confirm', { value: value, index: index }); |
||||
}, |
||||
emit: function (type, detail) { |
||||
detail.values = detail.value; |
||||
delete detail.value; |
||||
this.$emit(type, detail); |
||||
}, |
||||
parseValues: function (values) { |
||||
var columnsPlaceholder = this.data.columnsPlaceholder; |
||||
return values.map(function (value, index) { |
||||
if (value && |
||||
(!value.code || value.name === columnsPlaceholder[index])) { |
||||
return __assign(__assign({}, value), { code: '', name: '' }); |
||||
} |
||||
return value; |
||||
}); |
||||
}, |
||||
onChange: function (event) { |
||||
var _this = this; |
||||
var _a; |
||||
var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value; |
||||
this.code = value[index].code; |
||||
(_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(function () { |
||||
_this.$emit('change', { |
||||
picker: picker, |
||||
values: _this.parseValues(picker.getValues()), |
||||
index: index, |
||||
}); |
||||
}); |
||||
}, |
||||
getConfig: function (type) { |
||||
var areaList = this.data.areaList; |
||||
return (areaList && areaList["".concat(type, "_list")]) || {}; |
||||
}, |
||||
getList: function (type, code) { |
||||
if (type !== 'province' && !code) { |
||||
return []; |
||||
} |
||||
var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; |
||||
var list = this.getConfig(type); |
||||
var result = Object.keys(list).map(function (code) { return ({ |
||||
code: code, |
||||
name: list[code], |
||||
}); }); |
||||
if (code != null) { |
||||
// oversea code
|
||||
if (code[0] === '9' && type === 'city') { |
||||
code = '9'; |
||||
} |
||||
result = result.filter(function (item) { return item.code.indexOf(code) === 0; }); |
||||
} |
||||
if (typeToColumnsPlaceholder[type] && result.length) { |
||||
// set columns placeholder
|
||||
var codeFill = type === 'province' |
||||
? '' |
||||
: type === 'city' |
||||
? EMPTY_CODE.slice(2, 4) |
||||
: EMPTY_CODE.slice(4, 6); |
||||
result.unshift({ |
||||
code: "".concat(code).concat(codeFill), |
||||
name: typeToColumnsPlaceholder[type], |
||||
}); |
||||
} |
||||
return result; |
||||
}, |
||||
getIndex: function (type, code) { |
||||
var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; |
||||
var list = this.getList(type, code.slice(0, compareNum - 2)); |
||||
// oversea code
|
||||
if (code[0] === '9' && type === 'province') { |
||||
compareNum = 1; |
||||
} |
||||
code = code.slice(0, compareNum); |
||||
for (var i = 0; i < list.length; i++) { |
||||
if (list[i].code.slice(0, compareNum) === code) { |
||||
return i; |
||||
} |
||||
} |
||||
return 0; |
||||
}, |
||||
setValues: function () { |
||||
var picker = this.getPicker(); |
||||
if (!picker) { |
||||
return; |
||||
} |
||||
var code = this.code || this.getDefaultCode(); |
||||
var provinceList = this.getList('province'); |
||||
var cityList = this.getList('city', code.slice(0, 2)); |
||||
var stack = []; |
||||
var indexes = []; |
||||
var columnsNum = this.data.columnsNum; |
||||
if (columnsNum >= 1) { |
||||
stack.push(picker.setColumnValues(0, provinceList, false)); |
||||
indexes.push(this.getIndex('province', code)); |
||||
} |
||||
if (columnsNum >= 2) { |
||||
stack.push(picker.setColumnValues(1, cityList, false)); |
||||
indexes.push(this.getIndex('city', code)); |
||||
if (cityList.length && code.slice(2, 4) === '00') { |
||||
code = cityList[0].code; |
||||
} |
||||
} |
||||
if (columnsNum === 3) { |
||||
stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false)); |
||||
indexes.push(this.getIndex('county', code)); |
||||
} |
||||
return Promise.all(stack) |
||||
.catch(function () { }) |
||||
.then(function () { return picker.setIndexes(indexes); }) |
||||
.catch(function () { }); |
||||
}, |
||||
getDefaultCode: function () { |
||||
var columnsPlaceholder = this.data.columnsPlaceholder; |
||||
if (columnsPlaceholder.length) { |
||||
return EMPTY_CODE; |
||||
} |
||||
var countyCodes = Object.keys(this.getConfig('county')); |
||||
if (countyCodes[0]) { |
||||
return countyCodes[0]; |
||||
} |
||||
var cityCodes = Object.keys(this.getConfig('city')); |
||||
if (cityCodes[0]) { |
||||
return cityCodes[0]; |
||||
} |
||||
return ''; |
||||
}, |
||||
getValues: function () { |
||||
var picker = this.getPicker(); |
||||
if (!picker) { |
||||
return []; |
||||
} |
||||
return this.parseValues(picker.getValues().filter(function (value) { return !!value; })); |
||||
}, |
||||
getDetail: function () { |
||||
var values = this.getValues(); |
||||
var area = { |
||||
code: '', |
||||
country: '', |
||||
province: '', |
||||
city: '', |
||||
county: '', |
||||
}; |
||||
if (!values.length) { |
||||
return area; |
||||
} |
||||
var names = values.map(function (item) { return item.name; }); |
||||
area.code = values[values.length - 1].code; |
||||
if (area.code[0] === '9') { |
||||
area.country = names[1] || ''; |
||||
area.province = names[2] || ''; |
||||
} |
||||
else { |
||||
area.province = names[0] || ''; |
||||
area.city = names[1] || ''; |
||||
area.county = names[2] || ''; |
||||
} |
||||
return area; |
||||
}, |
||||
reset: function (code) { |
||||
this.code = code || ''; |
||||
return this.setValues(); |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-picker": "../picker/index" |
||||
} |
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
<wxs src="./index.wxs" module="computed" /> |
||||
|
||||
<van-picker |
||||
class="van-area__picker" |
||||
active-class="active-class" |
||||
toolbar-class="toolbar-class" |
||||
column-class="column-class" |
||||
show-toolbar="{{ showToolbar }}" |
||||
value-key="name" |
||||
title="{{ title }}" |
||||
loading="{{ loading }}" |
||||
columns="{{ computed.displayColumns(columns, columnsNum) }}" |
||||
item-height="{{ itemHeight }}" |
||||
visible-item-count="{{ visibleItemCount }}" |
||||
cancel-button-text="{{ cancelButtonText }}" |
||||
confirm-button-text="{{ confirmButtonText }}" |
||||
bind:change="onChange" |
||||
bind:confirm="onConfirm" |
||||
bind:cancel="onCancel" |
||||
/> |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
/* eslint-disable */ |
||||
function displayColumns(columns, columnsNum) { |
||||
return columns.slice(0, +columnsNum); |
||||
} |
||||
|
||||
module.exports = { |
||||
displayColumns: displayColumns, |
||||
}; |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss'; |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
export {}; |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
"use strict"; |
||||
Object.defineProperty(exports, "__esModule", { value: true }); |
||||
var component_1 = require("../common/component"); |
||||
var button_1 = require("../mixins/button"); |
||||
var version_1 = require("../common/version"); |
||||
var mixins = [button_1.button]; |
||||
if ((0, version_1.canIUseFormFieldButton)()) { |
||||
mixins.push('wx://form-field-button'); |
||||
} |
||||
(0, component_1.VantComponent)({ |
||||
mixins: mixins, |
||||
classes: ['hover-class', 'loading-class'], |
||||
data: { |
||||
baseStyle: '', |
||||
}, |
||||
props: { |
||||
formType: String, |
||||
icon: String, |
||||
classPrefix: { |
||||
type: String, |
||||
value: 'van-icon', |
||||
}, |
||||
plain: Boolean, |
||||
block: Boolean, |
||||
round: Boolean, |
||||
square: Boolean, |
||||
loading: Boolean, |
||||
hairline: Boolean, |
||||
disabled: Boolean, |
||||
loadingText: String, |
||||
customStyle: String, |
||||
loadingType: { |
||||
type: String, |
||||
value: 'circular', |
||||
}, |
||||
type: { |
||||
type: String, |
||||
value: 'default', |
||||
}, |
||||
dataset: null, |
||||
size: { |
||||
type: String, |
||||
value: 'normal', |
||||
}, |
||||
loadingSize: { |
||||
type: String, |
||||
value: '20px', |
||||
}, |
||||
color: String, |
||||
}, |
||||
methods: { |
||||
onClick: function (event) { |
||||
var _this = this; |
||||
this.$emit('click', event); |
||||
var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang; |
||||
if (openType === 'getUserInfo' && canIUseGetUserProfile) { |
||||
wx.getUserProfile({ |
||||
desc: getUserProfileDesc || ' ', |
||||
lang: lang || 'en', |
||||
complete: function (userProfile) { |
||||
_this.$emit('getuserinfo', userProfile); |
||||
}, |
||||
}); |
||||
} |
||||
}, |
||||
}, |
||||
}); |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
{ |
||||
"component": true, |
||||
"usingComponents": { |
||||
"van-icon": "../icon/index", |
||||
"van-loading": "../loading/index" |
||||
} |
||||
} |
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" /> |
||||
<wxs src="./index.wxs" module="computed" /> |
||||
|
||||
<button |
||||
id="{{ id || buttonId }}" |
||||
data-detail="{{ dataset }}" |
||||
class="custom-class {{ utils.bem('button', [type, size, { block, round, plain, square, loading, disabled, hairline, unclickable: disabled || loading }]) }} {{ hairline ? 'van-hairline--surround' : '' }}" |
||||
hover-class="{{ disabled || loading ? '' : 'van-button--active hover-class'}}" |
||||
lang="{{ lang }}" |
||||
form-type="{{ formType }}" |
||||
style="{{ computed.rootStyle({ plain, color, customStyle }) }}" |
||||
open-type="{{ disabled || loading || (canIUseGetUserProfile && openType === 'getUserInfo') ? '' : openType }}" |
||||
business-id="{{ businessId }}" |
||||
session-from="{{ sessionFrom }}" |
||||
send-message-title="{{ sendMessageTitle }}" |
||||
send-message-path="{{ sendMessagePath }}" |
||||
send-message-img="{{ sendMessageImg }}" |
||||
show-message-card="{{ showMessageCard }}" |
||||
app-parameter="{{ appParameter }}" |
||||
aria-label="{{ ariaLabel }}" |
||||
bindtap="{{ disabled || loading ? '' : 'onClick' }}" |
||||
bindgetuserinfo="onGetUserInfo" |
||||
bindcontact="onContact" |
||||
bindgetphonenumber="onGetPhoneNumber" |
||||
bindgetrealtimephonenumber="onGetRealTimePhoneNumber" |
||||
bindagreeprivacyauthorization="onAgreePrivacyAuthorization" |
||||
binderror="onError" |
||||
bindlaunchapp="onLaunchApp" |
||||
bindopensetting="onOpenSetting" |
||||
bindchooseavatar="onChooseAvatar" |
||||
> |
||||
<block wx:if="{{ loading }}"> |
||||
<van-loading |
||||
custom-class="loading-class" |
||||
size="{{ loadingSize }}" |
||||
type="{{ loadingType }}" |
||||
color="{{ computed.loadingColor({ type, color, plain }) }}" |
||||
/> |
||||
<view wx:if="{{ loadingText }}" class="van-button__loading-text"> |
||||
{{ loadingText }} |
||||
</view> |
||||
</block> |
||||
<block wx:else> |
||||
<van-icon |
||||
wx:if="{{ icon }}" |
||||
size="1.2em" |
||||
name="{{ icon }}" |
||||
class-prefix="{{ classPrefix }}" |
||||
class="van-button__icon" |
||||
custom-style="line-height: inherit;" |
||||
/> |
||||
<view class="van-button__text"> |
||||
<slot /> |
||||
</view> |
||||
</block> |
||||
</button> |
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
/* eslint-disable */ |
||||
var style = require('../wxs/style.wxs'); |
||||
|
||||
function rootStyle(data) { |
||||
if (!data.color) { |
||||
return data.customStyle; |
||||
} |
||||
|
||||
var properties = { |
||||
color: data.plain ? data.color : '#fff', |
||||
background: data.plain ? null : data.color, |
||||
}; |
||||
|
||||
// hide border when color is linear-gradient |
||||
if (data.color.indexOf('gradient') !== -1) { |
||||
properties.border = 0; |
||||
} else { |
||||
properties['border-color'] = data.color; |
||||
} |
||||
|
||||
return style([properties, data.customStyle]); |
||||
} |
||||
|
||||
function loadingColor(data) { |
||||
if (data.plain) { |
||||
return data.color ? data.color : '#c9c9c9'; |
||||
} |
||||
|
||||
if (data.type === 'default') { |
||||
return '#c9c9c9'; |
||||
} |
||||
|
||||
return '#fff'; |
||||
} |
||||
|
||||
module.exports = { |
||||
rootStyle: rootStyle, |
||||
loadingColor: loadingColor, |
||||
}; |