Browse Source

修改

null_safety
fmk 4 years ago
parent
commit
4896e6af3a
  1. 14
      android/app/build.gradle
  2. 22
      android/app/src/main/AndroidManifest.xml
  3. 3
      android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXEntryActivity.kt
  4. 4
      android/tmpmob/ShareSDK/assets/ShareSDK.xml
  5. BIN
      assets/image/2x/icon_line.png
  6. BIN
      assets/image/3x/icon_line.png
  7. BIN
      assets/image/icon_line.png
  8. 6
      lib/generated/intl/messages_en.dart
  9. 6
      lib/generated/intl/messages_zh_CN.dart
  10. 6
      lib/generated/intl/messages_zh_Hans_CN.dart
  11. 4
      lib/generated/intl/messages_zh_Hant_CN.dart
  12. 4
      lib/generated/intl/messages_zh_TW.dart
  13. 28
      lib/generated/l10n.dart
  14. 4
      lib/home/home_page.dart
  15. 7
      lib/home/points_mall_page.dart
  16. 1
      lib/integral/integral_page.dart
  17. 76
      lib/integral_store/integral_store_details_page.dart
  18. 6
      lib/l10n/intl_en.arb
  19. 6
      lib/l10n/intl_zh_CN.arb
  20. 6
      lib/l10n/intl_zh_Hans_CN.arb
  21. 4
      lib/l10n/intl_zh_Hant_CN.arb
  22. 4
      lib/l10n/intl_zh_TW.arb
  23. 1
      lib/main.dart
  24. 337
      lib/mine/vip_detail_page.dart
  25. 319
      lib/order/order_history_page.dart
  26. 8
      lib/retrofit/data/vip_card.dart
  27. 2
      lib/setting/permission_setting_page.dart
  28. 101
      lib/union/store_details_page.dart
  29. 4
      lib/union/union_details_page.dart
  30. 4
      lib/union/union_page.dart
  31. 13
      lib/utils/flutter_utils.dart
  32. 369
      lib/utils/status_utils.dart
  33. 2
      lib/view_widget/login_tips.dart
  34. 103
      lib/view_widget/share_dialog.dart
  35. 2
      pubspec.yaml

14
android/app/build.gradle

