diff --git a/project.private.config.json b/project.private.config.json index ab5c055..fbdf45e 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -25,7 +25,7 @@ { "name": "知识夸详情-文章", "pathName": "pages/knowledgeDetail/index", - "query": "id=9", + "query": "id=15", "scene": null, "launchMode": "default" }, diff --git a/src/app.ts b/src/app.ts index bdbf286..4ecfeea 100644 --- a/src/app.ts +++ b/src/app.ts @@ -93,21 +93,21 @@ App({ }, 500) }) }, - mpBehavior(data: { PageName: string; doctor?: boolean }) { - let url = '?r=zd/mp-behavior/add' - if (data.doctor) { - url = '?r=zd/doctor/mp-behavior/add' - } - delete data.doctor - wx.ajax({ - method: 'POST', - url, - data: data, - loading: false, - showMsg: false, - }).then((res) => { - console.log('res: ', res) - }) + mpBehavior(data: { PageName: string }) { + // let url = '?r=zd/mp-behavior/add' + // if (data.doctor) { + // url = '?r=zd/doctor/mp-behavior/add' + // } + // delete data.doctor + // wx.ajax({ + // method: 'POST', + // url, + // data: data, + // loading: false, + // showMsg: false, + // }).then((res) => { + // console.log('res: ', res) + // }) }, getUserInfo() { diff --git a/src/components/star/index.json b/src/components/star/index.json new file mode 100644 index 0000000..a89ef4d --- /dev/null +++ b/src/components/star/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} diff --git a/src/components/star/index.scss b/src/components/star/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/components/star/index.ts b/src/components/star/index.ts new file mode 100644 index 0000000..427bee1 --- /dev/null +++ b/src/components/star/index.ts @@ -0,0 +1,204 @@ +const app = getApp(); +/** + * >=min && <=max + * @param min + * @param max + */ +function getRandom(min, max) { + return min + Math.floor(Math.random() * (max - min + 1)); +} +Component({ + options: {}, + lifetimes: { + attached() { + const query = wx.createSelectorQuery().in(this); + query + .select("#thumsCanvas") + .fields({ node: true, size: true }) + .exec((res) => { + const canvas = res[0].node; + const context = canvas.getContext("2d"); + this.setData({ + context: context, + }); + + const dpr = wx.getSystemInfoSync().pixelRatio; + canvas.width = res[0].width * dpr; + canvas.height = res[0].height * dpr; + this.data.width = res[0].width * dpr; + this.data.height = res[0].height * dpr; + // context.fillStyle = "rgba(255, 255, 255, 0)"; + const images = [ + "star/icon1.png", + "star/icon2.png", + "star/icon3.png", + "star/icon4.png", + "star/icon5.png", + "star/icon6.png", + "star/icon7.png", + "star/icon8.png", + ]; + const promiseAll = [] as Array>; + images.forEach((src) => { + const p = new Promise(function (resolve) { + const img = canvas.createImage(); + img.onerror = img.onload = resolve.bind(null, img); + img.src = app.globalData.imageUrl + src; + }); + promiseAll.push(p); + }); + Promise.all(promiseAll).then((imgsList) => { + const imgsLists = imgsList.filter((d) => { + if (d && d.width > 0) return true; + return false; + }); + this.setData({ + imgsList: imgsLists, + }); + if (this.data.imgsList.length == 0) { + // logger.error("imgsList load all error"); + wx.showToast({ + icon: "none", + title: "imgsList load all error", + }); + return; + } + }); + }); + }, + }, + properties: {}, + data: { + imgsList: [] as WechatMiniprogram.ImageData[], + width: 0, + height: 0, + context: null as any, + scanning: false, + renderList: [], + scaleTime: 0.1, // 百分比 + }, + methods: { + handleTap() { + this.start(); + }, + createRender() { + if (this.data.imgsList.length == 0) return null; + const basicScale = [0.6, 0.9, 1.2][getRandom(0, 2)]; + + const getScale = (diffTime) => { + if (diffTime < this.data.scaleTime) { + return +(diffTime / this.data.scaleTime).toFixed(2) * basicScale; + } else { + return basicScale; + } + }; + const context = this.data.context; + // 随机读取一个图片来渲染 + const image: any = this.data.imgsList[getRandom(0, this.data.imgsList.length - 1)]; + const offset = 20; + const basicX = this.data.width / 2 + getRandom(-offset, offset); + const angle = getRandom(2, 10); + let ratio = getRandom(10, 30) * (getRandom(0, 1) ? 1 : -1); + const getTranslateX = (diffTime) => { + if (diffTime < this.data.scaleTime) { + // 放大期间,不进行摇摆位移 + return basicX; + } else { + return basicX + ratio * Math.sin(angle * (diffTime - this.data.scaleTime)); + } + }; + + const getTranslateY = (diffTime) => { + return image.height / 2 + (this.data.height - image.height / 2) * (1 - diffTime); + }; + + const fadeOutStage = getRandom(14, 18) / 100; + const getAlpha = (diffTime) => { + let left = 1 - +diffTime; + if (left > fadeOutStage) { + return 1; + } else { + return 1 - +((fadeOutStage - left) / fadeOutStage).toFixed(2); + } + }; + + return (diffTime) => { + // 差值满了,即结束了 0 ---》 1 + if (diffTime >= 1) return true; + context.save(); + const scale = getScale(diffTime); + // const rotate = getRotate(); + const translateX = getTranslateX(diffTime); + const translateY = getTranslateY(diffTime); + context.translate(translateX, translateY); + context.scale(scale, scale); + // context.rotate(rotate * Math.PI / 180); + context.globalAlpha = getAlpha(diffTime); + context.drawImage(image, -image.width / 2, -image.height / 2, image.width, image.height); + context.restore(); + }; + }, + scan() { + this.data.context.clearRect(0, 0, this.data.width, this.data.height); + this.data.context.fillStyle = "rgba(255, 255, 255, 0)"; + this.data.context.fillRect(0, 0, 200, 400); + let index = 0; + let length = this.data.renderList.length; + if (length > 0) { + this.requestFrame(this.scan.bind(this)); + this.setData({ + scanning: true, + }); + } else { + this.setData({ + scanning: false, + }); + } + while (index < length) { + const child = this.data.renderList[index]; + if (!child || !child.render || child.render.call(null, (Date.now() - child.timestamp) / child.duration)) { + // 结束了,删除该动画 + this.setData({ + renderList: [...this.data.renderList].filter((_item, fIndex) => fIndex != index), + }); + length--; + } else { + // continue + index++; + } + } + }, + start() { + const render = this.createRender(); + const duration = getRandom(1500, 3000); + this.setData({ + renderList: [ + ...this.data.renderList, + { + render, + duration, + timestamp: Date.now(), + }, + ], + }); + + if (!this.data.scanning) { + this.setData({ + scanning: true, + }); + + this.requestFrame(this.scan.bind(this)); + // this.scan.bind(this)(); + } + return this; + }, + requestFrame(cb) { + return ( + this.data.context.requestAnimationFrame || + (function (callback) { + setTimeout(callback, 1000 / 60); + })(cb) + ); + }, + }, +}); diff --git a/src/components/star/index.wxml b/src/components/star/index.wxml new file mode 100644 index 0000000..e056d7b --- /dev/null +++ b/src/components/star/index.wxml @@ -0,0 +1 @@ + diff --git a/src/custom-tab-bar/index.ts b/src/custom-tab-bar/index.ts index aa39b12..c72287f 100644 --- a/src/custom-tab-bar/index.ts +++ b/src/custom-tab-bar/index.ts @@ -5,7 +5,7 @@ Component({ properties: {}, data: { imageUrl: app.globalData.imageUrl, - Timestamp:app.globalData.Timestamp, + Timestamp: app.globalData.Timestamp, isChild: 0, active: 0, @@ -25,7 +25,7 @@ Component({ { pagePath: '/pages/my/index', text: '我的', - icon: 'tabbar1-2', + icon: 'tabbar1-3', iconActive: 'tabbar1-3-active', }, ], diff --git a/src/images/icon10.png b/src/images/icon10.png index 72b0b35..a3c8c8d 100644 Binary files a/src/images/icon10.png and b/src/images/icon10.png differ diff --git a/src/images/icon19.png b/src/images/icon19.png new file mode 100644 index 0000000..5851621 Binary files /dev/null and b/src/images/icon19.png differ diff --git a/src/images/icon20.png b/src/images/icon20.png new file mode 100644 index 0000000..bc4eadc Binary files /dev/null and b/src/images/icon20.png differ diff --git a/src/images/icon21.png b/src/images/icon21.png new file mode 100644 index 0000000..754a724 Binary files /dev/null and b/src/images/icon21.png differ diff --git a/src/images/icon3.png b/src/images/icon3.png index 64a64c9..2cd4635 100644 Binary files a/src/images/icon3.png and b/src/images/icon3.png differ diff --git a/src/images/icon8.png b/src/images/icon8.png index 2cd4635..6a9cff1 100644 Binary files a/src/images/icon8.png and b/src/images/icon8.png differ diff --git a/src/images/icon9.png b/src/images/icon9.png index 60ea57f..4701772 100644 Binary files a/src/images/icon9.png and b/src/images/icon9.png differ diff --git a/src/images/none.png b/src/images/none.png new file mode 100644 index 0000000..e0c650f Binary files /dev/null and b/src/images/none.png differ diff --git a/src/images/star/icon1.png b/src/images/star/icon1.png new file mode 100644 index 0000000..189a7f8 Binary files /dev/null and b/src/images/star/icon1.png differ diff --git a/src/images/star/icon2.png b/src/images/star/icon2.png new file mode 100644 index 0000000..781e39f Binary files /dev/null and b/src/images/star/icon2.png differ diff --git a/src/images/star/icon3.png b/src/images/star/icon3.png new file mode 100644 index 0000000..f76ad07 Binary files /dev/null and b/src/images/star/icon3.png differ diff --git a/src/images/star/icon4.png b/src/images/star/icon4.png new file mode 100644 index 0000000..982cce8 Binary files /dev/null and b/src/images/star/icon4.png differ diff --git a/src/images/star/icon5.png b/src/images/star/icon5.png new file mode 100644 index 0000000..14a888a Binary files /dev/null and b/src/images/star/icon5.png differ diff --git a/src/images/star/icon6.png b/src/images/star/icon6.png new file mode 100644 index 0000000..fa87826 Binary files /dev/null and b/src/images/star/icon6.png differ diff --git a/src/images/star/icon7.png b/src/images/star/icon7.png new file mode 100644 index 0000000..c8f642d Binary files /dev/null and b/src/images/star/icon7.png differ diff --git a/src/images/star/icon8.png b/src/images/star/icon8.png new file mode 100644 index 0000000..d96c4eb Binary files /dev/null and b/src/images/star/icon8.png differ diff --git a/src/pages/applyFrom/index.scss b/src/pages/applyFrom/index.scss index 96ce2f8..5ff2fc6 100644 --- a/src/pages/applyFrom/index.scss +++ b/src/pages/applyFrom/index.scss @@ -13,7 +13,7 @@ page { display: flex; align-items: center; border-bottom: 1px solid #ededf7; - &.no-center{ + &.no-center { align-items: start; } &:last-of-type { @@ -22,6 +22,7 @@ page { .label { flex-shrink: 0; font-size: 32rpx; + line-height: 1.2; color: #010105; width: 7em; &.required::before { @@ -32,6 +33,7 @@ page { } .content { flex: 1; + line-height: 1.2; .select { display: flex; gap: 24rpx; @@ -72,6 +74,7 @@ page { } } .textarea { + padding: 0; width: 100%; font-size: 32rpx; height: 100rpx; diff --git a/src/pages/applyFrom/index.ts b/src/pages/applyFrom/index.ts index 958dcbb..88c117f 100644 --- a/src/pages/applyFrom/index.ts +++ b/src/pages/applyFrom/index.ts @@ -21,6 +21,7 @@ Page({ }, onLoad() { app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PREAPPLY' }) app.getUserInfo().then((userInfo) => { if (userInfo.ApplyIntentionId) { this.getDetail(userInfo.ApplyIntentionId) @@ -70,6 +71,9 @@ Page({ }) }, handlePhoneNumber(e) { + if (!e.detail.encryptedData) { + return + } wx.ajax({ method: 'POST', url: '?r=wtx/user/wx-telephone', @@ -79,11 +83,12 @@ Page({ }, }).then((res) => { this.setData({ - Telephone: res.Telehpone, + Telephone: res.Telephone, }) }) }, handleSubmit() { + app.mpBehavior({ PageName: 'BTN_PREAPPLY_SUBMIT' }) const { Id, UserName, Relation, BirthMonth, ProvinceId, CityId, Telephone, Remark, Argument } = this.data let toast = '' if (!Telephone) { @@ -132,6 +137,9 @@ Page({ }) }) }, + handleBack() { + wx.navigateBack() + }, }) export {} diff --git a/src/pages/applyFrom/index.wxml b/src/pages/applyFrom/index.wxml index 8ea1b80..806d084 100644 --- a/src/pages/applyFrom/index.wxml +++ b/src/pages/applyFrom/index.wxml @@ -1,5 +1,5 @@ - + diff --git a/src/pages/applyFromResult/index.scss b/src/pages/applyFromResult/index.scss index 6492a23..30ddea9 100644 --- a/src/pages/applyFromResult/index.scss +++ b/src/pages/applyFromResult/index.scss @@ -1,5 +1,5 @@ page { - color: #fafafa; + background-color: rgba(246, 246, 249, 1); } .page { background: linear-gradient(172deg, #ffa340 0%, #ffdcdd 56%, #fafafa 100%) no-repeat top center/100% 726rpx; diff --git a/src/pages/applyFromResult/index.ts b/src/pages/applyFromResult/index.ts index 56a0e63..fc713c8 100644 --- a/src/pages/applyFromResult/index.ts +++ b/src/pages/applyFromResult/index.ts @@ -21,6 +21,9 @@ Page({ }) }) }, + handleBack() { + wx.navigateBack() + }, }) export {} diff --git a/src/pages/applyFromResult/index.wxml b/src/pages/applyFromResult/index.wxml index fd3cd41..98e268c 100644 --- a/src/pages/applyFromResult/index.wxml +++ b/src/pages/applyFromResult/index.wxml @@ -1,5 +1,5 @@ - + diff --git a/src/pages/ask/index.scss b/src/pages/ask/index.scss index 4075b5d..7f75d91 100644 --- a/src/pages/ask/index.scss +++ b/src/pages/ask/index.scss @@ -145,11 +145,39 @@ page { .message { margin-bottom: 32rpx; padding: 26rpx 32rpx; - background: linear-gradient(13deg, #ffffff 0%, #ffcdca 100%); + background: #fff linear-gradient(to top, #ffffff 0%, #ffcdca 100%) no-repeat top center/ 100% 200rpx; border-radius: 32rpx; font-size: 32rpx; - color: rgba(40, 48, 49, 1); + color: rgba(1, 1, 5, 1); + line-height: 48rpx; white-space: pre-line; + .reference { + margin-top: 24rpx; + font-size: 24rpx; + color: rgba(1, 1, 5, 0.5); + line-height: 32rpx; + } + .m-footer { + border-top: 1px solid rgba(0, 0, 0, 0.04); + margin-top: 32rpx; + padding-top: 24rpx; + display: flex; + align-items: center; + justify-content: flex-end; + .icon { + width: 36rpx; + height: 36rpx; + } + .num { + margin-left: 12rpx; + font-size: 32rpx; + color: rgba(1, 1, 5, 0.4); + line-height: 1px; + &.active { + color: rgba(242, 58, 47, 1); + } + } + } } .week { margin-bottom: 32rpx; @@ -417,10 +445,11 @@ page { flex-shrink: 0; padding: 18rpx 30rpx calc(env(safe-area-inset-bottom) + 30rpx); border-radius: 24rpx 24rpx 0 0; - background-color: #fff; + background-color: rgba(255, 255, 255, 1); transition: all 0.3s; height: calc(124rpx + env(safe-area-inset-bottom)); box-sizing: border-box; + box-shadow: 0rpx 2rpx 28rpx 0rpx rgba(0, 0, 0, 0.08); .unread { position: absolute; top: -80rpx; @@ -435,13 +464,6 @@ page { &.expend { height: 50vh; } - .line { - margin: 0 auto; - width: 52rpx; - height: 6rpx; - background: #f2f4f5; - border-radius: 48rpx 48rpx 48rpx 48rpx; - } .title { margin-top: 26rpx; font-size: 32rpx; @@ -465,11 +487,11 @@ page { } .tab { flex-shrink: 0; - padding: 13rpx 22rpx; - font-size: 32rpx; - color: rgba(40, 48, 49, 1); + padding: 14rpx 32rpx; + font-size: 28rpx; + color: rgba(1, 1, 5, 0.6); border-radius: 129rpx; - background-color: rgba(242, 244, 245, 1); + background-color: rgba(247, 247, 250, 1); display: flex; align-items: center; gap: 8rpx; @@ -485,7 +507,7 @@ page { } &.active { color: #fff; - background: linear-gradient( 180deg, #FC684F 0%, #F33D31 100%); + background: linear-gradient(180deg, #fc684f 0%, #f33d31 100%); .icon { display: none; } @@ -512,7 +534,7 @@ page { justify-content: center; color: rgba(255, 255, 255, 1); border-radius: 6rpx; - background: linear-gradient( 180deg, #FC684F 0%, #F33D31 100%); + background: linear-gradient(180deg, #fc684f 0%, #f33d31 100%); } .content { padding: 0 16rpx; @@ -524,6 +546,12 @@ page { color: rgba(40, 48, 49, 1); } } + .none { + display: block; + margin: 30rpx auto; + width: 344rpx; + max-height: 302rpx; + } } } } diff --git a/src/pages/ask/index.ts b/src/pages/ask/index.ts index b92ca09..fae6008 100644 --- a/src/pages/ask/index.ts +++ b/src/pages/ask/index.ts @@ -1,26 +1,20 @@ import dayjs from 'dayjs' +const licia = require('miniprogram-licia') 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' // 1: 文本 msgContent: any msgVisitTime: string msgFromType: '1' | '2' // 1: 患者 2: 医生 - isPlay?: boolean - welcomeMsg?: { - hotQuestion: Item[] - } msgCreateTime: string // 消息创建时间 msgCreateTimeName?: string // 消息创建时间 showTime?: boolean - ReVisitInfo?: any -} - -interface Item { - questionId: string - question: string + questionId?: string // 问题ID + Reference?: string // 参考资料 + LikeTimes?: number // 点赞次数 } Page({ @@ -32,213 +26,167 @@ Page({ questionActive: 0, questionList: [] as any, - questionActiveList: [] as Item[], + questionActiveList: [] as any[], + headerQuestionList: [] as any, isLoad: false, isFinish: false, - messageList: [ - { - msgId: '1668', - msgContentType: '1', - msgContent: '您最近一次复诊时间是2025年4月23日;我的方案是:血浆置换', - welcomeMsg: '', - msgVisitTimeType: '0', - msgVisitTime: '', - msgFromType: '1', - ReVisitInfo: - '{"loginState":"lszdadaa0ca7fecc7d2ff8dee1091de8c214","visitDate":"2025-04-23","recordId":33,"hormone":2,"traditionalInhibitor":2,"gammaGlobulin":2,"plasmaExchange":1,"bCellInhibitor":2,"fcRnAntagonists":2,"c5ComplementInhibitor":2,"chineseMedicine":2,"other":2,"reVisitSolution":["血浆置换"]}', - msgCreateTime: '2025-05-23 11:58:23', - }, - { - msgId: '1668', - msgContentType: '1', - msgContent: '您最近一次复诊时间是2025年4月23日;我的方案是:血浆置换', - welcomeMsg: '', - msgVisitTimeType: '0', - msgVisitTime: '', - msgFromType: '2', - ReVisitInfo: - '{"loginState":"lszdadaa0ca7fecc7d2ff8dee1091de8c214","visitDate":"2025-04-23","recordId":33,"hormone":2,"traditionalInhibitor":2,"gammaGlobulin":2,"plasmaExchange":1,"bCellInhibitor":2,"fcRnAntagonists":2,"c5ComplementInhibitor":2,"chineseMedicine":2,"other":2,"reVisitSolution":["血浆置换"]}', - msgCreateTime: '2025-05-23 11:58:23', - }, - ] as IMessageItem[], + messageList: [] as IMessageItem[], nextMsgId: '', unReadCount: 0, firstNotReadMsgId: 0, isVisitAdl: 2, adlMsgId: 0, - week: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], - timeDay: { 1: '上午', 2: '下午' }, + LikeTimes: 0, userInfo: {}, }, - innerAudioContext: null as WechatMiniprogram.InnerAudioContext | null, - onLoad() { - this.innerAudioContext = wx.createInnerAudioContext({ - useWebAudioImplement: true, - }) - app.waitLogin({}).then(() => { - this.getQuestionList() - this.getMessageList() - app.getUserInfo(this, true, (userInfo) => { + onLoad(options) { + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_FAQ' }) + app.getUserInfo().then((userInfo) => { this.setData({ userInfo, }) }) + this.getQuestionList() + this.getHeaderQuestionList() + if (options.id) { + this.getDetail(options.id) + } }) }, - onUnload() { - if (this.innerAudioContext) { - this.innerAudioContext.stop() - } - }, handleView(index = -1) { this.setData({ scrollIntoView: index > -1 ? `view${index}` : `place`, }) }, - getDoctorDetail() { + getHeaderQuestionList() { wx.ajax({ method: 'GET', - url: '?r=zd/message-interact/get-bind-doctor-info', + url: '?r=wtx/common-question/concerned-list', data: {}, }).then((res) => { this.setData({ - doctorDetail: { - ...res, - }, + headerQuestionList: res.list, }) }) }, + getDetail(Id: string) { + wx.ajax({ + method: 'GET', + url: '?r=wtx/common-question/detail', + data: { Id }, + }).then((res) => { + this.handleSendQuestion(res) + }) + }, getQuestionList() { wx.ajax({ method: 'GET', - url: '?r=zd/message-interact/get-question-list', + url: '?r=wtx/common-question/type-list', data: {}, }).then((res) => { this.setData({ - questionList: res, - questionActiveList: res[0].questionList, + questionList: res.list, }) + this.getQuestionCommonList(this.data.questionActive) }) }, - getMessageList() { - if (this.data.isLoad || this.data.isFinish) return - this.setData({ - isLoad: true, - }) - const nextMsgId = this.data.nextMsgId + getQuestionCommonList(questionActive: number) { + const QuestionTypeId = this.data.questionList[questionActive].Id wx.ajax({ method: 'GET', - url: '?r=zd/message-interact/patient-get-message-list', + url: '?r=wtx/common-question/list', data: { - nextMsgId, + QuestionTypeId, + count: 0, }, }).then((res) => { - res.messageList.map((item) => { - if (item.msgContentType === '4') { - item.msgContent = JSON.parse(item.msgContent) - } - if (item.msgContentType === '2') { - item.msgVisitTime = item.msgVisitTimeType == 2 ? item.msgVisitTime : JSON.parse(item.msgVisitTime) - } - if (item.msgContentType === '5') { - item.welcomeMsg = JSON.parse(item.welcomeMsg) - } - if (item.msgContentType === '9') { - item.ReVisitInfo = JSON.parse(item.ReVisitInfo) - item.ReVisitInfo.visitDateName = dayjs(item.ReVisitInfo.visitDate).format('YYYY年M月DD日') - } - - return item - }) - this.setData({ - messageList: [...res.messageList.reverse(), ...this.data.messageList], - nextMsgId: res.nextMsgId, - unReadCount: res.unReadCount, - firstNotReadMsgId: res.firstNotReadMsgId, - isVisitAdl: res.isVisitAdl, - adlMsgId: res.adlMsgId, - isLoad: false, - isFinish: nextMsgId === res.nextMsgId, - }) - this.filterCreateTime() - if (!nextMsgId) { - this.handleView() + if (this.data.questionActive === questionActive) { + this.setData({ + questionActiveList: res.list, + }) } }) }, - scrolltoupper(e) { - if (e.detail.direction === 'top') { - this.getMessageList() - } + handleHeaderQuestion(e: any) { + const { index } = e.currentTarget.dataset + const { headerQuestionList } = this.data + const question = headerQuestionList[index] + this.handleQuestionClick(question.Id) + this.handleSendQuestion(question) + }, + handleQuestion(e: any) { + const { index } = e.currentTarget.dataset + const { questionActiveList } = this.data + const question = questionActiveList[index] + this.handleQuestionClick(question.Id) + this.handleSendQuestion(question) }, - handleHot(e) { - const { index, mindex } = e.currentTarget.dataset + handleSendQuestion(questionItem: any) { const { messageList } = this.data - const hotList = messageList[mindex].welcomeMsg?.hotQuestion - const hot = hotList?.[index] this.setData({ messageList: [ ...messageList, { - msgId: '', + msgId: new Date().getTime().toString(), msgContentType: '1', - msgContent: hot?.question, + msgContent: questionItem.Question, msgVisitTime: '', msgFromType: '1', msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, - ], - }) - this.handleView() - this.sendQuestion(hot?.questionId) - }, - handleQuestion(e) { - const { index } = e.currentTarget.dataset - const { questionActiveList, messageList } = this.data - const question = questionActiveList[index] - this.setData({ - messageList: [ - ...messageList, { - msgId: '', + msgId: new Date().getTime().toString(), msgContentType: '1', - msgContent: question.question, + msgContent: questionItem.Answer, + questionId: questionItem.Id, + Reference: questionItem.Reference, + LikeTimes: questionItem.LikeTimes, msgVisitTime: '', - msgFromType: '1', + msgFromType: '2', msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), }, ], }) - this.sendQuestion(question.questionId) + this.handleView() + }, + handleQuestionClick(Id) { + wx.ajax({ + method: 'POST', + url: '?r=wtx/common-question/click', + data: { Id }, + }) + }, + handleLike(e) { + const { index } = e.currentTarget.dataset + const { messageList, LikeTimes } = this.data + const item = messageList[index] + const LikeTimesKey = `messageList[${index}].LikeTimes` + const IsLikeKey = `messageList[${index}].IsLike` + this.setData({ + [LikeTimesKey]: Number(item.LikeTimes) + 1, + [IsLikeKey]: true, + LikeTimes: LikeTimes + 1, + }) + this.likePost(item.questionId) }, - sendQuestion(questionId) { + likePost: licia.debounce(function (this: any, Id) { + const { LikeTimes } = this.data + this.setData({ + LikeTimes: 0, + }) wx.ajax({ method: 'POST', - url: '?r=zd/message-interact/send-question-message', + url: '?r=wtx/common-question/like', data: { - questionId, + Id, + LikeTimes, }, - }).then((res) => { - this.setData({ - messageList: [ - ...this.data.messageList, - { - msgId: '', - msgContentType: '1', - msgContent: res, - msgVisitTime: '', - msgFromType: '2', - msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), - }, - ], - }) - this.filterCreateTime() - this.handleView() }) - }, + }, 1000), formatTime(date: string) { let msgCreateTimeName = '' if (dayjs().format('YYYY-MM-DD') === dayjs(date).format('YYYY-MM-DD')) { @@ -279,96 +227,21 @@ Page({ const { index } = e.currentTarget.dataset this.setData({ questionActive: index, - questionActiveList: this.data.questionList[index].questionList, - }) - }, - handleDoctorDetail() { - const { doctorId } = this.data.doctorDetail - wx.navigateTo({ - url: `/pages/doctorDetail/index?id=${doctorId}`, - }) - }, - handleRead() { - const { firstNotReadMsgId, messageList } = this.data - const index = messageList.findIndex((item) => `${item.msgId}` === `${firstNotReadMsgId}`) - this.handleView(index) - this.setData({ - unReadCount: 0, }) + this.getQuestionCommonList(index) }, handleFooter() { - app.mpBehavior({ PageName: 'BTN_PATIENTINTERACTIONCHOOSEQUESTION' }) this.setData({ expend: !this.data.expend, }) if (this.data.expend) { + // this.getQuestionList() setTimeout(() => { this.handleView() }, 300) } }, - handleAdl() { - wx.navigateTo({ - url: '/pages/adl/index', - }) - }, - handleAudio(e) { - const { index } = e.currentTarget.dataset - const { messageList } = this.data - const messageItem = messageList[index] - const { url } = messageItem.msgContent[0] - if (this.innerAudioContext) { - if (messageItem.isPlay) { - this.innerAudioContext.stop() - messageItem.isPlay = false - this.setData({ - messageList, - }) - return - } - this.innerAudioContext.stop() - this.innerAudioContext.src = url - this.innerAudioContext.play() - messageItem.isPlay = true - this.innerAudioContext.onEnded(() => { - messageItem.isPlay = false - this.setData({ - messageList, - }) - }) - this.setData({ - messageList, - }) - } - }, - handleFillUserInfo() { - wx.navigateTo({ - url: '/pages/personalInformation/index', - }) - }, - handleReferral() { - this.setData({ - referralFromShow: true, - }) - }, - handleReferralReplay(e) { - const params = e.detail - this.setData({ - messageList: [ - ...this.data.messageList, - { - msgId: '', - msgContentType: '9', - msgVisitTime: '', - msgContent: '', - msgFromType: '1', - msgCreateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), - ReVisitInfo: { - ...params, - visitDateName: dayjs(params.visitDate).format('YYYY年M月DD日'), - }, - }, - ], - }) + handleBack() { + wx.navigateBack() }, }) diff --git a/src/pages/ask/index.wxml b/src/pages/ask/index.wxml index 03075fe..4f4121b 100644 --- a/src/pages/ask/index.wxml +++ b/src/pages/ask/index.wxml @@ -1,7 +1,10 @@ - + - + - @@ -19,9 +21,7 @@ 关于血友病B 的基因治疗相关的问题,您关心哪些?我可以为您解答哦~ - 1.基因疗法适合多大年龄? - 1.基因疗法适合多大年龄? - 1.基因疗法适合多大年龄? + {{item.Question}} @@ -52,68 +52,15 @@ - {{message.msgContent}} - - 以下是我的出诊时间 - - {{message.msgVisitTime}} - - - {{week[item.weekday-1]}} - {{timeDay[item.timeType]}} - - - - - - - ADL+激素双达标 - 点击进入ADL - 建议您定期做ADL测评 - - - - - {{message.msgContent[0].duration}}'' - - - {{message.msgContent}} - 提交您的真实姓名 - - - {{message.msgContent}} - 完善个人信息 - - - - 您最近有按照医生的 提醒,定期复诊吗? - - - - 已复诊 + + {{message.msgContent || '您的问题我收到啦!我会继续努力,尽快帮您找到答案的~'}} + {{message.Reference}} + + + + + {{message.LikeTimes}} + @@ -123,7 +70,7 @@ {{message.msgContent}} - + @@ -131,14 +78,9 @@ - - 您有{{unReadCount}}条新消息 - - - - + - 请选择您要咨询的问题 + 我要提问 - - - {{item.typeName}} + {{item.Name}} @@ -165,11 +102,10 @@ data-index="{{index}}" > {{index+1}} - {{item.question}} + {{item.Question}} + - - diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index d154a18..ab91667 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -80,16 +80,27 @@ .module-item { border-radius: 24rpx; background: #ffffff; + position: relative; .item-img { - border-radius: 24rpx 24rpx 0 0; + border-radius: 24rpx; width: 424rpx; - height: 220rpx; + height: 317rpx; } .item-title { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + box-sizing: border-box; padding: 20rpx; font-size: 28rpx; color: #010105; line-height: 32rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + background-color: #fff; + border-radius: 0 0 24rpx 24rpx; } } } @@ -128,13 +139,18 @@ display: none; } .module-item { + flex-shrink: 0; padding: 24rpx 32rpx; width: 424rpx; box-sizing: border-box; border-radius: 24rpx; border: 2rpx solid #ffffff; background: linear-gradient(12deg, #ffffff 0%, #ffe8e6 100%); + display: flex; + flex-direction: column; + justify-content: space-between; .item-header { + flex-shrink: 0; padding-bottom: 24rpx; display: flex; align-items: center; @@ -152,20 +168,32 @@ } } .content { - padding: 16rpx 0; font-size: 28rpx; color: #010105; line-height: 48rpx; + height: 96rpx; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } .item-footer { + flex-shrink: 0; display: flex; justify-content: flex-end; margin-top: 24rpx; - font-size: 24rpx; - color: #f23a2f; - .icon { - width: 24rpx; - height: 28rpx; + .star { + font-size: 24rpx; + color: #f23a2f; + display: flex; + align-items: center; + .icon { + flex-shrink: 0; + width: 28rpx; + height: 28rpx; + } } } } diff --git a/src/pages/index/index.ts b/src/pages/index/index.ts index 01b2b0c..cbe858f 100644 --- a/src/pages/index/index.ts +++ b/src/pages/index/index.ts @@ -11,6 +11,7 @@ Page({ userInfo: {}, bannerList: [], knowledgeList: [] as any, + questionList: [] as any, pageTop: '', background: 'transparent', @@ -26,6 +27,7 @@ Page({ }) this.getBanner() this.getKnowledgeList() + this.getQuestionList() }) }, getBanner() { @@ -50,18 +52,32 @@ Page({ }) }) }, + getQuestionList() { + wx.ajax({ + method: 'GET', + url: '?r=wtx/common-question/index-list', + data: {}, + }).then((res) => { + this.setData({ + questionList: res.list, + }) + }) + }, onBannerItemTap(e: any) { + app.mpBehavior({ PageName: 'BTN_HOMEBANNER' }) const { path } = e.currentTarget.dataset wx.navigateTo({ url: path, }) }, handleKnowledge() { + app.mpBehavior({ PageName: 'BTN_HOMEEDUCATIONALL' }) wx.switchTab({ url: '/pages/knowledge/index', }) }, handleKnowledgeDetail(e: any) { + app.mpBehavior({ PageName: 'BTN_HOMEEDUCATIONCARD' }) const { index } = e.currentTarget.dataset const params = this.data.knowledgeList[index] if (params.Type == 1) { @@ -76,6 +92,15 @@ Page({ }, routerTo(e) { const { url } = e.currentTarget.dataset + let PageName = { + '/pages/applyFrom/index': 'BTN_HOMEPREAPPLYCARD', + }[url] + if (url.includes('/pages/ask/index')) { + PageName = 'BTN_HOMEFAQENTRY' + } + if (PageName) { + app.mpBehavior({ PageName }) + } wx.navigateTo({ url, }) diff --git a/src/pages/index/index.wxml b/src/pages/index/index.wxml index 5d15d83..9248173 100644 --- a/src/pages/index/index.wxml +++ b/src/pages/index/index.wxml @@ -43,7 +43,7 @@ bindtap="handleKnowledgeDetail" data-index="{{index}}" > - + {{item.Title}} @@ -57,16 +57,16 @@ - + - 基因疗法适合多大年龄? + {{item.Question}} - 目前的治疗方案适合 18 岁以上成人,暂不支持儿童及... + {{item.Answer}} - 123 + {{item.LikeTimes}} diff --git a/src/pages/knowledge/index.scss b/src/pages/knowledge/index.scss index a3e3165..f91aafc 100644 --- a/src/pages/knowledge/index.scss +++ b/src/pages/knowledge/index.scss @@ -7,11 +7,14 @@ page { .list { .list-item { margin-bottom: 24rpx; + padding: 30rpx; + border-radius: 24rpx; display: flex; + background-color: #fff; .photo { flex-shrink: 0; width: 208rpx; - height: 140rpx; + height: 156rpx; .photo-img { width: 100%; height: 100%; @@ -21,10 +24,19 @@ page { .wrap { flex: 1; padding-left: 24rpx; + display: flex; + flex-direction: column; + justify-content: space-between; .title { font-size: 32rpx; color: rgba(1, 1, 5, 1); line-height: 44rpx; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } .w-footer { margin-top: 20rpx; diff --git a/src/pages/knowledge/index.ts b/src/pages/knowledge/index.ts index b85d7c1..8eba592 100644 --- a/src/pages/knowledge/index.ts +++ b/src/pages/knowledge/index.ts @@ -13,6 +13,7 @@ Page({ }, onShow() { app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_EDUCATION' }) this.getList() }) }, diff --git a/src/pages/knowledgeDetail/index.json b/src/pages/knowledgeDetail/index.json index 89a5e89..54f1df7 100644 --- a/src/pages/knowledgeDetail/index.json +++ b/src/pages/knowledgeDetail/index.json @@ -1,6 +1,7 @@ { "navigationBarTitleText": "知识库详情", "usingComponents": { - "mp-html": "mp-html" + "mp-html": "mp-html", + "star": "/components/star/index" } } diff --git a/src/pages/knowledgeDetail/index.scss b/src/pages/knowledgeDetail/index.scss index 3601dc7..390a59b 100644 --- a/src/pages/knowledgeDetail/index.scss +++ b/src/pages/knowledgeDetail/index.scss @@ -1,5 +1,5 @@ .page { - padding: 60rpx 30rpx; + padding: 60rpx 30rpx calc(120rpx + env(safe-area-inset-bottom)); .title { font-size: 40rpx; color: rgba(1, 1, 5, 1); @@ -30,6 +30,18 @@ } } } + .animate { + position: fixed; + z-index: 1; + left: 1000000px; + bottom: calc(env(safe-area-inset-bottom) + 80rpx); + transform: translateX(-50%); + width: 200rpx; + height: 400rpx; + &.active { + left: 75%; + } + } .footer { position: fixed; bottom: 0; @@ -59,7 +71,10 @@ .num { margin-left: 12rpx; font-size: 32rpx; - color: rgba(242, 58, 47, 1); + color: rgba(1, 1, 5, 0.4); + &.active { + color: rgba(242, 58, 47, 1); + } } } .line { diff --git a/src/pages/knowledgeDetail/index.ts b/src/pages/knowledgeDetail/index.ts index 97077d4..cb2cc92 100644 --- a/src/pages/knowledgeDetail/index.ts +++ b/src/pages/knowledgeDetail/index.ts @@ -1,3 +1,4 @@ +const dayjs = require('dayjs') const licia = require('miniprogram-licia') const app = getApp() @@ -6,6 +7,8 @@ Page({ id: '', detail: {} as any, LikeTimes: 0, + + starShow: false, }, onLoad(options) { this.setData({ @@ -34,16 +37,30 @@ Page({ Id: this.data.id, }, }).then((res) => { + res.UpdateTime = dayjs(res.UpdateTime).format('YYYY-MM-DD') this.setData({ detail: res, }) }) }, + _timer: null as any, handleLike() { this.setData({ 'detail.LikeTimes': Number(this.data.detail.LikeTimes) + 1, + 'detail.IsLike': true, LikeTimes: this.data.LikeTimes + 1, + starShow: true, }) + const header = this.selectComponent('#animate') + header.start() + if (this._timer) { + clearInterval(this._timer) + } + this._timer = setTimeout(() => { + this.setData({ + starShow: false, + }) + }, 2000) this.likePost() }, likePost: licia.debounce(function (this: any) { @@ -58,17 +75,17 @@ Page({ Id: id, LikeTimes, }, - }).then(() => { - this.getDetail() }) }, 1000), onShareAppMessage() { + this.setData({ + 'detail.ShareTimes': Number(this.data.detail.ShareTimes) + 1, + 'detail.IsShare': true, + }) wx.ajax({ method: 'POST', url: '?r=wtx/knowledge/share', data: { Id: this.data.id }, - }).then(() => { - this.getDetail() }) }, }) diff --git a/src/pages/knowledgeDetail/index.wxml b/src/pages/knowledgeDetail/index.wxml index cc9d27e..f99c883 100644 --- a/src/pages/knowledgeDetail/index.wxml +++ b/src/pages/knowledgeDetail/index.wxml @@ -8,15 +8,18 @@ + - - {{detail.LikeTimes}} + + + {{detail.LikeTimes}} diff --git a/src/pages/knowledgeDetailVideo/index.json b/src/pages/knowledgeDetailVideo/index.json index e2336b0..e882641 100644 --- a/src/pages/knowledgeDetailVideo/index.json +++ b/src/pages/knowledgeDetailVideo/index.json @@ -2,6 +2,8 @@ "navigationStyle": "custom", "usingComponents": { "mp-video-swiper": "@miniprogram-component-plus/video-swiper", - "navbar": "/components/navbar/index" + "navbar": "/components/navbar/index", + "van-slider": "@vant/weapp/slider/index", + "star": "/components/star/index" } } diff --git a/src/pages/knowledgeDetailVideo/index.scss b/src/pages/knowledgeDetailVideo/index.scss index f58b6c5..751137b 100644 --- a/src/pages/knowledgeDetailVideo/index.scss +++ b/src/pages/knowledgeDetailVideo/index.scss @@ -7,10 +7,18 @@ position: relative; width: 100vw; height: 100vh; - .video{ + .video { width: 100%; height: 100%; } + .play { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90rpx; + height: 104rpx; + } .swiper-item-footer { padding: 80rpx 30rpx calc(34rpx + env(safe-area-inset-bottom)); width: 100%; @@ -23,8 +31,15 @@ font-size: 32rpx; color: rgba(255, 255, 255, 1); } + .progress { + margin-top: 24rpx; + .slider-btn { + width: 200vw; + height: 80rpx; + } + } .container { - margin-top: 32rpx; + margin-top: 24rpx; width: 100%; display: flex; align-items: center; @@ -69,6 +84,9 @@ margin-top: 6rpx; font-size: 32rpx; color: rgba(255, 255, 255, 1); + &.active { + color: rgba(246, 74, 58, 1); + } } } } @@ -77,3 +95,15 @@ } } } + +.animate { + position: fixed; + z-index: 10000000; + right: 1000000px; + bottom: calc(env(safe-area-inset-bottom) + 110rpx); + width: 200rpx; + height: 400rpx; + &.active { + right: -20rpx; + } +} diff --git a/src/pages/knowledgeDetailVideo/index.ts b/src/pages/knowledgeDetailVideo/index.ts index d54b5e6..8b973e4 100644 --- a/src/pages/knowledgeDetailVideo/index.ts +++ b/src/pages/knowledgeDetailVideo/index.ts @@ -15,6 +15,8 @@ Page({ beforeEnd: false, afterLoading: false, afterEnd: false, + + starShow: false, }, onLoad(options) { this.setData({ @@ -43,50 +45,55 @@ Page({ data: { Id: this.data.id, }, - }).then((res) => { + }).then(async (res) => { this.setData({ videoList: [res], afterLoading: true, beforeLoading: true, }) this.playCurrentVideo() - this.getList('before') - this.getList('after') + await this.getList('after') + await this.getList('before') }) }, getList(sort: 'before' | 'after') { - const { videoList, id, current } = this.data - wx.ajax({ - method: 'GET', - url: '?r=wtx/knowledge/video-sort-list', - data: { - Id: id, - sort, - }, - }).then((res) => { - if (sort === 'before') { - const newVideoList = [...res.list, ...videoList] - this.setData({ - videoList: newVideoList, - beforeLoading: false, - current: newVideoList.length - 1 + current, - beforeEnd: res.length === 0, - }) - } - if (sort === 'after') { - this.setData({ - videoList: videoList.concat(res.list), - afterLoading: false, - afterEnd: res.length === 0, - }) - } - }) + const { id } = this.data + return wx + .ajax({ + method: 'GET', + url: '?r=wtx/knowledge/video-sort-list', + data: { + Id: id, + sort, + }, + }) + .then((res) => { + const { videoList, current } = this.data + if (sort === 'before') { + const newVideoList = [...res.list, ...videoList] + this.setData({ + videoList: newVideoList, + beforeLoading: false, + current: res.list.length + current, + beforeEnd: res.length === 0, + }) + } + if (sort === 'after') { + const newVideoList = [...videoList, ...res.list] + this.setData({ + videoList: newVideoList, + afterLoading: false, + afterEnd: res.length === 0, + }) + } + }) }, handleChange(e: any) { const { beforeLoading, afterLoading, beforeEnd, afterEnd, videoList } = this.data const { current } = e.detail this.setData({ current, + starShow: false, }) if (current === 0 && !beforeLoading && beforeEnd) { this.setData({ @@ -108,6 +115,7 @@ Page({ if (!item.ctx) { item.ctx = wx.createVideoContext(`video-${item.Id}`) } + item.drag = false if (index === current) { item.ctx.play() } else { @@ -115,15 +123,85 @@ Page({ } }) }, - handleLike() { - const { current, videoList } = this.data - const currentVideo = videoList[current] + handlePlay(e: any) { + const { index } = e.currentTarget.dataset + const key = `videoList[${index}].play` + this.setData({ + [key]: true, + }) + }, + handlePause(e: any) { + const { index } = e.currentTarget.dataset + const key = `videoList[${index}].play` + this.setData({ + [key]: false, + }) + }, + handleTimeUpdate(e: any) { + const { index } = e.currentTarget.dataset + const { videoList } = this.data + if (videoList[index].drag) return + const { currentTime, duration } = e.detail + const progress = (currentTime / duration) * 100 + const progressKey = `videoList[${index}].progress` + const durationKey = `videoList[${index}].duration` + this.setData({ + [progressKey]: progress, + [durationKey]: duration, + }) + }, + handleCustomPasue(e) { + const { index } = e.currentTarget.dataset + const { videoList } = this.data + videoList[index].ctx.pause() + }, + handleCustomPlay(e: any) { + const { index } = e.currentTarget.dataset + const { videoList } = this.data + videoList[index].ctx.play() + }, + handleDragStart(e: any) { + const { index } = e.currentTarget.dataset + const key = `videoList[${index}].drag` + this.setData({ + [key]: true, + }) + }, + handleDragEnd(e: any) { + const { index } = e.currentTarget.dataset + const { videoList } = this.data + const duration = videoList[index].duration + const drapProgress = e.detail + const currentTime = (drapProgress / 100) * duration + videoList[index].ctx.seek(currentTime) + const dragKey = `videoList[${index}].drag` + this.setData({ + [dragKey]: false, + }) + }, + _timer: null as any, + handleLike(e: any) { + const { index } = e.currentTarget.dataset + const { videoList } = this.data + const currentVideo = videoList[index] const LikeTimes = Number(currentVideo.LikeTimes) + 1 - const key = `videoList[${current}].LikeTimes` + const key = `videoList[${index}].LikeTimes` this.setData({ LikeTimes: this.data.LikeTimes + 1, [key]: LikeTimes, + [`videoList[${index}].IsLike`]: true, + starShow: true, }) + const header = this.selectComponent('#animate') + header.start() + if (this._timer) { + clearInterval(this._timer) + } + this._timer = setTimeout(() => { + this.setData({ + starShow: false, + }) + }, 2000) this.likePost() }, likePost: licia.debounce(function (this: any) { @@ -141,12 +219,16 @@ Page({ }) }, 1000), onShareAppMessage() { + const { current, videoList } = this.data + const currentVideo = videoList[current] + this.setData({ + [`videoList[${current}].ShareTimes`]: Number(currentVideo.ShareTimes) + 1, + [`videoList[${current}].IsShare`]: true, + }) wx.ajax({ method: 'POST', url: '?r=wtx/knowledge/share', data: { Id: this.data.activeId }, - }).then(() => { - this.getDetail() }) }, handleBack() { diff --git a/src/pages/knowledgeDetailVideo/index.wxml b/src/pages/knowledgeDetailVideo/index.wxml index dfa0e2b..5f2de8c 100644 --- a/src/pages/knowledgeDetailVideo/index.wxml +++ b/src/pages/knowledgeDetailVideo/index.wxml @@ -1,5 +1,5 @@ - + 视频 @@ -9,29 +9,59 @@ id="video-{{item.Id}}" class="video" src="{{item.VideoSrc}}" - poster="{{item.CoverImg}}" loop object-fit="cover" enable-play-gesture enable-progress-gesture show-center-play-btn="{{false}}" + play-btn-position="center" controls="{{false}}" + bindprogress="handleProgress" + bindplay="handlePlay" + bindpause="handlePause" + bindtimeupdate="handleTimeUpdate" + data-index="{{index}}" + bind:tap="handleCustomPasue" > + - {{item.Title}}{{item.Id}} + {{item.Title}} + + + + + - + 基因知识库 - - - {{item.LikeTimes}} + + + + {{item.LikeTimes}} @@ -39,3 +69,5 @@ + + diff --git a/src/pages/login/index.wxml b/src/pages/login/index.wxml index e2fd55c..ac1664a 100644 --- a/src/pages/login/index.wxml +++ b/src/pages/login/index.wxml @@ -1,7 +1,7 @@ - + - - + + diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss index 8e07ebf..70573dd 100644 --- a/src/pages/my/index.scss +++ b/src/pages/my/index.scss @@ -43,10 +43,9 @@ page { margin-top: 8rpx; font-size: 28rpx; color: rgba(1, 1, 5, 0.4); - .num { - font-size: 36rpx; - color: rgba(242, 58, 47, 1); - } + line-height: 36rpx; + display: flex; + align-items: baseline; } } .apply { diff --git a/src/pages/my/index.ts b/src/pages/my/index.ts index 8087ff1..92409b8 100644 --- a/src/pages/my/index.ts +++ b/src/pages/my/index.ts @@ -8,9 +8,12 @@ Page({ }, onLoad() { app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_MY' }) app.getUserInfo().then((userInfo) => { this.setData({ userInfo, + // 数字变红 + Days: userInfo.Days.replace(/(\d+)/g, '$1'), }) }) }) @@ -65,7 +68,13 @@ Page({ url, }) }, - handleNone() { + handleNone(e: any) { + const { index } = e.currentTarget.dataset + const PageName = { + 1: 'BTN_MY_SWITCHPATIENT', + 2: 'BTN_MY_SWITCH_DOCTOR', + }[index] + app.mpBehavior({ PageName }) this.setData({ popupShow: true, popupType: 'stayTuned', diff --git a/src/pages/my/index.wxml b/src/pages/my/index.wxml index 1609e55..3e8c64d 100644 --- a/src/pages/my/index.wxml +++ b/src/pages/my/index.wxml @@ -12,7 +12,7 @@ 今天是陪伴您的第 - {{userInfo.Days}} + @@ -34,7 +34,7 @@ 切换身份 - + 我已开启基因治疗 @@ -42,7 +42,7 @@ - + 我是医生 diff --git a/src/patient/pages/home/index.wxml b/src/patient/pages/home/index.wxml index a4e68d7..7922b3a 100644 --- a/src/patient/pages/home/index.wxml +++ b/src/patient/pages/home/index.wxml @@ -75,7 +75,7 @@ - + diff --git a/typings/index.d.ts b/typings/index.d.ts index dee933b..a3cf159 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -44,7 +44,7 @@ interface IAppOption { getUserInfo: () => Promise startLogin: () => void waitLogin: () => Promise - mpBehavior: (data: { PageName: string; doctor?: boolean }) => void + mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void globalSystemInfo?: globalSystemInfo [propName: string]: any }