瀏覽代碼

1.补充degui缓存

2.修改消息中心
tags/0.0.3+8
“yanghuaxuan” 4 年之前
父節點
當前提交
b3ef18c5b3
共有 12 個檔案被更改,包括 247 行新增169 行删除
  1. +2
    -2
      example/android/app/build.gradle
  2. +39
    -9
      example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java
  3. +4
    -0
      example/android/app/src/main/res/values/color.xml
  4. +1
    -0
      lib/dialog/global_dialog/activity_dialog/activity_dialog.dart
  5. +30
    -17
      lib/models/app_config_model.dart
  6. +1
    -1
      lib/pages/message_notice_page/bloc/message_notice_repository.dart
  7. +114
    -54
      lib/pages/message_notice_page/message_notice_page.dart
  8. +48
    -84
      lib/pages/message_notice_page/model/message_notice_data_model.dart
  9. +2
    -1
      lib/pages/withdraw_page/withdraw_page.dart
  10. +1
    -1
      lib/register.dart
  11. +4
    -0
      lib/widgets/home/home_goods/home_goods_header.dart
  12. +1
    -0
      lib/zhiying_base_widget.dart

+ 2
- 2
example/android/app/build.gradle 查看文件

@@ -112,9 +112,9 @@ android {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 27
versionCode 28
dimension "app"
versionName '1.2.27'
versionName '1.2.28'
// 签名信息
signingConfig signingConfigs.zhiying
}


+ 39
- 9
example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java 查看文件

@@ -5,23 +5,29 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.FrameLayout;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;

import com.example.moblink.MoblinkPlugin;
import com.mob.moblink.MobLink;

import java.util.HashMap;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;

import cn.zhios.zhiying_comm.ZhiyingFlutterCommHandler;
import cn.zhios.zhiying_comm.ZhiyingFlutterCommNativable;
@@ -52,6 +58,8 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN

///添加启动页
void addLaunchView() {


view = (FrameLayout) this.getWindow().getDecorView();

launchImageFrame = new FrameLayout(this);
@@ -63,7 +71,7 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN
launchImageFrame.setLayoutParams(params);


ImageView launchImageView = new ImageView(this);
ImageView launchImageView = new ImageView(this);

FrameLayout.LayoutParams b_p = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);

@@ -77,15 +85,37 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN
view.addView(launchImageFrame, params);
}

Timer timer=new Timer();

///移除启动页
void removeLaunchView() {
//此处延时是为了不显示启动页往上顶
if(timer!=null){
timer.schedule(new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (view != null && launchImageFrame != null) {
getWindow().getDecorView().setBackground(new ColorDrawable(Color.parseColor("#000000")));
// Animation alphaAnimation = new AlphaAnimation(1, 1);
// alphaAnimation.setDuration(100);
// alphaAnimation.setFillAfter(true);
// launchImageFrame.startAnimation(alphaAnimation);
Log.d("----------------", "----------------------清除启动页---------------");
view.removeView(launchImageFrame);
launchImageFrame = null;
view = null;
}
}
});
timer=null;
}
},100);

if(view!=null&&launchImageFrame!=null){
Log.d("----------------","----------------------清除启动页---------------");
view.removeView(launchImageFrame);
}
launchImageFrame=null;
view=null;

}

@Override
@@ -138,7 +168,7 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN
public Map getSetting() {
Map map = new HashMap();
map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989");
// map.put("domain", "http://192.168.0.113:5000");
// map.put("domain", "http://192.168.0.113:5000");45678910,
map.put("master_id", "123456");
map.put("secret_key", "123456");
// map.put("token", "123465");
@@ -152,8 +182,8 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN

@Override
public void initSuccess() {
Log.d("----------------","----------------------清除启动页---------------");
removeLaunchView();
Log.d("----------------", "----------------------清除启动页---------------");
removeLaunchView();
}

@Override


+ 4
- 0
example/android/app/src/main/res/values/color.xml 查看文件

@@ -0,0 +1,4 @@
<resources>
<color name="transport">#00000000</color><!--白色 -->
<color name="ivory">#FFFFF0</color><!--象牙色 -->
</resources>

+ 1
- 0
lib/dialog/global_dialog/activity_dialog/activity_dialog.dart 查看文件

@@ -59,6 +59,7 @@ class ActivityDialog extends StatelessWidget {
// margin: const EdgeInsets.symmetric(horizontal: 40),
width: MediaQuery.of(context).size.width * 0.7,
child: CachedNetworkImage(
fadeInDuration: Duration(milliseconds: 0),
imageUrl: model?.img ?? '',
),
),


+ 30
- 17
lib/models/app_config_model.dart 查看文件

@@ -1,3 +1,6 @@
import 'dart:convert';

import 'package:zhiying_comm/util/shared_prefe_util.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

// 应用配置信息
@@ -5,34 +8,47 @@ import 'package:zhiying_comm/zhiying_comm.dart';
class AppConfigModel {
// 应用配置的key
AppConfigKeyModel keys;

// 引导页
AppConfigGuideModel guideImage;

static AppConfigModel _config;

AppConfigModel({this.keys, this.guideImage});
static AppConfigModel getConfig() => _config;

static Future<AppConfigModel> init() async {
Map result =
await NetUtil.post('/api/v1/app/guide', method: NetMethod.GET);
static Future<AppConfigModel> init({bool isGetCache = false}) async {
try {
var data = result['data'];
_config = AppConfigModel.fromJson(Map<String, dynamic>.from(data));
Logger.debug('基础设置初始化');
return _config;
String cacheData = await SharedPreferencesUtil.getStringValue(GlobalConfig.MAIN_CONFIG, defaultVal: '1');
if (isGetCache && cacheData != '1') {
_config = AppConfigModel.fromJson(Map<String, dynamic>.from(json.decode(cacheData)));
Logger.debug('基础设置初始化');
NetUtil.request('/api/v1/app/guide', onSuccess: (data) {
print(data);
var cacheString = json.encode(data);
SharedPreferencesUtil.setNetCacheResult(GlobalConfig.GUIDE, cacheString);
});
return _config;
} else {
Map result = await NetUtil.post('/api/v1/app/guide', method: NetMethod.GET);
var data = result['data'];
_config = AppConfigModel.fromJson(Map<String, dynamic>.from(data));
Logger.debug('基础设置初始化');
SharedPreferencesUtil.setNetCacheResult(GlobalConfig.GUIDE, json.encode(data));
return _config;
}
} catch (err) {
Logger.error(err);

return null;
}
return null;
}

AppConfigModel.fromJson(Map<String, dynamic> json) {
keys = json['keys'] != null ? new AppConfigKeyModel.fromJson(json['keys']) : null;
guideImage = json['guide_image'] != null
? new AppConfigGuideModel.fromJson(json['guide_image'])
: null;
guideImage = json['guide_image'] != null ? new AppConfigGuideModel.fromJson(json['guide_image']) : null;
}

Map<String, dynamic> toJson() {
@@ -59,12 +75,9 @@ class AppConfigKeyModel {
AppConfigKeyModel.fromJson(Map<String, dynamic> json) {
weibo = json['weibo'] != null ? new AppConfigKeyItemModel.fromJson(json['weibo']) : null;
qq = json['qq'] != null ? new AppConfigKeyItemModel.fromJson(json['qq']) : null;
weixin =
json['weixin'] != null ? new AppConfigKeyItemModel.fromJson(json['weixin']) : null;
weixin = json['weixin'] != null ? new AppConfigKeyItemModel.fromJson(json['weixin']) : null;
jdIos = json['jd_ios'] != null ? new AppConfigKeyItemModel.fromJson(json['jd_ios']) : null;
jdAndroid = json['jd_android'] != null
? new AppConfigKeyItemModel.fromJson(json['jd_android'])
: null;
jdAndroid = json['jd_android'] != null ? new AppConfigKeyItemModel.fromJson(json['jd_android']) : null;
}

Map<String, dynamic> toJson() {


+ 1
- 1
lib/pages/message_notice_page/bloc/message_notice_repository.dart 查看文件

@@ -84,7 +84,7 @@ class MessageNoticeRepository {
try{
_oldData.forEach((element){
if(element.id == selectId) {
element.unread_count = '';
element.unreadCount = '';
}
});
return MessageNoticeDataModel()..list = _oldData;


+ 114
- 54
lib/pages/message_notice_page/message_notice_page.dart 查看文件

@@ -1,3 +1,5 @@
import 'dart:convert';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -52,16 +54,15 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine

/// 子item点击事件
void _onMainItemClick(MainNotificationStyleItem styleModel, MessageNoticeDataItemModel dataModel) {

/// 消除消息红点
BlocProvider.of<MessageNoticeBloc>(context).add(MessageNoticeClearPointEvent(selectId: dataModel?.id));
BlocProvider.of<MessageNoticeBloc>(context).add(MessageNoticeClearPointEvent(selectId: dataModel?.id.toString()));

/// 如果是消息中心,则重新打开页面加载
Navigator.push(context, CupertinoPageRoute(builder: (_) => MessageNoticePage({'NoticePageType': styleModel?.type, 'NoticePageTitle': styleModel?.name})));
}

/// 子item点击的公共跳转
void _onItemClick(SkipModel model){
void _onItemClick(SkipModel model) {
RouterUtil.route(model, model.toJson(), context);
}

@@ -162,7 +163,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine

/// 交易通知
if (styleType == 'transaction_notification') {
return _buildTradeNoticeStyleWidget(styleModel?.transaction_notification, itemDataModel);
return _buildOfficialNoticeStyleWidget2(styleModel?.transaction_notification, itemDataModel);
}

/// 推广通知
@@ -236,7 +237,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
width: double.infinity,
child: Row(
children: <Widget>[
_buildCustomerAvatarWidget(icon: styleModel?.icon, unreadBgColor: unreadBgColor, unreadTextColor: unreadTextColor, value: dataModel?.unread_count),
_buildCustomerAvatarWidget(icon: styleModel?.icon, unreadBgColor: unreadBgColor, unreadTextColor: unreadTextColor, value: dataModel?.unreadCount),
const SizedBox(width: 10),
Expanded(
child: Column(
@@ -251,14 +252,14 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
styleModel?.name ?? '官方活动',
style: TextStyle(color: HexColor.fromHex(styleModel?.name_color ?? '#333333'), fontWeight: FontWeight.bold, fontSize: 13),
),
Text(dataModel?.date_time ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 12)),
Text(dataModel?.dateTime ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 12)),
],
),
Padding(
padding: const EdgeInsets.only(right: 22),
child: Text(
//'2020年6月23日4:00至6月30日4:00关闭提现aaa',
dataModel?.main_preview ?? '',
dataModel?.messageContent.title ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: HexColor.fromHex(styleModel?.value_color ?? '#999999'), fontSize: 12),
@@ -280,7 +281,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 官方通知样式
Widget _buildOfficialNoticeStyleWidget(OfficialNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: ()=> _onItemClick(dataModel),
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10),
@@ -303,14 +304,14 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
children: <Widget>[
/// 标题
Text(
dataModel?.title ?? '',
dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold),
),
const SizedBox(height: 5),

/// 内容
Text(
dataModel?.subtitle ?? '',
dataModel?.messageContent.title ?? '',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11),
@@ -325,7 +326,64 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(
dataModel?.date_time ?? '',
dataModel?.dateTime ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11),
))
],
),
),
);
}

/// 交易通知样式
Widget _buildOfficialNoticeStyleWidget2(TransactionNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10),
margin: const EdgeInsets.only(bottom: 7.5),
decoration: BoxDecoration(
color: HexColor.fromHex(styleModel?.bg_color ?? '#FFFFFF'),
borderRadius: BorderRadius.circular(7.5),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_buildCustomerAvatarWidget(icon: styleModel?.icon),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
/// 标题
Text(
dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold),
),
const SizedBox(height: 5),

/// 内容
Text(
dataModel?.messageContent.title ?? '',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11),
)
],
),
)
],
),

