Browse Source

课程更改

ff_new
w-R 3 years ago
parent
commit
6d4c575881
  1. BIN
      assets/image/2x/ketang_play.png
  2. BIN
      assets/image/3x/ketang_play.png
  3. BIN
      assets/image/ketang_play.png
  4. 6
      lib/community/community_course.dart
  5. 54
      lib/community/community_view/class_details.dart
  6. 111
      lib/community/community_view/class_list_view.dart
  7. 267
      lib/community/community_view/home_class.dart
  8. 18
      lib/home/home_view/shortcut_operation.dart
  9. 33
      lib/integral_store/integral_store_details_page.dart
  10. 72
      lib/retrofit/data/course_details.dart
  11. 11
      lib/retrofit/min_api.dart
  12. 2
      lib/retrofit/min_api.g.dart
  13. 12
      lib/retrofit/retrofit_api.dart
  14. 24
      lib/retrofit/retrofit_api.g.dart
  15. 3
      lib/union/union_page.dart

BIN
assets/image/2x/ketang_play.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

BIN
assets/image/3x/ketang_play.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

BIN
assets/image/ketang_play.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

6
lib/community/community_course.dart

@ -7,7 +7,6 @@ import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/banner.dart'; import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/brand_data.dart';
import 'package:huixiang/retrofit/data/category_select_list.dart'; import 'package:huixiang/retrofit/data/category_select_list.dart';
import 'package:huixiang/retrofit/data/collect_class_list.dart'; import 'package:huixiang/retrofit/data/collect_class_list.dart';
import 'package:huixiang/retrofit/data/course_list.dart'; import 'package:huixiang/retrofit/data/course_list.dart';
@ -88,7 +87,6 @@ class _CommunityCourse extends State<CommunityCourse>
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
/// ///
classListAsync() async { classListAsync() async {
if (apiService == null) { if (apiService == null) {
@ -258,8 +256,8 @@ class _CommunityCourse extends State<CommunityCourse>
SizedBox(height: 28), SizedBox(height: 28),
/// ///
HomeClass(collect,collectList), HomeClass(collect,collectList,),
/// ///
ClassTitleTab(classSelectList,(index){ ClassTitleTab(classSelectList,(index){

54
lib/community/community_view/class_details.dart

@ -10,8 +10,6 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/chapter.dart'; import 'package:huixiang/retrofit/data/chapter.dart';
import 'package:huixiang/retrofit/data/course_details.dart'; import 'package:huixiang/retrofit/data/course_details.dart';
import 'package:huixiang/retrofit/data/member_comment_list.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
@ -176,13 +174,13 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver{
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
child: Icon( child: Image.asset(
Icons.arrow_back_ios, "assets/image/integral_return.png",
color: Colors.white, width: 24,
size: 24, height: 24,
), ),
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop(course.viewers+1);
}, },
), ),
], ],
@ -268,9 +266,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver{
), ),
)), )),
Text( Text(
"播放次数", "播放次数:",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -352,8 +348,8 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver{
commentTextController, commentTextController,
_toComment, _toComment,
_queryMemberComment, _queryMemberComment,
_queryInformationLikes, _queryCourseLikes,
isLike: false, isLike:course?.selfLiked,
), ),
], ],
), ),
@ -527,18 +523,34 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver{
); );
} }
//// // ////
_queryInformationLikes() async { // _queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(widget.arguments["id"]).catchError((onError) {}); // BaseData baseData = await apiService.courseLikes(widget.arguments["id"]).catchError((onError) {});
// if (baseData != null && baseData.isSuccess) {
// commentKey.currentState.setState(() {});
// setState(() {
// comunity.likes -= 1;
// else
// comunity.likes += 1;
//
// });
// } else {
// // SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
// }
// }
///
_queryCourseLikes() async {
BaseData baseData = await apiService.courseLikes(widget.arguments["id"]).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {});
setState(() { setState(() {
// if (comunity.selfLike ?? false) if (course.selfLiked ?? false)
// comunity.likes -= 1; course.likes -= 1;
// else else
// comunity.likes += 1; course.likes += 1;
// comunity.selfLike = !comunity.selfLike ?? false; course.selfLiked = !course.selfLiked ?? false;
}); });
commentKey.currentState.setState(() {});
} else { } else {
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center); // SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }

111
lib/community/community_view/class_list_view.dart

