member_page.dart 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918
  1. import 'dart:io';
  2. import 'package:cached_network_image/cached_network_image.dart';
  3. import 'package:flutter/cupertino.dart';
  4. import 'package:flutter/gestures.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:flutter/src/widgets/framework.dart';
  7. import 'package:flutter_screenutil/flutter_screenutil.dart';
  8. import 'package:get/get.dart';
  9. import 'package:get/get_core/src/get_main.dart';
  10. import 'package:location/base/base_page.dart';
  11. import 'package:location/module/member/member_controller.dart';
  12. import 'package:location/resource/assets.gen.dart';
  13. import 'package:location/resource/colors.gen.dart';
  14. import 'package:location/utils/common_expand.dart';
  15. import 'package:location/utils/project_expand.dart';
  16. import 'package:location/widget/auto_scroll_list_view.dart';
  17. import '../../data/bean/goods_bean.dart';
  18. import '../../data/bean/member_status_info.dart';
  19. import '../../data/bean/pay_item_bean.dart';
  20. import '../../data/consts/payment_type.dart';
  21. import '../../resource/fonts.gen.dart';
  22. import '../../resource/string.gen.dart';
  23. import '../../router/app_pages.dart';
  24. import '../../utils/date_util.dart';
  25. import '../../widget/animated_switcher_widget.dart';
  26. import 'member_discount_countdown_widget.dart';
  27. import 'member_evaluate_bean.dart';
  28. import 'member_header_cycle_widget.dart';
  29. ///进入会员类型
  30. enum MemberPageType {
  31. ///通用进入
  32. universalAccessEnter,
  33. ///倒计时试用完会员进入
  34. afeterTrialMemberEnter,
  35. ///加好友进入
  36. addFriendToEnter,
  37. }
  38. class MemberPage extends BasePage<MemberController> {
  39. MemberPage({super.key,this.pageType});
  40. late MemberPageType? pageType = MemberPageType.universalAccessEnter;
  41. static void start({MemberPageType? enterTyp = MemberPageType.universalAccessEnter}) {
  42. Get.toNamed(RoutePath.member,arguments: enterTyp);
  43. }
  44. @override
  45. bool immersive() {
  46. return true;
  47. }
  48. @override
  49. bool statusBarDarkFont() {
  50. return false;
  51. }
  52. @override
  53. Widget buildBody(BuildContext context) {
  54. return PopScope(
  55. canPop: false,
  56. onPopInvokedWithResult: (bool didPop, dynamic result) async {
  57. controller.onPopBack();
  58. },
  59. child: Stack(
  60. children: [
  61. SingleChildScrollView(
  62. physics: const ClampingScrollPhysics(),
  63. controller: controller.scrollController,
  64. child: Stack(
  65. children: [
  66. MemberHeaderCycleWidget(),
  67. Column(
  68. children: [
  69. SizedBox(height: 249.w + MediaQuery.of(Get.context!).padding.top),
  70. Container(
  71. decoration: BoxDecoration(
  72. color: ColorName.white,
  73. borderRadius: BorderRadius.only(
  74. topLeft: Radius.circular(20.w),
  75. topRight: Radius.circular(20.w)),
  76. ),
  77. child: Stack(
  78. children: [
  79. Container(
  80. decoration: BoxDecoration(
  81. borderRadius: BorderRadius.only(
  82. topLeft: Radius.circular(20.w),
  83. topRight: Radius.circular(20.w)),
  84. image: DecorationImage(
  85. image: Assets.images.iconMemberVipMiddleBg.provider(),
  86. )
  87. ),
  88. width: double.infinity,
  89. height: 174,
  90. ),
  91. Container(
  92. //width: double.infinity,
  93. decoration: BoxDecoration(
  94. borderRadius: BorderRadius.only(
  95. topLeft: Radius.circular(20.w),
  96. topRight: Radius.circular(20.w)),
  97. image: DecorationImage(image: Assets.images.iconMemberVipMiddleBg.provider())
  98. ),
  99. child: Column(
  100. crossAxisAlignment: CrossAxisAlignment.start,
  101. children: [
  102. SizedBox(height: 15.w),
  103. buildUserInfoView(),
  104. SizedBox(height: 23.w),
  105. buildGoodsList(),
  106. SizedBox(height: 12.w),
  107. buildPrivacyPolicyView(),
  108. buildPayWayView(),
  109. SizedBox(height: 30.w),
  110. Padding(
  111. padding: EdgeInsets.only(left: 12.w),
  112. child: Text(StringName.memberEquityIntroduction,
  113. style: TextStyle(
  114. fontSize: 16.sp,
  115. color: ColorName.black90,
  116. fontWeight: FontWeight.bold)),
  117. ),
  118. SizedBox(height: 19.w),
  119. buildFunctionList(),
  120. SizedBox(height: 40.w),
  121. Padding(
  122. padding: EdgeInsets.only(left: 12.w),
  123. child: Text(StringName.memberUserEvaluate,
  124. style: TextStyle(
  125. fontSize: 16.sp,
  126. color: ColorName.black90,
  127. fontWeight: FontWeight.bold)),
  128. ),
  129. SizedBox(height: 8.w),
  130. buildUserEvaluateList(),
  131. SizedBox(height: 20.w),
  132. Container(
  133. padding: EdgeInsets.all(12.w),
  134. decoration: BoxDecoration(
  135. color: '#F7F7F7'.color,
  136. borderRadius: BorderRadius.circular(6.w)),
  137. margin: EdgeInsets.symmetric(horizontal: 12.w),
  138. child: Text(StringName.memberTips,
  139. style: TextStyle(
  140. fontSize: 12.sp, color: '#A7A7A7'.color)),
  141. ),
  142. SizedBox(height: 100.w)
  143. ],
  144. ),
  145. ),
  146. ],
  147. ),
  148. )
  149. ],
  150. ),
  151. ],
  152. )
  153. /*Stack(
  154. children: [
  155. Assets.images.bgMemberHeader.image(width: double.infinity),
  156. SafeArea(
  157. child: Column(
  158. children: [
  159. SizedBox(height: 249.w + MediaQuery.of(Get.context!).padding.top),
  160. buildUserInfoView(),
  161. SizedBox(height: 26.w),
  162. Container(
  163. width: double.infinity,
  164. decoration: BoxDecoration(
  165. borderRadius: BorderRadius.only(
  166. topLeft: Radius.circular(14.w),
  167. topRight: Radius.circular(14.w)),
  168. gradient: LinearGradient(
  169. begin: Alignment.topCenter,
  170. end: Alignment.bottomCenter,
  171. stops: [0.0, 0.1],
  172. colors: ['#EFE9FF'.color, Colors.white])),
  173. child: Column(
  174. crossAxisAlignment: CrossAxisAlignment.start,
  175. children: [
  176. SizedBox(height: 23.w),
  177. buildGoodsList(),
  178. SizedBox(height: 12.w),
  179. buildPrivacyPolicyView(),
  180. buildPayWayView(),
  181. SizedBox(height: 30.w),
  182. Padding(
  183. padding: EdgeInsets.only(left: 12.w),
  184. child: Text(StringName.memberEquityIntroduction,
  185. style: TextStyle(
  186. fontSize: 16.sp,
  187. color: ColorName.black90,
  188. fontWeight: FontWeight.bold)),
  189. ),
  190. SizedBox(height: 19.w),
  191. buildFunctionList(),
  192. SizedBox(height: 40.w),
  193. Padding(
  194. padding: EdgeInsets.only(left: 12.w),
  195. child: Text(StringName.memberUserEvaluate,
  196. style: TextStyle(
  197. fontSize: 16.sp,
  198. color: ColorName.black90,
  199. fontWeight: FontWeight.bold)),
  200. ),
  201. SizedBox(height: 8.w),
  202. buildUserEvaluateList(),
  203. SizedBox(height: 20.w),
  204. Container(
  205. padding: EdgeInsets.all(12.w),
  206. decoration: BoxDecoration(
  207. color: '#F7F7F7'.color,
  208. borderRadius: BorderRadius.circular(6.w)),
  209. margin: EdgeInsets.symmetric(horizontal: 12.w),
  210. child: Text(StringName.memberTips,
  211. style: TextStyle(
  212. fontSize: 12.sp, color: '#A7A7A7'.color)),
  213. ),
  214. SizedBox(height: 100.w)
  215. ],
  216. ),
  217. )
  218. ],
  219. ),
  220. )
  221. ],
  222. ),*/
  223. ),
  224. buildHeadBar(),
  225. buildMemberBottomView()
  226. ],
  227. ),
  228. );
  229. }
  230. Widget buildGoodsList() {
  231. return Obx(() {
  232. if (controller.goodsList.isEmpty) {
  233. return Container();
  234. }
  235. if (controller.goodsList.length == 1) {
  236. return Container(
  237. padding: EdgeInsets.symmetric(horizontal: 14.w),
  238. //height: 165.w,
  239. child: Column(
  240. children: [
  241. _createSpecialProduct(controller.goodsList.first)
  242. ],
  243. ),
  244. );
  245. } else if (controller.goodsList.length == 2) {
  246. return Container(
  247. padding: EdgeInsets.symmetric(horizontal: 14.w),
  248. //height: 165.w,
  249. child: Column(
  250. children: [
  251. Row(
  252. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  253. children: [
  254. Expanded(child: _ordinaryProductWidget(controller.goodsList.first)),
  255. SizedBox(width: 8,),
  256. Expanded(child: _ordinaryProductWidget(controller.goodsList[1]))
  257. ],
  258. )
  259. ],
  260. ),
  261. );
  262. }
  263. return Container(
  264. padding: EdgeInsets.symmetric(horizontal: 14.w),
  265. //height: 165.w,
  266. child: Column(
  267. children: [
  268. _createSpecialProduct(controller.goodsList.first),
  269. SizedBox(height: 7.w,),
  270. Row(
  271. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  272. children: [
  273. Expanded(child: _ordinaryProductWidget(controller.goodsList[1])),
  274. SizedBox(width: 8,),
  275. Expanded(child: _ordinaryProductWidget(controller.goodsList[2]))
  276. ],
  277. )
  278. ],
  279. ),
  280. );
  281. });
  282. }
  283. //特惠产品
  284. Widget _createSpecialProduct(GoodsBean goodsInfo) {
  285. bool isSelected = controller.selectedGoods?.id == goodsInfo.id;
  286. return GestureDetector(
  287. onTap: () {
  288. controller.onGoodsItemClick(goodsInfo);
  289. },
  290. child: Container(
  291. height: 96.w,
  292. padding: EdgeInsets.only(left: 17.w),
  293. decoration: BoxDecoration(
  294. image: DecorationImage(
  295. image: isSelected ? Assets.images.iconMemberSpecialProductsSelect.provider() : Assets.images.iconMemberSpecialProductsNormal.provider(),
  296. fit: BoxFit.cover
  297. ),
  298. ),
  299. child: Column(
  300. children: [
  301. SizedBox(height: 29.w,),
  302. Row(
  303. children: [
  304. Column(
  305. children: [
  306. RichText(
  307. text: TextSpan(
  308. style: TextStyle(
  309. color: isSelected
  310. ? '#FF5656'.color
  311. : "#323133".color,
  312. fontWeight: FontWeight.bold),
  313. children: [
  314. TextSpan(
  315. text: '¥',
  316. style: TextStyle(
  317. fontSize: 16.sp, height: 1)),
  318. TextSpan(
  319. text: goodsInfo.amount.divideBy100(),
  320. style: TextStyle(
  321. fontSize: 28.sp,
  322. height: 1,
  323. //fontFamily: FontFamily.oppoSans
  324. )
  325. )
  326. ]
  327. )
  328. ),
  329. Text('¥${goodsInfo.originalAmount.divideBy100()}',
  330. style: TextStyle(
  331. decoration: TextDecoration.lineThrough,
  332. decorationColor: ColorName.black40,
  333. decorationThickness: 1.0,
  334. fontSize: 12.sp,
  335. color: ColorName.black40))
  336. ],
  337. ),
  338. SizedBox(width: 22.24.w,),
  339. Column(
  340. crossAxisAlignment: CrossAxisAlignment.start,
  341. children: [
  342. Text(
  343. goodsInfo.name,
  344. style: TextStyle(
  345. fontSize: 17.sp,
  346. color: "#333333".color,
  347. fontWeight: FontWeight.bold),
  348. ),
  349. SizedBox(
  350. height: 3.w,
  351. ),
  352. Text(
  353. goodsInfo.description ?? "",
  354. style: TextStyle(
  355. fontSize: 11.sp ,
  356. color: "#9191BA".color,
  357. fontWeight: FontWeight.bold),
  358. ),
  359. ],
  360. ),
  361. ],
  362. ),
  363. ],
  364. ),
  365. ),
  366. );
  367. }
  368. ///普通产品
  369. Widget _ordinaryProductWidget(GoodsBean goodsInfo) {
  370. bool isSelected = controller.selectedGoods?.id == goodsInfo.id;
  371. return GestureDetector(
  372. onTap: () {
  373. controller.onGoodsItemClick(goodsInfo);
  374. },
  375. child: Container(
  376. height: 62.w,
  377. padding: EdgeInsets.only(left: 16.w,right: 12.w),
  378. decoration: BoxDecoration(
  379. image: DecorationImage(
  380. image: isSelected ? Assets.images.iconMemberOrdinaryProductSelect.provider() : Assets.images.iconMemberOrdinaryProductNormal.provider(),
  381. fit: BoxFit.cover
  382. ),
  383. ),
  384. child: Column(
  385. children: [
  386. SizedBox(height: 15.w,),
  387. Row(
  388. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  389. children: [
  390. Column(
  391. crossAxisAlignment: CrossAxisAlignment.start,
  392. children: [
  393. Text(
  394. goodsInfo.name,
  395. style: TextStyle(
  396. fontSize: 12.sp,
  397. color: "#333333".color,
  398. fontWeight: FontWeight.bold),
  399. ),
  400. //SizedBox(height: 6.w,),
  401. Text(
  402. goodsInfo.description ?? "",
  403. style: TextStyle(
  404. fontSize: 10.sp ,
  405. color: ColorName.black40,
  406. fontWeight: FontWeight.bold),
  407. ),
  408. ],
  409. ),
  410. //SizedBox(width: 22.24.w,),
  411. Column(
  412. crossAxisAlignment: CrossAxisAlignment.end,
  413. children: [
  414. RichText(
  415. text: TextSpan(
  416. style: TextStyle(
  417. color: isSelected
  418. ? '#FF5656'.color
  419. : "#323133".color,
  420. fontWeight: FontWeight.bold),
  421. children: [
  422. TextSpan(
  423. text: '¥',
  424. style: TextStyle(
  425. color: isSelected? "#FF5656".color : ColorName.black80,
  426. fontSize: 11.sp, height: 1)),
  427. TextSpan(
  428. text: goodsInfo.amount.divideBy100(),
  429. style: TextStyle(
  430. fontSize: 20.sp,
  431. height: 1,))
  432. ]
  433. )
  434. ),
  435. Text('¥${goodsInfo.originalAmount.divideBy100()}',
  436. style: TextStyle(
  437. decoration: TextDecoration.lineThrough,
  438. decorationColor: ColorName.black30,
  439. decorationThickness: 1.0,
  440. fontSize: 10.sp,
  441. color: ColorName.black30))
  442. ],
  443. ),
  444. ],
  445. ),
  446. ],
  447. ),
  448. ),
  449. );
  450. }
  451. Widget buildMemberBottomView() {
  452. return Obx(() {
  453. return Visibility(
  454. visible: controller.memberStatusInfo == null ||
  455. controller.memberStatusInfo?.permanent == false,
  456. child: Align(
  457. alignment: Alignment.bottomCenter,
  458. child: Container(//top: 98.w,
  459. alignment: Alignment.bottomCenter,
  460. height: 190.w + MediaQuery.of(Get.context!).padding.bottom,
  461. padding: EdgeInsets.only(
  462. left: 12.w, right: 12.w, bottom: 17.w + MediaQuery.of(Get.context!).padding.bottom),
  463. decoration: BoxDecoration(
  464. gradient: LinearGradient(
  465. begin: Alignment.bottomCenter, // 0deg 相当于从底部开始
  466. end: Alignment.topCenter,
  467. colors: [
  468. Colors.white, // #FFF
  469. "#00FFFFFF".color,
  470. ],
  471. stops: [0.4368, 1.0], // 对应 43.68% 和 100%
  472. ),
  473. ),
  474. child: Obx(() {
  475. return Column(
  476. mainAxisAlignment: MainAxisAlignment.end,
  477. children: [
  478. Container(
  479. width: double.infinity, // 设置容器宽度
  480. height: 50.w, // 设置容器高度
  481. padding: EdgeInsets.only(left: 20.w),
  482. decoration: BoxDecoration(
  483. image: DecorationImage(
  484. image: Assets.images.iconMemberSettlementBg.provider(),
  485. fit: BoxFit.fill,
  486. ),
  487. ),
  488. // 实现内阴影效果
  489. child: Row(
  490. children: [
  491. Transform.translate(
  492. offset: Offset(0, 3), // 向下偏移4像素
  493. child: Text('¥',
  494. style: TextStyle(
  495. fontSize: 14.sp,
  496. color: '#FFF8EF'.color,
  497. fontWeight: FontWeight.bold)),
  498. ),
  499. SizedBox(width: 3.w,),
  500. Text(
  501. controller.selectedGoods?.amount.divideBy100() ?? '--',
  502. style: TextStyle(
  503. fontSize: 24.sp,
  504. color: '#FFF8EF'.color,
  505. fontWeight: FontWeight.bold),
  506. ),
  507. SizedBox(width: 3.w,),
  508. Text("/",
  509. style: TextStyle(
  510. fontSize: 12.sp,
  511. fontWeight: FontWeight.w400,
  512. color: "#FFF8EF".color),),
  513. Text('原价${controller.selectedGoods?.originalAmount.divideBy100()}',
  514. style: TextStyle(
  515. decoration: TextDecoration.lineThrough,
  516. decorationColor: Colors.white,
  517. decorationThickness: 1.0,
  518. fontSize: 12.sp,
  519. fontWeight: FontWeight.w400,
  520. color: "#FFF8EF".color)),
  521. Spacer(),
  522. GestureDetector(
  523. onTap: controller.onBuyClick,
  524. child: Container(
  525. decoration: BoxDecoration(
  526. image: DecorationImage(
  527. image: Assets.images.iconMemberSettlementConfirm.provider(),
  528. fit: BoxFit.fill,
  529. )
  530. ),
  531. // width: 164.w,
  532. // height: 44.w,
  533. padding: EdgeInsets.only(left: 64.w,right: 29.w),
  534. child: Center(
  535. child: Text(
  536. controller.memberStatusInfo?.expired == false
  537. ? StringName.memberVipRenew
  538. : StringName.memberVipUnlock,
  539. style: TextStyle(
  540. fontSize: 18.sp,
  541. color: "#9B3800".color,
  542. fontWeight: FontWeight.bold),
  543. ),
  544. ),
  545. ),
  546. )
  547. ],
  548. ),
  549. ),
  550. SizedBox(height: 8.w,),
  551. buildPrivacyPolicyView(),
  552. ],
  553. );
  554. }),
  555. ),
  556. ),
  557. );
  558. });
  559. }
  560. Widget buildUserInfoView() {
  561. return Row(
  562. children: [
  563. SizedBox(width: 18.w),
  564. controller.isLogin ? ClipOval(
  565. child: Container(
  566. width: 32.w,
  567. height: 32.w,
  568. child: CachedNetworkImage(
  569. imageUrl: controller.memberStatusInfo?.avatar ?? "",
  570. fit: BoxFit.cover,
  571. ),
  572. ),
  573. ) : Assets.images.iconMemberAvatar.image(width: 32.w, height: 32.w),
  574. SizedBox(width: 7.w),
  575. Column(
  576. crossAxisAlignment: CrossAxisAlignment.start,
  577. children: [
  578. Obx(() {
  579. return GestureDetector(
  580. onTap: controller.onLoginClick,
  581. child: Text(
  582. controller.phone?.isNotEmpty == true
  583. ? controller.getUserName(controller.phone!)
  584. : StringName.mineAccountGoLogin,
  585. style: TextStyle(
  586. fontSize: 13.sp,
  587. color: "#333333".color,
  588. fontWeight: FontWeight.bold)),
  589. );
  590. }),
  591. Container(
  592. height: 16.w,
  593. width: MediaQuery.of(Get.context!).size.width - 77.w,
  594. child: Row(
  595. // 主轴默认左对齐,通过Spacer推挤右侧内容
  596. children: [
  597. // 左侧内容:会员等级描述 + VIP卡片描述
  598. Visibility(
  599. visible: MemberStatusInfo.getLevelDesc(controller.memberStatusInfo).isNotEmpty,
  600. child: Text(
  601. MemberStatusInfo.getLevelDesc(controller.memberStatusInfo),
  602. style: TextStyle(
  603. fontSize: 11.sp,
  604. fontWeight: FontWeight.w700,
  605. color: '#9144F8'.color
  606. )
  607. ),
  608. ),
  609. buildMemberCardVipDesc(),
  610. Spacer(),
  611. Container(
  612. child: MemberDiscountCountdownWidget(
  613. onExpired: () {
  614. print("sssfsdfs");
  615. controller.isShowCount.value = false;
  616. },
  617. ),
  618. )
  619. ],
  620. ),
  621. )
  622. ],
  623. ),
  624. SizedBox(width: 20.w)
  625. ],
  626. );
  627. }
  628. // Spacer(),
  629. // Container(
  630. // decoration: BoxDecoration(
  631. // color: '#272F51'.color,
  632. // border: Border.all(color: '#99CAB0F0'.color, width: 1.w),
  633. // borderRadius: BorderRadius.circular(100.w),
  634. // ),
  635. // padding: EdgeInsets.symmetric(horizontal: 18.w, vertical: 6.w),
  636. // child: Obx(() {
  637. // return Text(
  638. // MemberStatusInfo.getLevelDesc(controller.memberStatusInfo),
  639. // style: TextStyle(fontSize: 12.sp, color: '#D2CCFF'.color));
  640. // })),
  641. Widget buildMemberCardVipDesc() {
  642. return Obx(() {
  643. String desc = '';
  644. if (!controller.isLogin) {
  645. //desc = StringName.memberCardNoLoginDesc;
  646. desc =
  647. '${DateUtil.fromMillisecondsSinceEpoch('yyyy-MM-dd', controller.memberStatusInfo?.endTimestamp ?? 0)} ${StringName.memberCardExpirationDesc}';
  648. } else if (controller.memberStatusInfo == null ||
  649. controller.memberStatusInfo?.expired == true) {
  650. desc = StringName.memberCardNoVipDesc;
  651. } else if (controller.memberStatusInfo?.expired == false &&
  652. controller.memberStatusInfo?.permanent == true) {
  653. desc = StringName.memberCardPermanentVipDesc;
  654. } else {
  655. desc =
  656. '${DateUtil.fromMillisecondsSinceEpoch('yyyy-MM-dd', controller.memberStatusInfo?.endTimestamp ?? 0)} ${StringName.memberCardExpirationDesc}';
  657. }
  658. return Text(desc,
  659. style: TextStyle(fontSize: 11.sp, color: ColorName.black50,fontWeight: FontWeight.w400));
  660. });
  661. }
  662. Widget buildHeadBar() {
  663. return Obx(() {
  664. return Stack(
  665. children: [
  666. IgnorePointer(
  667. child: Container(
  668. color: ColorName.colorPrimary.withOpacity(controller.toolBarOpacity),
  669. child: SafeArea(
  670. child: SizedBox(
  671. width: double.infinity,
  672. height: 56.w,
  673. ),
  674. ),
  675. ),
  676. ),
  677. SafeArea(
  678. child: SizedBox(
  679. width: double.infinity,
  680. height: 56.w,
  681. child: Stack(alignment: Alignment.center, children: [
  682. Positioned(
  683. left: 15.w,
  684. child: GestureDetector(
  685. onTap: () => controller.onPopBack(),
  686. child: Assets.images.iconMemberVipBack
  687. .image(width: 26.w, height: 26..w),
  688. )),
  689. Container(
  690. padding: EdgeInsets.only(left: 51.w,right: 12.w),
  691. child: buildVerticalSlideshowWidget())
  692. ]),
  693. ),
  694. ),
  695. ],
  696. );
  697. });
  698. }
  699. Widget buildVerticalSlideshowWidget() {
  700. return Row(
  701. children: [
  702. Visibility(visible: !Platform.isIOS, child: Spacer()),
  703. Container(
  704. width: 192.w,
  705. height: 26.w,
  706. decoration: BoxDecoration(
  707. color: ColorName.black40,
  708. borderRadius: BorderRadius.circular(87.w),
  709. ),
  710. child: Center(
  711. child: AnimatedSwitcherWidget(
  712. controller: controller.switcherController)),
  713. ),
  714. Spacer(),
  715. Visibility(
  716. visible: Platform.isIOS && controller.accountRepository.isLogin.value,
  717. child: GestureDetector(
  718. onTap: controller.clickRecoverSubscribe,
  719. child: Container(
  720. height: 26.w,
  721. decoration: BoxDecoration(
  722. color: ColorName.black40,
  723. borderRadius: BorderRadius.circular(26.w / 2.0),
  724. ),
  725. padding: EdgeInsets.symmetric(horizontal: 10.w),
  726. child: Row(
  727. children: [
  728. Assets.images.iconAppleRecoverSubscribe.image(width: 14.w,height: 14.w),
  729. Text(StringName.appleRecoverSubscribeTxt,
  730. style: TextStyle(
  731. fontSize: 11.sp,
  732. color: ColorName.white,
  733. fontWeight: FontWeight.w500)),
  734. ],
  735. ),
  736. ),
  737. )
  738. )
  739. ],
  740. );
  741. }
  742. Widget buildPrivacyPolicyView() {
  743. return Padding(
  744. padding: EdgeInsets.only(left: 12.w),
  745. child: RichText(
  746. text: TextSpan(
  747. style: TextStyle(fontSize: 12.sp, color: ColorName.black40),
  748. children: [
  749. TextSpan(text: '购买前请先阅读'),
  750. TextSpan(
  751. recognizer: TapGestureRecognizer()
  752. ..onTap = () {
  753. controller.onPrivacyPolicyClick();
  754. },
  755. text: '隐私政策',
  756. style: TextStyle(
  757. color: ColorName.black60,
  758. decoration: TextDecoration.underline)),
  759. TextSpan(text: '&'),
  760. TextSpan(
  761. recognizer: TapGestureRecognizer()
  762. ..onTap = () {
  763. controller.onTermOfServiceClick();
  764. },
  765. text: '服务条款',
  766. style: TextStyle(
  767. color: ColorName.black60,
  768. decoration: TextDecoration.underline)),
  769. ])),
  770. );
  771. }
  772. Widget buildFunctionList() {
  773. return SizedBox(
  774. height: 80.w,
  775. child: AutoScrollListView(
  776. padding: EdgeInsets.only(left: 12.w),
  777. itemBuilder: (ctx, index) {
  778. final item = controller.funList[index];
  779. return Padding(
  780. padding: EdgeInsets.only(right: 20.w),
  781. child: Column(
  782. children: [
  783. Image.asset(item.iconPath, width: 36.w, height: 36.w),
  784. Spacer(flex: 3),
  785. Text(item.funName,
  786. style: TextStyle(
  787. fontSize: 12.8.sp,
  788. color: ColorName.black90,
  789. fontWeight: FontWeight.bold)),
  790. Spacer(flex: 2),
  791. Text(item.funDesc,
  792. style: TextStyle(
  793. fontSize: 10.6.sp,
  794. color: ColorName.black50,
  795. )),
  796. ],
  797. ),
  798. );
  799. },
  800. itemCount: controller.funList.length));
  801. }
  802. Widget buildUserEvaluateList() {
  803. return Column(
  804. children: [
  805. for (int index = 0; index < controller.evaluateList.length; index++)
  806. buildUserEvaluateItem(controller.evaluateList[index],
  807. index == controller.evaluateList.length - 1)
  808. ],
  809. );
  810. }
  811. Widget buildUserEvaluateItem(MemberEvaluateBean item, bool isLast) {
  812. return Column(
  813. crossAxisAlignment: CrossAxisAlignment.start,
  814. children: [
  815. SizedBox(height: 20.w),
  816. Row(
  817. children: [
  818. SizedBox(width: 12.w),
  819. Image.asset(item.avatarPath, width: 24.w, height: 24.w),
  820. SizedBox(width: 8.w),
  821. Text(
  822. item.userName,
  823. style: TextStyle(fontSize: 14.sp, color: Colors.black),
  824. )
  825. ],
  826. ),
  827. SizedBox(height: 1.w),
  828. Padding(
  829. padding: EdgeInsets.only(left: 44.w, right: 12.w),
  830. child: Text(
  831. item.userEvaluate,
  832. style: TextStyle(fontSize: 14.sp, color: '#BF000000'.color),
  833. )),
  834. SizedBox(height: 20.w),
  835. Visibility(
  836. child: Container(
  837. margin: EdgeInsets.only(left: 26.w),
  838. width: 288.w,
  839. color: '#21000000'.color,
  840. height: 1.w),
  841. )
  842. ],
  843. );
  844. }
  845. Widget buildPayWayView() {
  846. return Obx(() {
  847. return Visibility(
  848. visible: Platform.isIOS ? false : controller.payItemList.isNotEmpty,
  849. child: Container(
  850. margin: EdgeInsets.only(top: 7.w),
  851. child: Column(
  852. children: [
  853. for (PayItemBean item in controller.payItemList)
  854. buildPayWayItem(item)
  855. ],
  856. ),
  857. ),
  858. );
  859. });
  860. }
  861. Widget buildPayWayItem(PayItemBean item) {
  862. return GestureDetector(
  863. behavior: HitTestBehavior.translucent,
  864. onTap: () => controller.onPayWayItemClick(item),
  865. child: Obx(() {
  866. bool isSelected = controller.selectedPayWay?.id == item.id;
  867. return Container(
  868. padding: EdgeInsets.symmetric(vertical: 10.w),
  869. child: Row(
  870. children: [
  871. SizedBox(width: 12.w),
  872. Image.asset(
  873. getPaymentIconPath(
  874. payMethod: item.payMethod, payPlatform: item.payPlatform),
  875. width: 24.w,
  876. height: 24.w),
  877. SizedBox(width: 6.w),
  878. Text(item.title,
  879. style: TextStyle(fontSize: 14.sp, color: ColorName.black90)),
  880. Spacer(),
  881. Image.asset(
  882. isSelected
  883. ? Assets.images.iconCbSelected.path
  884. : Assets.images.iconCbUnSelect.path,
  885. width: 20.w,
  886. height: 20.w),
  887. SizedBox(width: 20.w),
  888. ],
  889. ),
  890. );
  891. }),
  892. );
  893. }
  894. }