/// 时间
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(
dataModel?.dateTime ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11),
))
],
@@ -337,7 +395,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 官方活动样式
Widget _buildOfficialActivitiesStyleWidget(OfficialActivityStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: ()=> _onItemClick(dataModel),
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10),
@@ -348,7 +406,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
children: <Widget>[
/// 标题
Text(
dataModel?.title ?? '',
dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontWeight: FontWeight.bold, fontSize: 14),
maxLines: 1,
overflow: TextOverflow.ellipsis,
@@ -359,14 +417,14 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
ClipRRect(
borderRadius: BorderRadius.circular(7.5),
child: CachedNetworkImage(
imageUrl: dataModel?.img ?? '',
imageUrl: dataModel?.messageContent?.image ?? '',
width: double.infinity,
)),
const SizedBox(height: 6.5),

/// 活动内容
Text(
dataModel?.subtitle ?? '',
dataModel?.messageContent?.content ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 11, color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999')),
@@ -374,7 +432,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine

/// 时间
const SizedBox(height: 7),
Text(dataModel?.date_time ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11))
Text(dataModel?.dateTime ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11))
],
),
),
@@ -384,7 +442,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 交易通知样式
Widget _buildTradeNoticeStyleWidget(TransactionNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: ()=> _onItemClick(dataModel),
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10),
@@ -406,11 +464,12 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
/// 标题
Text(dataModel?.title ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)),
Text(dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)),
const SizedBox(height: 5),

