修改ios審核時候的視頻播放
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user