Browse Source

商品选規格价格显示更改;

推荐刷新更改;
订单详情优惠显示更改;
优惠券选择更改;
动态图片規格显示更改;
ff_new
w-R 3 years ago
parent
commit
13f61ef139
  1. 11
      lib/community/community_child_page.dart
  2. 3
      lib/community/community_view/community_dynamic.dart
  3. 6
      lib/home/home_view/coupon.dart
  4. 6
      lib/home/home_view/featured_acticvity.dart
  5. 1
      lib/integral/integral_detailed_page.dart
  6. 8
      lib/settlement/settlement.dart
  7. 4
      lib/settlement/settlement_view/coupon.dart
  8. 2
      lib/settlement/settlement_view/settlement_coupon.dart
  9. 17
      lib/settlement/settlement_view/settlement_order_commodity.dart
  10. 16
      lib/store/store_view/product_sku.dart
  11. 2
      lib/store/store_view/shop_goods.dart
  12. 7
      lib/store/store_view/store_order_list.dart
  13. 4
      lib/view_widget/custom_image.dart
  14. 2
      lib/view_widget/text_image_dialog.dart

11
lib/community/community_child_page.dart

@ -27,8 +27,9 @@ class CommunityChildPage extends StatefulWidget {
class _CommunityChildPage extends State<CommunityChildPage> { class _CommunityChildPage extends State<CommunityChildPage> {
RefreshController refreshController = RefreshController(); RefreshController refreshController = RefreshController();
ApiService apiService; ApiService apiService;
int pageNum = 0; int pageNum = 1;
String userId; String userId;
bool isLoadMore = false;
List<Article> articles = []; List<Article> articles = [];
@ -39,7 +40,6 @@ class _CommunityChildPage extends State<CommunityChildPage> {
} }
_onRefresh() async { _onRefresh() async {
pageNum = 0;
setState(() {}); setState(() {});
} }
@ -54,7 +54,11 @@ class _CommunityChildPage extends State<CommunityChildPage> {
token: value.getString("token"), token: value.getString("token"),
); );
} }
pageNum += 1; if(isLoadMore){
pageNum += 1;
isLoadMore = false;
}
else pageNum = 1;
BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({ BaseData<PageInfo<ComunityComment>> baseData = await apiService.trendList({
"onlyFollow": widget.typeStr == "关注" ? true : false, "onlyFollow": widget.typeStr == "关注" ? true : false,
"onlyMe": false, "onlyMe": false,
@ -113,6 +117,7 @@ class _CommunityChildPage extends State<CommunityChildPage> {
), ),
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {
isLoadMore = true;
setState(() {}); setState(() {});
}, },
child: ListView.builder( child: ListView.builder(

3
lib/community/community_view/community_dynamic.dart

@ -368,10 +368,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
); );
}, },
child: MImage( child: MImage(
cnt["images"][0].replaceAll(".jpg", ".jpg?imageView2/0/q/75"), cnt["images"][0],
fit: BoxFit.contain, fit: BoxFit.contain,
radius: BorderRadius.circular(2), radius: BorderRadius.circular(2),
width: MediaQuery.of(context).size.width/1.5,
height:MediaQuery.of(context).size.width/1.5, height:MediaQuery.of(context).size.width/1.5,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",

6
lib/home/home_view/coupon.dart

@ -87,12 +87,12 @@ class _CouponView extends State<CouponView> {
Widget couponItem(Coupon coupon) { Widget couponItem(Coupon coupon) {
return Container( return Container(
width: 0.9.sw, width: 0.9,
height: 122.h, height: 122.h,
child: Stack( child: Stack(
children: [ children: [
Container( Container(
width: 0.9.sw, width: 0.9,
height: 122.h, height: 122.h,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/youhuiquan_bg.svg", "assets/svg/youhuiquan_bg.svg",
@ -102,7 +102,7 @@ class _CouponView extends State<CouponView> {
), ),
), ),
Container( Container(
width: 0.9.sw, width: 0.9,
height: 122.h, height: 122.h,
child: Row( child: Row(
children: [ children: [

6
lib/home/home_view/featured_acticvity.dart

@ -119,9 +119,9 @@ class _FeaturedActivity extends State<FeaturedActivity> {
), ),
), ),
), ),
SizedBox( // SizedBox(
height: 5, // height: 5,
), // ),
// GestureDetector( // GestureDetector(
// onTap: () { // onTap: () {
// Navigator.of(context).pushNamed('/router/web_page', // Navigator.of(context).pushNamed('/router/web_page',

1
lib/integral/integral_detailed_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/my_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';

8
lib/settlement/settlement.dart

@ -307,7 +307,9 @@ class _Settlement extends State<Settlement> {
} }
BaseData<WxPay> baseData = await minService BaseData<WxPay> baseData = await minService
.settlementWx(placeOrderFirst.toJson()) .settlementWx(placeOrderFirst.toJson())
.catchError((error) {}); .catchError((error) {
print(error);
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
WxPay wxPay = baseData.data; WxPay wxPay = baseData.data;
await registerWxApi( await registerWxApi(
@ -332,7 +334,9 @@ class _Settlement extends State<Settlement> {
} else { } else {
BaseData baseData = await minService BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson()) .settlementApi(placeOrderFirst.toJson())
.catchError((error) {}); .catchError((error) {
print(error);
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
toOrderDetails(placeOrderFirst.id); toOrderDetails(placeOrderFirst.id);
} else { } else {

4
lib/settlement/settlement_view/coupon.dart

@ -171,8 +171,8 @@ class _CouponWidget extends State<CouponWidget> {
}, },
child: Image.asset( child: Image.asset(
widget.selected widget.selected
? "assets/image/icon_radio_unselected.png" ? "assets/image/icon_radio_selected.png"
: "assets/image/icon_radio_selected.png", : "assets/image/icon_radio_unselected.png",
width: 24, width: 24,
height: 24, height: 24,
), ),

2
lib/settlement/settlement_view/settlement_coupon.dart

@ -115,7 +115,7 @@ class _SettlementCoupon extends State<SettlementCoupon> {
return CouponWidget( return CouponWidget(
couponCan[position], couponCan[position],
widget.storeInfo, widget.storeInfo,
selected: widget.couponBean == couponCan[position], selected: widget?.couponBean?.id == couponCan[position]?.id,
); );
}, },
), ),

17
lib/settlement/settlement_view/settlement_order_commodity.dart

@ -122,7 +122,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
children: [ children: [
MImage( MImage(
productList.skuImg, productList.skuImg,
width: 44.w, width: 44,
height: 44, height: 44,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
@ -342,10 +342,7 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
), ),
Container( Container(
child: Text( child: Text(
"已优惠:¥${(widget.minOrderInfo != null) ? (double.parse(widget.minOrderInfo.discountAmount ?? "0") + double.parse(widget.settleOrderInfo.benefitDiscountAmount ?? "0")) : "已优惠:¥${discountPrice()}",
(double.parse(widget.tableId <= 0 ? "0" : (widget.settleOrderInfo.discountAmount ?? "0"))
+ double.parse(widget?.settleOrderInfo?.benefitDiscountAmount ?? "0"))
}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF7B7B7B), color: Color(0xFF7B7B7B),
@ -384,6 +381,16 @@ class _SettlementOrderCommodity extends State<SettlementOrderCommodity> {
); );
} }
String discountPrice(){
if(widget.minOrderInfo != null){
return (widget.minOrderInfo.discountAmount ?? "0") + double.parse(widget.settleOrderInfo.benefitDiscountAmount ?? "0");
}else if(widget.tableId < 0){
return "0";
}else {
return widget?.settleOrderInfo?.discountAmount ?? "0";
}
}
String totalPrice() { String totalPrice() {
if (widget.minOrderInfo != null && if (widget.minOrderInfo != null &&
widget.minOrderInfo.orderProductVOList != null) { widget.minOrderInfo.orderProductVOList != null) {

16
lib/store/store_view/product_sku.dart

@ -34,8 +34,8 @@ class ProductSku extends StatefulWidget {
class _ProductSku extends State<ProductSku> { class _ProductSku extends State<ProductSku> {
List<String> selectSkus = []; List<String> selectSkus = [];
int count = 1; int count = 1;
String selectedPrice = "";
@override @override
void initState() { void initState() {
@ -59,6 +59,7 @@ class _ProductSku extends State<ProductSku> {
return; return;
} }
if (productSku == null) return; if (productSku == null) return;
selectedPrice = productSku.skuPrice;
String skuId = productSku.id; String skuId = productSku.id;
if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return; if (widget.shopCarGoods == null || widget.shopCarGoods.shoppingCartSkuItemList == null) return;
int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id); int shopSkuIndex = widget.shopCarGoods.shoppingCartSkuItemList.indexWhere((element) => skuId == element.id);
@ -98,6 +99,7 @@ class _ProductSku extends State<ProductSku> {
height: MediaQuery.of(context).size.height / 3 * 2, height: MediaQuery.of(context).size.height / 3 * 2,
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
// color: Color(0xFFFAFAFA),
color: Color(0xFFFAFAFA), color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(8), topLeft: Radius.circular(8),
@ -123,7 +125,7 @@ class _ProductSku extends State<ProductSku> {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Expanded(child: Column( Expanded(child:Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
@ -159,7 +161,7 @@ class _ProductSku extends State<ProductSku> {
), ),
), ),
Text( Text(
widget.miNiDetail.price, selectedPrice,
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 14.sp, fontSize: 14.sp,
@ -169,9 +171,7 @@ class _ProductSku extends State<ProductSku> {
], ],
), ),
], ],
)) )),
,
Spacer(),
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
@ -352,12 +352,12 @@ class _ProductSku extends State<ProductSku> {
Widget sweetnessItem(String name, bool isCheck) { Widget sweetnessItem(String name, bool isCheck) {
return Container( return Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 70.w, width: 70.w,
height: 29.h, height:30.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060), color: !isCheck ? Color(0xFFE5E5E5) : Color(0xFF32A060),

2
lib/store/store_view/shop_goods.dart

@ -198,7 +198,7 @@ class _ShopGoods extends State<ShopGoods> {
), ),
), ),
if (widget.isShopCart || (widget.productListBean?.attrStyle??0) == 0) if (widget.isShopCart || (widget.productListBean?.attrStyle??0) == 0)
InkWell( GestureDetector(
onTap: () { onTap: () {
widget.add(widget.shoppingCartSkuItemListBean); widget.add(widget.shoppingCartSkuItemListBean);
}, },

7
lib/store/store_view/store_order_list.dart

@ -230,11 +230,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
} }
}); });
} }
return InkWell( return ShopGoods(
onTap: () {
widget.queryMiNiDetail(productListBeans[position].id,1);
},
child: ShopGoods(
(ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) { (ShoppingCartSkuItemListBean shoppingCartSkuItemListBean) {
widget.queryMiNiDetail(productListBeans[position].id,1); widget.queryMiNiDetail(productListBeans[position].id,1);
}, },
@ -247,7 +243,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
isShopCart: false, isShopCart: false,
queryMiNiDetail: widget.queryMiNiDetail, queryMiNiDetail: widget.queryMiNiDetail,
shoppingCartSkuItemListBean: shoppingCartSkuItemListBean, shoppingCartSkuItemListBean: shoppingCartSkuItemListBean,
),
); );
} }
} }

4
lib/view_widget/custom_image.dart

@ -43,8 +43,8 @@ class MImage extends StatelessWidget {
// } // }
/// ///
if (src != "" && src.startsWith("http")) { if ((src??"").startsWith("http")) {
imageUrl = "$src?imageView2/1/w/${(constraints.constrainWidth() * scaleIndex).toInt()}/h/${(constraints.constrainHeight() * scaleIndex).toInt()}/format/jpg/q/75"; imageUrl = "$src?imageView2/1/format/jpg/q/50";
} }
// print("imageUrl:$imageUrl"); // print("imageUrl:$imageUrl");

2
lib/view_widget/text_image_dialog.dart

@ -38,7 +38,7 @@ class _TextImageWidget extends State<TextImageWidget> {
child: Center( child: Center(
child: Container( child: Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:16.w), margin: EdgeInsets.symmetric(horizontal:26.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

Loading…
Cancel
Save