# Conflicts: # lib/pages/personal/clock_in/clock_in_page.dart # lib/ui/market/search/submit_order_page_normal.dartpull/1/head
commit
f6feb831db
After Width: | Height: | Size: 109 KiB |
@ -0,0 +1,79 @@
|
|||||||
|
import 'package:aku_new_community/gen/assets.gen.dart';
|
||||||
|
import 'package:aku_new_community/ui/market/integral/integral_sku_model.dart';
|
||||||
|
import 'package:aku_new_community/ui/market/search/good_detail_page.dart';
|
||||||
|
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class IntegralExchangePage extends StatefulWidget {
|
||||||
|
const IntegralExchangePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_IntegralExchangePageState createState() => _IntegralExchangePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _IntegralExchangePageState extends State<IntegralExchangePage> {
|
||||||
|
List<IntegralSkuModel> _models = IntegralSkuModel.examples;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeScaffold(
|
||||||
|
title: '积分商城',
|
||||||
|
body: SafeArea(
|
||||||
|
child: GridView.builder(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
|
||||||
|
itemCount: _models.length,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: 332 / 480,
|
||||||
|
mainAxisSpacing: 16.w,
|
||||||
|
crossAxisSpacing: 24.w),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return _card(_models[index]);
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _card(IntegralSkuModel model) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.to(() => GoodDetailPage(
|
||||||
|
goodId: model.goodId,
|
||||||
|
integral: model.integral,
|
||||||
|
integralGood: true,
|
||||||
|
));
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Color(0xFFF9F9F),
|
||||||
|
child: Image.network(model.imgPath, width: 332.w, height: 332.w)),
|
||||||
|
16.w.heightBox,
|
||||||
|
'${model.skuName}'
|
||||||
|
.text
|
||||||
|
.size(28.sp)
|
||||||
|
.maxLines(2)
|
||||||
|
.overflow(TextOverflow.ellipsis)
|
||||||
|
.color(Color(0xFF4F4F4F))
|
||||||
|
.make(),
|
||||||
|
16.w.heightBox,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Assets.icons.intergral.image(width: 24.w, height: 24.w),
|
||||||
|
4.w.widthBox,
|
||||||
|
'${model.integral}'.text.size(24.sp).color(Colors.red).make(),
|
||||||
|
Spacer(),
|
||||||
|
'已售${model.sold}份'
|
||||||
|
.text
|
||||||
|
.size(24.sp)
|
||||||
|
.color(Color(0xFFBDBDBD))
|
||||||
|
.make(),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,109 @@
|
|||||||
|
import 'package:aku_new_community/pages/tab_navigator.dart';
|
||||||
|
import 'package:aku_new_community/ui/profile/order/order_page.dart';
|
||||||
|
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
|
||||||
|
class ReceiveSuccess extends StatefulWidget {
|
||||||
|
final bool integralGood;
|
||||||
|
final int? integral;
|
||||||
|
|
||||||
|
const ReceiveSuccess({Key? key, this.integralGood = false, this.integral})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ReceiveSuccessState createState() => _ReceiveSuccessState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ReceiveSuccessState extends State<ReceiveSuccess> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BeeScaffold(
|
||||||
|
title: '订单结果',
|
||||||
|
body: SafeArea(
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 56.w,
|
||||||
|
height: 56.w,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(28.w),
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
colors: [Color(0xFFE52E2E), Color(0xFFF58123)],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
CupertinoIcons.check_mark,
|
||||||
|
size: 42.w,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
24.w.heightBox,
|
||||||
|
'收货成功'.text.size(32.sp).color(Colors.black).make(),
|
||||||
|
widget.integral != null
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
8.w.heightBox,
|
||||||
|
'已获得${widget.integral}积分'
|
||||||
|
.text
|
||||||
|
.size(28.sp)
|
||||||
|
.color(Colors.red)
|
||||||
|
.make(),
|
||||||
|
48.w.heightBox,
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Column(
|
||||||
|
children: [
|
||||||
|
8.w.heightBox,
|
||||||
|
'本单已享受积分兑换不予返还积分'
|
||||||
|
.text
|
||||||
|
.size(28.sp)
|
||||||
|
.color(Colors.black.withOpacity(0.25))
|
||||||
|
.make(),
|
||||||
|
32.w.heightBox,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
MaterialButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.offAll(() => TabNavigator());
|
||||||
|
},
|
||||||
|
color: Colors.white,
|
||||||
|
minWidth: 168.w,
|
||||||
|
height: 68.w,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(34.w),
|
||||||
|
side: BorderSide(color: Colors.red),
|
||||||
|
),
|
||||||
|
child: '返回首页'.text.size(28.sp).color(Colors.red).make(),
|
||||||
|
),
|
||||||
|
24.w.widthBox,
|
||||||
|
MaterialButton(
|
||||||
|
onPressed: () {
|
||||||
|
Get.off(() => OrderPage(initIndex: 3));
|
||||||
|
},
|
||||||
|
color: Colors.white,
|
||||||
|
minWidth: 168.w,
|
||||||
|
height: 68.w,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(34.w),
|
||||||
|
side: BorderSide(color: Colors.red),
|
||||||
|
),
|
||||||
|
child: '查看详情'.text.size(28.sp).color(Colors.red).make(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue