new_discount_page.dart 27 KB

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