/// 内容
_buildCustomerTradeContentWidget(styleModel, dataModel?.transactions),
// _buildCustomerTradeContentWidget(styleModel, dataModel?.transactions),
],
),
)
@@ -420,7 +479,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 时间
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(dataModel?.date_time ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
child: Text(dataModel?.dateTime ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
],
),
),
@@ -430,7 +489,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 推广通知样式
Widget _buildPromoteNoticeStyleWidget(PromotionNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: ()=> _onItemClick(dataModel),
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 12.5, bottom: 10),
@@ -445,7 +504,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_buildCustomerAvatarWidget(icon: dataModel?.img),
_buildCustomerAvatarWidget(icon: styleModel?.icon),
const SizedBox(width: 10),
Expanded(
child: Column(
@@ -453,14 +512,14 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
children: <Widget>[
/// 标题
Text(
dataModel?.title ?? '',
dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold),
),
const SizedBox(height: 5),

/// 内容
Text(
dataModel?.subtitle ?? '恭喜您成功邀请152****5887加入您的团队,快带领小伙伴走向致富之路吧!',
dataModel?.messageContent?.content ?? '恭喜您成功邀请152****5887加入您的团队,快带领小伙伴走向致富之路吧!',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11),
@@ -474,7 +533,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 时间
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(dataModel?.date_time ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
child: Text(dataModel?.dateTime ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
],
),
),
@@ -484,7 +543,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 反馈通知样式
Widget _buildFeedbackNoticeStyleWidget(FeedbackNotificationStyle styleModel, MessageNoticeDataItemModel dataModel) {
return GestureDetector(
onTap: ()=> _onItemClick(dataModel),
onTap: () => _onItemClick(SkipModel.fromJson(json.decode(dataModel.skipIdentifier))),
behavior: HitTestBehavior.opaque,
child: Container(
padding: const EdgeInsets.only(left: 15, right: 15, top: 14, bottom: 10),
@@ -506,11 +565,12 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
/// 标题
Text(dataModel?.title ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)),
Text(dataModel?.messageContent.title ?? '',
style: TextStyle(color: HexColor.fromHex(styleModel?.title_value_color ?? '#333333'), fontSize: 14, fontWeight: FontWeight.bold)),
const SizedBox(height: 3),

/// 内容
Text(dataModel?.subtitle ?? '',
Text( dataModel?.messageContent?.content ?? '',
maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'), fontSize: 11))
],
),
@@ -521,7 +581,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
/// 时间
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text(dataModel?.date_time ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
child: Text(dataModel?.dateTime ?? '', style: TextStyle(color: HexColor.fromHex(styleModel?.time_color ?? '#D8D8D8'), fontSize: 11)))
],
),
),
@@ -581,7 +641,7 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
borderRadius: BorderRadius.circular(6),
border: Border.all(color: HexColor.fromHex('#FFFFFF'), width: 0.5)),
child: Text(
value?? '',
value ?? '',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 9, color: HexColor.fromHex(unreadTextColor ?? '#FFFFFF')),
),
@@ -593,28 +653,28 @@ class __MessageNoticePageContainerState extends State<_MessageNoticePageContaine
);
}

