Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
245592a7f2
  1. 2
      android/app/build.gradle
  2. 2
      android/app/src/main/assets/data/dcloud_control.xml
  3. 5
      android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt
  4. 1
      lib/generated/intl/messages_en.dart
  5. 1
      lib/generated/intl/messages_zh_CN.dart
  6. 1
      lib/generated/intl/messages_zh_Hans_CN.dart
  7. 1
      lib/generated/intl/messages_zh_Hant_CN.dart
  8. 1
      lib/generated/intl/messages_zh_TW.dart
  9. 10
      lib/generated/l10n.dart
  10. 1
      lib/l10n/intl_en.arb
  11. 1
      lib/l10n/intl_zh_CN.arb
  12. 1
      lib/l10n/intl_zh_Hans_CN.arb
  13. 1
      lib/l10n/intl_zh_Hant_CN.arb
  14. 1
      lib/l10n/intl_zh_TW.arb
  15. 18
      lib/login/login_page.dart
  16. 5
      lib/main.dart
  17. 23
      lib/mine/roll_center_page.dart
  18. 24
      lib/order/order_detail_page.dart
  19. 1
      lib/setting/setting_page.dart
  20. 24
      lib/union/union_view/store_info.dart
  21. 7
      lib/view_widget/mine_vip_view.dart
  22. 6
      lib/web/web_page.dart
  23. 69
      lib/web/web_view/comment_list.dart
  24. 6
      lib/web/web_view/input_comment.dart
  25. 42
      lib/web/web_view/web_content.dart

2
android/app/build.gradle

@ -190,6 +190,8 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.alibaba:fastjson:1.2.54' implementation 'com.alibaba:fastjson:1.2.54'
implementation 'com.tencent.tpns:xiaomi:1.2.7.1-release'
implementation 'com.tencent.tpns:huawei:1.2.6.0-release' implementation 'com.tencent.tpns:huawei:1.2.6.0-release'
// HMS Core Push // HMS Core Push
implementation 'com.huawei.hms:push:5.3.0.304' implementation 'com.huawei.hms:push:5.3.0.304'

2
android/app/src/main/assets/data/dcloud_control.xml

@ -1,4 +1,4 @@
<hbuilder version="1.9.9.80110" debug="false" syncDebug ="false"> <hbuilder version="1.9.9.80110" debug="false" syncDebug="true">
<apps> <apps>
<app appid="__UNI__ACD00DA" appver="1.0"/> <app appid="__UNI__ACD00DA" appver="1.0"/>
<app appid="__UNI__E60E056" appver="1.0"/> <app appid="__UNI__E60E056" appver="1.0"/>

5
android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt

@ -24,7 +24,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
/// This local reference serves to register the plugin with the Flutter Engine and unregister it /// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity /// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel private lateinit var channel : MethodChannel
private lateinit var context : Context; private lateinit var context : Context
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
context = flutterPluginBinding.applicationContext; context = flutterPluginBinding.applicationContext;
@ -44,7 +44,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
.setMenuDefFontColor("#000000") .setMenuDefFontColor("#000000")
.setMenuDefFontWeight("normal") .setMenuDefFontWeight("normal")
.setMenuActionSheetItems(sheetItems) .setMenuActionSheetItems(sheetItems)
.setEnableBackground(true) .setEnableBackground(false) //后台运行
.build() .build()
DCUniMPSDK.getInstance().initialize(context, config) { DCUniMPSDK.getInstance().initialize(context, config) {
result.success(it) result.success(it)
@ -60,6 +60,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler {
} }
DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { DCUniMPSDK.getInstance().setUniMPOnCloseCallBack {
Logger.e("用户点击了退出 it: $it") Logger.e("用户点击了退出 it: $it")
DCUniMPSDK.getInstance().closeCurrentApp()
} }
} }
} else if (call.method == "isInitialize") { } else if (call.method == "isInitialize") {

1
lib/generated/intl/messages_en.dart

@ -214,6 +214,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"), "guanyuchuangshiren" : MessageLookupByLibrary.simpleMessage("关于创始人"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
"haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"),
"haowu" : MessageLookupByLibrary.simpleMessage("好物"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"),
"heji" : MessageLookupByLibrary.simpleMessage("合计:"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"),

1
lib/generated/intl/messages_zh_CN.dart

@ -213,6 +213,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
"haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"),
"haowu" : MessageLookupByLibrary.simpleMessage("好物"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"),
"heji" : MessageLookupByLibrary.simpleMessage("合计:"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"),

1
lib/generated/intl/messages_zh_Hans_CN.dart

@ -213,6 +213,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanyu" : MessageLookupByLibrary.simpleMessage("关于"), "guanyu" : MessageLookupByLibrary.simpleMessage("关于"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("过健康有机生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("还没有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("还没有优惠券可以领取~"),
"haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峡姐妹"),
"haowu" : MessageLookupByLibrary.simpleMessage("好物"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"),
"heji" : MessageLookupByLibrary.simpleMessage("合计:"), "heji" : MessageLookupByLibrary.simpleMessage("合计:"),

1
lib/generated/intl/messages_zh_Hant_CN.dart

@ -213,6 +213,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"),
"haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"),
"haowu" : MessageLookupByLibrary.simpleMessage("好物"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"),
"heji" : MessageLookupByLibrary.simpleMessage("合計:"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"),

1
lib/generated/intl/messages_zh_TW.dart

@ -213,6 +213,7 @@ class MessageLookup extends MessageLookupByLibrary {
"guanyu" : MessageLookupByLibrary.simpleMessage("關於"), "guanyu" : MessageLookupByLibrary.simpleMessage("關於"),
"guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"), "guojiankangyoujishenghuo" : MessageLookupByLibrary.simpleMessage("過健康有機生活"),
"haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"), "haimeiyouxiaoxi" : MessageLookupByLibrary.simpleMessage("還沒有消息~"),
"haimeiyouyouhuiquankeyilingqu" : MessageLookupByLibrary.simpleMessage("還沒有優惠券可以領取~"),
"haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"), "haixiajiemei" : MessageLookupByLibrary.simpleMessage("海峽姐妹"),
"haowu" : MessageLookupByLibrary.simpleMessage("好物"), "haowu" : MessageLookupByLibrary.simpleMessage("好物"),
"heji" : MessageLookupByLibrary.simpleMessage("合計:"), "heji" : MessageLookupByLibrary.simpleMessage("合計:"),

10
lib/generated/l10n.dart

@ -4955,6 +4955,16 @@ class S {
); );
} }
/// `~`
String get haimeiyouyouhuiquankeyilingqu {
return Intl.message(
'还没有优惠券可以领取~',
name: 'haimeiyouyouhuiquankeyilingqu',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

1
lib/l10n/intl_en.arb

@ -512,6 +512,7 @@
"yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}", "yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}",
"saomashibieguanzhugongzonghao": "扫码识别,关注公众号", "saomashibieguanzhugongzonghao": "扫码识别,关注公众号",
"fenxiangzhiweixin": "分享至微信", "fenxiangzhiweixin": "分享至微信",
"haimeiyouyouhuiquankeyilingqu": "还没有优惠券可以领取~",

1
lib/l10n/intl_zh_CN.arb

@ -514,6 +514,7 @@
"yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}", "yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}",
"saomashibieguanzhugongzonghao": "扫码识别,关注公众号", "saomashibieguanzhugongzonghao": "扫码识别,关注公众号",
"fenxiangzhiweixin": "分享至微信", "fenxiangzhiweixin": "分享至微信",
"haimeiyouyouhuiquankeyilingqu": "还没有优惠券可以领取~",

1
lib/l10n/intl_zh_Hans_CN.arb

@ -514,6 +514,7 @@
"yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}", "yaoqingrenshoujihao_": "邀请人手机号:{shoujihao}",
"saomashibieguanzhugongzonghao": "扫码识别,关注公众号", "saomashibieguanzhugongzonghao": "扫码识别,关注公众号",
"fenxiangzhiweixin": "分享至微信", "fenxiangzhiweixin": "分享至微信",
"haimeiyouyouhuiquankeyilingqu": "还没有优惠券可以领取~",

1
lib/l10n/intl_zh_Hant_CN.arb

@ -507,6 +507,7 @@
"yaoqingrenshoujihao_": "邀请人手機號:{shoujihao}", "yaoqingrenshoujihao_": "邀请人手機號:{shoujihao}",
"saomashibieguanzhugongzonghao": "掃碼識別,關注公眾號", "saomashibieguanzhugongzonghao": "掃碼識別,關注公眾號",
"fenxiangzhiweixin": "分享至微信", "fenxiangzhiweixin": "分享至微信",
"haimeiyouyouhuiquankeyilingqu": "還沒有優惠券可以領取~",

1
lib/l10n/intl_zh_TW.arb

@ -506,6 +506,7 @@
"yaoqingrenshoujihao_": "邀请人手機號:{shoujihao}", "yaoqingrenshoujihao_": "邀请人手機號:{shoujihao}",
"saomashibieguanzhugongzonghao": "掃碼識別,關注公眾號", "saomashibieguanzhugongzonghao": "掃碼識別,關注公眾號",
"fenxiangzhiweixin": "分享至微信", "fenxiangzhiweixin": "分享至微信",
"haimeiyouyouhuiquankeyilingqu": "還沒有優惠券可以領取~",

18
lib/login/login_page.dart

@ -85,11 +85,12 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Image image; Image image;
buildImageInfo(BuildContext context) async { buildImageInfo(BuildContext context) async {
image = Image.asset("assets/image/laoban.png"); image = Image.asset("assets/image/laoban.png");
double screenWidth = MediaQuery.of(this.context).size.width;
image.image image.image
.resolve(ImageConfiguration()) .resolve(ImageConfiguration())
.addListener(ImageStreamListener((ImageInfo info, bool _) { .addListener(ImageStreamListener((ImageInfo info, bool _) {
double width = info.image.width.toDouble(); double width = info.image.width.toDouble();
double screenWidth = 375; if (!mounted) return;
if ((width / screenWidth) < rota) { if ((width / screenWidth) < rota) {
rota = (screenWidth * 1.04) / width; rota = (screenWidth * 1.04) / width;
} }
@ -98,22 +99,11 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
})); }));
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
isLogin(); isLogin();
try {
buildImageInfo(this.context);
} catch(ex) {}
} }
initController() { initController() {
@ -390,6 +380,10 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
try {
buildImageInfo(this.context);
} catch(ex) {}
if (animatedContainer != null && !animatedContainer.isAnimating) { if (animatedContainer != null && !animatedContainer.isAnimating) {
animatedContainer.forward(); animatedContainer.forward();
} }

5
lib/main.dart

@ -110,8 +110,9 @@ initSdk() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi();
// //
// androidApi.setMiPushAppId(appId:"APP_ID"); androidApi.setMiPushAppId(appId:"2882303761520050452");
// androidApi.setMiPushAppKey(appKey: "APPKEY"); androidApi.setMiPushAppKey(appKey: "5582005091452");
androidApi.enableOtherPush(); androidApi.enableOtherPush();
androidApi.regPush(); androidApi.regPush();
} }

23
lib/mine/roll_center_page.dart

@ -11,6 +11,7 @@ import 'package:huixiang/view_widget/item_title.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/new_coupon_widget.dart'; import 'package:huixiang/view_widget/new_coupon_widget.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/receive_success.dart'; import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/selector_store_dialog.dart'; import 'package:huixiang/view_widget/selector_store_dialog.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -34,8 +35,11 @@ class _RollCenterPage extends State<RollCenterPage> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(
context: context, token: value.getString('token')), Dio(),
context: context,
token: value.getString('token'),
),
queryCoupon(), queryCoupon(),
}); });
_refreshController = RefreshController(initialRefresh: false); _refreshController = RefreshController(initialRefresh: false);
@ -114,7 +118,8 @@ class _RollCenterPage extends State<RollCenterPage> {
onRefresh: refreshCoupon, onRefresh: refreshCoupon,
onLoading: queryCoupon, onLoading: queryCoupon,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: ListView.builder( child: (coupons != null && coupons.length > 0)
? ListView.builder(
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
child: NewCouponWidget( child: NewCouponWidget(
@ -144,10 +149,15 @@ class _RollCenterPage extends State<RollCenterPage> {
), ),
); );
}, },
itemCount: coupons != null ? coupons.length : 0, itemCount: (coupons != null && coupons.length > 0) ? coupons.length : 0,
)
: NoDataView(
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
),
), ),
), ),
)
], ],
), ),
), ),
@ -168,7 +178,8 @@ class _RollCenterPage extends State<RollCenterPage> {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
builder: (context) { builder: (context) {
return SelectorStoreWidget(storeList); return SelectorStoreWidget(storeList);
}); },
);
} }
showAlertDialog() { showAlertDialog() {

24
lib/order/order_detail_page.dart

@ -36,8 +36,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = apiService = ApiService(
ApiService(Dio(), context: context, token: value.getString("token")); Dio(),
context: context,
token: value.getString("token"),
);
queryDetails(); queryDetails();
}); });
} }
@ -62,11 +65,11 @@ class _OrderDetailPage extends State<OrderDetailPage> {
isTakeOut = orderInfo.isTakeOut; isTakeOut = orderInfo.isTakeOut;
refundStatus = orderInfo.refundStatus; refundStatus = orderInfo.refundStatus;
// storeType = orderInfo.storeVO.posType.code; // storeType = orderInfo.storeVO.posType.code;
print("refund_status: $refundStatus"); print("order refund_status: $refundStatus");
print("payStatus: $payStatus"); print("order payStatus: $payStatus");
print("orderStatus: $orderStatus"); print("order orderStatus: $orderStatus");
print("sendStatus: $sendStatus"); print("order sendStatus: $sendStatus");
print("isTakeOut: $isTakeOut"); print("order isTakeOut: $isTakeOut");
if (mounted) if (mounted)
setState(() { setState(() {
statusTitle(); statusTitle();
@ -470,7 +473,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
return AlertDialog( return AlertDialog(
content: Container( content: Container(
width: MediaQuery.of(context).size.width - 84.w, width: MediaQuery.of(context).size.width - 84.w,
height: 120.h, height: 140.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -528,12 +531,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
flex: 1, flex: 1,
), ),
], ],
) ),
], ],
), ),
), ),
); );
}); },
);
} }
Widget paySelector() { Widget paySelector() {

1
lib/setting/setting_page.dart

@ -190,6 +190,7 @@ class _SettingPage extends State<SettingPage> {
if (miniAppids != null && miniAppids.length > 0) { if (miniAppids != null && miniAppids.length > 0) {
miniAppids.forEach((element) async { miniAppids.forEach((element) async {
print("appid: $element"); print("appid: $element");
await Min.closeCurrentApp();
String path = await Min.getAppBasePath(element); String path = await Min.getAppBasePath(element);
AppUtils.deleteDirectory(Directory(path)); AppUtils.deleteDirectory(Directory(path));
String filePath = ""; String filePath = "";

24
lib/union/union_view/store_info.dart

@ -66,35 +66,37 @@ class _StoreInfos extends State<StoreInfos> {
children: [ children: [
Row( Row(
children: [ children: [
Text( Expanded(
child: Container(
alignment:
Alignment.centerLeft,
child: Text(
widget.storeInfo != null widget.storeInfo != null
? widget.storeInfo.storeName ? widget.storeInfo.storeName
: "", : "",
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,
color: Colors.black, color: Colors.black,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
Expanded( ),
child: Container( ),
alignment: Text(
Alignment.centerRight,
child: Text(
S.of(context).ren( S.of(context).ren(
widget.storeInfo != null widget.storeInfo != null
? widget.storeInfo ? widget.storeInfo
.perCapitaConsumption .perCapitaConsumption
: "", : "",
), ),
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
),
),
], ],
), ),
Text( Text(
@ -117,10 +119,8 @@ class _StoreInfos extends State<StoreInfos> {
), ),
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(

7
lib/view_widget/mine_vip_view.dart

@ -312,9 +312,10 @@ class MineVipView extends StatelessWidget {
}); });
} }
}, },
child: (tag == null || tag == "") child: widget,
? widget //(tag == null || tag == "")
: Hero(tag: tag, child: widget), // ? widget
// : Hero(tag: tag, child: widget)
); );
} }
} }

6
lib/web/web_page.dart

@ -249,7 +249,9 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
WebHeader(widget.arguments, activity, article,16), WebHeader(widget.arguments, activity, article,16),
/// ///
WebContent(activity, article), WebContent(activity, article, (){
setState(() {});
}),
/// ///
CommentList( CommentList(
@ -318,7 +320,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
Offset first = firstRenderBox.localToGlobal(Offset.zero); Offset first = firstRenderBox.localToGlobal(Offset.zero);
scrollController.animateTo(first.dy + scrollController.offset - scrollController.animateTo(first.dy + scrollController.offset -
(kToolbarHeight + MediaQuery.of(context).padding.top), (kToolbarHeight + MediaQuery.of(context).padding.top),
duration: Duration(milliseconds: 1000), duration: Duration(milliseconds: 300),
curve: Curves.easeIn); curve: Curves.easeIn);
} }

69
lib/web/web_view/comment_list.dart

@ -136,15 +136,15 @@ class _CommentList extends State<CommentList> {
showPressMenu(memberList[position].createUser, showPressMenu(memberList[position].createUser,
memberList[position]); memberList[position]);
}, },
child: commentItem(memberList[position], position, child: commentItem(
memberList.length), memberList[position], position, memberList.length),
), ),
); );
}, },
), ),
if (memberList != null && memberList.length > 0) if (memberList != null && memberList.length > 0)
Container( Container(
height: 63.h, height: commentHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
boxShadow: [ boxShadow: [
@ -156,7 +156,8 @@ class _CommentList extends State<CommentList> {
), ),
], ],
), ),
alignment: Alignment.center, alignment: Alignment.topCenter,
padding: EdgeInsets.only(top: 22.h),
child: Text( child: Text(
S.of(context).yixiansquanbupinglun, S.of(context).yixiansquanbupinglun,
style: TextStyle( style: TextStyle(
@ -168,8 +169,13 @@ class _CommentList extends State<CommentList> {
if (memberList == null || memberList.length == 0) if (memberList == null || memberList.length == 0)
Container( Container(
width: double.infinity, width: double.infinity,
height: 80.h, height: MediaQuery.of(context).size.height -
alignment: Alignment.center, kToolbarHeight -
MediaQuery.of(context).padding.top -
160.h,
alignment: Alignment.topCenter,
color: Color(0xFFF2F2F2),
padding: EdgeInsets.only(top: 22.h),
child: Text( child: Text(
S.of(context).zanwupinglun, S.of(context).zanwupinglun,
style: TextStyle( style: TextStyle(
@ -182,30 +188,41 @@ class _CommentList extends State<CommentList> {
], ],
), ),
), ),
SizedBox(
height: 12.h,
),
], ],
); );
} }
double commentHeight = 60.h;
contentHeight() {
double contentHeight = MediaQuery.of(context).size.height -
kToolbarHeight -
MediaQuery.of(context).padding.top -
160.h;
if ((contentHeight - 60.h) > (128.h * memberList.length)) {
commentHeight = contentHeight - (128.h * memberList.length);
}
}
// //
queryMemberCommentList() async { queryMemberCommentList() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null) if (apiService == null)
apiService = ApiService(Dio(), apiService = ApiService(
context: context, token: sharedPreferences.getString("token")); Dio(),
BaseData<PageInfo<MemberCommentList>> baseData = context: context,
await apiService.memberCommentList({ token: sharedPreferences.getString("token"),
);
BaseData<PageInfo<MemberCommentList>> baseData = await apiService.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": "relationalId": widget.arguments["activityId"] ?? widget.arguments["articleId"],
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalType": 1, "relationalType": 1,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTotal = baseData.data.size; commentTotal = baseData.data.size;
memberList = baseData.data.list; memberList = baseData.data.list;
contentHeight();
setState(() {}); setState(() {});
} }
} }
@ -216,24 +233,6 @@ class _CommentList extends State<CommentList> {
return; return;
} }
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
// showModalBottomSheet(
// context: context,
// backgroundColor: Colors.transparent,
// builder: (context) {
// return CommentMenu(
// (type) {
// print("click: $type");
// if (type == "huifu") {
// widget.reply(memberComment);
// } else if (type == "shanchu") {
// widget.delCommentTips();
// }
// },
// isSelf: userId == value.getString("userId"),
// );
// },
// );
SmartDialog.show( SmartDialog.show(
widget: CommentMenu( widget: CommentMenu(
(type) { (type) {
@ -369,8 +368,8 @@ class _CommentList extends State<CommentList> {
), ),
Container( Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 68, left: 68.w,
right: 16, right: 16.w,
top: 16.h, top: 16.h,
bottom: 16.h, bottom: 16.h,
), ),

6
lib/web/web_view/input_comment.dart

@ -64,9 +64,7 @@ class _InputComment extends State<InputComment> {
color: Color(0xffF2F2F2), color: Color(0xffF2F2F2),
borderRadius: BorderRadius.circular(2.0), borderRadius: BorderRadius.circular(2.0),
), ),
child: Column( child: Container(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 4.w), margin: EdgeInsets.symmetric(horizontal: 4.w),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: TextField( child: TextField(
@ -84,8 +82,6 @@ class _InputComment extends State<InputComment> {
), ),
), ),
), ),
],
),
), ),
), ),
if (widget.isKeyBoardShow) if (widget.isKeyBoardShow)

