Browse Source

safety

master
fmk 3 years ago
parent
commit
8246ce77ba
  1. 16
      lib/community/community_details.dart
  2. 4
      lib/community/community_view/community_dynamic.dart
  3. 2
      lib/home/home_view/coupon.dart
  4. 36
      lib/home/home_view/featured_acticvity.dart
  5. 46
      lib/home/home_view/home_integral_store.dart
  6. 4
      lib/mine/mine_page.dart
  7. 12
      lib/order/order_detail_page.dart
  8. 6
      lib/order/order_history_page.dart
  9. 11
      lib/order/order_utils.dart
  10. 10
      lib/retrofit/min_api.dart
  11. 2
      lib/retrofit/min_api.g.dart
  12. 10
      lib/retrofit/retrofit_api.dart
  13. 6
      lib/retrofit/retrofit_api.g.dart
  14. 6
      lib/settlement/settlement.dart
  15. 16
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  16. 4
      lib/settlement/settlement_view/pay_method.dart
  17. 2
      lib/store/store_order.dart
  18. 34
      lib/store/store_view/shop_goods.dart
  19. 4
      lib/web/web_page.dart
  20. 2
      lib/web/web_view/comment_list.dart
  21. 100
      lib/web/web_view/web_content.dart

16
lib/community/community_details.dart

@ -197,7 +197,7 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
comunity.selfLike = !comunity.selfLike ?? false;
});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@ -210,7 +210,8 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
"relationalType": 1
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
commentKey.currentState.initState();
CommentListState state = commentKey.currentState;
state.queryMemberCommentList();
commentTextController.text = "";
FocusScope.of(context).unfocus();
_queryMemberCommentList();
@ -254,17 +255,18 @@ class _CommunityDetails extends State<CommunityDetails> with WidgetsBindingObser
}
///
_delCommentTips() {
_delCommentTips(memberComment) {
SmartDialog.show(widget: Tips(() {
delComment();
delComment(memberComment);
}));
}
///
delComment() async {
BaseData baseData = await apiService.delComment("");
delComment(memberComment) async {
BaseData baseData = await apiService.delComment(memberComment.id);
if (baseData != null && baseData.isSuccess) {
commentKey.currentState.initState();
CommentListState state = commentKey.currentState;
state.queryMemberCommentList();
}
}

4
lib/community/community_view/community_dynamic.dart

@ -120,7 +120,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
widget.exitFull();
SmartDialog.showToast("关注成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@ -131,7 +131,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
widget.exitFull();
SmartDialog.showToast("删除成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}

2
lib/home/home_view/coupon.dart

@ -59,7 +59,7 @@ class _CouponView extends State<CouponView> {
@override
Widget build(BuildContext context) {
return Column(
return (coupons == null || coupons.length == 0) ? Container(height: 20,) : Column(
children: [
SizedBox(
height: 20.h,

36
lib/home/home_view/featured_acticvity.dart

@ -69,7 +69,12 @@ class _FeaturedActivity extends State<FeaturedActivity> {
child: Row(
children: [
if (activityList != null && activityList.length > 0)
Container(
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[0].id});
},
child: Container(
child: stackItem(18.sp, activityList[0]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
@ -85,12 +90,18 @@ class _FeaturedActivity extends State<FeaturedActivity> {
),
),
),
),
if (activityList != null && activityList.length > 1)
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[1].id});
},
child: Container(
child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
@ -100,16 +111,22 @@ class _FeaturedActivity extends State<FeaturedActivity> {
color: Colors.green,
image: DecorationImage(
image: NetworkImage(
activityList[2].coverImg,
activityList[1].coverImg,
),
fit: BoxFit.cover,
),
),
),
),
SizedBox(
height: 5,
),
Container(
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[2].id});
},
child: Container(
child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
@ -124,7 +141,8 @@ class _FeaturedActivity extends State<FeaturedActivity> {
fit: BoxFit.cover,
),
),
)
),
),
],
),
),
@ -184,12 +202,6 @@ class _FeaturedActivity extends State<FeaturedActivity> {
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child:
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activity.id});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
@ -208,7 +220,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
size: 12,
),
],
)),
),
),
],
);

46
lib/home/home_view/home_integral_store.dart

@ -45,56 +45,12 @@ class _HomeIntegralStore extends State<HomeIntegralStore> {
),
child: Column(
children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Expanded(
// flex: 1,
// child: ItemTitle(
// text: S.of(context).jifenshangcheng,
// imgPath: "assets/image/icon_points_mall.png",
// ),
// ),
// GestureDetector(
// onTap: widget.callback,
// child: Container(
// padding: EdgeInsets.symmetric(
// vertical: 3.h,
// horizontal: 8.w,
// ),
// margin: EdgeInsets.only(right: 16.w),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(11.5),
// color: Color(0xFF32A060),
// ),
// child: Row(
// children: [
// Text(
// "GO",
// style: TextStyle(
// fontSize: 14.sp,
// fontWeight: FontWeight.bold,
// color: Colors.white,
// ),
// ),
// Icon(
// Icons.chevron_right,
// color: Colors.white,
// size: 18,
// ),
// ],
// ),
// ),
// ),
// ],
// ),
ItemTitle(
text: "大家都在兑换",
imgPath: "assets/image/icon_points_mall.png",
),
SizedBox(
height: 14.h,
height: 10.h,
),
Divider(
thickness: 1,

4
lib/mine/mine_page.dart

@ -331,7 +331,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
),
Text(
"(" + (infoNumber != null ?infoNumber.follow.toString() :"()") +")",
"(" + (infoNumber != null ?infoNumber.follow.toString() :"0") +")",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,
@ -351,7 +351,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
),
),
Text(
"(" + (infoNumber != null ?infoNumber.fans.toString() :"()") +")",
"(" + (infoNumber != null ?infoNumber.fans.toString() :"0") +")",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 15.sp,

12
lib/order/order_detail_page.dart

@ -115,7 +115,9 @@ class _OrderDetailPage extends State<OrderDetailPage> {
@override
Widget build(BuildContext context) {
return Stack(
return Container(
color: Colors.white,
child: Stack(
children: [
Positioned(
top: 0,
@ -193,6 +195,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
bottom: 0,
),
],
),
);
}
@ -208,10 +211,15 @@ class _OrderDetailPage extends State<OrderDetailPage> {
},
);
if (payChannel != null && payChannel > 0) {
OrderUtils.carryOnPay(payChannel, minService, orderInfo, queryDetails);
OrderUtils.carryOnPay(payChannel, minService, orderInfo, payResult);
}
}
payResult(BaseData baseData) {
queryDetails();
SmartDialog.showToast("订单支付成功");
}
statusTitle() {
if (isTakeOut == 0) {
if (payStatus == 0) {

6
lib/order/order_history_page.dart

@ -524,8 +524,12 @@ class _OrderHistoryList extends State<OrderHistoryList>
Future.delayed(Duration(seconds: 1), () {
_onRefresh();
});
});
},);
}
}
payResult(BaseData baseData) {
}
orderCancel(String orderId) async {

11
lib/order/order_utils.dart

@ -1,6 +1,3 @@
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
@ -8,7 +5,6 @@ import 'package:huixiang/retrofit/data/placeOrderFirst.dart';
import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
class OrderUtils {
@ -75,12 +71,7 @@ class OrderUtils {
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {});
// if (baseData != null && baseData.isSuccess) {
//
// } else {
queryDetails();
SmartDialog.show(widget: Tips((){}, text: "${baseData.msg}",));
// }
queryDetails(baseData);
}
}

10
lib/retrofit/min_api.dart

@ -21,14 +21,12 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
const base_url = "http://192.168.10.236:8765/app/";
const base_url = "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 baseUrl = "http://192.168.10.236:8765/app/";
///
// const base_url = "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 {
_MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8765/app/';
baseUrl ??= 'https://pos.api.lotus-wallet.com/app/';
}
final Dio _dio;

10
lib/retrofit/retrofit_api.dart

