new_discount_page.dart 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  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, 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, bool isSelected) {
  432. return Container(
  433. height: 70.w,
  434. width: 328.w,
  435. padding: EdgeInsets.symmetric(horizontal: 16.w),
  436. decoration:
  437. isSelected
  438. ? BoxDecoration(
  439. borderRadius: BorderRadius.circular(16.w),
  440. image: DecorationImage(
  441. image: Assets.images.bgNewDiscountItemSelect.provider(),
  442. fit: BoxFit.fill,
  443. ),
  444. )
  445. : BoxDecoration(
  446. borderRadius: BorderRadius.circular(16.w),
  447. image: DecorationImage(
  448. image: Assets.images.bgNewDiscountItemUnselect.provider(),
  449. fit: BoxFit.fill,
  450. ),
  451. ),
  452. child: Row(
  453. children: [
  454. Text(
  455. "¥",
  456. style: TextStyle(
  457. color:
  458. isSelected
  459. ? const Color(0xFFFF684E)
  460. : Colors.black.withAlpha(204),
  461. fontSize: 16.sp,
  462. fontWeight: FontWeight.w700,
  463. ),
  464. ),
  465. Text(
  466. (item.code == "vip_permanent")
  467. ? '${item.priceDescNumber}'
  468. : '${item.amountText}',
  469. textAlign: TextAlign.center,
  470. style: TextStyle(
  471. color:
  472. isSelected
  473. ? const Color(0xFFFF684E)
  474. : Colors.black.withAlpha(204),
  475. fontSize: 29.sp,
  476. fontWeight: FontWeight.w700,
  477. ),
  478. ),
  479. if (item.code == "vip_permanent")
  480. Text(
  481. item.priceDescUnit,
  482. style: TextStyle(
  483. color: Colors.black.withAlpha(153),
  484. fontSize: 12.sp,
  485. fontWeight: FontWeight.w400,
  486. ),
  487. ),
  488. SizedBox(width: 9.w),
  489. Column(
  490. crossAxisAlignment: CrossAxisAlignment.start,
  491. mainAxisAlignment: MainAxisAlignment.center,
  492. children: [
  493. Row(
  494. children: [
  495. Text(
  496. item.name,
  497. style: TextStyle(
  498. color: Colors.black.withAlpha(204),
  499. fontSize: 14.sp,
  500. fontWeight: FontWeight.w500,
  501. ),
  502. ),
  503. SizedBox(width: 4.5.w),
  504. if (item.timeLimitDesc?.isNotEmpty == true)
  505. Container(
  506. padding: EdgeInsets.symmetric(
  507. horizontal: 4.w,
  508. vertical: 2.w,
  509. ),
  510. margin: EdgeInsets.only(bottom: 4.w),
  511. decoration: ShapeDecoration(
  512. gradient: LinearGradient(
  513. begin: Alignment(0.00, 0.50),
  514. end: Alignment(1.00, 0.50),
  515. colors: [
  516. const Color(0xFFFF684E),
  517. const Color(0xFFFF4F9A),
  518. ],
  519. ),
  520. shape: RoundedRectangleBorder(
  521. borderRadius: BorderRadius.only(
  522. topLeft: Radius.circular(10.50),
  523. topRight: Radius.circular(10.50),
  524. bottomRight: Radius.circular(10.50),
  525. ),
  526. ),
  527. ),
  528. child: Text(
  529. item.timeLimitDesc!,
  530. style: TextStyle(
  531. color: Colors.white,
  532. fontSize: 12.sp,
  533. fontWeight: FontWeight.w500,
  534. ),
  535. ),
  536. ),
  537. ],
  538. ),
  539. Text(
  540. (item.code == "vip_permanent")
  541. ? '${item.description}'
  542. : '${item.priceDesc}',
  543. style: TextStyle(
  544. color: Colors.black.withAlpha(153),
  545. fontSize: 12.sp,
  546. fontWeight: FontWeight.w400,
  547. ),
  548. ),
  549. ],
  550. ),
  551. // Spacer(),
  552. // isSelected
  553. // ? Assets.images.iconCustomCharacterAddDialogSelect.image(
  554. // width: 20.w,
  555. // height: 20.w,
  556. // fit: BoxFit.contain,
  557. // )
  558. // : Container(
  559. // width: 20.w,
  560. // height: 20.w,
  561. // decoration: ShapeDecoration(
  562. // color: Colors.white,
  563. // shape: OvalBorder(
  564. // side: BorderSide(
  565. // width: 2.w,
  566. // color: const Color(0xFFE6E6E6),
  567. // ),
  568. // ),
  569. // ),
  570. // ),
  571. ],
  572. ),
  573. );
  574. }
  575. _buildSelectedDesc() {
  576. return Column(
  577. children: [
  578. Obx(() {
  579. return Container(
  580. margin: EdgeInsets.symmetric(horizontal: 16.w),
  581. child: Row(
  582. children: [
  583. Text(
  584. controller.selectedGoodsInfoItem?.selectDesc ?? "",
  585. style: TextStyle(
  586. color: Colors.black.withAlpha(102),
  587. fontSize: 12.sp,
  588. fontWeight: FontWeight.w400,
  589. ),
  590. ),
  591. ],
  592. ),
  593. );
  594. }),
  595. Visibility(visible:!isNotHWChannel(),child: Container(
  596. margin: EdgeInsets.symmetric(horizontal: 16.w),
  597. alignment: Alignment.centerLeft,
  598. child: GestureDetector(
  599. onTap: () {
  600. BrowserPage.start(WebUrl.memberServiceAgreement);
  601. },
  602. child:Text(
  603. StringName.textSpanMembershipAgreement,
  604. style: TextStyle(
  605. color: const Color(0xFF459FFF),
  606. fontSize: 10.sp,
  607. fontWeight: FontWeight.w400,
  608. ),
  609. ),),
  610. ), )
  611. ],
  612. );
  613. }
  614. Widget _buildMemberCard() {
  615. return Container(
  616. margin: EdgeInsets.symmetric(horizontal: 16.w),
  617. child: Column(
  618. mainAxisAlignment: MainAxisAlignment.start,
  619. crossAxisAlignment: CrossAxisAlignment.start,
  620. children: [
  621. Assets.images.iconNewDiscountMembershipCardTitle.image(
  622. width: 79.w,
  623. height: 24.w,
  624. ),
  625. SizedBox(height: 6.w),
  626. Text(
  627. StringName.newDiscountMemberCardDesc,
  628. style: TextStyle(
  629. color: Colors.black.withValues(alpha: 87),
  630. fontSize: 11.sp,
  631. fontWeight: FontWeight.w400,
  632. ),
  633. ),
  634. SizedBox(height: 8.w),
  635. _buildMemberCardItem(),
  636. SizedBox(height: 28.w),
  637. _buildUserNotice(),
  638. ],
  639. ),
  640. );
  641. }
  642. // 卡片权益
  643. _buildMemberCardItem() {
  644. return SizedBox(
  645. height: 80.w,
  646. child: AutoScrollListView(
  647. scrollDirection: Axis.horizontal,
  648. itemBuilder: (context, index) {
  649. final item = controller.memberCardList[index];
  650. return Container(
  651. margin: EdgeInsets.only(right: 8.w),
  652. width: 140.w,
  653. height: 65.w,
  654. decoration: ShapeDecoration(
  655. gradient: item.gradient,
  656. shape: RoundedRectangleBorder(
  657. side: BorderSide(width: 1.w, color: Colors.black.withAlpha(8)),
  658. borderRadius: BorderRadius.circular(20.r),
  659. ),
  660. ),
  661. child: Row(
  662. mainAxisAlignment: MainAxisAlignment.center,
  663. crossAxisAlignment: CrossAxisAlignment.center,
  664. children: [
  665. item.imageUrl.image(width: 28.w, height: 27.62.w),
  666. SizedBox(width: 8.w),
  667. Column(
  668. crossAxisAlignment: CrossAxisAlignment.start,
  669. mainAxisAlignment: MainAxisAlignment.center,
  670. children: [
  671. Text(
  672. item.title,
  673. style: TextStyle(
  674. color: Colors.black.withAlpha(204),
  675. fontSize: 12.sp,
  676. fontWeight: FontWeight.w700,
  677. ),
  678. ),
  679. SizedBox(height: 6.w),
  680. Text(
  681. item.desc,
  682. style: TextStyle(
  683. color: Colors.black.withAlpha(128),
  684. fontSize: 10.sp,
  685. fontWeight: FontWeight.w400,
  686. ),
  687. ),
  688. ],
  689. ),
  690. ],
  691. ),
  692. );
  693. },
  694. itemCount: controller.memberCardList.length,
  695. ),
  696. );
  697. }
  698. Widget _buildPrivacyTextSpan() {
  699. return Row(
  700. mainAxisAlignment: MainAxisAlignment.center,
  701. children: [
  702. Obx(() {
  703. return GestureDetector(
  704. behavior: HitTestBehavior.opaque,
  705. onTap: () {
  706. controller.isAgree.value = !controller.isAgree.value;
  707. },
  708. child:
  709. controller.isAgree.value
  710. ? Assets.images.iconStoreAgreePrivacy.image(
  711. width: 16.w,
  712. height: 16.w,
  713. )
  714. : SizedBox(
  715. child: Container(
  716. padding: EdgeInsets.all(1.w),
  717. width: 16.w,
  718. height: 16.w,
  719. child: Container(
  720. decoration: BoxDecoration(
  721. shape: BoxShape.circle,
  722. border: Border.all(
  723. color: Colors.black.withAlpha(153),
  724. width: 1.w,
  725. ),
  726. ),
  727. ),
  728. ),
  729. ),
  730. );
  731. }),
  732. Text.rich(
  733. PlatformUtil.isIOS
  734. ? TextSpan(
  735. children: [
  736. TextSpan(
  737. text: StringName.textSpanIHaveReadAndAgree,
  738. style: TextStyle(
  739. color: Colors.black.withAlpha(153),
  740. fontSize: 10.sp,
  741. fontWeight: FontWeight.w400,
  742. ),
  743. ),
  744. ClickTextSpan(
  745. text: StringName.textSpanPrivacyPolicy,
  746. url: WebUrl.privacyPolicy,
  747. ),
  748. ClickTextSpan(
  749. text: StringName.textSpanServiceTerms,
  750. url: WebUrl.serviceAgreement,
  751. ),
  752. TextSpan(
  753. text: StringName.textSpanAnd,
  754. style: TextStyle(
  755. color: Colors.black.withAlpha(153),
  756. fontSize: 10.sp,
  757. fontWeight: FontWeight.w400,
  758. ),
  759. ),
  760. ClickTextSpan(
  761. text: StringName.textSpanMembershipAgreement,
  762. url: WebUrl.subscribeAgreement,
  763. ),
  764. ],
  765. )
  766. : TextSpan(
  767. children: [
  768. TextSpan(
  769. text: StringName.textSpanIHaveReadAndAgree,
  770. style: TextStyle(
  771. color: Colors.black.withAlpha(153),
  772. fontSize: 10.sp,
  773. fontWeight: FontWeight.w400,
  774. ),
  775. ),
  776. ClickTextSpan(
  777. text: StringName.textSpanPrivacyPolicy,
  778. url: WebUrl.privacyPolicy,
  779. ),
  780. ClickTextSpan(
  781. text: StringName.textSpanServiceTerms,
  782. url: WebUrl.serviceAgreement,
  783. ),
  784. TextSpan(
  785. text: StringName.textSpanAnd,
  786. style: TextStyle(
  787. color: Colors.black.withAlpha(153),
  788. fontSize: 10.sp,
  789. fontWeight: FontWeight.w400,
  790. ),
  791. ),
  792. ClickTextSpan(
  793. text: StringName.textSpanMembershipAgreement,
  794. url: WebUrl.memberServiceAgreement,
  795. ),
  796. ],
  797. ),
  798. ),
  799. ],
  800. );
  801. }
  802. // 用户须知
  803. Widget _buildUserNotice() {
  804. return Container(
  805. decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.r)),
  806. child: Column(
  807. crossAxisAlignment: CrossAxisAlignment.start,
  808. children: [
  809. Text('购买须知', style: Styles.getTextStyleBlack204W400(12.sp)),
  810. SizedBox(height: 8.h),
  811. Obx(() {
  812. return Text(
  813. controller.configRepository.memberTips.value,
  814. style: Styles.getTextStyleBlack153W400(10.sp),
  815. );
  816. }),
  817. ],
  818. ),
  819. );
  820. }
  821. }