42
lib/web/web_view/web_content.dart

@ -1,6 +1,7 @@
import 'package:chewie/chewie.dart'; import 'package:chewie/chewie.dart';
import 'package:flutter/services.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/image_render.dart'; import 'package:flutter_html/image_render.dart';
import 'package:chewie/src/chewie_progress_colors.dart' as chewie; import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
@ -15,8 +16,9 @@ class WebContent extends StatefulWidget {
final Activity activity; final Activity activity;
final Article article; final Article article;
final Function exitFull;
WebContent(this.activity, this.article); WebContent(this.activity, this.article, this.exitFull);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -107,15 +109,7 @@ class _WebContent extends State<WebContent> {
Widget videoWidget(double width, double height, src, sandboxMode) { Widget videoWidget(double width, double height, src, sandboxMode) {
print("src : $src"); print("src : $src");
return MediaQuery( chewieAudioController = ChewieController(
data: MediaQuery.of(context).copyWith(
textScaleFactor: 0.9,
),
child: Container(
width: MediaQuery.of(context).size.width - 17,
height: (MediaQuery.of(context).size.width) / (width / height),
child: chewies = Chewie(
controller: chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController = videoPlayerController: videoPlayerController =
VideoPlayerController.network( VideoPlayerController.network(
src, src,
@ -126,6 +120,11 @@ class _WebContent extends State<WebContent> {
// //
looping: false, looping: false,
// //
allowFullScreen: true,
// systemOverlaysAfterFullScreen: [],
// systemOverlaysOnEnterFullScreen: [],
// deviceOrientationsAfterFullScreen: [],
// deviceOrientationsOnEnterFullScreen: [],
// //
materialProgressColors: chewie.ChewieProgressColors( materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white, playedColor: Colors.white,
@ -134,12 +133,35 @@ class _WebContent extends State<WebContent> {
bufferedColor: Colors.transparent, bufferedColor: Colors.transparent,
), ),
autoInitialize: true, autoInitialize: true,
);
chewieAudioController.addListener(_fullScreenListener);
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: 0.9,
), ),
child: Container(
width: MediaQuery.of(context).size.width - 17,
height: (MediaQuery.of(context).size.width) / (width / height),
child: chewies = Chewie(
controller: chewieAudioController,
), ),
), ),
); );
} }
Future<void> _fullScreenListener() async {
print("object: isPlaying: ${videoPlayerController.value.isPlaying}");
print("object: isFullScreen: ${chewieAudioController.isFullScreen}");
if (!chewieAudioController.isFullScreen) {
Future.delayed(Duration(seconds: 1), () {
widget.exitFull();
});
}
}
Widget audioWidget(showControls, loop, autoplay, src, width) { Widget audioWidget(showControls, loop, autoplay, src, width) {
return Container( return Container(
width: width, width: width,

Loading…
Cancel
Save