main.dart 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329
  1. import 'dart:async';
  2. import 'dart:convert';
  3. import 'dart:io';
  4. import 'package:amap_location/amap_location.dart';
  5. import 'package:bbyyy/beans/access_bean_entity.dart';
  6. import 'package:bbyyy/beans/template_bean_entity.dart';
  7. import 'package:bbyyy/beans/w_x_bean_entity.dart';
  8. import 'package:bbyyy/https/url.dart';
  9. import 'package:bbyyy/my_tools/event_bus.dart';
  10. import 'package:bbyyy/my_tools/my_cookie.dart';
  11. import 'package:bbyyy/my_tools/my_tools.dart';
  12. import 'package:bbyyy/paegs/login_page/login_page.dart';
  13. import 'package:bbyyy/paegs/pay_page/order_information_page.dart';
  14. import 'package:bbyyy/paegs/root_page/root_page.dart';
  15. import 'package:bbyyy/paegs/root_page/root_page_view.dart';
  16. import 'package:bbyyy/paegs/welcome_page/welcome_page.dart';
  17. import 'package:dio/dio.dart';
  18. import 'package:flustars/flustars.dart';
  19. import 'package:flutter/cupertino.dart';
  20. import 'package:flutter/material.dart';
  21. import 'package:flutter/services.dart';
  22. import 'package:flutter_local_notifications/flutter_local_notifications.dart';
  23. import 'package:flutter_localizations/flutter_localizations.dart';
  24. import 'package:flutter_svg/flutter_svg.dart';
  25. import 'package:fluwx/fluwx.dart';
  26. import 'package:pull_to_refresh/pull_to_refresh.dart';
  27. import 'package:rxdart/rxdart.dart';
  28. import 'beans/coupon_bean_entity.dart';
  29. import 'beans/my_shop_bean_entity.dart';
  30. import 'beans/new_order_bean_entity.dart';
  31. import 'beans/smart_order_bean_entity.dart';
  32. import 'beans/system_information_bean_entity.dart';
  33. import 'https/MyDio.dart';
  34. import 'https/my_request.dart';
  35. import 'my_tools/const.dart';
  36. import 'my_tools/dims.dart';
  37. import 'my_tools/easy_loading/easy_loading.dart';
  38. import 'my_tools/easy_loading/loading.dart';
  39. import 'my_tools/global.dart';
  40. import 'my_tools/my_colors.dart';
  41. import 'my_tools/my_views.dart';
  42. import 'my_tools/order.dart';
  43. import 'my_tools/pop_up_queue.dart';
  44. final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
  45. FlutterLocalNotificationsPlugin();
  46. final BehaviorSubject<ReceivedNotification> didReceiveLocalNotificationSubject =
  47. BehaviorSubject<ReceivedNotification>();
  48. final BehaviorSubject<String> selectNotificationSubject =
  49. BehaviorSubject<String>();
  50. class ReceivedNotification {
  51. ReceivedNotification({
  52. @required this.id,
  53. @required this.title,
  54. @required this.body,
  55. @required this.payload,
  56. });
  57. final int id;
  58. final String title;
  59. final String body;
  60. final String payload;
  61. }
  62. Future<void> main() async {
  63. if (Platform.isIOS) {
  64. AMapLocationClient.setApiKey('548414a843a2ec9c383e34341b8c84df');
  65. }
  66. WidgetsFlutterBinding.ensureInitialized();
  67. const AndroidInitializationSettings initializationSettingsAndroid =
  68. AndroidInitializationSettings('@mipmap/app_logo');
  69. /// Note: permissions aren't requested here just to demonstrate that can be
  70. /// done later
  71. final IOSInitializationSettings initializationSettingsIOS =
  72. IOSInitializationSettings(
  73. requestAlertPermission: true,
  74. requestBadgePermission: true,
  75. requestSoundPermission: true,
  76. onDidReceiveLocalNotification:
  77. (int id, String title, String body, String payload) async {
  78. didReceiveLocalNotificationSubject.add(ReceivedNotification(
  79. id: id, title: title, body: body, payload: payload));
  80. });
  81. const MacOSInitializationSettings initializationSettingsMacOS =
  82. MacOSInitializationSettings(
  83. requestAlertPermission: true,
  84. requestBadgePermission: true,
  85. requestSoundPermission: true);
  86. final InitializationSettings initializationSettings = InitializationSettings(
  87. android: initializationSettingsAndroid,
  88. iOS: initializationSettingsIOS,
  89. macOS: initializationSettingsMacOS);
  90. await flutterLocalNotificationsPlugin.initialize(initializationSettings,
  91. onSelectNotification: (String payload) async {
  92. if (payload != null) {
  93. if (payload == notifyTypeNewMsg) {
  94. RootPageView().bNIndex = 2;
  95. EventBus().emit('ChangePage');
  96. }
  97. debugPrint('notification payload: $payload');
  98. }
  99. selectNotificationSubject.add(payload);
  100. });
  101. runApp(MyApp());
  102. }
  103. class MyApp extends StatelessWidget with WidgetsBindingObserver {
  104. BuildContext buildContext;
  105. StateSetter ss;
  106. List<MyShopBeanDataData> shops = [];
  107. int shopIndex = 0;
  108. String clipboardT;
  109. int amountCompleted = 0;
  110. NewOrderBeanEntity newOrder;
  111. @override
  112. StatelessElement createElement() {
  113. // TODO: implement createElement
  114. WidgetsBinding.instance.addObserver(this);
  115. MyCookie().initP();
  116. _initFluwx();
  117. EventBus().on('hasNewOrder', (arg) {
  118. newOrder = arg;
  119. displayPendingOrders();
  120. });
  121. EventBus().on('systemInformation', (arg) {
  122. if (arg is SystemInformationBeanEntity) {
  123. showSystemMessages(arg);
  124. }
  125. });
  126. EventBus().on('检查粘贴板', (arg) {
  127. Timer(Duration(seconds: 1), () {
  128. getClipboardData();
  129. });
  130. });
  131. EventBus().on('hasCoupon', (arg) {
  132. if (arg is CouponBeanDataData) {
  133. couponBulletBox(arg);
  134. }
  135. });
  136. return super.createElement();
  137. }
  138. @override
  139. Widget build(BuildContext context) {
  140. SystemChrome.setPreferredOrientations([
  141. DeviceOrientation.portraitUp, //只能纵向
  142. DeviceOrientation.portraitDown, //只能纵向
  143. ]);
  144. return RefreshConfiguration(
  145. child: MaterialApp(
  146. navigatorKey: navigatorKey,
  147. theme: ThemeData(fontFamily: 'PingFang'),
  148. debugShowCheckedModeBanner: false,
  149. home: WelcomePage(),
  150. routes: {
  151. '/loginPage': (context) => LoginPage(),
  152. '/rootPage': (context) => RootPage(),
  153. },
  154. supportedLocales: [const Locale('zh', 'CH')],
  155. localizationsDelegates: [
  156. RefreshLocalizations.delegate,
  157. GlobalMaterialLocalizations.delegate,
  158. GlobalWidgetsLocalizations.delegate,
  159. const FallbackCupertinoLocalisationsDelegate(),
  160. ],
  161. builder: (BuildContext context, Widget child) {
  162. buildContext = context;
  163. return MediaQuery(
  164. data: MediaQuery.of(context)
  165. .copyWith(textScaleFactor: 1.0), //设置字体不随系统字体大小改变
  166. child: FlutterEasyLoading(
  167. child: child,
  168. ),
  169. );
  170. },
  171. ),
  172. hideFooterWhenNotFull: true,
  173. footerBuilder: () {
  174. return ClassicFooter(
  175. loadStyle: LoadStyle.ShowWhenLoading,
  176. );
  177. },
  178. );
  179. }
  180. @override
  181. void didChangeAppLifecycleState(AppLifecycleState state) {
  182. super.didChangeAppLifecycleState(state);
  183. if (state == AppLifecycleState.paused) {
  184. print('went to Background');
  185. }
  186. if (state == AppLifecycleState.resumed) {
  187. print('came back to Foreground');
  188. if (MyCookie().loginInformation != null) {
  189. Timer(Duration(seconds: 1), () {
  190. getClipboardData();
  191. });
  192. }
  193. }
  194. }
  195. //获取剪切板文字
  196. Future<void> getClipboardData() async {
  197. PopUpQueue().onShow = true;
  198. ClipboardData text = await Clipboard.getData(Clipboard.kTextPlain);
  199. try {
  200. print('Clipboard-----\n${text.text}');
  201. clipboardT = text.text;
  202. Clipboard.setData(ClipboardData(text: ''));
  203. getOnlineTemplate();
  204. } catch (e) {
  205. PopUpQueue().onShow = false;
  206. PopUpQueue().showNext();
  207. }
  208. }
  209. //获取线上模板
  210. void getOnlineTemplate() {
  211. MyDio().query({
  212. 'key': 'order_template',
  213. "dims": ["id", "sid", "template"],
  214. "filters": {}
  215. }, (response, hasError) {
  216. if (!hasError) {
  217. TemplateBeanEntity entity = TemplateBeanEntity()
  218. .fromJson(json.decode(response.data.toString()));
  219. checkOrder(entity.data);
  220. } else {
  221. PopUpQueue().onShow = false;
  222. PopUpQueue().showNext();
  223. }
  224. }, (error) {
  225. PopUpQueue().onShow = false;
  226. PopUpQueue().showNext();
  227. });
  228. }
  229. var orderHash;
  230. //最大金额赢家数量 0---发送订单的人不是最大赢家 1---发订单的人是最大赢家 2---发订单的人是最大赢家且有两个一样的金额
  231. int commissionPayerNum = -1;
  232. //匹配模板去除不是自己的订单
  233. void checkOrder(List<TemplateBeanData> data) {
  234. commissionPayerNum = -1;
  235. bool hasMatch = false;
  236. w:
  237. for (int i = 0; i < data.length; i++) {
  238. try {
  239. var res = parseString2(
  240. data[i].template.replaceAll('\r', ''), '''$clipboardT''');
  241. if (res != null) {
  242. print('-----------data[i].template-----------');
  243. print(data[i].template);
  244. print(json.encode(res));
  245. var order = parse2(res);
  246. print(order.toString());
  247. var maxAmount = 0;
  248. int maxAmountNum = 0;
  249. order.forEach((element) {
  250. if (maxAmount < element.seller.amount) {
  251. maxAmount = element.seller.amount;
  252. maxAmountNum = 1;
  253. } else if (maxAmount == element.seller.amount) {
  254. maxAmountNum++;
  255. }
  256. });
  257. print('maxAmount---------$maxAmount');
  258. print('maxAmountNum---------$maxAmountNum');
  259. int meIsMaximum = order.indexWhere((element) =>
  260. element.seller.amount == maxAmount &&
  261. (element.seller.name
  262. .contains(MyCookie().loginInformation.data.extra.name) ||
  263. MyCookie()
  264. .loginInformation
  265. .data
  266. .extra
  267. .name
  268. .contains(element.seller.name)));
  269. if (meIsMaximum >= 0) {
  270. commissionPayerNum = maxAmountNum;
  271. }
  272. print('commissionPayerNum-----------$commissionPayerNum');
  273. order.removeWhere((element) =>
  274. !element.seller.name
  275. .contains(MyCookie().loginInformation.data.extra.name) &&
  276. !MyCookie()
  277. .loginInformation
  278. .data
  279. .extra
  280. .name
  281. .contains(element.seller.name));
  282. if (order.length > 0) {
  283. hasMatch = true;
  284. orderHash = computeOrderHash(res);
  285. getShop(order);
  286. }
  287. break w;
  288. }
  289. } catch (e) {}
  290. }
  291. if (!hasMatch) {
  292. PopUpQueue().onShow = false;
  293. PopUpQueue().showNext();
  294. }
  295. }
  296. //订单视图
  297. items(List<OrderInfo2> order) {
  298. List<Widget> items = [];
  299. order.forEach((element) {
  300. items.add(Container(
  301. child: Column(
  302. children: [
  303. Row(
  304. children: [
  305. Container(
  306. margin: EdgeInsets.only(left: 8, right: 7),
  307. child: ClipRRect(
  308. child: MyViews().netImg(
  309. imgURL(MyCookie().loginInformation.data.extra.picture),
  310. 35,
  311. 35),
  312. borderRadius: BorderRadius.circular(17.5),
  313. ),
  314. ),
  315. Expanded(
  316. child: Container(
  317. height: 35,
  318. child: Column(
  319. children: [
  320. Text(
  321. '付款人:${element.payer.name}',
  322. style: TextStyle(
  323. color: MyColors.c333333,
  324. fontSize: 13,
  325. decoration: TextDecoration.none,
  326. ),
  327. ),
  328. Text(
  329. '订单时间:${element.time}',
  330. style: TextStyle(
  331. color: MyColors.c666666,
  332. fontSize: 10,
  333. decoration: TextDecoration.none,
  334. ),
  335. ),
  336. ],
  337. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  338. crossAxisAlignment: CrossAxisAlignment.start,
  339. ),
  340. ),
  341. ),
  342. Container(
  343. margin: EdgeInsets.only(right: 10),
  344. child: Text(
  345. '¥${(element.payer.amount * element.factor).toStringAsFixed(2)}',
  346. style: TextStyle(
  347. color: MyColors.cFF4233,
  348. fontSize: 14,
  349. decoration: TextDecoration.none,
  350. ),
  351. ),
  352. ),
  353. ],
  354. crossAxisAlignment: CrossAxisAlignment.center,
  355. ),
  356. Container(
  357. height: 0.5,
  358. margin: EdgeInsets.only(right: 10, left: 50, top: 5),
  359. color: MyColors.cE7E7E7,
  360. )
  361. ],
  362. ),
  363. margin: EdgeInsets.only(top: 5),
  364. ));
  365. });
  366. return items;
  367. }
  368. bool saving = false;
  369. //获取用户所在店铺
  370. void getShop(List<OrderInfo2> order) {
  371. shopIndex = 0;
  372. MyDio().query({
  373. "key": "shop_user",
  374. "filters": {
  375. "or": true,
  376. "conditions": [
  377. "role!=0",
  378. "user_uid==${MyCookie().getUID()}",
  379. "review_state==1"
  380. ],
  381. "filters": [
  382. {
  383. "conditions": ["role==0", "user_uid==${MyCookie().getUID()}"]
  384. }
  385. ]
  386. },
  387. "dims": shopUserDims,
  388. "paging": [1, 20000]
  389. }, (response, hasError) {
  390. if (!hasError) {
  391. MyShopBeanEntity entity =
  392. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  393. shops = entity.data.data;
  394. shops.removeWhere((element) => !element.privateShop);
  395. if (shops.length == 0) {
  396. showToast('你还没有添加任何货帮,暂时不能发送智能订单');
  397. PopUpQueue().onShow = false;
  398. PopUpQueue().showNext();
  399. } else {
  400. EasyLoading.instance
  401. ..contentPadding = EdgeInsets.symmetric(horizontal: 0, vertical: 12)
  402. ..alignment = Alignment.bottomCenter
  403. ..loadingStyle = EasyLoadingStyle.light
  404. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  405. EasyLoading.show(
  406. indicator: Material(
  407. color: Colors.white,
  408. child: StatefulBuilder(
  409. builder: (c, s) {
  410. ss = s;
  411. return Column(
  412. children: [
  413. Container(
  414. child: Stack(
  415. children: [
  416. Container(
  417. child: MyViews()
  418. .myText('智能订单', MyColors.c333333, 14),
  419. alignment: Alignment.center,
  420. height: 22,
  421. ),
  422. Positioned(
  423. right: 0,
  424. child: GestureDetector(
  425. onTap: () {
  426. PopUpQueue().onShow = false;
  427. PopUpQueue().showNext();
  428. },
  429. behavior: HitTestBehavior.translucent,
  430. child: Container(
  431. child: Icon(
  432. Icons.close,
  433. size: 20,
  434. color: Colors.white,
  435. ),
  436. decoration: BoxDecoration(
  437. color: MyColors.cB6B6B6,
  438. borderRadius: BorderRadius.circular(11)),
  439. height: 22,
  440. width: 22,
  441. ),
  442. ),
  443. )
  444. ],
  445. alignment: Alignment.center,
  446. ),
  447. height: 30,
  448. padding: EdgeInsets.symmetric(horizontal: 12),
  449. ),
  450. Container(
  451. height: 5,
  452. color: MyColors.cF7F7F7,
  453. margin: EdgeInsets.only(top: 10),
  454. ),
  455. Column(
  456. children: items(order),
  457. ),
  458. Container(
  459. height: 5,
  460. color: MyColors.cF7F7F7,
  461. margin: EdgeInsets.only(top: 10),
  462. ),
  463. Visibility(
  464. child: Column(
  465. children: [
  466. Container(
  467. child: MyViews()
  468. .myText('货帮选择', MyColors.c333333, 13),
  469. margin: EdgeInsets.only(left: 7, top: 11),
  470. ),
  471. Container(
  472. margin: EdgeInsets.symmetric(
  473. horizontal: 7, vertical: 10),
  474. height: (shops.length * 1.0 / 2).ceil() *
  475. (double.parse(
  476. '${MediaQuery.of(buildContext).size.width - 74}') /
  477. 2 /
  478. 3.8 +
  479. 10) -
  480. 10,
  481. child: GridView(
  482. gridDelegate:
  483. SliverGridDelegateWithFixedCrossAxisCount(
  484. crossAxisCount: 2, //横轴三个子widget
  485. childAspectRatio: 3.8,
  486. crossAxisSpacing: 10,
  487. mainAxisSpacing: 8 //宽高比为1时,子widget
  488. ),
  489. children: shop(shops),
  490. padding: EdgeInsets.all(0),
  491. ),
  492. ),
  493. ],
  494. crossAxisAlignment: CrossAxisAlignment.start,
  495. ),
  496. visible: shops.length != 1,
  497. ),
  498. Container(
  499. height: 0.5,
  500. color: MyColors.cF7F7F7,
  501. margin: EdgeInsets.only(bottom: 10),
  502. ),
  503. Container(
  504. child: GestureDetector(
  505. onTap: () {
  506. if (saving) {
  507. return;
  508. } else {
  509. saving = true;
  510. EventBus().on('saveOrder', (arg) {
  511. amountCompleted++;
  512. if (amountCompleted == order.length) {
  513. amountCompleted = 0;
  514. EasyLoading.dismiss();
  515. showToast('发送成功');
  516. clipboardT = '';
  517. saving = false;
  518. EventBus().off('saveOrder');
  519. PopUpQueue().onShow = false;
  520. PopUpQueue().showNext();
  521. }
  522. });
  523. order.forEach((element) {
  524. sendOrder(element);
  525. });
  526. }
  527. },
  528. behavior: HitTestBehavior.translucent,
  529. child: Container(
  530. decoration: BoxDecoration(
  531. color: MyColors.cFF4233,
  532. borderRadius: BorderRadius.circular(20),
  533. ),
  534. height: 40,
  535. width: 150,
  536. child: MyViews().myText('发送订单', Colors.white, 14),
  537. alignment: Alignment.center,
  538. ),
  539. ),
  540. alignment: Alignment.center,
  541. )
  542. ],
  543. mainAxisAlignment: MainAxisAlignment.start,
  544. crossAxisAlignment: CrossAxisAlignment.start,
  545. );
  546. },
  547. ),
  548. ),
  549. );
  550. }
  551. } else {
  552. PopUpQueue().onShow = false;
  553. PopUpQueue().showNext();
  554. }
  555. }, (error) {
  556. PopUpQueue().onShow = false;
  557. PopUpQueue().showNext();
  558. });
  559. }
  560. //店铺视图
  561. shop(List<MyShopBeanDataData> shops) {
  562. List<Widget> items = [];
  563. for (int i = 0; i < shops.length; i++) {
  564. items.add(GestureDetector(
  565. onTap: () {
  566. shopIndex = i;
  567. ss(() {});
  568. },
  569. behavior: HitTestBehavior.translucent,
  570. child: Container(
  571. child: Row(
  572. children: [
  573. Container(
  574. margin: EdgeInsets.only(right: 5),
  575. child: ClipRRect(
  576. child: MyViews().netImg(imgURL(shops[i].shopPic), 30, 30),
  577. borderRadius: BorderRadius.circular(15),
  578. ),
  579. ),
  580. Expanded(
  581. child: Column(
  582. children: [
  583. Text(
  584. shops[i].shopName,
  585. style: TextStyle(
  586. color: i == shopIndex
  587. ? MyColors.cFF4233
  588. : MyColors.c666666,
  589. fontSize: 12,
  590. ),
  591. maxLines: 1,
  592. overflow: TextOverflow.ellipsis,
  593. softWrap: true,
  594. ),
  595. Text(
  596. 'ID:${shops[i].shopUid}',
  597. style: TextStyle(
  598. color: i == shopIndex
  599. ? MyColors.cFF4233
  600. : MyColors.c666666,
  601. fontSize: 10,
  602. ),
  603. maxLines: 1,
  604. overflow: TextOverflow.ellipsis,
  605. softWrap: true,
  606. ),
  607. ],
  608. crossAxisAlignment: CrossAxisAlignment.start,
  609. ),
  610. ),
  611. ],
  612. ),
  613. decoration: BoxDecoration(
  614. color: i == shopIndex ? MyColors.cFFECEB : MyColors.cEDEDED,
  615. borderRadius: BorderRadius.circular(4),
  616. ),
  617. constraints: BoxConstraints(maxWidth: 150),
  618. padding: EdgeInsets.symmetric(horizontal: 6, vertical: 6),
  619. ),
  620. ));
  621. }
  622. return items;
  623. }
  624. //发送订单
  625. void sendOrder(OrderInfo2 element) {
  626. MyDio().save({
  627. 'key': 'order',
  628. 'object': {
  629. 'uuid': orderHash,
  630. 'shop_uid': shops[shopIndex].shopUid,
  631. 'shop_pic': shops[shopIndex].shopPic,
  632. 'shop_name': shops[shopIndex].shopName,
  633. 'seller_pic': MyCookie().loginInformation.data.extra.picture,
  634. 'seller_uid': MyCookie().getUID(),
  635. 'seller_name': MyCookie().loginInformation.data.extra.name,
  636. 'buyer_name': element.payer.name,
  637. 'type': orderTypeThirdPlatform,
  638. 'amount': NumUtil.multiply(element.payer.amount, element.factor),
  639. 'commission_payer_num': commissionPayerNum
  640. }
  641. }, (response, hasError) {
  642. if (!hasError) {
  643. EventBus().emit('saveOrder');
  644. }
  645. }, (error) {});
  646. }
  647. //待支付订单视图
  648. void displayPendingOrders() {
  649. EasyLoading.instance
  650. ..contentPadding = EdgeInsets.symmetric(horizontal: 0, vertical: 12)
  651. ..alignment = Alignment.bottomCenter
  652. ..loadingStyle = EasyLoadingStyle.light
  653. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  654. EasyLoading.show(
  655. indicator: Material(
  656. color: Colors.white,
  657. child: Column(
  658. children: [
  659. Container(
  660. padding: EdgeInsets.symmetric(horizontal: 12),
  661. child: Row(
  662. children: [
  663. Container(
  664. margin: EdgeInsets.only(right: 7),
  665. child: ClipRRect(
  666. child: MyViews()
  667. .netImg(imgURL(newOrder.content.shopPic), 25, 25),
  668. borderRadius: BorderRadius.circular(12.5),
  669. ),
  670. ),
  671. MyViews().myText(
  672. '${newOrder.content.shopName}(${newOrder.content.shopUID})',
  673. MyColors.c333333,
  674. 14),
  675. ],
  676. ),
  677. ),
  678. Container(
  679. margin: EdgeInsets.only(top: 11, left: 12, right: 12, bottom: 11),
  680. height: 0.5,
  681. color: MyColors.cE7E7E7,
  682. ),
  683. Container(
  684. margin: EdgeInsets.symmetric(horizontal: 12),
  685. child: Row(
  686. children: [
  687. Container(
  688. child: SvgPicture.asset(
  689. newOrder.content.buyerPic == null
  690. ? 'images/svg/第三方.svg'
  691. : 'images/svg/线下付款.svg',
  692. height: 27,
  693. width: 27,
  694. ),
  695. margin: EdgeInsets.only(right: 8),
  696. height: 45,
  697. width: 45,
  698. decoration: BoxDecoration(
  699. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  700. alignment: Alignment.center,
  701. ),
  702. Expanded(
  703. child: Container(
  704. height: 45,
  705. child: Column(
  706. children: [
  707. MyViews().myText(
  708. newOrder.content.buyerPic == null
  709. ? '第三方订单'
  710. : '线下付款',
  711. MyColors.c333333,
  712. 13),
  713. Row(
  714. children: [
  715. MyViews().myText('¥${newOrder.content.amount}',
  716. MyColors.cFF4233, 12),
  717. MyViews().myText('x1', MyColors.c999999, 12),
  718. ],
  719. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  720. )
  721. ],
  722. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  723. crossAxisAlignment: CrossAxisAlignment.start,
  724. ),
  725. ),
  726. ),
  727. ],
  728. ),
  729. ),
  730. Container(
  731. height: 0.5,
  732. color: MyColors.cE7E7E7,
  733. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  734. ),
  735. Container(
  736. margin: EdgeInsets.symmetric(horizontal: 12),
  737. child: Row(
  738. children: [
  739. MyViews().myText('卖家信息:', MyColors.c333333, 13),
  740. Row(
  741. children: [
  742. Container(
  743. margin: EdgeInsets.only(right: 5),
  744. child: ClipRRect(
  745. child: MyViews().netImg(
  746. imgURL(newOrder.content.sellerPic), 23, 23),
  747. borderRadius: BorderRadius.circular(11.5),
  748. ),
  749. ),
  750. MyViews().myText(
  751. '${newOrder.content.sellerName}(${hideUID(newOrder.content.sellerUID.toString())})',
  752. MyColors.c333333,
  753. 13),
  754. ],
  755. )
  756. ],
  757. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  758. ),
  759. ),
  760. Container(
  761. height: 0.5,
  762. color: MyColors.cE7E7E7,
  763. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  764. ),
  765. Container(
  766. margin: EdgeInsets.symmetric(horizontal: 12),
  767. child: Row(
  768. children: [
  769. MyViews().myText('买家信息:', MyColors.c333333, 13),
  770. Row(
  771. children: [
  772. Container(
  773. margin: EdgeInsets.only(right: 5),
  774. child: ClipRRect(
  775. child: MyViews().netImg(
  776. newOrder.content.buyerPic == null
  777. ? ''
  778. : imgURL(newOrder.content.buyerPic),
  779. 23,
  780. 23),
  781. borderRadius: BorderRadius.circular(11.5),
  782. ),
  783. ),
  784. MyViews().myText(
  785. '${newOrder.content.buyerName} ${newOrder.content.buyerUID != null && newOrder.content.buyerUID.toString().length > 0 ? '(${newOrder.content.buyerUID})' : ''}',
  786. MyColors.c333333,
  787. 13),
  788. ],
  789. )
  790. ],
  791. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  792. ),
  793. ),
  794. Container(
  795. height: 0.5,
  796. color: MyColors.cE7E7E7,
  797. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  798. ),
  799. Container(
  800. margin: EdgeInsets.symmetric(horizontal: 12),
  801. child: Row(
  802. children: [
  803. MyViews().myText('下单时间:', MyColors.c333333, 13),
  804. MyViews().myText(
  805. '${newOrder.content.createTime}', MyColors.c333333, 13)
  806. ],
  807. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  808. ),
  809. ),
  810. Container(
  811. height: 0.5,
  812. color: MyColors.cE7E7E7,
  813. margin: EdgeInsets.symmetric(horizontal: 12, vertical: 11),
  814. ),
  815. Container(
  816. margin: EdgeInsets.symmetric(horizontal: 20),
  817. child: Row(
  818. children: [
  819. Expanded(
  820. child: GestureDetector(
  821. onTap: () {
  822. PopUpQueue().onShow = false;
  823. PopUpQueue().showNext();
  824. },
  825. behavior: HitTestBehavior.translucent,
  826. child: Container(
  827. decoration: BoxDecoration(
  828. borderRadius: BorderRadius.only(
  829. topLeft: Radius.circular(20),
  830. bottomLeft: Radius.circular(20),
  831. ),
  832. border: Border.all(
  833. color: MyColors.cFF4233, width: 1)),
  834. height: 40,
  835. child: MyViews().myText('与我无瓜', MyColors.cFF4233, 14),
  836. alignment: Alignment.center),
  837. ),
  838. ),
  839. Expanded(
  840. child: GestureDetector(
  841. onTap: () {
  842. if (newOrder.content.buyerName
  843. .contains(MyCookie().getName()) ||
  844. MyCookie()
  845. .getName()
  846. .contains(newOrder.content.buyerName)) {
  847. EasyLoading.dismiss();
  848. payTheOrder();
  849. } else {
  850. showToast('该订单与你无关');
  851. PopUpQueue().onShow = false;
  852. PopUpQueue().showNext();
  853. }
  854. },
  855. behavior: HitTestBehavior.translucent,
  856. child: Container(
  857. decoration: BoxDecoration(
  858. borderRadius: BorderRadius.only(
  859. topRight: Radius.circular(20),
  860. bottomRight: Radius.circular(20),
  861. ),
  862. color: MyColors.cFF4233),
  863. height: 40,
  864. child: MyViews().myText('去支付', Colors.white, 14),
  865. alignment: Alignment.center),
  866. ),
  867. )
  868. ],
  869. ),
  870. )
  871. ],
  872. ),
  873. ),
  874. );
  875. }
  876. void payTheOrder() {
  877. //获取店铺信息
  878. MyDio().query({
  879. "key": "shop_user",
  880. "filters": {
  881. "conditions": ["shop_uid==${newOrder.content.shopUID}"]
  882. },
  883. "dims": shopUserDims,
  884. "paging": [1, 1],
  885. "order_by": ["shop_name,DESC"]
  886. }, (response, hasError) {
  887. if (!hasError) {
  888. MyShopBeanEntity entity =
  889. MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
  890. SmartOrderBeanDataData data = SmartOrderBeanDataData();
  891. data.sellerUid = newOrder.content.sellerUID;
  892. data.sellerName = newOrder.content.sellerName;
  893. data.sellerPic = newOrder.content.sellerPic;
  894. data.buyerUid = 0;
  895. data.buyerName = newOrder.content.buyerName;
  896. data.buyerPic = '';
  897. data.amount = newOrder.content.amount;
  898. data.uid = newOrder.content.uID;
  899. navigatorKey.currentState
  900. .push(MaterialPageRoute(
  901. builder: (context) => OrderInformationPage(
  902. false,
  903. orderType: orderTypeThirdPlatform,
  904. amount: newOrder.content.amount,
  905. uid: newOrder.content.uID,
  906. buyerUid: MyCookie().getUID(),
  907. buyerName: newOrder.content.buyerName,
  908. buyerPic: MyCookie().getPic(),
  909. commodityCount: 1,
  910. commodityTitle: '第三方订单',
  911. commodityCover: '',
  912. sellName: newOrder.content.sellerName,
  913. sellPic: newOrder.content.sellerPic,
  914. sellUid: newOrder.content.sellerUID,
  915. )))
  916. .then((value) {
  917. PopUpQueue().onShow = false;
  918. PopUpQueue().showNext();
  919. });
  920. // navigatorKey.currentState.push(MaterialPageRoute(
  921. // builder: (context) =>
  922. // GangInPage(entity.data.data[0], newOrder.content)));
  923. }
  924. }, (error) {});
  925. // getUserWalletBalance((re, hE) {
  926. // if (!hE) {
  927. // UserBalanceEntity balance =
  928. // UserBalanceEntity().fromJson(json.decode(re.data.toString()));
  929. // if (balance.data >= newOrder.content.amount) {
  930. // payOrder(payWayWallet, newOrder.content.uID, (re, hE) {
  931. // if (!hE) {
  932. // showToast('支付成功');
  933. // EventBus().emit('payAnOrder');
  934. // }
  935. // }, (e) {}, context);
  936. // } else {
  937. // payOrder(payWayAliPay, newOrder.content.uID, (re, hE) {
  938. // if (!hE) {
  939. // PayByAlipayBeanEntity entity = PayByAlipayBeanEntity()
  940. // .fromJson(json.decode(re.data.toString()));
  941. // EventBus().on('alipayPaymentCallback', (arg) {
  942. // EventBus().off('alipayPaymentCallback');
  943. // EasyLoading.dismiss();
  944. // showToast('支付成功');
  945. // EventBus().emit('reNoPayOrder');
  946. // });
  947. // print(entity.data);
  948. // EasyLoading.instance
  949. // ..contentPadding =
  950. // EdgeInsets.symmetric(horizontal: 20, vertical: 12)
  951. // ..alignment = Alignment.center
  952. // ..contentMargin = EdgeInsets.all(20);
  953. // EasyLoading.show();
  954. // aliPay(entity.data).then((value) {
  955. // print(json.encode(value));
  956. // AlipayResultBeanEntity e = AlipayResultBeanEntity()
  957. // .fromJson(json.decode(json.encode(value)));
  958. // try {
  959. // int r = int.parse(e.resultStatus);
  960. // if (r == 9000) {
  961. // showToast('支付成功');
  962. // } else {
  963. // showToast(aliPayResultStatus(r));
  964. // resetOrder(newOrder.content.uID, context);
  965. // }
  966. // } catch (e) {
  967. // EasyLoading.dismiss();
  968. // }
  969. // });
  970. // // EventBus().emit('payAnOrder');
  971. // }
  972. // }, (e) {}, context);
  973. // // showToast('积分余额不足');
  974. // }
  975. // }
  976. // }, (e) {}, context);
  977. }
  978. void showSystemMessages(SystemInformationBeanEntity arg) {
  979. EasyLoading.instance
  980. ..contentPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 12)
  981. ..alignment = Alignment.center
  982. ..loadingStyle = EasyLoadingStyle.custom
  983. ..backgroundColor = Colors.transparent
  984. ..indicatorColor = Colors.black
  985. ..progressColor = Colors.black
  986. ..maskColor = Colors.black
  987. ..textColor = Colors.black
  988. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  989. EasyLoading.show(
  990. indicator: Material(
  991. color: Colors.transparent,
  992. child: Container(
  993. decoration: BoxDecoration(
  994. borderRadius: BorderRadius.circular(16),
  995. ),
  996. height: MediaQuery.of(buildContext).size.height - 200,
  997. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  998. child: Column(
  999. children: [
  1000. Expanded(child: Container()),
  1001. Container(
  1002. decoration: BoxDecoration(
  1003. color: Colors.white,
  1004. borderRadius: BorderRadius.circular(16),
  1005. ),
  1006. child: Column(
  1007. children: [
  1008. Container(
  1009. child: Text(
  1010. '系统消息',
  1011. style: TextStyle(
  1012. color: MyColors.c333333,
  1013. fontSize: 14,
  1014. fontWeight: FontWeight.bold),
  1015. ),
  1016. margin:
  1017. EdgeInsets.symmetric(horizontal: 26, vertical: 15),
  1018. ),
  1019. Container(
  1020. child: Text(
  1021. arg.content.content,
  1022. style: TextStyle(color: MyColors.c333333, fontSize: 14),
  1023. ),
  1024. margin: EdgeInsets.symmetric(horizontal: 26),
  1025. alignment: Alignment.centerLeft,
  1026. ),
  1027. Container(
  1028. height: 0.5,
  1029. color: MyColors.cE7E7E7,
  1030. margin: EdgeInsets.only(bottom: 12, top: 12),
  1031. ),
  1032. GestureDetector(
  1033. onTap: () {
  1034. PopUpQueue().onShow = false;
  1035. PopUpQueue().showNext();
  1036. },
  1037. behavior: HitTestBehavior.translucent,
  1038. child: Container(
  1039. width: 150,
  1040. margin: EdgeInsets.only(bottom: 14),
  1041. decoration: BoxDecoration(
  1042. borderRadius: BorderRadius.circular(20),
  1043. border:
  1044. Border.all(color: MyColors.cFF4233, width: 1.1),
  1045. color: Colors.white),
  1046. child: MyViews().myText('我知道了', MyColors.cFF4233, 14),
  1047. height: 40,
  1048. alignment: Alignment.center,
  1049. ),
  1050. )
  1051. ],
  1052. ),
  1053. ),
  1054. Expanded(child: Container()),
  1055. ],
  1056. ),
  1057. alignment: Alignment.center,
  1058. ),
  1059. ),
  1060. );
  1061. }
  1062. //优惠券弹框
  1063. void couponBulletBox(CouponBeanDataData data) {
  1064. EasyLoading.instance
  1065. ..contentPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 12)
  1066. ..alignment = Alignment.center
  1067. ..loadingStyle = EasyLoadingStyle.custom
  1068. ..backgroundColor = Colors.transparent
  1069. ..indicatorColor = Colors.black
  1070. ..progressColor = Colors.black
  1071. ..maskColor = Colors.black
  1072. ..textColor = Colors.black
  1073. ..contentMargin = EdgeInsets.fromLTRB(20, 20, 20, 65);
  1074. EasyLoading.show(
  1075. indicator: Material(
  1076. color: Colors.transparent,
  1077. child: Stack(
  1078. children: [
  1079. Image.asset(
  1080. 'images/优惠券.png',
  1081. height: 640,
  1082. width: double.infinity,
  1083. ),
  1084. Container(
  1085. height: 640,
  1086. margin: EdgeInsets.only(top: 24),
  1087. child: Column(
  1088. children: [
  1089. Container(
  1090. margin: EdgeInsets.only(bottom: 5),
  1091. child: Text(
  1092. '抢红包啦',
  1093. style: TextStyle(
  1094. color: Colors.white,
  1095. fontSize: 24,
  1096. fontWeight: FontWeight.bold,
  1097. shadows: [
  1098. Shadow(
  1099. offset: Offset(1.0, 1.0),
  1100. blurRadius: 3.0,
  1101. color: MyColors.cDC1717,
  1102. )
  1103. ]),
  1104. ),
  1105. ),
  1106. Container(
  1107. decoration: BoxDecoration(
  1108. color: Colors.white,
  1109. borderRadius: BorderRadius.circular(8),
  1110. ),
  1111. height: 107,
  1112. width: double.infinity,
  1113. margin: EdgeInsets.symmetric(horizontal: 25, vertical: 27),
  1114. child: Column(
  1115. children: [
  1116. Text(
  1117. '平台红包大放送!',
  1118. style: TextStyle(
  1119. color: MyColors.c333333,
  1120. fontSize: 16,
  1121. fontWeight: FontWeight.bold),
  1122. ),
  1123. Text(
  1124. '立即去抢最高${data.max}元消费红包',
  1125. style: TextStyle(
  1126. color: MyColors.cFF4233,
  1127. fontSize: 14,
  1128. fontWeight: FontWeight.bold),
  1129. ),
  1130. Text(
  1131. '活动时间${data.distributeFromDate}至${data.distributeEndDate}',
  1132. style: TextStyle(
  1133. color: MyColors.c666666,
  1134. fontSize: 11,
  1135. fontWeight: FontWeight.bold),
  1136. ),
  1137. ],
  1138. mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  1139. crossAxisAlignment: CrossAxisAlignment.start,
  1140. ),
  1141. padding: EdgeInsets.symmetric(horizontal: 26),
  1142. ),
  1143. Container(
  1144. margin: EdgeInsets.symmetric(horizontal: 25),
  1145. child: Row(
  1146. children: [
  1147. Expanded(
  1148. child: GestureDetector(
  1149. onTap: () {
  1150. EasyLoading.dismiss();
  1151. },
  1152. behavior: HitTestBehavior.translucent,
  1153. child: Container(
  1154. height: 34,
  1155. decoration: BoxDecoration(
  1156. borderRadius: BorderRadius.only(
  1157. topLeft: Radius.circular(17),
  1158. bottomLeft: Radius.circular(17),
  1159. ),
  1160. border: Border.all(
  1161. color: MyColors.cFFB455, width: 1),
  1162. color: Colors.white),
  1163. child: Text(
  1164. '我已参与',
  1165. style: TextStyle(
  1166. color: MyColors.cFFB455,
  1167. fontSize: 14,
  1168. ),
  1169. ),
  1170. alignment: Alignment.center,
  1171. ),
  1172. ),
  1173. ),
  1174. Expanded(
  1175. child: GestureDetector(
  1176. onTap: () {
  1177. grabACoupon(data.id);
  1178. },
  1179. behavior: HitTestBehavior.translucent,
  1180. child: Container(
  1181. height: 34,
  1182. decoration: BoxDecoration(
  1183. borderRadius: BorderRadius.only(
  1184. topRight: Radius.circular(17),
  1185. bottomRight: Radius.circular(17),
  1186. ),
  1187. color: MyColors.cFFB455),
  1188. child: Text(
  1189. '立即去抢',
  1190. style: TextStyle(
  1191. color: Colors.white,
  1192. fontSize: 14,
  1193. ),
  1194. ),
  1195. alignment: Alignment.center,
  1196. ),
  1197. ),
  1198. ),
  1199. ],
  1200. ),
  1201. )
  1202. ],
  1203. mainAxisAlignment: MainAxisAlignment.center,
  1204. ),
  1205. alignment: Alignment.center,
  1206. )
  1207. ],
  1208. ),
  1209. ),
  1210. );
  1211. }
  1212. _initFluwx() async {
  1213. await registerWxApi(
  1214. appId: AppID,
  1215. doOnAndroid: true,
  1216. doOnIOS: true,
  1217. universalLink: "https://oms.kunyueyun.com/");
  1218. var result = await isWeChatInstalled;
  1219. print("is installed $result");
  1220. weChatResponseEventHandler.listen((res) {
  1221. if (res is WeChatPaymentResponse) {
  1222. // do something here
  1223. print('res.type----${res.type}');
  1224. print('res.extData----${res.extData}');
  1225. print('res.errCode----${res.errCode}');
  1226. print('res.errStr----${res.errStr}');
  1227. print('res.isSuccessful----${res.isSuccessful}');
  1228. EventBus().emit('WeChatPaymentResponse', res.isSuccessful);
  1229. }
  1230. if (res is WeChatAuthResponse) {
  1231. print('res.type----${res.type}');
  1232. print('res.country----${res.country}');
  1233. print('res.lang----${res.lang}');
  1234. print('res.code----${res.code}');
  1235. print('res.state----${res.state}');
  1236. print(
  1237. 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=$AppID&secret=$AppSecret&code=${res.code}&grant_type=authorization_code');
  1238. Dio()
  1239. .get(
  1240. 'https://api.weixin.qq.com/sns/oauth2/access_token?appid=$AppID&secret=$AppSecret&code=${res.code}&grant_type=authorization_code')
  1241. .then((value) {
  1242. print(value);
  1243. getWeChatInfo(value);
  1244. });
  1245. }
  1246. });
  1247. }
  1248. //获取微信用户信息
  1249. void getWeChatInfo(Response value) {
  1250. AccessBeanEntity accessBeanEntity =
  1251. AccessBeanEntity().fromJson(json.decode(value.toString()));
  1252. Dio()
  1253. .get(
  1254. 'https://api.weixin.qq.com/sns/userinfo?access_token=${accessBeanEntity.accessToken}&openid=${accessBeanEntity.openid}')
  1255. .then((value) {
  1256. print(value);
  1257. try {
  1258. WXBeanEntity entity =
  1259. WXBeanEntity().fromJson(json.decode(value.toString()));
  1260. saveWXInfo(entity);
  1261. } catch (e) {}
  1262. });
  1263. }
  1264. void saveWXInfo(WXBeanEntity entity) {
  1265. MyDio().update({
  1266. "key": "user",
  1267. "values": {
  1268. "id": MyCookie().loginInformation.data.extra.id,
  1269. "wx_picture": entity.headimgurl,
  1270. "wx_name": entity.nickname,
  1271. "wx_openid": entity.openid
  1272. }
  1273. }, (response, hasError) {
  1274. if (!hasError) {
  1275. MyCookie().userBean.wxOpenid = entity.openid;
  1276. MyCookie().userBean.wxName = entity.nickname;
  1277. MyCookie().userBean.wxPicture = entity.headimgurl;
  1278. EventBus().emit('bindToWeChat');
  1279. }
  1280. }, (error) {});
  1281. }
  1282. }
  1283. class FallbackCupertinoLocalisationsDelegate
  1284. extends LocalizationsDelegate<CupertinoLocalizations> {
  1285. const FallbackCupertinoLocalisationsDelegate();
  1286. @override
  1287. bool isSupported(Locale locale) => true;
  1288. @override
  1289. Future<CupertinoLocalizations> load(Locale locale) =>
  1290. DefaultCupertinoLocalizations.load(locale);
  1291. @override
  1292. bool shouldReload(FallbackCupertinoLocalisationsDelegate old) => false;
  1293. }