Browse Source

Merge remote-tracking branch 'origin/remove_uniapp' into remove_uniapp

remove_uniapp
fmk 3 years ago
parent
commit
e27e403779
  1. 65
      lib/home/home_view/featured_acticvity.dart
  2. 3
      lib/login/login_page.dart
  3. 4
      lib/main_page.dart
  4. 6
      lib/retrofit/data/settleOrderInfo.dart
  5. 4
      lib/retrofit/min_api.dart
  6. 5
      lib/retrofit/retrofit_api.dart
  7. 2
      lib/retrofit/retrofit_api.g.dart
  8. 60
      lib/settlement/settlement.dart
  9. 4
      lib/store/store_order.dart
  10. 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);
} }
}); });
} }

4
lib/main_page.dart

@ -337,8 +337,8 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
PackageInfo packageInfo = await PackageInfo.fromPlatform(); PackageInfo packageInfo = await PackageInfo.fromPlatform();
BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {}); BaseData<AppUpdate> baseData = await apiService.appVersion().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
baseData.data.appLastVersion = "1.0.5"; // baseData.data.appLastVersion = "1.0.95";
baseData.data.appLastVersionUp = "1.0.1"; // baseData.data.appLastVersionUp = "1.0.95";
if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion) if(AppUtils.versionCompare(packageInfo.version,baseData.data?.appLastVersion)
&& AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){ && AppUtils.versionCompare(value.getString("appLastVersion")??"1.0.0",baseData.data?.appLastVersion)){
showDialog( showDialog(

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,
}; };
} }

4
lib/retrofit/min_api.dart

@ -32,7 +32,7 @@ part 'min_api.g.dart';
// const base_url = "http://192.168.10.37:8765/app/"; // const base_url = "http://192.168.10.37:8765/app/";
const localBaseUrl = "http://192.168.10.236:8766/app/";/// const localBaseUrl = "http://192.168.10.236:8765/app/";///
const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线
@ -102,7 +102,7 @@ abstract class MinApiService {
} }
} else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) {
///poi服务请求不需要toast ///poi服务请求不需要toast
SmartDialog.showToast(map["msg"], alignment: Alignment.center); // SmartDialog.showToast(map["msg"], alignment: Alignment.center);
} }
debugPrint( debugPrint(
"======================= Min_响应数据结束 =======================\n"); "======================= Min_响应数据结束 =======================\n");

5
lib/retrofit/retrofit_api.dart

@ -130,7 +130,7 @@ abstract class ApiService {
} }
} else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) {
///poi服务请求不需要toast ///poi服务请求不需要toast
SmartDialog.showToast(map["msg"], alignment: Alignment.center); // SmartDialog.showToast(map["msg"], alignment: Alignment.center);
} }
debugPrint("======================= 响应数据结束 =======================\n"); debugPrint("======================= 响应数据结束 =======================\n");
}, onError: (DioError e) { }, onError: (DioError e) {
@ -170,8 +170,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);

2
lib/retrofit/retrofit_api.g.dart

@ -92,7 +92,7 @@ class _ApiService implements ApiService {
data: _data); data: _data);
final value = BaseData<LoginInfo>.fromJson( final value = BaseData<LoginInfo>.fromJson(
_result.data, _result.data,
(json) => LoginInfo.fromJson(json), (json) => json==""?null :LoginInfo.fromJson(json),
); );
return value; return value;
} }

60
lib/settlement/settlement.dart

@ -89,7 +89,7 @@ class _Settlement extends State<Settlement> {
tenant: tenant, tenant: tenant,
storeId: storeId, storeId: storeId,
showLoading: true); showLoading: true);
if (promotions != null && promotions != "" || tableId <= 0) { if (promotions != null && promotions != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
selectedBtn, selectedBtn,
@ -98,7 +98,7 @@ class _Settlement extends State<Settlement> {
widget.arguments["pid"], widget.arguments["pid"],
payChannel payChannel
); );
} else if (coupons != null && coupons != "" || tableId <= 0) { } else if (coupons != null && coupons != "" && tableId <= 0) {
queryOrderInfo( queryOrderInfo(
address != null ? address.id : null, address != null ? address.id : null,
selectedBtn, selectedBtn,
@ -134,9 +134,29 @@ class _Settlement extends State<Settlement> {
"promotionId": promotionId, "promotionId": promotionId,
"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;
@ -468,8 +488,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,
@ -562,9 +582,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,
payChannel payChannel
); );
} }
@ -599,20 +619,20 @@ class _Settlement extends State<Settlement> {
couponBean: couponListBean); couponBean: couponListBean);
}, },
); );
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,
couponListBean?.id, couponBean?.id,
0, 0,
null, null,
payChannel payChannel
); );
} // }
} }
/// ///
@ -625,19 +645,19 @@ class _Settlement extends State<Settlement> {
return SettlementActivity(settleOrderInfo, storeInfo); return SettlementActivity(settleOrderInfo, storeInfo);
}, },
); );
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?.id, pro?.id,
payChannel payChannel
); );
} // }
} }
} }

4
lib/store/store_order.dart

@ -566,9 +566,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,

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.94+3
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save