diff --git a/.prettierrc b/.prettierrc index 5f406b8..67a42dd 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "$schema":"https://json.schemastore.org/prettierrc.json", + "$schema": "https://json.schemastore.org/prettierrc.json", "printWidth": 120, "tabWidth": 2, "useTabs": false, @@ -11,18 +11,25 @@ "endOfLine": "auto", "htmlWhitespaceSensitivity": "ignore", "singleAttributePerLine": false, + "jsxSingleQuote": true, "overrides": [ { "files": "*.wxml", - "options": { "parser": "html" } + "options": { + "parser": "html" + } }, { "files": "*.wxss", - "options": { "parser": "css" } + "options": { + "parser": "css" + } }, { "files": "*.wxs", - "options": { "parser": "babel" } + "options": { + "parser": "babel" + } } ] } diff --git a/README.md b/README.md index 7a161dc..df8f013 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ 3. 图像识别模糊 可以反向确认 通过ocr识别接口 接入ocr同时识别不到 姓名,年龄等字样,及判断该病历已被涂抹 + https://pic1.zhimg.com/50/v2-dcfbab1219ae4f7a7a6db168bb1580a2_720w.jpg?source=2c26e567 images svn 地址 diff --git a/package.json b/package.json index 01fd7f5..991afe3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "wutian", + "name": "shizhong", "version": "1.0.0", "description": "", "author": "", @@ -19,6 +19,6 @@ "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", "miniprogram-api-typings": "^4.0.1", - "prettier": "^3.3.3" + "prettier": "3.3.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07f148d..4b489a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: specifier: ^4.0.1 version: 4.0.1 prettier: - specifier: ^3.3.3 + specifier: 3.3.3 version: 3.3.3 packages: diff --git a/project.config.json b/project.config.json index 92eb602..56b1eb0 100644 --- a/project.config.json +++ b/project.config.json @@ -43,5 +43,5 @@ "include": [], "ignore": [] }, - "appid": "wxaae50c206446a964" + "appid": "wx2b0bb13edf717c1d" } \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index b770beb..cfd2f51 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,6 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "wutian-miniprogram", + "projectname": "shizhong-miniprogram", "setting": { "compileHotReLoad": true, "urlCheck": true @@ -9,15 +9,29 @@ "miniprogram": { "list": [ { - "name": "调研", - "pathName": "pages/topic/index", + "name": "文章详情", + "pathName": "pages/article/index", "query": "", "launchMode": "default", "scene": null }, { - "name": "登录", - "pathName": "pages/login/index", + "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 @@ -28,6 +42,20 @@ "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 } ] } diff --git a/src/app.json b/src/app.json index b590040..48da4df 100644 --- a/src/app.json +++ b/src/app.json @@ -4,7 +4,10 @@ "pages/home/index", "pages/login/index", "pages/my/index", - "pages/topic/index" + "pages/topic/index", + "pages/collection/index", + "pages/classify/index", + "pages/article/index" ], "preloadRule": {}, "window": { diff --git a/src/app.ts b/src/app.ts index 729468c..692cd1f 100644 --- a/src/app.ts +++ b/src/app.ts @@ -43,21 +43,21 @@ App({ wx.ajax = licia.curry(request)({ gUrl: this.globalData.url }); - wx.login({ - success: (res) => { - wx.ajax({ - method: "GET", - url: "?r=takeda/user/init-login", - data: { - code: res.code, - }, - }).then((res) => { - this.globalData.loginState = res.loginState; - this.globalData.isLogin = res.isLogin; - this.globalData.doctorId = res.doctorId; - }); - }, - }); + // wx.login({ + // success: (res) => { + // wx.ajax({ + // method: "GET", + // url: "?r=takeda/user/init-login", + // data: { + // code: res.code, + // }, + // }).then((res) => { + // this.globalData.loginState = res.loginState; + // this.globalData.isLogin = res.isLogin; + // this.globalData.doctorId = res.doctorId; + // }); + // }, + // }); wx.setInnerAudioOption({ obeyMuteSwitch: false, diff --git a/src/components/global-toast/index.json b/src/components/global-toast/index.json new file mode 100644 index 0000000..074f50b --- /dev/null +++ b/src/components/global-toast/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-popup": "@vant/weapp/popup/index" + } +} diff --git a/src/components/global-toast/index.scss b/src/components/global-toast/index.scss new file mode 100644 index 0000000..af505a7 --- /dev/null +++ b/src/components/global-toast/index.scss @@ -0,0 +1,27 @@ +.popup1 { + padding: 110rpx 0 0; + width: 651rpx; + height: 651rpx; + 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; + } +} diff --git a/src/components/global-toast/index.ts b/src/components/global-toast/index.ts new file mode 100644 index 0000000..de9b15a --- /dev/null +++ b/src/components/global-toast/index.ts @@ -0,0 +1,32 @@ +const _app = getApp(); + +// pages/story/a.ts +Component({ + /** + * 组件的属性列表 + */ + properties: { + show: { + type: Boolean, + value: false, + }, + type: { + type: Number, + value: 0, + }, + }, + + /** + * 组件的初始数据 + */ + data: {}, + + /** + * 组件的方法列表 + */ + methods: { + handleClose() { + this.triggerEvent("close"); + }, + }, +}); diff --git a/src/components/global-toast/index.wxml b/src/components/global-toast/index.wxml new file mode 100644 index 0000000..7e2ff6f --- /dev/null +++ b/src/components/global-toast/index.wxml @@ -0,0 +1,7 @@ + + + 关注适中健康微信公众号 + + 长按识别二维码关注 + + diff --git a/src/images/home-bg.png b/src/images/home-bg.png new file mode 100644 index 0000000..bdb5bd1 Binary files /dev/null and b/src/images/home-bg.png differ diff --git a/src/images/home-card-bg.png b/src/images/home-card-bg.png new file mode 100644 index 0000000..cb768b6 Binary files /dev/null and b/src/images/home-card-bg.png differ diff --git a/src/images/home-logo.png b/src/images/home-logo.png new file mode 100644 index 0000000..8127dbd Binary files /dev/null and b/src/images/home-logo.png differ diff --git a/src/images/home-title.png b/src/images/home-title.png new file mode 100644 index 0000000..795f762 Binary files /dev/null and b/src/images/home-title.png differ diff --git a/src/images/icon-collection-active.png b/src/images/icon-collection-active.png new file mode 100644 index 0000000..5ea867a Binary files /dev/null and b/src/images/icon-collection-active.png differ diff --git a/src/images/icon-collection.png b/src/images/icon-collection.png new file mode 100644 index 0000000..66a27bd Binary files /dev/null and b/src/images/icon-collection.png differ diff --git a/src/images/icon-eye.png b/src/images/icon-eye.png new file mode 100644 index 0000000..a96ca4b Binary files /dev/null and b/src/images/icon-eye.png differ diff --git a/src/images/icon-play.png b/src/images/icon-play.png new file mode 100644 index 0000000..cf3781f Binary files /dev/null and b/src/images/icon-play.png differ diff --git a/src/images/icon-prev.png b/src/images/icon-prev.png new file mode 100644 index 0000000..e73b2b9 Binary files /dev/null and b/src/images/icon-prev.png differ diff --git a/src/images/icon-search.png b/src/images/icon-search.png new file mode 100644 index 0000000..e12c699 Binary files /dev/null and b/src/images/icon-search.png differ diff --git a/src/images/icon-stop.png b/src/images/icon-stop.png new file mode 100644 index 0000000..7aac7d7 Binary files /dev/null and b/src/images/icon-stop.png differ diff --git a/src/images/my-list-icon1.png b/src/images/my-list-icon1.png new file mode 100644 index 0000000..cdc4760 Binary files /dev/null and b/src/images/my-list-icon1.png differ diff --git a/src/images/my-list-icon2.png b/src/images/my-list-icon2.png new file mode 100644 index 0000000..af1e1d1 Binary files /dev/null and b/src/images/my-list-icon2.png differ diff --git a/src/images/place.png b/src/images/place.png new file mode 100644 index 0000000..15f30f8 Binary files /dev/null and b/src/images/place.png differ diff --git a/src/images/popup1-bg.png b/src/images/popup1-bg.png new file mode 100644 index 0000000..9130378 Binary files /dev/null and b/src/images/popup1-bg.png differ diff --git a/src/images/user.png b/src/images/user.png new file mode 100644 index 0000000..e9dff94 Binary files /dev/null and b/src/images/user.png differ diff --git a/src/pages/article/index.json b/src/pages/article/index.json new file mode 100644 index 0000000..2d067ab --- /dev/null +++ b/src/pages/article/index.json @@ -0,0 +1,7 @@ +{ + "navigationStyle": "default", + "navigationBarTitleText": "详情", + "usingComponents": { + "van-slider": "@vant/weapp/slider/index" + } +} diff --git a/src/pages/article/index.scss b/src/pages/article/index.scss new file mode 100644 index 0000000..62785b0 --- /dev/null +++ b/src/pages/article/index.scss @@ -0,0 +1,14 @@ +.page { + padding: 48rpx 32rpx; + .page-title { + font-size: 44rpx; + color: #222222; + font-weight: bold; + line-height: 48rpx; + } + .page-date{ + margin-top: 24rpx; + font-size: 28rpx; + color: #999999; + } +} diff --git a/src/pages/article/index.ts b/src/pages/article/index.ts new file mode 100644 index 0000000..067b6bb --- /dev/null +++ b/src/pages/article/index.ts @@ -0,0 +1,8 @@ +const _app = getApp(); + +Page({ + data: {}, + onLoad() {}, +}); + +export {} diff --git a/src/pages/article/index.wxml b/src/pages/article/index.wxml new file mode 100644 index 0000000..4dae00e --- /dev/null +++ b/src/pages/article/index.wxml @@ -0,0 +1,15 @@ + + 身体活动引用的指南与专家共识 + 2024/05/21 + + + + 概要解读 + 00:01/09:47 + + + + + + + diff --git a/src/pages/classify/index.json b/src/pages/classify/index.json new file mode 100644 index 0000000..41ae150 --- /dev/null +++ b/src/pages/classify/index.json @@ -0,0 +1,8 @@ +{ + "navigationStyle": "default", + "navigationBarTitleText": "分类", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "pagination":"/components/pagination/index" + } +} diff --git a/src/pages/classify/index.scss b/src/pages/classify/index.scss new file mode 100644 index 0000000..d6f09ad --- /dev/null +++ b/src/pages/classify/index.scss @@ -0,0 +1,109 @@ +page { + background-color: #f3f4f5; +} +.page { + padding-bottom: 80rpx; + .nav { + padding: 0 16rpx; + display: flex; + overflow-x: auto; + background-color: #fff; + &::-webkit-scrollbar { + display: none; + } + .nav-item { + flex-shrink: 0; + padding: 32rpx 16rpx; + font-size: 32rpx; + color: #222222; + line-height: 36rpx; + &.active { + font-size: 36rpx; + color: #3795f7; + font-weight: bold; + position: relative; + &::after { + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + content: ""; + width: 44rpx; + height: 8rpx; + background: #3795f7; + border-radius: 0rpx 0rpx 0rpx 0rpx; + } + } + } + } + .types { + padding: 32rpx; + display: flex; + gap: 16rpx; + flex-wrap: wrap; + .type { + min-width: 160rpx; + padding: 8rpx 10rpx; + box-sizing: border-box; + font-size: 28rpx; + color: #65686c; + line-height: 40rpx; + background-color: #fff; + border-radius: 8rpx; + text-align: center; + } + } + .card { + margin: 0 32rpx 24rpx; + padding: 24rpx; + display: flex; + gap: 24rpx; + background: linear-gradient(173deg, #ffffff 0%, #eff7ff 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + &:last-of-type { + margin-bottom: 0; + } + .photo { + flex-shrink: 0; + width: 218rpx; + height: 218rpx; + border-radius: 16rpx; + } + .c-container { + flex: 1; + .title { + font-size: 32rpx; + color: #222222; + font-weight: bold; + line-height: 48rpx; + } + .type { + margin-top: 16rpx; + font-size: 28rpx; + color: #999999; + line-height: 28rpx; + } + .stat { + margin-top: 42rpx; + display: flex; + align-items: center; + gap: 40rpx; + .s-item { + display: flex; + align-items: center; + gap: 8rpx; + font-size: 28rpx; + color: #999999; + .icon { + width: 28rpx; + height: 28rpx; + } + &.active { + color: #3795f7; + } + } + } + } + } +} diff --git a/src/pages/classify/index.ts b/src/pages/classify/index.ts new file mode 100644 index 0000000..65267b1 --- /dev/null +++ b/src/pages/classify/index.ts @@ -0,0 +1,50 @@ +const _app = getApp(); + +Page({ + data: { + background: "transparent", + + pagination: { + page: 1, + pages: 1, + count: 1, + }, + list: [], + }, + onLoad() {}, + getList(newPage = 1) { + // wx.ajax({ + // method: "GET", + // url: `?r=takeda/case/get-list`, + // data: { + // page: newPage, + // }, + // }).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.data.list.length) { + this.getList(page + 1); + } + }, + handleDetail() { + wx.navigateTo({ + url: "/pages/article/index", + }); + }, + handleBack() { + wx.navigateBack(); + }, +}); + +export {}; diff --git a/src/pages/classify/index.wxml b/src/pages/classify/index.wxml new file mode 100644 index 0000000..e3be432 --- /dev/null +++ b/src/pages/classify/index.wxml @@ -0,0 +1,48 @@ + + + 全部 + 引用指南与专家共识 + 引用指南与专家共识 + 引用指南与专家共识 + 引用指南与专家共识 + 引用指南与专家共识 + 引用指南与专家共识 + 引用指南与专家共识 + + + 全部 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + 口腔 + + + + + 骨密度是骨健康的关键指标,我们检查对吗? + 健康管理/口腔 + + + + 123 + + + + 已收藏 + + + + 收藏 + + + + + + diff --git a/src/pages/collection/index.json b/src/pages/collection/index.json new file mode 100644 index 0000000..9806cef --- /dev/null +++ b/src/pages/collection/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "van-nav-bar": "@vant/weapp/nav-bar/index", + "van-icon": "@vant/weapp/icon/index", + "pagination":"/components/pagination/index" + } +} diff --git a/src/pages/collection/index.scss b/src/pages/collection/index.scss new file mode 100644 index 0000000..d370b48 --- /dev/null +++ b/src/pages/collection/index.scss @@ -0,0 +1,56 @@ +page { + background-color: #f3f4f5; +} +.page { + margin: 50rpx 32rpx 0; + padding-bottom: 80rpx; + .card { + padding: 24rpx; + display: flex; + gap: 24rpx; + background: linear-gradient(173deg, #ffffff 0%, #eff7ff 100%); + border-radius: 24rpx 24rpx 24rpx 24rpx; + border: 2rpx solid #ffffff; + .photo { + flex-shrink: 0; + width: 218rpx; + height: 218rpx; + border-radius: 16rpx; + } + .c-container { + flex: 1; + .title { + font-size: 32rpx; + color: #222222; + font-weight: bold; + line-height: 48rpx; + } + .type { + margin-top: 16rpx; + font-size: 28rpx; + color: #999999; + line-height: 28rpx; + } + .stat { + margin-top: 42rpx; + display: flex; + align-items: center; + gap: 40rpx; + .s-item { + display: flex; + align-items: center; + gap: 8rpx; + font-size: 28rpx; + color: #999999; + .icon { + width: 28rpx; + height: 28rpx; + } + &.active { + color: #3795f7; + } + } + } + } + } +} diff --git a/src/pages/collection/index.ts b/src/pages/collection/index.ts new file mode 100644 index 0000000..1e18f4f --- /dev/null +++ b/src/pages/collection/index.ts @@ -0,0 +1,45 @@ +const _app = getApp(); + +Page({ + data: { + background: "transparent", + + pagination: { + page: 1, + pages: 1, + count: 1, + }, + list: [], + }, + onLoad() {}, + getList(newPage = 1) { + // wx.ajax({ + // method: "GET", + // url: `?r=takeda/case/get-list`, + // data: { + // page: newPage, + // }, + // }).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.data.list.length) { + this.getList(page + 1); + } + }, + handleBack() { + wx.navigateBack(); + }, +}); + +export {}; diff --git a/src/pages/collection/index.wxml b/src/pages/collection/index.wxml new file mode 100644 index 0000000..30fed97 --- /dev/null +++ b/src/pages/collection/index.wxml @@ -0,0 +1,34 @@ + + + + + + + + + 骨密度是骨健康的关键指标,我们检查对吗? + 健康管理/口腔 + + + + 123 + + + + 取消收藏 + + + + 收藏 + + + + + + diff --git a/src/pages/home/index.scss b/src/pages/home/index.scss index e69de29..b93694a 100644 --- a/src/pages/home/index.scss +++ b/src/pages/home/index.scss @@ -0,0 +1,157 @@ +page { + background-color: #f3f4f5; +} +.page { + padding-bottom: 10vh; + min-height: 100vh; + .logo { + margin-left: 32rpx; + width: 216rpx; + height: 70rpx; + } + .page-title { + margin: 50rpx 0 0 32rpx; + width: 580rpx; + height: 52rpx; + } + .page-slogan { + margin-top: 22rpx; + margin-left: 32rpx; + font-size: 32rpx; + color: #222222; + } + .search { + margin: 34rpx 32rpx 0; + padding: 0 0 0 24rpx; + display: flex; + align-items: center; + background: linear-gradient(158deg, #ffffff 0%, #f2f9fe 100%); + border-radius: 106rpx 106rpx 106rpx 106rpx; + border: 1px solid #ffffff; + .icon { + width: 36rpx; + height: 36rpx; + } + .input { + flex: 1; + padding: 16rpx; + line-height: 40rpx; + font-size: 28rpx; + } + .place-input { + color: #c9cdd4; + } + } + .swiper { + margin: 36rpx 32rpx 0; + height: 318rpx; + + .wx-swiper-dots { + bottom: 60rpx; + } + .wx-swiper-dot-active { + width: 24rpx !important; + height: 8rpx !important; + border-radius: 5rpx !important; + } + + .swiper-item { + position: relative; + .banner { + position: absolute; + top: 0; + left: 0; + z-index: 1; + display: block; + width: 100%; + height: 274rpx; + } + &::after { + content: ""; + position: absolute; + bottom: 74rpx; + left: 40rpx; + width: 606rpx; + height: 194rpx; + background: rgba(0, 43, 88, 0.28); + box-shadow: 0rpx 8rpx 8rpx 0rpx rgba(0, 0, 0, 0.65); + border-radius: 0rpx 0rpx 0rpx 0rpx; + filter: blur(16.5px); + } + } + } + + .cards { + margin: 0 32rpx; + display: grid; + gap: 28rpx 26rpx; + grid-template-columns: repeat(2, 1fr); + grid-template-rows: repeat(auto-fill, 164rpx); + .card { + padding: 20rpx 30rpx; + display: flex; + justify-content: center; + flex-direction: column; + overflow: hidden; + .title { + font-size: 36rpx; + color: #3795f7; + line-height: 42rpx; + } + .content { + margin-top: 10rpx; + font-size: 28rpx; + color: #65686c; + min-width: 0; + line-height: 40rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + } + + .remark { + margin: 52rpx 32rpx 0; + .r-header { + display: flex; + align-items: center; + gap: 16rpx; + font-size: 36rpx; + color: #222222; + font-weight: bold; + &::before { + content: ""; + width: 8rpx; + height: 34rpx; + background-color: #3795f7; + } + } + .r-content { + margin-top: 30rpx; + padding: 32rpx; + width: 100%; + box-sizing: border-box; + height: 272rpx; + font-size: 32rpx; + background-color: #fff; + border-radius: 24rpx; + } + .textarea-placeholder { + color: #babdc1; + } + .submit { + margin: 28rpx auto 0; + width: 236rpx; + height: 70rpx; + font-size: 28rpx; + color: #fff; + text-align: center; + line-height: 70rpx; + background: linear-gradient(90deg, #134df6 36%, #3795f7 100%); + border-radius: 112rpx 112rpx 112rpx 112rpx; + } + } +} diff --git a/src/pages/home/index.ts b/src/pages/home/index.ts index b792ee4..913ee0c 100644 --- a/src/pages/home/index.ts +++ b/src/pages/home/index.ts @@ -3,4 +3,11 @@ const _app = getApp(); Page({ data: {}, onLoad() {}, + handleDetail() { + wx.navigateTo({ + url: "/pages/classify/index", + }); + }, }); + +export {}; diff --git a/src/pages/home/index.wxml b/src/pages/home/index.wxml index a10af0e..4d39d4b 100644 --- a/src/pages/home/index.wxml +++ b/src/pages/home/index.wxml @@ -1,2 +1,49 @@ - -pages/story/index.wxml + + + + 人人都是家庭健康师,让生活更有质量 + + + + + + + + + + + + 公司综合信息 + 健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策健康政策三医政策 + + + + + 留言板 + + + 提交 + + diff --git a/src/pages/my/index.json b/src/pages/my/index.json index a97367d..4024b52 100644 --- a/src/pages/my/index.json +++ b/src/pages/my/index.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents": { + "van-icon": "@vant/weapp/icon/index", + "global-toast":"/components/global-toast/index" + } } diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss index e69de29..b8a5822 100644 --- a/src/pages/my/index.scss +++ b/src/pages/my/index.scss @@ -0,0 +1,79 @@ +page { + background-color: #f3f4f5; +} +.page { + background: linear-gradient(180deg, #d2f1fe 0%, rgba(244, 248, 249, 0) 100%) no-repeat top center / 100% 682rpx; + .no-login { + margin: 32rpx 62rpx 0; + display: flex; + align-items: center; + gap: 24rpx; + .avatar { + width: 160rpx; + height: 160rpx; + } + .name { + font-size: 40rpx; + color: #3795f7; + } + } + .login { + margin: 32rpx 62rpx 0; + display: flex; + align-items: center; + gap: 24rpx; + .avatar { + width: 160rpx; + height: 160rpx; + border-radius: 50%; + } + .user { + flex: 1; + .name { + font-size: 40rpx; + color: #141515; + font-weight: bold; + line-height: 1; + } + .tel { + margin-top: 8rpx; + font-size: 28rpx; + color: #999999; + line-height: 40rpx; + } + .status { + margin-top: 8rpx; + font-size: 28rpx; + color: #999999; + line-height: 40rpx; + } + } + .switch { + font-size: 28rpx; + color: #999999; + } + } + .nav-list { + margin: 70rpx 32rpx 0; + padding: 0 30rpx; + background: #ffffff; + border-radius: 16rpx 16rpx 16rpx 16rpx; + border: 2rpx solid #ffffff; + .nav-item { + padding: 32rpx 0; + display: flex; + align-items: center; + border-bottom: 1px solid #f0f0f0; + font-size: 36rpx; + color: #000000; + &:last-of-type { + border: none; + } + .icon { + margin-right: 20rpx; + width: 48rpx; + height: 48rpx; + } + } + } +} diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index b792ee4..b0f762e 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -1,6 +1,25 @@ const _app = getApp(); Page({ - data: {}, + data: { + toastShow: false, + toastType: 1, + }, onLoad() {}, + handleCollection() { + wx.navigateTo({ + url: "/pages/collection/index", + }); + }, + handleOffice() { + this.setData({ + toastShow: true, + toastType: 1, + }); + }, + handleToastClose() { + this.setData({ + toastShow: false, + }); + }, }); diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index a10af0e..5757310 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -1,2 +1,30 @@ - -pages/story/index.wxml + + + + + + + 我的收藏 + + + + 关注公众号 + + + + + diff --git a/src/pages/topic/index.json b/src/pages/topic/index.json index a97367d..0700ef8 100644 --- a/src/pages/topic/index.json +++ b/src/pages/topic/index.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "van-progress": "@vant/weapp/progress/index" + } } diff --git a/src/pages/topic/index.scss b/src/pages/topic/index.scss index 264746f..656fe4d 100644 --- a/src/pages/topic/index.scss +++ b/src/pages/topic/index.scss @@ -4,7 +4,93 @@ page { .page { min-height: 100vh; - .topic{ + overflow: hidden; + + .swiper { + width: 100%; height: 1232rpx; + box-sizing: border-box; + } + + .topic { + position: relative; + padding: 86rpx 88rpx; + width: 100%; + height: 1232rpx; + box-sizing: border-box; + + .order { + font-size: 60rpx; + color: #3795f7; + font-weight: bold; + + .all { + font-size: 44rpx; + color: #cdcdcd; + } + } + + .progress { + margin-top: 26rpx; + } + + .content { + margin-top: 34rpx; + font-size: 40rpx; + color: #222222; + line-height: 64rpx; + } + + .conform { + margin-top: 64rpx; + height: 88rpx; + font-size: 36rpx; + color: #ffffff; + line-height: 88rpx; + text-align: center; + background: #3795f7; + border-radius: 96rpx 96rpx 96rpx 96rpx; + } + + .cancel { + margin-top: 32rpx; + font-size: 36rpx; + color: #65686c; + line-height: 88rpx; + text-align: center; + height: 88rpx; + background: #f4f7fa; + border-radius: 84rpx 84rpx 84rpx 84rpx; + } + .prev { + position: absolute; + bottom: 206rpx; + left: 0; + width: 100%; + padding: 0 106rpx; + box-sizing: border-box; + font-size: 36rpx; + color: #3795f7; + font-weight: bold; + display: flex; + align-items: center; + justify-content: space-between; + .icon { + margin-right: 16rpx; + width: 44rpx; + height: 44rpx; + } + .submit { + width: 290rpx; + height: 88rpx; + font-size: 36rpx; + color: #ffffff; + background: #3795f7; + border-radius: 96rpx 96rpx 96rpx 96rpx; + text-align: center; + line-height: 88rpx; + font-weight: normal; + } + } } } diff --git a/src/pages/topic/index.ts b/src/pages/topic/index.ts index 086a005..7de5185 100644 --- a/src/pages/topic/index.ts +++ b/src/pages/topic/index.ts @@ -1,8 +1,44 @@ const _app = getApp(); Page({ - data: {}, - onLoad() { + data: { + nav: 0, + question: [ + { + content: "这是一个问题的文案,这是一个问题的文案,这是一个问题的文案", + }, + + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + { + content: "", + }, + ], + }, + onLoad() {}, + bindtransition() { + this.setData({ + nav: this.data.nav, + }) }, }); diff --git a/src/pages/topic/index.wxml b/src/pages/topic/index.wxml index bb17510..702e67c 100644 --- a/src/pages/topic/index.wxml +++ b/src/pages/topic/index.wxml @@ -1,9 +1,42 @@ - - + + + + + + {{nav + 1}}/ + 9 + + + + + + {{questionItem.content}} + + + + + + + 上一题 + + 提交 + + + + diff --git a/src/utils/page.ts b/src/utils/page.ts index 3e91e6c..07505c8 100644 --- a/src/utils/page.ts +++ b/src/utils/page.ts @@ -4,23 +4,23 @@ * 2、app.js onLaunch 的时候 Page = page */ -const originalPage = Page +const originalPage = Page; function page(config: WechatMiniprogram.Page.Instance) { - const originalOnLoad = config.onLoad + const originalOnLoad = config.onLoad; config.onLoad = function (options) { - setImageParams(this) - getApp().getMenuInfo(this) + setImageParams(this); + getApp().getMenuInfo(this); if (originalOnLoad) { - originalOnLoad.call(this, options) + originalOnLoad.call(this, options); } - } + }; - const originalOnShareAppMessage = config.onShareAppMessage + const originalOnShareAppMessage = config.onShareAppMessage; config.onShareAppMessage = function (options) { if (originalOnShareAppMessage) { - return originalOnShareAppMessage.call(this, options) + return originalOnShareAppMessage.call(this, options); } else { // const date = new Date(); // const Timestamp = date.getTime(); @@ -30,25 +30,36 @@ function page(config: WechatMiniprogram.Page.Instance 20) { + background = "#fff"; + } + this.setData({ + background, + }); + }; + + return originalPage(config); } function setImageParams( currPage: WechatMiniprogram.Page.Instance, ) { - const date = new Date() - const Timestamp = date.getTime() + const date = new Date(); + const Timestamp = date.getTime(); currPage.setData({ imageUrl: getApp().globalData.imageUrl, Timestamp, - }) + }); } -export default page +export default page;