new_discount_page.dart 27 KB

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