Browse Source

更改

null_safety
w-R 4 years ago
parent
commit
da0f797184
  1. 11
      lib/home/huixiang_brand_page.dart
  2. 96
      lib/mine/vip_detail_page.dart

11
lib/home/huixiang_brand_page.dart

@ -22,6 +22,7 @@ import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:huixiang/view_widget/store_title_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
class BrandPage extends StatefulWidget { class BrandPage extends StatefulWidget {
@override @override
@ -76,9 +77,11 @@ class _BrandPage extends State<BrandPage>
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString('token')), context: context, token: value.getString('token')),
queryHome(), queryHome(),
if(value.getBool("isFristLogin")){ if(value.getBool("isFristLogin") == null){
value.setBool("isFristLogin",true),
showAlertDialog(), showAlertDialog(),
}}); }
});
eventBus.on<EventType>().listen((event) { eventBus.on<EventType>().listen((event) {
print("object: BrandPage"); print("object: BrandPage");
@ -607,7 +610,9 @@ class _BrandPage extends State<BrandPage>
textColor: Colors.white, textColor: Colors.white,
fontSize: 12, fontSize: 12,
callback: () { callback: () {
Navigator.of(context).pop(); SharesdkPlugin.uploadPrivacyPermissionStatus(1, (success) => {
Navigator.of(context).pop(),
});
}, },
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 10.h, top: 10.h,

96
lib/mine/vip_detail_page.dart

@ -163,10 +163,10 @@ class _VipDetailPage extends State<VipDetailPage> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: shopItem(), child: shopItem(orderInfos[position]),
); );
}, },
// itemCount: orderInfos != null ? orderInfos.length : 0, itemCount: orderInfos != null ? orderInfos.length : 0,
), ),
), ),
), ),
@ -284,7 +284,7 @@ class _VipDetailPage extends State<VipDetailPage> {
children: [ children: [
TextSpan( TextSpan(
text: text:
"¥${vipCard != null ? vipCard.balance : ""}", "¥${vipCard != null ? vipCard.balance : ""}",
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -369,10 +369,10 @@ class _VipDetailPage extends State<VipDetailPage> {
child: Text( child: Text(
vipCard != null vipCard != null
? "${vipCard.id.substring(0, 4)} " ? "${vipCard.id.substring(0, 4)} "
"${vipCard.id.substring(4, 8)} " "${vipCard.id.substring(4, 8)} "
"${vipCard.id.substring(8, 12)} " "${vipCard.id.substring(8, 12)} "
"${vipCard.id.substring(12, 16)} " "${vipCard.id.substring(12, 16)} "
"${vipCard.id.substring(16, vipCard.id.length)}" "${vipCard.id.substring(16, vipCard.id.length)}"
: "", : "",
maxLines: 1, maxLines: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -382,11 +382,11 @@ class _VipDetailPage extends State<VipDetailPage> {
wordSpacing: vipCard == null wordSpacing: vipCard == null
? 10 ? 10
: (MediaQuery.of(context).size.width - 64.w) / : (MediaQuery.of(context).size.width - 64.w) /
(((vipCard.id.length) * 4)), (((vipCard.id.length) * 4)),
letterSpacing: vipCard == null letterSpacing: vipCard == null
? 8 ? 8
: (MediaQuery.of(context).size.width - 64.w) / : (MediaQuery.of(context).size.width - 64.w) /
(((vipCard.id.length) * 4)), (((vipCard.id.length) * 4)),
), ),
), ),
), ),
@ -407,7 +407,7 @@ class _VipDetailPage extends State<VipDetailPage> {
); );
} }
Widget shopItem() { Widget shopItem(OrderInfo orderInfo) {
return Container( return Container(
margin: EdgeInsets.all(16.w), margin: EdgeInsets.all(16.w),
child: Column( child: Column(
@ -420,7 +420,7 @@ class _VipDetailPage extends State<VipDetailPage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"百年川椒重庆老火锅(汉街店)", (orderInfo != null) ? orderInfo.storeName : "",
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -429,7 +429,7 @@ class _VipDetailPage extends State<VipDetailPage> {
)), )),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
Navigator.of(context).pushNamed('/router/union_detail_page'); Navigator.of(context).pushNamed('/router/union_detail_page',arguments: {"id": orderInfo.storeId});
}, },
child:Text( child:Text(
"查看", "查看",
@ -462,6 +462,7 @@ class _VipDetailPage extends State<VipDetailPage> {
), ),
Text( Text(
"楚河汉街第一街区万达总部国际C座对面", "楚河汉街第一街区万达总部国际C座对面",
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -487,7 +488,10 @@ class _VipDetailPage extends State<VipDetailPage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
"10:00-22:00", (orderInfo.storeVO.openStartTime == null &&
orderInfo.storeVO.openEndTime == null)
? S.of(context).quantian
: "${orderInfo.storeVO.openStartTime.substring(0, orderInfo.storeVO.openStartTime.lastIndexOf(":"))}-${orderInfo.storeVO.openEndTime.substring(0, orderInfo.storeVO.openEndTime.lastIndexOf(":"))}",
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
@ -530,40 +534,40 @@ class _VipDetailPage extends State<VipDetailPage> {
return products return products
.map( .map(
(e) => Container( (e) => Container(
margin: EdgeInsets.symmetric(horizontal: 2.w), margin: EdgeInsets.symmetric(horizontal: 2.w),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
MImage( MImage(
e.skuImg, e.skuImg,
width: 75.w, width: 75.w,
height: 75.h, height: 75.h,
fit: BoxFit.contain, fit: BoxFit.contain,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
),
SizedBox(
height: 4.h,
),
if (isRemake)
Container(
width: 75.w,
child: Text(
e.productName,
maxLines: 1,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
],
), ),
), SizedBox(
) height: 4.h,
),
if (isRemake)
Container(
width: 75.w,
child: Text(
e.productName,
maxLines: 1,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
),
],
),
),
)
.toList(); .toList();
} }
} }

Loading…
Cancel
Save