@ -47,6 +47,14 @@ MobSDK {
bypassApproval false
enable true
}
WechatMoments {
id 3
sortId 3
appId "wx3b269e795ed23e5f"
appSecret "64020361b8ec4c99936c0e3999a9f249"
bypassApproval false
enable true
}
Facebook {
id 8
sortId 8
@ -59,8 +67,10 @@ MobSDK {
Line {
id 2
sortId 2
appKey "1656257249"
appSecret "7f160c9686672a50b5952364a8553f99"
// appKey "1656257249"
// appSecret "7f160c9686672a50b5952364a8553f99"
appKey "1656257047"
appSecret "fd93cb8f12b285b80c7c67bdee8bd091"
callbackUri "https://mob.com"
callbackscheme "huixiang"
shareByAppClient true

22
android/app/src/main/AndroidManifest.xml

@ -78,17 +78,17 @@
<data android:scheme="sdksample" />
</intent-filter>
</activity>
<!-- <activity-->
<!-- android:name="com.zsw.huixiang.wxapi.WXEntryActivity"-->
<!-- android:exported="true"-->
<!-- android:theme="@android:style/Theme.Translucent.NoTitleBar"-->
<!-- android:launchMode="singleTop" >-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.VIEW" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <data android:scheme="sdksample" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<activity
android:name="com.zsw.huixiang.wxapi.WXEntryActivity"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sdksample" />
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"

3
android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXEntryActivity.kt

@ -2,10 +2,11 @@ package com.zsw.huixiang.wxapi
import android.content.Intent
import android.os.Bundle
import cn.sharesdk.wechat.utils.WechatHandlerActivity
import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity
import io.flutter.Log
class WXEntryActivity : AbsWXPayCallbackActivity() {
class WXEntryActivity : WechatHandlerActivity() {
// IWXAPI 是第三方app和微信通信的openapi接口

4
android/tmpmob/ShareSDK/assets/ShareSDK.xml

@ -17,7 +17,7 @@
<Email Enable="false" />
<ShortMessage Enable="false" />
<Wechat Id="4" SortId="4" AppId="wx3b269e795ed23e5f" AppSecret="64020361b8ec4c99936c0e3999a9f249" userName="gh_afb25ac019c9" path="pages/index/index.html?id=1" WithShareTicket="true" MiniprogramType="0" BypassApproval="false" Enable="true" />
<WechatMoments Enable="false" />
<WechatMoments Id="3" SortId="3" AppId="wx3b269e795ed23e5f" AppSecret="64020361b8ec4c99936c0e3999a9f249" BypassApproval="false" Enable="true" />
<QQ Enable="false" />
<Instapaper Enable="false" />
<Pocket Enable="false" />
@ -30,7 +30,7 @@
<Yixin Enable="false" />
<YixinMoments Enable="false" />
<Mingdao Enable="false" />
<Line Id="2" SortId="2" AppKey="1656257249" callbackscheme="huixiang" ShareByAppClient="true" Enable="true" ChannelSecret="7f160c9686672a50b5952364a8553f99" RedirectUri="https://mob.com" />
<Line Id="2" SortId="2" AppKey="1656257047" callbackscheme="huixiang" ShareByAppClient="true" Enable="true" ChannelSecret="fd93cb8f12b285b80c7c67bdee8bd091" RedirectUri="https://mob.com" />
<WhatsApp Enable="false" />
<KakaoTalk Enable="false" />
<KakaoStory Enable="false" />

BIN
assets/image/2x/icon_line.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
assets/image/3x/icon_line.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
assets/image/icon_line.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

6
lib/generated/intl/messages_en.dart

@ -79,7 +79,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m29(yue) => "余额${yue}";
static m30(zuozhe) => "作者${zuozhe}";
static m30(zuozhe) => "作者:${zuozhe}";
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m3,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"ge" : m4,
"geiwopingfen" : MessageLookupByLibrary.simpleMessage("给我评分"),
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
@ -192,6 +193,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jiesuanjine" : MessageLookupByLibrary.simpleMessage("结算金额"),
"jifen" : MessageLookupByLibrary.simpleMessage("积分"),
"jifen_" : m9,
"jifenbuzu" : MessageLookupByLibrary.simpleMessage("您的积分不足"),
"jifendaoxiayidengji" : m10,
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
@ -447,7 +449,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhifuxiangqing" : MessageLookupByLibrary.simpleMessage("支付详情"),
"zhizunhuiyuan" : MessageLookupByLibrary.simpleMessage("至尊会员"),
"zhizuowancheng" : MessageLookupByLibrary.simpleMessage("制作完成"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("中文简体"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

6
lib/generated/intl/messages_zh_CN.dart

@ -79,7 +79,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m29(yue) => "余额${yue}";
static m30(zuozhe) => "作者${zuozhe}";
static m30(zuozhe) => "作者:${zuozhe}";
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m3,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"ge" : m4,
"geiwopingfen" : MessageLookupByLibrary.simpleMessage("给我评分"),
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
@ -191,6 +192,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jiesuanjine" : MessageLookupByLibrary.simpleMessage("结算金额"),
"jifen" : MessageLookupByLibrary.simpleMessage("积分"),
"jifen_" : m9,
"jifenbuzu" : MessageLookupByLibrary.simpleMessage("您的积分不足"),
"jifendaoxiayidengji" : m10,
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
@ -445,7 +447,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhifuxiangqing" : MessageLookupByLibrary.simpleMessage("支付详情"),
"zhizunhuiyuan" : MessageLookupByLibrary.simpleMessage("至尊会员"),
"zhizuowancheng" : MessageLookupByLibrary.simpleMessage("制作完成"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("中文简体"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

6
lib/generated/intl/messages_zh_Hans_CN.dart

@ -79,7 +79,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m29(yue) => "余额${yue}";
static m30(zuozhe) => "作者${zuozhe}";
static m30(zuozhe) => "作者:${zuozhe}";
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m3,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非实物兑换吗"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非实物商品兑换后领取到卡包即可使用!"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"ge" : m4,
"geiwopingfen" : MessageLookupByLibrary.simpleMessage("给我评分"),
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
@ -191,6 +192,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jiesuanjine" : MessageLookupByLibrary.simpleMessage("结算金额"),
"jifen" : MessageLookupByLibrary.simpleMessage("积分"),
"jifen_" : m9,
"jifenbuzu" : MessageLookupByLibrary.simpleMessage("您的积分不足"),
"jifendaoxiayidengji" : m10,
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("积分的计算说明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("积分从低到高"),
@ -445,7 +447,7 @@ class MessageLookup extends MessageLookupByLibrary {
"zhifuxiangqing" : MessageLookupByLibrary.simpleMessage("支付详情"),
"zhizunhuiyuan" : MessageLookupByLibrary.simpleMessage("至尊会员"),
"zhizuowancheng" : MessageLookupByLibrary.simpleMessage("制作完成"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("中文简体"),
"zhongwenjianti" : MessageLookupByLibrary.simpleMessage("简体中文"),
"ziqu" : MessageLookupByLibrary.simpleMessage("自取"),
"ziti" : MessageLookupByLibrary.simpleMessage("自提"),
"zitidizhi" : MessageLookupByLibrary.simpleMessage("自提地址"),

4
lib/generated/intl/messages_zh_Hant_CN.dart

@ -79,7 +79,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m29(yue) => "餘額${yue}";
static m30(zuozhe) => "作者${zuozhe}";
static m30(zuozhe) => "作者:${zuozhe}";
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m3,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"ge" : m4,
"geiwopingfen" : MessageLookupByLibrary.simpleMessage("給我評分"),
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
@ -191,6 +192,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jiesuanjine" : MessageLookupByLibrary.simpleMessage("結算金額"),
"jifen" : MessageLookupByLibrary.simpleMessage("積分"),
"jifen_" : m9,
"jifenbuzu" : MessageLookupByLibrary.simpleMessage("您的積分不足"),
"jifendaoxiayidengji" : m10,
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"),

4
lib/generated/intl/messages_zh_TW.dart

@ -79,7 +79,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m29(yue) => "餘額${yue}";
static m30(zuozhe) => "作者${zuozhe}";
static m30(zuozhe) => "作者:${zuozhe}";
final messages = _notInlinedMessages(_notInlinedMessages);
static _notInlinedMessages(_) => <String, Function> {
@ -150,6 +150,7 @@ class MessageLookup extends MessageLookupByLibrary {
"faxingshijian" : m3,
"feishiwuduihuanma" : MessageLookupByLibrary.simpleMessage("非實物兌換碼"),
"feishiwushangpin" : MessageLookupByLibrary.simpleMessage("非實物商品!"),
"fenxiangdao" : MessageLookupByLibrary.simpleMessage("分享到"),
"ge" : m4,
"geiwopingfen" : MessageLookupByLibrary.simpleMessage("給我評分"),
"gengduo" : MessageLookupByLibrary.simpleMessage("更多"),
@ -191,6 +192,7 @@ class MessageLookup extends MessageLookupByLibrary {
"jiesuanjine" : MessageLookupByLibrary.simpleMessage("結算金額"),
"jifen" : MessageLookupByLibrary.simpleMessage("積分"),
"jifen_" : m9,
"jifenbuzu" : MessageLookupByLibrary.simpleMessage("您的積分不足"),
"jifendaoxiayidengji" : m10,
"jifendejisuanshuoming" : MessageLookupByLibrary.simpleMessage("積分的計算説明"),
"jifendidaogao" : MessageLookupByLibrary.simpleMessage("積分從低到高"),

28
lib/generated/l10n.dart

@ -1535,10 +1535,10 @@ class S {
);
}
/// ``
/// ``
String get zhongwenjianti {
return Intl.message(
'中文简体',
'简体中文',
name: 'zhongwenjianti',
desc: '',
args: [],
@ -2505,10 +2505,10 @@ class S {
);
}
/// `{zuozhe}`
/// `:{zuozhe}`
String zuozhe(Object zuozhe) {
return Intl.message(
'作者$zuozhe',
'作者:$zuozhe',
name: 'zuozhe',
desc: '',
args: [zuozhe],
@ -3755,6 +3755,26 @@ class S {
);
}
/// ``
String get fenxiangdao {
return Intl.message(
'分享到',
name: 'fenxiangdao',
desc: '',
args: [],
);
}
/// ``
String get jifenbuzu {
return Intl.message(
'您的积分不足',
name: 'jifenbuzu',
desc: '',
args: [],
);
}
/// `使`
String get privacy_policy4 {
return Intl.message(

4
lib/home/home_page.dart

@ -104,7 +104,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
"pageNum": 1,
"pageSize": 10,
"searchKey": "",
"state": 0,
"state": 1,
"type": 2
}).catchError((onError) {
refreshController.refreshFailed();
@ -640,7 +640,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// contentType 0123
bannerClick(BannerData bannerData) async {
switch(bannerData.contentType) {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});

7
lib/home/points_mall_page.dart

@ -224,8 +224,7 @@ class _PointsMallPage extends State<PointsMallPage>
crossAxisSpacing: 11.w,
//Widget之间间距
mainAxisSpacing: 16.w,
//Widget宽高比例
//0.59
//Widget宽高比例 0.59
childAspectRatio: 166.w / 281.h,
),
itemBuilder: (contetx, index) {
@ -286,9 +285,7 @@ class _PointsMallPage extends State<PointsMallPage>
return Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4),
),
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),

1
lib/integral/integral_page.dart

@ -238,6 +238,7 @@ class _IntegralPage extends State<IntegralPage> {
return "assets/image/icon_integral_sign.png";
break;
}
return "assets/image/icon_integral_share.png";
}
Widget tashItem(Task task) {

76
lib/integral_store/integral_store_details_page.dart

@ -35,12 +35,13 @@ class _IntegralStoreDetailsPage extends State {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(), context: context, token: value.getString("token"));
queryGoodsById();
if (value.getString('user') != null) {
points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points;
}
});
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
queryGoodsById();
if (value.getString('user') != null) {
points = UserInfo.fromJson(jsonDecode(value.getString('user'))).points;
}
});
}
Goods goods;
@ -138,21 +139,31 @@ class _IntegralStoreDetailsPage extends State {
),
GestureDetector(
onTap: () {
toExchangeOrder();
if (goods != null &&
points != null &&
int.tryParse(goods.price) < int.tryParse(points)) {
toExchangeOrder();
}
},
child: Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
decoration: BoxDecoration(
color: (goods != null && points != null &&
int.tryParse(goods.price) < int.tryParse(points))
? Color(0xFF32A060)
: Color(0xFFD8D8D8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
topRight: Radius.circular(4))),
color: (goods != null &&
points != null &&
int.tryParse(goods.price) < int.tryParse(points))
? Color(0xFF32A060)
: Color(0xFFD8D8D8),
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
),
),
alignment: Alignment.center,
child: Text(
S.of(context).duihuan,
(goods != null &&
points != null &&
int.tryParse(goods.price) < int.tryParse(points))
? S.of(context).duihuan
: S.of(context).jifenbuzu,
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
@ -189,8 +200,9 @@ class _IntegralStoreDetailsPage extends State {
Widget buildProduct() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8)),
borderRadius: BorderRadius.vertical(
bottom: Radius.circular(8.h),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
@ -204,7 +216,7 @@ class _IntegralStoreDetailsPage extends State {
children: [
swiper(),
Container(
padding: EdgeInsets.fromLTRB(16, 16, 16, 16),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
children: [
Row(
@ -217,7 +229,7 @@ class _IntegralStoreDetailsPage extends State {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
fontSize: 18.sp,
color: Color(0xFF353535),
),
),
@ -228,14 +240,14 @@ class _IntegralStoreDetailsPage extends State {
? ""
: S.of(context).yiduihuanjian("${goods.sales}"),
style: TextStyle(
fontSize: 10,
fontSize: 10.sp,
color: Color(0xFFA29E9E),
),
),
],
),
SizedBox(
height: 11,
height: 11.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -245,7 +257,7 @@ class _IntegralStoreDetailsPage extends State {
child: Text(
goods == null ? "" : goods.description,
style: TextStyle(
fontSize: 12,
fontSize: 12.sp,
color: Color(0xFF727272),
),
),
@ -255,7 +267,7 @@ class _IntegralStoreDetailsPage extends State {
goods == null ? "" : S.of(context).jifen_(goods.price),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
fontSize: 16.sp,
color: Color(0xFF32A060),
),
),
@ -275,18 +287,20 @@ class _IntegralStoreDetailsPage extends State {
aspectRatio: 1.5,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76))),
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
itemBuilder: (context, position) {
return goods == null
? Container()
: Container(
margin: EdgeInsets.only(bottom: 30),
margin: EdgeInsets.only(bottom: 30.h),
child: ClipRRect(
child: Image.network(
goods.viceImgPaths.elementAt(position),

6
lib/l10n/intl_en.arb

@ -149,7 +149,7 @@
"shimingrenzheng": "实名认证",
"zhanghaoshouquan": "账号授权",
"yuyan": "语言",
"zhongwenjianti": "中文简体",
"zhongwenjianti": "简体中文",
"quanxian": "权限",
"tuichudenglu": "退出登录",
"xiaoxi": "消息",
@ -246,7 +246,7 @@
"shuaxinzhong": "刷新中....",
"shuaxinchenggong": "刷新成功",
"shuaxinshibai": "刷新失败",
"zuozhe": "作者{zuozhe}",
"zuozhe": "作者:{zuozhe}",
"quanchangzhe": "全场{zhe}折",
"shanglajiazai": "上拉加载",
"jiazaishibai": "加载失败",
@ -389,6 +389,8 @@
"yinshi": "饮食",
"shenghuoyule": "生活娱乐",
"bangong": "办公",
"fenxiangdao": "分享到",
"jifenbuzu": "您的积分不足",

6
lib/l10n/intl_zh_CN.arb

@ -149,7 +149,7 @@
"shimingrenzheng": "实名认证",
"zhanghaoshouquan": "账号授权",
"yuyan": "语言",
"zhongwenjianti": "中文简体",
"zhongwenjianti": "简体中文",
"quanxian": "权限",
"tuichudenglu": "退出登录",
"xiaoxi": "消息",
@ -246,7 +246,7 @@
"shuaxinzhong": "刷新中....",
"shuaxinchenggong": "刷新成功",
"shuaxinshibai": "刷新失败",
"zuozhe": "作者{zuozhe}",
"zuozhe": "作者:{zuozhe}",
"quanchangzhe": "全场{zhe}折",
"shanglajiazai": "上拉加载",
"jiazaishibai": "加载失败",
@ -390,6 +390,8 @@
"yinshi": "饮食",
"shenghuoyule": "生活娱乐",
"bangong": "办公",
"fenxiangdao": "分享到",
"jifenbuzu": "您的积分不足",

6
lib/l10n/intl_zh_Hans_CN.arb

@ -149,7 +149,7 @@
"shimingrenzheng": "实名认证",
"zhanghaoshouquan": "账号授权",
"yuyan": "语言",
"zhongwenjianti": "中文简体",
"zhongwenjianti": "简体中文",
"quanxian": "权限",
"tuichudenglu": "退出登录",
"xiaoxi": "消息",
@ -246,7 +246,7 @@
"shuaxinzhong": "刷新中....",
"shuaxinchenggong": "刷新成功",
"shuaxinshibai": "刷新失败",
"zuozhe": "作者{zuozhe}",
"zuozhe": "作者:{zuozhe}",
"quanchangzhe": "全场{zhe}折",
"shanglajiazai": "上拉加载",
"jiazaishibai": "加载失败",
@ -390,6 +390,8 @@
"yinshi": "饮食",
"shenghuoyule": "生活娱乐",
"bangong": "办公",
"fenxiangdao": "分享到",
"jifenbuzu": "您的积分不足",

4
lib/l10n/intl_zh_Hant_CN.arb

@ -247,7 +247,7 @@
"shuaxinzhong": "刷新中....",
"shuaxinchenggong": "刷新成功",
"shuaxinshibai": "刷新失敗",
"zuozhe": "作者{zuozhe}",
"zuozhe": "作者:{zuozhe}",
"quanchangzhe": "全場{zhe}折",
"shanglajiazai": "上拉加載",
"jiazaishibai": "加載失敗",
@ -382,6 +382,8 @@
"yinshi": "飲食",
"shenghuoyule": "生活娛樂",
"bangong": "辦公",
"fenxiangdao": "分享到",
"jifenbuzu": "您的積分不足",
"privacy_policy4": "并使用本機號碼登錄"

4
lib/l10n/intl_zh_TW.arb

@ -247,7 +247,7 @@
"shuaxinzhong": "刷新中....",
"shuaxinchenggong": "刷新成功",
"shuaxinshibai": "刷新失敗",
"zuozhe": "作者{zuozhe}",
"zuozhe": "作者:{zuozhe}",
"quanchangzhe": "全場{zhe}折",
"shanglajiazai": "上拉加載",
"jiazaishibai": "加載失敗",
@ -382,6 +382,8 @@
"yinshi": "飲食",
"shenghuoyule": "生活娛樂",
"bangong": "辦公",
"fenxiangdao": "分享到",
"jifenbuzu": "您的積分不足",
"privacy_policy4": "并使用本機號碼登錄"

1
lib/main.dart

@ -97,6 +97,7 @@ initSdk() async {
shareSDKRegister.setupWechat("wx3b269e795ed23e5f", "64020361b8ec4c99936c0e3999a9f249", "https://hx.lotus-wallet.com/app/");
shareSDKRegister.setupFacebook("523308712059457", "d3a1b6377100871799d8973fbe84794a", "回乡");
SharesdkPlugin.regist(shareSDKRegister);
}
EventBus eventBus = EventBus(sync: true);

337
lib/mine/vip_detail_page.dart

@ -3,12 +3,16 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/data/vip_card.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/painter_bg.dart';
import 'package:huixiang/utils/status_utils.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
class VipDetailPage extends StatefulWidget {
@ -36,6 +40,9 @@ class _VipDetailPage extends State<VipDetailPage> {
}
VipCard vipCard;
List<OrderInfo> orderInfos = [];
final RefreshController refreshController = RefreshController();
int current = 1;
vipDetail() async {
BaseData baseData = await apiService
@ -45,6 +52,31 @@ class _VipDetailPage extends State<VipDetailPage> {
vipCard = VipCard.fromJson(baseData.data);
setState(() {});
}
BaseData order = await apiService.orderList({
"current": current,
"model": {"status": 0, "storeId": vipCard.storeId},
"order": "descending",
"size": 10,
"sort": "id"
});
if (order != null && order.isSuccess) {
PageInfo pageInfo = PageInfo.fromJson(order.data);
if (current == 1) {
orderInfos.clear();
}
orderInfos
.addAll(pageInfo.records.map((e) => OrderInfo.fromJson(e)).toList());
refreshController.loadComplete();
if (current * 10 > int.tryParse(pageInfo.total)) {
refreshController.loadNoData();
} else {
current += 1;
}
setState(() {});
} else {
refreshController.loadFailed();
}
}
@override
@ -116,16 +148,27 @@ class _VipDetailPage extends State<VipDetailPage> {
),
),
Expanded(
child: ListView.builder(
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: historyItem(),
);
},
itemCount: 5,
child: SmartRefresher(
controller: refreshController,
enablePullDown: false,
enablePullUp: true,
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
physics: BouncingScrollPhysics(),
child: ListView.builder(
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: historyItem(orderInfos[position]),
);
},
itemCount: orderInfos != null ? orderInfos.length : 0,
),
),
)
),
],
),
);
@ -184,14 +227,17 @@ class _VipDetailPage extends State<VipDetailPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
vipCard != null ? vipCard.storeName : "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
Expanded(
child: Text(
vipCard != null ? vipCard.storeName : "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
flex: 1,
),
Image.asset(
"assets/image/icon_vip.png",
@ -359,7 +405,7 @@ class _VipDetailPage extends State<VipDetailPage> {
);
}
Widget historyItem() {
Widget historyItem(OrderInfo orderInfo) {
return Container(
margin: EdgeInsets.all(16.w),
child: Column(
@ -380,7 +426,7 @@ class _VipDetailPage extends State<VipDetailPage> {
borderRadius: BorderRadius.circular(2),
),
child: Text(
"",
(orderInfo != null && orderInfo.isTakeOut == 0) ? "" : "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
@ -394,7 +440,7 @@ class _VipDetailPage extends State<VipDetailPage> {
margin: EdgeInsets.only(left: 6.w, top: 12.h),
alignment: Alignment.centerLeft,
child: Text(
"前进麦味·天然烘焙(凯德1818店)",
(orderInfo != null) ? orderInfo.storeName : "",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
@ -407,11 +453,28 @@ class _VipDetailPage extends State<VipDetailPage> {
Padding(
padding: EdgeInsets.only(top: 12.h, right: 12.w),
child: Text(
S.of(context).yiwancheng,
(orderInfo != null &&
orderInfo.storeVO != null &&
orderInfo.storeVO.posType != null)
? StatusUtils.statusText(
context,
orderInfo.refundStatus,
orderInfo.orderStatus,
orderInfo.payStatus,
orderInfo.sendStatus,
orderInfo.isTakeOut)
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xff32A060),
color: (orderInfo == null)
? Color(0xFF32A060)
: (orderInfo.refundStatus == 1 ||
orderInfo.orderStatus >= 5)
? Colors.grey
: (orderInfo.orderStatus == 4)
? Color(0xFF32A060)
: Color(0xffFE951E),
),
),
),
@ -428,7 +491,8 @@ class _VipDetailPage extends State<VipDetailPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).xiadanshijian_("2020.01.20~2020.1.21"),
S.of(context).xiadanshijian_(
(orderInfo != null) ? orderInfo.createTime : ""),
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF727272),
@ -440,24 +504,10 @@ class _VipDetailPage extends State<VipDetailPage> {
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
"https://t7.baidu.com/it/u=1348120667,563487140&fm=193&f=GIF",
width: 75.w,
height: 75.h,
fit: BoxFit.contain,
),
SizedBox(
height: 4.h,
),
Text(
"桑葚椰汁水果茶",
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF353535),
),
),
],
children: goodsItem(
(orderInfo != null && orderInfo.productList != null)
? orderInfo.productList
: null),
),
],
),
@ -487,101 +537,84 @@ class _VipDetailPage extends State<VipDetailPage> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(TextSpan(children: [
Text.rich(
TextSpan(
text: "合计:",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
TextSpan(
text: S.of(context).yuan_("58.2"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
children: [
TextSpan(
text: S.of(context).gong,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
TextSpan(
text: (orderInfo != null &&
orderInfo.productList != null)
? "${orderInfo.productList.length}"
: "0",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
TextSpan(
text: S.of(context).jian,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
],
),
])),
),
SizedBox(
width: 4.w,
),
Text.rich(TextSpan(children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
Text.rich(
TextSpan(
text: "5",
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
TextSpan(
text: "",
style: TextStyle(
fontSize: 12,
color: Color(0xFF868686),
),
children: [
TextSpan(
text: S.of(context).heji,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
TextSpan(
text: totalPrice(orderInfo),
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
TextSpan(
text: S.of(context).yuan,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF868686),
),
),
],
),
])),
),
],
),
SizedBox(
height: 8.h,
),
Row(
children: [
RoundButton(
text: "再来一单",
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(color: Color(0xff32A060), width: 0.5),
),
),
child: Text(
"删除一单",
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 37.w),
alignment: Alignment.centerLeft,
child: Text(
"取单号 201",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black),
),
),
),
],
children: (orderInfo != null)
? StatusUtils.statusBtn(
context,
orderInfo.payStatus,
orderInfo.orderStatus,
orderInfo.isTakeOut,
orderInfo.sendStatus,
orderInfo.refundStatus,
orderInfo.dayFlowCode)
: [],
),
],
),
@ -591,4 +624,62 @@ class _VipDetailPage extends State<VipDetailPage> {
),
);
}
bool isRemake = true;
String totalPrice(orderInfo) {
if (orderInfo == null) return "";
double totalPrice = (double.tryParse(orderInfo.orderSum) +
double.tryParse(orderInfo.postFee));
if (orderInfo.orderDetail != null &&
orderInfo.orderDetail.couponDTO != null) {
totalPrice -= double.tryParse(orderInfo.orderDetail.couponDTO.money);
}
return "$totalPrice";
}
List<Widget> goodsItem(List<ProductList> products) {
if (products == null) return [];
if (products.length > 3) {
products = products.sublist(0, 3);
}
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),
),
),
),
],
),
),
)
.toList();
}
}

