Merge branch 'design'

This commit is contained in:
guozhigq
2024-04-28 00:07:18 +08:00
5 changed files with 60 additions and 3 deletions

View File

@ -36,7 +36,6 @@ class NetworkImgLayer extends StatelessWidget {
final int defaultImgQuality = GlobalData().imgQuality;
final String imageUrl =
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
// print(imageUrl);
int? memCacheWidth, memCacheHeight;
double aspectRatio = (width / height).toDouble();

View File

@ -414,6 +414,7 @@ class DynamicMajorModel {
this.none,
this.type,
this.courses,
this.common,
});
DynamicArchiveModel? archive;
@ -429,6 +430,7 @@ class DynamicMajorModel {
// MAJOR_TYPE_OPUS 图文/文章
String? type;
Map? courses;
Map? common;
DynamicMajorModel.fromJson(Map<String, dynamic> json) {
archive = json['archive'] != null
@ -452,6 +454,7 @@ class DynamicMajorModel {
json['none'] != null ? DynamicNoneModel.fromJson(json['none']) : null;
type = json['type'];
courses = json['courses'] ?? {};
common = json['common'] ?? {};
}
}

View File

@ -2,6 +2,7 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart';
import 'package:pilipala/utils/utils.dart';
import 'additional_panel.dart';
@ -182,6 +183,61 @@ Widget forWard(item, context, ctr, source, {floor = 1}) {
)
],
);
// 活动
case 'DYNAMIC_TYPE_COMMON_SQUARE':
return Padding(
padding: const EdgeInsets.only(top: 8),
child: InkWell(
onTap: () {
Get.toNamed('/webview', parameters: {
'url': item.modules.moduleDynamic.major.common['jump_url'],
'type': 'url',
'pageTitle': item.modules.moduleDynamic.major.common['title']
});
},
child: Container(
width: double.infinity,
padding:
const EdgeInsets.only(left: 12, top: 10, right: 12, bottom: 10),
color: Theme.of(context).dividerColor.withOpacity(0.08),
child: Row(
children: [
NetworkImgLayer(
width: 45,
height: 45,
src: item.modules.moduleDynamic.major.common['cover'],
),
const SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.modules.moduleDynamic.major.common['title'],
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
Text(
item.modules.moduleDynamic.major.common['desc'],
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
)
],
),
// TextButton(onPressed: () {}, child: Text('123'))
),
),
);
default:
return const SizedBox(
width: double.infinity,

View File

@ -446,7 +446,7 @@ class _HeaderControlState extends State<HeaderControl> {
children: [
RadioListTile(
value: -1,
title: const Text('关闭'),
title: const Text('关闭'),
groupValue: tempThemeValue,
onChanged: (value) {
tempThemeValue = value!;

View File

@ -109,7 +109,6 @@ class Utils {
toInt: false,
formatType: formatType);
}
print('distance: $distance');
if (distance <= 60) {
return '刚刚';
} else if (distance <= 3600) {