@ -31,19 +31,21 @@ class _ClassListView extends State<ClassListView> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//Widget数量 //Widget数量
crossAxisCount: 3, crossAxisCount:2,
//Widget之间间距 //Widget之间间距
crossAxisSpacing: 11.w, crossAxisSpacing: 11.w,
//Widget之间间距 //Widget之间间距
mainAxisSpacing: 16.w, mainAxisSpacing: 16.w,
//Widget宽高比例 0.59 //Widget宽高比例 0.59
childAspectRatio: childAspectRatio:
166 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)), 260 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/class_details',arguments: {"id": widget.classList[index].id}); Navigator.of(context).pushNamed('/router/class_details',
arguments: {"id": widget.classList[index].id})
.then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1});
}, },
child: classListItem(widget.classList[index]), child: classListItem(widget.classList[index]),
); );
@ -53,13 +55,23 @@ class _ClassListView extends State<ClassListView> {
Widget classListItem(CourseList classList) { Widget classListItem(CourseList classList) {
return Container( return Container(
width: 106, decoration: BoxDecoration(
height: 189, borderRadius: BorderRadius.vertical(
bottom: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white,
),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
// horizontal: 6.w,
vertical: 3, vertical: 3,
), ),
color: Colors.white,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -67,15 +79,30 @@ class _ClassListView extends State<ClassListView> {
alignment: Alignment(0.9, 0.9), alignment: Alignment(0.9, 0.9),
children: [ children: [
Container( Container(
color: Color.fromARGB(80, 0, 0, 0), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Color.fromARGB(90, 0, 0, 0),
),
child: ClipRRect( child: ClipRRect(
child: MImage( child:
classList.coverImg, Opacity(
width: double.infinity, opacity: 0.6,
height: 120, child:MImage(
fit: BoxFit.cover, classList.coverImg,
errorSrc: "assets/image/default_1.png", width: double.infinity,
fadeSrc: "assets/image/default_1.png", height: 120,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
), ),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(4), top: Radius.circular(4),
@ -91,14 +118,14 @@ class _ClassListView extends State<ClassListView> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset( Image.asset(
"assets/image/ketang_like.png", "assets/image/ketang_play.png",
width: 16.w, width: 16.w,
height: 16.h, height: 16.h,
color: Colors.white, color: Colors.white,
), ),
SizedBox(width: 5), SizedBox(width: 5),
Text( Text(
classList.likes.toString(), classList.viewers.toString(),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -108,47 +135,51 @@ class _ClassListView extends State<ClassListView> {
], ],
), ),
SizedBox(width: 8), SizedBox(width: 8),
Row( // Row(
children: [ // children: [
Image.asset( // Image.asset(
"assets/image/ketang_message.png", // "assets/image/ketang_message.png",
width: 16.w, // width: 16.w,
height: 16.h, // height: 16.h,
color: Colors.white, // color: Colors.white,
), // ),
SizedBox(width: 5), // SizedBox(width: 5),
Text( // Text(
classList.viewers.toString(), // classList.viewers.toString(),
style: TextStyle( // style: TextStyle(
fontSize: 12.sp, // fontSize: 12.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
color: Colors.white, // color: Colors.white,
), // ),
), // ),
], // ],
), // ),
], ],
), ),
), ),
], ],
), ),
Container( Expanded(child:Container(
padding: EdgeInsets.only(left: 4, top: 3), padding: EdgeInsets.all(10),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
classList.subject, classList.subject,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.semi_bold,
color: Colors.black, color: Colors.black,
), ),
), ),
SizedBox(height: 2), SizedBox(height: 2),
Text( Text(
"讲师:${classList.author.name}", "讲师:${classList.author.name}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -157,7 +188,7 @@ class _ClassListView extends State<ClassListView> {
), ),
], ],
), ),
), ),)
], ],
), ),
); );

267
lib/community/community_view/home_class.dart

