|
|
@@ -2,6 +2,7 @@ import 'dart:convert';
|
|
|
import 'dart:io';
|
|
|
import 'dart:math' as math;
|
|
|
|
|
|
+import 'package:amap_flutter_base/amap_flutter_base.dart';
|
|
|
import 'package:bbyyy/beans/ad_bean_entity.dart';
|
|
|
import 'package:bbyyy/beans/android_app_version_bean_entity.dart';
|
|
|
import 'package:bbyyy/beans/flow_bean_entity.dart';
|
|
|
@@ -20,6 +21,7 @@ import 'package:bbyyy/my_tools/global.dart';
|
|
|
import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
import 'package:bbyyy/my_tools/my_tools.dart';
|
|
|
+import 'package:bbyyy/my_tools/providers.dart';
|
|
|
import 'package:bbyyy/my_tools/role_permissions.dart';
|
|
|
import 'package:bbyyy/paegs/gang_page/application_details_page/application_details_page.dart';
|
|
|
import 'package:bbyyy/paegs/gang_page/gang_in_page/gang_in_page.dart';
|
|
|
@@ -39,12 +41,14 @@ import 'package:install_plugin/install_plugin.dart';
|
|
|
import 'package:launch_review/launch_review.dart';
|
|
|
import 'package:lpinyin/lpinyin.dart';
|
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
+import 'package:provider/provider.dart';
|
|
|
|
|
|
import '../beans/complain_bean_entity.dart';
|
|
|
import '../paegs/ad_details_page/ad_details_page.dart';
|
|
|
import '../paegs/other_people_s_turnover_page/other_people_s_turnover_page.dart';
|
|
|
import 'const.dart';
|
|
|
import 'dims.dart';
|
|
|
+import 'map_util.dart';
|
|
|
|
|
|
class MyViews {
|
|
|
Widget netImg(String path, double h, double w,
|
|
|
@@ -317,8 +321,8 @@ class MyViews {
|
|
|
}
|
|
|
|
|
|
//我的订单、店铺订单item
|
|
|
- Widget getNoPayGoodsItem(
|
|
|
- SmartOrderBeanDataData data, BuildContext context, int ownerUid,int role) {
|
|
|
+ Widget getNoPayGoodsItem(SmartOrderBeanDataData data, BuildContext context,
|
|
|
+ int ownerUid, int role) {
|
|
|
return Container(
|
|
|
margin: EdgeInsets.only(bottom: 10),
|
|
|
decoration: BoxDecoration(
|
|
|
@@ -621,7 +625,9 @@ class MyViews {
|
|
|
Row(
|
|
|
children: [
|
|
|
Text(
|
|
|
- flow.traderUid == 0 ? "" : 'ID:${hideUID(flow.traderUid.toString())}',
|
|
|
+ flow.traderUid == 0
|
|
|
+ ? ""
|
|
|
+ : 'ID:${hideUID(flow.traderUid.toString())}',
|
|
|
style:
|
|
|
TextStyle(color: MyColors.c666666, fontSize: 12),
|
|
|
),
|
|
|
@@ -760,7 +766,8 @@ class MyViews {
|
|
|
GestureDetector(
|
|
|
onTap: () {
|
|
|
MyTools().toPage(
|
|
|
- context, ReleaseGoodsPage(data,''), (then) {
|
|
|
+ context, ReleaseGoodsPage(data, ''),
|
|
|
+ (then) {
|
|
|
EventBus().emit('updateProduct');
|
|
|
});
|
|
|
},
|
|
|
@@ -1461,12 +1468,11 @@ class MyViews {
|
|
|
visible: data.role != shopUserMember,
|
|
|
child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- color: MyColors.cFFCD00,
|
|
|
+ color: MyColors.cFFCD00,
|
|
|
borderRadius: BorderRadius.circular(8)),
|
|
|
height: 16,
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
|
- child: myText(roleText(data.role),
|
|
|
- Colors.white, 10),
|
|
|
+ child: myText(roleText(data.role), Colors.white, 10),
|
|
|
alignment: Alignment.center,
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
),
|
|
|
@@ -1878,19 +1884,22 @@ class MyViews {
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
- }else if (data.type == orderTypeScancodeAilyPay) {
|
|
|
+ } else if (data.type == orderTypeScancodeAilyPay) {
|
|
|
//扫码收款
|
|
|
return Container(
|
|
|
margin: EdgeInsets.only(left: 10, right: 10),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
Container(
|
|
|
- child: Icon(Icons.qr_code_outlined,color: Colors.white,),
|
|
|
+ child: Icon(
|
|
|
+ Icons.qr_code_outlined,
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
margin: EdgeInsets.only(right: 8),
|
|
|
height: 60,
|
|
|
width: 60,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: MyColors.cFF4233,
|
|
|
+ color: MyColors.cFF4233,
|
|
|
border: Border.all(color: MyColors.cEBEBEB, width: 1)),
|
|
|
alignment: Alignment.center,
|
|
|
),
|
|
|
@@ -1909,8 +1918,7 @@ class MyViews {
|
|
|
),
|
|
|
Text(
|
|
|
'¥${double.parse('${data.amount}').toStringAsFixed(2)}',
|
|
|
- style:
|
|
|
- TextStyle(color: MyColors.cFF4233, fontSize: 12),
|
|
|
+ style: TextStyle(color: MyColors.cFF4233, fontSize: 12),
|
|
|
),
|
|
|
],
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
@@ -1921,8 +1929,7 @@ class MyViews {
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
- }
|
|
|
- else if (data.type == orderTypeOfflineTransfer ||
|
|
|
+ } else if (data.type == orderTypeOfflineTransfer ||
|
|
|
data.type == orderTypeOfflinePay) {
|
|
|
//线下付款
|
|
|
return Container(
|
|
|
@@ -2167,14 +2174,16 @@ class MyViews {
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- boxShadow: [BoxShadow(
|
|
|
- color: MyColors.c7FE1E1E1,
|
|
|
- blurRadius: 5.0,
|
|
|
- ),],
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: MyColors.c7FE1E1E1,
|
|
|
+ blurRadius: 5.0,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
color: Colors.white,
|
|
|
borderRadius: BorderRadius.circular(4),
|
|
|
),
|
|
|
- margin: EdgeInsets.only(bottom: 6.5,left: 16,right: 16,top: 6.5),
|
|
|
+ margin: EdgeInsets.only(bottom: 6.5, left: 16, right: 16, top: 6.5),
|
|
|
child: Padding(
|
|
|
padding: const EdgeInsets.all(10),
|
|
|
child: Row(
|
|
|
@@ -2190,33 +2199,59 @@ class MyViews {
|
|
|
margin: EdgeInsets.only(left: 10),
|
|
|
child: Column(
|
|
|
children: [
|
|
|
- myText('${data.name}(${data.uid})', MyColors.c333333,
|
|
|
- 14),
|
|
|
+ myText(
|
|
|
+ '${data.name}(${data.uid})', MyColors.c333333, 14),
|
|
|
Text(
|
|
|
'货帮介绍:${data.introduction}',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c666666, fontSize: 11),
|
|
|
+ style:
|
|
|
+ TextStyle(color: MyColors.c666666, fontSize: 11),
|
|
|
maxLines: 1,
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
softWrap: true,
|
|
|
),
|
|
|
Row(
|
|
|
children: [
|
|
|
- Icon(
|
|
|
- Icons.location_on_outlined,
|
|
|
- size: 15,
|
|
|
- color: MyColors.c666666,
|
|
|
- ),
|
|
|
Expanded(
|
|
|
- child: Text(
|
|
|
- '${data.address}',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.c666666, fontSize: 10),
|
|
|
- maxLines: 1,
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- softWrap: true,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ if (data.latitude == 0) {
|
|
|
+ showToast('该店坐标有误');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ mapNavigationPopup(
|
|
|
+ data.latitude, data.longitude, context);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Icon(
|
|
|
+ Icons.location_on_outlined,
|
|
|
+ size: 15,
|
|
|
+ color: MyColors.c666666,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ '${data.address}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c666666,
|
|
|
+ fontSize: 10),
|
|
|
+ maxLines: 1,
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ softWrap: true,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
+ if (data.longitude != 0 &&
|
|
|
+ context.watch<MyLocationProvider>().myLatLng !=
|
|
|
+ null)
|
|
|
+ Text(
|
|
|
+ '${(AMapTools.distanceBetween(LatLng(data.latitude, data.longitude), LatLng(MyCookie().location.latitude, MyCookie().location.longitude)) / 1000).toStringAsFixed(3)}km',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 10, color: MyColors.c666666),
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
],
|
|
|
@@ -2237,13 +2272,17 @@ class MyViews {
|
|
|
},
|
|
|
behavior: HitTestBehavior.translucent,
|
|
|
child: Container(
|
|
|
- margin: EdgeInsets.only(bottom: 6.5,left: 16,right: 16,top: 6.5),
|
|
|
- decoration: BoxDecoration(boxShadow: [BoxShadow(
|
|
|
- color: MyColors.c7FE1E1E1,
|
|
|
- blurRadius: 5.0,
|
|
|
- ),],
|
|
|
+ margin: EdgeInsets.only(bottom: 6.5, left: 16, right: 16, top: 6.5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ boxShadow: [
|
|
|
+ BoxShadow(
|
|
|
+ color: MyColors.c7FE1E1E1,
|
|
|
+ blurRadius: 5.0,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
color: Colors.white,
|
|
|
- borderRadius: BorderRadius.circular(4),),
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
+ ),
|
|
|
child: Padding(
|
|
|
padding: const EdgeInsets.only(top: 10, bottom: 10, left: 10),
|
|
|
child: Row(
|
|
|
@@ -2317,6 +2356,145 @@ class MyViews {
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ void mapNavigationPopup(
|
|
|
+ double latitude,
|
|
|
+ double longitude,
|
|
|
+ BuildContext context,
|
|
|
+ ) {
|
|
|
+ showModalBottomSheet(
|
|
|
+ isScrollControlled: true,
|
|
|
+ shape: RoundedRectangleBorder(
|
|
|
+ //圆角
|
|
|
+ borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
|
|
|
+ ),
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return AnimatedPadding(
|
|
|
+ //showModalBottomSheet 键盘弹出时自适应
|
|
|
+ padding: MediaQuery.of(context).viewInsets, //边距(必要)
|
|
|
+ duration: const Duration(milliseconds: 100), //时常 (必要)
|
|
|
+ child: Container(
|
|
|
+ // height: 180,
|
|
|
+ constraints: BoxConstraints(
|
|
|
+ minHeight: 90, //设置最小高度(必要)
|
|
|
+ maxHeight:
|
|
|
+ MediaQuery.of(context).size.height / 1.5, //设置最大高度(必要)
|
|
|
+ ),
|
|
|
+ padding: EdgeInsets.only(top: 20, bottom: 20),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
|
|
|
+ color: Colors.white), //圆角
|
|
|
+ child: ListView(
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
+ shrinkWrap: true,
|
|
|
+ children: <Widget>[
|
|
|
+ Column(
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ MapUtil.gotoAMap(longitude, latitude);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 50,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '高德地图',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 16),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: Colors.grey[200],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ MapUtil.gotoBaiduMap(longitude, latitude);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 50,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '百度地图',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 16),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: Colors.grey[200],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ MapUtil.gotoTencentMap(longitude, latitude);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 50,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '腾讯地图',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 16),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: Colors.grey[200],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ if (Platform.isIOS)
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ MapUtil.gotoAppleMap(longitude, latitude);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 50,
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '苹果地图',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333, fontSize: 16),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: Colors.grey[200],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ context: context);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Widget noData() {
|