319
lib/order/order_history_page.dart

@ -5,12 +5,12 @@ import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/status_utils.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -289,7 +289,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
(orderInfo != null &&
orderInfo.storeVO != null &&
orderInfo.storeVO.posType != null)
? statusText(
? StatusUtils.statusText(
context,
orderInfo.refundStatus,
orderInfo.orderStatus,
orderInfo.payStatus,
@ -441,7 +442,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
),
Row(
children: (orderInfo != null)
? statusBtn(
? StatusUtils.statusBtn(
context,
orderInfo.payStatus,
orderInfo.orderStatus,
orderInfo.isTakeOut,
@ -470,317 +472,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
return "$totalPrice";
}
String statusText(
refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) {
String statusText = "";
if (isTakeOut == 0) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
switch (orderStatus) {
case 2:
statusText = S.of(context).shangjiazhengzaipeican;
break;
case 3:
statusText = S.of(context).daiqucan;
break;
case 4:
statusText = S.of(context).yiwancheng;
break;
}
}
} else if (isTakeOut == 1) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
if (orderStatus < 4) {
switch (sendStatus) {
case 1:
statusText = S.of(context).zhengzaihujiaoqishou;
break;
case 2:
statusText = S.of(context).quhuozhong;
break;
case 3:
statusText = S.of(context).peisongzhong;
break;
case 4:
statusText = S.of(context).yisongda;
break;
}
} else {
switch (orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
}
}
} else if (isTakeOut == 2) {
if (payStatus == 0) {
statusText = S.of(context).daizhifu;
} else {
statusText = S.of(context).yizhifu;
if (orderStatus < 4) {
switch (sendStatus) {
case 1:
statusText = S.of(context).yifahuo;
break;
case 4:
statusText = S.of(context).yisongda;
break;
}
} else {
switch (orderStatus) {
case 4:
statusText = S.of(context).yiwancheng;
break;
}
}
}
}
if (refundStatus == 1) {
statusText = S.of(context).yituikuan;
}
if (orderStatus == 5) {
statusText = S.of(context).yiquxiao;
}
return statusText;
}
List<Widget> statusBtn(payStatus, orderStatus, isTakeOut, sendStatus,
refundStatus, dayFlowCode) {
if (refundStatus == 1) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
}
if (orderStatus > 4) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
} else {
if (payStatus == 0) {
return [
RoundButton(
text: S.of(context).quzhifu,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).quxiaozhifu,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
} else {
if (orderStatus < 4) {
if (isTakeOut == 0) {
return [
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 37.w),
alignment: Alignment.centerLeft,
child: Text(
S.of(context).qudanhao(dayFlowCode),
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
),
];
} else if (isTakeOut == 1 || isTakeOut == 2) {
// } else if (isTakeOut == 2) {
if (sendStatus < 4) {
return [
RoundButton(
text: S.of(context).querenshouhuo,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {
Navigator.of(context)
.pushNamed('/router/logistics_information_page');
},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(color: Color(0xff32A060), width: 0.5),
),
),
child: Text(
S.of(context).chakanwuliu,
style:
TextStyle(color: Color(0xff32A060), fontSize: 12.sp),
),
),
),
];
} else {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
];
}
}
} else if (orderStatus == 4) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
}
}
}
}
List<Widget> goodsItem(List<ProductList> products) {
if (products == null) return [];
if (products.length > 3) {

8
lib/retrofit/data/vip_card.dart

@ -44,6 +44,7 @@ class VipCard {
String _expendAmount;
int _buyTimes;
dynamic _lastBuyTime;
String _storeId;
String _storeName;
String _storeLogo;
@ -69,6 +70,7 @@ class VipCard {
int get buyTimes => _buyTimes;
dynamic get lastBuyTime => _lastBuyTime;
String get storeName => _storeName;
String get storeId => _storeId;
String get storeLogo => _storeLogo;
VipCard({
@ -93,7 +95,8 @@ class VipCard {
String expendAmount,
int buyTimes,
dynamic lastBuyTime,
String storeName,
String storeName,
String storeId,
String storeLogo}){
_id = id;
_createTime = createTime;
@ -116,6 +119,7 @@ class VipCard {
_expendAmount = expendAmount;
_buyTimes = buyTimes;
_lastBuyTime = lastBuyTime;
_storeId = storeId;
_storeName = storeName;
_storeLogo = storeLogo;
}
@ -142,6 +146,7 @@ class VipCard {
_expendAmount = json["expendAmount"];
_buyTimes = json["buyTimes"];
_lastBuyTime = json["lastBuyTime"];
_storeId = json["storeId"];
_storeName = json["storeName"];
_storeLogo = json["storeLogo"];
}
@ -169,6 +174,7 @@ class VipCard {
map["expendAmount"] = _expendAmount;
map["buyTimes"] = _buyTimes;
map["lastBuyTime"] = _lastBuyTime;
map["storeId"] = _storeId;
map["storeName"] = _storeName;
map["storeLogo"] = _storeLogo;
return map;

2
lib/setting/permission_setting_page.dart

@ -148,7 +148,7 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
queryPermission();
}
},
heightRatioWithWidth: 0.84,
heightRatioWithWidth: 0.8,
);
});
}

101
lib/union/store_details_page.dart

@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/image_render.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/share_dialog.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_defines.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
@ -56,7 +56,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
}
}
share2WeChat() async {
share() async {
// await registerWxApi(appId: "wx3b269e795ed23e5f", doOnAndroid: true, universalLink: "https://hx.lotus-wallet.com/app/");
// shareToWeChat(WeChatShareWebPageModel(
// "http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}",
@ -64,26 +64,75 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
// SharesdkPlugin.showMenu();
SSDKMap params = SSDKMap()
..setGeneral(
activity != null ? activity.mainTitle : article != null ? article.mainTitle : "",
activity != null ? activity.viceTitle : article != null ? article.viceTitle : "",
activity != null
? activity.mainTitle
: article != null
? article.mainTitle
: "",
activity != null
? activity.viceTitle
: article != null
? article.viceTitle
: "",
[],
"",
"",
"http://hx.lotus-wallet.com/index.html?id=${widget
.arguments["activityId"] ?? widget.arguments["articleId"]}",
"http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}",
"",
"",
"",
"",
SSDKContentTypes.webpage);
SharesdkPlugin.showMenu(null, null, params, (state, platform, userData, contentEntity, error) {
print("分享成功!$state");
print("分享成功!$platform");
print("分享成功!$userData");
print("分享成功!$contentEntity");
print("分享成功!$error");
print("分享成功!");
SharesdkPlugin.uploadPrivacyPermissionStatus(1, (success) => {
});
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ShareDialog((platform){
if (platform == ShareSDKPlatforms.line) {
params.map["text"] = "${activity != null
? activity.viceTitle
: article != null
? article.viceTitle
: ""} http://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}";
}
// shareFacebookCustom(context);
SharesdkPlugin.share(platform, params, (state, userData, contentEntity, error) {
print("分享成功!$state");
print("分享成功!$platform");
print("分享成功!$userData");
print("分享成功!$contentEntity");
print("分享成功!$error");
print("分享成功!");
});
});
});
}
void shareFacebookCustom(BuildContext context) {
SSDKMap params = SSDKMap()
..setFacebook(
"Share SDK Link Desc",
"http://ww4.sinaimg.cn/bmiddle/005Q8xv4gw1evlkov50xuj30go0a6mz3.jpg",
"http://www.mob.com",
"Share SDK",
null,
null,
"#MobData",
"Mob官网 - 全球领先的移动开发者服务平台",
SSDKFacebookShareTypes.native,
SSDKContentTypes.webpage);
params
..setFacebookAssetLocalIdentifier("73EC5698-20CF-4030-8FB2-CC0C80EF8156/L0/001,B2A42CA3-FA0F-45EC-92B2-F0F94A8A5A2B/L0/001,AA97F2F3-D2E4-43BB-8C2A-06D77480D7CA/L0/001,B220D191-2D5F-43E1-BF97-E3D7E61E86DB/L0/001,F064C692-79A1-4768-9530-1EFEA8360843/L0/001", "asdf");
SharesdkPlugin.share(ShareSDKPlatforms.facebook, params,
(SSDKResponseState state, userdata, contentEntity,
SSDKError error) {
});
}
@override
@ -91,10 +140,10 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
return Scaffold(
appBar: MyAppBar(
action: Container(
margin: EdgeInsets.only(right: 15),
margin: EdgeInsets.only(right: 10),
child: GestureDetector(
onTap: () {
share2WeChat();
share();
},
child: Icon(
Icons.share,
@ -108,8 +157,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
title: activity != null
? activity.mainTitle
: article != null
? article.mainTitle
: "",
? article.mainTitle
: "",
titleSize: 18.sp,
titleColor: Colors.black,
),
@ -125,8 +174,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
activity != null
? activity.mainTitle
: article != null
? article.mainTitle
: "",
? article.mainTitle
: "",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
@ -140,9 +189,7 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
children: [
InkWell(
child: Text(
"${activity != null ? activity.storeName : (article !=
null && article.author != null) ? article.author
.name : ""}",
"${activity != null ? activity.storeName : (article != null && article.author != null) ? article.author.name : ""}",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 14.sp,
@ -164,8 +211,8 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
activity != null
? activity.createTime
: article != null
? article.createTime
: "",
? article.createTime
: "",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 12.sp,
@ -179,13 +226,13 @@ class _StoreDetailsPage extends State<StoreDetailsPage> {
data: activity != null
? activity.content
: article != null
? article.content
: "",
? article.content
: "",
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"):
svgNetworkImageRender(),
svgNetworkImageRender(),
networkSourceMatcher(): networkImageRender(loadingWidget: () {
// return Image.asset("assets/image/default_1.png",);
return Container();

4
lib/union/union_details_page.dart

@ -480,7 +480,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
);
}
bool isReceive = false;
bool isReceive = true;
Widget buildCoupon() {
return Container(
@ -708,7 +708,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast(S.of(context).lingquchenggong);
setState(() {
isReceive = true;
isReceive = false;
});
}
}

4
lib/union/union_page.dart

@ -431,7 +431,7 @@ class _UnionPage extends State<UnionPage>
// startLocation();
}
},
heightRatioWithWidth: 0.84,
heightRatioWithWidth: 0.8,
);
},
);
@ -454,7 +454,7 @@ class _UnionPage extends State<UnionPage>
}
}
},
heightRatioWithWidth: 0.84,
heightRatioWithWidth: 0.8,
);
});
}

