Browse Source

bug fix

dev
kola-web 2 days ago
parent
commit
e5eeffffb7
  1. 2
      src/app.ts
  2. 16
      src/components/popup/index.ts
  3. 2
      src/components/uploadFile/index.scss
  4. 2
      src/pages/followDetail/index.scss
  5. 8
      src/pages/followDetail/index.ts
  6. 3
      src/pages/followDetail/index.wxml
  7. 3
      src/pages/followForm/index.scss
  8. 11
      src/pages/followForm/index.ts
  9. 9
      src/pages/followForm/index.wxml
  10. 9
      src/pages/health/index.scss
  11. 43
      src/pages/health/index.ts
  12. 12
      src/pages/health/index.wxml
  13. 2
      src/pages/heartDetail/index.scss
  14. 11
      src/pages/heartDetail/index.ts
  15. 2
      src/pages/heartDetail/index.wxml
  16. 2
      src/pages/heartForm/index.scss
  17. 9
      src/pages/heartForm/index.ts
  18. 3
      src/pages/heartForm/index.wxml
  19. 2
      src/pages/hotTopic/index.ts
  20. 2
      src/pages/hotTopicDetail/index.scss
  21. 2
      src/pages/hotTopicDetail/index.ts
  22. 1
      src/pages/index/index.scss
  23. 32
      src/pages/index/index.ts
  24. 8
      src/pages/index/index.wxml
  25. 4
      src/pages/login/index.scss
  26. 7
      src/pages/my/index.ts
  27. 4
      src/pages/my/index.wxml
  28. 16
      src/pages/myCollection/index.ts
  29. 11
      src/pages/myCollection/index.wxml
  30. 1
      src/pages/myComment/index.scss
  31. 5
      src/pages/myComment/index.ts
  32. 2
      src/pages/myComment/index.wxml
  33. 2
      src/pages/myWall/index.scss
  34. 2
      src/pages/myWall/index.ts
  35. 2
      src/pages/wall/index.scss
  36. 2
      src/pages/wall/index.ts
  37. 2
      src/pages/wallDetail/index.scss
  38. 2
      src/pages/wallDetail/index.ts
  39. 2
      src/pages/wallForm/index.scss
  40. 2
      src/pages/wallForm/index.ts
  41. 2
      typings/index.d.ts

2
src/app.ts

