diff --git a/App.vue b/App.vue
index 709d17e..a3755b7 100644
--- a/App.vue
+++ b/App.vue
@@ -22,4 +22,25 @@
}
/* 每个页面公共css */
+
+ /* #ifdef H5 */
+ h1, h2, h3, h4, h5, h6 {
+ font-size: inherit;
+ font-weight: inherit;
+ }
+ ol, ul, menu {
+ list-style: none;
+ }
+ ul, ol {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ }
+ .page {
+ min-height: calc(100vh - 50px) !important;
+ }
+ uni-page-head .uni-page-head {
+ box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
+ }
+ /* #endif */
diff --git a/components/h5-signature/h5-signature.vue b/components/h5-signature/h5-signature.vue
new file mode 100644
index 0000000..fe4f9a3
--- /dev/null
+++ b/components/h5-signature/h5-signature.vue
@@ -0,0 +1,303 @@
+
+
+
+
+ 请在此处手写签名
+ 请横屏书写
+
+
+
+
+
+ 取消
+
+
+ 清除
+
+
+ {{ saving ? '上传中' : '保存' }}
+
+
+
+
+
+
+
+
diff --git a/config/env.js b/config/env.js
index cd7e26d..392e842 100644
--- a/config/env.js
+++ b/config/env.js
@@ -10,7 +10,22 @@ const envConf = {
// 正式版-正式环境
release: {
BASE_URL: 'https://cytx.csybhelp.com',
+ },
+ // H5 环境
+ h5: {
+ BASE_URL: '/pro-api',
}
}
-export default envConf[uni.getAccountInfoSync().miniProgram.envVersion || 'develop']; // 可在此处手
-// export default envConf['develop'];
+
+function getEnvConfig() {
+ // #ifdef H5
+ return envConf['h5']
+ // #endif
+ // #ifdef MP-WEIXIN
+ return envConf[uni.getAccountInfoSync().miniProgram.envVersion || 'develop']
+ // #endif
+ // eslint-disable-next-line no-unreachable
+ return envConf['develop']
+}
+
+export default getEnvConfig()
diff --git a/manifest.json b/manifest.json
index f8a1740..195044a 100644
--- a/manifest.json
+++ b/manifest.json
@@ -60,5 +60,13 @@
"uniStatistics" : {
"enable" : false
},
+ "h5" : {
+ "title" : "肠愈同行",
+ "router" : {
+ "mode" : "history",
+ "base" : "/"
+ },
+ "devServer" : {}
+ },
"vueVersion" : "3"
}
diff --git a/pages.json b/pages.json
index 4bb6d6e..9fd2993 100644
--- a/pages.json
+++ b/pages.json
@@ -11,20 +11,20 @@
{
"path": "pages/index/index",
"style": {
- "navigationBarTitleText": ""
+ "navigationBarTitleText": "肠愈同行"
}
},
{
"path": "pages/profile/profile",
"style": {
- "navigationBarTitleText": ""
+ "navigationBarTitleText": "我的"
}
},
{
"path": "pages/content/content",
"style": {
"navigationStyle": "default",
- "navigationBarTitleText": ""
+ "navigationBarTitleText": "详情"
}
},
{
diff --git a/pages/content/content.vue b/pages/content/content.vue
index 53402eb..0db35da 100644
--- a/pages/content/content.vue
+++ b/pages/content/content.vue
@@ -1,7 +1,7 @@
-
+
@@ -15,6 +15,18 @@ import { onLoad } from '@dcloudio/uni-app'
import { get } from '@/utils/request.js'
import mpHtml from '@/uni_modules/mp-html/components/mp-html/mp-html.vue'
+const mpHtmlTagStyle = {
+ h1: 'font-size:inherit;font-weight:inherit;',
+ h2: 'font-size:inherit;font-weight:inherit;',
+ h3: 'font-size:inherit;font-weight:inherit;',
+ h4: 'font-size:inherit;font-weight:inherit;',
+ h5: 'font-size:inherit;font-weight:inherit;',
+ h6: 'font-size:inherit;font-weight:inherit;',
+ ol: 'list-style:none;margin:0;padding:0;',
+ ul: 'list-style:none;margin:0;padding:0;',
+ menu: 'list-style:none;'
+}
+
const content = ref('')
const loaded = ref(false)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b6303b7..603e007 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -1,13 +1,20 @@
+
+
+
+
+
+
+
-
+
加载中...
@@ -24,6 +31,18 @@ import { get } from '@/utils/request.js'
import { getToken, getUserInfo, setUserInfo } from '@/utils/cache.js'
import mpHtml from '@/uni_modules/mp-html/components/mp-html/mp-html.vue'
+const mpHtmlTagStyle = {
+ h1: 'font-size:inherit;font-weight:inherit;',
+ h2: 'font-size:inherit;font-weight:inherit;',
+ h3: 'font-size:inherit;font-weight:inherit;',
+ h4: 'font-size:inherit;font-weight:inherit;',
+ h5: 'font-size:inherit;font-weight:inherit;',
+ h6: 'font-size:inherit;font-weight:inherit;',
+ ol: 'list-style:none;margin:0;padding:0;',
+ ul: 'list-style:none;margin:0;padding:0;',
+ menu: 'list-style:none;'
+}
+
const CONTENT_CACHE_KEY = 'cytx-index-content'
const content = ref('')
@@ -146,6 +165,20 @@ onShow(() => {
display: block;
}
+.banner-h5 {
+ width: 100%;
+ height: 350px;
+ overflow: hidden;
+
+ .banner-img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ object-position: center bottom;
+ display: block;
+ }
+}
+
.content-area {
background: #fff;
border-radius: 24rpx;
@@ -153,6 +186,9 @@ onShow(() => {
position: relative;
z-index: 1;
padding: 56rpx 40rpx 32rpx;
+ /* #ifdef H5 */
+ margin-top: -172px;
+ /* #endif */
}
.letter {
diff --git a/pages/login/index.vue b/pages/login/index.vue
index 953c837..4ad30d6 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -7,9 +7,29 @@
-
@@ -67,6 +149,9 @@ const goPrivacy = () => {
flex-direction: column;
align-items: center;
padding-top: 25vh;
+ /* #ifdef H5 */
+ padding-top: 10vh;
+ /* #endif */
}
.logo-area {
@@ -94,8 +179,6 @@ const goPrivacy = () => {
color: #b0b3b8;
letter-spacing: 2rpx;
}
-
-
}
.btn-area {
@@ -133,4 +216,59 @@ const goPrivacy = () => {
}
}
}
+
+.phone-form {
+ width: 100%;
+
+ .form-item {
+ margin-bottom: 24rpx;
+ }
+
+ .form-input {
+ width: 100%;
+ height: 88rpx;
+ border: 1rpx solid #dcdfe6;
+ border-radius: 44rpx;
+ padding: 0 36rpx;
+ font-size: 30rpx;
+ box-sizing: border-box;
+ background: #f8f9fa;
+ }
+
+ .code-row {
+ display: flex;
+ gap: 20rpx;
+
+ .code-input {
+ flex: 2;
+ }
+ }
+
+ .sms-btn {
+ flex: 1;
+ height: 88rpx;
+ line-height: 88rpx;
+ padding: 0;
+ background: #0F78E9;
+ color: #fff;
+ border: none;
+ border-radius: 44rpx;
+ font-size: 26rpx;
+ white-space: nowrap;
+ text-align: center;
+
+ &::after {
+ border: none;
+ }
+
+ &[disabled] {
+ background: #a0cfff;
+ color: #fff;
+ }
+ }
+
+ .login-btn {
+ margin-top: 16rpx;
+ }
+}
diff --git a/pages/profile/profile.vue b/pages/profile/profile.vue
index da5fc08..cc0c1a9 100644
--- a/pages/profile/profile.vue
+++ b/pages/profile/profile.vue
@@ -13,7 +13,7 @@
{{ displayName }}
- {{ userInfo.patient.patient_no }}
+ No·{{ userInfo.patient.patient_no }}
@@ -65,7 +65,7 @@
修改手机号
-
@@ -68,6 +72,9 @@ const guardianIdCard = ref('')
const guardianRelation = ref('')
const signImageUrl = ref('')
const submitting = ref(false)
+// #ifdef H5
+const showH5Sign = ref(false)
+// #endif
const onSignatureResult = (data) => {
if (data.url) signImageUrl.value = data.url
@@ -75,17 +82,20 @@ const onSignatureResult = (data) => {
onLoad((options) => {
signType.value = options.type || 'privacy'
- // 回显上次填写的数据
if (options.amount) incomeAmount.value = decodeURIComponent(options.amount)
if (options.guardianName) guardianName.value = decodeURIComponent(options.guardianName)
if (options.guardianIdCard) guardianIdCard.value = decodeURIComponent(options.guardianIdCard)
if (options.guardianRelation) guardianRelation.value = decodeURIComponent(options.guardianRelation)
+ // #ifdef MP-WEIXIN
uni.$on('signatureResult', onSignatureResult)
+ // #endif
loadContent()
})
onBeforeUnmount(() => {
+ // #ifdef MP-WEIXIN
uni.$off('signatureResult', onSignatureResult)
+ // #endif
})
const loadContent = async () => {
@@ -97,9 +107,21 @@ const loadContent = async () => {
} catch (e) {}
}
-const goSignature = () => {
+const openSignature = () => {
+ // #ifdef MP-WEIXIN
uni.navigateTo({ url: '/pages/sign/signature' })
+ // #endif
+ // #ifdef H5
+ showH5Sign.value = true
+ // #endif
+}
+
+// #ifdef H5
+const onH5SignConfirm = (data) => {
+ showH5Sign.value = false
+ if (data.url) signImageUrl.value = data.url
}
+// #endif
const confirmSign = async () => {
if (!signImageUrl.value) {
diff --git a/pages/sign/signature.vue b/pages/sign/signature.vue
index 1899bfb..08c7e2d 100644
--- a/pages/sign/signature.vue
+++ b/pages/sign/signature.vue
@@ -3,6 +3,7 @@
请在此处手写签名
+ 请横屏书写
@@ -181,6 +182,10 @@ const handleSave = () => {
pointer-events: none;
white-space: nowrap;
z-index: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 16rpx;
text {
font-size: 48rpx;
@@ -188,6 +193,11 @@ const handleSave = () => {
font-weight: 300;
letter-spacing: 16rpx;
}
+
+ .hint-sub {
+ font-size: 28rpx;
+ letter-spacing: 8rpx;
+ }
}
.sign-canvas {
diff --git a/vite.config.js b/vite.config.js
new file mode 100644
index 0000000..33e1cbe
--- /dev/null
+++ b/vite.config.js
@@ -0,0 +1,15 @@
+import { defineConfig } from 'vite'
+import uni from '@dcloudio/vite-plugin-uni'
+
+export default defineConfig({
+ plugins: [uni()],
+ server: {
+ proxy: {
+ '/pro-api': {
+ target: 'http://192.168.3.66:8361',
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/pro-api/, '')
+ }
+ }
+ }
+})