diff --git a/README.md b/README.md index 161960e..0e49e6d 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,14 @@ images svn 地址 svn://39.106.86.127:28386/projects/xd/proj_src/shop/frontend/web/xd svn://39.106.86.127:28386/projects/xd/proj_src/branches/dev_v2.0/shop/frontend/web/xd/ +## vscode (/images/)(\S*(?=["|'])) {{imageUrl}}$2?t={{Timestamp}} +## neovim +(/images/)([^\"|']*) +{{imageUrl}}$2?t={{Timestamp}} + ui问题 1. 首页绑定医生弹窗需要重新切图 diff --git a/project.private.config.json b/project.private.config.json index ce70062..82e04cc 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -23,13 +23,6 @@ "miniprogram": { "list": [ { - "name": "11", - "pathName": "patient/pages/certReslove/index", - "query": "", - "scene": null, - "launchMode": "default" - }, - { "name": "药房", "pathName": "gift/pages/dtpDurg/index", "query": "id=10", diff --git a/src/app.ts b/src/app.ts index 1f34796..7d94f51 100644 --- a/src/app.ts +++ b/src/app.ts @@ -534,4 +534,20 @@ App({ callback(res) }) }, + setTabbarNoticeMessage() { + wx.ajax({ + method: 'GET', + url: '?r=zd/doctor/message-interact/get-unread-count', + data: {}, + }).then((res) => { + if (res > 0) { + wx.setTabBarBadge({ + index: 2, + text: res > 99 ? '99+' : res, + }) + return + } + wx.removeTabBarBadge({ index: 2 }) + }) + }, }) diff --git a/src/components/popup/index.wxml b/src/components/popup/index.wxml index b2509ea..759016a 100644 --- a/src/components/popup/index.wxml +++ b/src/components/popup/index.wxml @@ -73,13 +73,13 @@ - + 文字包含不合规内容 请修改后重新提交 - 知道了 + 知道了 { - app.mpBehavior({ doctor:true, PageName: 'PG_DoctorIMList' }) + app.mpBehavior({ doctor: true, PageName: 'PG_DoctorIMList' }) + app.setTabbarNoticeMessage() this.getList() }) }, handleTapSearch() { - app.mpBehavior({ doctor:true, PageName: 'BTN_DoctorIMListSearch' }) + app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorIMListSearch' }) }, handleSearch() { this.setData({ @@ -40,13 +41,6 @@ Page({ this.getList() }, getList(newPage = 1) { - const { active } = this.data - if (active == '' && newPage == 1) { - } - if (active == '1' && newPage == 1) { - } - if (active == '2' && newPage == 1) { - } wx.ajax({ method: 'GET', url: '?r=zd/doctor/message-interact/get-interact-patient-list', @@ -75,7 +69,7 @@ Page({ } }, handleDetail(e) { - app.mpBehavior({ doctor:true, PageName: 'BTN_DoctorIMList' }) + app.mpBehavior({ doctor: true, PageName: 'BTN_DoctorIMList' }) const { index } = e.currentTarget.dataset const { list } = this.data const listItem: any = list[index] @@ -112,7 +106,7 @@ Page({ }), }) const header = this.selectComponent('#tabbar') - header.getList() //子组件的方法 + header.getList() // 子组件的方法 }) } }, diff --git a/src/pages/d_interactive/index.wxml b/src/pages/d_interactive/index.wxml index f6127de..55e3e9f 100644 --- a/src/pages/d_interactive/index.wxml +++ b/src/pages/d_interactive/index.wxml @@ -33,7 +33,7 @@ - 1 + {{item.unReadCount> 99 ? '99+' : item.unReadCount}} diff --git a/src/pages/d_interactiveDoctor/index.json b/src/pages/d_interactiveDoctor/index.json index cc0b65f..0e5437c 100644 --- a/src/pages/d_interactiveDoctor/index.json +++ b/src/pages/d_interactiveDoctor/index.json @@ -4,6 +4,7 @@ "usingComponents": { "van-icon": "@vant/weapp/icon/index", "navbar": "/components/navbar/index", - "van-popup": "@vant/weapp/popup/index" + "van-popup": "@vant/weapp/popup/index", + "popup": "/components/popup/index" } } diff --git a/src/pages/d_interactiveDoctor/index.scss b/src/pages/d_interactiveDoctor/index.scss index 558d331..f01dcbc 100644 --- a/src/pages/d_interactiveDoctor/index.scss +++ b/src/pages/d_interactiveDoctor/index.scss @@ -548,11 +548,13 @@ page { height: 300rpx; box-sizing: border-box; padding-bottom: 80rpx; + background-color: transparent; .ka-container { padding: 30rpx 62rpx; display: flex; align-items: center; justify-content: space-between; + background-color: transparent; .stat { font-size: 28rpx; color: #adacb2; diff --git a/src/pages/d_interactiveDoctor/index.ts b/src/pages/d_interactiveDoctor/index.ts index 637c2e0..47053cf 100644 --- a/src/pages/d_interactiveDoctor/index.ts +++ b/src/pages/d_interactiveDoctor/index.ts @@ -4,7 +4,7 @@ const app = getApp() interface IMessageItem { msgId: string - msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 msgContent: any msgVisitTime: string msgVisitTimeType?: string @@ -13,6 +13,7 @@ interface IMessageItem { msgCreateTime: string // 消息创建时间 msgCreateTimeName?: string // 消息创建时间 showTime?: boolean + msgCustomSendStatus?: number | string } interface Item { @@ -22,6 +23,10 @@ interface Item { Page({ data: { + popupShow: false, + popupType: 'popup9', + popupParams: {} as any, + doctor: {} as any, patientId: '', @@ -44,6 +49,8 @@ Page({ week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], timeDay: { 1: '上午', 2: '下午' }, + + customMessage: '', }, innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, @@ -471,6 +478,61 @@ Page({ }) } }, + handleConfirm() { + const { customMessage } = this.data + this.handleHideKeyboard() + this.handleSendCustomMessage(customMessage) + }, + handleSendCustomMessage(customMessage: string) { + if (!customMessage) + return + const { messageList, patientId } = this.data + wx.ajax({ + method: 'POST', + url: '?r=zd/doctor/message-interact/send-text-message', + data: { + text: customMessage, + patientId, + }, + }).then((res) => { + if (res.errcode == 10001) { + this.setData({ + popupShow: true, + popupType: 'popup9', + popupParams: { + message: res.errmsg, + }, + }) + return + } + const pushMessage: IMessageItem[] = [ + { + msgId: '', + msgContentType: '12', + msgContent: customMessage, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }, + ] + this.setData({ + customMessage: '', + messageList: [...messageList, ...pushMessage], + }) + this.filterCreateTime() + this.handleView() + }) + }, + handlePopupOk() { + this.setData({ + popupShow: false, + }) + }, + handlePopupCancel() { + this.setData({ + popupShow: false, + }) + }, handleBack() { wx.navigateBack() }, diff --git a/src/pages/d_interactiveDoctor/index.wxml b/src/pages/d_interactiveDoctor/index.wxml index a6f0a07..4521b81 100644 --- a/src/pages/d_interactiveDoctor/index.wxml +++ b/src/pages/d_interactiveDoctor/index.wxml @@ -45,7 +45,9 @@ - {{message.msgContent}} + + {{message.msgContent}} + 我最近一次复诊时间是{{message.ReVisitInfo.visitDateName}} 我的方案是 @@ -81,7 +83,11 @@ - {{message.msgContent}} + + {{message.msgContent}} + 以下是我的出诊时间 @@ -169,6 +175,7 @@ @@ -213,3 +221,11 @@ 发送 + + diff --git a/src/pages/home/index.ts b/src/pages/home/index.ts index 1f6f89f..295995a 100644 --- a/src/pages/home/index.ts +++ b/src/pages/home/index.ts @@ -40,12 +40,9 @@ Page({ }, }, onShow() { - wx.setTabBarBadge({ - index: 2, - text: '99', - }) app.waitLogin({ type: [2] }).then(() => { app.mpBehavior({ doctor: true, PageName: 'PG_DoctorHome' }) + app.setTabbarNoticeMessage() this.getNotice() this.getBanner() this.getList() @@ -63,6 +60,7 @@ Page({ }) }) }, + getNoticeNum() {}, getTab() { wx.ajax({ method: 'GET', diff --git a/src/patient/pages/doctor/index.ts b/src/patient/pages/doctor/index.ts index 26caf66..520fab3 100644 --- a/src/patient/pages/doctor/index.ts +++ b/src/patient/pages/doctor/index.ts @@ -1,4 +1,4 @@ -import { parseUrlArgsToArray } from '@/utils/util' +import licia from 'miniprogram-licia' const app = getApp() @@ -66,8 +66,8 @@ Page({ const atvs = { length: 0 } res[0].subList .filter(item => item.showStatus == 1) - .forEach((item) => { - atvs[parseUrlArgsToArray(item.linkUrl).active || '0'] = true + .forEach((item: any) => { + atvs[licia.getUrlParam('active', item.linkUrl) || 0] = true }) atvs.length = Object.keys(atvs).length this.setData({ @@ -186,7 +186,7 @@ Page({ this.getList() }, onChange(e: WechatMiniprogram.CustomEvent) { - const index = e.detail.index + const index = e.detail.name this.setData({ tabActive: index, }) diff --git a/src/patient/pages/doctor/index.wxml b/src/patient/pages/doctor/index.wxml index 5b794ac..1af3897 100644 --- a/src/patient/pages/doctor/index.wxml +++ b/src/patient/pages/doctor/index.wxml @@ -44,9 +44,9 @@ tab-active-class="tab-active-class" bind:change="onChange" > - - - + + + diff --git a/src/patient/pages/enterInfo/index.ts b/src/patient/pages/enterInfo/index.ts index 2b331f2..19b560d 100644 --- a/src/patient/pages/enterInfo/index.ts +++ b/src/patient/pages/enterInfo/index.ts @@ -1,4 +1,5 @@ import dayjs from 'dayjs' + const app = getApp() Page({ @@ -113,7 +114,8 @@ Page({ }, handleSubmit() { app.mpBehavior({ PageName: 'BTN_PatientInfoComfirm' }) - if (this.data.submiting) return + if (this.data.submiting) + return const { name, @@ -131,17 +133,20 @@ Page({ let toast = '' // if (!diagnosisTime) toast = "确诊时间不能为空"; // if (!birth) toast = "出生日期不能为空"; - if (!gender) toast = '请选择性别' - if (!ageRange) toast = '请选择年龄范围' - if (!name) toast = '姓名不能为空' + if (!gender) + toast = '请选择性别' + if (!ageRange) + toast = '请选择年龄范围' + if (!name) + toast = '姓名不能为空' if (toast) { wx.showToast({ title: toast, icon: 'none' }) return } const backPage = app.globalData.backPage - const navUrl = - typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index' + const navUrl + = typeof backPage === 'string' && backPage.includes('liveResult') ? backPage : '/patient/pages/certReslove/index' this.setData({ submiting: true, @@ -190,6 +195,11 @@ Page({ }, handleVisitors() { app.mpBehavior({ PageName: 'BTN_PatientInfoSkip' }) + const backPage = app.globalData.backPage + const navUrl + = typeof backPage === 'string' && backPage.includes('liveResult') + ? backPage.replace('liveResult', 'liveDetail') + : '/patient/pages/index/index?visitors=1' wx.ajax({ method: 'POST', url: '?r=zd/login/reg-logout', @@ -198,7 +208,18 @@ Page({ }).then(() => { app.startLogin(() => { wx.reLaunch({ - url: '/patient/pages/index/index?visitors=1', + url: navUrl, + success() { + app.globalData.backPath = '' + if (navUrl.includes('liveDetail')) { + setTimeout(() => { + wx.showToast({ + title: '注册后可享平台完整服务', + icon: 'none', + }) + }, 1000) + } + }, }) }) }) diff --git a/src/patient/pages/hospital/index.wxml b/src/patient/pages/hospital/index.wxml index 12c3b8a..6da0fe7 100644 --- a/src/patient/pages/hospital/index.wxml +++ b/src/patient/pages/hospital/index.wxml @@ -52,7 +52,7 @@ {{item.Name}} - + {{item.Introduce}} diff --git a/src/patient/pages/index/index.wxml b/src/patient/pages/index/index.wxml index ad83492..b5c377a 100644 --- a/src/patient/pages/index/index.wxml +++ b/src/patient/pages/index/index.wxml @@ -133,7 +133,7 @@ {{item.BeginTime}} - {{item.Status==2?'点此参加':'查看'}} + {{item.Status==2?'点此进入':'查看'}} @@ -212,7 +212,7 @@ () interface IMessageItem { msgId: string - msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 + msgContentType: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' // 1:文本 2: 出诊时间 3: adl卡片 4: 语音 5: 欢迎语 6:补充真实姓名 7: 提醒完善信息 8: 复诊卡片 9:患者恢复复诊消息 msgContent: any msgVisitTime: string msgFromType: '1' | '2' // 1: 患者 2: 医生 @@ -16,6 +16,8 @@ interface IMessageItem { msgCreateTimeName?: string // 消息创建时间 showTime?: boolean ReVisitInfo?: any + msgCustomSendStatus?: number | string + msgTipsInfo?: string } interface Item { @@ -25,7 +27,7 @@ interface Item { Page({ data: { - popupShow: true, + popupShow: false, popupType: 'popup9', popupParams: {} as any, @@ -54,6 +56,8 @@ Page({ timeDay: { 1: '上午', 2: '下午' }, zdUserInfo: {}, + + customMessage: '', }, innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, onLoad(options) { @@ -338,6 +342,74 @@ Page({ focus: false, }) }, + handleInput(e: any) { + if (e.detail.value.length >= 500) { + wx.showToast({ + title: '文字已达上限', + icon: 'none', + }) + } + }, + handleReplay(e: any) { + const { message } = e.currentTarget.dataset + this.handleSendCustomMessage(message) + }, + handleConfirm() { + const { customMessage } = this.data + this.handleFooter() + this.handleSendCustomMessage(customMessage) + }, + handleSendCustomMessage(customMessage: string) { + if (!customMessage) + return + const { messageList } = this.data + wx.ajax({ + method: 'POST', + url: '?r=zd/message-interact/send-text-message', + data: { + text: customMessage, + }, + }).then((res) => { + if (res.errcode == 10001) { + this.setData({ + popupShow: true, + popupType: 'popup9', + popupParams: { + message: res.errmsg, + }, + }) + return + } + const pushMessage: IMessageItem[] = [ + { + msgId: '', + msgContentType: '11', + msgContent: customMessage, + msgVisitTime: '', + msgFromType: '1', + msgCustomSendStatus: res.this_msg_data.msgCustomSendStatus, + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + msgTipsInfo: res.this_msg_data.msgTipsInfo, + }, + ] + if (res.next_msg_data) { + pushMessage.push({ + msgId: '', + msgContentType: '12', + msgContent: res.next_msg_data.msgContent, + msgVisitTime: '', + msgFromType: '2', + msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), + }) + } + this.setData({ + customMessage: '', + messageList: [...messageList, ...pushMessage], + }) + this.filterCreateTime() + this.handleView() + }) + }, handleAdl() { wx.navigateTo({ url: '/patient/pages/adl/index', diff --git a/src/patient/pages/interactivePatient/index.wxml b/src/patient/pages/interactivePatient/index.wxml index 340bd5e..f4e70c8 100644 --- a/src/patient/pages/interactivePatient/index.wxml +++ b/src/patient/pages/interactivePatient/index.wxml @@ -34,6 +34,7 @@ + 机器人 @@ -53,7 +54,11 @@ - {{message.msgContent}} + + {{message.msgContent}} + 以下是我的出诊时间 @@ -113,9 +118,15 @@ - + - + {{message.msgContent}} @@ -145,7 +156,7 @@ - 医生回复您之前,24小时内最多只能发1条文字消息 + {{message.msgTipsInfo}} @@ -212,6 +223,7 @@ diff --git a/src/patient/pages/live/index.wxml b/src/patient/pages/live/index.wxml index 2e2416d..b665aa4 100644 --- a/src/patient/pages/live/index.wxml +++ b/src/patient/pages/live/index.wxml @@ -63,7 +63,7 @@ > 审核中 - 点此参加 + 点此进入 已报名 @@ -84,6 +84,7 @@ 已满额 报名已截止 + 点此进入 报名 diff --git a/src/patient/pages/liveDetail/index.wxml b/src/patient/pages/liveDetail/index.wxml index d648e63..3cd0aad 100644 --- a/src/patient/pages/liveDetail/index.wxml +++ b/src/patient/pages/liveDetail/index.wxml @@ -124,7 +124,7 @@ 审核中 - 点此参加 + 点此进入 @@ -151,7 +151,7 @@ 已满额 报名已截止 - 点此参加 + 点此进入 报名 diff --git a/src/patient/pages/liveResult/index.ts b/src/patient/pages/liveResult/index.ts index 00db503..60e1a1d 100644 --- a/src/patient/pages/liveResult/index.ts +++ b/src/patient/pages/liveResult/index.ts @@ -13,6 +13,8 @@ Page({ dateValue: '' as string | number, rewardScore: 0 as number | undefined, qrCode: '', + + entry: '0', }, onLoad(options) { this.setData({ @@ -50,6 +52,9 @@ Page({ this.setData({ detail: res, }) + if (this.data.entry == '1') { + this.handleLive() + } this.getQrCode() }) }, diff --git a/src/patient/pages/liveResult/index.wxml b/src/patient/pages/liveResult/index.wxml index 5da474b..f2b3f50 100644 --- a/src/patient/pages/liveResult/index.wxml +++ b/src/patient/pages/liveResult/index.wxml @@ -17,21 +17,11 @@ 立即进入直播间 + 关注公众号,活动提醒不错过 长按识别二维码 - - - - {{detail.ActivityName}} - 直播时间: {{detail.BeginTime}} - - 立即进入直播间 - - - - diff --git a/src/patient/pages/myLive/index.wxml b/src/patient/pages/myLive/index.wxml index cb78ede..fe35fa8 100644 --- a/src/patient/pages/myLive/index.wxml +++ b/src/patient/pages/myLive/index.wxml @@ -31,7 +31,7 @@ > 审核中 - 点此参加 + 点此进入 已报名