feat: opus专栏内容渲染
This commit is contained in:
28
lib/pages/opus/controller.dart
Normal file
28
lib/pages/opus/controller.dart
Normal file
@ -0,0 +1,28 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/http/read.dart';
|
||||
import 'package:pilipala/models/read/opus.dart';
|
||||
|
||||
class OpusController extends GetxController {
|
||||
late String url;
|
||||
late String title;
|
||||
late String id;
|
||||
late String dynamicType;
|
||||
Rx<OpusDataModel> opusData = OpusDataModel().obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
url = Get.parameters['url']!;
|
||||
title = Get.parameters['title']!;
|
||||
id = Get.parameters['id']!;
|
||||
dynamicType = Get.parameters['dynamicType']!;
|
||||
}
|
||||
|
||||
Future fetchOpusData() async {
|
||||
var res = await ReadHttp.parseArticleOpus(id: id);
|
||||
if (res['status']) {
|
||||
opusData.value = res['data'];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user