Browse Source

社群内容更改

remove_uniapp
w-R 3 years ago
parent
commit
c9dbb25a52
  1. 2
      lib/community/community_list.dart
  2. 11
      lib/community/community_view/community_dynamic.dart
  3. 5
      lib/login/login_page.dart
  4. 19
      lib/retrofit/min_api.dart
  5. 2
      lib/retrofit/min_api.g.dart
  6. 15
      lib/retrofit/retrofit_api.dart
  7. 2
      lib/retrofit/retrofit_api.g.dart
  8. 34
      lib/utils/flutter_utils.dart

2
lib/community/community_list.dart

@ -361,7 +361,7 @@ class _CommunityList extends State<CommunityList> {
), ),
Text( Text(
comments.subject ?? "", comments.subject ?? "",
maxLines: 5, maxLines: 10,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),

11
lib/community/community_view/community_dynamic.dart

@ -295,15 +295,22 @@ class _CommunityDynamic extends State<CommunityDynamic> {
SizedBox( SizedBox(
height: 12.h, height: 12.h,
), ),
Text( widget.isList ? Text(
widget?.article?.mainTitle ?? "", widget?.article?.mainTitle ?? "",
maxLines: 5, maxLines:5,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 15.sp, fontSize: 15.sp,
), ),
) :Text(
widget?.article?.mainTitle ?? "",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontWeight: MyFontWeight.regular,
fontSize: 15.sp,
),
), ),
buildMedia(widget?.article?.content), buildMedia(widget?.article?.content),
SizedBox( SizedBox(

5
lib/login/login_page.dart

@ -11,6 +11,7 @@ import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/retrofit/data/user_entity.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/border_text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -326,8 +327,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) { BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) {
print(error); print(error.message);
SmartDialog.showToast("$error", alignment: Alignment.center); SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center);
}); });
// EasyLoading.show(status: S.of(context).zhengzaijiazai); // EasyLoading.show(status: S.of(context).zhengzaijiazai);
Future.delayed(Duration(seconds:2), () { Future.delayed(Duration(seconds:2), () {

19
lib/retrofit/min_api.dart

@ -22,25 +22,22 @@ 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 base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
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.132:8765/app/";/// // const base_url = "http://192.168.10.132:8765/app/";///
// const baseUrl = "http://192.168.10.132:8765/app/";///
// const base_url = "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 localBaseUrl = "https://pos.api.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
/// ///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: localBaseUrl)
abstract class MinApiService { abstract class MinApiService {
factory MinApiService( factory MinApiService(
Dio dio, { Dio dio, {
@ -122,7 +119,7 @@ abstract class MinApiService {
); );
if (kReleaseMode) { if (kReleaseMode) {
baseUrl = base_url; baseUrl = serviceBaseUrl;
} }
return _MinApiService(dio, baseUrl: baseUrl); return _MinApiService(dio, baseUrl: baseUrl);
} }

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 ??= 'http://192.168.10.236:8765/app/'; baseUrl ??= kReleaseMode?serviceBaseUrl:localBaseUrl;
} }
final Dio _dio; final Dio _dio;

15
lib/retrofit/retrofit_api.dart

@ -59,22 +59,19 @@ import 'data/vip_rule_details.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 base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
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 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 base_url = "http://192.168.10.132:8766/app/";/// // const base_url = "http://192.168.10.132:8766/app/";///
// const baseUrl = "http://192.168.10.132:8766/app/";///
@RestApi(baseUrl: baseUrl) const localBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///
const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线
@RestApi(baseUrl: localBaseUrl)
abstract class ApiService { abstract class ApiService {
factory ApiService( factory ApiService(
Dio dio, { Dio dio, {
@ -147,7 +144,7 @@ abstract class ApiService {
); );
if (kReleaseMode) { if (kReleaseMode) {
baseUrl = base_url; baseUrl = serviceBaseUrl;
} }
return _ApiService(dio, baseUrl: baseUrl); return _ApiService(dio, baseUrl: baseUrl);
} }

2
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 ??= 'http://192.168.10.236:8766/app/'; baseUrl ??= kReleaseMode?serviceBaseUrl:localBaseUrl;
} }
final Dio _dio; final Dio _dio;

34
lib/utils/flutter_utils.dart

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart'; import 'package:flutter_baidu_mapapi_utils/flutter_baidu_mapapi_utils.dart';
@ -178,4 +179,37 @@ class AppUtils {
} }
} }
} }
static String dioErrorTypeToString(DioErrorType type){
String errorStr = "";
switch(type){
case DioErrorType.CANCEL:{
errorStr = "取消请求";
break;
}
case DioErrorType.CONNECT_TIMEOUT:{
errorStr = "链接超时";
break;
}
case DioErrorType.RECEIVE_TIMEOUT:{
errorStr = "响应超时";
break;
}
case DioErrorType.SEND_TIMEOUT:{
errorStr = "请求超时";
break;
}
case DioErrorType.RESPONSE:{
errorStr = "服务器异常";
break;
}
case DioErrorType.DEFAULT:
default:{
errorStr = "请求异常";
break;
}
}
errorStr += ",请检查手机网络是否正常";
return errorStr;
}
} }

Loading…
Cancel
Save