Commit 1055344925536b51680c91624d0bd0bd2d10768d

Authored by wdn127929
1 parent 7858d78b

积分显示改变

@@ -28,21 +28,25 @@ class IntegralModel extends Object { @@ -28,21 +28,25 @@ class IntegralModel extends Object {
28 @JsonSerializable() 28 @JsonSerializable()
29 class IntegralSunModel extends Object { 29 class IntegralSunModel extends Object {
30 @JsonKey(name: 'myIntegral') 30 @JsonKey(name: 'myIntegral')
31 - String myIntegral; 31 + dynamic myIntegral;
32 32
33 @JsonKey(name: 'Cumulative') 33 @JsonKey(name: 'Cumulative')
34 - String cumulative; 34 + dynamic cumulative;
35 35
36 - @JsonKey(name: 'Converted')  
37 - String converted; 36 + @JsonKey(name: 'benyue')
  37 + dynamic benyue;
  38 +
  39 + @JsonKey(name: 'shangyue')
  40 + dynamic shangyue;
38 41
39 @JsonKey(name: 'reviewed') 42 @JsonKey(name: 'reviewed')
40 - String reviewed; 43 + dynamic reviewed;
41 44
42 IntegralSunModel( 45 IntegralSunModel(
43 this.myIntegral, 46 this.myIntegral,
44 this.cumulative, 47 this.cumulative,
45 - this.converted, 48 + this.benyue,
  49 + this.shangyue,
46 this.reviewed, 50 this.reviewed,
47 ); 51 );
48 52
@@ -25,10 +25,11 @@ Map<String, dynamic> _$IntegralModelToJson(IntegralModel instance) => @@ -25,10 +25,11 @@ Map<String, dynamic> _$IntegralModelToJson(IntegralModel instance) =>
25 25
26 IntegralSunModel _$IntegralSunModelFromJson(Map<String, dynamic> json) { 26 IntegralSunModel _$IntegralSunModelFromJson(Map<String, dynamic> json) {
27 return IntegralSunModel( 27 return IntegralSunModel(
28 - json['myIntegral'] as String,  
29 - json['Cumulative'] as String,  
30 - json['Converted'] as String,  
31 - json['reviewed'] as String, 28 + json['myIntegral'] as dynamic,
  29 + json['Cumulative'] as dynamic,
  30 + json['benyue'] as dynamic,
  31 + json['shangyue'] as dynamic,
  32 + json['reviewed'] as dynamic,
32 ); 33 );
33 } 34 }
34 35
@@ -36,6 +37,7 @@ Map<String, dynamic> _$IntegralSunModelToJson(IntegralSunModel instance) => @@ -36,6 +37,7 @@ Map<String, dynamic> _$IntegralSunModelToJson(IntegralSunModel instance) =>
36 <String, dynamic>{ 37 <String, dynamic>{
37 'myIntegral': instance.myIntegral, 38 'myIntegral': instance.myIntegral,
38 'Cumulative': instance.cumulative, 39 'Cumulative': instance.cumulative,
39 - 'Converted': instance.converted, 40 + 'benyue': instance.benyue,
  41 + 'shangyue': instance.shangyue,
40 'reviewed': instance.reviewed, 42 'reviewed': instance.reviewed,
41 }; 43 };
@@ -43,128 +43,196 @@ class _MyIntegralPageState extends State<MyIntegralPage> { @@ -43,128 +43,196 @@ class _MyIntegralPageState extends State<MyIntegralPage> {
43 Navigator.of(context).pop(); 43 Navigator.of(context).pop();
44 }, 44 },
45 ), 45 ),
46 - body: Container(  
47 - child: SingleChildScrollView(  
48 - child: Column(  
49 - crossAxisAlignment: CrossAxisAlignment.center,  
50 - children: [  
51 - Stack(  
52 - clipBehavior: Clip.none,  
53 - children: [  
54 - Container(  
55 - height: ScreenUtil().setWidth(145 * 2),  
56 - color: MyColours.color_199095,  
57 - child: Column(  
58 - crossAxisAlignment: CrossAxisAlignment.center,  
59 - children: [  
60 - VEmptyView(40),  
61 - Container(  
62 - alignment: Alignment.center,  
63 - width: double.infinity,  
64 - height: ScreenUtil().setWidth(56 * 2),  
65 - child: Text(  
66 - widget.sunModel?.myIntegral != null  
67 - ? widget.sunModel.myIntegral  
68 - : '0',  
69 - style: TextStyle(  
70 - fontSize: ScreenUtil().setSp(80),  
71 - color: MyColours.color_fefefe,  
72 - fontWeight: FontWeight.bold),  
73 - )),  
74 - Container(  
75 - alignment: Alignment.center,  
76 - width: double.infinity,  
77 - height: ScreenUtil().setWidth(20 * 2),  
78 - child: Text(  
79 - '当前积分',  
80 - style: TextStyle(  
81 - fontSize: ScreenUtil().setSp(28),  
82 - color: Color.fromRGBO(255, 255, 255, 0.6),  
83 - ),  
84 - ),  
85 - )  
86 - ],  
87 - ),  
88 - ),  
89 - Positioned(  
90 - top: ScreenUtil().setWidth(145 * 2 - 18 * 2),  
91 - left: ScreenUtil().setWidth(20),  
92 - right: ScreenUtil().setWidth(20),  
93 - child: Column(children: [  
94 - Container(  
95 - padding: EdgeInsets.symmetric(  
96 - vertical: ScreenUtil().setWidth(20)),  
97 - // height: ScreenUtil().setWidth(205 * 2),  
98 - decoration: BoxDecoration(  
99 - borderRadius: BorderRadius.circular(  
100 - ScreenUtil().setWidth(40)),  
101 - color: Colors.white),  
102 - child: Column( 46 + body: NestedScrollView(
  47 + // controller: _scrollViewController,
  48 + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
  49 + return <Widget>[
  50 + SliverAppBar(
  51 + automaticallyImplyLeading: false,
  52 + pinned: false,
  53 + floating: false,
  54 + backgroundColor: MyColours.color_f5f5f5,
  55 + expandedHeight: ScreenUtil().setWidth(386 * 2 + 40),
  56 + flexibleSpace: FlexibleSpaceBar(
  57 + collapseMode: CollapseMode.pin,
  58 + background: Column(
  59 + crossAxisAlignment: CrossAxisAlignment.center,
103 children: [ 60 children: [
104 - MyItem(  
105 - title: '已兑换积分',  
106 - content: widget.sunModel?.converted != null  
107 - ? widget.sunModel.converted  
108 - : '0',  
109 - needRadius: true, 61 + Stack(
  62 + clipBehavior: Clip.none,
  63 + children: [
  64 + Container(
  65 + height: ScreenUtil().setWidth(145 * 2),
  66 + color: MyColours.color_199095,
  67 + child: Column(
  68 + crossAxisAlignment:
  69 + CrossAxisAlignment.center,
  70 + children: [
  71 + VEmptyView(40),
  72 + Container(
  73 + alignment: Alignment.center,
  74 + width: double.infinity,
  75 + height: ScreenUtil().setWidth(56 * 2),
  76 + child: Text(
  77 + widget.sunModel?.myIntegral != null
  78 + ? widget.sunModel.myIntegral
  79 + : '0',
  80 + style: TextStyle(
  81 + fontSize:
  82 + ScreenUtil().setSp(80),
  83 + color: MyColours.color_fefefe,
  84 + fontWeight: FontWeight.bold),
  85 + )),
  86 + Container(
  87 + alignment: Alignment.center,
  88 + width: double.infinity,
  89 + height: ScreenUtil().setWidth(20 * 2),
  90 + child: Text(
  91 + '当前积分',
  92 + style: TextStyle(
  93 + fontSize: ScreenUtil().setSp(28),
  94 + color: Color.fromRGBO(
  95 + 255, 255, 255, 0.6),
  96 + ),
  97 + ),
  98 + )
  99 + ],
  100 + ),
  101 + ),
  102 + Positioned(
  103 + top:
  104 + ScreenUtil().setWidth(145 * 2 - 18 * 2),
  105 + left: ScreenUtil().setWidth(20),
  106 + right: ScreenUtil().setWidth(20),
  107 + child: Column(children: [
  108 + Container(
  109 + // color: Colors.red,
  110 + padding: EdgeInsets.symmetric(
  111 + vertical:
  112 + ScreenUtil().setWidth(20)),
  113 + // height: ScreenUtil().setWidth(205 * 2),
  114 + decoration: BoxDecoration(
  115 + borderRadius: BorderRadius.circular(
  116 + ScreenUtil().setWidth(40)),
  117 + color: Colors.white),
  118 + child: Column(
  119 + children: [
  120 + MyItem(
  121 + title: '上月积分',
  122 + content: widget
  123 + .sunModel?.shangyue !=
  124 + null
  125 + ? '${widget.sunModel.shangyue}'
  126 + : '0',
  127 + needRadius: true,
  128 + ),
  129 + Padding(
  130 + padding: EdgeInsets.symmetric(
  131 + horizontal: ScreenUtil()
  132 + .setWidth(40)),
  133 + child: MyDivider(
  134 + double.infinity,
  135 + ScreenUtil().setWidth(2),
  136 + color: MyColours.color_f3f3f3,
  137 + )),
  138 + MyItem(
  139 + title: '累计积分',
  140 + content: widget.sunModel
  141 + ?.cumulative !=
  142 + null
  143 + ? '${widget.sunModel.cumulative}'
  144 + : '0',
  145 + needRadius: true,
  146 + ),
  147 + Padding(
  148 + padding: EdgeInsets.symmetric(
  149 + horizontal: ScreenUtil()
  150 + .setWidth(40)),
  151 + child: MyDivider(
  152 + double.infinity,
  153 + ScreenUtil().setWidth(2),
  154 + color: MyColours.color_f3f3f3,
  155 + )),
  156 + MyItem(
  157 + title: '本月积分',
  158 + content: widget
  159 + .sunModel?.benyue !=
  160 + null
  161 + ? '${widget.sunModel.cumulative}'
  162 + : '0',
  163 + needRadius: true,
  164 + ),
  165 + Padding(
  166 + padding: EdgeInsets.symmetric(
  167 + horizontal: ScreenUtil()
  168 + .setWidth(40)),
  169 + child: MyDivider(
  170 + double.infinity,
  171 + ScreenUtil().setWidth(2),
  172 + color: MyColours.color_f3f3f3,
  173 + )),
  174 + MyItem(
  175 + title: '待审核积分',
  176 + content: widget
  177 + .sunModel?.reviewed !=
  178 + null
  179 + ? '${widget.sunModel.reviewed}'
  180 + : '0',
  181 + needRadius: true,
  182 + )
  183 + ],
  184 + ),
  185 + ),
  186 + // VEmptyView(60),
  187 + // RoundButton(
  188 + // onPressed: () async {},
  189 + // text: '兑换',
  190 + // fontSize: 34,
  191 + // isBold: false,
  192 + // height: ScreenUtil().setWidth(84),
  193 + // width: ScreenUtil().setWidth(155 * 2),
  194 + // radius: ScreenUtil().setWidth(10),
  195 + // ),
  196 + // VEmptyView(100),
  197 + // Padding(
  198 + // padding: EdgeInsets.symmetric(
  199 + // horizontal: ScreenUtil().setWidth(40)),
  200 + // child: Text(
  201 + // '积分规则:\n1.每成功创建一个内部预订的预订安排微信发送给客户并且客户打开后,获得10积分;\n2.每个餐厅每天每个时段预订安排发送总量不能超过现有桌位数;\n3.同一顾客同一时段的订单,积分只给最早创建内部预订的经理;\n4.订单创建人转发的预订安排,才可获得积分,转发他人创建的订单无效。',
  202 + // style: TextStyle(
  203 + // fontSize: ScreenUtil().setSp(24),
  204 + // color: MyColours.color_999999,
  205 + // height: 1.3)))
  206 + ])),
  207 + ],
110 ), 208 ),
111 - Padding(  
112 - padding: EdgeInsets.symmetric(  
113 - horizontal: ScreenUtil().setWidth(40)),  
114 - child: MyDivider(  
115 - double.infinity,  
116 - ScreenUtil().setWidth(2),  
117 - color: MyColours.color_f3f3f3,  
118 - )),  
119 - MyItem(  
120 - title: '累计积分',  
121 - content: widget.sunModel?.cumulative != null  
122 - ? widget.sunModel.cumulative  
123 - : '0',  
124 - needRadius: true,  
125 - ),  
126 - Padding(  
127 - padding: EdgeInsets.symmetric(  
128 - horizontal: ScreenUtil().setWidth(40)),  
129 - child: MyDivider(  
130 - double.infinity,  
131 - ScreenUtil().setWidth(2),  
132 - color: MyColours.color_f3f3f3,  
133 - )),  
134 - MyItem(  
135 - title: '待审核积分',  
136 - content: widget.sunModel?.reviewed != null  
137 - ? widget.sunModel.reviewed  
138 - : '0',  
139 - needRadius: true,  
140 - )  
141 - ],  
142 - ),  
143 - ),  
144 - VEmptyView(60),  
145 - RoundButton(  
146 - onPressed: () async {},  
147 - text: '兑换',  
148 - fontSize: 34,  
149 - isBold: false,  
150 - height: ScreenUtil().setWidth(84),  
151 - width: ScreenUtil().setWidth(155 * 2),  
152 - radius: ScreenUtil().setWidth(10),  
153 - ),  
154 - VEmptyView(100),  
155 - Padding(  
156 - padding: EdgeInsets.symmetric(  
157 - horizontal: ScreenUtil().setWidth(40)),  
158 - child: Text(  
159 - '积分规则:\n1.每成功创建一个内部预订的预订安排微信发送给客户并且客户打开后,获得10积分;\n2.每个餐厅每天每个时段预订安排发送总量不能超过现有桌位数;\n3.同一顾客同一时段的订单,积分只给最早创建内部预订的经理;\n4.订单创建人转发的预订安排,才可获得积分,转发他人创建的订单无效。',  
160 - style: TextStyle(  
161 - fontSize: ScreenUtil().setSp(24),  
162 - color: MyColours.color_999999,  
163 - height: 1.3)))  
164 - ])),  
165 - ],  
166 - ),  
167 - ],  
168 - )))); 209 + ])))
  210 + ];
  211 + },
  212 + body: Column(
  213 + children: [
  214 + // VEmptyView(60),
  215 + // RoundButton(
  216 + // onPressed: () async {},
  217 + // text: '兑换',
  218 + // fontSize: 34,
  219 + // isBold: false,
  220 + // height: ScreenUtil().setWidth(84),
  221 + // width: ScreenUtil().setWidth(155 * 2),
  222 + // radius: ScreenUtil().setWidth(10),
  223 + // ),
  224 + VEmptyView(100),
  225 + Padding(
  226 + padding: EdgeInsets.symmetric(
  227 + horizontal: ScreenUtil().setWidth(40)),
  228 + child: Text(
  229 + '积分规则:\n1.每成功创建一个内部预订的预订安排微信发送给客户并且客户打开后,获得10积分;\n2.每个餐厅每天每个时段预订安排发送总量不能超过现有桌位数;\n3.同一顾客同一时段的订单,积分只给最早创建内部预订的经理;\n4.订单创建人转发的预订安排,才可获得积分,转发他人创建的订单无效;\n5.每个就餐用户在一个店铺,每7天只能提供一个有效订单获得积分。',
  230 + style: TextStyle(
  231 + fontSize: ScreenUtil().setSp(24),
  232 + color: MyColours.color_999999,
  233 + height: 1.3)))
  234 + ],
  235 + ),
  236 + ));
