From e5eeffffb7c0c625c1a93193a4d21bf9537bd74e Mon Sep 17 00:00:00 2001 From: kola-web Date: Fri, 24 Jul 2026 12:00:24 +0800 Subject: [PATCH] bug fix --- src/app.ts | 2 +- src/components/popup/index.ts | 16 ++------------ src/components/uploadFile/index.scss | 2 +- src/pages/followDetail/index.scss | 2 +- src/pages/followDetail/index.ts | 8 ++++--- src/pages/followDetail/index.wxml | 3 +-- src/pages/followForm/index.scss | 3 ++- src/pages/followForm/index.ts | 11 ++++++++- src/pages/followForm/index.wxml | 9 ++++---- src/pages/health/index.scss | 9 ++++++-- src/pages/health/index.ts | 43 ++++++++++++++++++++++-------------- src/pages/health/index.wxml | 20 ++++++++++------- src/pages/heartDetail/index.scss | 2 +- src/pages/heartDetail/index.ts | 11 ++++++--- src/pages/heartDetail/index.wxml | 2 +- src/pages/heartForm/index.scss | 2 +- src/pages/heartForm/index.ts | 9 ++++++-- src/pages/heartForm/index.wxml | 3 ++- src/pages/hotTopic/index.ts | 2 +- src/pages/hotTopicDetail/index.scss | 2 +- src/pages/hotTopicDetail/index.ts | 2 +- src/pages/index/index.scss | 1 + src/pages/index/index.ts | 32 ++++++++++++++++++--------- src/pages/index/index.wxml | 8 +++---- src/pages/login/index.scss | 4 ++-- src/pages/my/index.ts | 7 +++++- src/pages/my/index.wxml | 4 ++-- src/pages/myCollection/index.ts | 16 +++++++++++--- src/pages/myCollection/index.wxml | 11 ++++++++- src/pages/myComment/index.scss | 1 + src/pages/myComment/index.ts | 5 ++++- src/pages/myComment/index.wxml | 2 +- src/pages/myWall/index.scss | 2 +- src/pages/myWall/index.ts | 2 +- src/pages/wall/index.scss | 2 +- src/pages/wall/index.ts | 2 +- src/pages/wallDetail/index.scss | 2 +- src/pages/wallDetail/index.ts | 2 +- src/pages/wallForm/index.scss | 2 +- src/pages/wallForm/index.ts | 2 +- typings/index.d.ts | 2 +- 41 files changed, 172 insertions(+), 100 deletions(-) diff --git a/src/app.ts b/src/app.ts index 2b366bb..fed6f6e 100644 --- a/src/app.ts +++ b/src/app.ts @@ -115,7 +115,7 @@ App({ return new Promise((resolve) => { const checkLogin = () => { if (this.globalData.loginState) { - if (this.checkLoginType(type)) { + if (this.checkLoginType(type, false)) { resolve() } return diff --git a/src/components/popup/index.ts b/src/components/popup/index.ts index 3f8032f..e676db3 100644 --- a/src/components/popup/index.ts +++ b/src/components/popup/index.ts @@ -21,19 +21,7 @@ Component({ observers: { show(val) { if (val) { - if (this.data.type === 'TCenter') { - this.setData({ - TCenterId: this.data.params.hospitalId, - }) - } - if (this.data.type === 'inhibitors') { - this.setData({ - inhibitorsId: this.data.params.drugId || '', - inhibitorsName: this.data.params.drugName || '', - inhibitorsContent: this.data.params.content || '', - }) - } - if (this.data.type === 'publicCard') { + if (this.data.type === 'popup1') { this.getCodeImg() } } @@ -150,7 +138,7 @@ Component({ getCodeImg() { wx.ajax({ method: 'GET', - url: '?r=wtx/common/get-channel-wx-code', + url: '?r=psvt/common/get-channel-wx-code', data: { ChannelType: 2, }, diff --git a/src/components/uploadFile/index.scss b/src/components/uploadFile/index.scss index 270aae0..6c3c787 100644 --- a/src/components/uploadFile/index.scss +++ b/src/components/uploadFile/index.scss @@ -57,7 +57,7 @@ justify-content: center; font-size: 28rpx; color: rgba(255, 255, 255, 1); - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); box-sizing: border-box; } } diff --git a/src/pages/followDetail/index.scss b/src/pages/followDetail/index.scss index dff2247..474ab77 100644 --- a/src/pages/followDetail/index.scss +++ b/src/pages/followDetail/index.scss @@ -127,7 +127,7 @@ page { color: rgba(100, 116, 139, 1); } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/followDetail/index.ts b/src/pages/followDetail/index.ts index ebbdbd5..b466d53 100644 --- a/src/pages/followDetail/index.ts +++ b/src/pages/followDetail/index.ts @@ -14,11 +14,13 @@ Page({ onLoad(options: any) { if (options.id) { this.setData({ id: options.id }) - app.waitLogin({ type: 'any' }).then(() => { - this.getDetail(options.id) - }) } }, + onShow() { + app.waitLogin({ type: 1 }).then(() => { + this.getDetail(this.data.id) + }) + }, getDetail(id: string) { wx.ajax({ method: 'GET', diff --git a/src/pages/followDetail/index.wxml b/src/pages/followDetail/index.wxml index 24cc887..4bc8915 100644 --- a/src/pages/followDetail/index.wxml +++ b/src/pages/followDetail/index.wxml @@ -19,7 +19,6 @@ 上传图片 - 可上传复诊病历、处方单或检查结果 @@ -35,7 +34,7 @@ - 是否更新手术 + 是否手术诊断 diff --git a/src/pages/followForm/index.scss b/src/pages/followForm/index.scss index d5e65df..f2cb638 100644 --- a/src/pages/followForm/index.scss +++ b/src/pages/followForm/index.scss @@ -79,6 +79,7 @@ page { width: 100%; height: 240rpx; font-size: 28rpx; + line-height: 48rpx; color: rgba(30, 41, 59, 1); box-sizing: border-box; background: #f9fafb; @@ -124,7 +125,7 @@ page { color: rgba(100, 116, 139, 1); } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/followForm/index.ts b/src/pages/followForm/index.ts index 742440f..3f7846f 100644 --- a/src/pages/followForm/index.ts +++ b/src/pages/followForm/index.ts @@ -1,3 +1,5 @@ +import dayjs from 'dayjs' + const app = getApp() Page({ @@ -19,6 +21,8 @@ Page({ isUpdateSurgery: 0, remark: '', isEdit: false, + + endDate: dayjs().format('YYYY-MM-DD'), }, onLoad(options: any) { if (options.id) { @@ -52,7 +56,12 @@ Page({ }) }, onDateChange(e: any) { - this.setData({ visitDate: e.detail.value }) + const selectedDate = e.detail.value + if (dayjs(selectedDate).isAfter(dayjs(), 'day')) { + wx.showToast({ title: '不能选择未来日期', icon: 'none' }) + return + } + this.setData({ visitDate: selectedDate }) }, handleSetData(e: any) { const { fileList } = this.data diff --git a/src/pages/followForm/index.wxml b/src/pages/followForm/index.wxml index c6011be..56867e8 100644 --- a/src/pages/followForm/index.wxml +++ b/src/pages/followForm/index.wxml @@ -1,7 +1,7 @@ - 复诊记录 + {{isEdit?"编辑":"添加"}}复诊记录 @@ -12,7 +12,7 @@ 日期 - + {{visitDate}} @@ -26,6 +26,7 @@ - 是否更新手术 + 是否手术诊断 () const echarts = require('@/components/ec-canvas/echarts.js') @@ -52,13 +54,13 @@ Page({ this.ecDataTrendComponent = this.selectComponent('#chart1') this.initChart() - app.waitLogin({ type: 0 }).then(() => { + app.waitLogin({ type: 1 }).then(() => { this._loaded = true - if (this.data.tab === 1) { + if (this.data.tab === 0) { this.getHeartStats() this.getHeartChart() this.getHeartRateList() - } else if (this.data.tab === 2) { + } else if (this.data.tab === 1) { this.getRevisitList() this.getLastRevisit() } @@ -83,11 +85,11 @@ Page({ if (query.tab !== undefined) { const tab = Number(query.tab) this.setData({ tab }) - if (tab === 1) { + if (tab === 0) { this.getHeartStats() this.getHeartChart() this.getHeartRateList() - } else if (tab === 2) { + } else if (tab === 1) { this.getRevisitList() this.getLastRevisit() } @@ -95,23 +97,23 @@ Page({ } } if (this._loaded) { - if (this.data.tab === 1) { + if (this.data.tab === 0) { this.getHeartStats() this.getHeartChart() this.getHeartRateList() - } else if (this.data.tab === 2) { + } else if (this.data.tab === 1) { this.getRevisitList() this.getLastRevisit() } } }, onReachBottom() { - if (this.data.tab === 1) { + if (this.data.tab === 0) { const { heartRatePagination } = this.data if (heartRatePagination.page < heartRatePagination.pages) { this.getHeartRateList(heartRatePagination.page + 1, true) } - } else if (this.data.tab === 2) { + } else if (this.data.tab === 1) { const { revisitPagination } = this.data if (revisitPagination.page < revisitPagination.pages) { this.getRevisitList(revisitPagination.page + 1, true) @@ -121,11 +123,11 @@ Page({ onChange(e: any) { const { index } = e.detail this.setData({ tab: index }) - if (index === 1) { + if (index === 0) { this.getHeartStats() this.getHeartChart() this.getHeartRateList() - } else if (index === 2) { + } else if (index === 1) { this.getRevisitList() this.getLastRevisit() } @@ -173,7 +175,7 @@ Page({ }, onStartMonthChange(e: any) { this.setData({ startMonth: e.detail.value }) - if (this.data.tab === 1) { + if (this.data.tab === 0) { this.getHeartChart() this.getHeartRateList() } else { @@ -182,7 +184,7 @@ Page({ }, onEndMonthChange(e: any) { this.setData({ endMonth: e.detail.value }) - if (this.data.tab === 1) { + if (this.data.tab === 0) { this.getHeartChart() this.getHeartRateList() } else { @@ -202,11 +204,11 @@ Page({ }) }, handleAdd() { - if (this.data.tab === 1) { + if (this.data.tab === 0) { wx.navigateTo({ url: '/pages/heartForm/index', }) - } else if (this.data.tab === 2) { + } else if (this.data.tab === 1) { wx.navigateTo({ url: '/pages/followForm/index', }) @@ -224,7 +226,10 @@ Page({ endMonth, }, }).then((res: any) => { - const list = res.list || [] + const list = (res.list || []).map((item) => { + item.recordDateTime = dayjs(item.recordDateTime).format('YYYY-MM-DD HH:mm') + return item + }) this.setData({ heartRateList: append ? this.data.heartRateList.concat(list) : list, heartRatePagination: { @@ -266,6 +271,7 @@ Page({ const isAttack = Number(item.isPsvtAttack) === 1 return { value: Number(item.heartRate), + isAttack, itemStyle: isAttack ? { color: '#d62828', borderColor: '#fff' } : { color: '#fff', borderColor: '#46bc70', borderWidth: 2 }, @@ -301,6 +307,11 @@ Page({ fontSize: 10, }, order: 'seriesDesc', + formatter: (params: any) => { + const p = params[0] + const name = p.data.isAttack ? '发作心率' : '正常心率' + return `${p.axisValueLabel}\n${p.marker}${name} ${p.value}` + }, }, legend: { bottom: 0, diff --git a/src/pages/health/index.wxml b/src/pages/health/index.wxml index f989d79..f3d2c62 100644 --- a/src/pages/health/index.wxml +++ b/src/pages/health/index.wxml @@ -21,7 +21,6 @@ nav-class="nav-calss" offset-top="{{offsetTop}}" > - 内容 1 @@ -49,7 +48,7 @@ - 最近发作 + 总共发作 {{heartStats.attackCount}} @@ -117,11 +116,16 @@ - 共复诊 - {{totalRevisits}} - 次 距上次复诊 - {{daysSinceLastRevisit}} - 天 + + 共复诊 + {{totalRevisits}} + 次 + + + 距上次复诊 + {{daysSinceLastRevisit}} + 天 + @@ -135,7 +139,7 @@ - {{item.isUpdatePrescription ? '已更新处方' : '未更新处方'}} + {{item.isUpdatePrescription ? '已更新处方' : '未更新处方'}};{{isUpdateSurgery ? '已更新手术诊断' : '未手术诊断'}} {{item.remark}} diff --git a/src/pages/heartDetail/index.scss b/src/pages/heartDetail/index.scss index f2d6e65..f9f7dd2 100644 --- a/src/pages/heartDetail/index.scss +++ b/src/pages/heartDetail/index.scss @@ -152,7 +152,7 @@ page { color: rgba(100, 116, 139, 1); } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/heartDetail/index.ts b/src/pages/heartDetail/index.ts index 4260e82..9824e14 100644 --- a/src/pages/heartDetail/index.ts +++ b/src/pages/heartDetail/index.ts @@ -1,3 +1,5 @@ +import dayjs from 'dayjs' + const app = getApp() Page({ @@ -14,17 +16,20 @@ Page({ onLoad(options: any) { if (options.id) { this.setData({ id: options.id }) - app.waitLogin({ type: 'any' }).then(() => { - this.getDetail(options.id) - }) } }, + onShow() { + app.waitLogin({ type: 1 }).then(() => { + this.getDetail(this.data.id) + }) + }, getDetail(id: string) { wx.ajax({ method: 'GET', url: '?r=psvt/heart-rate-record/detail', data: { id }, }).then((res: any) => { + res.recordDateTime = dayjs(res.recordDateTime).format('YYYY-MM-DD HH:mm') this.setData({ detail: res || {} }) }) }, diff --git a/src/pages/heartDetail/index.wxml b/src/pages/heartDetail/index.wxml index 82c7637..b7bf48f 100644 --- a/src/pages/heartDetail/index.wxml +++ b/src/pages/heartDetail/index.wxml @@ -11,7 +11,7 @@ > - 日期 + 日期时间 {{detail.recordDateTime || ''}} diff --git a/src/pages/heartForm/index.scss b/src/pages/heartForm/index.scss index 670e703..2bd8d65 100644 --- a/src/pages/heartForm/index.scss +++ b/src/pages/heartForm/index.scss @@ -156,7 +156,7 @@ page { color: rgba(100, 116, 139, 1); } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/heartForm/index.ts b/src/pages/heartForm/index.ts index 0736f02..c85c7de 100644 --- a/src/pages/heartForm/index.ts +++ b/src/pages/heartForm/index.ts @@ -14,6 +14,7 @@ Page({ recordDateTime: '', datetimePickerShow: false, datetimeValue: Date.now(), + maxDate: Date.now(), isPsvtAttack: 0, remark: '', isEdit: false, @@ -21,11 +22,11 @@ Page({ onLoad(options: any) { if (options.id) { this.setData({ id: options.id, isEdit: true }) - app.waitLogin({ type: 'any' }).then(() => { + app.waitLogin({ type: 1 }).then(() => { this.getDetail(options.id) }) } else { - app.waitLogin({ type: 'any' }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) } }, getDetail(id: string) { @@ -64,6 +65,10 @@ Page({ }, onDatetimeConfirm(e: any) { const date = new Date(e.detail) + if (date.getTime() > Date.now()) { + wx.showToast({ title: '不能选择未来时间', icon: 'none' }) + return + } const y = date.getFullYear() const m = String(date.getMonth() + 1).padStart(2, '0') const d = String(date.getDate()).padStart(2, '0') diff --git a/src/pages/heartForm/index.wxml b/src/pages/heartForm/index.wxml index 7269ab4..9ff7e17 100644 --- a/src/pages/heartForm/index.wxml +++ b/src/pages/heartForm/index.wxml @@ -1,7 +1,7 @@ - 心率记录 + {{isEdit?"编辑":"添加"}}心率记录 @@ -42,6 +42,7 @@ diff --git a/src/pages/hotTopic/index.ts b/src/pages/hotTopic/index.ts index 3ea8363..951d35e 100644 --- a/src/pages/hotTopic/index.ts +++ b/src/pages/hotTopic/index.ts @@ -9,7 +9,7 @@ Page({ } as any, }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/src/pages/hotTopicDetail/index.scss b/src/pages/hotTopicDetail/index.scss index 466c516..c33ab5b 100644 --- a/src/pages/hotTopicDetail/index.scss +++ b/src/pages/hotTopicDetail/index.scss @@ -204,7 +204,7 @@ page { width: 128rpx; height: 128rpx; border-radius: 19998rpx; - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); box-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38); box-sizing: border-box; display: flex; diff --git a/src/pages/hotTopicDetail/index.ts b/src/pages/hotTopicDetail/index.ts index 3ea8363..951d35e 100644 --- a/src/pages/hotTopicDetail/index.ts +++ b/src/pages/hotTopicDetail/index.ts @@ -9,7 +9,7 @@ Page({ } as any, }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index 13b3113..7422692 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -122,6 +122,7 @@ page { font-weight: 600; } .k-date { + margin-left: 10rpx; font-family: Manrope, sans-serif; font-weight: 400; } diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 5999a58..c3d0220 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -28,6 +28,7 @@ Page({ 'qiye-wx': true, education: true, } as Record, + educationName: '知识科普', healthSummary: { heartRate: 0, @@ -36,7 +37,8 @@ Page({ revisitDate: '', } as any, }, - onLoad() { + onLoad() {}, + onShow() { app.waitLogin({ type: 'any' }).then(() => { this.getMyInfo() this.getCateList() @@ -46,11 +48,6 @@ Page({ this.getHealthSummary() }) }, - onShow() { - if (app.globalData.loginState) { - this.getMyInfo() - } - }, getHealthSummary() { const summary: any = { heartRate: 0, @@ -103,8 +100,12 @@ Page({ const conf = list.find((item: any) => item.code === code) return { code, + name: conf.name, subList: conf?.subList || [], - visible: conf ? (conf.showStatus == 1 && (code === 'spread1' || code === 'spread2' ? (conf.subList || []).length > 0 : true)) : false, + visible: conf + ? conf.showStatus == 1 && + (code === 'spread1' || code === 'spread2' ? (conf.subList || []).length > 0 : true) + : false, } }) .sort((a, b) => { @@ -113,7 +114,8 @@ Page({ return Number(aSeq) - Number(bSeq) }) - this.setData({ configList: list, moduleVisible, sectionList }) + const educationConf = list.find((item: any) => item.code === 'education') + this.setData({ configList: list, moduleVisible, sectionList, educationName: educationConf?.name || '知识科普' }) }) }, getMyInfo() { @@ -251,13 +253,13 @@ Page({ }, handleHealthHeartTap() { const tabBarParams = app.globalData.tabBarParams || {} - tabBarParams['pages/health/index'] = 'tab=1' + tabBarParams['pages/health/index'] = 'tab=0' app.globalData.tabBarParams = tabBarParams wx.switchTab({ url: '/pages/health/index' }) }, handleHealthRevisitTap() { const tabBarParams = app.globalData.tabBarParams || {} - tabBarParams['pages/health/index'] = 'tab=2' + tabBarParams['pages/health/index'] = 'tab=1' app.globalData.tabBarParams = tabBarParams wx.switchTab({ url: '/pages/health/index' }) }, @@ -315,6 +317,16 @@ Page({ }) } }, + handleAddHeart() { + wx.navigateTo({ + url: '/pages/heartForm/index', + }) + }, + handleAddFollow() { + wx.navigateTo({ + url: '/pages/followForm/index', + }) + }, }) export {} diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index eacae8b..c4167d3 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -28,7 +28,7 @@ style="background: url('{{imageUrl}}bg17.png?t={{Timestamp}}') no-repeat top 72rpx left 0/193rpx 47rpx" > - + {{healthSummary.heartRate}} 次/分 @@ -43,7 +43,7 @@ - + {{healthSummary.revisitDays}} @@ -75,7 +75,7 @@ - 视频科普 + {{item.name}} 查看更多 @@ -109,7 +109,7 @@ - 知识科普 + {{educationName}} 推荐 diff --git a/src/pages/login/index.scss b/src/pages/login/index.scss index 15217db..10ba47f 100644 --- a/src/pages/login/index.scss +++ b/src/pages/login/index.scss @@ -76,7 +76,7 @@ border-radius: 24rpx; font-size: 28rpx; color: #fff; - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); display: flex; align-items: center; justify-content: center; @@ -84,7 +84,7 @@ } .submit { height: 96rpx; - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); border-radius: 24rpx; font-size: 34rpx; color: #ffffff; diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index a095253..22d8421 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -6,7 +6,7 @@ Page({ days: 0, }, onShow() { - app.waitLogin().then(() => { + app.waitLogin({ type: 1 }).then(() => { this.getMyInfo() }) }, @@ -27,6 +27,11 @@ Page({ }) }) }, + handleHealth() { + wx.switchTab({ + url: '/pages/health/index', + }) + }, routerTo(e: any) { const { url } = e.currentTarget.dataset wx.navigateTo({ url }) diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index 11fe0fe..c1c62ab 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -22,13 +22,13 @@ 我的帖子 - + 健康档案 - + 我的评论 diff --git a/src/pages/myCollection/index.ts b/src/pages/myCollection/index.ts index ccfe5ee..20219ec 100644 --- a/src/pages/myCollection/index.ts +++ b/src/pages/myCollection/index.ts @@ -4,6 +4,7 @@ Page({ data: { tab: 0, offsetTop: 0, + search: '', videoList: [] as Array, videoPagination: { @@ -20,7 +21,7 @@ Page({ }, }, onShow() { - app.waitLogin({ type: 0 }).then(() => { + app.waitLogin({ type: 1 }).then(() => { this.getVideoList() this.getArticleList() }) @@ -31,10 +32,11 @@ Page({ this.setData({ offsetTop: statusBarHeight + navBarHeight }) }, getVideoList(page = 1, append = false) { + const { search } = this.data wx.ajax({ method: 'GET', url: '?r=psvt/video/collection-list', - data: { page, count: 10 }, + data: { page, count: 10, ...(search ? { Search: search } : {}) }, }).then((res: any) => { const list = res.list || [] this.setData({ @@ -48,10 +50,11 @@ Page({ }) }, getArticleList(page = 1, append = false) { + const { search } = this.data wx.ajax({ method: 'GET', url: '?r=psvt/pic-text/collection-list', - data: { page, count: 10 }, + data: { page, count: 10, ...(search ? { Search: search } : {}) }, }).then((res: any) => { const list = res.list || [] this.setData({ @@ -64,6 +67,13 @@ Page({ }) }) }, + onSearchInput(e: any) { + this.setData({ search: e.detail.value }) + }, + onSearch() { + this.getVideoList() + this.getArticleList() + }, onChange(e: any) { const { index } = e.detail this.setData({ tab: index }) diff --git a/src/pages/myCollection/index.wxml b/src/pages/myCollection/index.wxml index 43d3cce..01f12f8 100644 --- a/src/pages/myCollection/index.wxml +++ b/src/pages/myCollection/index.wxml @@ -9,7 +9,16 @@ - + {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data @@ -97,6 +97,9 @@ Page({ topicShow: false, }) }, + handleBack() { + wx.navigateBack() + }, }) export {} diff --git a/src/pages/myComment/index.wxml b/src/pages/myComment/index.wxml index 3da3579..c311eaf 100644 --- a/src/pages/myComment/index.wxml +++ b/src/pages/myComment/index.wxml @@ -1,5 +1,5 @@ - + 我的评论 diff --git a/src/pages/myWall/index.scss b/src/pages/myWall/index.scss index d833c98..8000f89 100644 --- a/src/pages/myWall/index.scss +++ b/src/pages/myWall/index.scss @@ -162,7 +162,7 @@ page { justify-content: center; align-items: center; border-radius: 102rpx; - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); box-sizing: border-box; color: #fff; text-align: center; diff --git a/src/pages/myWall/index.ts b/src/pages/myWall/index.ts index 0e0b7dc..163a4fe 100644 --- a/src/pages/myWall/index.ts +++ b/src/pages/myWall/index.ts @@ -14,7 +14,7 @@ Page({ fileList: [] as any[], }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/src/pages/wall/index.scss b/src/pages/wall/index.scss index abb1742..78427f1 100644 --- a/src/pages/wall/index.scss +++ b/src/pages/wall/index.scss @@ -239,7 +239,7 @@ page { width: 128rpx; height: 128rpx; border-radius: 19998rpx; - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); box-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38); box-sizing: border-box; display: flex; diff --git a/src/pages/wall/index.ts b/src/pages/wall/index.ts index 40d1fbe..baef5b9 100644 --- a/src/pages/wall/index.ts +++ b/src/pages/wall/index.ts @@ -9,7 +9,7 @@ Page({ } as any, }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/src/pages/wallDetail/index.scss b/src/pages/wallDetail/index.scss index 2d526fa..14b8610 100644 --- a/src/pages/wallDetail/index.scss +++ b/src/pages/wallDetail/index.scss @@ -425,7 +425,7 @@ page { color: rgba(100, 116, 139, 1); } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/wallDetail/index.ts b/src/pages/wallDetail/index.ts index 90bcad3..645388e 100644 --- a/src/pages/wallDetail/index.ts +++ b/src/pages/wallDetail/index.ts @@ -13,7 +13,7 @@ Page({ actionShow: false, }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/src/pages/wallForm/index.scss b/src/pages/wallForm/index.scss index c9ce297..d1a1fe9 100644 --- a/src/pages/wallForm/index.scss +++ b/src/pages/wallForm/index.scss @@ -232,7 +232,7 @@ page { } } .send { - background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); + background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%); color: #fff; border-color: transparent; } diff --git a/src/pages/wallForm/index.ts b/src/pages/wallForm/index.ts index 3d26b14..0ee110e 100644 --- a/src/pages/wallForm/index.ts +++ b/src/pages/wallForm/index.ts @@ -14,7 +14,7 @@ Page({ fileList: [] as any[], }, onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + app.waitLogin({ type: 1 }).then(() => {}) }, handlePopupOk() { const { popupType } = this.data diff --git a/typings/index.d.ts b/typings/index.d.ts index 708083c..ab5985b 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -45,7 +45,7 @@ interface IAppOption { } getUserInfo: (type?: 0 | 1 | 2) => Promise startLogin: (callback?: () => void) => void - waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise + waitLogin: (params?: { type?: 1 | 'any' }) => Promise checkLoginType: (type: 1 | 'any', confirm: boolean) => boolean mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void globalSystemInfo?: globalSystemInfo