Browse Source

Merge branch 'remove_uniapp' into new_revision_app

# Conflicts:
#	lib/main_page.dart
#	lib/retrofit/retrofit_api.g.dart
#	lib/settlement/settlement.dart
#	lib/store/store_view/product_sku.dart
#	lib/view_widget/new_coupon_widget.dart
zyh
w-R 3 years ago
parent
commit
36de0e8d9b
  1. 65
      lib/home/home_view/featured_acticvity.dart
  2. 3
      lib/login/login_page.dart
  3. 2
      lib/main_page.dart
  4. 6
      lib/retrofit/data/settleOrderInfo.dart
  5. 3
      lib/retrofit/retrofit_api.dart
  6. 46
      lib/settlement/settlement.dart
  7. 4
      lib/store/store_order.dart
  8. 3
      lib/store/store_view/product_sku.dart
  9. 17
      lib/view_widget/new_coupon_widget.dart
  10. 12
      lib/view_widget/update_dialog.dart
  11. 2
      pubspec.yaml

65
lib/home/home_view/featured_acticvity.dart

@ -197,38 +197,43 @@ class _FeaturedActivity extends State<FeaturedActivity> {
], ],
), ),
), ),
Container( Row(
width: 48.w, children: [
margin: EdgeInsets.only(left: 8, bottom: 8), Container(
padding: EdgeInsets.symmetric( // width: 52.w,
vertical: 4.h, margin: EdgeInsets.only(left: 8, bottom: 8),
horizontal: 8.w, padding: EdgeInsets.symmetric(
), vertical: 4.h,
decoration: BoxDecoration( horizontal: 8.w,
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"了解",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
), ),
Icon( decoration: BoxDecoration(
Icons.keyboard_arrow_right, color: Color(0xFF32A060),
color: Colors.white, borderRadius: BorderRadius.circular(20),
size: 12,
), ),
], alignment: Alignment.center,
), child: Row(
), mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"了解",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 12,
),
],
),
),
Spacer()
],
)
], ],
)); ));
} }

3
lib/login/login_page.dart

@ -343,7 +343,8 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
EasyLoading.dismiss(); EasyLoading.dismiss();
} else { } else {
// SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center); if(value?.msg !=null)
SmartDialog.showToast("${value?.msg ??""}", alignment: Alignment.center);
} }
}); });
} }

2
lib/main_page.dart

@ -409,6 +409,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
bottomNavigationItem(S.of(context).main_menu1, 0), bottomNavigationItem(S.of(context).main_menu1, 0),
bottomNavigationItem(S.of(context).main_menu2, 1), bottomNavigationItem(S.of(context).main_menu2, 1),
bottomNavigationItem(S.of(context).main_menu3 , 2), bottomNavigationItem(S.of(context).main_menu3 , 2),
// bottomNavigationItem("订单", 2),
bottomNavigationItem(S.of(context).main_menu4, 3), bottomNavigationItem(S.of(context).main_menu4, 3),
], ],
), ),
@ -490,7 +491,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
); );
} }
// Widget bottomNavigationBigItem(text, index) { // Widget bottomNavigationBigItem(text, index) {
// var isSelected = index == clickIndex; // var isSelected = index == clickIndex;
// return Expanded( // return Expanded(

6
lib/retrofit/data/settleOrderInfo.dart

@ -16,6 +16,8 @@ class SettleOrderInfo {
String threshold; String threshold;
String freePostAge; String freePostAge;
List<OrderProductVOList> orderProductList; List<OrderProductVOList> orderProductList;
String promotionId;
String memberCouponId;
static SettleOrderInfo fromJson(Map<String, dynamic> map) { static SettleOrderInfo fromJson(Map<String, dynamic> map) {
if (map == null) return null; if (map == null) return null;
@ -40,6 +42,8 @@ class SettleOrderInfo {
settleOrderInfoBean.orderProductList = List()..addAll( settleOrderInfoBean.orderProductList = List()..addAll(
(map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o)) (map['orderProductList'] as List ?? []).map((o) => OrderProductVOList.fromJson(o))
); );
settleOrderInfoBean.promotionId = map['promotionId'];
settleOrderInfoBean.memberCouponId = map['memberCouponId'];
return settleOrderInfoBean; return settleOrderInfoBean;
} }
@ -58,6 +62,8 @@ class SettleOrderInfo {
"threshold": threshold, "threshold": threshold,
"freePostAge": freePostAge, "freePostAge": freePostAge,
"orderProductList": orderProductList, "orderProductList": orderProductList,
"promotionId": promotionId,
"memberCouponId": memberCouponId,
}; };
} }

3
lib/retrofit/retrofit_api.dart

@ -171,8 +171,7 @@ abstract class ApiService {
@Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo); @Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo);
/// ///
@GET( @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
"https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng, Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng,
@Path("keywords") String keywords, int size, int page); @Path("keywords") String keywords, int size, int page);

46
lib/settlement/settlement.dart