@ -40,11 +40,11 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "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://192.168.10.236:8766/app/"; ///
const baseUrl = "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 baseUrl = "http://192.168.10.37:8766/app/";
@ -343,7 +343,7 @@ abstract class ApiService {
Future<BaseData> commentLike(@Path("id") String id);
///
@GET("/memberComment/delete/{id}")
@DELETE("/memberComment/{id}")
Future<BaseData> delComment(@Path("id") String id);
///

6
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8766/app/';
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
}
final Dio _dio;
@ -1101,10 +1101,10 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/memberComment/delete/$id',
'/memberComment/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
method: 'DELETE',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),

6
lib/settlement/settlement.dart

@ -325,7 +325,9 @@ class _Settlement extends State<Settlement> {
@override
Widget build(BuildContext context) {
return Stack(
return Container(
color: Colors.white,
child: Stack(
children: [
Positioned(
top: 0,
@ -390,6 +392,7 @@ class _Settlement extends State<Settlement> {
coupons,
promotions,
couponCount(),
placeOrder,
),
if (placeOrder) ///
@ -457,6 +460,7 @@ class _Settlement extends State<Settlement> {
bottom: 0,
),
],
),
);
}

16
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -12,6 +12,7 @@ class ActivityCouponRemarks extends StatefulWidget {
final String promotions;
final SettleOrderInfo settleOrderInfo;
final int couponCount;
final bool placeOrder;
ActivityCouponRemarks(
this.couponCart,
@ -20,6 +21,7 @@ class ActivityCouponRemarks extends StatefulWidget {
this.coupons,
this.promotions,
this.couponCount,
this.placeOrder,
);
@override
@ -29,6 +31,7 @@ class ActivityCouponRemarks extends StatefulWidget {
}
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
@override
Widget build(BuildContext context) {
return Container(
@ -44,7 +47,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
borderRadius: BorderRadius.circular(8),
),
height: 122.h,
height: 122.h / (!widget.placeOrder ? 2 : 1),
margin: EdgeInsets.only(
left: 16,
right: 16,
@ -60,6 +63,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (widget.placeOrder)
InkWell(
onTap: () {
widget.activityCart();
@ -95,9 +99,11 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
),
),
if (widget.placeOrder)
SizedBox(
height: 13,
),
if (widget.placeOrder)
InkWell(
onTap: () {
widget.couponCart();
@ -133,10 +139,15 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
],
),
),
if (widget.placeOrder)
SizedBox(
height: 13,
),
Row(
InkWell(
onTap: () {
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@ -166,6 +177,7 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
),
],
),
),
],
),
);

4
lib/settlement/settlement_view/pay_method.dart

@ -84,7 +84,7 @@ class _PayMethod extends State<PayMethod> {
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(1),
Expanded(
@ -125,7 +125,7 @@ class _PayMethod extends State<PayMethod> {
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(2),
Expanded(

2
lib/store/store_order.dart

@ -710,7 +710,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
"productName": miNiDetail.productName,
"skuName": skuValue,
"storeId": storeInfo.id,
"skuPrice": productSku.applyPrice,
"skuPrice": productSku.skuPrice,
"skuStock": productSku.skuStock,
"tableId": tableId,
},

34
lib/store/store_view/shop_goods.dart

@ -81,9 +81,6 @@ class _ShopGoods extends State<ShopGoods> {
SizedBox(
height: 2,
),
///{"id":"1442420413828169728","productId":"1432652566000304128","productName":"桂花乌龙茶","skuName":null,"buyNum":1,"skuStock":1000,"skuImg":"https://pos.upload.gznl.top/1177/2021/08/f855ffb8-d473-4f5f-93c9-5907b539b2fd.jpg",
///"skuPrice":"0.00","selected":1,"storeId":null,"groupId":"1426067376096411648","createTime":"2021-10-20 10:27:46","tableId":null,"platterList":null}
Row(
children: [
Expanded(
@ -110,9 +107,6 @@ class _ShopGoods extends State<ShopGoods> {
),
Row(
children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
Row(
children: [
Text(
@ -136,31 +130,6 @@ class _ShopGoods extends State<ShopGoods> {
),
],
),
// Row(
// children: [
// Text(
// S.of(context).yuanjia,
// style: TextStyle(
// color: Color(0xFFA29E9E),
// fontSize: 9.sp,
// fontWeight: MyFontWeight.regular,
// ),
// ),
// SizedBox(
// width: 4,
// ),
// Text(
// "¥${widget.isShopCart ? widget.shoppingCartSkuItemListBean.skuPrice : widget.productListBean.price}",
// style: TextStyle(
// color: Color(0xFFA29E9E),
// fontSize: 10.sp,
// fontWeight: MyFontWeight.regular,
// ),
// ),
// ],
// ),
// ],
// ),
Spacer(),
if (!widget.isShopCart)
Stack(
@ -181,7 +150,8 @@ class _ShopGoods extends State<ShopGoods> {
widget.productListBean != null
? widget.productListBean.id
: widget.shoppingCartSkuItemListBean
.productId);
.productId,
);
},
),
),

4
lib/web/web_page.dart

@ -209,7 +209,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
}
commentKey.currentState.setState(() {});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@ -272,7 +272,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
CommentList(
commentKey,
article?.likes ?? activity?.likes ?? 0,
article?.id ?? activity?.id,
widget.arguments["activityId"] ?? widget.arguments["articleId"],
isKeyBoardShow,
_reply,
_delCommentTips,

2
lib/web/web_view/comment_list.dart

@ -233,7 +233,7 @@ class CommentListState extends State<CommentList> {
if (type == "huifu") {
widget.reply(memberComment);
} else if (type == "shanchu") {
widget.delCommentTips();
widget.delCommentTips(memberComment);
}
},
isSelf: userId == value.getString("userId"),

100
lib/web/web_view/web_content.dart

@ -53,58 +53,54 @@ class _WebContent extends State<WebContent> {
},
),
},
// customRender: {
// "video":
// (context, parsedChild) {
// var src = attributes['src'];
// parsedChild.toString()
// return videoWidget(
// double.tryParse(attributes['width'] ?? ""),
// double.tryParse(
// element.attributes['height'] ?? ""),
// (src != null &&
// src != "" &&
// src.endsWith(".mp4"))
// ? src
// : element
// .children.first.attributes["src"],
// element.attributes["sandbox"]);
// },
// "iframe":
// (context, parsedChild) {
// var src = attributes['src'];
// return videoWidget(
// double.tryParse(attributes['width'] ?? ""),
// double.tryParse(
// element.attributes['height'] ?? ""),
// (src != null &&
// src != "" &&
// src.endsWith(".mp4"))
// ? src
// : element
// .children.first.attributes["src"],
// element.attributes["sandbox"]);
// },
// "audio":
// (context, parsedChild) {
// final sources = <String>[
// if (element.attributes['src'] != null)
// element.attributes['src'],
// ];
// if (sources == null ||
// sources.isEmpty ||
// sources.first == null) {
// return EmptyContentElement();
// }
// return audioWidget(
// attributes['controls'] != null,
// attributes['loop'] != null,
// attributes['autoplay'] != null,
// sources,
// context.style.width ?? 300.w,
// );
// },
// },
customRender: {
"video":
(context, parsedChild) {
var src = context.tree.element.attributes["src"];
return videoWidget(
double.tryParse(context.tree.element.attributes["width"] ?? ""),
double.tryParse(
context.tree.element.attributes["height"] ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: context.tree.children.first.attributes["src"],
context.tree.attributes["sandbox"]);
},
"iframe":
(context, parsedChild) {
var src = context.tree.element.children.firstWhere((element) => element.localName == "source").attributes["src"];
return videoWidget(
double.tryParse(context.style.width ?? ""),
double.tryParse(context.style.height ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: context.tree.children.first.attributes["src"],
context.tree.attributes["sandbox"]);
},
"audio":
(context, parsedChild) {
final sources = <String>[
if (context.tree.attributes['src'] != null)
context.tree.attributes['src'],
];
if (sources == null ||
sources.isEmpty ||
sources.first == null) {
return EmptyContentElement();
}
return audioWidget(
context.tree.attributes['controls'] != null,
context.tree.attributes['loop'] != null,
context.tree.attributes['autoplay'] != null,
sources,
context.style.width ?? 300.w,
);
},
},
);
}

Loading…
Cancel
Save