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

16
src/components/popup/index.ts

@ -21,19 +21,7 @@ Component({ @@ -21,19 +21,7 @@ Component({
observers: {
show(val) {
if (val) {
if (this.data.type === 'TCenter') {
this.setData({
TCenterId: this.data.params.hospitalId,
})
}
if (this.data.type === 'inhibitors') {
this.setData({
inhibitorsId: this.data.params.drugId || '',
inhibitorsName: this.data.params.drugName || '',
inhibitorsContent: this.data.params.content || '',
})
}
if (this.data.type === 'publicCard') {
if (this.data.type === 'popup1') {
this.getCodeImg()
}
}
@ -150,7 +138,7 @@ Component({ @@ -150,7 +138,7 @@ Component({
getCodeImg() {
wx.ajax({
method: 'GET',
url: '?r=wtx/common/get-channel-wx-code',
url: '?r=psvt/common/get-channel-wx-code',
data: {
ChannelType: 2,
},

2
src/components/uploadFile/index.scss

@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
justify-content: center;
font-size: 28rpx;
color: rgba(255, 255, 255, 1);
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%));
background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
box-sizing: border-box;
}
}

2
src/pages/followDetail/index.scss

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

8
src/pages/followDetail/index.ts

@ -14,11 +14,13 @@ Page({ @@ -14,11 +14,13 @@ Page({
onLoad(options: any) {
if (options.id) {
this.setData({ id: options.id })
app.waitLogin({ type: 'any' }).then(() => {
this.getDetail(options.id)
})
}
},
onShow() {
app.waitLogin({ type: 1 }).then(() => {
this.getDetail(this.data.id)
})
},
getDetail(id: string) {
wx.ajax({
method: 'GET',

3
src/pages/followDetail/index.wxml

@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
<view class="form-item">
<view class="form-label">
上传图片
<view class="sub">可上传复诊病历、处方单或检查结果</view>
</view>
<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">
@ -35,7 +34,7 @@ @@ -35,7 +34,7 @@
</view>
</view>
<view class="form-item">
<view class="form-label">是否更新手术</view>
<view class="form-label">是否手术诊断</view>
<view class="select1">
<view class="s-item {{detail.isUpdateSurgery === 1 ? 'active' : ''}}">是</view>
<view class="s-item {{detail.isUpdateSurgery === 0 ? 'active' : ''}}">否</view>

3
src/pages/followForm/index.scss

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

11
src/pages/followForm/index.ts

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
import dayjs from 'dayjs'
const app = getApp<IAppOption>()
Page({
@ -19,6 +21,8 @@ Page({ @@ -19,6 +21,8 @@ Page({
isUpdateSurgery: 0,
remark: '',
isEdit: false,
endDate: dayjs().format('YYYY-MM-DD'),
},
onLoad(options: any) {
if (options.id) {
@ -52,7 +56,12 @@ Page({ @@ -52,7 +56,12 @@ Page({
})
},
onDateChange(e: any) {
this.setData({ visitDate: e.detail.value })
const selectedDate = e.detail.value
if (dayjs(selectedDate).isAfter(dayjs(), 'day')) {
wx.showToast({ title: '不能选择未来日期', icon: 'none' })
return
}
this.setData({ visitDate: selectedDate })
},
handleSetData(e: any) {
const { fileList } = this.data

9
src/pages/followForm/index.wxml

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

9
src/pages/health/index.scss

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

43
src/pages/health/index.ts

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

20
src/pages/health/index.wxml

@ -21,7 +21,6 @@ @@ -21,7 +21,6 @@
nav-class="nav-calss"
offset-top="{{offsetTop}}"
>
<van-tab title="健康量表">内容 1</van-tab>
<van-tab title="心率记录">
<view class="body2">
<view class="body-op">
@ -49,7 +48,7 @@ @@ -49,7 +48,7 @@
</view>
</view>
<view class="stat-card">
<view class="stat-label">最近发作</view>
<view class="stat-label">总共发作</view>
<view class="stat-value">
<text class="stat-number">{{heartStats.attackCount}}</text>
<text class="stat-unit">次</text>
@ -117,11 +116,16 @@ @@ -117,11 +116,16 @@
<image class="icon" src="{{imageUrl}}icon25.png?t={{Timestamp}}"></image>
</view>
<view class="total">
共复诊
<view class="high">{{totalRevisits}}</view>
次 距上次复诊
<view class="high">{{daysSinceLastRevisit}}</view>
<view>
共复诊
<view class="high">{{totalRevisits}}</view>
</view>
<view>
距上次复诊
<view class="high">{{daysSinceLastRevisit}}</view>
</view>
</view>
</view>
<view class="list">
@ -135,7 +139,7 @@ @@ -135,7 +139,7 @@
<image class="p-img" mode="aspectFill" src="{{img}}"></image>
</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>
</view>

2
src/pages/heartDetail/index.scss

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

11
src/pages/heartDetail/index.ts

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

2
src/pages/heartDetail/index.wxml

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

2
src/pages/heartForm/index.scss

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

9
src/pages/heartForm/index.ts

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

3
src/pages/heartForm/index.wxml

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

2
src/pages/hotTopic/index.ts

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

2
src/pages/hotTopicDetail/index.scss

@ -204,7 +204,7 @@ page { @@ -204,7 +204,7 @@ page {
width: 128rpx;
height: 128rpx;
border-radius: 19998rpx;
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%));
background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
box-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38);
box-sizing: border-box;
display: flex;

2
src/pages/hotTopicDetail/index.ts

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

1
src/pages/index/index.scss

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

32
src/pages/index/index.ts

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

8
src/pages/index/index.wxml

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

4
src/pages/login/index.scss

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

7
src/pages/my/index.ts

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

4
src/pages/my/index.wxml

@ -22,13 +22,13 @@ @@ -22,13 +22,13 @@
我的帖子
<image class="icon" src="{{imageUrl}}icon30.png?t={{Timestamp}}"></image>
</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>
</view>
</view>
<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>
<view class="content">我的评论</view>
<van-icon class="arrow" name="arrow" />

16
src/pages/myCollection/index.ts

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

11
src/pages/myCollection/index.wxml

@ -9,7 +9,16 @@ @@ -9,7 +9,16 @@
<view class="page-header" id="page-header" style="" style="padding-top: {{pageTop + 21}}px;">
<view class="search">
<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>
<van-tabs

1
src/pages/myComment/index.scss

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

5
src/pages/myComment/index.ts

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

2
src/pages/myComment/index.wxml

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<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" />
我的评论
</view>

2
src/pages/myWall/index.scss

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

2
src/pages/myWall/index.ts

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

2
src/pages/wall/index.scss

@ -239,7 +239,7 @@ page { @@ -239,7 +239,7 @@ page {
width: 128rpx;
height: 128rpx;
border-radius: 19998rpx;
background: var(--, linear-gradient(270deg, #439fc7 0%, #2f82a9 100%));
background: linear-gradient(270deg, #439fc7 0%, #2f82a9 100%);
box-shadow: 0 40rpx 50rpx -10rpx rgba(47, 130, 169, 0.38);
box-sizing: border-box;
display: flex;

2
src/pages/wall/index.ts

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

2
src/pages/wallDetail/index.scss

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

2
src/pages/wallDetail/index.ts

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

2
src/pages/wallForm/index.scss

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

2
src/pages/wallForm/index.ts

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

2
typings/index.d.ts vendored

@ -45,7 +45,7 @@ interface IAppOption { @@ -45,7 +45,7 @@ interface IAppOption {
}
getUserInfo: (type?: 0 | 1 | 2) => Promise<any>
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
mpBehavior: (data: { PageName: string; type?: 0 | 1 | 2 | 3 }) => void
globalSystemInfo?: globalSystemInfo

Loading…
Cancel
Save