|
|
|
|
@ -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}`, |
|
|
|
|
}) |
|
|
|
|
|