|
|
|
@ -16,7 +16,14 @@
|
|
|
|
|
/>
|
|
|
|
|
</view>
|
|
|
|
|
<view v-else-if="item.lx=='activity'">
|
|
|
|
|
|
|
|
|
|
<view :style="{backgroundColor:item.color,width:'90vw',height:'70px'}">
|
|
|
|
|
<view :style="{fontSize:'30px'}">
|
|
|
|
|
<text :style="{color:'white'}">{{item.showname}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view :style="{fontSize:'15px'}">
|
|
|
|
|
<text :style="{color:'white'}">{{item.title}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
@ -30,13 +37,15 @@
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { onMounted, onUnmounted } from 'vue'
|
|
|
|
|
|
|
|
|
|
import io from '@hyoga/uni-socket.io'
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
import {onLoad} from "@dcloudio/uni-app";
|
|
|
|
|
|
|
|
|
|
// 课堂活动and PPT
|
|
|
|
|
const kctivityAndPPT = ref([
|
|
|
|
|
{lx:'ppt',id:1,name:'PPT展示1',src:'https://img11.360buyimg.com/n1/s720x720_jfs/t1/303510/33/1806/82651/6815a7a6F2e5d77b6/08d231a86927b0ce.jpg'},
|
|
|
|
|
{lx :'activity',id:2,name:'课堂活动1',src:'https://img11.360buyimg.com/n1/s720x720_jfs/t1/303510/33/1806/82651/6815a7a6F2e5d77b6/08d231a86927b0ce.jpg'}
|
|
|
|
|
{lx :'activity',id:2,name:'课堂活动1',lxA:'讨论',color:'green',showname:'课程讨论',title:'历史为什么选择了中国共产党'}
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -45,19 +54,33 @@ const kctivityAndPPT = ref([
|
|
|
|
|
let socket
|
|
|
|
|
|
|
|
|
|
// 初始化连接
|
|
|
|
|
onMounted((options) => {
|
|
|
|
|
console.log(options)
|
|
|
|
|
socket = io('ws://localhost:3400', {
|
|
|
|
|
transports: ['websocket'],
|
|
|
|
|
auth: {
|
|
|
|
|
xuehao: "202413501062",
|
|
|
|
|
sf: "stu",
|
|
|
|
|
kch: options.kch,
|
|
|
|
|
kctime: options.kctime,
|
|
|
|
|
k_id: options.uuid,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onLoad((options) => {
|
|
|
|
|
console.log('load',options)
|
|
|
|
|
console.log(kctivityAndPPT.value)
|
|
|
|
|
socket = null;
|
|
|
|
|
if(options) {
|
|
|
|
|
socket= io('ws://localhost:3400', {
|
|
|
|
|
transports: ['websocket'],
|
|
|
|
|
auth: {
|
|
|
|
|
xuehao: "202413501062",
|
|
|
|
|
sf: "stu",
|
|
|
|
|
kch: options.kch,
|
|
|
|
|
kctime: options.kctime,
|
|
|
|
|
k_id: options.uuid,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
socket= io('ws://localhost:3400', {
|
|
|
|
|
transports: ['websocket'],
|
|
|
|
|
auth: {
|
|
|
|
|
xuehao: "202413501062",
|
|
|
|
|
sf: "stu",
|
|
|
|
|
kch: "nokch",
|
|
|
|
|
kctime: "nokctime",
|
|
|
|
|
k_id: "nouuid",
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 监听事件
|
|
|
|
|
socket.on('connect', () => console.log('Socket 已连接'))
|
|
|
|
|
socket.on('server', (data) => {
|
|
|
|
@ -92,4 +115,8 @@ const sendData = () => {
|
|
|
|
|
.container {
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
.classactivetitle{
|
|
|
|
|
font-size: 32rpx
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|