/// 转账自定义widget
Widget _buildCustomerTradeContentWidget(TransactionNotificationStyle styleModel, List<TransactionBodyItemModel> transactions) {
List<Widget> lists = [];
transactions.forEach((element) {
bool isearnings = (element?.type ?? '') == 'earnings';
lists.add(Padding(
padding: const EdgeInsets.only(bottom: 5),
child: RichText(
textAlign: TextAlign.start,
text: TextSpan(children: [
TextSpan(text: element?.text ?? '', style: TextStyle(fontSize: 11, color: HexColor.fromHex( styleModel?.message_value_color ?? '#999999'))),
TextSpan(text: element?.data ?? '', style: TextStyle(fontSize: 11, color: HexColor.fromHex( isearnings ?
styleModel?.earnings ?? '#FF0100'
: styleModel?.message_value_color ?? '#999999'))),
]),
),
));
});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: lists,
);
}
// /// 转账自定义widget
// Widget _buildCustomerTradeContentWidget(TransactionNotificationStyle styleModel, List<TransactionBodyItemModel> transactions) {
// List<Widget> lists = [];
// transactions.forEach((element) {
// bool isearnings = (element?.type ?? '') == 'earnings';
// lists.add(Padding(
// padding: const EdgeInsets.only(bottom: 5),
// child: RichText(
// textAlign: TextAlign.start,
// text: TextSpan(children: [
// TextSpan(text: element?.text ?? '', style: TextStyle(fontSize: 11, color: HexColor.fromHex(styleModel?.message_value_color ?? '#999999'))),
// TextSpan(
// text: element?.data ?? '',
// style: TextStyle(fontSize: 11, color: HexColor.fromHex(isearnings ? styleModel?.earnings ?? '#FF0100' : styleModel?.message_value_color ?? '#999999'))),
// ]),
// ),
// ));
// });
//
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: lists,
// );
// }
}

+ 48
- 84
lib/pages/message_notice_page/model/message_notice_data_model.dart 查看文件

@@ -1,18 +1,17 @@
import 'dart:convert';

import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart';
import 'package:zhiying_comm/models/base/skip_model.dart';
import 'package:zhiying_comm/util/empty_util.dart';
import 'dart:convert' as Con;

class MessageNoticeDataModel {
List<MessageNoticeDataItemModel> list;

MessageNoticeDataModel({this.list});

factory MessageNoticeDataModel.fromJson(Map<String, dynamic> json) {
return MessageNoticeDataModel(
list: json['list'] != null ? (json['list'] as List).map((i) => MessageNoticeDataItemModel.fromJson(i)).toList() : null,
);
MessageNoticeDataModel.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
list = new List<MessageNoticeDataItemModel>();
json['list'].forEach((v) {
list.add(new MessageNoticeDataItemModel.fromJson(v));
});
}
}

Map<String, dynamic> toJson() {
@@ -24,100 +23,65 @@ class MessageNoticeDataModel {
}
}

class MessageNoticeDataItemModel extends SkipModel {
String unread_count;
String receiver;
String body;
String date_time;
String id;
String img;
String main_preview;
String oid;
String sender;
String status;
String subtitle;
String title;
class MessageNoticeDataItemModel {
String unreadCount;
String type;
List<TransactionBodyItemModel> transactions;
int id;
int receiver;
String content;
String skipIdentifier;
int status;
String dateTime;
MessageContent messageContent;

MessageNoticeDataItemModel({
this.unread_count,
this.receiver,
this.body,
this.date_time,
this.id,
this.img,
this.main_preview,
this.oid,
this.sender,
this.status,
this.subtitle,
this.title,
this.type,
this.transactions,
});
MessageNoticeDataItemModel({this.unreadCount, this.type, this.id, this.receiver, this.content, this.skipIdentifier, this.status, this.dateTime});

MessageNoticeDataItemModel.fromJson(Map<String, dynamic> json) {
super.fromJson(json);
unread_count = json['unread_count']?.toString();
receiver = json['receiver']?.toString();
body = json['body']?.toString();
date_time = json['date_time']?.toString();
id = json['id']?.toString();
img = json['img']?.toString();
main_preview = json['main_preview']?.toString();
oid = json['oid']?.toString();
sender = json['sender']?.toString();
status = json['status']?.toString();
subtitle = json['subtitle']?.toString();
title = json['title']?.toString();
type = json['type']?.toString();
transactions = (!EmptyUtil.isEmpty(json['body']) && jsonDecode(json['body']) != null)
? (jsonDecode(json['body']) as List).map((e) => TransactionBodyItemModel.fromJson(e)).toList()
: null;
unreadCount = json['unread_count'];
type = json['type'];
id = json['id'];
receiver = json['receiver'];
content = json['content'];
skipIdentifier = json['skip_identifier'];
status = json['status'];
dateTime = json['date_time'];
if(json['content']!=null){
messageContent=MessageContent.fromJson(Con.json.decode(json['content']));
}
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = super.toJson();
data['receiver'] = this.receiver;
data['body'] = this.body;
data['date_time'] = this.date_time;
final Map<String, dynamic> data = new Map<String, dynamic>();
data['unread_count'] = this.unreadCount;
data['type'] = this.type;
data['id'] = this.id;
data['img'] = this.img;
data['main_preview'] = this.main_preview;
data['oid'] = this.oid;
data['sender'] = this.sender;
data['receiver'] = this.receiver;
data['content'] = this.content;
data['skip_identifier'] = this.skipIdentifier;
data['status'] = this.status;
data['subtitle'] = this.subtitle;
data['title'] = this.title;
data['type'] = this.type;
if (null != this.transactions) {
data['transactions'] = this.transactions.map((e) => e.toJson()).toList();
}
data['date_time'] = this.dateTime;
return data;
}
}

class TransactionBodyItemModel {
String data;
String text;
String type;
class MessageContent {
String title;
String content;
String image;

TransactionBodyItemModel({this.data, this.text, this.type});
MessageContent({this.title, this.content, this.image});

factory TransactionBodyItemModel.fromJson(Map<String, dynamic> json) {
return TransactionBodyItemModel(
data: json['data'],
text: json['text'],
type: json['type'],
);
MessageContent.fromJson(Map<String, dynamic> json) {
title = json['title'];
content = json['content'];
image = json['image'];
}

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['data'] = this.data;
data['text'] = this.text;
data['type'] = this.type;
data['title'] = this.title;
data['content'] = this.content;
data['image'] = this.image;
return data;
}
}

+ 2
- 1
lib/pages/withdraw_page/withdraw_page.dart 查看文件

@@ -138,8 +138,9 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
title: Text(
model.appBarName,
style: TextStyle(
fontSize: 15,
fontSize: 17,
color: HexColor.fromHex(model.appBarNameColor),
fontWeight: FontWeight.w600
),
),
actions:<Widget>[ GestureDetector(


+ 1
- 1
lib/register.dart 查看文件

@@ -108,7 +108,7 @@ class BaseWidgetRegister {
});

Application.addMethod(() async {
AppConfigModel config = await AppConfigModel.init();
AppConfigModel config = await AppConfigModel.init(isGetCache: true);
if (config == null) {
Logger.debug('app 初始化失败');
return;


+ 4
- 0
lib/widgets/home/home_goods/home_goods_header.dart 查看文件

@@ -90,6 +90,10 @@ class _HomeGoodsHeaderState extends State<_HomeGoodsHeader>
Widget build(BuildContext context) {
_widgets.clear();

if(_style.recommendList.length<2){
return Container();
}

for (int index = 0; index < _style.recommendList.length; index++) {
_widgets.add(_HomeGoodsHeaderItem(
_style.recommendList[index],


+ 1
- 0
lib/zhiying_base_widget.dart 查看文件

@@ -1,3 +1,4 @@
library zhiying_base_widget;

export 'dialog/loading/loading.dart';
export 'package:flutter_swiper/flutter_swiper.dart';

||||||
x
 
000:0
Loading…
取消
儲存