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 @@ @@ -71,5 +71,5 @@
}
]
},
"appid": "wxf9ce8010f1ad24aa"
"appid": "wx71ac9c27c3c3e3f4"
}

2
project.private.config.json

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

19
src/app.ts

@ -16,15 +16,15 @@ App<IAppOption>({ @@ -16,15 +16,15 @@ App<IAppOption>({
// 测试号 wx2b0bb13edf717c1d
// dev
// appid:wxf9ce8010f1ad24aa
url: 'https://m.xd.hbraas.com',
upFileUrl: 'https://m.xd.hbraas.com/',
imageUrl: 'https://m.xd.hbraas.com/xd/',
// url: 'https://m.xd.hbraas.com',
// upFileUrl: 'https://m.xd.hbraas.com/',
// imageUrl: 'https://m.xd.hbraas.com/xd/',
// pro
// appid:wx71ac9c27c3c3e3f4
// url: 'https://m.xd.hbsaas.com',
// upFileUrl: 'https://m.xd.hbsaas.com/',
// imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
url: 'https://m.xd.hbsaas.com',
upFileUrl: 'https://m.xd.hbsaas.com/',
imageUrl: 'https://m.xd.hbsaas.com/api/xd/',
loginState: '',
isLogin: 0,
@ -97,6 +97,11 @@ App<IAppOption>({ @@ -97,6 +97,11 @@ App<IAppOption>({
99: '取消',
100: '已删除',
},
liveSubscribe: {
sub: false,
tmplIds: [],
},
},
onLaunch() {
Page = page as WechatMiniprogram.Page.Constructor
@ -475,7 +480,7 @@ App<IAppOption>({ @@ -475,7 +480,7 @@ App<IAppOption>({
}
if (isReject) {
that.globalData.backPage = backPage
reject(null)
reject(new Error('非登录用户拦截'))
return
}
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({ @@ -472,7 +472,7 @@ Page({
data: { type: 1 },
}).then(() => {
wx.navigateTo({
url: '/patient/pages/personalInformation/index?bottom=1',
url: '/patient/pages/personalInformation/index?bottom=1&submit=1',
})
})
this.handleToastCancel(null, false)

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

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

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

@ -7,9 +7,26 @@ @@ -7,9 +7,26 @@
position: relative;
width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
.video {
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 {
position: absolute;

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

@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
import dayjs from 'dayjs'
const licia = require('miniprogram-licia')
const app = getApp<IAppOption>()
// 组件说明文档 https://github.com/wechat-miniprogram/miniprogram-component-plus/blob/master/docs/video-swiper.md
@ -20,6 +22,8 @@ Page({ @@ -20,6 +22,8 @@ Page({
starShow: false,
index: 0,
offsetTop: 310,
},
onLoad(options) {
this.setData({
@ -78,11 +82,37 @@ Page({ @@ -78,11 +82,37 @@ Page({
item.drag = false
if (index === current) {
item.ctx.play()
} else {
}
else {
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) {
const { index } = e.currentTarget.dataset
const key = `videoList[${index}].play`
@ -100,7 +130,8 @@ Page({ @@ -100,7 +130,8 @@ Page({
handleTimeUpdate(e: any) {
const { index } = e.currentTarget.dataset
const { videoList } = this.data
if (videoList[index].drag) return
if (videoList[index].drag)
return
const { currentTime, duration } = e.detail
const progress = (currentTime / duration) * 100
const progressKey = `videoList[${index}].progress`
@ -115,7 +146,8 @@ Page({ @@ -115,7 +146,8 @@ Page({
const { videoList } = this.data
if (videoList[index].play) {
videoList[index].ctx.pause()
} else {
}
else {
videoList[index].ctx.play()
}
},
@ -138,60 +170,22 @@ Page({ @@ -138,60 +170,22 @@ Page({
[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[${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)
onShareAppMessage() {
const { id, current, videoList } = this.data
return {
title: videoList[current].Title,
path: `/patient/pages/liveDetailVideo/index?id=${id}&index=${current}`,
imageUrl: videoList[current].imgUrl,
}
this._timer = setTimeout(() => {
this.setData({
starShow: false,
})
}, 2000)
this.likePost()
},
likePost: licia.debounce(function (this: any) {
const { activeId, LikeTimes } = this.data
this.setData({
LikeTimes: 0,
})
wx.ajax({
method: 'POST',
url: '?r=wtx/knowledge/like',
data: {
Id: activeId,
LikeTimes,
handleBack() {
wx.navigateBack({
fail: () => {
wx.reLaunch({
url: `/patient/pages/liveDetail/index?id=${this.data.id}`,
})
},
})
}, 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 @@ @@ -11,19 +11,31 @@
src="{{item.videoUrl}}"
poster="{{item.imgUrl}}"
loop
title="{{item.title}}"
object-fit="contain"
enable-play-gesture
enable-progress-gesture
show-center-play-btn="{{false}}"
play-btn-position="center"
controls="{{false}}"
controls="{{item.fullScreen}}"
bindloadedmetadata="handleLoadedMetaData"
bindprogress="handleProgress"
bindplay="handlePlay"
bindpause="handlePause"
bindfullscreenchange="handleFullScreenChange"
bindtimeupdate="handleTimeUpdate"
data-index="{{index}}"
bind:tap="handleTogglePlay"
data-full="{{item.fullScreen}}"
></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
wx:if="{{!item.play}}"
class="play"
@ -33,7 +45,7 @@ @@ -33,7 +45,7 @@
data-index="{{index}}"
></image>
<view class="swiper-item-footer">
<view class="title">{{item.Title}}</view>
<view class="title">{{item.title}}</view>
<view class="progress">
<van-slider
value="{{item.progress}}"
@ -51,7 +63,7 @@ @@ -51,7 +63,7 @@
<view class="container">
<view class="user">
<image class="avatar" src="{{imageUrl}}logo1.png?t={{Timestamp}}"></image>
<view class="name">基因知识库</view>
<view class="name">TED关爱小助手</view>
</view>
<view class="options">
<button class="o-item" open-type="share">
@ -59,11 +71,11 @@ @@ -59,11 +71,11 @@
<image wx:else class="icon" src="{{imageUrl}}icon85.png?t={{Timestamp}}"></image>
<view class="num {{item.IsShare && 'active'}}">{{item.ShareTimes}}</view>
</button>
<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:else class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image>
<view class="num {{item.IsLike && 'active'}}">{{item.LikeTimes}}</view>
</view>
<!-- <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:else class="icon" src="{{imageUrl}}icon86.png?t={{Timestamp}}"></image> -->
<!-- <view class="num {{item.IsLike && 'active'}}">{{item.LikeTimes}}</view> -->
<!-- </view> -->
</view>
</view>
</view>

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

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

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

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

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

@ -179,7 +179,12 @@ @@ -179,7 +179,12 @@
<view class="del" catchtap="handleDelData" wx:if="{{zdUserInfo.DrugsAuditStatus==2}}">
<image class="d-icon" src="{{imageUrl}}icon77.png?t={{Timestamp}}"></image>
</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}}">
<image class="check-icon" src="{{imageUrl}}icon81.png?t={{Timestamp}}"></image>
审核中...
@ -197,8 +202,11 @@ @@ -197,8 +202,11 @@
</block>
</view>
</view>
<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>
<view wx:if="{{submit}}" class="cancellation" bind:tap="routerTo" data-url="/patient/pages/my/index">提交</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>
<van-popup

Loading…
Cancel
Save