@ -172,9 +172,29 @@ class _Settlement extends State<Settlement> {
"buyNum": buyNum, "buyNum": buyNum,
"payChannel": payChannel "payChannel": payChannel
}).catchError((error) {}); }).catchError((error) {});
this.promotion = null;
promotions = "";
this.couponListBean = null;
coupons = "";
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
settleOrderInfo = baseData.data; settleOrderInfo = baseData.data;
if((settleOrderInfo?.promotionId??"")!=""){
settleOrderInfo.promotionInfoList.forEach((element) {
if(element.id == settleOrderInfo.promotionId){
this.promotion = element;
promotions = promotion?.name ?? "";
}
});
}
if((settleOrderInfo?.memberCouponId??"")!=""){
settleOrderInfo.couponList.forEach((element) {
if(element.id == settleOrderInfo.memberCouponId){
this.couponListBean = element;
coupons = couponListBean?.promotionName ?? "";
}
});
}
if (settleOrderInfo.orderProductList == null || if (settleOrderInfo.orderProductList == null ||
settleOrderInfo.orderProductList.length == 0) { settleOrderInfo.orderProductList.length == 0) {
placeOrder = true; placeOrder = true;
@ -668,8 +688,8 @@ class _Settlement extends State<Settlement> {
couponCart, couponCart,
activityCart, activityCart,
settleOrderInfo, settleOrderInfo,
payChannel == 4 ? null : coupons, coupons,
payChannel == 4 ? null : promotions, promotions,
couponCount(), couponCount(),
placeOrder, placeOrder,
remakers, remakers,
@ -778,9 +798,9 @@ class _Settlement extends State<Settlement> {
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
payChannel == 4 ? null : couponListBean?.id, couponListBean?.id,
0, 0,
payChannel == 4 ? null : promotion?.id, promotion?.id,
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",
@ -819,10 +839,10 @@ class _Settlement extends State<Settlement> {
}, },
); );
// if (couponBean != null) { // if (couponBean != null) {
this.couponListBean = couponBean; // this.couponListBean = couponBean;
coupons = couponListBean?.promotionName ?? ""; // coupons = couponListBean?.promotionName ?? "";
promotions = ""; // promotions = "";
this.promotion = null; // this.promotion = null;
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
@ -848,16 +868,16 @@ class _Settlement extends State<Settlement> {
}, },
); );
// if (pro != null) { // if (pro != null) {
this.promotion = pro; // this.promotion = pro;
promotions = promotion?.name ?? ""; // promotions = promotion?.name ?? "";
coupons = ""; // coupons = "";
this.couponListBean = null; // this.couponListBean = null;
queryOrderInfo( queryOrderInfo(
address?.id, address?.id,
selectedBtn, selectedBtn,
null, null,
0, 0,
promotion != null ? promotion.id : (productId ?? null), promotion != null ? pro.id : (productId ?? null),
productSkuId ?? "", productSkuId ?? "",
actProductId ?? "", actProductId ?? "",
actProductSkuId ?? "", actProductSkuId ?? "",

4
lib/store/store_order.dart

@ -599,9 +599,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
"tableId": tableId, "tableId": tableId,
"parentCode": parentCode, "parentCode": parentCode,
"parentId": parentId, "parentId": parentId,
"pName": pName, // "pName": pName,
"pid": pid, "pid": pid,
"cName": cName, // "cName": cName,
"cid": cid, "cid": cid,
"shoppingCart": shopCarGoods, "shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople, "numberOfPeople": numberOfPeople,

3
lib/store/store_view/product_sku.dart

@ -1,6 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart'; import 'package:huixiang/retrofit/data/miNiDetail.dart';
@ -139,7 +138,7 @@ class _ProductSku extends State<ProductSku> {
Padding( Padding(
padding: EdgeInsets.only(top: 4, bottom: 7), padding: EdgeInsets.only(top: 4, bottom: 7),
child: Text( child: Text(
": " + "已选: " +
(selectSkus.map((e) => "$e").toList().toString()), (selectSkus.map((e) => "$e").toList().toString()),
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,

17
lib/view_widget/new_coupon_widget.dart

@ -16,9 +16,20 @@ class NewCouponWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return homeCoupon(context); return buildCoupon(context);
} }
String getCouponStoreName(){
String couponStoreName = coupon.tenantName;
if(coupon?.storeList != null && coupon.storeId != "0"){
coupon.storeList.forEach((element) {
if(element.id == coupon.storeId)
couponStoreName = element.storeName;
});
}
return couponStoreName;
}
///ui ///ui
Widget buildCoupon(BuildContext context) { Widget buildCoupon(BuildContext context) {
// if(coupon != null) { // if(coupon != null) {
@ -246,9 +257,7 @@ class NewCouponWidget extends StatelessWidget {
width: 8.w, width: 8.w,
), ),
Expanded( Expanded(
child: Text( child: Text(getCouponStoreName(),
(coupon.storeId != "0" && coupon?.storeList != null && coupon.storeList.isNotEmpty && coupon.storeList.firstWhere((x) => x.id == coupon.storeId)!=null ?
coupon.storeList.firstWhere((x) => x.id == coupon.storeId).storeName : coupon.tenantName),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,

12
lib/view_widget/update_dialog.dart

@ -30,7 +30,7 @@ class _UpdateDialog extends State<UpdateDialog> {
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width - 80.w, width: MediaQuery.of(context).size.width - 80.w,
height: 180.h, height: 192.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -39,7 +39,7 @@ class _UpdateDialog extends State<UpdateDialog> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
height: 110.h, // height: 110.h,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(
@ -102,9 +102,7 @@ class _UpdateDialog extends State<UpdateDialog> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
(Theme.of(context).platform == TargetPlatform.android) ? updateApp();
androidUpdate():Bridge.toAppStore().then((value) {
});
// Navigator.of(context).pop(); // Navigator.of(context).pop();
}, },
child: Container( child: Container(
@ -139,8 +137,8 @@ class _UpdateDialog extends State<UpdateDialog> {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
androidUpdate() async { updateApp() async {
String url = "http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1"; String url = Platform.isIOS ? "itms-apps://itunes.apple.com/app/id1575124838":"http://application.lotus-wallet.com/huixaing?release_id=627cadff23389f2fe6d57cb1";
if (await canLaunch(url)) { if (await canLaunch(url)) {
await launch(url); await launch(url);
} else { } else {

2
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.1+2 version: 1.0.95+3
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save