@ -76,7 +76,8 @@ class _HomeClass extends State<HomeClass> {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/class_details', Navigator.of(context).pushNamed('/router/class_details',
arguments: {"id":widget.collect[position].id}); arguments: {"id":widget.collect[position].id})
.then((value) => {widget.collect[position].viewers = value != null?value:widget.collect[position].viewers+1});
}, },
child: classItem(widget.collect[position]), child: classItem(widget.collect[position]),
); );
@ -92,138 +93,170 @@ class _HomeClass extends State<HomeClass> {
return Container( return Container(
width: 168, width: 168,
height: 189, height: 189,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.white,
),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6.w, horizontal:6,
vertical: 3,
), ),
color: Colors.white,
child: Column( child: Column(
children: [ children: [
Stack( Stack(
alignment: Alignment(0.9,0.9), alignment: Alignment.topRight,
children: [ children: [
Container( Stack(
color: Color.fromARGB(80, 0, 0, 0), alignment: Alignment(0.9,0.9),
child: ClipRRect( children: [
child: MImage( Container(
collect.coverImg, decoration: BoxDecoration(
width: double.infinity, borderRadius: BorderRadius.circular(4),
height: 120, boxShadow: [
fit: BoxFit.cover, BoxShadow(
errorSrc: "assets/image/default_1.png", color: Colors.black.withAlpha(10),
fadeSrc: "assets/image/default_1.png", offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Color.fromARGB(90, 0, 0, 0),
), ),
borderRadius: BorderRadius.vertical( child: ClipRRect(
top: Radius.circular(4), child: Opacity(
opacity: 0.6,
child: MImage(
collect.coverImg,
width: double.infinity,
height: 120,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
),
), ),
), ),
), Container(
Container( padding: EdgeInsets.only(left: 4),
padding: EdgeInsets.only(left: 4), child:Row(
child:Row(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.asset( Row(
"assets/image/ketang_like.png", mainAxisAlignment: MainAxisAlignment.spaceAround,
width: 16.w, crossAxisAlignment: CrossAxisAlignment.start,
height: 16.h, children: [
color: Colors.white, Image.asset(
), "assets/image/ketang_play.png",
SizedBox(width:5), width: 16.w,
Text( height: 16.h,
collect.likes.toString(), color: Colors.white,
style: TextStyle( ),
fontSize: 12.sp, SizedBox(width:5),
fontWeight: MyFontWeight.regular, Text(
color: Colors.white, collect.viewers.toString(),
), style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
],
), ),
SizedBox(width:8),
// Row(
// children: [
// Image.asset(
// "assets/image/ketang_message.png",
// width: 16.w,
// height: 16.h,
// color: Colors.white,
// ),
// SizedBox(width:5),
// Text(
// collect.viewers.toString(),
// style: TextStyle(
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Colors.white,
// ),
// ),
// ],
// ),
], ],
), ),
SizedBox(width:8),
// Row( ),
// children: [ ],
// Image.asset( ),
// "assets/image/ketang_message.png", Container(
// width: 16.w, margin: EdgeInsets.only(top: 8,right: 8),
// height: 16.h, height: 16.h,
// color: Colors.white, width: 30.w,
// ), alignment: Alignment.center,
// SizedBox(width:5), decoration: BoxDecoration(
// Text( borderRadius:
// collect.viewers.toString(), BorderRadius.circular(2),
// style: TextStyle( color: Color(0xFFFFCD00),
// fontSize: 12.sp,
// fontWeight: MyFontWeight.regular,
// color: Colors.white,
// ),
// ),
// ],
// ),
],
), ),
child: Text(
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF634815),
),
), ),
], ),
), ],
Container( ),
padding: EdgeInsets.only(left:4,top: 2), Expanded(child:
child: Column( Container(
mainAxisAlignment: MainAxisAlignment.spaceAround, padding: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
SizedBox(height:2), crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
mainAxisAlignment: MainAxisAlignment.spaceBetween, Row(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
height: 16.h, Expanded(child: Text(
width: 30.w, collect.subject,
alignment: Alignment.center, overflow: TextOverflow.ellipsis,
decoration: BoxDecoration( maxLines: 2,
borderRadius: style: TextStyle(
BorderRadius.circular(2), fontSize: 14.sp,
border: Border.all( fontWeight: MyFontWeight.semi_bold,
width: 1, color: Colors.black,
color: Color(0xFFFF7A1A),
style: BorderStyle.solid,
),
),
child: Text(
( collect?.tags != null && collect.tags.length > 0 )?collect.tags[0] : "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFFF7A1A),
),
),
), ),
SizedBox(width:5), ),),
Expanded(child: Text( ],
collect.subject, ),
style: TextStyle( SizedBox(height:5),
fontSize: 14.sp, Text(
fontWeight: MyFontWeight.medium, "讲师:${collect.author.name}",
color: Colors.black, overflow: TextOverflow.ellipsis,
), maxLines: 2,
),), style: TextStyle(
], fontSize: 12.sp,
), fontWeight: MyFontWeight.regular,
SizedBox(height:3), color: Colors.black,
Text(
"讲师:${collect.author.name}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
), ),
], ),
), ],
), ),
),),
], ],
), ),
); );

