Browse Source

更改购物车,搜索

zyh
w-R 3 years ago
parent
commit
84a0ed103f
  1. 127
      lib/mine/mine_view/mine_item.dart
  2. 2
      lib/order/bargain_group_order.dart
  3. 4
      lib/retrofit/min_api.dart
  4. 2
      lib/retrofit/min_api.g.dart
  5. 4
      lib/retrofit/retrofit_api.dart
  6. 2
      lib/retrofit/retrofit_api.g.dart
  7. 27
      lib/store/shopping/shopping_cart/shopping_cart_page.dart
  8. 52
      lib/store/shopping/shopping_home/search_page.dart
  9. 3
      lib/store/shopping/shopping_mall_home.dart

127
lib/mine/mine_view/mine_item.dart

@ -35,22 +35,6 @@ class _MineItem extends State<MineItem> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// InkWell(
// onTap: () {
// SharedPreferences.getInstance().then((value) {
// if (value.getString("token") == null ||
// value.getString("token") == "") {
// LoginTipsDialog().show(context);
// return;
// }
// Navigator.of(context).pushNamed('/router/mine_wallet');
// });
// },
// child: mineItem(
// S.of(context).wodeqianbao,
// "assets/image/icon_mine_wallet.webp",
// ),
// ),
Container( Container(
padding: EdgeInsets.only(left: 16,top:16,bottom:4), padding: EdgeInsets.only(left: 16,top:16,bottom:4),
child: Text( child: Text(
@ -85,6 +69,8 @@ class _MineItem extends State<MineItem> {
// ), // ),
// ), // ),
// ), // ),
///
Expanded(child: InkWell( Expanded(child: InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
@ -102,6 +88,7 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_mine_records_of_consumption.webp", "assets/image/icon_mine_records_of_consumption.webp",
), ),
),), ),),
///
Expanded(child: InkWell( Expanded(child: InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
@ -118,6 +105,7 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_mine_card.webp", "assets/image/icon_mine_card.webp",
), ),
),), ),),
///
Expanded(child: InkWell( Expanded(child: InkWell(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
@ -134,48 +122,66 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_location_address.webp", "assets/image/icon_location_address.webp",
), ),
),), ),),
Expanded(child:InkWell( ///
Expanded(child: InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); showCallMobile();
}, },
child: mineItem( child: mineItem(
S.of(context).tuiguangma, "联系客服",
"assets/image/icon_mine_promotion_code.webp", "assets/image/icon_mine_online_service.webp",
), ),
),), ),),
], ],
), ),
SizedBox(height: 10.h,),
Row( Row(
children: [ children: [
Expanded(child:InkWell( Expanded(child:
onTap: () { InkWell(
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); onTap: () {
}, Navigator.of(context)
child: mineItem( .pushNamed('/router/bargain_group_order',
"邀请记录", arguments: {"type":3});
"assets/image/yao_q.webp", },
), child: mineItem(
),), S.of(context).wodekanjia,
/// "assets/image/icon_mine_records_of_consumption.webp",
Expanded(child: InkWell( ),
onTap: () { ),),
showCallMobile(); Expanded(child: InkWell(
}, onTap: () {
child: mineItem( Navigator.of(context).pushNamed('/router/bargain_group_order',
"联系客服", arguments: {"type":1});
"assets/image/icon_mine_online_service.webp", },
), child: mineItem(
),), S.of(context).wodepintuan,
Expanded(child:Container()), "assets/image/kan_jia.webp",
Expanded(child:Container()) ),
], ),),
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
},
child: mineItem(
S.of(context).tuiguangma,
"assets/image/pin_tuan.webp",
),
),),
Expanded(child:InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {});
},
child: mineItem(
"邀请记录",
"assets/image/yao_q.webp",
),
),),
],
),
SizedBox(height: 10.h,),
],
), ),
// mineItem(
// S.of(context).bangzhuyufankui,
// "assets/image/icon_mine_feedback.webp",
// ),
],
),
); );
} }
@ -204,11 +210,6 @@ class _MineItem extends State<MineItem> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
// Icon(
// Icons.keyboard_arrow_right,
// size: 20,
// color: Colors.black,
// )
], ],
), ),
); );
@ -221,15 +222,15 @@ class _MineItem extends State<MineItem> {
return CupertinoActionSheet( return CupertinoActionSheet(
title: Text(S.of(context).bodadianhua), title: Text(S.of(context).bodadianhua),
actions: [ actions: [
CupertinoActionSheetAction( CupertinoActionSheetAction(
child: Text("15392949097"), child: Text("15392949097"),
onPressed: () { onPressed: () {
callMobile("15392949097"); callMobile("15392949097");
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
isDefaultAction: true, isDefaultAction: true,
isDestructiveAction: false, isDestructiveAction: false,
), ),
], ],
cancelButton: CupertinoActionSheetAction( cancelButton: CupertinoActionSheetAction(
onPressed: () { onPressed: () {

2
lib/order/bargain_group_order.dart

@ -212,7 +212,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
return Container( return Container(
child: SmartRefresher( child: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: false,
header: MyHeader(), header: MyHeader(),
footer: CustomFooter( footer: CustomFooter(
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {

4
lib/retrofit/min_api.dart

@ -39,8 +39,8 @@ part 'min_api.g.dart';
// 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.104:8765/app/";/// const base_url = "http://192.168.10.132:8765/app/";///
const baseUrl = "http://192.168.10.104:8765/app/";/// const baseUrl = "http://192.168.10.132:8765/app/";///
// const base_url = "http://192.168.10.37:8766/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 { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.104:8765/app/'; baseUrl ??= 'http://192.168.10.132:8765/app/';
} }
final Dio _dio; final Dio _dio;

4
lib/retrofit/retrofit_api.dart

@ -72,8 +72,8 @@ part 'retrofit_api.g.dart';
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.104:8766/app/";/// const base_url = "http://192.168.10.132:8766/app/";///
const baseUrl = "http://192.168.10.104:8766/app/";/// const baseUrl = "http://192.168.10.132:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.104:8766/app/'; baseUrl ??= 'http://192.168.10.132:8766/app/';
} }
final Dio _dio; final Dio _dio;

27
lib/store/shopping/shopping_cart/shopping_cart_page.dart

@ -314,6 +314,8 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
) )
: GestureDetector( : GestureDetector(
onTap: () { onTap: () {
if(isAllItemUnSelected())
return;
clearShopCar(); clearShopCar();
}, },
child: Container( child: Container(
@ -322,7 +324,7 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
height: 32.h, height: 32.h,
margin: EdgeInsets.only(left: 6.w), margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color:Color(0xFFFB312B), color:isAllItemUnSelected()?Color(0xFFE5E5E5):Color(0xFFFB312B),
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -351,6 +353,29 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
); );
} }
////
bool isAllItemUnSelected(){
bool unAllSelectedFlag = true;
bool allSelectedFlag = true;
if(shopCarGoods == null || shopCarGoods.length == 0){
setState(() {
isAllSelect = false;
});
return unAllSelectedFlag;
}
shopCarGoods[0]
.shoppingCartSkuItemList
.forEach((element) {
if(element.selected == 1)
unAllSelectedFlag = false;
else allSelectedFlag = false;
});
setState(() {
isAllSelect = allSelectedFlag;
});
return unAllSelectedFlag;
}
Widget cartGoodsList() { Widget cartGoodsList() {
return (shopCarGoods == null || shopCarGoods.length == 0) return (shopCarGoods == null || shopCarGoods.length == 0)
? NoDataView( ? NoDataView(

52
lib/store/shopping/shopping_home/search_page.dart

@ -99,7 +99,7 @@ class _SearchPage extends State<SearchPage>
strArr.removeAt(strArr.length - 1); strArr.removeAt(strArr.length - 1);
setState(() { setState(() {
historySearch.clear(); historySearch.clear();
historySearch.addAll(strArr); historySearch.addAll(strArr.reversed);
}); });
} }
@ -772,43 +772,35 @@ class _SearchPage extends State<SearchPage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Container(
child: Container( margin: EdgeInsets.only(top: 8, right: 8),
margin: EdgeInsets.only(top: 8, right: 8), padding: EdgeInsets.only(left: 2, right: 2),
padding: EdgeInsets.only(left: 2, right: 2), height: 18.h,
height: 17.h, alignment: Alignment.center,
alignment: Alignment.center, decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(2),
borderRadius: BorderRadius.circular(2), color: Color(0xFF5A5A5A),
color: Color(0xFF5A5A5A),
),
child: Text(
productListBeans.supplierName,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
), ),
),
Expanded(
child: Container(
child: Text( child: Text(
"已售${productListBeans?.sellCount ?? 0}", AppUtils.textSubStr( productListBeans.supplierName ?? "",8),
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 10.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF5D5D5D), color: Colors.white,
), ),
), ),
alignment: Alignment.topRight, ),
)), Text(
"已售${productListBeans?.sellCount ?? 0}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF5D5D5D),
),
),
], ],
), ),
Text( Text(

3
lib/store/shopping/shopping_mall_home.dart

@ -139,7 +139,8 @@ class _ShoppingMallHome extends State<ShoppingMallHome>
storeId, storeId,
tenant, tenant,
), ),
if (minToken != null && choiceIndex == 1) ShoppingCartPage( if (minToken != null && choiceIndex == 1)
ShoppingCartPage(
minToken, minToken,
storeId, storeId,
tenant, tenant,

Loading…
Cancel
Save