|
|
|
|
@ -6,6 +6,7 @@ Page({
@@ -6,6 +6,7 @@ Page({
|
|
|
|
|
data: { |
|
|
|
|
id: '', |
|
|
|
|
shareShow: false, |
|
|
|
|
dateValue: 0, |
|
|
|
|
detail: {} as any, |
|
|
|
|
zdUserInfo: {} as any, |
|
|
|
|
posterUrl: '', |
|
|
|
|
@ -14,6 +15,10 @@ Page({
@@ -14,6 +15,10 @@ Page({
|
|
|
|
|
|
|
|
|
|
currentVideoSrc: '', |
|
|
|
|
|
|
|
|
|
lightList: [], |
|
|
|
|
|
|
|
|
|
timeData: {}, |
|
|
|
|
|
|
|
|
|
popupShow: false, |
|
|
|
|
popupType: 'popup6', // 登录失败弹窗
|
|
|
|
|
popupParams: { |
|
|
|
|
@ -43,6 +48,7 @@ Page({
@@ -43,6 +48,7 @@ Page({
|
|
|
|
|
app.mpBehavior({ PageName: 'PG_PatientLiveDetails' }) |
|
|
|
|
this.getDetail() |
|
|
|
|
this.setView() |
|
|
|
|
this.getLightList() |
|
|
|
|
app.getZdUserInfo(this, true, () => { |
|
|
|
|
this.getPosterParams() |
|
|
|
|
}) |
|
|
|
|
@ -51,6 +57,21 @@ Page({
@@ -51,6 +57,21 @@ Page({
|
|
|
|
|
onReady() { |
|
|
|
|
this.videoContext = wx.createVideoContext('video') |
|
|
|
|
}, |
|
|
|
|
getLightList() { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'GET', |
|
|
|
|
url: '?r=zd/activity/get-high-light-list', |
|
|
|
|
data: { activityId: this.data.id }, |
|
|
|
|
}).then((res) => { |
|
|
|
|
res.map((item: any) => { |
|
|
|
|
item.duration = dayjs(item.duration * 1000).format('mm:ss') |
|
|
|
|
return item |
|
|
|
|
}) |
|
|
|
|
this.setData({ |
|
|
|
|
lightList: res, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getPosterParams() { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
@ -115,6 +136,16 @@ Page({
@@ -115,6 +136,16 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleLightVideo(e) { |
|
|
|
|
const { url } = e.currentTarget.dataset |
|
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
currentVideoSrc: url, |
|
|
|
|
}) |
|
|
|
|
this.videoContext.requestFullScreen({}) |
|
|
|
|
this.videoContext.seek(0) |
|
|
|
|
this.videoContext.play() |
|
|
|
|
}, |
|
|
|
|
handleReplay() { |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PatientLiveReview' }) |
|
|
|
|
this.setData({ |
|
|
|
|
@ -127,6 +158,20 @@ Page({
@@ -127,6 +158,20 @@ Page({
|
|
|
|
|
handleFullscreenExit() { |
|
|
|
|
this.videoContext.pause() |
|
|
|
|
}, |
|
|
|
|
handleBanner() { |
|
|
|
|
const { detail, zdUserInfo, dateValue } = this.data |
|
|
|
|
if (detail.IsSignUp && zdUserInfo.AuditStatus) { |
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (zdUserInfo.AuditStatus == 1 || zdUserInfo.AuditStatus == 3 || zdUserInfo.AuditStatus == 4) { |
|
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
|
|
if (detail.SignUpStatus == 2) { |
|
|
|
|
if (detail.BeginTimeValue * 1 < dateValue * 1) { |
|
|
|
|
this.handleLive() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleLive() { |
|
|
|
|
const { Type } = this.data.detail |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PatientLiveEnter' }) |
|
|
|
|
@ -159,30 +204,36 @@ Page({
@@ -159,30 +204,36 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleSignUp() { |
|
|
|
|
const { SubscribeTemplateList } = this.data.detail |
|
|
|
|
app.mpBehavior({ PageName: 'BTN_PatientLiveSign' }) |
|
|
|
|
const { Type } = this.data.detail |
|
|
|
|
const { UserType } = this.data.zdUserInfo |
|
|
|
|
|
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: '?r=zd/activity/sign-up', |
|
|
|
|
data: { |
|
|
|
|
Id: this.data.id, |
|
|
|
|
PreUserIdentity: UserType, |
|
|
|
|
}, |
|
|
|
|
}).then((res) => { |
|
|
|
|
app |
|
|
|
|
.zdPermissionVerification( |
|
|
|
|
3, |
|
|
|
|
Type == 1 ? 1 : 10, |
|
|
|
|
`/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, |
|
|
|
|
this.data.id, |
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, |
|
|
|
|
}) |
|
|
|
|
wx.requestSubscribeMessage({ |
|
|
|
|
tmplIds: SubscribeTemplateList, |
|
|
|
|
complete: () => { |
|
|
|
|
wx.ajax({ |
|
|
|
|
method: 'POST', |
|
|
|
|
url: '?r=zd/activity/sign-up', |
|
|
|
|
data: { |
|
|
|
|
Id: this.data.id, |
|
|
|
|
PreUserIdentity: UserType, |
|
|
|
|
}, |
|
|
|
|
}).then((res) => { |
|
|
|
|
app |
|
|
|
|
.zdPermissionVerification( |
|
|
|
|
3, |
|
|
|
|
Type == 1 ? 1 : 10, |
|
|
|
|
`/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, |
|
|
|
|
this.data.id, |
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: `/patient/pages/liveResult/index?id=${this.data.id}&rewardScore=${res.rewardScore}`, |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleShare() { |
|
|
|
|
@ -329,19 +380,20 @@ Page({
@@ -329,19 +380,20 @@ Page({
|
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleAnswer() { |
|
|
|
|
const link = this.data.detail.QuestionnaireUrl |
|
|
|
|
wx.navigateTo({ |
|
|
|
|
url: `/pages/webview/index?url=${encodeURIComponent('https://shop.show.hbsaas.com/statics/#/?nId=bz56')}`, |
|
|
|
|
url: `/pages/webview/index?url=${encodeURIComponent(link)}`, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
hadnleMessage() { |
|
|
|
|
wx.requestSubscribeMessage({ |
|
|
|
|
tmplIds: ['IMF4HFzZaKG13H3yjFyna23g0ZuIHcVND6dUGqhr8IA'], |
|
|
|
|
success(res) { |
|
|
|
|
console.log(res) |
|
|
|
|
}, |
|
|
|
|
fail(err) { |
|
|
|
|
console.log(err) |
|
|
|
|
}, |
|
|
|
|
handleTimeChange(e) { |
|
|
|
|
this.setData({ |
|
|
|
|
timeData: e.detail, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleTimeFinish() { |
|
|
|
|
this.setData({ |
|
|
|
|
dateValue: dayjs().valueOf(), |
|
|
|
|
'detail.LeftTime': 0, |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
onShareAppMessage() { |
|
|
|
|
|