18
lib/home/home_view/shortcut_operation.dart

@ -47,7 +47,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
child: Container( child: Container(
width: 106, width: 106,
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(left: 15,right: 15), margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
children: [ children: [
@ -69,11 +69,11 @@ class _ShortcutOperation extends State<ShortcutOperation> {
), ),
), ),
SizedBox(height: 20), SizedBox(height: 20),
Image.asset( Expanded(child: Image.asset(
"assets/image/home_order.png", "assets/image/home_order.png",
width:70, width:70,
height:70, height:70,
), ),),
], ],
), ),
), ),
@ -85,7 +85,7 @@ class _ShortcutOperation extends State<ShortcutOperation> {
child: Container( child: Container(
width: 106, width: 106,
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(left: 15,right: 15), margin: EdgeInsets.only(right:10),
padding: EdgeInsets.only(top: 8,bottom: 8), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
children: [ children: [
@ -107,11 +107,11 @@ class _ShortcutOperation extends State<ShortcutOperation> {
), ),
), ),
SizedBox(height: 20), SizedBox(height: 20),
Image.asset( Expanded(child:Image.asset(
"assets/image/home_recharge.png", "assets/image/home_recharge.png",
width:70, width:70,
height:70, height:70,
), ),),
], ],
), ),
), ),
@ -123,7 +123,6 @@ class _ShortcutOperation extends State<ShortcutOperation> {
child:Container( child:Container(
width: 106, width: 106,
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(left: 15,right: 15),
padding: EdgeInsets.only(top: 8,bottom: 8), padding: EdgeInsets.only(top: 8,bottom: 8),
child: Column( child: Column(
children: [ children: [
@ -145,11 +144,12 @@ class _ShortcutOperation extends State<ShortcutOperation> {
), ),
), ),
SizedBox(height: 20), SizedBox(height: 20),
Image.asset( Expanded(child: Image.asset(
"assets/image/home_coupon.png", "assets/image/home_coupon.png",
width:70, width:70,
height:70, height:70,
), ), ),
], ],
), ),
), ),

33
lib/integral_store/integral_store_details_page.dart

@ -115,31 +115,34 @@ class _IntegralStoreDetailsPage extends State {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (goods != null && // if (goods != null &&
points != null && // points != null &&
int.tryParse(goods.price) < int.tryParse(points)) { // int.tryParse(goods.price) < int.tryParse(points)) {
toExchangeOrder(); // toExchangeOrder();
} // }
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h), padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: (goods != null && color:
points != null && // (goods != null &&
int.tryParse(goods.price) < int.tryParse(points)) // points != null &&
? Color(0xFF32A060) // int.tryParse(goods.price) < int.tryParse(points))
: Color(0xFFD8D8D8), // ? Color(0xFF32A060)
// :
Color(0xFFD8D8D8),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(4), top: Radius.circular(4),
), ),
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
(goods != null && // (goods != null &&
points != null && // points != null &&
int.tryParse(goods.price) < int.tryParse(points)) // int.tryParse(goods.price) < int.tryParse(points))
? S.of(context).duihuan // ? S.of(context).duihuan
: S.of(context).jifenbuzu, // : S.of(context).jifenbuzu,
"兑换功能暂未开放",
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),

72
lib/retrofit/data/course_details.dart