13
lib/utils/flutter_utils.dart

@ -1,11 +1,9 @@
import 'dart:io';
import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart';
class AppUtils {
static String getAge(DateTime brt) {
int age = 0;
DateTime dateTime = DateTime.now();
@ -68,7 +66,8 @@ class AppUtils {
static String getHourMinuteAfter30mByString(String birth) {
if (birth == null || birth == "") return "";
DateTime brt = DateFormat("yyyy-MM-dd HH:mm:ss").parse(birth);
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(brt.millisecondsSinceEpoch + 30 * 60 * 1000);
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
brt.millisecondsSinceEpoch + 30 * 60 * 1000);
return DateFormat("HH:mm").format(dateTime); //
}
@ -81,7 +80,7 @@ class AppUtils {
}
///
static Future<int> clear() async {
static Future<void> clear() async {
Directory tempDir = await getTemporaryDirectory();
if (tempDir == null) return 0;
await _delete(tempDir);
@ -94,6 +93,7 @@ class AppUtils {
int length = await file.length();
return length;
}
///
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
@ -107,7 +107,7 @@ class AppUtils {
}
///
static Future<int> _delete(FileSystemEntity file) async {
static Future<void> _delete(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
@ -119,7 +119,7 @@ class AppUtils {
}
///
static Future<int> deleteDirectory(FileSystemEntity file) async {
static Future<void> deleteDirectory(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
@ -127,5 +127,4 @@ class AppUtils {
}
}
}
}

369
lib/utils/status_utils.dart

@ -1,137 +1,12 @@
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart';
class AppUtils {
static String getAge(DateTime brt) {
int age = 0;
DateTime dateTime = DateTime.now();
if (dateTime.isBefore(brt)) {
//
return '出生日期不正確';
}
int yearNow = dateTime.year; //
int monthNow = dateTime.month; //
int dayOfMonthNow = dateTime.day; //
int yearBirth = brt.year;
int monthBirth = brt.month;
int dayOfMonthBirth = brt.day;
age = yearNow - yearBirth; //
if (monthNow <= monthBirth) {
if (monthNow == monthBirth) {
if (dayOfMonthNow < dayOfMonthBirth) age--; //
} else {
age--; //
}
}
return age.toString();
}
static String getAgeByString(String birth) {
if (birth == null || birth == "") return "";
int age = 0;
DateTime brt = DateFormat("yyyy-MM-dd").parse(birth);
DateTime dateTime = DateTime.now();
if (dateTime.isBefore(brt)) {
//
return '出生日期不正確';
}
int yearNow = dateTime.year; //
int monthNow = dateTime.month; //
int dayOfMonthNow = dateTime.day; //
int yearBirth = brt.year;
int monthBirth = brt.month;
int dayOfMonthBirth = brt.day;
age = yearNow - yearBirth; //
if (monthNow <= monthBirth) {
if (monthNow == monthBirth) {
if (dayOfMonthNow < dayOfMonthBirth) age--; //
} else {
age--; //
}
}
return age.toString();
}
static String getHourMinuteByString(String birth) {
if (birth == null || birth == "") return "";
DateTime brt = DateFormat("yyyy-MM-dd HH:mm:ss").parse(birth);
return DateFormat("HH:mm").format(brt);
}
static String getHourMinuteAfter30mByString(String birth) {
if (birth == null || birth == "") return "";
DateTime brt = DateFormat("yyyy-MM-dd HH:mm:ss").parse(birth);
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(brt.millisecondsSinceEpoch + 30 * 60 * 1000);
return DateFormat("HH:mm").format(dateTime); //
}
///
static Future<int> total() async {
Directory tempDir = await getTemporaryDirectory();
if (tempDir == null) return 0;
int total = await _reduce(tempDir);
return total;
}
///
static Future<void> clear() async {
Directory tempDir = await getTemporaryDirectory();
if (tempDir == null) return 0;
await _delete(tempDir);
}
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
///
static Future<int> _reduce(FileSystemEntity file) async {
///
if (file is File) {
int length = await file.length();
return length;
}
///
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
int total = 0;
if (children != null && children.isNotEmpty)
for (final FileSystemEntity child in children)
total += await _reduce(child);
return total;
}
return 0;
}
///
static Future<void> _delete(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
await child.delete(recursive: true);
}
} else {
await file.delete();
}
}
///
static Future<void> deleteDirectory(FileSystemEntity file) async {
if (file is Directory) {
final List<FileSystemEntity> children = file.listSync();
for (final FileSystemEntity child in children) {
child.deleteSync(recursive: true);
}
}
}
static String statusText(context,
refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) {
class StatusUtils {
static String statusText(
context, refundStatus, orderStatus, payStatus, sendStatus, isTakeOut) {
String statusText = "";
if (isTakeOut == 0) {
if (payStatus == 0) {
@ -210,4 +85,234 @@ class AppUtils {
return statusText;
}
static List<Widget> statusBtn(context, payStatus, orderStatus, isTakeOut,
sendStatus, refundStatus, dayFlowCode) {
if (refundStatus == 1) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
}
if (orderStatus > 4) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
} else {
if (payStatus == 0) {
return [
RoundButton(
text: S.of(context).quzhifu,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).quxiaozhifu,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
} else {
if (orderStatus < 4) {
if (isTakeOut == 0) {
return [
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 37.w),
alignment: Alignment.centerLeft,
child: Text(
S.of(context).qudanhao(dayFlowCode),
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
),
];
} else if (isTakeOut == 1 || isTakeOut == 2) {
// } else if (isTakeOut == 2) {
if (sendStatus < 4) {
return [
RoundButton(
text: S.of(context).querenshouhuo,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {
Navigator.of(context)
.pushNamed('/router/logistics_information_page');
},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(color: Color(0xff32A060), width: 0.5),
),
),
child: Text(
S.of(context).chakanwuliu,
style:
TextStyle(color: Color(0xff32A060), fontSize: 12.sp),
),
),
),
];
} else {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
];
}
}
} else if (orderStatus == 4) {
return [
RoundButton(
text: S.of(context).zailaiyidan,
textColor: Colors.white,
fontSize: 12.sp,
backgroup: Color(0xFF32A060),
radius: 2,
padding: EdgeInsets.fromLTRB(17.w, 4.h, 17.w, 4.h),
),
SizedBox(
width: 10.w,
),
Container(
width: 72.w,
height: 24.h,
margin: EdgeInsets.only(right: 10.w),
child: TextButton(
onPressed: () {},
style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero),
side: MaterialStateProperty.all(
BorderSide(
color: Color(0xff32A060),
width: 0.5,
),
),
),
child: Text(
S.of(context).shanchudingdan,
style: TextStyle(
color: Color(0xff32A060),
fontSize: 12.sp,
),
),
),
),
];
}
}
}
}
}

