From 90eae5c44cd4db4864f29d9a184b0ca6d944b670 Mon Sep 17 00:00:00 2001 From: kola-web Date: Thu, 23 Jul 2026 11:42:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E8=AF=8A=E8=AE=B0=E5=BD=95=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 2 +- src/app.ts | 69 +++++++++++------ src/components/uploadFile/index.js | 20 +++-- src/components/uploadFile/index.wxml | 8 +- src/custom-tab-bar/index.ts | 24 +++--- src/pages/articleDetail/index.ts | 4 +- src/pages/articleVideoDetail/index.ts | 4 +- src/pages/followDetail/index.scss | 1 + src/pages/followDetail/index.ts | 77 +++++++++++++------ src/pages/followDetail/index.wxml | 30 ++++---- src/pages/followForm/index.scss | 1 + src/pages/followForm/index.ts | 135 +++++++++++++++++++++++++++++++--- src/pages/followForm/index.wxml | 55 +++++++++++--- src/pages/health/index.json | 3 +- src/pages/health/index.ts | 134 ++++++++++++++++++++++++++++----- src/pages/health/index.wxml | 36 ++++----- src/pages/index/index.scss | 10 +++ src/pages/index/index.ts | 8 +- src/pages/index/index.wxml | 8 +- src/pages/login/index.ts | 1 + src/pages/my/index.wxml | 40 +++++----- src/pages/videoDetail/index.ts | 4 +- typings/index.d.ts | 2 +- 23 files changed, 504 insertions(+), 172 deletions(-) diff --git a/project.config.json b/project.config.json index 821f750..c0c8295 100644 --- a/project.config.json +++ b/project.config.json @@ -66,7 +66,7 @@ ], "include": [] }, - "appid": "wxd9e68fd8ad8cc3f6", + "appid": "wx903aa29742dad363", "scripts": { "beforeCompile": "pnpm run beforeCompile", "beforePreview": "pnpm run beforeCompile", diff --git a/src/app.ts b/src/app.ts index cb440ce..5c8e37b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -25,15 +25,15 @@ App({ globalData: { // dev // appid:wx903aa29742dad363 - // url: 'https://m.psvt.hbraas.com', - // upFileUrl: 'https://m.psvt.hbraas.com/', - // imageUrl: 'https://m.psvt.hbraas.com/psvt/', + url: 'https://m.psvt.hbraas.com', + upFileUrl: 'https://m.psvt.hbraas.com/', + imageUrl: 'https://m.psvt.hbraas.com/psvt/', // pro // appid:wxd9e68fd8ad8cc3f6 - url: 'https://m.psvt.hbsaas.com', - upFileUrl: 'https://m.psvt.hbsaas.com/', - imageUrl: 'https://m.psvt.hbsaas.com/psvt/', + // url: 'https://m.psvt.hbsaas.com', + // upFileUrl: 'https://m.psvt.hbsaas.com/', + // imageUrl: 'https://m.psvt.hbsaas.com/psvt/', Timestamp: new Date().getTime(), @@ -61,10 +61,34 @@ App({ }) }, onShow(options) { + console.log('DEBUGPRINT[316]: app.ts:63: options=', JSON.stringify(options)) + // {"path":"pages/start/index","query":{"scene":"cid%3D3"},"scene":1047,"referrerInfo":{},"mode":"default","apiCategory":"default"} + let sceneData: any = {} if (options.query.scene) { - this.globalData.scene = parseScene(options.query.scene) as { workerId: string } + sceneData = parseScene(options.query.scene) || {} } - this.startLogin() + // 渠道码:优先取 scene 中解析的 cid,其次取 query 中直接传入的 cid + const channelId = sceneData.cid || sceneData.channelId || options.query.cid || '' + if (channelId) { + sceneData.channelId = channelId + } + this.globalData.scene = sceneData + + this.startLogin(() => { + // 已登录用户扫码,调用渠道码扫码记录接口 + if (channelId) { + const { isLogin, isReg } = this.globalData.initLoginInfo + if (isLogin && isReg) { + wx.ajax({ + method: 'POST', + url: '?r=psvt/channel/scan-channel', + data: { channelId: Number(channelId) }, + loading: false, + showMsg: false, + }) + } + } + }) }, startLogin(callback?: () => void) { wx.login({ @@ -103,7 +127,7 @@ App({ checkLogin() }) }, - checkLoginType(type = 'any') { + checkLoginType(type = 'any', confirm = false) { const { isLogin, isReg } = this.globalData.initLoginInfo if (type === 'any') { @@ -111,18 +135,18 @@ App({ } if (!isLogin) { - this.redirectToLogin('/pages/login/index') + this.redirectToLogin('/pages/login/index', confirm) return false } if (!isReg) { - this.redirectToLogin('/pages/confirmInfo/index') + this.redirectToLogin('/pages/confirmInfo/index', confirm) return false } return true }, - redirectToLogin(path) { + redirectToLogin(path, confirm) { // 获取当前页面路径 const pages = getCurrentPages() const currentPage = pages[pages.length - 1] @@ -137,15 +161,18 @@ App({ this.globalData.loginRedirectUrl = query ? `${currentUrl}?${query}` : currentUrl } if (currentUrl.includes('login/index')) return - wx.reLaunch({ - url: path, - }) - // wx.showModal({ - // title: '提示', - // content: '授权登录后,可体验更好的服务', - // success: () => { - // }, - // }) + if (confirm) { + wx.showModal({ + title: '提示', + content: '授权登录后,可体验更好的服务', + success: () => { + wx.reLaunch({ + url: path, + }) + }, + }) + return + } }, mpBehavior(data: { PageName: string }) { const url = '?r=wtx/mp-behavior/add' diff --git a/src/components/uploadFile/index.js b/src/components/uploadFile/index.js index 7a38772..7f1bd83 100644 --- a/src/components/uploadFile/index.js +++ b/src/components/uploadFile/index.js @@ -15,6 +15,10 @@ Component({ type: Boolean, value: true, }, + fileType: { + type: String, + value: 'image', + }, // 附件data fileList: { type: Array, @@ -222,9 +226,15 @@ Component({ }) }, handleAction() { - this.setData({ - show: true, - }) + // this.setData({ + // show: true, + // }) + + if (this.data.fileType === 'file') { + this.selectFiles() + } else { + this.selectMedia() + } }, onSelect(e) { const { id } = e.currentTarget.dataset @@ -247,8 +257,8 @@ Component({ count = maxNum - fileList.length } wx.chooseMedia({ - mediaType: ['image', 'video'], - count: count, + mediaType: this.data.fileType, + count, sourceType: ['album', 'camera'], sizeType: ['original'], success: (res) => { diff --git a/src/components/uploadFile/index.wxml b/src/components/uploadFile/index.wxml index 8e2949c..5a84b26 100644 --- a/src/components/uploadFile/index.wxml +++ b/src/components/uploadFile/index.wxml @@ -10,7 +10,11 @@ > - + @@ -26,8 +30,6 @@ - - { + this.getDetail(options.id) + }) + } + }, + getDetail(id: string) { + wx.ajax({ + method: 'GET', + url: '?r=psvt/revisit-record/detail', + data: { id }, + }).then((res: any) => { + this.setData({ detail: res || {} }) + }) + }, + handleDelete() { + const { id } = this.data + wx.showModal({ + title: '提示', + content: '确定删除该复诊记录吗?', + success: (res) => { + if (!res.confirm) return + wx.ajax({ + method: 'POST', + url: '?r=psvt/revisit-record/delete', + data: { id: Number(id) }, + }).then(() => { + wx.showToast({ title: '删除成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + }, + }) }, - onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + handleEdit() { + const { id } = this.data + wx.navigateTo({ + url: `/pages/followForm/index?id=${id}`, + }) + }, + handlePreviewImage(e: any) { + const { url } = e.currentTarget.dataset + const { detail } = this.data + wx.previewImage({ + current: url, + urls: detail.images || [], + }) }, handlePopupOk() { const { popupType } = this.data @@ -79,23 +125,8 @@ Page({ url: '/pages/wechatWork/index', }) }, - handleSetData(e) { - const { fileList } = this.data - this.setData({ - fileList: [...fileList, ...e.detail], - }) - }, - handleDeleteFile(e) { - const { index } = e.detail - const { fileList } = this.data - this.setData({ - fileList: fileList.filter((_, i) => i !== index), - }) - }, - topicClose() { - this.setData({ - topicShow: false, - }) + handleBack() { + wx.navigateBack() }, }) diff --git a/src/pages/followDetail/index.wxml b/src/pages/followDetail/index.wxml index 93762e8..24cc887 100644 --- a/src/pages/followDetail/index.wxml +++ b/src/pages/followDetail/index.wxml @@ -1,5 +1,5 @@ - + 复诊记录详情 @@ -13,7 +13,7 @@ 日期 - 2026.07.06 21:30 + {{detail.visitDate || ''}} @@ -21,35 +21,33 @@ 上传图片 可上传复诊病历、处方单或检查结果 - - - + + + - 发作时感受 + 是否更新处方 - - + + - 发作时处理方式 + 是否更新手术 - - + + 其他备注 - - 本次复诊心悸发作频率较上次减少,发作持续时间约5–10分钟,含服药物后可自行缓解。医生建议继续规律服药,避免剧烈运动及情绪激动,定期复查心电图。 - + {{detail.remark || ''}} - 删除 - 编辑 + 删除 + 编辑 diff --git a/src/pages/followForm/index.scss b/src/pages/followForm/index.scss index 44ddd49..d5e65df 100644 --- a/src/pages/followForm/index.scss +++ b/src/pages/followForm/index.scss @@ -5,6 +5,7 @@ page { .page-title { font-size: 36rpx; color: rgba(51, 51, 51, 1); + padding-right: 100rpx; } .page { diff --git a/src/pages/followForm/index.ts b/src/pages/followForm/index.ts index 04c510a..e661e7d 100644 --- a/src/pages/followForm/index.ts +++ b/src/pages/followForm/index.ts @@ -8,10 +8,128 @@ Page({ position: 'bottom', } as any, + topicShow: false, + replayShow: true, + + id: '', + visitDate: '', fileList: [] as any[], + isUpdatePrescription: 0, + isUpdateSurgery: 0, + remark: '', + isEdit: false, + }, + onLoad(options: any) { + if (options.id) { + this.setData({ id: options.id, isEdit: true }) + app.waitLogin({ type: 'any' }).then(() => { + this.getDetail(options.id) + }) + } else { + app.waitLogin({ type: 'any' }).then(() => {}) + } + }, + getDetail(id: string) { + wx.ajax({ + method: 'GET', + url: '?r=psvt/revisit-record/detail', + data: { id }, + }).then((res: any) => { + if (!res) return + const fileList = (res.images || []).map((url: string) => ({ + url, + fileType: 'image', + name: url, + })) + this.setData({ + visitDate: res.visitDate || '', + fileList, + isUpdatePrescription: res.isUpdatePrescription ?? 0, + isUpdateSurgery: res.isUpdateSurgery ?? 0, + remark: res.remark || '', + }) + }) + }, + onDateChange(e: any) { + this.setData({ visitDate: e.detail.value }) + }, + handleSetData(e: any) { + const { fileList } = this.data + this.setData({ + fileList: [...fileList, ...e.detail], + }) + }, + handleDeleteFile(e: any) { + const { index } = e.detail + const { fileList } = this.data + this.setData({ + fileList: fileList.filter((_, i) => i !== index), + }) + }, + handlePrescriptionChange(e: any) { + const { value } = e.currentTarget.dataset + this.setData({ isUpdatePrescription: value }) }, - onLoad() { - app.waitLogin({ type: 0 }).then(() => {}) + handleSurgeryChange(e: any) { + const { value } = e.currentTarget.dataset + this.setData({ isUpdateSurgery: value }) + }, + onRemarkInput(e: any) { + this.setData({ remark: e.detail.value }) + }, + handleSubmit() { + const { id, visitDate, fileList, isUpdatePrescription, isUpdateSurgery, remark, isEdit } = this.data + + if (!visitDate) { + wx.showToast({ title: '请选择复诊日期', icon: 'none' }) + return + } + + const images = fileList.map((item: any) => item.url) + + const data = { + visitDate, + images, + isUpdatePrescription, + isUpdateSurgery, + remark, + } + + wx.showLoading({ title: '保存中' }) + + if (isEdit) { + wx.ajax({ + method: 'POST', + url: '?r=psvt/revisit-record/update', + data: { id: Number(id), ...data }, + }) + .then(() => { + wx.hideLoading() + wx.showToast({ title: '保存成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + .catch(() => { + wx.hideLoading() + }) + } else { + wx.ajax({ + method: 'POST', + url: '?r=psvt/revisit-record/create', + data, + }) + .then(() => { + wx.hideLoading() + wx.showToast({ title: '保存成功', icon: 'success' }) + setTimeout(() => { + wx.navigateBack() + }, 1000) + }) + .catch(() => { + wx.hideLoading() + }) + } }, handlePopupOk() { const { popupType } = this.data @@ -76,18 +194,13 @@ Page({ url: '/pages/wechatWork/index', }) }, - handleSetData(e) { - const { fileList } = this.data + topicClose() { this.setData({ - fileList: [...fileList, ...e.detail], + topicShow: false, }) }, - handleDeleteFile(e) { - const { index } = e.detail - const { fileList } = this.data - this.setData({ - fileList: fileList.filter((_, i) => i !== index), - }) + handleBack() { + wx.navigateBack() }, }) diff --git a/src/pages/followForm/index.wxml b/src/pages/followForm/index.wxml index 765d32c..6ec15da 100644 --- a/src/pages/followForm/index.wxml +++ b/src/pages/followForm/index.wxml @@ -1,5 +1,5 @@ - + 复诊记录 @@ -12,9 +12,9 @@ 日期 - + - + {{visitDate}} @@ -34,26 +34,57 @@ - 发作时感受 + 是否更新处方 - - + + 是 + + + 否 + - 发作时处理方式 + 是否更新手术 - - + + 是 + + + 否 + 其他备注 - + - 取消 - 保存记录 + 取消 + 保存记录 diff --git a/src/pages/health/index.json b/src/pages/health/index.json index af5be5f..6ea7029 100644 --- a/src/pages/health/index.json +++ b/src/pages/health/index.json @@ -5,6 +5,7 @@ "navbar": "/components/navbar/index", "van-tab": "@vant/weapp/tab/index", "van-tabs": "@vant/weapp/tabs/index", - "ec-canvas": "/components/ec-canvas/ec-canvas" + "ec-canvas": "/components/ec-canvas/ec-canvas", + "pagination": "/components/pagination/index" } } diff --git a/src/pages/health/index.ts b/src/pages/health/index.ts index e31172d..532fa4a 100644 --- a/src/pages/health/index.ts +++ b/src/pages/health/index.ts @@ -1,6 +1,8 @@ const app = getApp() const echarts = require('@/components/ec-canvas/echarts.js') +const PAGE_SIZE = 10 + Page({ data: { popupShow: false, @@ -9,36 +11,142 @@ Page({ position: 'bottom', } as any, - tab: 1, + tab: 2, offsetTop: 0, + + // 复诊记录 + revisitList: [] as any[], + revisitPagination: { + page: 1, + pages: 1, + count: 0, + }, + startMonth: '', + endMonth: '', + daysSinceLastRevisit: 0, + totalRevisits: 0, }, ecDataTrendComponent: null as any, + _loaded: false, onLoad() { + const now = new Date() + const endMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}` + const startDate = new Date(now.getFullYear(), now.getMonth() - 6, 1) + const startMonth = `${startDate.getFullYear()}-${String(startDate.getMonth() + 1).padStart(2, '0')}` + this.setData({ startMonth, endMonth }) + this.ecDataTrendComponent = this.selectComponent('#chart1') this.initChart() - app.waitLogin({ type: 0 }).then(() => {}) + + app.waitLogin({ type: 0 }).then(() => { + this._loaded = true + this.getRevisitList() + this.getLastRevisit() + }) }, onReady() { const { statusBarHeight } = wx.getSystemInfoSync() const navBarHeight = 44 this.setData({ offsetTop: statusBarHeight + navBarHeight }) }, + onShow() { + if (this._loaded && this.data.tab === 2) { + this.getRevisitList() + this.getLastRevisit() + } + }, + onReachBottom() { + if (this.data.tab === 2) { + const { revisitPagination } = this.data + if (revisitPagination.page < revisitPagination.pages) { + this.getRevisitList(revisitPagination.page + 1, true) + } + } + }, + onChange(e: any) { + const { index } = e.detail + this.setData({ tab: index }) + if (index === 2) { + this.getRevisitList() + this.getLastRevisit() + } + }, + getRevisitList(page = 1, append = false) { + const { startMonth, endMonth } = this.data + wx.ajax({ + method: 'GET', + url: '?r=psvt/revisit-record/list', + data: { + page, + count: PAGE_SIZE, + startMonth, + endMonth, + }, + }).then((res: any) => { + const totalCount = Number(res.count) || 0 + const list = (res.list || []).map((item: any, index: number) => { + const globalIndex = (page - 1) * PAGE_SIZE + index + return { + ...item, + seqNum: globalIndex + 1, + } + }) + this.setData({ + revisitList: append ? this.data.revisitList.concat(list) : list, + revisitPagination: { + page: res.page || 1, + pages: res.pages || 1, + count: totalCount, + }, + totalRevisits: totalCount, + }) + }) + }, + getLastRevisit() { + wx.ajax({ + method: 'GET', + url: '?r=psvt/revisit-record/last-revisit', + }).then((res: any) => { + this.setData({ + daysSinceLastRevisit: res?.daysSinceLastRevisit ?? 0, + }) + }) + }, + onStartMonthChange(e: any) { + this.setData({ startMonth: e.detail.value }) + this.getRevisitList() + }, + onEndMonthChange(e: any) { + this.setData({ endMonth: e.detail.value }) + this.getRevisitList() + }, + handleRevisitTap(e: any) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/pages/followDetail/index?id=${id}`, + }) + }, + handleAddRevisit() { + wx.navigateTo({ + url: '/pages/followForm/index', + }) + }, initChart() { const arr = ['2026-06-01', '2026-06-02', '2026-06-03', '2026-06-04', '2026-06-05', '2026-06-06', '2026-06-07'] this.ecDataTrendComponent.init((canvas, width, height, dpr) => { - let chart = echarts.init(canvas, null, { - width: width, - height: height, + const chart = echarts.init(canvas, null, { + width, + height, devicePixelRatio: dpr, }) canvas.setChart(chart) - var option = { + const option = { dataZoom: [ { type: 'inside', startValue: 0, - endValue: 6, // 修正:数组下标0~6,原来7会越界 + endValue: 6, xAxisIndex: [0], }, ], @@ -55,7 +163,6 @@ Page({ }, order: 'seriesDesc', }, - // 双图例自定义样式,匹配原图空心绿圈+实心红点 legend: { bottom: 0, padding: 0, @@ -133,20 +240,18 @@ Page({ ], series: [ { - // 单条主线,所有点位都有数值,折线完整连续无断点 name: '心率', type: 'line', symbol: 'circle', symbolSize: 8, lineStyle: { color: '#46bc70', width: 2 }, - // 每个点位单独配置样式,发作点红色实心,其余白色空心绿边框 data: [ { value: 62, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, { value: 60, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, { value: 61, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 66, itemStyle: { color: '#d62828', borderColor: '#fff' } }, // 发作红点 + { value: 66, itemStyle: { color: '#d62828', borderColor: '#fff' } }, { value: 63, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, - { value: 69, itemStyle: { color: '#d62828', borderColor: '#fff' } }, // 发作红点 + { value: 69, itemStyle: { color: '#d62828', borderColor: '#fff' } }, { value: 64, itemStyle: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 } }, ], }, @@ -215,11 +320,6 @@ Page({ }) } }, - handleDetail() { - wx.navigateTo({ - url: '/pages/wallDetail/index', - }) - }, }) export {} diff --git a/src/pages/health/index.wxml b/src/pages/health/index.wxml index e9884f2..66bc011 100644 --- a/src/pages/health/index.wxml +++ b/src/pages/health/index.wxml @@ -6,11 +6,6 @@ class="page" style="background: url('{{imageUrl}}bg6.png?t={{Timestamp}}') no-repeat top center/100% 478rpx;padding-top: {{pageTop}}px;" > - - - - - - - 2026.01 + + {{startMonth}} - - - 2026.01 + + {{endMonth}} 共复诊 - 3 + {{totalRevisits}} 次 距上次复诊 - 12 + {{daysSinceLastRevisit}} - + - 第4次复诊 - 2026.7.12 + 第{{item.seqNum}}次复诊 + {{item.visitDate}} - - - + + + - 未更新处方 - 医生建议持续监测心律指标、评估药物疗效与不良反应,动态调整治… + {{item.isUpdatePrescription ? '已更新处方' : '未更新处方'}} + {{item.remark}} + - + diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index 36ab315..9cf264f 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -58,6 +58,16 @@ page { margin: 32rpx 30rpx 0; height: 176rpx; } + .swiper2 { + margin: 32rpx 30rpx 0; + height: 160rpx; + .s-img{ + display: block; + width: 100%; + height: 160rpx; + border-radius: 32rpx; + } + } .video-list { margin: 32rpx 0 0; .v-header { diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 42cd28a..e177b1a 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -19,7 +19,7 @@ Page({ }, videoList: [] as Array, configList: [] as Array, - sectionList: [] as Array<{ code: string; visible: boolean }>, + sectionList: [] as Array<{ code: string; visible: boolean; subList: any[] }>, moduleVisible: { health: true, 'spread1': true, @@ -68,7 +68,11 @@ Page({ const sectionList = sectionCodes .map((code) => { const conf = list.find((item: any) => item.code === code) - return { code, visible: conf ? conf.showStatus == 1 : false } + return { + code, + visible: conf ? conf.showStatus == 1 : false, + subList: conf?.subList || [], + } }) .sort((a, b) => { const aSeq = list.find((item: any) => item.code === a.code)?.sequence || 0 diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index 83f19d9..d2e89f1 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -42,7 +42,13 @@ - + diff --git a/src/pages/login/index.ts b/src/pages/login/index.ts index 929aa23..543d0f6 100644 --- a/src/pages/login/index.ts +++ b/src/pages/login/index.ts @@ -114,6 +114,7 @@ Page({ data: { mobile, code, + channelId: app.globalData.scene?.channelId || '', }, showMsg: false, }) diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index a53686e..11fe0fe 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -17,27 +17,27 @@ - - - - - - - - - - + + + 我的帖子 + + + + 健康档案 + + + - - - - - - - - - - + + + 我的评论 + + + + + 我的收藏 + + 个人信息 diff --git a/src/pages/videoDetail/index.ts b/src/pages/videoDetail/index.ts index 3b5bcca..ccde763 100644 --- a/src/pages/videoDetail/index.ts +++ b/src/pages/videoDetail/index.ts @@ -164,7 +164,7 @@ Page({ this.setData({ [`videoList[${index}].drag`]: false }) }, handleCompliment() { - if (!app.checkLoginType(1)) return + if (!app.checkLoginType(1, true)) return const { current, videoList } = this.data const video = videoList[current] if (video.IsCompliment) return @@ -180,7 +180,7 @@ Page({ }) }, handleCollect() { - if (!app.checkLoginType(1)) return + if (!app.checkLoginType(1, true)) return const { current, videoList } = this.data const video = videoList[current] const isCollect = video.IsCollect diff --git a/typings/index.d.ts b/typings/index.d.ts index cce2c5c..708083c 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -46,7 +46,7 @@ interface IAppOption { getUserInfo: (type?: 0 | 1 | 2) => Promise startLogin: (callback?: () => void) => void waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise - checkLoginType: (type: 0 | 1 | 2 | 'any') => boolean + checkLoginType: (type: 1 | 'any', confirm: boolean) => boolean mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void globalSystemInfo?: globalSystemInfo [propName: string]: any