new_app/pages/video/index.nvue

169 lines
3.0 KiB
Plaintext

<template>
<view class="min-page">
<!-- <up-button @click="toDetail">toDetail</up-button> -->
<my-video-list
isCommand
isTabbar
v-if="state.list.length"
@swiperChange="swiperChange"
:list="state.list"
@update="update"
:info="state"
@errorHandle="errorHandle"
></my-video-list>
</view>
<view class="mask" v-if="maskShow">
<view class="content">
<view class="title">
<text class="t">风险提示</text>
</view>
<view class="text">
<text>您的账号暂不可用,详情请联系客服</text>
</view>
<div class="btn-wrap">
<text class="btn" @click="toContact">去联系客服</text>
</div>
</view>
</view>
</template>
<script setup>
import { onLoad, onShow } from '@dcloudio/uni-app';
import * as Api from '@/api/video/index.js';
import { computed, reactive, ref } from 'vue';
import { slice } from 'lodash';
const maskShow = ref(false);
function toContact() {
uni.navigateTo({
url: '/pages/me/contact'
});
}
function toDetail() {
uni.navigateTo({
url: '/pages/video/detail?courseId=1208'
});
}
let options = {};
const state = reactive({
collect: 0,
current: {},
list: [],
price: 0,
title: ''
});
// 接收错误信息
const errorHandle = (error) => {
console.log('errorHandle.60===', error);
if (error.code == 702) {
maskShow.value = true;
} else {
maskShow.value = false;
}
};
async function init() {
try {
const res = await Api.tuijianVideo(options);
state.current = res.list[0];
Object.assign(state, res);
state.list = res.list;
} catch (error) {
console.log(error);
if (error.code == 702) {
maskShow.value = true;
} else {
maskShow.value = false;
}
}
}
function update({ index, item }) {
state.list[index] = item;
}
onLoad((opt) => {
Object.assign(options, opt);
init();
});
function swiperChange({ current, direction, data }) {}
onShow(() => {});
</script>
<style>
page {
height: calc(100vh - 50px);
overflow: hidden;
}
</style>
<style lang="scss" scoped>
.min-page {
/* #ifdef H5 */
height: calc(100vh - 50px);
/* #endif */
/* #ifdef APP */
height: 100vh;
/* #endif */
background-color: #000;
overflow: hidden;
flex: 1;
}
.u-popup {
position: fixed;
}
.mask {
width: 750upx;
height: 1700upx;
background-color: rgba(0, 0, 0, 0.6);
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
.content {
width: 680upx;
height: 420upx;
background-color: #fff;
border-radius: 20upx;
.title {
display: flex;
align-items: center;
justify-content: center;
height: 100upx;
.t {
font-size: 32upx;
font-weight: bold;
}
}
.text {
padding: 50upx 28upx;
display: flex;
align-items: center;
}
.btn-wrap {
display: flex;
padding: 50upx 28upx 28upx;
.btn {
flex: 1;
height: 80upx;
display: flex;
align-items: center;
justify-content: center;
background-color: #dd8591;
color: #fff;
border-radius: 12upx;
text-align: center;
line-height: 80upx;
}
}
}
}
</style>