| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855 |
- <template>
- <view class="video-player-container">
- <!-- 直播状态显示 -->
- <view class="videolist" v-if="liveItem.status == 2">
- <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
- <!-- 直播 -->
- <live-player
- v-if="liveItem.livingUrl && liveItem.liveType == 1"
- :id="'myLivePlayer_' + liveId"
- :src="liveItem.livingUrl"
- autoplay
- mode="live"
- object-fit="contain"
- :muted="false"
- orientation="vertical"
- :enable-play-gesture="false"
- min-cache="1"
- max-cache="3"
- @statechange="onLiveStateChange"
- @error="onLiveError"
- class="item"></live-player>
-
- <!-- 录播 -->
- <video
- v-if="liveItem.videoUrl && liveItem.liveType == 2"
- :id="`myVideo_${liveId}`"
- :autoplay="true"
- class="item"
- :src="liveItem.videoUrl"
- :controls="false"
- object-fit="contain"
- :custom-cache="false"
- :enable-progress-gesture="false"
- vslide-gesture-in-fullscreen="false"
- :show-center-play-btn="false"
- :http-cache="false"
- loop
- @error="videoError"
- @timeupdate="onVideoTimeUpdate"
- @loadedmetadata="onVideoMetaLoaded"
- @pause="onVideoPause"
- @play="onVideoPlay"
- @waiting="onVideoWaiting"
- :enable-play-gesture="false"
- :play-strategy="1"
- @dblclick="preventDoubleClick"
- preload="auto"
- :enable-stash-buffer="false"
- :stash-initial-size="0"
- :stash-max-size="0"
- :stash-time="0"
- type="application/x-mpegURL"></video>
-
- <view v-if="liveItem.videoUrl && liveItem.liveType == 2" class="time">{{ diffTotalTime }}</view>
- </view>
- </view>
- <!-- 直播结束状态 -->
- <view class="videolist" v-if="liveItem.status == 3">
- <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
- <view class="end">直播已结束</view>
- </view>
- </view>
- <!-- 直播回放状态 -->
- <view class="videolist" v-if="liveItem.status == 4">
- <view class="video" :class="liveItem.showType == 1 ? 'video_row' : ''">
- <!-- 直播回放 -->
- <video
- v-if="liveItem.videoUrl && liveItem.liveType == 3"
- :id="`myVideo_${liveId}`"
- class="item"
- :src="liveItem.videoUrl"
- :autoplay="true"
- :controls="true"
- object-fit="contain"
- :custom-cache="false"
- :enable-progress-gesture="liveItem.isSpeedAllowed"
- vslide-gesture-in-fullscreen="true"
- :show-center-play-btn="true"
- :http-cache="false"
- loop
- @error="videoError"
- @timeupdate="onVideoTimeUpdate"
- @loadedmetadata="onVideoMetaLoaded"
- @pause="onVideoPause"
- @play="onVideoPlay"
- :enable-play-gesture="true"
- preload="auto"
- @waiting="onVideoWaiting"
- type="application/x-mpegURL"></video>
-
- <view v-if="liveItem.videoUrl && liveItem.liveType == 3" class="lable">直播回放</view>
- </view>
- </view>
- <!-- 直播预告状态 -->
- <view class="trailer-box" v-if="liveItem.status == 1">
- <video
- v-if="liveItem.previewUrl"
- :id="`myVideo_${liveId}`"
- class="item"
- :src="liveItem.previewUrl"
- :autoplay="true"
- :loop="false"
- :controls="false"
- object-fit="contain"
- :custom-cache="false"
- :enable-progress-gesture="false"
- vslide-gesture-in-fullscreen="false"
- :show-center-play-btn="false"
- :http-cache="false"
- @error="videoError"
- @loadedmetadata="onVideoMetaLoaded"
- @pause="onVideoPause"
- @play="onVideoPlay"
- :disable-progress="true"
- :enable-play-gesture="true"
- @waiting="onVideoWaiting"
- preload="auto"
- type="application/x-mpegURL"></video>
-
- <image
- v-if="liveItem.status == 1 && !liveItem.previewUrl"
- class="img"
- src="/static/images/no_live.png"></image>
-
- <view class="countdown-item mt30 mb30" v-if="liveItem.status == 1 && liveCountdown">
- 开播倒计时
- <view class="x-f">
- <view class="white">{{ liveCountdown.hours || '00' }}</view>
- <view class="white">{{ liveCountdown.minutes || '00' }}</view>
- <view class="white">{{ liveCountdown.seconds || '00' }}</view>
- </view>
- </view>
-
- <view class="name">{{ liveItem.liveName }}</view>
- <view class="title" v-if="liveCountdown">暂未开播</view>
-
- <view class="button" v-if="!isAgreement" @click="handleAgreement">预约直播</view>
- <view class="button ash" v-if="isAgreement">已预约</view>
- <view class="title" v-if="!liveCountdown">主播还在来的路上</view>
- </view>
- <!-- 无直播状态 -->
- <view class="trailer-box" v-if="!liveItem">
- <image class="img" src="/static/images/no_live.png"></image>
- <view class="title">暂无直播</view>
- </view>
- </view>
- </template>
- <script>
- import { generateRandomString } from '@/utils/common.js';
- import dayjs from 'dayjs';
- import { internetTraffic, liveInternetTraffic } from '@/api/living.js';
- import { getUserInfo } from '@/api/user';
- export default {
- name: 'LiveVideoPlayer',
- props: {
- liveItem: {
- type: Object,
- default: () => ({})
- },
- liveId: {
- type: [String, Number],
- default: ''
- },
- userData: {
- type: Object,
- default: () => ({})
- }
- },
- data() {
- return {
- // 流量计算相关
- uuId: '',
- totalTraffic: 0,
- bitrate: 800, // 录播默认码率 0.16Mbps
- bitrateLive: 1600, // 直播默认码率 0.16Mbps
-
- // 定时器
- trafficTimer: null,
- liveStartTimer: null,
- trafficInterval: null,
- lookTimer: null,
-
- // 状态数据
- liveCountdown: {},
- diffTotalTime: '',
- videoCurrentTime: 0,
- videoProgressKey: '',
- startTime: 0,
- stayTime: 0,
- isAgreement: false,
-
- // 性能优化
- videoRetryCounts: Object.create(null)
- };
- },
- computed: {
- // 计算当前时间与开始时间的差值
- currentTimeDiff() {
- if (!this.liveItem.startTime) return 0;
- const timeStr = this.liveItem.startTime;
- const time = new Date(timeStr.replace(/-/g, '/'));
- if (isNaN(time.getTime())) return 0;
-
- const now = new Date();
- return Math.max(0, now.getTime() - time.getTime());
- }
- },
- watch: {
- 'liveItem.status': {
- handler(newStatus, oldStatus) {
- if (newStatus === undefined || oldStatus === undefined) return;
- if (newStatus === oldStatus) return;
-
- console.log(`直播状态变化: ${oldStatus} -> ${newStatus}`);
- this.handleStatusChange(newStatus);
- },
- immediate: true
- }
- // ,
- // 'liveItem.status': {
- // handler(newVal) {
- // if (newVal && newVal.status === 2) {
- // this.startTimeTimer(newVal);
- // }
- // },
- // deep: true,
- // immediate: true
- // }
- },
- async mounted() {
- await this.initializeComponent();
- },
- beforeUnmount() {
- this.cleanup();
- },
- methods: {
- // 初始化组件
- async initializeComponent() {
- this.uuId = generateRandomString(16);
- this.isAgreement = uni.getStorageSync('isAgreement');
-
- if (this.liveItem.status === 2) {
- this.startTimeTimer(this.liveItem);
- }
-
- if (this.liveItem.status === 1 && this.liveItem.startTime) {
- this.startLiveCountdown();
- }
-
- this.startTimer();
- },
-
- // 处理状态变化
- handleStatusChange(newStatus) {
- // 清理旧定时器
- this.cleanupTimers();
-
- switch (newStatus) {
- case 1: // 预告
- this.startLiveCountdown();
- break;
- case 2: // 直播中
- this.startTimeTimer(this.liveItem);
- this.playVideo();
- break;
- case 3: // 已结束
- case 4: // 回放
- this.pauseVideo();
- break;
- }
- },
-
- // 启动直播倒计时
- startLiveCountdown() {
- if (this.liveStartTimer) {
- clearInterval(this.liveStartTimer);
- }
-
- this.liveStartTimer = setInterval(() => {
- this.liveCountdown = this.handleTime(this.liveItem.startTime, 0);
- if (!this.liveCountdown) {
- this.$emit('liveStart');
- clearInterval(this.liveStartTimer);
- }
- }, 1000);
- },
-
- // 启动时间计时器
- startTimeTimer(item) {
- if (!item) return;
-
- // 立即计算一次
- this.calculateTimeDiff(item);
-
- // 每秒更新
- if (item.timeTimer) {
- clearInterval(item.timeTimer);
- }
-
- item.timeTimer = setInterval(() => {
- this.calculateTimeDiff(item);
- }, 1000);
- },
-
- // 计算时间差
- calculateTimeDiff(item) {
- if (!item.startTime) return;
-
- const time = new Date(item.startTime.replace(/-/g, '/'));
- if (isNaN(time.getTime())) return;
-
- const now = new Date();
- let diffMs = Math.max(0, now.getTime() - time.getTime());
-
- const totalSeconds = Math.floor(diffMs / 1000);
- const hours = this.padZero(Math.floor(totalSeconds / 3600));
- const minutes = this.padZero(Math.floor((totalSeconds % 3600) / 60));
- const seconds = this.padZero(totalSeconds % 60);
-
- this.diffTotalTime = `${hours}:${minutes}:${seconds}`;
- },
-
- // 补零函数
- padZero(num) {
- return num < 10 ? `0${num}` : num;
- },
-
- // 时间处理
- handleTime(time, duration) {
- let timeStamp;
-
- if (typeof time === 'number' && time > 0 && time < 9999999999999) {
- timeStamp = time;
- } else if (typeof time === 'string' && time.trim() !== '') {
- const isoTime = time.replace(' ', 'T');
- const date = new Date(isoTime);
- if (!isNaN(date.getTime())) {
- timeStamp = date.getTime();
- } else {
- console.error('无效的日期格式:', time);
- return false;
- }
- } else {
- console.error('time参数必须是有效的时间戳或日期字符串');
- return false;
- }
-
- const targetTimestamp = timeStamp + duration * 60 * 1000;
- const currentTimestamp = Date.now();
- const timeDiffMs = targetTimestamp - currentTimestamp;
-
- if (timeDiffMs <= 0) {
- return false;
- }
-
- const hours = Math.floor(timeDiffMs / (1000 * 60 * 60));
- const minutes = Math.floor((timeDiffMs % (1000 * 60 * 60)) / (1000 * 60));
- const seconds = Math.floor((timeDiffMs % (1000 * 60)) / 1000);
-
- const formatNum = (num) => num.toString().padStart(2, '0');
- return {
- hours: formatNum(hours),
- minutes: formatNum(minutes),
- seconds: formatNum(seconds)
- };
- },
-
- // 播放视频
- playVideo() {
- if (!this.liveItem) {
- console.log('liveItem 为空,无法播放视频');
- return;
- }
-
- try {
- // 直播流
- if (this.liveItem.liveType === 1 && this.liveItem.livingUrl && this.liveItem.status == 2) {
- const livePlayerId = `myLivePlayer_${this.liveId}`;
- const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
- if (livePlayerContext) {
- livePlayerContext.play();
- }
- }
- // 预告视频
- else if (this.liveItem.status == 1 && this.liveItem.previewUrl) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.play();
- }
- }
- // 录播
- else if (this.liveItem.liveType === 2 && this.liveItem.videoUrl && this.liveItem.status == 2) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.play();
- }
- }
- // 回放
- else if (this.liveItem.liveType === 3 && this.liveItem.videoUrl && this.liveItem.status == 4) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.play();
- }
- }
- } catch (error) {
- console.error('播放视频失败:', error);
- this.$emit('playError', error);
- }
- },
-
- // 暂停视频
- pauseVideo() {
- if (!this.liveItem) return;
-
- try {
- if (this.liveItem.status == 1) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.pause();
- }
- } else if (this.liveItem.status == 2) {
- if (this.liveItem.liveType === 1) {
- const livePlayerId = `myLivePlayer_${this.liveId}`;
- const livePlayerContext = uni.createLivePlayerContext(livePlayerId, this);
- if (livePlayerContext) {
- livePlayerContext.pause();
- }
- } else if (this.liveItem.liveType === 2) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.pause();
- }
- }
- }
- } catch (error) {
- console.error('暂停视频失败:', error);
- this.$emit('pauseError', error);
- }
- },
-
- // 视频错误处理
- videoError(e) {
- if (!this.liveItem || !this.liveId) return;
-
- // 初始化重试计数
- if (this.videoRetryCounts[this.liveId] === undefined) {
- this.videoRetryCounts[this.liveId] = 0;
- }
-
- // 限制重试次数
- if (this.videoRetryCounts[this.liveId] >= 3) {
- console.error(`直播间 ${this.liveId} 视频加载失败,停止重试`);
- this.$emit('videoError', {
- type: 'loadFailed',
- liveId: this.liveId,
- message: '视频加载失败,请检查网络'
- });
- return;
- }
-
- this.videoRetryCounts[this.liveId]++;
-
- // 延迟重试
- setTimeout(() => {
- console.log(`第${this.videoRetryCounts[this.liveId]}次重试播放视频`);
- this.playVideo();
- }, 2000);
-
- this.$emit('videoError', {
- type: 'retry',
- liveId: this.liveId,
- retryCount: this.videoRetryCounts[this.liveId]
- });
- },
-
- // 直播状态变化
- onLiveStateChange(e) {
- const stateCode = e.detail.code;
-
- if (e.detail.code == -2301 || e.detail.code == -2302) {
- this.playVideo();
- } else if (e.detail.code == 2004) {
- this.calculateTimeDiff(this.liveItem);
- this.startTrafficCalculation(this.bitrateLive);
- }
-
- this.$emit('liveStateChange', e.detail);
- },
-
- // 直播错误
- onLiveError(e) {
- this.videoError(e);
- this.$emit('liveError', e.detail);
- },
-
- // 视频元数据加载
- onVideoMetaLoaded(e) {
- this.videoProgressKey = `videoProgress_${this.liveId}`;
- this.setVideoProgress();
- this.$emit('videoMetaLoaded', e.detail);
- },
-
- // 设置视频进度
- setVideoProgress() {
- if (this.liveItem.liveType !== 2 && this.liveItem.liveType !== 3) {
- return;
- }
-
- let currentTime = 0;
- if (this.liveItem.liveType === 2) {
- const diff = this.getTimeDifferenceInSeconds(this.liveItem.startTime);
- if (diff > this.liveItem.duration) {
- const storedProgress = uni.getStorageSync(this.videoProgressKey) || 0;
- currentTime = storedProgress >= this.liveItem.duration ? 0 : storedProgress || 0;
- } else {
- currentTime = diff % this.liveItem.duration;
- }
- } else if (this.liveItem.liveType === 3) {
- const storedProgress = uni.getStorageSync(this.videoProgressKey);
- currentTime = storedProgress || 0;
- }
-
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- if (videoContext) {
- videoContext.seek(currentTime);
- }
- },
-
- // 获取时间差(秒)
- getTimeDifferenceInSeconds(createTimeStr) {
- const createTime = new Date(createTimeStr.replace(/-/g, '/'));
- const now = new Date();
- const timeDiffMs = now - createTime;
- return Math.max(0, Math.floor(timeDiffMs / 1000));
- },
-
- // 视频时间更新
- onVideoTimeUpdate(e) {
- this.videoCurrentTime = e.detail.currentTime;
-
- if (Math.floor(this.videoCurrentTime) % 10 === 0) {
- this.saveVideoProgress();
- }
-
- this.$emit('videoTimeUpdate', e.detail);
- },
-
- // 视频暂停
- onVideoPause(e) {
- if (this.liveItem.liveType === 2) {
- const videoId = `myVideo_${this.liveId}`;
- const videoContext = uni.createVideoContext(videoId, this);
- setTimeout(() => {
- videoContext.play();
- }, 100);
- }
-
- this.saveVideoProgress();
- this.$emit('videoPause', e.detail);
- },
-
- // 视频播放
- onVideoPlay(e) {
- this.$emit('videoPlay', e.detail);
- },
-
- // 视频等待
- onVideoWaiting(e) {
- if (this.liveItem.liveType == 2) {
- this.startTrafficCalculation(this.bitrate);
- } else {
- if (this.trafficInterval) {
- clearInterval(this.trafficInterval);
- this.trafficInterval = null;
- }
-
- this.trafficInterval = setInterval(() => {
- this.getInternetTraffic();
- }, 10000);
- }
-
- this.$emit('videoWaiting', e.detail);
- },
-
- // 阻止双击事件
- preventDoubleClick(e) {
- e.preventDefault();
- e.stopPropagation();
- return false;
- },
-
- // 保存视频进度
- saveVideoProgress() {
- if (this.videoProgressKey) {
- uni.setStorage({
- key: this.videoProgressKey,
- data: this.videoCurrentTime,
- success: () => {},
- fail: (err) => {
- console.error('保存视频进度失败:', err);
- }
- });
- }
- },
-
- // 开始流量计算
- startTrafficCalculation(bitrate) {
- if (this.trafficTimer) {
- clearInterval(this.trafficTimer);
- this.trafficTimer = null;
- }
-
- this.startTime = Date.now();
- this.trafficTimer = setInterval(() => {
- this.calculateTraffic(bitrate);
- }, 10000);
- },
-
- // 计算流量
- calculateTraffic(bitrate) {
- const currentTime = Date.now();
- const duration = (currentTime - this.startTime) / 1000;
- const trafficBits = bitrate * duration;
- this.totalTraffic = trafficBits / 8;
- this.getLiveInternetTraffic();
- },
-
- // 直播流量统计
- getLiveInternetTraffic() {
- if (!this.liveId || !this.userData.userId) return;
-
- const param = {
- userId: this.userData.userId,
- liveId: this.liveId,
- uuId: dayjs().format('YYYYMMDD') + this.uuId,
- internetTraffic: this.totalTraffic
- };
-
- liveInternetTraffic(param).catch(err => {
- console.error('直播流量统计失败:', err);
- });
- },
-
- // 回放、预告流量统计
- getInternetTraffic() {
- if (!this.liveId || !this.userData.userId || !this.uuId) return;
-
- const currentTime = (this.stayTime / this.liveItem.duration) * 100;
- const param = {
- videoType: this.liveItem.videoType,
- videoId: this.liveItem.videoId,
- userId: this.userData.userId,
- liveId: this.liveId,
- uuId: dayjs().format('YYYYMMDD') + this.uuId,
- duration: this.liveItem.duration,
- bufferRate: currentTime
- };
-
- if (this.liveItem.status == 1) {
- param.videoType = this.liveItem.previewVideoType || '';
- param.videoId = this.liveItem.previewVideoId || '';
- }
-
- if (this.liveItem.liveType == 1) {
- param.bufferRate = this.totalTraffic;
- }
-
- internetTraffic(param).catch(err => {
- console.error('流量统计失败:', err);
- });
- },
-
- // 开始计时器
- startTimer() {
- this.startTime = Date.now();
- this.lookTimer = setInterval(() => {
- this.stayTime = Math.floor((Date.now() - this.startTime) / 1000);
- }, 1000);
- },
-
- // 预约直播
- handleAgreement() {
- this.$emit('agreementClick');
- },
-
- // 清理定时器
- cleanupTimers() {
- if (this.liveStartTimer) {
- clearInterval(this.liveStartTimer);
- this.liveStartTimer = null;
- }
-
- if (this.trafficTimer) {
- clearInterval(this.trafficTimer);
- this.trafficTimer = null;
- }
-
- if (this.trafficInterval) {
- clearInterval(this.trafficInterval);
- this.trafficInterval = null;
- }
-
- if (this.lookTimer) {
- clearInterval(this.lookTimer);
- this.lookTimer = null;
- }
-
- if (this.liveItem && this.liveItem.timeTimer) {
- clearInterval(this.liveItem.timeTimer);
- this.liveItem.timeTimer = null;
- }
- },
-
- // 组件清理
- cleanup() {
- this.cleanupTimers();
- this.pauseVideo();
- this.saveVideoProgress();
- }
- }
- };
- </script>
- <style scoped lang="scss">
- .video-player-container {
- width: 100%;
- height: 100%;
- position: relative;
- }
- .videolist {
- position: relative;
- height: 100vh;
- width: 100%;
- .video {
- height: 100vh;
- width: 100%;
-
- .item {
- width: 100%;
- height: 100%;
- }
-
- .time {
- color: #ffffff;
- font-size: 20rpx;
- margin-left: 10rpx;
- }
-
- .end {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- font-size: 36rpx;
- color: #fff;
- }
-
- .lable {
- position: absolute;
- top: 50rpx;
- right: 16rpx;
- background-color: rgba(57, 57, 57, 0.6);
- padding: 4rpx 10rpx;
- color: #fff;
- border-radius: 15rpx;
- }
- }
-
- .video_row {
- position: absolute;
- top: 20%;
- max-height: 450rpx;
- z-index: 99;
- }
- }
- .trailer-box {
- position: relative;
- top: 15%;
- display: flex;
- flex-direction: column;
- align-items: center;
- color: #ffffff;
- padding: 20rpx;
- .button {
- margin-top: 20rpx;
- background: #6d7bd4;
- color: #fff;
- border-radius: 20rpx;
- padding: 20rpx 30rpx;
- position: relative;
- z-index: 99999;
- }
- .ash {
- background: #636363;
- }
- .countdown-item {
- display: flex;
- flex-direction: column;
- align-items: center;
- .white {
- width: 60rpx;
- height: 60rpx;
- text-align: center;
- overflow: hidden;
- background: #ffffff;
- border-radius: 8rpx;
- margin: 30rpx 10rpx 0;
- font-weight: 600;
- font-size: 24rpx;
- color: #000000;
- line-height: 60rpx;
- }
- }
- .item {
- width: 100%;
- height: 400rpx;
- }
- .name {
- font-size: 34rpx;
- }
- .img {
- margin-bottom: 40rpx;
- width: 240rpx;
- height: 240rpx;
- }
- .title {
- margin-top: 30rpx;
- font-size: 42rpx;
- font-weight: 500;
- }
- }
- </style>
|