@ -115,7 +115,7 @@ App<IAppOption>({
return new Promise((resolve) => { return new Promise((resolve) => {
const checkLogin = () => { const checkLogin = () => {
if (this.globalData.loginState) { if (this.globalData.loginState) {
if (this.checkLoginType(type)) { if (this.checkLoginType(type, false)) {
resolve() resolve()
} }
return return

16
src/components/popup/index.ts

@ -21,19 +21,7 @@ Component({
observers: { observers: {
show(val) { show(val) {
if (val) { if (val) {
if (this.data.type === 'TCenter') { if (this.data.type === 'popup1') {
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') {
this.getCodeImg() this.getCodeImg()
} }
} }
@ -150,7 +138,7 @@ Component({
getCodeImg() { getCodeImg() {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=wtx/common/get-channel-wx-code', url: '?r=psvt/common/get-channel-wx-code',
data: { data: {
ChannelType: 2, ChannelType: 2,
}, },

2
src/components/uploadFile/index.scss

@ -57,7 +57,7 @@
justify-content: center; justify-content: center;
font-size: 28rpx; font-size: 28rpx;
color: rgba(255, 255, 255, 1); 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; box-sizing: border-box;
} }
} }

2
src/pages/followDetail/index.scss

@ -127,7 +127,7 @@ page {
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

8
src/pages/followDetail/index.ts

@ -14,11 +14,13 @@ Page({
onLoad(options: any) { onLoad(options: any) {
if (options.id) { if (options.id) {
this.setData({ id: 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) { getDetail(id: string) {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',

3
src/pages/followDetail/index.wxml

@ -19,7 +19,6 @@
<view class="form-item"> <view class="form-item">
<view class="form-label"> <view class="form-label">
上传图片 上传图片
<view class="sub">可上传复诊病历、处方单或检查结果</view>
</view> </view>
<view class="photo9" wx:if="{{detail.images && detail.images.length}}"> <view class="photo9" wx:if="{{detail.images && detail.images.length}}">
<view class="p-item" wx:for="{{detail.images}}" wx:key="*this" data-url="{{item}}" bind:tap="handlePreviewImage"> <view class="p-item" wx:for="{{detail.images}}" wx:key="*this" data-url="{{item}}" bind:tap="handlePreviewImage">
@ -35,7 +34,7 @@
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">是否更新手术</view> <view class="form-label">是否手术诊断</view>
<view class="select1"> <view class="select1">
<view class="s-item {{detail.isUpdateSurgery === 1 ? 'active' : ''}}">是</view> <view class="s-item {{detail.isUpdateSurgery === 1 ? 'active' : ''}}">是</view>
<view class="s-item {{detail.isUpdateSurgery === 0 ? 'active' : ''}}">否</view> <view class="s-item {{detail.isUpdateSurgery === 0 ? 'active' : ''}}">否</view>

3
src/pages/followForm/index.scss

@ -79,6 +79,7 @@ page {
width: 100%; width: 100%;
height: 240rpx; height: 240rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 48rpx;
color: rgba(30, 41, 59, 1); color: rgba(30, 41, 59, 1);
box-sizing: border-box; box-sizing: border-box;
background: #f9fafb; background: #f9fafb;
@ -124,7 +125,7 @@ page {
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

11
src/pages/followForm/index.ts

@ -1,3 +1,5 @@
import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
Page({ Page({
@ -19,6 +21,8 @@ Page({
isUpdateSurgery: 0, isUpdateSurgery: 0,
remark: '', remark: '',
isEdit: false, isEdit: false,
endDate: dayjs().format('YYYY-MM-DD'),
}, },
onLoad(options: any) { onLoad(options: any) {
if (options.id) { if (options.id) {
@ -52,7 +56,12 @@ Page({
}) })
}, },
onDateChange(e: any) { 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) { handleSetData(e: any) {
const { fileList } = this.data const { fileList } = this.data

9
src/pages/followForm/index.wxml

@ -1,7 +1,7 @@
<navbar fixed custom-style="background:{{background}}" back> <navbar fixed custom-style="background:{{background}}" back>
<view class="page-title" slot="left" bind:tap="handleBack"> <view class="page-title" slot="left" bind:tap="handleBack">
<van-icon name="arrow-left" /> <van-icon name="arrow-left" />
复诊记录 {{isEdit?"编辑":"添加"}}复诊记录
</view> </view>
</navbar> </navbar>
@ -12,7 +12,7 @@
<view class="form"> <view class="form">
<view class="form-item"> <view class="form-item">
<view class="form-label">日期</view> <view class="form-label">日期</view>
<picker mode="date" value="{{visitDate}}" bind:change="onDateChange"> <picker mode="date" value="{{visitDate}}" bind:change="onDateChange" end="{{endDate}}">
<view class="date"> <view class="date">
<view class="content" data-place="请选择日期">{{visitDate}}</view> <view class="content" data-place="请选择日期">{{visitDate}}</view>
<van-icon class="icon" name="arrow-down" /> <van-icon class="icon" name="arrow-down" />
@ -26,6 +26,7 @@
</view> </view>
<view class="upload-wrap"> <view class="upload-wrap">
<uploadFile <uploadFile
maxNum="{{10}}"
fileList="{{fileList}}" fileList="{{fileList}}"
bind:setData="handleSetData" bind:setData="handleSetData"
bind:deleteFile="handleDeleteFile" bind:deleteFile="handleDeleteFile"
@ -53,7 +54,7 @@
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">是否更新手术</view> <view class="form-label">是否手术诊断</view>
<view class="select1"> <view class="select1">
<view <view
class="s-item {{isUpdateSurgery === 1 ? 'active' : ''}}" class="s-item {{isUpdateSurgery === 1 ? 'active' : ''}}"
@ -76,7 +77,7 @@
<textarea <textarea
class="txa" class="txa"
placeholder-class="txa-place" placeholder-class="txa-place"
placeholder="请输入备注" placeholder="请输入本次复诊内容,如:医生建议、症状变化、复诊结论等"
value="{{remark}}" value="{{remark}}"
bindinput="onRemarkInput" bindinput="onRemarkInput"
maxlength="{{500}}" maxlength="{{500}}"

9
src/pages/health/index.scss

@ -227,7 +227,7 @@ page {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 20rpx; gap: 30rpx;
.date-range { .date-range {
padding: 0 32rpx; padding: 0 32rpx;
border-radius: 100rpx; border-radius: 100rpx;
@ -247,6 +247,10 @@ page {
} }
} }
.total { .total {
flex: 1;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
font-size: 24rpx; font-size: 24rpx;
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
.high { .high {
@ -274,6 +278,7 @@ page {
border-radius: 12rpx; border-radius: 12rpx;
background: rgba(47, 130, 169, 0.05); background: rgba(47, 130, 169, 0.05);
box-sizing: border-box; box-sizing: border-box;
font-weight: bold;
} }
.date { .date {
color: #64748b; color: #64748b;
@ -324,7 +329,7 @@ page {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
border-radius: 19998rpx; 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-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38);
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;

43
src/pages/health/index.ts

@ -1,3 +1,5 @@
import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
const echarts = require('@/components/ec-canvas/echarts.js') const echarts = require('@/components/ec-canvas/echarts.js')
@ -52,13 +54,13 @@ Page({
this.ecDataTrendComponent = this.selectComponent('#chart1') this.ecDataTrendComponent = this.selectComponent('#chart1')
this.initChart() this.initChart()
app.waitLogin({ type: 0 }).then(() => { app.waitLogin({ type: 1 }).then(() => {
this._loaded = true this._loaded = true
if (this.data.tab === 1) { if (this.data.tab === 0) {
this.getHeartStats() this.getHeartStats()
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else if (this.data.tab === 2) { } else if (this.data.tab === 1) {
this.getRevisitList() this.getRevisitList()
this.getLastRevisit() this.getLastRevisit()
} }
@ -83,11 +85,11 @@ Page({
if (query.tab !== undefined) { if (query.tab !== undefined) {
const tab = Number(query.tab) const tab = Number(query.tab)
this.setData({ tab }) this.setData({ tab })
if (tab === 1) { if (tab === 0) {
this.getHeartStats() this.getHeartStats()
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else if (tab === 2) { } else if (tab === 1) {
this.getRevisitList() this.getRevisitList()
this.getLastRevisit() this.getLastRevisit()
} }
@ -95,23 +97,23 @@ Page({
} }
} }
if (this._loaded) { if (this._loaded) {
if (this.data.tab === 1) { if (this.data.tab === 0) {
this.getHeartStats() this.getHeartStats()
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else if (this.data.tab === 2) { } else if (this.data.tab === 1) {
this.getRevisitList() this.getRevisitList()
this.getLastRevisit() this.getLastRevisit()
} }
} }
}, },
onReachBottom() { onReachBottom() {
if (this.data.tab === 1) { if (this.data.tab === 0) {
const { heartRatePagination } = this.data const { heartRatePagination } = this.data
if (heartRatePagination.page < heartRatePagination.pages) { if (heartRatePagination.page < heartRatePagination.pages) {
this.getHeartRateList(heartRatePagination.page + 1, true) this.getHeartRateList(heartRatePagination.page + 1, true)
} }
} else if (this.data.tab === 2) { } else if (this.data.tab === 1) {
const { revisitPagination } = this.data const { revisitPagination } = this.data
if (revisitPagination.page < revisitPagination.pages) { if (revisitPagination.page < revisitPagination.pages) {
this.getRevisitList(revisitPagination.page + 1, true) this.getRevisitList(revisitPagination.page + 1, true)
@ -121,11 +123,11 @@ Page({
onChange(e: any) { onChange(e: any) {
const { index } = e.detail const { index } = e.detail
this.setData({ tab: index }) this.setData({ tab: index })
if (index === 1) { if (index === 0) {
this.getHeartStats() this.getHeartStats()
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else if (index === 2) { } else if (index === 1) {
this.getRevisitList() this.getRevisitList()
this.getLastRevisit() this.getLastRevisit()
} }
@ -173,7 +175,7 @@ Page({
}, },
onStartMonthChange(e: any) { onStartMonthChange(e: any) {
this.setData({ startMonth: e.detail.value }) this.setData({ startMonth: e.detail.value })
if (this.data.tab === 1) { if (this.data.tab === 0) {
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else { } else {
@ -182,7 +184,7 @@ Page({
}, },
onEndMonthChange(e: any) { onEndMonthChange(e: any) {
this.setData({ endMonth: e.detail.value }) this.setData({ endMonth: e.detail.value })
if (this.data.tab === 1) { if (this.data.tab === 0) {
this.getHeartChart() this.getHeartChart()
this.getHeartRateList() this.getHeartRateList()
} else { } else {
@ -202,11 +204,11 @@ Page({
}) })
}, },
handleAdd() { handleAdd() {
if (this.data.tab === 1) { if (this.data.tab === 0) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/heartForm/index', url: '/pages/heartForm/index',
}) })
} else if (this.data.tab === 2) { } else if (this.data.tab === 1) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/followForm/index', url: '/pages/followForm/index',
}) })
@ -224,7 +226,10 @@ Page({
endMonth, endMonth,
}, },
}).then((res: any) => { }).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({ this.setData({
heartRateList: append ? this.data.heartRateList.concat(list) : list, heartRateList: append ? this.data.heartRateList.concat(list) : list,
heartRatePagination: { heartRatePagination: {
@ -266,6 +271,7 @@ Page({
const isAttack = Number(item.isPsvtAttack) === 1 const isAttack = Number(item.isPsvtAttack) === 1
return { return {
value: Number(item.heartRate), value: Number(item.heartRate),
isAttack,
itemStyle: isAttack itemStyle: isAttack
? { color: '#d62828', borderColor: '#fff' } ? { color: '#d62828', borderColor: '#fff' }
: { color: '#fff', borderColor: '#46bc70', borderWidth: 2 }, : { color: '#fff', borderColor: '#46bc70', borderWidth: 2 },
@ -301,6 +307,11 @@ Page({
fontSize: 10, fontSize: 10,
}, },
order: 'seriesDesc', order: 'seriesDesc',
formatter: (params: any) => {
const p = params[0]
const name = p.data.isAttack ? '发作心率' : '正常心率'
return `${p.axisValueLabel}\n${p.marker}${name} ${p.value}`
},
}, },
legend: { legend: {
bottom: 0, bottom: 0,

12
src/pages/health/index.wxml

@ -21,7 +21,6 @@
nav-class="nav-calss" nav-class="nav-calss"
offset-top="{{offsetTop}}" offset-top="{{offsetTop}}"
> >
<van-tab title="健康量表">内容 1</van-tab>
<van-tab title="心率记录"> <van-tab title="心率记录">
<view class="body2"> <view class="body2">
<view class="body-op"> <view class="body-op">
@ -49,7 +48,7 @@
</view> </view>
</view> </view>
<view class="stat-card"> <view class="stat-card">
<view class="stat-label">最近发作</view> <view class="stat-label">总共发作</view>
<view class="stat-value"> <view class="stat-value">
<text class="stat-number">{{heartStats.attackCount}}</text> <text class="stat-number">{{heartStats.attackCount}}</text>
<text class="stat-unit">次</text> <text class="stat-unit">次</text>
@ -117,13 +116,18 @@
<image class="icon" src="{{imageUrl}}icon25.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon25.png?t={{Timestamp}}"></image>
</view> </view>
<view class="total"> <view class="total">
<view>
共复诊 共复诊
<view class="high">{{totalRevisits}}</view> <view class="high">{{totalRevisits}}</view>
次 距上次复诊
</view>
<view>
距上次复诊
<view class="high">{{daysSinceLastRevisit}}</view> <view class="high">{{daysSinceLastRevisit}}</view>
</view> </view>
</view> </view>
</view>
<view class="list"> <view class="list">
<view class="card" wx:for="{{revisitList}}" wx:key="id" data-id="{{item.id}}" bind:tap="handleRevisitTap"> <view class="card" wx:for="{{revisitList}}" wx:key="id" data-id="{{item.id}}" bind:tap="handleRevisitTap">
<view class="c-header"> <view class="c-header">
@ -135,7 +139,7 @@
<image class="p-img" mode="aspectFill" src="{{img}}"></image> <image class="p-img" mode="aspectFill" src="{{img}}"></image>
</view> </view>
</view> </view>
<view class="title">{{item.isUpdatePrescription ? '已更新处方' : '未更新处方'}}</view> <view class="title">{{item.isUpdatePrescription ? '已更新处方' : '未更新处方'}};{{isUpdateSurgery ? '已更新手术诊断' : '未手术诊断'}}</view>
<view class="content" wx:if="{{item.remark}}">{{item.remark}}</view> <view class="content" wx:if="{{item.remark}}">{{item.remark}}</view>
</view> </view>
</view> </view>

2
src/pages/heartDetail/index.scss

@ -152,7 +152,7 @@ page {
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

11
src/pages/heartDetail/index.ts

@ -1,3 +1,5 @@
import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
Page({ Page({
@ -14,17 +16,20 @@ Page({
onLoad(options: any) { onLoad(options: any) {
if (options.id) { if (options.id) {
this.setData({ id: 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) { getDetail(id: string) {
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=psvt/heart-rate-record/detail', url: '?r=psvt/heart-rate-record/detail',
data: { id }, data: { id },
}).then((res: any) => { }).then((res: any) => {
res.recordDateTime = dayjs(res.recordDateTime).format('YYYY-MM-DD HH:mm')
this.setData({ detail: res || {} }) this.setData({ detail: res || {} })
}) })
}, },

2
src/pages/heartDetail/index.wxml

@ -11,7 +11,7 @@
> >
<view class="form"> <view class="form">
<view class="form-item"> <view class="form-item">
<view class="form-label">日期</view> <view class="form-label">日期时间</view>
<view class="date"> <view class="date">
<view class="content">{{detail.recordDateTime || ''}}</view> <view class="content">{{detail.recordDateTime || ''}}</view>
</view> </view>

2
src/pages/heartForm/index.scss

@ -156,7 +156,7 @@ page {
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

9
src/pages/heartForm/index.ts

@ -14,6 +14,7 @@ Page({
recordDateTime: '', recordDateTime: '',
datetimePickerShow: false, datetimePickerShow: false,
datetimeValue: Date.now(), datetimeValue: Date.now(),
maxDate: Date.now(),
isPsvtAttack: 0, isPsvtAttack: 0,
remark: '', remark: '',
isEdit: false, isEdit: false,
@ -21,11 +22,11 @@ Page({
onLoad(options: any) { onLoad(options: any) {
if (options.id) { if (options.id) {
this.setData({ id: options.id, isEdit: true }) this.setData({ id: options.id, isEdit: true })
app.waitLogin({ type: 'any' }).then(() => { app.waitLogin({ type: 1 }).then(() => {
this.getDetail(options.id) this.getDetail(options.id)
}) })
} else { } else {
app.waitLogin({ type: 'any' }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
} }
}, },
getDetail(id: string) { getDetail(id: string) {
@ -64,6 +65,10 @@ Page({
}, },
onDatetimeConfirm(e: any) { onDatetimeConfirm(e: any) {
const date = new Date(e.detail) const date = new Date(e.detail)
if (date.getTime() > Date.now()) {
wx.showToast({ title: '不能选择未来时间', icon: 'none' })
return
}
const y = date.getFullYear() const y = date.getFullYear()
const m = String(date.getMonth() + 1).padStart(2, '0') const m = String(date.getMonth() + 1).padStart(2, '0')
const d = String(date.getDate()).padStart(2, '0') const d = String(date.getDate()).padStart(2, '0')

3
src/pages/heartForm/index.wxml

@ -1,7 +1,7 @@
<navbar fixed custom-style="background:{{background}}" back> <navbar fixed custom-style="background:{{background}}" back>
<view class="page-title" slot="left" bind:tap="handleBack"> <view class="page-title" slot="left" bind:tap="handleBack">
<van-icon name="arrow-left" /> <van-icon name="arrow-left" />
心率记录 {{isEdit?"编辑":"添加"}}心率记录
</view> </view>
</navbar> </navbar>
@ -42,6 +42,7 @@
<van-datetime-picker <van-datetime-picker
type="datetime" type="datetime"
value="{{datetimeValue}}" value="{{datetimeValue}}"
max-date="{{maxDate}}"
bind:confirm="onDatetimeConfirm" bind:confirm="onDatetimeConfirm"
bind:cancel="hideDatetimePicker" bind:cancel="hideDatetimePicker"
/> />

2
src/pages/hotTopic/index.ts

@ -9,7 +9,7 @@ Page({
} as any, } as any,
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

2
src/pages/hotTopicDetail/index.scss

@ -204,7 +204,7 @@ page {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
border-radius: 19998rpx; 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-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38);
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;

2
src/pages/hotTopicDetail/index.ts

@ -9,7 +9,7 @@ Page({
} as any, } as any,
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

1
src/pages/index/index.scss

@ -122,6 +122,7 @@ page {
font-weight: 600; font-weight: 600;
} }
.k-date { .k-date {
margin-left: 10rpx;
font-family: Manrope, sans-serif; font-family: Manrope, sans-serif;
font-weight: 400; font-weight: 400;
} }

32
src/pages/index/index.ts

@ -28,6 +28,7 @@ Page({
'qiye-wx': true, 'qiye-wx': true,
education: true, education: true,
} as Record<string, boolean>, } as Record<string, boolean>,
educationName: '知识科普',
healthSummary: { healthSummary: {
heartRate: 0, heartRate: 0,
@ -36,7 +37,8 @@ Page({
revisitDate: '', revisitDate: '',
} as any, } as any,
}, },
onLoad() { onLoad() {},
onShow() {
app.waitLogin({ type: 'any' }).then(() => { app.waitLogin({ type: 'any' }).then(() => {
this.getMyInfo() this.getMyInfo()
this.getCateList() this.getCateList()
@ -46,11 +48,6 @@ Page({
this.getHealthSummary() this.getHealthSummary()
}) })
}, },
onShow() {
if (app.globalData.loginState) {
this.getMyInfo()
}
},
getHealthSummary() { getHealthSummary() {
const summary: any = { const summary: any = {
heartRate: 0, heartRate: 0,
@ -103,8 +100,12 @@ Page({
const conf = list.find((item: any) => item.code === code) const conf = list.find((item: any) => item.code === code)
return { return {
code, code,
name: conf.name,
subList: conf?.subList || [], 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) => { .sort((a, b) => {
@ -113,7 +114,8 @@ Page({
return Number(aSeq) - Number(bSeq) 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() { getMyInfo() {
@ -251,13 +253,13 @@ Page({
}, },
handleHealthHeartTap() { handleHealthHeartTap() {
const tabBarParams = app.globalData.tabBarParams || {} const tabBarParams = app.globalData.tabBarParams || {}
tabBarParams['pages/health/index'] = 'tab=1' tabBarParams['pages/health/index'] = 'tab=0'
app.globalData.tabBarParams = tabBarParams app.globalData.tabBarParams = tabBarParams
wx.switchTab({ url: '/pages/health/index' }) wx.switchTab({ url: '/pages/health/index' })
}, },
handleHealthRevisitTap() { handleHealthRevisitTap() {
const tabBarParams = app.globalData.tabBarParams || {} const tabBarParams = app.globalData.tabBarParams || {}
tabBarParams['pages/health/index'] = 'tab=2' tabBarParams['pages/health/index'] = 'tab=1'
app.globalData.tabBarParams = tabBarParams app.globalData.tabBarParams = tabBarParams
wx.switchTab({ url: '/pages/health/index' }) 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 {} export {}

8
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" style="background: url('{{imageUrl}}bg17.png?t={{Timestamp}}') no-repeat top 72rpx left 0/193rpx 47rpx"
> >
<view class="k-main"> <view class="k-main">
<image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}"></image> <image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}" catch:tap="handleAddHeart"></image>
<view class="k-num"> <view class="k-num">
<text class="k-value">{{healthSummary.heartRate}}</text> <text class="k-value">{{healthSummary.heartRate}}</text>
<text class="k-unit">次/分</text> <text class="k-unit">次/分</text>
@ -43,7 +43,7 @@
</view> </view>
<view class="k-card" bind:tap="handleHealthRevisitTap"> <view class="k-card" bind:tap="handleHealthRevisitTap">
<view class="k-main"> <view class="k-main">
<image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}"></image> <image class="k-add" src="{{imageUrl}}icon43.png?t={{Timestamp}}" catch:tap="handleAddFollow"></image>
<view class="k-num"> <view class="k-num">
<text class="k-value">{{healthSummary.revisitDays}}</text> <text class="k-value">{{healthSummary.revisitDays}}</text>
<text class="k-unit">天</text> <text class="k-unit">天</text>
@ -75,7 +75,7 @@
<!-- code: video-big 大咖说 --> <!-- code: video-big 大咖说 -->
<view class="video-list" wx:if="{{item.code==='video-big' && item.visible}}"> <view class="video-list" wx:if="{{item.code==='video-big' && item.visible}}">
<view class="v-header"> <view class="v-header">
<view class="title">视频科普</view> <view class="title">{{item.name}}</view>
<view class="more" bind:tap="handleVideoMore"> <view class="more" bind:tap="handleVideoMore">
查看更多 查看更多
<van-icon name="arrow" /> <van-icon name="arrow" />
@ -109,7 +109,7 @@
<!-- code: education 用户教育最底部 --> <!-- code: education 用户教育最底部 -->
<view class="info-list" wx:if="{{moduleVisible.education}}"> <view class="info-list" wx:if="{{moduleVisible.education}}">
<view class="i-header"> <view class="i-header">
<view class="title">知识科普</view> <view class="title">{{educationName}}</view>
</view> </view>
<view class="i-types"> <view class="i-types">
<view class="type {{activeCateId==='' && 'active'}}" bind:tap="handleCateTap" data-cateid="">推荐</view> <view class="type {{activeCateId==='' && 'active'}}" bind:tap="handleCateTap" data-cateid="">推荐</view>

4
src/pages/login/index.scss

@ -76,7 +76,7 @@
border-radius: 24rpx; border-radius: 24rpx;
font-size: 28rpx; font-size: 28rpx;
color: #fff; color: #fff;
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -84,7 +84,7 @@
} }
.submit { .submit {
height: 96rpx; height: 96rpx;
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
border-radius: 24rpx; border-radius: 24rpx;
font-size: 34rpx; font-size: 34rpx;
color: #ffffff; color: #ffffff;

7
src/pages/my/index.ts

@ -6,7 +6,7 @@ Page({
days: 0, days: 0,
}, },
onShow() { onShow() {
app.waitLogin().then(() => { app.waitLogin({ type: 1 }).then(() => {
this.getMyInfo() this.getMyInfo()
}) })
}, },
@ -27,6 +27,11 @@ Page({
}) })
}) })
}, },
handleHealth() {
wx.switchTab({
url: '/pages/health/index',
})
},
routerTo(e: any) { routerTo(e: any) {
const { url } = e.currentTarget.dataset const { url } = e.currentTarget.dataset
wx.navigateTo({ url }) wx.navigateTo({ url })

4
src/pages/my/index.wxml

@ -22,13 +22,13 @@
我的帖子 我的帖子
<image class="icon" src="{{imageUrl}}icon30.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon30.png?t={{Timestamp}}"></image>
</view> </view>
<view class="k-item" bind:tap="handlePDev"> <view class="k-item" bind:tap="handleHealth">
健康档案 健康档案
<image class="icon" src="{{imageUrl}}icon31.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon31.png?t={{Timestamp}}"></image>
</view> </view>
</view> </view>
<view class="list"> <view class="list">
<view class="list-item" bind:tap="handlePDev"> <view class="list-item" bind:tap="routerTo" data-url="/pages/myComment/index">
<image class="icon" src="{{imageUrl}}icon32.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon32.png?t={{Timestamp}}"></image>
<view class="content">我的评论</view> <view class="content">我的评论</view>
<van-icon class="arrow" name="arrow" /> <van-icon class="arrow" name="arrow" />

16
src/pages/myCollection/index.ts

@ -4,6 +4,7 @@ Page({
data: { data: {
tab: 0, tab: 0,
offsetTop: 0, offsetTop: 0,
search: '',
videoList: [] as Array<any>, videoList: [] as Array<any>,
videoPagination: { videoPagination: {
@ -20,7 +21,7 @@ Page({
}, },
}, },
onShow() { onShow() {
app.waitLogin({ type: 0 }).then(() => { app.waitLogin({ type: 1 }).then(() => {
this.getVideoList() this.getVideoList()
this.getArticleList() this.getArticleList()
}) })
@ -31,10 +32,11 @@ Page({
this.setData({ offsetTop: statusBarHeight + navBarHeight }) this.setData({ offsetTop: statusBarHeight + navBarHeight })
}, },
getVideoList(page = 1, append = false) { getVideoList(page = 1, append = false) {
const { search } = this.data
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=psvt/video/collection-list', url: '?r=psvt/video/collection-list',
data: { page, count: 10 }, data: { page, count: 10, ...(search ? { Search: search } : {}) },
}).then((res: any) => { }).then((res: any) => {
const list = res.list || [] const list = res.list || []
this.setData({ this.setData({
@ -48,10 +50,11 @@ Page({
}) })
}, },
getArticleList(page = 1, append = false) { getArticleList(page = 1, append = false) {
const { search } = this.data
wx.ajax({ wx.ajax({
method: 'GET', method: 'GET',
url: '?r=psvt/pic-text/collection-list', url: '?r=psvt/pic-text/collection-list',
data: { page, count: 10 }, data: { page, count: 10, ...(search ? { Search: search } : {}) },
}).then((res: any) => { }).then((res: any) => {
const list = res.list || [] const list = res.list || []
this.setData({ this.setData({
@ -64,6 +67,13 @@ Page({
}) })
}) })
}, },
onSearchInput(e: any) {
this.setData({ search: e.detail.value })
},
onSearch() {
this.getVideoList()
this.getArticleList()
},
onChange(e: any) { onChange(e: any) {
const { index } = e.detail const { index } = e.detail
this.setData({ tab: index }) this.setData({ tab: index })

11
src/pages/myCollection/index.wxml

@ -9,7 +9,16 @@
<view class="page-header" id="page-header" style="" style="padding-top: {{pageTop + 21}}px;"> <view class="page-header" id="page-header" style="" style="padding-top: {{pageTop + 21}}px;">
<view class="search"> <view class="search">
<image class="icon" src="{{imageUrl}}icon14.png?t={{Timestamp}}"></image> <image class="icon" src="{{imageUrl}}icon14.png?t={{Timestamp}}"></image>
<input class="input" placeholder-class="place-input" type="text" placeholder="搜索" /> <input
class="input"
placeholder-class="place-input"
type="text"
placeholder="搜索"
confirm-type="search"
value="{{search}}"
bindinput="onSearchInput"
bindconfirm="onSearch"
/>
</view> </view>
</view> </view>
<van-tabs <van-tabs

1
src/pages/myComment/index.scss

@ -5,6 +5,7 @@ page {
.page-title { .page-title {
font-size: 36rpx; font-size: 36rpx;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
padding-right: 100rpx;
} }
.page { .page {

5
src/pages/myComment/index.ts

@ -14,7 +14,7 @@ Page({
fileList: [] as any[], fileList: [] as any[],
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data
@ -97,6 +97,9 @@ Page({
topicShow: false, topicShow: false,
}) })
}, },
handleBack() {
wx.navigateBack()
},
}) })
export {} export {}

2
src/pages/myComment/index.wxml

@ -1,5 +1,5 @@
<navbar fixed custom-style="background:{{background}}" back> <navbar fixed custom-style="background:{{background}}" back>
<view class="page-title" slot="left"> <view class="page-title" slot="left" bind:tap="handleBack">
<van-icon name="arrow-left" /> <van-icon name="arrow-left" />
我的评论 我的评论
</view> </view>

2
src/pages/myWall/index.scss

@ -162,7 +162,7 @@ page {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
border-radius: 102rpx; border-radius: 102rpx;
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
box-sizing: border-box; box-sizing: border-box;
color: #fff; color: #fff;
text-align: center; text-align: center;

2
src/pages/myWall/index.ts

@ -14,7 +14,7 @@ Page({
fileList: [] as any[], fileList: [] as any[],
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

2
src/pages/wall/index.scss

@ -239,7 +239,7 @@ page {
width: 128rpx; width: 128rpx;
height: 128rpx; height: 128rpx;
border-radius: 19998rpx; 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-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38);
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;

2
src/pages/wall/index.ts

@ -9,7 +9,7 @@ Page({
} as any, } as any,
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

2
src/pages/wallDetail/index.scss

@ -425,7 +425,7 @@ page {
color: rgba(100, 116, 139, 1); color: rgba(100, 116, 139, 1);
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

2
src/pages/wallDetail/index.ts

@ -13,7 +13,7 @@ Page({
actionShow: false, actionShow: false,
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

2
src/pages/wallForm/index.scss

@ -232,7 +232,7 @@ page {
} }
} }
.send { .send {
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%)); background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }

2
src/pages/wallForm/index.ts

@ -14,7 +14,7 @@ Page({
fileList: [] as any[], fileList: [] as any[],
}, },
onLoad() { onLoad() {
app.waitLogin({ type: 0 }).then(() => {}) app.waitLogin({ type: 1 }).then(() => {})
}, },
handlePopupOk() { handlePopupOk() {
const { popupType } = this.data const { popupType } = this.data

2
typings/index.d.ts vendored

@ -45,7 +45,7 @@ interface IAppOption {
} }
getUserInfo: (type?: 0 | 1 | 2) => Promise<any> getUserInfo: (type?: 0 | 1 | 2) => Promise<any>
startLogin: (callback?: () => void) => void startLogin: (callback?: () => void) => void
waitLogin: (params?: { type?: 0 | 1 | 2 | 'any' }) => Promise<void> waitLogin: (params?: { type?: 1 | 'any' }) => Promise<void>
checkLoginType: (type: 1 | 'any', confirm: boolean) => boolean checkLoginType: (type: 1 | 'any', confirm: boolean) => boolean
mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void
globalSystemInfo?: globalSystemInfo globalSystemInfo?: globalSystemInfo

Loading…
Cancel
Save