169 } 237 }
170 } 238 }
@@ -90,7 +90,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -90,7 +90,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
90 90
91 ///获取短信余量 91 ///获取短信余量
92 _getSmsInfo(context) async { 92 _getSmsInfo(context) async {
93 - myModel = Provider.of<MyModel>(context, listen: false); 93 + // myModel = Provider.of<MyModel>(context, listen: false);
94 await myModel.getSmsInfo(context); 94 await myModel.getSmsInfo(context);
95 // setState(() { 95 // setState(() {
96 // if (smsInfoData != null) { 96 // if (smsInfoData != null) {
@@ -176,6 +176,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -176,6 +176,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
176 VEmptyView(20), 176 VEmptyView(20),
177 InkWell( 177 InkWell(
178 onTap: () { 178 onTap: () {
  179 + // print(myModel.integralSunModel);
179 NavigatorUtil.goMyIntegralPage(context, 180 NavigatorUtil.goMyIntegralPage(context,
180 sunModel: myModel.integralSunModel); 181 sunModel: myModel.integralSunModel);
181 }, 182 },
@@ -72,6 +72,7 @@ class MyModel extends ChangeNotifier { @@ -72,6 +72,7 @@ class MyModel extends ChangeNotifier {
72 72
73 if (baseResp?.code == Constant.status_success) { 73 if (baseResp?.code == Constant.status_success) {
74 integralSunModel = IntegralModel.fromJson(baseResp.responseData).data; 74 integralSunModel = IntegralModel.fromJson(baseResp.responseData).data;
  75 + print(integralSunModel);
75 } else { 76 } else {
76 print('查询失败'); 77 print('查询失败');
77 } 78 }