Showing
7 changed files
with
360 additions
and
68 deletions
assets/share.png
0 → 100644
755 Bytes
| @@ -58,8 +58,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -58,8 +58,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 58 | 58 | ||
| 59 | _getActivityById() async { | 59 | _getActivityById() async { |
| 60 | pageState = PageState.Loading; | 60 | pageState = PageState.Loading; |
| 61 | - bool success = | ||
| 62 | - await couponProvider.getActivityById(context, {'id': widget.idstr}); | 61 | + bool success = await couponProvider |
| 62 | + .getActivityById(context, {'id': widget.idstr}, isShowLoading: false); | ||
| 63 | if (success) { | 63 | if (success) { |
| 64 | pageState = PageState.Success; | 64 | pageState = PageState.Success; |
| 65 | } else { | 65 | } else { |
| @@ -84,8 +84,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -84,8 +84,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 84 | child: Text( | 84 | child: Text( |
| 85 | title, | 85 | title, |
| 86 | style: TextStyle( | 86 | style: TextStyle( |
| 87 | - color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| 88 | - fontWeight: FontWeight.bold, | 87 | + color: MyColours.color_515151, |
| 89 | fontSize: ScreenUtil().setSp(32)), | 88 | fontSize: ScreenUtil().setSp(32)), |
| 90 | ), | 89 | ), |
| 91 | ), | 90 | ), |
| @@ -122,8 +121,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -122,8 +121,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 122 | child: Text( | 121 | child: Text( |
| 123 | title, | 122 | title, |
| 124 | style: TextStyle( | 123 | style: TextStyle( |
| 125 | - color: Color.fromRGBO(0, 0, 0, 0.9), | ||
| 126 | - fontWeight: FontWeight.bold, | 124 | + color: MyColours.color_515151, |
| 127 | fontSize: ScreenUtil().setSp(32)), | 125 | fontSize: ScreenUtil().setSp(32)), |
| 128 | ), | 126 | ), |
| 129 | ), | 127 | ), |
| @@ -176,6 +174,36 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -176,6 +174,36 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 176 | ); | 174 | ); |
| 177 | } | 175 | } |
| 178 | 176 | ||
| 177 | + ///是否立即启用 | ||
| 178 | + Widget _canUse(String title, bool swich) { | ||
| 179 | + return Container( | ||
| 180 | + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)), | ||
| 181 | + child: Row( | ||
| 182 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 183 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 184 | + children: [ | ||
| 185 | + Container( | ||
| 186 | + // height: ScreenUtil().setWidth(40), | ||
| 187 | + // color: Colors.red, | ||
| 188 | + child: Text( | ||
| 189 | + title, | ||
| 190 | + style: TextStyle( | ||
| 191 | + color: MyColours.color_515151, | ||
| 192 | + fontSize: ScreenUtil().setSp(32)), | ||
| 193 | + ), | ||
| 194 | + ), | ||
| 195 | + Spacer(), | ||
| 196 | + Image.asset( | ||
| 197 | + swich | ||
| 198 | + ? Utils.getImgPath('swich_on') | ||
| 199 | + : Utils.getImgPath('swich_off'), | ||
| 200 | + width: ScreenUtil().setWidth(44 * 2), | ||
| 201 | + ) | ||
| 202 | + ], | ||
| 203 | + ), | ||
| 204 | + ); | ||
| 205 | + } | ||
| 206 | + | ||
| 179 | @override | 207 | @override |
| 180 | Widget build(BuildContext context) { | 208 | Widget build(BuildContext context) { |
| 181 | couponProvider = Provider.of<CouponProvider>(context, listen: true); | 209 | couponProvider = Provider.of<CouponProvider>(context, listen: true); |
| @@ -186,6 +214,19 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -186,6 +214,19 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 186 | onTap: () { | 214 | onTap: () { |
| 187 | Navigator.pop(context); | 215 | Navigator.pop(context); |
| 188 | }, | 216 | }, |
| 217 | + rightImgName: couponProvider.couponSunModel.isType == '1' && | ||
| 218 | + couponProvider.couponSunModel.isExamine == '1' && | ||
| 219 | + couponProvider.couponSunModel.status == '1' | ||
| 220 | + ? 'share.png' | ||
| 221 | + : null, | ||
| 222 | + onTapRight: () { | ||
| 223 | + if (couponProvider.couponSunModel.isType == '1' && | ||
| 224 | + couponProvider.couponSunModel.isExamine == '1' && | ||
| 225 | + couponProvider.couponSunModel.status == '1') { | ||
| 226 | + //店铺可核销券 | ||
| 227 | + Utils.goShareBuyCouponToWeChat(context, widget.idstr); | ||
| 228 | + } | ||
| 229 | + }, | ||
| 189 | ), | 230 | ), |
| 190 | body: Consumer<CouponProvider>(builder: (context, model, _) { | 231 | body: Consumer<CouponProvider>(builder: (context, model, _) { |
| 191 | if (pageState != PageState.Success) { | 232 | if (pageState != PageState.Success) { |
| @@ -213,16 +254,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -213,16 +254,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 213 | _item( | 254 | _item( |
| 214 | '券类型', | 255 | '券类型', |
| 215 | couponProvider.couponSunModel.isType == '1' | 256 | couponProvider.couponSunModel.isType == '1' |
| 216 | - ? couponProvider.couponSunModel.isExamine == | ||
| 217 | - '1' | ||
| 218 | - ? '店铺优惠券(核销券)' | ||
| 219 | - : '店铺优惠券' | 257 | + ? '店铺优惠券' |
| 220 | : '我的优惠券'), | 258 | : '我的优惠券'), |
| 221 | Container( | 259 | Container( |
| 222 | height: ScreenUtil().setWidth(2), | 260 | height: ScreenUtil().setWidth(2), |
| 223 | color: MyColours.color_E7E7E7, | 261 | color: MyColours.color_E7E7E7, |
| 224 | ), | 262 | ), |
| 225 | VEmptyView(24), | 263 | VEmptyView(24), |
| 264 | + if (couponProvider.couponSunModel.isType == '1') | ||
| 265 | + Column( | ||
| 266 | + children: [ | ||
| 267 | + _canUse( | ||
| 268 | + '是否核销', | ||
| 269 | + couponProvider.couponSunModel.isExamine == | ||
| 270 | + '1' | ||
| 271 | + ? true | ||
| 272 | + : false), | ||
| 273 | + Container( | ||
| 274 | + height: ScreenUtil().setWidth(2), | ||
| 275 | + color: MyColours.color_E7E7E7, | ||
| 276 | + ), | ||
| 277 | + VEmptyView(24), | ||
| 278 | + ], | ||
| 279 | + ), | ||
| 226 | _item('券名称', couponProvider.couponSunModel.aname), | 280 | _item('券名称', couponProvider.couponSunModel.aname), |
| 227 | Container( | 281 | Container( |
| 228 | height: ScreenUtil().setWidth(2), | 282 | height: ScreenUtil().setWidth(2), |
| @@ -232,17 +286,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -232,17 +286,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 232 | if (couponProvider.couponSunModel.isType == '1' && | 286 | if (couponProvider.couponSunModel.isType == '1' && |
| 233 | couponProvider.couponSunModel.use != null) | 287 | couponProvider.couponSunModel.use != null) |
| 234 | Column( | 288 | Column( |
| 289 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 235 | children: [ | 290 | children: [ |
| 236 | _item( | 291 | _item( |
| 237 | - '销售价', | ||
| 238 | - couponProvider.couponSunModel.price ?? | ||
| 239 | - ''), | ||
| 240 | - Container( | ||
| 241 | - height: ScreenUtil().setWidth(2), | ||
| 242 | - color: MyColours.color_E7E7E7, | ||
| 243 | - ), | ||
| 244 | - VEmptyView(24), | ||
| 245 | - _item( | ||
| 246 | '券用途', | 292 | '券用途', |
| 247 | couponProvider.couponSunModel.use.isCash | 293 | couponProvider.couponSunModel.use.isCash |
| 248 | ? '代金券' | 294 | ? '代金券' |
| @@ -253,16 +299,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -253,16 +299,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 253 | .couponSunModel.use.isDish | 299 | .couponSunModel.use.isDish |
| 254 | ? '菜品券' | 300 | ? '菜品券' |
| 255 | : ''), | 301 | : ''), |
| 256 | - VEmptyView(10), | ||
| 257 | - _textShow( | 302 | + Container( |
| 303 | + height: ScreenUtil().setWidth(2), | ||
| 304 | + color: MyColours.color_E7E7E7, | ||
| 305 | + ), | ||
| 306 | + VEmptyView(24), | ||
| 307 | + _item( | ||
| 258 | couponProvider.couponSunModel.use.isCash | 308 | couponProvider.couponSunModel.use.isCash |
| 259 | - ? '金额:' | 309 | + ? '金额' |
| 260 | : couponProvider | 310 | : couponProvider |
| 261 | .couponSunModel.use.isDiscount | 311 | .couponSunModel.use.isDiscount |
| 262 | - ? '折扣率:' | 312 | + ? '折扣率' |
| 263 | : couponProvider | 313 | : couponProvider |
| 264 | .couponSunModel.use.isDish | 314 | .couponSunModel.use.isDish |
| 265 | - ? '菜品:' | 315 | + ? '菜品' |
| 266 | : '', | 316 | : '', |
| 267 | couponProvider.couponSunModel.use.isCash | 317 | couponProvider.couponSunModel.use.isCash |
| 268 | ? '${couponProvider.couponSunModel.use.cash}元' | 318 | ? '${couponProvider.couponSunModel.use.cash}元' |
| @@ -274,7 +324,15 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -274,7 +324,15 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 274 | ? couponProvider | 324 | ? couponProvider |
| 275 | .couponSunModel.use.dish | 325 | .couponSunModel.use.dish |
| 276 | : ''), | 326 | : ''), |
| 327 | + Container( | ||
| 328 | + height: ScreenUtil().setWidth(2), | ||
| 329 | + color: MyColours.color_E7E7E7, | ||
| 330 | + ), | ||
| 277 | VEmptyView(24), | 331 | VEmptyView(24), |
| 332 | + _item( | ||
| 333 | + '销售价', | ||
| 334 | + '${couponProvider.couponSunModel.price}元' ?? | ||
| 335 | + ''), | ||
| 278 | Container( | 336 | Container( |
| 279 | height: ScreenUtil().setWidth(2), | 337 | height: ScreenUtil().setWidth(2), |
| 280 | color: MyColours.color_E7E7E7, | 338 | color: MyColours.color_E7E7E7, |
| @@ -318,25 +376,44 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -318,25 +376,44 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 318 | ? '会员生日当天' | 376 | ? '会员生日当天' |
| 319 | : couponProvider.couponSunModel | 377 | : couponProvider.couponSunModel |
| 320 | .expDate.isWeek | 378 | .expDate.isWeek |
| 321 | - ? couponProvider.couponSunModel | ||
| 322 | - .expDate.weekShow | 379 | + ? '每周指定日期餐段可用' |
| 323 | : ''), | 380 | : ''), |
| 381 | + if (couponProvider | ||
| 382 | + .couponSunModel.expDate.isWeek) | ||
| 383 | + Align( | ||
| 384 | + alignment: Alignment.centerLeft, | ||
| 385 | + child: Padding( | ||
| 386 | + padding: EdgeInsets.only(left: w(16)), | ||
| 387 | + child: Text( | ||
| 388 | + couponProvider | ||
| 389 | + .couponSunModel.expDate.weekShow, | ||
| 390 | + textAlign: TextAlign.left, | ||
| 391 | + style: TextStyle( | ||
| 392 | + height: 1.5, | ||
| 393 | + fontSize: font(16), | ||
| 394 | + color: MyColours.color_999999), | ||
| 395 | + ), | ||
| 396 | + )), | ||
| 397 | + if (couponProvider | ||
| 398 | + .couponSunModel.expDate.isWeek) | ||
| 399 | + VEmptyView(24), | ||
| 324 | ]), | 400 | ]), |
| 325 | - couponProvider.couponSunModel.isType == '1' | ||
| 326 | - ? Column( | ||
| 327 | - crossAxisAlignment: | ||
| 328 | - CrossAxisAlignment.start, | ||
| 329 | - children: [ | ||
| 330 | - Container( | ||
| 331 | - height: ScreenUtil().setWidth(2), | ||
| 332 | - color: MyColours.color_E7E7E7, | ||
| 333 | - ), | ||
| 334 | - VEmptyView(24), | ||
| 335 | - _item('创建人', | ||
| 336 | - couponProvider.couponSunModel.uid), | ||
| 337 | - ], | ||
| 338 | - ) | ||
| 339 | - : SizedBox(), | 401 | + |
| 402 | + // couponProvider.couponSunModel.isType == '1' | ||
| 403 | + // ? Column( | ||
| 404 | + // crossAxisAlignment: | ||
| 405 | + // CrossAxisAlignment.start, | ||
| 406 | + // children: [ | ||
| 407 | + // Container( | ||
| 408 | + // height: ScreenUtil().setWidth(2), | ||
| 409 | + // color: MyColours.color_E7E7E7, | ||
| 410 | + // ), | ||
| 411 | + // VEmptyView(24), | ||
| 412 | + // _item('创建人', | ||
| 413 | + // couponProvider.couponSunModel.uid), | ||
| 414 | + // ], | ||
| 415 | + // ) | ||
| 416 | + // : SizedBox(), | ||
| 340 | couponProvider.couponSunModel.isType == '1' | 417 | couponProvider.couponSunModel.isType == '1' |
| 341 | ? Column( | 418 | ? Column( |
| 342 | crossAxisAlignment: | 419 | crossAxisAlignment: |
| @@ -375,19 +452,39 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | @@ -375,19 +452,39 @@ class _CouponDetailPageState extends State<CouponDetailPage> { | ||
| 375 | : SizedBox(), | 452 | : SizedBox(), |
| 376 | couponProvider.couponSunModel.explain != null && | 453 | couponProvider.couponSunModel.explain != null && |
| 377 | couponProvider.couponSunModel.explain != '' | 454 | couponProvider.couponSunModel.explain != '' |
| 378 | - ? _item('券说明', | ||
| 379 | - couponProvider.couponSunModel.explain) | 455 | + ? _item('券说明', '') |
| 380 | : SizedBox(), | 456 | : SizedBox(), |
| 381 | Container( | 457 | Container( |
| 382 | height: ScreenUtil().setWidth(2), | 458 | height: ScreenUtil().setWidth(2), |
| 383 | color: MyColours.color_E7E7E7, | 459 | color: MyColours.color_E7E7E7, |
| 384 | ), | 460 | ), |
| 385 | VEmptyView(24), | 461 | VEmptyView(24), |
| 386 | - _item( | ||
| 387 | - '券状态', | 462 | + if (couponProvider.couponSunModel.explain != null && |
| 463 | + couponProvider.couponSunModel.explain != '') | ||
| 464 | + Align( | ||
| 465 | + alignment: Alignment.centerLeft, | ||
| 466 | + child: Text( | ||
| 467 | + couponProvider.couponSunModel.explain, | ||
| 468 | + textAlign: TextAlign.left, | ||
| 469 | + style: TextStyle( | ||
| 470 | + // height: 1.5, | ||
| 471 | + fontSize: font(16), | ||
| 472 | + color: MyColours.color_999999), | ||
| 473 | + ), | ||
| 474 | + ), | ||
| 475 | + if (couponProvider.couponSunModel.explain != null && | ||
| 476 | + couponProvider.couponSunModel.explain != '') | ||
| 477 | + VEmptyView(24), | ||
| 478 | + // Container( | ||
| 479 | + // height: ScreenUtil().setWidth(2), | ||
| 480 | + // color: MyColours.color_E7E7E7, | ||
| 481 | + // ), | ||
| 482 | + VEmptyView(24), | ||
| 483 | + _canUse( | ||
| 484 | + '立即启用', | ||
| 388 | couponProvider.couponSunModel.status == '1' | 485 | couponProvider.couponSunModel.status == '1' |
| 389 | - ? '发放中' | ||
| 390 | - : '停用') | 486 | + ? true |
| 487 | + : false) | ||
| 391 | ], | 488 | ], |
| 392 | ))), | 489 | ))), |
| 393 | ) | 490 | ) |
| @@ -137,7 +137,8 @@ class _CouponSunPageState extends State<CouponSunPage> { | @@ -137,7 +137,8 @@ class _CouponSunPageState extends State<CouponSunPage> { | ||
| 137 | }, | 137 | }, |
| 138 | onPressed: () { | 138 | onPressed: () { |
| 139 | NavigatorUtil.goCouponDetailPage( | 139 | NavigatorUtil.goCouponDetailPage( |
| 140 | - context, couponProvider.couponList[index]); | 140 | + context, couponProvider.couponList[index], |
| 141 | + idStr: couponProvider.couponList[index].id); | ||
| 141 | }, | 142 | }, |
| 142 | ); | 143 | ); |
| 143 | }, childCount: couponProvider.couponList.length), | 144 | }, childCount: couponProvider.couponList.length), |
| @@ -101,19 +101,23 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -101,19 +101,23 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 101 | fontSize: ScreenUtil().setSp(32)), | 101 | fontSize: ScreenUtil().setSp(32)), |
| 102 | )), | 102 | )), |
| 103 | VEmptyView(26), | 103 | VEmptyView(26), |
| 104 | - Padding( | ||
| 105 | - padding: EdgeInsets.only(left: w(20)), | ||
| 106 | - child: Text( | ||
| 107 | - marketingCenterProvider.rechargeDetail.explain == '' || | ||
| 108 | - marketingCenterProvider.rechargeDetail.explain == null | ||
| 109 | - ? '无' | ||
| 110 | - : marketingCenterProvider.rechargeDetail.explain, | 104 | + MyDivider( |
| 105 | + double.infinity, | ||
| 106 | + w(0.5), | ||
| 107 | + color: MyColours.color_E7E7E7, | ||
| 108 | + ), | ||
| 109 | + VEmptyView(26), | ||
| 110 | + Text( | ||
| 111 | + marketingCenterProvider.rechargeDetail.explain == '' || | ||
| 112 | + marketingCenterProvider.rechargeDetail.explain == null | ||
| 113 | + ? '无' | ||
| 114 | + : marketingCenterProvider.rechargeDetail.explain, | ||
| 111 | 115 | ||
| 112 | - // maxLengthEnforced: true, | ||
| 113 | - style: TextStyle( | ||
| 114 | - fontSize: ScreenUtil().setSp(32), | ||
| 115 | - color: MyColours.color_999999), //输入文本的样式 | ||
| 116 | - )), | 116 | + // maxLengthEnforced: true, |
| 117 | + style: TextStyle( | ||
| 118 | + fontSize: ScreenUtil().setSp(32), | ||
| 119 | + color: MyColours.color_999999), //输入文本的样式 | ||
| 120 | + ), | ||
| 117 | ], | 121 | ], |
| 118 | ), | 122 | ), |
| 119 | ); | 123 | ); |
| @@ -153,7 +157,21 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -153,7 +157,21 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 153 | Provider.of<MarketingCenterProvider>(context, listen: true); | 157 | Provider.of<MarketingCenterProvider>(context, listen: true); |
| 154 | return Scaffold( | 158 | return Scaffold( |
| 155 | backgroundColor: MyColours.color_ffffff, | 159 | backgroundColor: MyColours.color_ffffff, |
| 156 | - appBar: SystemAppBar('充值优惠详情'), | 160 | + appBar: SystemAppBar( |
| 161 | + '充值优惠详情', | ||
| 162 | + rightImgName: widget.idstr != null && | ||
| 163 | + widget.idstr != 'null' && | ||
| 164 | + marketingCenterProvider.rechargeDetail.isOpen == '1' | ||
| 165 | + ? 'share.png' | ||
| 166 | + : '', | ||
| 167 | + onTapRight: () { | ||
| 168 | + if (widget.idstr != null && | ||
| 169 | + widget.idstr != 'null' && | ||
| 170 | + marketingCenterProvider.rechargeDetail.isOpen == '1') { | ||
| 171 | + Utils.goShareBuyRechargeToWeChat(context, widget.idstr); | ||
| 172 | + } | ||
| 173 | + }, | ||
| 174 | + ), | ||
| 157 | body: Consumer<MarketingCenterProvider>(builder: (context, model, _) { | 175 | body: Consumer<MarketingCenterProvider>(builder: (context, model, _) { |
| 158 | if (model.pageStateDetail != PageState.Success) { | 176 | if (model.pageStateDetail != PageState.Success) { |
| 159 | return ExceptionPage( | 177 | return ExceptionPage( |
| @@ -325,7 +343,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -325,7 +343,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 325 | child: Text( | 343 | child: Text( |
| 326 | e.aname, | 344 | e.aname, |
| 327 | style: TextStyle( | 345 | style: TextStyle( |
| 328 | - color: MyColours.color_438E93, | 346 | + color: MyColours.color_0143A3, |
| 329 | fontSize: | 347 | fontSize: |
| 330 | ScreenUtil().setSp(32)), | 348 | ScreenUtil().setSp(32)), |
| 331 | )); | 349 | )); |
| @@ -343,7 +361,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | @@ -343,7 +361,7 @@ class _RechargeDetailPageState extends State<RechargeDetailPage> { | ||
| 343 | Row( | 361 | Row( |
| 344 | children: [ | 362 | children: [ |
| 345 | Text( | 363 | Text( |
| 346 | - '使用限制:', | 364 | + '充值日期限制:', |
| 347 | style: TextStyle( | 365 | style: TextStyle( |
| 348 | color: MyColours.color_515151, | 366 | color: MyColours.color_515151, |
| 349 | fontSize: ScreenUtil().setSp(32)), | 367 | fontSize: ScreenUtil().setSp(32)), |
| @@ -180,10 +180,10 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -180,10 +180,10 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 180 | ? true | 180 | ? true |
| 181 | : false; | 181 | : false; |
| 182 | // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') { | 182 | // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') { |
| 183 | - fromDate = marketingCenterProvider.rechargeDetail.stimeStr; | 183 | + fromDate = marketingCenterProvider.rechargeDetail.stimeStr; |
| 184 | // } | 184 | // } |
| 185 | // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') { | 185 | // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') { |
| 186 | - endDate = marketingCenterProvider.rechargeDetail.etimeStr; | 186 | + endDate = marketingCenterProvider.rechargeDetail.etimeStr; |
| 187 | // } | 187 | // } |
| 188 | 188 | ||
| 189 | weekly = marketingCenterProvider.rechargeDetail.expDate.isWeek == '1' | 189 | weekly = marketingCenterProvider.rechargeDetail.expDate.isWeek == '1' |
| @@ -404,7 +404,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -404,7 +404,8 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 404 | fontSize: ScreenUtil().setSp(32), | 404 | fontSize: ScreenUtil().setSp(32), |
| 405 | color: MyColours.color_333333), //输入文本的样式 | 405 | color: MyColours.color_333333), //输入文本的样式 |
| 406 | decoration: InputDecoration( | 406 | decoration: InputDecoration( |
| 407 | - contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)), | 407 | + contentPadding: |
| 408 | + EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(30)), | ||
| 408 | hintText: hintText, | 409 | hintText: hintText, |
| 409 | hintStyle: TextStyle( | 410 | hintStyle: TextStyle( |
| 410 | color: MyColours.color_999999, | 411 | color: MyColours.color_999999, |
| @@ -511,7 +512,21 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | @@ -511,7 +512,21 @@ class _RechargeEditPageState extends State<RechargeEditPage> { | ||
| 511 | child: Scaffold( | 512 | child: Scaffold( |
| 512 | key: scaffoldKey, | 513 | key: scaffoldKey, |
| 513 | backgroundColor: MyColours.color_ffffff, | 514 | backgroundColor: MyColours.color_ffffff, |
| 514 | - appBar: SystemAppBar('充值优惠详情'), | 515 | + appBar: SystemAppBar( |
| 516 | + '充值优惠详情', | ||
| 517 | + rightImgName: widget.idstr != null && | ||
| 518 | + widget.idstr != 'null' && | ||
| 519 | + marketingCenterProvider.rechargeDetail.isOpen == '1' | ||
| 520 | + ? 'share.png' | ||
| 521 | + : '', | ||
| 522 | + onTapRight: () { | ||
| 523 | + if (widget.idstr != null && | ||
| 524 | + widget.idstr != 'null' && | ||
| 525 | + marketingCenterProvider.rechargeDetail.isOpen == '1') { | ||
| 526 | + Utils.goShareBuyRechargeToWeChat(context, widget.idstr); | ||
| 527 | + } | ||
| 528 | + }, | ||
| 529 | + ), | ||
| 515 | body: Column( | 530 | body: Column( |
| 516 | children: [ | 531 | children: [ |
| 517 | Expanded( | 532 | Expanded( |
| @@ -92,6 +92,10 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | @@ -92,6 +92,10 @@ class _RechargeHomePageState extends State<RechargeHomePage> { | ||
| 92 | backgroundColor: MyColours.color_f3f3f3, | 92 | backgroundColor: MyColours.color_f3f3f3, |
| 93 | appBar: SystemAppBar( | 93 | appBar: SystemAppBar( |
| 94 | '充值优惠', | 94 | '充值优惠', |
| 95 | + rightImgName: 'share.png', | ||
| 96 | + onTapRight: () { | ||
| 97 | + Utils.goShareRechargeListToWeChat(context); | ||
| 98 | + }, | ||
| 95 | ), | 99 | ), |
| 96 | body: Container( | 100 | body: Container( |
| 97 | child: Column( | 101 | child: Column( |
| @@ -1090,7 +1090,7 @@ class Utils { | @@ -1090,7 +1090,7 @@ class Utils { | ||
| 1090 | static getDateStrFromJiekou(String ms) { | 1090 | static getDateStrFromJiekou(String ms) { |
| 1091 | return DateUtil.formatDate( | 1091 | return DateUtil.formatDate( |
| 1092 | DateTime.fromMillisecondsSinceEpoch(int.parse(ms) * 1000), | 1092 | DateTime.fromMillisecondsSinceEpoch(int.parse(ms) * 1000), |
| 1093 | - format: DateFormats.full); | 1093 | + format: DateFormats.y_mo_d); |
| 1094 | } | 1094 | } |
| 1095 | 1095 | ||
| 1096 | static setBarStatus(bool isDarkIcon, | 1096 | static setBarStatus(bool isDarkIcon, |
| @@ -1555,6 +1555,163 @@ class Utils { | @@ -1555,6 +1555,163 @@ class Utils { | ||
| 1555 | return frame.image; | 1555 | return frame.image; |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | + //跳转到充值优惠列表 | ||
| 1559 | + static goShareRechargeListToWeChat(BuildContext context) async { | ||
| 1560 | + String _webPageUrl = "http://colorcun.com/"; | ||
| 1561 | + // String _thumbnail = | ||
| 1562 | + // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; | ||
| 1563 | + // String _thumbnail = | ||
| 1564 | + // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; | ||
| 1565 | + String sellerImage = | ||
| 1566 | + Provider.of<UserModel>(context, listen: false).user.sellerimage; | ||
| 1567 | + String _thumbnail = sellerImage == null || sellerImage == '' | ||
| 1568 | + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' | ||
| 1569 | + : sellerImage; | ||
| 1570 | + String _title = "充值优惠列表购买分享"; | ||
| 1571 | + String _userName = "gh_487873d353b3"; | ||
| 1572 | + String _path = | ||
| 1573 | + "pack-cookbook/pages/favourableList?sellerName=${Provider.of<UserModel>(context, listen: false).user.sellername}&sellerid=${Provider.of<UserModel>(context, listen: false).user.sellerid}"; | ||
| 1574 | + // if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') { | ||
| 1575 | + // //京厨九跳转新的邀请函地址 | ||
| 1576 | + // _path = | ||
| 1577 | + // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; | ||
| 1578 | + // } | ||
| 1579 | + String _description = "充值优惠列表购买分享"; | ||
| 1580 | + // Uint8List source = await testComporessList(context, _thumbnail); | ||
| 1581 | + | ||
| 1582 | + //跳转小程序 | ||
| 1583 | + var model = new WeChatShareMiniProgramModel( | ||
| 1584 | + webPageUrl: _webPageUrl, | ||
| 1585 | + userName: _userName, | ||
| 1586 | + title: _title, | ||
| 1587 | + path: _path, | ||
| 1588 | + description: _description, | ||
| 1589 | + miniProgramType: WXMiniProgramType.PREVIEW, //体验版 | ||
| 1590 | + // miniProgramType: WXMiniProgramType.RELEASE //正式版 | ||
| 1591 | + // miniProgramType: WXMiniProgramType.TEST //开发版 | ||
| 1592 | + // thumbnail: WeChatImage.binary(source) | ||
| 1593 | + thumbnail: WeChatImage.network(_thumbnail) | ||
| 1594 | + // thumbnail: WeChatImage.binary(image) | ||
| 1595 | + ); | ||
| 1596 | + //分享链接 | ||
| 1597 | + // var model = WeChatShareWebPageModel( | ||
| 1598 | + // // 'https://xt04.colorcun.com/h5/index.html#/?id=$rid&hasInvitation=1', | ||
| 1599 | + // 'https://xt04.colorcun.com/h5/index.html?id=$rid&hasInvitation=1&hasSellerShare=1', | ||
| 1600 | + // title: _title, | ||
| 1601 | + // description: _description, | ||
| 1602 | + // thumbnail: WeChatImage.network(_thumbnail), | ||
| 1603 | + // scene: WeChatScene.SESSION, | ||
| 1604 | + // ); | ||
| 1605 | + | ||
| 1606 | + bool isSuccess = await shareToWeChat(model); | ||
| 1607 | + return isSuccess; | ||
| 1608 | + } | ||
| 1609 | + | ||
| 1610 | + //跳转到优惠券购买页面 | ||
| 1611 | + static goShareBuyCouponToWeChat(BuildContext context, String couponid) async { | ||
| 1612 | + String _webPageUrl = "http://colorcun.com/"; | ||
| 1613 | + // String _thumbnail = | ||
| 1614 | + // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; | ||
| 1615 | + // String _thumbnail = | ||
| 1616 | + // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; | ||
| 1617 | + String sellerImage = | ||
| 1618 | + Provider.of<UserModel>(context, listen: false).user.sellerimage; | ||
| 1619 | + String _thumbnail = sellerImage == null || sellerImage == '' | ||
| 1620 | + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' | ||
| 1621 | + : sellerImage; | ||
| 1622 | + String _title = "优惠券购买分享"; | ||
| 1623 | + String _userName = "gh_487873d353b3"; | ||
| 1624 | + String _path = | ||
| 1625 | + "pack-activity/pack/buyCoupon?id=$couponid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3"; | ||
| 1626 | + // if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') { | ||
| 1627 | + // //京厨九跳转新的邀请函地址 | ||
| 1628 | + // _path = | ||
| 1629 | + // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; | ||
| 1630 | + // } | ||
| 1631 | + String _description = "进入查看包间详情,转发同行好友,还可一键导航到饭店"; | ||
| 1632 | + // Uint8List source = await testComporessList(context, _thumbnail); | ||
| 1633 | + | ||
| 1634 | + //跳转小程序 | ||
| 1635 | + var model = new WeChatShareMiniProgramModel( | ||
| 1636 | + webPageUrl: _webPageUrl, | ||
| 1637 | + userName: _userName, | ||
| 1638 | + title: _title, | ||
| 1639 | + path: _path, | ||
| 1640 | + description: _description, | ||
| 1641 | + miniProgramType: WXMiniProgramType.PREVIEW, //体验版 | ||
| 1642 | + // miniProgramType: WXMiniProgramType.RELEASE //正式版 | ||
| 1643 | + // miniProgramType: WXMiniProgramType.TEST //开发版 | ||
| 1644 | + // thumbnail: WeChatImage.binary(source) | ||
| 1645 | + thumbnail: WeChatImage.network(_thumbnail) | ||
| 1646 | + // thumbnail: WeChatImage.binary(image) | ||
| 1647 | + ); | ||
| 1648 | + //分享链接 | ||
| 1649 | + // var model = WeChatShareWebPageModel( | ||
| 1650 | + // // 'https://xt04.colorcun.com/h5/index.html#/?id=$rid&hasInvitation=1', | ||
| 1651 | + // 'https://xt04.colorcun.com/h5/index.html?id=$rid&hasInvitation=1&hasSellerShare=1', | ||
| 1652 | + // title: _title, | ||
| 1653 | + // description: _description, | ||
| 1654 | + // thumbnail: WeChatImage.network(_thumbnail), | ||
| 1655 | + // scene: WeChatScene.SESSION, | ||
| 1656 | + // ); | ||
| 1657 | + | ||
| 1658 | + bool isSuccess = await shareToWeChat(model); | ||
| 1659 | + return isSuccess; | ||
| 1660 | + } | ||
| 1661 | + | ||
| 1662 | + //跳转到充值优惠购买页面 | ||
| 1663 | + static goShareBuyRechargeToWeChat( | ||
| 1664 | + BuildContext context, String rechargeid) async { | ||
| 1665 | + String _webPageUrl = "http://colorcun.com/"; | ||
| 1666 | + // String _thumbnail = | ||
| 1667 | + // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; | ||
| 1668 | + // String _thumbnail = | ||
| 1669 | + // "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; | ||
| 1670 | + String sellerImage = | ||
| 1671 | + Provider.of<UserModel>(context, listen: false).user.sellerimage; | ||
| 1672 | + String _thumbnail = sellerImage == null || sellerImage == '' | ||
| 1673 | + ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' | ||
| 1674 | + : sellerImage; | ||
| 1675 | + String _title = "充值优惠购买分享"; | ||
| 1676 | + String _userName = "gh_487873d353b3"; | ||
| 1677 | + String _path = | ||
| 1678 | + "pack-activity/pack/vipRecharge?id=$rechargeid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3"; | ||
| 1679 | + // if (Provider.of<UserModel>(context, listen: false).user.sellerid == '677') { | ||
| 1680 | + // //京厨九跳转新的邀请函地址 | ||
| 1681 | + // _path = | ||
| 1682 | + // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; | ||
| 1683 | + // } | ||
| 1684 | + String _description = "充值优惠购买分享"; | ||
| 1685 | + // Uint8List source = await testComporessList(context, _thumbnail); | ||
| 1686 | + | ||
| 1687 | + //跳转小程序 | ||
| 1688 | + var model = new WeChatShareMiniProgramModel( | ||
| 1689 | + webPageUrl: _webPageUrl, | ||
| 1690 | + userName: _userName, | ||
| 1691 | + title: _title, | ||
| 1692 | + path: _path, | ||
| 1693 | + description: _description, | ||
| 1694 | + miniProgramType: WXMiniProgramType.PREVIEW, //体验版 | ||
| 1695 | + // miniProgramType: WXMiniProgramType.RELEASE //正式版 | ||
| 1696 | + // miniProgramType: WXMiniProgramType.TEST //开发版 | ||
| 1697 | + // thumbnail: WeChatImage.binary(source) | ||
| 1698 | + thumbnail: WeChatImage.network(_thumbnail) | ||
| 1699 | + // thumbnail: WeChatImage.binary(image) | ||
| 1700 | + ); | ||
| 1701 | + //分享链接 | ||
| 1702 | + // var model = WeChatShareWebPageModel( | ||
| 1703 | + // // 'https://xt04.colorcun.com/h5/index.html#/?id=$rid&hasInvitation=1', | ||
| 1704 | + // 'https://xt04.colorcun.com/h5/index.html?id=$rid&hasInvitation=1&hasSellerShare=1', | ||
| 1705 | + // title: _title, | ||
| 1706 | + // description: _description, | ||
| 1707 | + // thumbnail: WeChatImage.network(_thumbnail), | ||
| 1708 | + // scene: WeChatScene.SESSION, | ||
| 1709 | + // ); | ||
| 1710 | + | ||
| 1711 | + bool isSuccess = await shareToWeChat(model); | ||
| 1712 | + return isSuccess; | ||
| 1713 | + } | ||
| 1714 | + | ||
| 1558 | //分享邀请函 | 1715 | //分享邀请函 |
| 1559 | static goShareInvicationToWeChat( | 1716 | static goShareInvicationToWeChat( |
| 1560 | BuildContext context, String rid, String uid) async { | 1717 | BuildContext context, String rid, String uid) async { |
-
Please register or login to post a comment