fix: 未登录状态页面显示异常
This commit is contained in:
@ -166,7 +166,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
|||||||
bottom: 0,
|
bottom: 0,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: user.get(UserBoxKey.userLogin)
|
child: user.get(UserBoxKey.userLogin) ?? false
|
||||||
? GestureDetector(
|
? GestureDetector(
|
||||||
onTap: () => showModalBottomSheet(
|
onTap: () => showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -18,7 +18,7 @@ class MemberController extends GetxController {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
mid = int.parse(Get.parameters['mid']!);
|
mid = int.parse(Get.parameters['mid']!);
|
||||||
ownerMid = user.get(UserBoxKey.userMid);
|
ownerMid = user.get(UserBoxKey.userMid) ?? -1;
|
||||||
face = Get.arguments['face'] ?? '';
|
face = Get.arguments['face'] ?? '';
|
||||||
heroTag = Get.arguments['heroTag'] ?? '';
|
heroTag = Get.arguments['heroTag'] ?? '';
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,13 @@ import 'dart:developer';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_meedu_media_kit/meedu_player.dart';
|
import 'package:flutter_meedu_media_kit/meedu_player.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/http/constants.dart';
|
import 'package:pilipala/http/constants.dart';
|
||||||
import 'package:pilipala/http/video.dart';
|
import 'package:pilipala/http/video.dart';
|
||||||
import 'package:pilipala/models/video/play/url.dart';
|
import 'package:pilipala/models/video/play/url.dart';
|
||||||
import 'package:pilipala/models/video/reply/item.dart';
|
import 'package:pilipala/models/video/reply/item.dart';
|
||||||
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
import 'package:pilipala/pages/video/detail/replyReply/index.dart';
|
||||||
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class VideoDetailController extends GetxController
|
class VideoDetailController extends GetxController
|
||||||
with GetSingleTickerProviderStateMixin {
|
with GetSingleTickerProviderStateMixin {
|
||||||
@ -50,6 +52,7 @@ class VideoDetailController extends GetxController
|
|||||||
Timer? timer;
|
Timer? timer;
|
||||||
|
|
||||||
RxString bgCover = ''.obs;
|
RxString bgCover = ''.obs;
|
||||||
|
Box user = GStrorage.user;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -140,6 +143,9 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void markHeartBeat() async {
|
void markHeartBeat() async {
|
||||||
|
if (user.get(UserBoxKey.userMid) == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Duration progress = meeduPlayerController.position.value;
|
Duration progress = meeduPlayerController.position.value;
|
||||||
await VideoHttp.heartBeat(
|
await VideoHttp.heartBeat(
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
|
@ -324,8 +324,11 @@ class VideoIntroController extends GetxController {
|
|||||||
|
|
||||||
// 关注/取关up
|
// 关注/取关up
|
||||||
Future actionRelationMod() async {
|
Future actionRelationMod() async {
|
||||||
|
if (user.get(UserBoxKey.userMid) == null) {
|
||||||
|
SmartDialog.showToast('账号未登录');
|
||||||
|
return;
|
||||||
|
}
|
||||||
int currentStatus = followStatus['attribute'];
|
int currentStatus = followStatus['attribute'];
|
||||||
print(currentStatus);
|
|
||||||
int actionStatus = 0;
|
int actionStatus = 0;
|
||||||
switch (currentStatus) {
|
switch (currentStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -423,7 +423,11 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
? '关注'
|
? '关注'
|
||||||
: '已关注'),
|
: '已关注'),
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: ElevatedButton(
|
||||||
|
onPressed: () => videoIntroController
|
||||||
|
.actionRelationMod(),
|
||||||
|
child: const Text('关注'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user