2
lib/view_widget/login_tips.dart

@ -25,7 +25,7 @@ class LoginTips extends StatelessWidget {
borderRadius: BorderRadius.circular(8),
),
child: AspectRatio(
aspectRatio: 0.9,
aspectRatio: 0.8,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,

103
lib/view_widget/share_dialog.dart

@ -0,0 +1,103 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:sharesdk_plugin/sharesdk_defines.dart';
class ShareDialog extends StatefulWidget {
final Function(ShareSDKPlatform platform) onTap;
ShareDialog(this.onTap);
@override
State<StatefulWidget> createState() {
return _ShareDialog();
}
}
class _ShareDialog extends State<ShareDialog> {
List<String> platformNames = ["line", "微信好友", "朋友圈", "facebook"];
List<String> platformIcons = [
"assets/image/icon_line.png",
"assets/image/icon_weixin.png",
"assets/image/icon_pengyouquan.png",
"assets/image/icon_facebook.png"
];
List<ShareSDKPlatform> platforms = [
ShareSDKPlatforms.line,
ShareSDKPlatforms.wechatSession,
ShareSDKPlatforms.wechatTimeline,
ShareSDKPlatforms.facebook
];
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 200.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(8)),
),
padding: EdgeInsets.only(top: 16.h, bottom: 66.h),
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Text(
S.of(context).fenxiangdao,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF1A1A1A),
),
),
SizedBox(
height: 28.h,
),
Row(
children: platforms
.map((e) => Expanded(
child: InkWell(
onTap: () {
widget.onTap(e);
Navigator.of(context).pop();
},
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
platformIcons[platforms.indexOf(e)],
width: 40.w,
height: 40.h,
),
SizedBox(
height: 4.h,
),
Container(
height: 18.h,
child: Text(
platformNames[platforms.indexOf(e)],
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF1A1A1A),
),
),
),
],
),
),
),
flex: 1,
))
.toList(),
),
],
),
);
}
}

2
pubspec.yaml

@ -1,5 +1,5 @@
name: huixiang
description: A new Flutter application.
description: 一心回乡.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.

Loading…
Cancel
Save