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

96
lib/mine/vip_detail_page.dart

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

Loading…
Cancel
Save