Browse Source

v1.11.5 前三条需求开发

master
kola-web 1 month ago
parent
commit
947802ba57
  1. 2
      project.config.json
  2. 2
      project.private.config.json
  3. 19
      src/app.ts
  4. BIN
      src/images/icon87.png
  5. BIN
      src/images/za-images/live-banner.png
  6. 2
      src/patient/pages/index/index.ts
  7. 85
      src/patient/pages/liveDetail/index.ts
  8. 19
      src/patient/pages/liveDetailVideo/index.scss
  9. 100
      src/patient/pages/liveDetailVideo/index.ts
  10. 32
      src/patient/pages/liveDetailVideo/index.wxml
  11. 8
      src/patient/pages/personalInformation/index.scss
  12. 36
      src/patient/pages/personalInformation/index.ts
  13. 14
      src/patient/pages/personalInformation/index.wxml

2
project.config.json

@ -71,5 +71,5 @@
} }
] ]
}, },
"appid": "wxf9ce8010f1ad24aa" "appid": "wx71ac9c27c3c3e3f4"
} }

2
project.private.config.json

@ -3,7 +3,7 @@
"projectname": "xinda-miniprogram", "projectname": "xinda-miniprogram",
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": true, "urlCheck": false,
"coverView": false, "coverView": false,
"lazyloadPlaceholderEnable": false, "lazyloadPlaceholderEnable": false,
"skylineRenderEnable": true, "skylineRenderEnable": true,

19
src/app.ts

@ -16,15 +16,15 @@ App<IAppOption>({
// 测试号 wx2b0bb13edf717c1d // 测试号 wx2b0bb13edf717c1d
// dev // dev
// appid:wxf9ce8010f1ad24aa // appid:wxf9ce8010f1ad24aa
url: 'https://m.xd.hbraas.com', // url: 'https://m.xd.hbraas.com',
upFileUrl: 'https://m.xd.hbraas.com/', // upFileUrl: 'https://m.xd.hbraas.com/',
imageUrl: 'https://m.xd.hbraas.com/xd/', // imageUrl: 'https://m.xd.hbraas.com/xd/',
// pro // pro
// appid:wx71ac9c27c3c3e3f4 // appid:wx71ac9c27c3c3e3f4
// url: 'https://m.xd.hbsaas.com', url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.xd.hbsaas.com/', upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.xd.hbsaas.com/api/xd/', imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
loginState: '', loginState: '',
isLogin: 0, isLogin: 0,
@ -97,6 +97,11 @@ App<IAppOption>({
99: '取消', 99: '取消',
100: '已删除', 100: '已删除',
}, },
liveSubscribe: {
sub: false,
tmplIds: [],
},
}, },
onLaunch() { onLaunch() {
Page = page as WechatMiniprogram.Page.Constructor Page = page as WechatMiniprogram.Page.Constructor
@ -475,7 +480,7 @@ App<IAppOption>({
} }
if (isReject) { if (isReject) {
that.globalData.backPage = backPage that.globalData.backPage = backPage
reject(null) reject(new Error('非登录用户拦截'))
return return
} }
resolve(null) resolve(null)

BIN
src/images/icon87.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 694 B

BIN
src/images/za-images/live-banner.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 KiB

After

Width:  |  Height:  |  Size: 626 KiB

2
src/patient/pages/index/index.ts

@ -472,7 +472,7 @@ Page({
data: { type: 1 }, data: { type: 1 },
}).then(() => { }).then(() => {
wx.navigateTo({ wx.navigateTo({
url: '/patient/pages/personalInformation/index?bottom=1', url: '/patient/pages/personalInformation/index?bottom=1&submit=1',
}) })
}) })
this.handleToastCancel(null, false) this.handleToastCancel(null, false)

85
src/patient/pages/liveDetail/index.ts

@ -1,6 +1,6 @@
/* eslint-disable eqeqeq */
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { parseScene } from '../../../utils/util' import { parseScene } from '../../../utils/util'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
let live_time: null | number = null let live_time: null | number = null
@ -39,7 +39,8 @@ Page({
optionsScene: optionsScene || {}, optionsScene: optionsScene || {},
id: options.id || optionsScene?.id, id: options.id || optionsScene?.id,
}) })
} else if (options.proMethodId) { }
else if (options.proMethodId) {
this.setData({ this.setData({
'optionsScene.proMethodId': options.proMethodId, 'optionsScene.proMethodId': options.proMethodId,
}) })
@ -129,7 +130,8 @@ Page({
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '会议详情', title: '会议详情',
}) })
} else { }
else {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '活动详情', title: '活动详情',
}) })
@ -218,25 +220,11 @@ Page({
}) })
}, },
handleSignUp() { handleSignUp() {
const { SubscribeTemplateList } = this.data.detail
app.mpBehavior({ PageName: 'BTN_PatientLiveSign' }) app.mpBehavior({ PageName: 'BTN_PatientLiveSign' })
wx.requestSubscribeMessage({
tmplIds: SubscribeTemplateList,
success: (res) => {
const subscribe = SubscribeTemplateList.map((item) => {
return res[item] === 'accept' ? 1 : 2
})
this.handleSignUpCallback(subscribe)
},
fail: () => {
this.handleSignUpCallback([2, 2])
},
})
},
handleSignUpCallback(res = [2, 2]) {
const { Type } = this.data.detail const { Type } = this.data.detail
const { UserType } = this.data.zdUserInfo const { UserType } = this.data.zdUserInfo
const optionsScene = this.data.optionsScene const optionsScene = this.data.optionsScene
const { SubscribeTemplateList } = this.data.detail
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=zd/activity/sign-up', url: '?r=zd/activity/sign-up',
@ -244,7 +232,6 @@ Page({
Id: this.data.id, Id: this.data.id,
PreUserIdentity: UserType, PreUserIdentity: UserType,
promotionMethodId: optionsScene.proMethodId, promotionMethodId: optionsScene.proMethodId,
subscribe: [...res],
}, },
}).then((res) => { }).then((res) => {
app app
@ -255,10 +242,44 @@ Page({
this.data.id, this.data.id,
) )
.then(() => { .then(() => {
this.handleSignUpCallback()
wx.navigateTo({ wx.navigateTo({
url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`,
}) })
}) })
.catch(() => {
app.globalData.liveSubscribe = {
sub: true,
tmplIds: SubscribeTemplateList,
}
})
})
},
handleSignUpCallback() {
const { SubscribeTemplateList } = this.data.detail
wx.requestSubscribeMessage({
tmplIds: SubscribeTemplateList,
success: (res) => {
const subscribe = SubscribeTemplateList.map((item) => {
return res[item] === 'accept' ? 1 : 2
})
this.postSubscribe(subscribe)
},
fail: () => {
const subscribe = Array.from({ length: SubscribeTemplateList.length }).fill(2)
this.postSubscribe(subscribe)
},
})
},
postSubscribe(subscribe) {
wx.ajax({
method: 'POST',
url: '?r=zd/activity/subscribe',
data: {
ActivityId: this.data.id,
subscribe,
},
showMsg: false,
}) })
}, },
handleShare() { handleShare() {
@ -300,33 +321,37 @@ Page({
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if ( if (
res.authSetting['scope.writePhotosAlbum'] != undefined && res.authSetting['scope.writePhotosAlbum'] != undefined
res.authSetting['scope.writePhotosAlbum'] == true && res.authSetting['scope.writePhotosAlbum'] == true
) { ) {
that.saveImage() that.saveImage()
} else if (res.authSetting['scope.writePhotosAlbum'] == undefined) { }
//获取当前位置 else if (res.authSetting['scope.writePhotosAlbum'] == undefined) {
// 获取当前位置
that.saveImage() that.saveImage()
} else { }
else {
wx.showModal({ wx.showModal({
title: '请求授权相册权限', title: '请求授权相册权限',
content: '需要保存海报到相册,请确认授权', content: '需要保存海报到相册,请确认授权',
confirmColor: '#8c75d0', confirmColor: '#8c75d0',
success(res) { success(res) {
if (res.cancel) { if (res.cancel) {
//取消授权 // 取消授权
wx.showToast({ wx.showToast({
title: '拒绝授权', title: '拒绝授权',
icon: 'none', icon: 'none',
duration: 1000, duration: 1000,
}) })
} else if (res.confirm) { }
//确定授权,通过wx.openSetting发起授权请求 else if (res.confirm) {
// 确定授权,通过wx.openSetting发起授权请求
wx.openSetting({ wx.openSetting({
success(res) { success(res) {
if (res.authSetting['scope.writePhotosAlbum'] == true) { if (res.authSetting['scope.writePhotosAlbum'] == true) {
that.saveImage() that.saveImage()
} else { }
else {
wx.showToast({ wx.showToast({
title: '授权失败', title: '授权失败',
icon: 'none', icon: 'none',
@ -423,12 +448,12 @@ Page({
}, },
handleTimeFinish() { handleTimeFinish() {
this.setData({ this.setData({
dateValue: dayjs().valueOf(), 'dateValue': dayjs().valueOf(),
'detail.LeftTime': 0, 'detail.LeftTime': 0,
}) })
}, },
handleLightDetail(e) { handleLightDetail(e) {
const {index} = e.currentTarget.dataset; const { index } = e.currentTarget.dataset
wx.navigateTo({ wx.navigateTo({
url: `/patient/pages/liveDetailVideo/index?id=${this.data.id}&index=${index}`, url: `/patient/pages/liveDetailVideo/index?id=${this.data.id}&index=${index}`,
}) })

19
src/patient/pages/liveDetailVideo/index.scss

@ -7,9 +7,26 @@
position: relative; position: relative;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
.video { .video {
width: 100%; width: 100%;
height: 100%; }
.full-screen {
position: absolute;
right: 0;
color: #fff;
padding: 32rpx;
display: flex;
align-items: center;
gap: 12rpx;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.6);
.icon {
width: 40rpx;
height: 40rpx;
}
} }
.play { .play {
position: absolute; position: absolute;

100
src/patient/pages/liveDetailVideo/index.ts

@ -1,5 +1,7 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
const licia = require('miniprogram-licia') const licia = require('miniprogram-licia')
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
// 组件说明文档 https://github.com/wechat-miniprogram/miniprogram-component-plus/blob/master/docs/video-swiper.md // 组件说明文档 https://github.com/wechat-miniprogram/miniprogram-component-plus/blob/master/docs/video-swiper.md
@ -20,6 +22,8 @@ Page({
starShow: false, starShow: false,
index: 0, index: 0,
offsetTop: 310,
}, },
onLoad(options) { onLoad(options) {
this.setData({ this.setData({
@ -78,11 +82,37 @@ Page({
item.drag = false item.drag = false
if (index === current) { if (index === current) {
item.ctx.play() item.ctx.play()
} else { }
else {
item.ctx.pause() item.ctx.pause()
} }
}) })
}, },
handleFullScreenChange(e) {
const { index } = e.currentTarget.dataset
const fullScreenKey = `videoList[${index}].fullScreen`
this.setData({
[fullScreenKey]: e.detail.fullScreen,
})
},
handelFullScreen(e) {
const { id } = e.currentTarget.dataset
const context = wx.createVideoContext(id)
context.requestFullScreen({})
},
handleLoadedMetaData(e) {
const { index } = e.currentTarget.dataset
const offsetTopKey = `videoList[${index}].offsetTop`
const query = wx.createSelectorQuery()
query
.select(`#${e.target.id}`)
.boundingClientRect((rect) => {
this.setData({
[offsetTopKey]: rect.height + e.target.offsetTop + 10,
})
})
.exec()
},
handlePlay(e: any) { handlePlay(e: any) {
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
const key = `videoList[${index}].play` const key = `videoList[${index}].play`
@ -100,7 +130,8 @@ Page({
handleTimeUpdate(e: any) { handleTimeUpdate(e: any) {
const { index } = e.currentTarget.dataset const { index } = e.currentTarget.dataset
const { videoList } = this.data const { videoList } = this.data
if (videoList[index].drag) return if (videoList[index].drag)
return
const { currentTime, duration } = e.detail const { currentTime, duration } = e.detail
const progress = (currentTime / duration) * 100 const progress = (currentTime / duration) * 100
const progressKey = `videoList[${index}].progress` const progressKey = `videoList[${index}].progress`
@ -115,7 +146,8 @@ Page({
const { videoList } = this.data const { videoList } = this.data
if (videoList[index].play) { if (videoList[index].play) {
videoList[index].ctx.pause() videoList[index].ctx.pause()
} else { }
else {
videoList[index].ctx.play() videoList[index].ctx.play()
} }
}, },
@ -138,60 +170,22 @@ Page({
[dragKey]: false, [dragKey]: false,
}) })
}, },
_timer: null as any, onShareAppMessage() {
handleLike(e: any) { const { id, current, videoList } = this.data
const { index } = e.currentTarget.dataset return {
const { videoList } = this.data title: videoList[current].Title,
const currentVideo = videoList[index] path: `/patient/pages/liveDetailVideo/index?id=${id}&index=${current}`,
const LikeTimes = Number(currentVideo.LikeTimes) + 1 imageUrl: videoList[current].imgUrl,
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) { handleBack() {
const { activeId, LikeTimes } = this.data wx.navigateBack({
this.setData({ fail: () => {
LikeTimes: 0, wx.reLaunch({
}) url: `/patient/pages/liveDetail/index?id=${this.data.id}`,
wx.ajax({ })
method: 'POST',
url: '?r=wtx/knowledge/like',
data: {
Id: activeId,
LikeTimes,
}, },
}) })
}, 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 },
})
},
handleBack() {
wx.navigateBack()
}, },
}) })

32
src/patient/pages/liveDetailVideo/index.wxml

@ -11,19 +11,31 @@
src="{{item.videoUrl}}" src="{{item.videoUrl}}"
poster="{{item.imgUrl}}" poster="{{item.imgUrl}}"
loop loop
title="{{item.title}}"
object-fit="contain" object-fit="contain"
enable-play-gesture enable-play-gesture
enable-progress-gesture enable-progress-gesture
show-center-play-btn="{{false}}" show-center-play-btn="{{false}}"
play-btn-position="center" controls="{{item.fullScreen}}"
controls="{{false}}" bindloadedmetadata="handleLoadedMetaData"
bindprogress="handleProgress" bindprogress="handleProgress"
bindplay="handlePlay" bindplay="handlePlay"
bindpause="handlePause" bindpause="handlePause"
bindfullscreenchange="handleFullScreenChange"
bindtimeupdate="handleTimeUpdate" bindtimeupdate="handleTimeUpdate"
data-index="{{index}}" data-index="{{index}}"
bind:tap="handleTogglePlay" data-full="{{item.fullScreen}}"
></video> ></video>
<view
wx:if="{{item.offsetTop}}"
class="full-screen"
style="top:{{item.offsetTop}}px"
catch:tap="handelFullScreen"
data-id="video-{{item.attachmentId}}"
>
<image class="icon" src="{{imageUrl}}icon87.png?t={{Timestamp}}"></image>
全屏观看
</view>
<image <image
wx:if="{{!item.play}}" wx:if="{{!item.play}}"
class="play" class="play"
@ -33,7 +45,7 @@
data-index="{{index}}" data-index="{{index}}"
></image> ></image>
<view class="swiper-item-footer"> <view class="swiper-item-footer">
<view class="title">{{item.Title}}</view> <view class="title">{{item.title}}</view>
<view class="progress"> <view class="progress">
<van-slider <van-slider
value="{{item.progress}}" value="{{item.progress}}"
@ -51,7 +63,7 @@
<view class="container"> <view class="container">
<view class="user"> <view class="user">
<image class="avatar" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image> <image class="avatar" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="name">基因知识库</view> <view class="name">TED关爱小助手</view>
</view> </view>
<view class="options"> <view class="options">
<button class="o-item" open-type="share"> <button class="o-item" open-type="share">
@ -59,11 +71,11 @@
<image wx:else class="icon" src="{{imageUrl}}icon85.png?t={{Timestamp}}"></image> <image wx:else class="icon" src="{{imageUrl}}icon85.png?t={{Timestamp}}"></image>
<view class="num {{item.IsShare && 'active'}}">{{item.ShareTimes}}</view> <view class="num {{item.IsShare && 'active'}}">{{item.ShareTimes}}</view>
</button> </button>
<view class="o-item" bind:tap="handleLike" data-index="{{index}}"> <!-- <view class="o-item" bind:tap="handleLike" data-index="{{index}}"> -->
<image wx:if="{{item.IsLike}}" class="icon" src="{{imageUrl}}icon84.png?t={{Timestamp}}"></image> <!-- <image wx:if="{{item.IsLike}}" class="icon" src="{{imageUrl}}icon84.png?t={{Timestamp}}"></image> -->
<image wx:else class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image> <!-- <image wx:else class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image> -->
<view class="num {{item.IsLike && 'active'}}">{{item.LikeTimes}}</view> <!-- <view class="num {{item.IsLike && 'active'}}">{{item.LikeTimes}}</view> -->
</view> <!-- </view> -->
</view> </view>
</view> </view>
</view> </view>

8
src/patient/pages/personalInformation/index.scss

@ -39,7 +39,7 @@ page {
.row-sub { .row-sub {
margin-top: 8rpx; margin-top: 8rpx;
font-size: 28rpx; font-size: 28rpx;
color: #ADACB2; color: #adacb2;
} }
.row-content { .row-content {
padding-top: 24rpx; padding-top: 24rpx;
@ -267,7 +267,7 @@ page {
} }
.cancellation { .cancellation {
margin: 32rpx 0 24rpx; margin: 32rpx 0 0;
height: 88rpx; height: 88rpx;
background: #ffffff; background: #ffffff;
border-radius: 156rpx 156rpx 156rpx 156rpx; border-radius: 156rpx 156rpx 156rpx 156rpx;
@ -275,10 +275,6 @@ page {
line-height: 96rpx; line-height: 96rpx;
font-size: 32rpx; font-size: 32rpx;
color: #c394ff; color: #c394ff;
&:last-of-type {
margin-top: 0;
border: none;
}
} }
.picker { .picker {

36
src/patient/pages/personalInformation/index.ts

@ -1,10 +1,12 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
const app = getApp<IAppOption>() const app = getApp<IAppOption>()
const licia = require('miniprogram-licia') const licia = require('miniprogram-licia')
Page({ Page({
data: { data: {
scrollBottom: '', scrollBottom: '',
submit: '',
isEdit: false, isEdit: false,
area: [] as string[][], area: [] as string[][],
city: [] as string[][], city: [] as string[][],
@ -65,6 +67,7 @@ Page({
if (options.bottom) { if (options.bottom) {
this.setData({ this.setData({
scrollBottom: options.bottom, scrollBottom: options.bottom,
submit: options.submit,
}) })
} }
}, },
@ -105,7 +108,7 @@ Page({
formatUserInfo(res) { formatUserInfo(res) {
this.formatBorn(res.Birth) this.formatBorn(res.Birth)
this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false) this.handleChaneDiagnosisTime({ detail: { value: res.DiagnosisTime } }, false)
const diagnoseTypeValue = this.data.DTList.findIndex((item) => item.id == res.DiagnoseType) const diagnoseTypeValue = this.data.DTList.findIndex(item => item.id == res.DiagnoseType)
this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } }) this.handleChangeDiagnoseType({ detail: { value: [diagnoseTypeValue] } })
this.handleDiagnoseTypeSave(false) this.handleDiagnoseTypeSave(false)
// this.handleTapRT(); // this.handleTapRT();
@ -128,13 +131,15 @@ Page({
if (!Birth) { if (!Birth) {
bron = `${Birth}` bron = `${Birth}`
age = '岁' age = '岁'
} else if (Birth && Birth.split('-').length > 1) { }
else if (Birth && Birth.split('-').length > 1) {
bron = `${Birth.split('-')[0]}${Birth.split('-')[1]}` bron = `${Birth.split('-')[0]}${Birth.split('-')[1]}`
age = age
month - Birth.split('-')[1] >= 0 = month - Birth.split('-')[1] >= 0
? `${year - Birth.split('-')[0]}${month - Birth.split('-')[1]}个月` ? `${year - Birth.split('-')[0]}${month - Birth.split('-')[1]}个月`
: `${year - Birth.split('-')[0] - 1}${12 - Birth.split('-')[1] + month}个月` : `${year - Birth.split('-')[0] - 1}${12 - Birth.split('-')[1] + month}个月`
} else { }
else {
bron = `${Birth}` bron = `${Birth}`
age = `${year - Birth}` age = `${year - Birth}`
} }
@ -155,7 +160,7 @@ Page({
handleChaneDiagnosisTime(e, update = true) { handleChaneDiagnosisTime(e, update = true) {
const DiagnosisTime = e.detail.value const DiagnosisTime = e.detail.value
this.setData({ this.setData({
DiagnosisTime: dayjs(DiagnosisTime).format('YYYY年MM月'), 'DiagnosisTime': dayjs(DiagnosisTime).format('YYYY年MM月'),
'zdUserInfo.DiagnosisTime': DiagnosisTime, 'zdUserInfo.DiagnosisTime': DiagnosisTime,
}) })
this.updateUserInfo(update) this.updateUserInfo(update)
@ -171,7 +176,7 @@ Page({
const value = e.detail.value const value = e.detail.value
const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id const id = this.data.RTList.filter((_item, index) => index == value)[0]?.id
this.setData({ this.setData({
rtValue: value, 'rtValue': value,
'zdUserInfo.RelationType': id, 'zdUserInfo.RelationType': id,
}) })
this.updateUserInfo(update) this.updateUserInfo(update)
@ -180,7 +185,7 @@ Page({
const value = e.detail.value const value = e.detail.value
const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id const id = this.data.GenderList.filter((_item, index) => index == value)[0]?.id
this.setData({ this.setData({
genderValue: value, 'genderValue': value,
'zdUserInfo.Gender': id, 'zdUserInfo.Gender': id,
}) })
this.updateUserInfo(update) this.updateUserInfo(update)
@ -189,7 +194,7 @@ Page({
const value = e.detail.value const value = e.detail.value
const id = this.data.dict.AgeRange.filter((_item, index) => index == value)[0]?.id const id = this.data.dict.AgeRange.filter((_item, index) => index == value)[0]?.id
this.setData({ this.setData({
ageRangeValue: value, 'ageRangeValue': value,
'zdUserInfo.AgeRange': id, 'zdUserInfo.AgeRange': id,
}) })
this.updateUserInfo(update) this.updateUserInfo(update)
@ -198,7 +203,7 @@ Page({
const rangeIndex = this.data.selectDiagnoseTypeIndex const rangeIndex = this.data.selectDiagnoseTypeIndex
const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id const id = this.data.DTList.filter((_item, index) => index == rangeIndex)[0]?.id
this.setData({ this.setData({
diagnoseTypeValue: rangeIndex, 'diagnoseTypeValue': rangeIndex,
'zdUserInfo.DiagnoseType': id, 'zdUserInfo.DiagnoseType': id,
}) })
if (update) { if (update) {
@ -233,9 +238,10 @@ Page({
this.updateUserInfo() this.updateUserInfo()
}, },
updateUserInfo(update = true) { updateUserInfo(update = true) {
if (!update) return if (!update)
const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...zdUserInfo } = return
this.data.zdUserInfo const { PatientName, RelationType, Gender, Birth, DiagnosisTime, DiagnoseType, ...zdUserInfo }
= this.data.zdUserInfo
wx.ajax({ wx.ajax({
method: 'POST', method: 'POST',
url: '?r=zd/account/update-info', url: '?r=zd/account/update-info',
@ -290,8 +296,8 @@ Page({
}, },
handlePopupOk() { handlePopupOk() {
this.setData({ this.setData({
popupShow: false, 'popupShow': false,
popupType: '', 'popupType': '',
'zdUserInfo.prescriptionImg': '', 'zdUserInfo.prescriptionImg': '',
}) })
this.updateUserInfo() this.updateUserInfo()

14
src/patient/pages/personalInformation/index.wxml

@ -179,7 +179,12 @@
<view class="del" catchtap="handleDelData" wx:if="{{zdUserInfo.DrugsAuditStatus==2}}"> <view class="del" catchtap="handleDelData" wx:if="{{zdUserInfo.DrugsAuditStatus==2}}">
<image class="d-icon" src="{{imageUrl}}icon77.png?t={{Timestamp}}"></image> <image class="d-icon" src="{{imageUrl}}icon77.png?t={{Timestamp}}"></image>
</view> </view>
<image class="img" src="{{zdUserInfo.PrescriptionImg}}" mode="aspectFill" catch:tap="handlePreview"></image> <image
class="img"
src="{{zdUserInfo.PrescriptionImg}}"
mode="aspectFill"
catch:tap="handlePreview"
></image>
<view class="check" wx:if="{{zdUserInfo.DrugsAuditStatus==1}}"> <view class="check" wx:if="{{zdUserInfo.DrugsAuditStatus==1}}">
<image class="check-icon" src="{{imageUrl}}icon81.png?t={{Timestamp}}"></image> <image class="check-icon" src="{{imageUrl}}icon81.png?t={{Timestamp}}"></image>
审核中... 审核中...
@ -197,8 +202,11 @@
</block> </block>
</view> </view>
</view> </view>
<view class="cancellation" bind:tap="routerTo" data-url="/pages/login/index?back=1">切换医生端</view> <view wx:if="{{submit}}" class="cancellation" bind:tap="routerTo" data-url="/patient/pages/my/index">提交</view>
<view wx:if="{{zdUserInfo.IsRootUser==1}}" class="cancellation" bind:tap="handleLogout">注销账号</view> <block wx:else>
<view class="cancellation" bind:tap="routerTo" data-url="/pages/login/index?back=1">切换医生端</view>
<view wx:if="{{zdUserInfo.IsRootUser==1}}" class="cancellation" bind:tap="handleLogout">注销账号</view>
</block>
</view> </view>
<van-popup <van-popup

Loading…
Cancel
Save