@ -28,7 +28,8 @@ class CourseDetails {
Author author, Author author,
String introduce, String introduce,
int viewers, int viewers,
int likes, int likes,
bool selfLiked,
bool state, bool state,
int isDelete,}){ int isDelete,}){
_id = id; _id = id;
@ -44,6 +45,7 @@ class CourseDetails {
_introduce = introduce; _introduce = introduce;
_viewers = viewers; _viewers = viewers;
_likes = likes; _likes = likes;
_selfLiked = selfLiked;
_state = state; _state = state;
_isDelete = isDelete; _isDelete = isDelete;
} }
@ -62,6 +64,7 @@ class CourseDetails {
_introduce = json['introduce']; _introduce = json['introduce'];
_viewers = json['viewers']; _viewers = json['viewers'];
_likes = json['likes']; _likes = json['likes'];
_selfLiked = json['selfLiked'];
_state = json['state']; _state = json['state'];
_isDelete = json['isDelete']; _isDelete = json['isDelete'];
} }
@ -78,6 +81,7 @@ class CourseDetails {
String _introduce; String _introduce;
int _viewers; int _viewers;
int _likes; int _likes;
bool _selfLiked;
bool _state; bool _state;
int _isDelete; int _isDelete;
@ -94,9 +98,15 @@ class CourseDetails {
String get introduce => _introduce; String get introduce => _introduce;
int get viewers => _viewers; int get viewers => _viewers;
int get likes => _likes; int get likes => _likes;
bool get selfLiked => _selfLiked;
bool get state => _state; bool get state => _state;
int get isDelete => _isDelete; int get isDelete => _isDelete;
set id(String value) {
_id = value;
}
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['id'] = _id; map['id'] = _id;
@ -114,11 +124,71 @@ class CourseDetails {
map['introduce'] = _introduce; map['introduce'] = _introduce;
map['viewers'] = _viewers; map['viewers'] = _viewers;
map['likes'] = _likes; map['likes'] = _likes;
map['selfLiked'] = _selfLiked;
map['state'] = _state; map['state'] = _state;
map['isDelete'] = _isDelete; map['isDelete'] = _isDelete;
return map; return map;
} }
set createTime(String value) {
_createTime = value;
}
set createUser(String value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(String value) {
_updateUser = value;
}
set categoryId(String value) {
_categoryId = value;
}
set subject(String value) {
_subject = value;
}
set tags(List<String> value) {
_tags = value;
}
set coverImg(String value) {
_coverImg = value;
}
set author(Author value) {
_author = value;
}
set introduce(String value) {
_introduce = value;
}
set viewers(int value) {
_viewers = value;
}
set likes(int value) {
_likes = value;
}
set selfLiked(bool value) {
_selfLiked = value;
}
set state(bool value) {
_state = value;
}
set isDelete(int value) {
_isDelete = value;
}
} }
/// name : "1" /// name : "1"

11
lib/retrofit/min_api.dart

@ -21,13 +21,12 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const base_url = "https://pos.api.lotus-wallet.com/app/"; /// // const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
const base_url = "http://192.168.10.236:8765/app/";///
const baseUrl = "http://192.168.10.236:8765/app/";///
// const base_url = "http://192.168.10.236:8765/app/";
///
// const baseUrl = "http://192.168.10.236:8765/app/";
///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.236:8765/app/';
} }
final Dio _dio; final Dio _dio;

12
lib/retrofit/retrofit_api.dart

@ -45,11 +45,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; /// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; /// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
@ -422,4 +422,8 @@ abstract class ApiService {
@GET("/course/{id}") @GET("/course/{id}")
Future<BaseData<CourseDetails>> course(@Path("id") String id); Future<BaseData<CourseDetails>> course(@Path("id") String id);
////
@GET("/course/likes/{courseId}")
Future<BaseData> courseLikes(@Path("courseId") String courseId);
} }

24
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.236:8766/app/';
} }
final Dio _dio; final Dio _dio;
@ -1509,4 +1509,26 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<BaseData<dynamic>> courseLikes(courseId) async {
ArgumentError.checkNotNull(courseId, 'courseId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/course/likes/$courseId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<dynamic>.fromJson(
_result.data,
(json) => json as dynamic,
);
return value;
}
} }

3
lib/union/union_page.dart

@ -1,5 +1,4 @@
import 'dart:ui'; import 'dart:ui';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
@ -13,7 +12,6 @@ import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store.dart'; import 'package:huixiang/retrofit/data/store.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/scan.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/location.dart'; import 'package:huixiang/utils/location.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/border_text.dart';
@ -93,7 +91,6 @@ class _UnionPage extends State<UnionPage>
startLocation() async { startLocation() async {
EasyLoading.show(status: S.current.zhengzaijiazai); EasyLoading.show(status: S.current.zhengzaijiazai);
Location.getInstance() Location.getInstance()
.aMapFlutterLocation .aMapFlutterLocation
.onResultCallback() .onResultCallback()

Loading…
Cancel
Save