|
@@ -2,7 +2,7 @@ import ColSticky from '@/components/col-sticky'
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
import { browser, removeAuth } from '@/helpers/utils'
|
|
import { browser, removeAuth } from '@/helpers/utils'
|
|
import { postMessage } from '@/helpers/native-message'
|
|
import { postMessage } from '@/helpers/native-message'
|
|
-import { Button, Cell, CellGroup, Image, Notify, Popup } from 'vant'
|
|
|
|
|
|
+import { Button, Cell, CellGroup, Dialog, Image, Notify, Popup } from 'vant'
|
|
import { defineComponent } from 'vue'
|
|
import { defineComponent } from 'vue'
|
|
import styles from './index.module.less'
|
|
import styles from './index.module.less'
|
|
import logo from '@/common/images/logo.png'
|
|
import logo from '@/common/images/logo.png'
|
|
@@ -50,11 +50,17 @@ export default defineComponent({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async mounted() {
|
|
async mounted() {
|
|
- this.getMusicInfo()
|
|
|
|
|
|
+ await this.getMusicInfo()
|
|
|
|
+
|
|
|
|
+ // 判断是否在内容打开页面
|
|
if (!browser().isApp) {
|
|
if (!browser().isApp) {
|
|
this.popupStatus = true
|
|
this.popupStatus = true
|
|
removeAuth()
|
|
removeAuth()
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 判断活动状态的活动时间
|
|
|
|
+ this.checkActivityTime()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async getMusicInfo() {
|
|
async getMusicInfo() {
|
|
@@ -67,11 +73,52 @@ export default defineComponent({
|
|
//
|
|
//
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ checkActivityTime() {
|
|
|
|
+ // 判断活动状态的活动时间
|
|
|
|
+ try {
|
|
|
|
+ const activeInfo = this.activeInfo
|
|
|
|
+ if (activeInfo.activityState === 0) {
|
|
|
|
+ Dialog.alert({
|
|
|
|
+ message: '活动已结束,感谢你的关注!',
|
|
|
|
+ theme: 'round-button',
|
|
|
|
+ confirmButtonColor: '#2dc7aa'
|
|
|
|
+ })
|
|
|
|
+ this.onBackDialog('活动已结束,感谢你的关注!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const nowTime = dayjs()
|
|
|
|
+ const startTime = dayjs(activeInfo.activityStart)
|
|
|
|
+ const endTime = dayjs(activeInfo.activityEnd)
|
|
|
|
+ if (dayjs(nowTime).isBefore(dayjs(startTime))) {
|
|
|
|
+ this.onBackDialog('活动尚未开始,请您耐心等待!')
|
|
|
|
+ return false
|
|
|
|
+ } else if (!dayjs(nowTime).isBefore(dayjs(endTime))) {
|
|
|
|
+ this.onBackDialog('活动已结束,感谢你的关注!')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ return true
|
|
|
|
+ } catch {
|
|
|
|
+ //
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onBackDialog(str: string) {
|
|
|
|
+ Dialog.alert({
|
|
|
|
+ message: str,
|
|
|
|
+ theme: 'round-button',
|
|
|
|
+ confirmButtonColor: '#2dc7aa'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ postMessage({ api: 'back' })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
async onJoinActve() {
|
|
async onJoinActve() {
|
|
const activeInfo = this.activeInfo
|
|
const activeInfo = this.activeInfo
|
|
try {
|
|
try {
|
|
- // 判断是否是收费活动
|
|
|
|
|
|
+ if (!this.checkActivityTime()) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (activeInfo.registrationMethod === 'CHARGE') {
|
|
if (activeInfo.registrationMethod === 'CHARGE') {
|
|
|
|
+ // 判断是否是收费活动
|
|
orderStatus.orderObject.orderType = 'ACTI_REGIST'
|
|
orderStatus.orderObject.orderType = 'ACTI_REGIST'
|
|
orderStatus.orderObject.orderName = activeInfo.activityName
|
|
orderStatus.orderObject.orderName = activeInfo.activityName
|
|
orderStatus.orderObject.orderDesc = activeInfo.activityName
|
|
orderStatus.orderObject.orderDesc = activeInfo.activityName
|
|
@@ -323,6 +370,9 @@ export default defineComponent({
|
|
(this.userSelectMusic && item.join !== 1)
|
|
(this.userSelectMusic && item.join !== 1)
|
|
}
|
|
}
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
|
+ if (!this.checkActivityTime()) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.selectMusic = item
|
|
this.selectMusic = item
|
|
this.popupStatus = true
|
|
this.popupStatus = true
|
|
}}
|
|
}}
|