修改ios審核時候的視頻播放

This commit is contained in:
duan
2025-01-18 09:51:56 +08:00
parent 503f1d4594
commit 940cf8c2e7
10 changed files with 189 additions and 110 deletions

View File

@@ -1,17 +1,24 @@
<template>
<view class="min-page">
<my-video-list ref="refVideoList" v-if="state.list.length" @swiperChange="swiperChange" :list="state.list"
:options="options"
@update="update" :info="state"></my-video-list>
:options="options" @update="update" :info="state"></my-video-list>
</view>
</template>
<script setup>
import {
onLoad,onHide,
onLoad,
onHide,
onShow
} from '@dcloudio/uni-app'
import {
login
} from '@/api/login/login.js';
import * as Api from '@/api/video/index.js'
import {
useCommonStore
} from '@/store/common.js';
const $common = useCommonStore();
import {
reactive,
ref
@@ -23,7 +30,7 @@
const sysInfo = uni.getSystemInfoSync()
let isFirstLoad = true
let options = {
courseDetailsId:''
courseDetailsId: ''
}
const state = reactive({
collect: 0,
@@ -34,11 +41,40 @@
})
const refVideoList = ref(null)
async function init() {
try {
/**
* 如果是安卓則不做操作如果是ios判斷是否審核不審核不套裝
*/
// 是否审核,是否ios
if ($common.isIosExamine) {
const res = await Api.getVideoDetail(options)
isFirstLoad = false
Object.assign(state, res)
state.list = res.list
} else {
// ios是否登錄
console.log(uni.getStorageSync('tokenTwo'),'提送hi')
if (uni.getStorageSync('tokenTwo')) {
const res = await Api.getVideoDetail({...options,token:uni.getStorageSync('tokenTwo')})
isFirstLoad = false
Object.assign(state, res)
state.list = res.list
} else {
let res = await login({
password: '123456',
phone: '18681817128'
})
uni.setStorageSync('tokenTwo', res.token)
init()
}
}
// 是否审核,是否ios 保存本地
// 18681817128 123456 测试环境和正式环境都是这个账号 等会给添加上会员就可以了
// return res.token
try {
} catch (error) {
// if(getCurrentPages().length>=2){
// uni.navigateBack()
@@ -81,7 +117,7 @@
const nobuyCourseId = uni.getStorageSync('nobuyCourseId')
const item = state.list.find(v => v.courseId == nobuyCourseId)
uni.removeStorageSync('nobuyCourseId')
if(item){
if (item) {
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
.videoUrl) {
uni.navigateTo({
@@ -89,7 +125,7 @@
})
}
}
}
})
</script>