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(
crossAxisAlignment: CrossAxisAlignment.start,
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(
padding: EdgeInsets.only(left: 16,top:16,bottom:4),
child: Text(
@ -85,6 +69,8 @@ class _MineItem extends State<MineItem> {
// ),
// ),
// ),
///
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
@ -102,6 +88,7 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_mine_records_of_consumption.webp",
),
),),
///
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
@ -118,6 +105,7 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_mine_card.webp",
),
),),
///
Expanded(child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
@ -134,48 +122,66 @@ class _MineItem extends State<MineItem> {
"assets/image/icon_location_address.webp",
),
),),
Expanded(child:InkWell(
///
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
showCallMobile();
},
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(
children: [
Expanded(child:InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {});
},
child: mineItem(
"邀请记录",
"assets/image/yao_q.webp",
),
),),
///
Expanded(child: InkWell(
onTap: () {
showCallMobile();
},
child: mineItem(
"联系客服",
"assets/image/icon_mine_online_service.webp",
),
),),
Expanded(child:Container()),
Expanded(child:Container())
],
children: [
Expanded(child:
InkWell(
onTap: () {
Navigator.of(context)
.pushNamed('/router/bargain_group_order',
arguments: {"type":3});
},
child: mineItem(
S.of(context).wodekanjia,
"assets/image/icon_mine_records_of_consumption.webp",
),
),),
Expanded(child: InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/bargain_group_order',
arguments: {"type":1});
},
child: mineItem(
S.of(context).wodepintuan,
"assets/image/kan_jia.webp",
),
),),
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),
),
),
// Icon(
// Icons.keyboard_arrow_right,
// size: 20,
// color: Colors.black,
// )
],
),
);
@ -221,15 +222,15 @@ class _MineItem extends State<MineItem> {
return CupertinoActionSheet(
title: Text(S.of(context).bodadianhua),
actions: [
CupertinoActionSheetAction(
child: Text("15392949097"),
onPressed: () {
callMobile("15392949097");
Navigator.of(context).pop();
},
isDefaultAction: true,
isDestructiveAction: false,
),
CupertinoActionSheetAction(
child: Text("15392949097"),
onPressed: () {
callMobile("15392949097");
Navigator.of(context).pop();
},
isDefaultAction: true,
isDestructiveAction: false,
),
],
cancelButton: CupertinoActionSheetAction(
onPressed: () {

2
lib/order/bargain_group_order.dart

@ -212,7 +212,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
return Container(
child: SmartRefresher(
enablePullDown: true,
enablePullUp: true,
enablePullUp: false,
header: MyHeader(),
footer: CustomFooter(
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 base_url = "http://192.168.10.104:8765/app/";///
const baseUrl = "http://192.168.10.104:8765/app/";///
const base_url = "http://192.168.10.132:8765/app/";///
const baseUrl = "http://192.168.10.132: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.104:8765/app/';
baseUrl ??= 'http://192.168.10.132:8765/app/';
}
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 base_url = "http://192.168.10.104:8766/app/";///
const baseUrl = "http://192.168.10.104:8766/app/";///
const base_url = "http://192.168.10.132:8766/app/";///
const baseUrl = "http://192.168.10.132:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
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.104:8766/app/';
baseUrl ??= 'http://192.168.10.132:8766/app/';
}
final Dio _dio;

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

@ -314,6 +314,8 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
)
: GestureDetector(
onTap: () {
if(isAllItemUnSelected())
return;
clearShopCar();
},
child: Container(
@ -322,7 +324,7 @@ class _ShoppingCartPage extends State<ShoppingCartPage>
height: 32.h,
margin: EdgeInsets.only(left: 6.w),
decoration: BoxDecoration(
color:Color(0xFFFB312B),
color:isAllItemUnSelected()?Color(0xFFE5E5E5):Color(0xFFFB312B),
borderRadius: BorderRadius.circular(16),
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() {
return (shopCarGoods == null || shopCarGoods.length == 0)
? NoDataView(

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

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

3
lib/store/shopping/shopping_mall_home.dart

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

Loading…
Cancel
Save