new_discount_page.dart 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. import 'package:flutter/src/widgets/framework.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:keyboard/base/base_page.dart';
  4. import 'package:keyboard/data/bean/goods_info.dart';
  5. import 'package:keyboard/module/store/new_discount/new_discount_controller.dart';
  6. import 'package:flutter/material.dart';
  7. import 'package:carousel_slider/carousel_slider.dart';
  8. import 'package:get/get.dart';
  9. import 'package:keyboard/widget/platform_util.dart';
  10. import '../../../data/bean/character_info.dart';
  11. import '../../../data/consts/constants.dart';
  12. import '../../../data/consts/payment_type.dart';
  13. import '../../../data/consts/web_url.dart';
  14. import '../../../resource/assets.gen.dart';
  15. import '../../../resource/colors.gen.dart';
  16. import '../../../resource/string.gen.dart';
  17. import '../../../router/app_pages.dart';
  18. import '../../../utils/styles.dart';
  19. import '../../../widget/auto_scroll_list_view.dart';
  20. import '../../../widget/click_text_span.dart';
  21. import '../../browser/browser_page.dart';
  22. class NewDiscountPage extends BasePage<NewDiscountController> {
  23. const NewDiscountPage({super.key});
  24. /// 跳转
  25. static Future<void> start() async {
  26. await Get.toNamed(RoutePath.newDiscount);
  27. }
  28. @override
  29. bool immersive() {
  30. return true;
  31. }
  32. @override
  33. backgroundColor() => Colors.white;
  34. @override
  35. Widget buildBody(BuildContext context) {
  36. return PopScope(
  37. canPop: false,
  38. onPopInvokedWithResult: (didPop, result) {
  39. if (didPop) {
  40. return;
  41. }
  42. controller.clickBack();
  43. },
  44. child: Stack(
  45. children: [
  46. // Positioned(top: 0.w, child: _buildBanner()),
  47. Positioned(
  48. top: 0.w,
  49. child: SizedBox(
  50. width: 360.w,
  51. height: ScreenUtil().screenHeight,
  52. child: SingleChildScrollView(
  53. child: Column(
  54. children: [
  55. _buildBanner(),
  56. Transform.translate(
  57. offset: Offset(0, -20.w),
  58. child: Container(
  59. decoration: BoxDecoration(
  60. color: ColorName.white,
  61. borderRadius: BorderRadius.only(
  62. topLeft: Radius.circular(24.r),
  63. topRight: Radius.circular(24.r),
  64. ),
  65. ),
  66. width: 360.w,
  67. child: Column(
  68. children: [
  69. SizedBox(height: 16.w),
  70. _buildGoodsCard(),
  71. SizedBox(height: 12.w),
  72. // iOS平台,没有支付方式可以选择
  73. if (!PlatformUtil.isIOS) _buildPayWayCard(),
  74. SizedBox(height: 8.w),
  75. _buildSelectedDesc(),
  76. SizedBox(height: 30.w),
  77. _buildMemberCard(),
  78. SizedBox(height: 110.w),
  79. ],
  80. ),
  81. ),
  82. ),
  83. ],
  84. ),
  85. ),
  86. ),
  87. ),
  88. Positioned(top: 0, left: 0, right: 0, child: _buildTitle()),
  89. Positioned(bottom: 0, left: 0, right: 0, child: _buildBuyButtonCard()),
  90. ],
  91. ),
  92. );
  93. }
  94. _buildTitle() {
  95. return SafeArea(
  96. child: Container(
  97. alignment: Alignment.centerLeft,
  98. padding: EdgeInsets.only(top: 16.h, left: 16.w, right: 16.w),
  99. child: Row(
  100. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  101. children: [
  102. GestureDetector(
  103. onTap: controller.clickBack,
  104. child: Assets.images.iconDiscountClose.image(
  105. width: 32.w,
  106. height: 32.w,
  107. ),
  108. ),
  109. // iOS平台,才有恢复订阅按钮
  110. if (PlatformUtil.isIOS)
  111. GestureDetector(
  112. onTap: () {
  113. controller.clickRestore();
  114. },
  115. child: Container(
  116. padding: EdgeInsets.symmetric(
  117. horizontal: 12.w,
  118. vertical: 6.w,
  119. ),
  120. decoration: BoxDecoration(
  121. color: ColorName.black40,
  122. borderRadius: BorderRadius.circular(16.r),
  123. ),
  124. child: Text(
  125. StringName.recoverSubscribe,
  126. style: TextStyle(
  127. color: ColorName.white80,
  128. fontSize: 14.sp,
  129. fontWeight: FontWeight.w500,
  130. ),
  131. ),
  132. ),
  133. ),
  134. ],
  135. ),
  136. ),
  137. );
  138. }
  139. Widget _buildBanner() {
  140. return SizedBox(
  141. width: 360.w,
  142. child: Stack(
  143. children: [
  144. CarouselSlider(
  145. carouselController: controller.carouselSliderController,
  146. options: CarouselOptions(
  147. height: 438.w,
  148. viewportFraction: 1,
  149. initialPage: 0,
  150. enableInfiniteScroll: true,
  151. reverse: false,
  152. autoPlay: true,
  153. autoPlayInterval: const Duration(seconds: 3),
  154. autoPlayAnimationDuration: const Duration(milliseconds: 500),
  155. autoPlayCurve: Curves.fastOutSlowIn,
  156. scrollDirection: Axis.horizontal,
  157. onPageChanged: (index, reason) {
  158. controller.onBannerChanged(index, reason);
  159. },
  160. ),
  161. items:
  162. controller.bannerList.map((item) {
  163. return item.image(width: 360.w, fit: BoxFit.contain);
  164. }).toList(),
  165. ),
  166. Positioned(
  167. bottom: 149.16.w,
  168. left: 31.w,
  169. child: Assets.images.iconNewDiscountCharacterTitle.image(
  170. width: 296.w,
  171. height: 39.w,
  172. ),
  173. ),
  174. Positioned(
  175. bottom: 211.13.w,
  176. left: 42.w,
  177. right: 0,
  178. child: _buildIndicator(),
  179. ),
  180. Positioned(
  181. bottom: 0,
  182. left: 0,
  183. right: 0,
  184. child: _buildAutoCharacterList(),
  185. ),
  186. ],
  187. ),
  188. );
  189. }
  190. /// 指示器
  191. _buildIndicator() {
  192. return Row(
  193. children:
  194. controller.bannerList.asMap().entries.map((entry) {
  195. return Obx(() {
  196. final isSelectedBanner =
  197. controller.currentBannerIndex == entry.key;
  198. return Row(
  199. mainAxisAlignment: MainAxisAlignment.spaceAround,
  200. children: [
  201. GestureDetector(
  202. onTap:
  203. () => controller.carouselSliderController.animateToPage(
  204. entry.key,
  205. ),
  206. child: AnimatedContainer(
  207. duration: const Duration(milliseconds: 300),
  208. margin: EdgeInsets.only(right: 5.w),
  209. height: 5.w,
  210. width: isSelectedBanner ? 10.w : 5.w,
  211. decoration: BoxDecoration(
  212. color:
  213. isSelectedBanner
  214. ? const Color(0xff483459)
  215. : const Color(0xffAFB4BF),
  216. borderRadius: BorderRadius.circular(5.r),
  217. ),
  218. ),
  219. ),
  220. ],
  221. );
  222. });
  223. }).toList(),
  224. );
  225. }
  226. Widget _buildAutoCharacterList() {
  227. return Obx(() {
  228. if (controller.charactersList.isEmpty) {
  229. return Container();
  230. }
  231. return SizedBox(
  232. height: 130.w,
  233. child: AutoScrollListView(
  234. itemCount: (controller.charactersList.length / 2).ceil(),
  235. scrollDirection: Axis.horizontal,
  236. itemBuilder: (context, columnIndex) {
  237. int rowCount = 2;
  238. int startIndex = columnIndex * rowCount;
  239. final List<CharacterInfo> columnItems =
  240. controller.charactersList
  241. .skip(startIndex)
  242. .take(rowCount)
  243. .toList();
  244. return Column(
  245. children:
  246. columnItems.map((item) {
  247. final emoji = item.emoji ?? "";
  248. final name = item.name ?? "";
  249. return Padding(
  250. padding: EdgeInsets.symmetric(
  251. vertical: 4.w,
  252. horizontal: 4.w,
  253. ),
  254. child: Container(
  255. padding: EdgeInsets.symmetric(
  256. horizontal: 12.w,
  257. vertical: 6.w,
  258. ),
  259. decoration: ShapeDecoration(
  260. color: Colors.white,
  261. shape: RoundedRectangleBorder(
  262. side: BorderSide(
  263. width: 1.w,
  264. color: const Color(0xFFF4F1FF),
  265. ),
  266. borderRadius: BorderRadius.circular(31.r),
  267. ),
  268. ),
  269. child: Text(
  270. "$emoji$name",
  271. style: TextStyle(
  272. color: Colors.black.withAlpha(204),
  273. fontSize: 13.sp,
  274. fontWeight: FontWeight.w400,
  275. ),
  276. ),
  277. ),
  278. );
  279. }).toList(),
  280. );
  281. },
  282. ),
  283. );
  284. });
  285. }
  286. Widget _buildBuyButtonCard() {
  287. return Container(
  288. width: 360.w,
  289. padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 11.h),
  290. decoration: ShapeDecoration(
  291. color: Colors.white,
  292. shape: RoundedRectangleBorder(
  293. borderRadius: BorderRadius.only(
  294. topLeft: Radius.circular(24.r),
  295. topRight: Radius.circular(24.r),
  296. ),
  297. ),
  298. shadows: [
  299. BoxShadow(
  300. color: Color(0x99FFE498),
  301. blurRadius: 20,
  302. offset: Offset(0, 0),
  303. spreadRadius: 0,
  304. ),
  305. ],
  306. ),
  307. child: Column(
  308. children: [
  309. GestureDetector(
  310. onTap: controller.clickPayNow,
  311. child: Container(
  312. width: 328.w,
  313. height: 56.w,
  314. decoration: ShapeDecoration(
  315. shape: RoundedRectangleBorder(
  316. side: BorderSide(width: 2.w, color: const Color(0xFFFFF6C9)),
  317. borderRadius: BorderRadius.circular(30.55),
  318. ),
  319. ),
  320. child: Container(
  321. width: 328,
  322. height: 54,
  323. decoration: ShapeDecoration(
  324. gradient: LinearGradient(
  325. begin: Alignment(0.60, -0.39),
  326. end: Alignment(0.60, 0.95),
  327. colors: [
  328. const Color(0xFFF95FAC),
  329. const Color(0xFFFD4D99),
  330. const Color(0xFFFF3E75),
  331. const Color(0xFFFF0F53),
  332. ],
  333. ),
  334. shape: RoundedRectangleBorder(
  335. borderRadius: BorderRadius.circular(30.55),
  336. ),
  337. ),
  338. child: Center(
  339. child: Text(
  340. StringName.newDiscountUnlockNow,
  341. style: Styles.getTextStyleWhiteW500(17.sp),
  342. ),
  343. ),
  344. ),
  345. ),
  346. ),
  347. SizedBox(height: 11.h),
  348. _buildPrivacyTextSpan(),
  349. ],
  350. ),
  351. );
  352. }
  353. Widget _buildGoodsCard() {
  354. return Container(
  355. margin: EdgeInsets.symmetric(horizontal: 16.w),
  356. child: Column(
  357. crossAxisAlignment: CrossAxisAlignment.start,
  358. mainAxisAlignment: MainAxisAlignment.start,
  359. children: [
  360. Obx(() {
  361. final goodsList = controller.filteredGoodsList;
  362. if (goodsList.isEmpty) {
  363. return CircularProgressIndicator();
  364. }
  365. return Column(
  366. children: List.generate(goodsList.length, (index) {
  367. final item = goodsList[index];
  368. final isSelected =
  369. controller.selectedGoodsInfoItem?.id == item.id;
  370. return Column(
  371. children: [
  372. GestureDetector(
  373. onTap: () => controller.onGoodsItemClick(item),
  374. child: _buildGoodsItem(item, index, isSelected),
  375. ),
  376. if (index != goodsList.length - 1) SizedBox(height: 10.w),
  377. ],
  378. );
  379. }),
  380. );
  381. }),
  382. ],
  383. ),
  384. );
  385. }
  386. Widget _buildPayWayCard() {
  387. return GestureDetector(
  388. onTap: () => controller.clickPayWaySwitch(),
  389. child: Container(
  390. margin: EdgeInsets.symmetric(horizontal: 16.w),
  391. height: 36.h,
  392. padding: EdgeInsets.symmetric(horizontal: 10.w),
  393. decoration: ShapeDecoration(
  394. shape: RoundedRectangleBorder(
  395. side: BorderSide(width: 1, color: const Color(0xFFECEBE0)),
  396. borderRadius: BorderRadius.circular(10.r),
  397. ),
  398. ),
  399. child: Row(
  400. children: [
  401. Text(
  402. StringName.storePayWay,
  403. style: Styles.getTextStyleBlack204W400(14.sp),
  404. ),
  405. const Spacer(),
  406. Obx(() {
  407. if (controller.selectedPayWay == null) {
  408. return SizedBox.shrink();
  409. }
  410. return Row(
  411. children: [
  412. Image.asset(
  413. getPaymentIconPath(
  414. payMethod: controller.selectedPayWay!.payMethod,
  415. payPlatform: controller.selectedPayWay!.payPlatform,
  416. ),
  417. width: 20.w,
  418. height: 20.w,
  419. ),
  420. SizedBox(width: 4.w),
  421. Text(
  422. controller.selectedPayWay?.title ?? '',
  423. style: Styles.getTextStyleBlack204W400(14.sp),
  424. ),
  425. SizedBox(width: 6.w),
  426. Assets.images.iconStoreSwitchPay.image(
  427. width: 20.w,
  428. height: 20.w,
  429. fit: BoxFit.fill,
  430. ),
  431. ],
  432. );
  433. }),
  434. ],
  435. ),
  436. ),
  437. );
  438. }
  439. Widget _buildGoodsItem(GoodsInfo item, int index, bool isSelected) {
  440. var amountText = item.amountText;
  441. var priceDesc = item.priceDesc;
  442. if (index == 0) {
  443. if (controller.isDiscount.value) {
  444. amountText = item.firstAmountText;
  445. priceDesc = item.discountPriceDesc ?? "";
  446. }
  447. }
  448. return Container(
  449. height: 70.w,
  450. width: 328.w,
  451. padding: EdgeInsets.symmetric(horizontal: 16.w),
  452. decoration:
  453. isSelected
  454. ? BoxDecoration(
  455. borderRadius: BorderRadius.circular(16.w),
  456. image: DecorationImage(
  457. image: Assets.images.bgNewDiscountItemSelect.provider(),
  458. fit: BoxFit.fill,
  459. ),
  460. )
  461. : BoxDecoration(
  462. borderRadius: BorderRadius.circular(16.w),
  463. image: DecorationImage(
  464. image: Assets.images.bgNewDiscountItemUnselect.provider(),
  465. fit: BoxFit.fill,
  466. ),
  467. ),
  468. child: Row(
  469. children: [
  470. Text(
  471. "¥",
  472. style: TextStyle(
  473. color:
  474. isSelected
  475. ? const Color(0xFFFF684E)
  476. : Colors.black.withAlpha(204),
  477. fontSize: 16.sp,
  478. fontWeight: FontWeight.w700,
  479. ),
  480. ),
  481. Text(
  482. (item.code == "vip_permanent")
  483. ? '${item.priceDescNumber}'
  484. : '$amountText',
  485. textAlign: TextAlign.center,
  486. style: TextStyle(
  487. color:
  488. isSelected
  489. ? const Color(0xFFFF684E)
  490. : Colors.black.withAlpha(204),
  491. fontSize: 29.sp,
  492. fontWeight: FontWeight.w700,
  493. ),
  494. ),
  495. if (item.code == "vip_permanent")
  496. Text(
  497. item.priceDescUnit,
  498. style: TextStyle(
  499. color: Colors.black.withAlpha(153),
  500. fontSize: 12.sp,
  501. fontWeight: FontWeight.w400,
  502. ),
  503. ),
  504. SizedBox(width: 9.w),
  505. Column(
  506. crossAxisAlignment: CrossAxisAlignment.start,
  507. mainAxisAlignment: MainAxisAlignment.center,
  508. children: [
  509. Row(
  510. children: [
  511. Text(
  512. item.name,
  513. style: TextStyle(
  514. color: Colors.black.withAlpha(204),
  515. fontSize: 14.sp,
  516. fontWeight: FontWeight.w500,
  517. ),
  518. ),
  519. SizedBox(width: 4.5.w),
  520. if (item.timeLimitDesc?.isNotEmpty == true)
  521. Container(
  522. padding: EdgeInsets.symmetric(
  523. horizontal: 4.w,
  524. vertical: 2.w,
  525. ),
  526. margin: EdgeInsets.only(bottom: 4.w),
  527. decoration: ShapeDecoration(
  528. gradient: LinearGradient(
  529. begin: Alignment(0.00, 0.50),
  530. end: Alignment(1.00, 0.50),
  531. colors: [
  532. const Color(0xFFFF684E),
  533. const Color(0xFFFF4F9A),
  534. ],
  535. ),
  536. shape: RoundedRectangleBorder(
  537. borderRadius: BorderRadius.only(
  538. topLeft: Radius.circular(10.50),
  539. topRight: Radius.circular(10.50),
  540. bottomRight: Radius.circular(10.50),
  541. ),
  542. ),
  543. ),
  544. child: Text(
  545. item.timeLimitDesc!,
  546. style: TextStyle(
  547. color: Colors.white,
  548. fontSize: 12.sp,
  549. fontWeight: FontWeight.w500,
  550. ),
  551. ),
  552. ),
  553. ],
  554. ),
  555. Text(
  556. (item.code == "vip_permanent")
  557. ? '${item.description}'
  558. : priceDesc,
  559. style: TextStyle(
  560. color: Colors.black.withAlpha(153),
  561. fontSize: 12.sp,
  562. fontWeight: FontWeight.w400,
  563. ),
  564. ),
  565. ],
  566. ),
  567. // Spacer(),
  568. // isSelected
  569. // ? Assets.images.iconCustomCharacterAddDialogSelect.image(
  570. // width: 20.w,
  571. // height: 20.w,
  572. // fit: BoxFit.contain,
  573. // )
  574. // : Container(
  575. // width: 20.w,
  576. // height: 20.w,
  577. // decoration: ShapeDecoration(
  578. // color: Colors.white,
  579. // shape: OvalBorder(
  580. // side: BorderSide(
  581. // width: 2.w,
  582. // color: const Color(0xFFE6E6E6),
  583. // ),
  584. // ),
  585. // ),
  586. // ),
  587. ],
  588. ),
  589. );
  590. }
  591. _buildSelectedDesc() {
  592. return Column(
  593. children: [
  594. Obx(() {
  595. return Container(
  596. margin: EdgeInsets.symmetric(horizontal: 16.w),
  597. child: Row(
  598. children: [
  599. Text(
  600. controller.selectedGoodsInfoItem?.selectDesc ?? "",
  601. style: TextStyle(
  602. color: Colors.black.withAlpha(102),
  603. fontSize: 12.sp,
  604. fontWeight: FontWeight.w400,
  605. ),
  606. ),
  607. ],
  608. ),
  609. );
  610. }),
  611. Visibility(
  612. visible: !isNotHWChannel(),
  613. child: Container(
  614. margin: EdgeInsets.symmetric(horizontal: 16.w),
  615. alignment: Alignment.centerLeft,
  616. child: GestureDetector(
  617. onTap: () {
  618. BrowserPage.start(WebUrl.memberServiceAgreement);
  619. },
  620. child: Text(
  621. StringName.textSpanMembershipAgreement,
  622. style: TextStyle(
  623. color: const Color(0xFF459FFF),
  624. fontSize: 10.sp,
  625. fontWeight: FontWeight.w400,
  626. ),
  627. ),
  628. ),
  629. ),
  630. ),
  631. ],
  632. );
  633. }
  634. Widget _buildMemberCard() {
  635. return Container(
  636. margin: EdgeInsets.symmetric(horizontal: 16.w),
  637. child: Column(
  638. mainAxisAlignment: MainAxisAlignment.start,
  639. crossAxisAlignment: CrossAxisAlignment.start,
  640. children: [
  641. Assets.images.iconNewDiscountMembershipCardTitle.image(
  642. width: 79.w,
  643. height: 24.w,
  644. ),
  645. SizedBox(height: 6.w),
  646. Text(
  647. StringName.newDiscountMemberCardDesc,
  648. style: TextStyle(
  649. color: Colors.black.withValues(alpha: 87),
  650. fontSize: 11.sp,
  651. fontWeight: FontWeight.w400,
  652. ),
  653. ),
  654. SizedBox(height: 8.w),
  655. _buildMemberCardItem(),
  656. SizedBox(height: 28.w),
  657. _buildUserNotice(),
  658. ],
  659. ),
  660. );
  661. }
  662. // 卡片权益
  663. _buildMemberCardItem() {
  664. return SizedBox(
  665. height: 80.w,
  666. child: AutoScrollListView(
  667. scrollDirection: Axis.horizontal,
  668. itemBuilder: (context, index) {
  669. final item = controller.memberCardList[index];
  670. return Container(
  671. margin: EdgeInsets.only(right: 8.w),
  672. width: 140.w,
  673. height: 65.w,
  674. decoration: ShapeDecoration(
  675. gradient: item.gradient,
  676. shape: RoundedRectangleBorder(
  677. side: BorderSide(width: 1.w, color: Colors.black.withAlpha(8)),
  678. borderRadius: BorderRadius.circular(20.r),
  679. ),
  680. ),
  681. child: Row(
  682. mainAxisAlignment: MainAxisAlignment.center,
  683. crossAxisAlignment: CrossAxisAlignment.center,
  684. children: [
  685. item.imageUrl.image(width: 28.w, height: 27.62.w),
  686. SizedBox(width: 8.w),
  687. Column(
  688. crossAxisAlignment: CrossAxisAlignment.start,
  689. mainAxisAlignment: MainAxisAlignment.center,
  690. children: [
  691. Text(
  692. item.title,
  693. style: TextStyle(
  694. color: Colors.black.withAlpha(204),
  695. fontSize: 12.sp,
  696. fontWeight: FontWeight.w700,
  697. ),
  698. ),
  699. SizedBox(height: 6.w),
  700. Text(
  701. item.desc,
  702. style: TextStyle(
  703. color: Colors.black.withAlpha(128),
  704. fontSize: 10.sp,
  705. fontWeight: FontWeight.w400,
  706. ),
  707. ),
  708. ],
  709. ),
  710. ],
  711. ),
  712. );
  713. },
  714. itemCount: controller.memberCardList.length,
  715. ),
  716. );
  717. }
  718. Widget _buildPrivacyTextSpan() {
  719. return Row(
  720. mainAxisAlignment: MainAxisAlignment.center,
  721. children: [
  722. Obx(() {
  723. return GestureDetector(
  724. behavior: HitTestBehavior.opaque,
  725. onTap: () {
  726. controller.isAgree.value = !controller.isAgree.value;
  727. },
  728. child:
  729. controller.isAgree.value
  730. ? Assets.images.iconStoreAgreePrivacy.image(
  731. width: 16.w,
  732. height: 16.w,
  733. )
  734. : SizedBox(
  735. child: Container(
  736. padding: EdgeInsets.all(1.w),
  737. width: 16.w,
  738. height: 16.w,
  739. child: Container(
  740. decoration: BoxDecoration(
  741. shape: BoxShape.circle,
  742. border: Border.all(
  743. color: Colors.black.withAlpha(153),
  744. width: 1.w,
  745. ),
  746. ),
  747. ),
  748. ),
  749. ),
  750. );
  751. }),
  752. Text.rich(
  753. PlatformUtil.isIOS
  754. ? TextSpan(
  755. children: [
  756. TextSpan(
  757. text: StringName.textSpanIHaveReadAndAgree,
  758. style: TextStyle(
  759. color: Colors.black.withAlpha(153),
  760. fontSize: 10.sp,
  761. fontWeight: FontWeight.w400,
  762. ),
  763. ),
  764. ClickTextSpan(
  765. text: StringName.textSpanPrivacyPolicy,
  766. url: WebUrl.privacyPolicy,
  767. ),
  768. ClickTextSpan(
  769. text: StringName.textSpanServiceTerms,
  770. url: WebUrl.serviceAgreement,
  771. ),
  772. TextSpan(
  773. text: StringName.textSpanAnd,
  774. style: TextStyle(
  775. color: Colors.black.withAlpha(153),
  776. fontSize: 10.sp,
  777. fontWeight: FontWeight.w400,
  778. ),
  779. ),
  780. ClickTextSpan(
  781. text: StringName.textSpanMembershipAgreement,
  782. url: WebUrl.subscribeAgreement,
  783. ),
  784. ],
  785. )
  786. : TextSpan(
  787. children: [
  788. TextSpan(
  789. text: StringName.textSpanIHaveReadAndAgree,
  790. style: TextStyle(
  791. color: Colors.black.withAlpha(153),
  792. fontSize: 10.sp,
  793. fontWeight: FontWeight.w400,
  794. ),
  795. ),
  796. ClickTextSpan(
  797. text: StringName.textSpanPrivacyPolicy,
  798. url: WebUrl.privacyPolicy,
  799. ),
  800. ClickTextSpan(
  801. text: StringName.textSpanServiceTerms,
  802. url: WebUrl.serviceAgreement,
  803. ),
  804. TextSpan(
  805. text: StringName.textSpanAnd,
  806. style: TextStyle(
  807. color: Colors.black.withAlpha(153),
  808. fontSize: 10.sp,
  809. fontWeight: FontWeight.w400,
  810. ),
  811. ),
  812. ClickTextSpan(
  813. text: StringName.textSpanMembershipAgreement,
  814. url: WebUrl.memberServiceAgreement,
  815. ),
  816. ],
  817. ),
  818. ),
  819. ],
  820. );
  821. }
  822. // 用户须知
  823. Widget _buildUserNotice() {
  824. return Container(
  825. decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.r)),
  826. child: Column(
  827. crossAxisAlignment: CrossAxisAlignment.start,
  828. children: [
  829. Text('购买须知', style: Styles.getTextStyleBlack204W400(12.sp)),
  830. SizedBox(height: 8.h),
  831. Obx(() {
  832. return Text(
  833. controller.configRepository.memberTips.value,
  834. style: Styles.getTextStyleBlack153W400(10.sp),
  835. );
  836. }),
  837. ],
  838. ),
  839. );
  840. }
  841. }