my_views.dart 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710
  1. import 'dart:convert';
  2. import 'dart:io';
  3. import 'dart:math' as math;
  4. import 'package:bbyyy/beans/ad_bean_entity.dart';
  5. import 'package:bbyyy/beans/android_app_version_bean_entity.dart';
  6. import 'package:bbyyy/beans/flow_bean_entity.dart';
  7. import 'package:bbyyy/beans/goods_bean_entity.dart';
  8. import 'package:bbyyy/beans/my_shop_bean_entity.dart';
  9. import 'package:bbyyy/beans/smart_order_bean_entity.dart';
  10. import 'package:bbyyy/beans/store_bean_entity.dart';
  11. import 'package:bbyyy/beans/user_bean_entity.dart';
  12. import 'package:bbyyy/beans/user_vp_bean_entity.dart';
  13. import 'package:bbyyy/https/MyDio.dart';
  14. import 'package:bbyyy/https/my_request.dart';
  15. import 'package:bbyyy/https/url.dart';
  16. import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
  17. import 'package:bbyyy/my_tools/event_bus.dart';
  18. import 'package:bbyyy/my_tools/global.dart';
  19. import 'package:bbyyy/my_tools/my_colors.dart';
  20. import 'package:bbyyy/my_tools/my_cookie.dart';
  21. import 'package:bbyyy/my_tools/my_tools.dart';
  22. import 'package:bbyyy/paegs/gang_page/application_details_page/application_details_page.dart';
  23. import 'package:bbyyy/paegs/gang_page/gang_in_page/gang_in_page.dart';
  24. import 'package:bbyyy/paegs/mine_page/order_page/apply_for_compensation_page/apply_for_compensation_page.dart';
  25. import 'package:bbyyy/paegs/mine_page/privacy_protection_props_page/privacy_protection_props_page.dart';
  26. import 'package:bbyyy/paegs/product_details_page/product_details_page.dart';
  27. import 'package:bbyyy/paegs/release_goods_page/release_goods_page.dart';
  28. import 'package:cached_network_image/cached_network_image.dart';
  29. import 'package:dio/dio.dart';
  30. import 'package:flustars/flustars.dart';
  31. import 'package:flutter/cupertino.dart';
  32. import 'package:flutter/material.dart';
  33. import 'package:flutter/services.dart';
  34. import 'package:flutter_svg/svg.dart';
  35. import 'package:install_plugin/install_plugin.dart';
  36. import 'package:launch_review/launch_review.dart';
  37. import 'package:lpinyin/lpinyin.dart';
  38. import 'package:path_provider/path_provider.dart';
  39. import '../beans/complain_bean_entity.dart';
  40. import '../paegs/ad_details_page/ad_details_page.dart';
  41. import '../paegs/other_people_s_turnover_page/other_people_s_turnover_page.dart';
  42. import '../paegs/pay_page/pay_page.dart';
  43. import 'const.dart';
  44. import 'dims.dart';
  45. class MyViews {
  46. Widget netImg(String path, double h, double w,
  47. {String placeholder = 'images/svg/缺省头像.svg'}) {
  48. return CachedNetworkImage(
  49. imageUrl: path,
  50. height: h,
  51. width: w,
  52. fit: BoxFit.cover,
  53. placeholder: (context, url) => SvgPicture.asset(
  54. placeholder,
  55. fit: BoxFit.cover,
  56. height: h,
  57. width: w,
  58. ),
  59. errorWidget: (context, url, error) => SvgPicture.asset(
  60. placeholder,
  61. height: h,
  62. fit: BoxFit.cover,
  63. width: w,
  64. ),
  65. );
  66. }
  67. Widget myText(String content, Color color, double fs, {double height = 1.4}) {
  68. return Text(
  69. content,
  70. style: TextStyle(color: color, fontSize: fs, height: height),
  71. );
  72. }
  73. Widget myAppBar(String title, BuildContext context, List<Widget> rW) {
  74. return Container(
  75. color: Colors.white,
  76. child: SafeArea(
  77. bottom: false,
  78. child: Container(
  79. height: 45,
  80. width: double.infinity,
  81. color: Colors.white,
  82. child: Stack(
  83. children: [
  84. Text(
  85. title,
  86. style: TextStyle(color: MyColors.c333333, fontSize: 16),
  87. ),
  88. Positioned(
  89. left: 0,
  90. child: GestureDetector(
  91. onTap: () {
  92. Navigator.pop(context);
  93. },
  94. behavior: HitTestBehavior.translucent,
  95. child: Transform.rotate(
  96. angle: math.pi,
  97. child: Padding(
  98. padding: EdgeInsets.only(
  99. left: 16, right: 16, top: 8, bottom: 8),
  100. child: SvgPicture.asset(
  101. 'images/svg/箭头.svg',
  102. color: MyColors.c333333,
  103. height: 14,
  104. ),
  105. ),
  106. ),
  107. ),
  108. ),
  109. Row(
  110. children: rW,
  111. mainAxisAlignment: MainAxisAlignment.end,
  112. )
  113. ],
  114. alignment: Alignment.center,
  115. ),
  116. ),
  117. ),
  118. );
  119. }
  120. Widget getGoodsItem(var data, BuildContext context) {
  121. double w = (MediaQuery.of(context).size.width - 28 - 8) / 2;
  122. if (data is GoodsBeanDataData) {
  123. return GestureDetector(
  124. onTap: () {
  125. MyTools().toPage(context, ProductDetailsPage(data), (then) {});
  126. },
  127. behavior: HitTestBehavior.translucent,
  128. child: Card(
  129. elevation: 2,
  130. shadowColor: MyColors.c21333333,
  131. child: Column(
  132. children: [
  133. Padding(
  134. padding: EdgeInsets.only(left: 6, top: 6, bottom: 3),
  135. child: Row(
  136. children: [
  137. ClipRRect(
  138. child: MyViews().netImg(imgURL(data.shopPic), 20, 20),
  139. borderRadius: BorderRadius.all(Radius.circular(10)),
  140. ),
  141. Expanded(
  142. child: Container(
  143. margin: EdgeInsets.only(right: 5, left: 5),
  144. child: Text(
  145. data.shopName,
  146. style: TextStyle(
  147. color: MyColors.c999999,
  148. fontSize: 10,
  149. ),
  150. maxLines: 1,
  151. overflow: TextOverflow.ellipsis,
  152. softWrap: true,
  153. ),
  154. ),
  155. ),
  156. // Container(
  157. // decoration: BoxDecoration(
  158. // borderRadius: BorderRadius.only(
  159. // topLeft: Radius.circular(7),
  160. // bottomLeft: Radius.circular(7),
  161. // ),
  162. // color: data.onSale ? MyColors.cFF4233 : MyColors.cADD358,
  163. // ),
  164. // height: 14,
  165. // width: 28,
  166. // child: Text(
  167. // data.onSale ? '找货' : '有货',
  168. // style: TextStyle(color: Colors.white, fontSize: 8),
  169. // ),
  170. // alignment: Alignment.center,
  171. // padding: EdgeInsets.only(bottom: 0.8),
  172. // )
  173. ],
  174. ),
  175. ),
  176. MyViews().netImg(imgURL(data.coverPath), w, w,
  177. placeholder: 'images/svg/goodsDefImg.svg'),
  178. Container(
  179. padding: EdgeInsets.only(right: 6, left: 6, top: 8),
  180. child: Text(
  181. '${data.title}\n${data.description}',
  182. style: TextStyle(color: Colors.black, fontSize: 12),
  183. maxLines: 1,
  184. overflow: TextOverflow.ellipsis,
  185. softWrap: true,
  186. ),
  187. ),
  188. Container(
  189. padding: EdgeInsets.only(right: 6, left: 6, top: 7),
  190. child: Row(
  191. children: [
  192. Expanded(
  193. child: Text(
  194. '¥${data.price}',
  195. style: TextStyle(color: MyColors.cFF4233, fontSize: 15),
  196. ),
  197. ),
  198. Container(
  199. child: Text(
  200. '详情',
  201. style: TextStyle(color: MyColors.cFF4233, fontSize: 12),
  202. ),
  203. alignment: Alignment.center,
  204. padding: EdgeInsets.only(bottom: 2),
  205. decoration: BoxDecoration(
  206. border: Border.all(color: MyColors.cFF4233, width: 1),
  207. borderRadius: BorderRadius.all(Radius.circular(10))),
  208. height: 20,
  209. width: 50,
  210. )
  211. ],
  212. ),
  213. )
  214. ],
  215. crossAxisAlignment: CrossAxisAlignment.start,
  216. ),
  217. ),
  218. );
  219. } else if (data is AdBeanDataData) {
  220. return GestureDetector(
  221. onTap: () {
  222. MyTools().toPage(context, AdDetailsPage(data), (then) {});
  223. },
  224. behavior: HitTestBehavior.translucent,
  225. child: Card(
  226. elevation: 2,
  227. shadowColor: MyColors.c21333333,
  228. child: Column(
  229. children: [
  230. Padding(
  231. padding: EdgeInsets.only(left: 6, top: 6, bottom: 3),
  232. child: Row(
  233. children: [
  234. ClipRRect(
  235. child: Container(
  236. height: 20,
  237. ),
  238. borderRadius: BorderRadius.all(Radius.circular(10)),
  239. ),
  240. Expanded(
  241. child: Container(
  242. margin: EdgeInsets.only(right: 5, left: 5),
  243. child: Text(
  244. '',
  245. style: TextStyle(
  246. color: MyColors.c999999,
  247. fontSize: 10,
  248. ),
  249. maxLines: 1,
  250. overflow: TextOverflow.ellipsis,
  251. softWrap: true,
  252. ),
  253. ),
  254. ),
  255. ],
  256. ),
  257. ),
  258. MyViews().netImg(imgURL(data.coverPath), w, w,
  259. placeholder: 'images/svg/goodsDefImg.svg'),
  260. Container(
  261. padding: EdgeInsets.only(right: 6, left: 6, top: 8),
  262. child: Text(
  263. '${data.title}\n${data.description}',
  264. style: TextStyle(color: Colors.black, fontSize: 12),
  265. maxLines: 1,
  266. overflow: TextOverflow.ellipsis,
  267. softWrap: true,
  268. ),
  269. ),
  270. Container(
  271. padding: EdgeInsets.only(right: 6, top: 7),
  272. child: Row(
  273. children: [
  274. Container(
  275. decoration: BoxDecoration(
  276. color: MyColors.cADD358,
  277. borderRadius: BorderRadius.only(
  278. topRight: Radius.circular(8),
  279. bottomRight: Radius.circular(8),
  280. ),
  281. ),
  282. height: 16,
  283. width: 32,
  284. child: myText('推广', Colors.white, 9),
  285. alignment: Alignment.center,
  286. ),
  287. Container(
  288. child: Text(
  289. '详情',
  290. style: TextStyle(color: MyColors.cFF4233, fontSize: 12),
  291. ),
  292. alignment: Alignment.center,
  293. padding: EdgeInsets.only(bottom: 2),
  294. decoration: BoxDecoration(
  295. border: Border.all(color: MyColors.cFF4233, width: 1),
  296. borderRadius: BorderRadius.all(Radius.circular(10))),
  297. height: 20,
  298. width: 50,
  299. )
  300. ],
  301. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  302. ),
  303. )
  304. ],
  305. crossAxisAlignment: CrossAxisAlignment.start,
  306. ),
  307. ),
  308. );
  309. }
  310. }
  311. Widget getNoPayGoodsItem(
  312. SmartOrderBeanDataData data, BuildContext context, int ownerUid) {
  313. return Container(
  314. margin: EdgeInsets.only(bottom: 10),
  315. decoration: BoxDecoration(
  316. color: Colors.white,
  317. borderRadius: BorderRadius.all(
  318. Radius.circular(4),
  319. ),
  320. ),
  321. child: Column(
  322. children: [
  323. Container(
  324. margin: EdgeInsets.only(left: 10, top: 16),
  325. child: Row(
  326. children: [
  327. ClipRRect(
  328. child: data.type == orderTypeAnnualFee || data.sellerUid == 0
  329. ? Image.asset(
  330. 'images/app_logo.png',
  331. height: 25,
  332. width: 25,
  333. )
  334. : MyViews().netImg(imgURL(data.sellerPic), 25, 25),
  335. borderRadius: BorderRadius.all(Radius.circular(12.5)),
  336. ),
  337. Container(
  338. margin: EdgeInsets.only(right: 5, left: 5),
  339. child: Text(
  340. data.type == orderTypeAnnualFee || data.sellerUid == 0
  341. ? '$appName'
  342. : '${data.sellerName}(${data.sellerUid})',
  343. style: TextStyle(
  344. color: MyColors.c333333,
  345. fontSize: 14,
  346. ),
  347. maxLines: 1,
  348. overflow: TextOverflow.ellipsis,
  349. softWrap: true,
  350. ),
  351. ),
  352. ],
  353. ),
  354. ),
  355. Container(
  356. height: 0.5,
  357. color: MyColors.cE7E7E7,
  358. margin: EdgeInsets.only(left: 10, right: 10, top: 11, bottom: 11),
  359. ),
  360. orderStyle(data),
  361. Container(
  362. height: 0.5,
  363. color: MyColors.cE7E7E7,
  364. margin: EdgeInsets.only(left: 10, right: 10, top: 11, bottom: 11),
  365. ),
  366. Container(
  367. padding: EdgeInsets.only(left: 10, right: 10, bottom: 11),
  368. child: Row(
  369. children: [
  370. Text(
  371. '下单时间:${data.createTime}',
  372. style: TextStyle(color: MyColors.c666666, fontSize: 11),
  373. ),
  374. GestureDetector(
  375. onTap: () {
  376. if (data.buyerName.contains(MyCookie().getName()) ||
  377. MyCookie().getName().contains(data.buyerName) ||
  378. MyCookie().getUID() == ownerUid) {
  379. showPayDialog(data, context, () {
  380. Navigator.pop(context);
  381. MyTools().toPage(context,
  382. PayPage(data.uid, false, data.amount), (then) {});
  383. // getUserWalletBalance((re, hE) {
  384. // if (!hE) {
  385. // UserBalanceEntity balance = UserBalanceEntity()
  386. // .fromJson(json.decode(re.data.toString()));
  387. // if (balance.data >= data.amount) {
  388. // payOrder(payWayWallet, data.uid, (re, hE) {
  389. // if (!hE) {
  390. // showToast('支付成功');
  391. // EventBus().emit('payAnOrder');
  392. // }
  393. // }, (e) {}, context);
  394. // } else {
  395. // payOrder(payWayAliPay, data.uid, (re, hE) {
  396. // if (!hE) {
  397. // PayByAlipayBeanEntity entity =
  398. // PayByAlipayBeanEntity().fromJson(
  399. // json.decode(re.data.toString()));
  400. // EventBus().on('alipayPaymentCallback', (arg) {
  401. // EventBus().off('alipayPaymentCallback');
  402. // EasyLoading.dismiss();
  403. // showToast('支付成功');
  404. // EventBus().emit('reNoPayOrder');
  405. // });
  406. // print(entity.data);
  407. // EasyLoading.instance
  408. // ..contentPadding = EdgeInsets.symmetric(
  409. // horizontal: 20, vertical: 12)
  410. // ..alignment = Alignment.center
  411. // ..loadingStyle = EasyLoadingStyle.light
  412. // ..contentMargin = EdgeInsets.all(20);
  413. // EasyLoading.show();
  414. // aliPay(entity.data).then((value) {
  415. // print(json.encode(value));
  416. // AlipayResultBeanEntity e =
  417. // AlipayResultBeanEntity().fromJson(
  418. // json.decode(json.encode(value)));
  419. // try {
  420. // int r = int.parse(e.resultStatus);
  421. // if (r == 9000) {
  422. // showToast('支付成功');
  423. // } else {
  424. // showToast(aliPayResultStatus(r));
  425. // resetOrder(data.uid);
  426. // }
  427. // } catch (e) {
  428. // EasyLoading.dismiss();
  429. // }
  430. // });
  431. // // EventBus().emit('payAnOrder');
  432. // }
  433. // }, (e) {}, context);
  434. // // showToast('积分余额不足');
  435. // }
  436. // }
  437. // }, (e) {}, context);
  438. });
  439. } else {
  440. showToast('该订单与你无关');
  441. }
  442. },
  443. behavior: HitTestBehavior.translucent,
  444. child: Visibility(
  445. visible: data.state == orderStateUnpaid &&
  446. data.sellerUid != MyCookie().getUID(),
  447. child: Container(
  448. height: 26,
  449. width: 70,
  450. decoration: BoxDecoration(
  451. color: MyColors.cFF4233,
  452. borderRadius: BorderRadius.all(Radius.circular(13))),
  453. child: Text(
  454. '立即支付',
  455. style: TextStyle(color: Colors.white, fontSize: 12),
  456. ),
  457. alignment: Alignment.center,
  458. padding: EdgeInsets.only(bottom: 2),
  459. ),
  460. ),
  461. )
  462. ],
  463. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  464. ),
  465. )
  466. ],
  467. ),
  468. );
  469. }
  470. Widget getMembersItem(MyShopBeanDataData data, BuildContext context) {
  471. return Column(
  472. children: [
  473. ClipRRect(
  474. child: netImg(imgURL(data.userPic), 40, 40),
  475. borderRadius: BorderRadius.all(Radius.circular(20)),
  476. ),
  477. Container(
  478. child: Text(
  479. data.userName,
  480. style: TextStyle(color: MyColors.c666666, fontSize: 12),
  481. ),
  482. margin: EdgeInsets.only(top: 8),
  483. )
  484. ],
  485. );
  486. }
  487. Widget getUserItem(UserBeanDataData data, BuildContext context) {
  488. return Container(
  489. padding: EdgeInsets.only(left: 15, right: 15),
  490. color: Colors.white,
  491. child: Column(
  492. children: [
  493. Container(
  494. margin: EdgeInsets.only(top: 8, bottom: 6),
  495. child: Row(
  496. children: [
  497. Container(
  498. margin: EdgeInsets.only(right: 6),
  499. child: ClipRRect(
  500. child: netImg(imgURL(data.picture), 42, 42),
  501. borderRadius: BorderRadius.circular(21),
  502. ),
  503. ),
  504. myText('${data.name} (${data.uid})', MyColors.c333333, 15),
  505. Expanded(
  506. child: Container(
  507. child: GestureDetector(
  508. onTap: () {
  509. EventBus().emit('addMember', data);
  510. },
  511. behavior: HitTestBehavior.translucent,
  512. child: Container(
  513. decoration: BoxDecoration(
  514. border: Border.all(color: MyColors.cFF4233, width: 1),
  515. borderRadius: BorderRadius.circular(14),
  516. ),
  517. height: 28,
  518. width: 70,
  519. child: myText('邀请入帮', MyColors.cFF4233, 12),
  520. alignment: Alignment.center,
  521. ),
  522. ),
  523. alignment: Alignment.centerRight,
  524. ),
  525. ),
  526. ],
  527. ),
  528. ),
  529. Container(
  530. height: 0.5,
  531. color: MyColors.cE7E7E7,
  532. )
  533. ],
  534. ),
  535. );
  536. }
  537. Widget getRemoveMemberItem(MyShopBeanDataData data, BuildContext context) {
  538. return Container(
  539. padding: EdgeInsets.only(left: 15, right: 15),
  540. color: Colors.white,
  541. child: Column(
  542. children: [
  543. Container(
  544. margin: EdgeInsets.only(top: 8, bottom: 6),
  545. child: Row(
  546. children: [
  547. Container(
  548. margin: EdgeInsets.only(right: 6),
  549. child: ClipRRect(
  550. child: netImg(imgURL(data.userPic), 42, 42),
  551. borderRadius: BorderRadius.circular(21),
  552. ),
  553. ),
  554. myText(
  555. '${data.userName} (${data.userUid})', MyColors.c333333, 15),
  556. Expanded(
  557. child: Container(
  558. child: GestureDetector(
  559. onTap: () {
  560. EventBus().emit('removeMember', data);
  561. },
  562. behavior: HitTestBehavior.translucent,
  563. child: Container(
  564. decoration: BoxDecoration(
  565. border: Border.all(color: MyColors.cFF4233, width: 1),
  566. borderRadius: BorderRadius.circular(14),
  567. ),
  568. height: 28,
  569. width: 70,
  570. child: myText('移除成员', MyColors.cFF4233, 12),
  571. alignment: Alignment.center,
  572. ),
  573. ),
  574. alignment: Alignment.centerRight,
  575. ),
  576. ),
  577. ],
  578. ),
  579. ),
  580. Container(
  581. height: 0.5,
  582. color: MyColors.cE7E7E7,
  583. )
  584. ],
  585. ),
  586. );
  587. }
  588. Widget getWalletItem(FlowBeanDataDataRecords flow, BuildContext context) {
  589. return Container(
  590. padding: EdgeInsets.symmetric(horizontal: 15),
  591. child: Column(
  592. children: [
  593. Row(
  594. children: [
  595. Container(
  596. child: ClipRRect(
  597. child: flow.traderUid == 0
  598. ? Image.asset(
  599. 'images/app_logo.png',
  600. width: 50,
  601. height: 50,
  602. )
  603. : MyViews().netImg(imgURL(flow.traderPic), 50, 50),
  604. borderRadius: BorderRadius.all(Radius.circular(25)),
  605. ),
  606. margin: EdgeInsets.only(right: 12),
  607. ),
  608. Expanded(
  609. child: Column(
  610. children: [
  611. Row(
  612. children: [
  613. Text(
  614. flow.traderUid == 0 ? '平台' : flow.traderName,
  615. style:
  616. TextStyle(color: MyColors.c333333, fontSize: 14),
  617. ),
  618. Text(
  619. '${flow.paidAmount}',
  620. style:
  621. TextStyle(color: MyColors.c333333, fontSize: 15),
  622. ),
  623. ],
  624. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  625. ),
  626. Row(
  627. children: [
  628. Text(
  629. flow.traderUid == 0 ? "" : 'ID:${flow.traderUid}',
  630. style:
  631. TextStyle(color: MyColors.c666666, fontSize: 12),
  632. ),
  633. Text(
  634. flow.payTime,
  635. style:
  636. TextStyle(color: MyColors.c666666, fontSize: 11),
  637. ),
  638. ],
  639. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  640. ),
  641. Row(
  642. children: [
  643. Text(
  644. '${flowType(flow.type)}',
  645. style:
  646. TextStyle(color: MyColors.c666666, fontSize: 12),
  647. ),
  648. Text(
  649. '${flow.userBalance}',
  650. style:
  651. TextStyle(color: MyColors.c666666, fontSize: 11),
  652. ),
  653. ],
  654. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  655. )
  656. ],
  657. ),
  658. )
  659. ],
  660. ),
  661. Container(
  662. color: MyColors.cE7E7E7,
  663. height: 0.5,
  664. margin: EdgeInsets.only(top: 14, bottom: 12),
  665. )
  666. ],
  667. ),
  668. );
  669. }
  670. Widget getMyGoodsItem(GoodsBeanDataData data, BuildContext context) {
  671. return Container(
  672. padding: EdgeInsets.only(left: 8, right: 8, bottom: 7, top: 18),
  673. decoration: BoxDecoration(
  674. color: Colors.white,
  675. borderRadius: BorderRadius.all(
  676. Radius.circular(4),
  677. ),
  678. ),
  679. margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
  680. child: Column(
  681. children: [
  682. Row(
  683. children: [
  684. // Container(
  685. // decoration: BoxDecoration(
  686. // color: data.onSale ? MyColors.cADD358 : MyColors.cFF4233,
  687. // borderRadius: BorderRadius.all(
  688. // Radius.circular(4),
  689. // ),
  690. // ),
  691. // height: 20,
  692. // width: 40,
  693. // child: Text(
  694. // data.onSale ? '有货' : '找货',
  695. // style: TextStyle(color: Colors.white, fontSize: 10),
  696. // ),
  697. // alignment: Alignment.center,
  698. // padding: EdgeInsets.only(bottom: 2),
  699. // margin: EdgeInsets.only(right: 10),
  700. // ),
  701. ClipRRect(
  702. child: MyViews().netImg(imgURL(data.shopPic), 25, 25),
  703. borderRadius: BorderRadius.circular(12.5),
  704. ),
  705. Container(
  706. margin: EdgeInsets.only(left: 10),
  707. child: Text(
  708. data.shopName,
  709. style: TextStyle(color: MyColors.c333333, fontSize: 14),
  710. ),
  711. ),
  712. ],
  713. ),
  714. Container(
  715. height: 0.5,
  716. color: MyColors.cE7E7E7,
  717. margin: EdgeInsets.only(top: 14),
  718. ),
  719. Row(
  720. children: [
  721. Container(
  722. child: MyViews().netImg(imgURL(data.coverPath), 84, 82,
  723. placeholder: 'images/svg/goodsDefImg.svg'),
  724. margin: EdgeInsets.only(right: 8, top: 11, bottom: 11),
  725. ),
  726. Expanded(
  727. child: Container(
  728. child: Column(
  729. children: [
  730. Text(
  731. '${data.title}\n${data.description}',
  732. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  733. ),
  734. Row(
  735. children: [
  736. Text(
  737. '¥${data.price}',
  738. style: TextStyle(
  739. color: MyColors.cFF4233, fontSize: 12),
  740. ),
  741. Row(
  742. children: [
  743. GestureDetector(
  744. onTap: () {
  745. MyDio().update({
  746. 'key': 'commodity',
  747. 'values': {
  748. 'id': data.id,
  749. 'on_sale': !data.onSale,
  750. }
  751. }, (response, hasError) {
  752. if (!hasError) {
  753. EventBus().emit('updateProduct');
  754. }
  755. }, (error) {});
  756. },
  757. behavior: HitTestBehavior.translucent,
  758. child: Container(
  759. margin: EdgeInsets.only(left: 10),
  760. child: Text(
  761. data.onSale ? '下架' : '上架',
  762. style: TextStyle(
  763. color: data.onSale
  764. ? MyColors.c999999
  765. : MyColors.cFF4233,
  766. fontSize: 12),
  767. ),
  768. alignment: Alignment.center,
  769. decoration: BoxDecoration(
  770. color: Colors.white,
  771. borderRadius: BorderRadius.circular(13),
  772. border: Border.all(
  773. color: data.onSale
  774. ? MyColors.c999999
  775. : MyColors.cFF4233,
  776. width: 1)),
  777. height: 26,
  778. width: 70,
  779. ),
  780. ),
  781. GestureDetector(
  782. onTap: () {
  783. MyTools().toPage(
  784. context, ReleaseGoodsPage(data), (then) {
  785. EventBus().emit('updateProduct');
  786. });
  787. },
  788. behavior: HitTestBehavior.translucent,
  789. child: Container(
  790. margin: EdgeInsets.only(left: 10),
  791. child: Text(
  792. '修改',
  793. style: TextStyle(
  794. color: Colors.white, fontSize: 12),
  795. ),
  796. alignment: Alignment.center,
  797. decoration: BoxDecoration(
  798. color: MyColors.cFF4233,
  799. borderRadius: BorderRadius.circular(13)),
  800. height: 26,
  801. width: 70,
  802. ),
  803. ),
  804. ],
  805. )
  806. ],
  807. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  808. )
  809. ],
  810. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  811. crossAxisAlignment: CrossAxisAlignment.start,
  812. ),
  813. height: 84,
  814. ),
  815. )
  816. ],
  817. ),
  818. ],
  819. ),
  820. );
  821. }
  822. Widget getCompensateItem(int index, BuildContext context) {
  823. return Container(
  824. decoration: BoxDecoration(
  825. color: Colors.white,
  826. borderRadius: BorderRadius.circular(4),
  827. ),
  828. margin: EdgeInsets.only(bottom: 10, left: 10, right: 10),
  829. padding: EdgeInsets.only(left: 8, right: 8, top: 14, bottom: 8),
  830. child: Column(
  831. children: [
  832. Row(
  833. children: [
  834. ClipRRect(
  835. child: MyViews().netImg('path', 25, 25),
  836. borderRadius: BorderRadius.circular(12.5),
  837. ),
  838. Container(
  839. child: Text(
  840. '一颗带货达人小星星(21548679)',
  841. style: TextStyle(color: MyColors.c333333, fontSize: 14),
  842. ),
  843. margin: EdgeInsets.only(left: 7),
  844. )
  845. ],
  846. ),
  847. Container(
  848. color: MyColors.cE7E7E7,
  849. height: 0.5,
  850. margin: EdgeInsets.only(top: 13, bottom: 9),
  851. ),
  852. Text(
  853. '所属货帮:全球顶尖带货达人团',
  854. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  855. ),
  856. Container(
  857. color: MyColors.cE7E7E7,
  858. height: 0.5,
  859. margin: EdgeInsets.only(top: 9, bottom: 9),
  860. ),
  861. Text(
  862. '订单金额:¥200.00',
  863. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  864. ),
  865. Container(
  866. color: MyColors.cE7E7E7,
  867. height: 0.5,
  868. margin: EdgeInsets.only(top: 9, bottom: 9),
  869. ),
  870. Text(
  871. '申请时间:2020-08-24 10:00:00',
  872. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  873. ),
  874. Container(
  875. color: MyColors.cE7E7E7,
  876. height: 0.5,
  877. margin: EdgeInsets.only(top: 9, bottom: 9),
  878. ),
  879. Text(
  880. '申请理由',
  881. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  882. ),
  883. Container(
  884. margin: EdgeInsets.only(top: 6),
  885. decoration: BoxDecoration(
  886. color: MyColors.c19FF4233,
  887. borderRadius: BorderRadius.circular(4)),
  888. constraints: BoxConstraints(minHeight: 60),
  889. child: Text(
  890. '产品质量有问题,希望获得一定的金额的赔付',
  891. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  892. ),
  893. padding: EdgeInsets.symmetric(vertical: 8, horizontal: 7),
  894. alignment: Alignment.topLeft,
  895. ),
  896. Container(
  897. color: MyColors.cE7E7E7,
  898. height: 0.5,
  899. margin: EdgeInsets.only(top: 9, bottom: 9),
  900. ),
  901. Row(
  902. children: [
  903. Text(
  904. '处理结果:',
  905. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  906. ),
  907. Text(
  908. '已处理',
  909. style: TextStyle(color: MyColors.c2B9C77, fontSize: 13),
  910. ),
  911. Text(
  912. '/',
  913. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  914. ),
  915. Text(
  916. '处理中',
  917. style: TextStyle(color: MyColors.c3D6CD5, fontSize: 13),
  918. ),
  919. Text(
  920. '/',
  921. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  922. ),
  923. Text(
  924. '已处理',
  925. style: TextStyle(color: MyColors.cFF4233, fontSize: 13),
  926. ),
  927. ],
  928. ),
  929. Container(
  930. margin: EdgeInsets.only(top: 6),
  931. decoration: BoxDecoration(
  932. color: MyColors.c19FF6700,
  933. borderRadius: BorderRadius.circular(4)),
  934. constraints: BoxConstraints(minHeight: 60),
  935. child: Text(
  936. '赔偿买家20元现金(赔付成功/失败结果 )',
  937. style: TextStyle(color: MyColors.cFF9249, fontSize: 13),
  938. ),
  939. padding: EdgeInsets.symmetric(vertical: 8, horizontal: 7),
  940. alignment: Alignment.topLeft,
  941. ),
  942. Container(
  943. color: MyColors.cE7E7E7,
  944. height: 0.5,
  945. margin: EdgeInsets.only(top: 9, bottom: 9),
  946. ),
  947. Text(
  948. '处理时间:2020-08-25 10:00:00',
  949. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  950. ),
  951. Container(
  952. color: MyColors.cE7E7E7,
  953. height: 0.5,
  954. margin: EdgeInsets.only(top: 9, bottom: 9),
  955. ),
  956. Row(
  957. children: [
  958. Container(
  959. decoration: BoxDecoration(
  960. border: Border.all(color: MyColors.cFF4233, width: 1),
  961. borderRadius: BorderRadius.circular(13)),
  962. height: 26,
  963. width: 70,
  964. child: Text(
  965. '查看申请',
  966. style: TextStyle(color: MyColors.cFF4233, fontSize: 12),
  967. ),
  968. alignment: Alignment.center,
  969. ),
  970. Container(
  971. margin: EdgeInsets.only(left: 10),
  972. decoration: BoxDecoration(
  973. color: MyColors.cFF4233,
  974. borderRadius: BorderRadius.circular(13)),
  975. height: 26,
  976. width: 70,
  977. child: Text(
  978. '查看订单',
  979. style: TextStyle(color: Colors.white, fontSize: 12),
  980. ),
  981. alignment: Alignment.center,
  982. )
  983. ],
  984. mainAxisAlignment: MainAxisAlignment.end,
  985. )
  986. ],
  987. crossAxisAlignment: CrossAxisAlignment.start,
  988. ),
  989. );
  990. }
  991. List<String> states = ['未支付', '已支付', '支付中', '支付失败', '已代付', '已取消'];
  992. Widget getOrdersItem(SmartOrderBeanDataData data, BuildContext context) {
  993. return Container(
  994. decoration: BoxDecoration(
  995. color: Colors.white, borderRadius: BorderRadius.circular(4)),
  996. margin: EdgeInsets.only(bottom: 10, left: 10, right: 10),
  997. padding: EdgeInsets.only(left: 10, right: 10, top: 16, bottom: 7),
  998. child: Column(
  999. children: [
  1000. Row(
  1001. children: [
  1002. Row(
  1003. children: [
  1004. ClipRRect(
  1005. borderRadius: BorderRadius.circular(12.5),
  1006. child: MyViews().netImg(imgURL(data.sellerPic), 25, 25),
  1007. ),
  1008. Container(
  1009. margin: EdgeInsets.only(left: 7, right: 7),
  1010. child: Text(
  1011. data.sellerName,
  1012. style: TextStyle(color: MyColors.c333333, fontSize: 14),
  1013. ),
  1014. ),
  1015. Container(
  1016. decoration: BoxDecoration(
  1017. border: Border.all(color: MyColors.cFF4233, width: 1),
  1018. borderRadius: BorderRadius.circular(2),
  1019. ),
  1020. width: 26,
  1021. height: 14,
  1022. child: Text(
  1023. '卖家',
  1024. style: TextStyle(
  1025. color: MyColors.cFF4233, fontSize: 10, height: 1.0),
  1026. ),
  1027. alignment: Alignment.center,
  1028. padding: EdgeInsets.only(top: 1),
  1029. ),
  1030. ],
  1031. ),
  1032. Text(
  1033. states[data.state],
  1034. style: TextStyle(
  1035. color:
  1036. data.state == 1 ? MyColors.c2B9C77 : MyColors.cFF4233),
  1037. )
  1038. ],
  1039. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1040. ),
  1041. Container(
  1042. height: 0.5,
  1043. color: MyColors.cE7E7E7,
  1044. margin: EdgeInsets.only(top: 11, bottom: 11),
  1045. ),
  1046. data.type == orderTypeThirdPlatform
  1047. ? Container(
  1048. child: Row(
  1049. children: [
  1050. Container(
  1051. child: SvgPicture.asset(
  1052. 'images/svg/第三方.svg',
  1053. height: 45,
  1054. width: 45,
  1055. ),
  1056. margin: EdgeInsets.only(right: 8),
  1057. height: 60,
  1058. width: 60,
  1059. decoration: BoxDecoration(
  1060. border:
  1061. Border.all(color: MyColors.cEBEBEB, width: 1)),
  1062. alignment: Alignment.center,
  1063. ),
  1064. Expanded(
  1065. child: Container(
  1066. height: 60,
  1067. child: Column(
  1068. children: [
  1069. MyViews().myText(
  1070. '第三方订单(${data.uid})', MyColors.c333333, 13),
  1071. MyViews().myText('付款人:${data.buyerName}',
  1072. MyColors.c333333, 13),
  1073. Row(
  1074. children: [
  1075. MyViews().myText(
  1076. '¥${data.amount}', MyColors.cFF4233, 12),
  1077. MyViews().myText('x${data.commodityCount}',
  1078. MyColors.c999999, 12),
  1079. ],
  1080. mainAxisAlignment:
  1081. MainAxisAlignment.spaceBetween,
  1082. crossAxisAlignment: CrossAxisAlignment.start,
  1083. )
  1084. ],
  1085. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1086. crossAxisAlignment: CrossAxisAlignment.start,
  1087. ),
  1088. ),
  1089. ),
  1090. ],
  1091. ),
  1092. )
  1093. : Row(
  1094. children: [
  1095. Container(
  1096. child: MyViews().netImg(
  1097. imgURL(data.commodityCover), 84, 82,
  1098. placeholder: 'images/svg/goodsDefImg.svg'),
  1099. margin: EdgeInsets.only(right: 8),
  1100. ),
  1101. Expanded(
  1102. child: Container(
  1103. height: 84,
  1104. child: Column(
  1105. children: [
  1106. Text(
  1107. data.commodityTitle,
  1108. style: TextStyle(
  1109. color: MyColors.c333333, fontSize: 13),
  1110. maxLines: 2,
  1111. overflow: TextOverflow.ellipsis,
  1112. softWrap: true,
  1113. ),
  1114. Row(
  1115. children: [
  1116. Text(
  1117. '¥${data.amount}',
  1118. style: TextStyle(
  1119. color: MyColors.cFF4233, fontSize: 12),
  1120. ),
  1121. Text(
  1122. 'x1',
  1123. style: TextStyle(
  1124. color: MyColors.c999999, fontSize: 12),
  1125. )
  1126. ],
  1127. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1128. crossAxisAlignment: CrossAxisAlignment.start,
  1129. ),
  1130. Row(
  1131. children: [
  1132. ClipRRect(
  1133. borderRadius: BorderRadius.circular(12.5),
  1134. child: MyViews().netImg('path', 25, 25),
  1135. ),
  1136. Container(
  1137. child: Text(
  1138. data.buyerName,
  1139. style: TextStyle(
  1140. color: MyColors.c333333, fontSize: 13),
  1141. ),
  1142. margin: EdgeInsets.only(left: 8, right: 8),
  1143. ),
  1144. Container(
  1145. decoration: BoxDecoration(
  1146. border: Border.all(
  1147. color: MyColors.cFF4233, width: 1),
  1148. borderRadius: BorderRadius.circular(2),
  1149. ),
  1150. width: 26,
  1151. height: 14,
  1152. child: Text(
  1153. '买家',
  1154. style: TextStyle(
  1155. color: MyColors.cFF4233,
  1156. fontSize: 10,
  1157. height: 1.0),
  1158. ),
  1159. alignment: Alignment.center,
  1160. padding: EdgeInsets.only(top: 1),
  1161. ),
  1162. ],
  1163. ),
  1164. ],
  1165. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1166. ),
  1167. ),
  1168. )
  1169. ],
  1170. ),
  1171. Container(
  1172. height: 0.5,
  1173. color: MyColors.cE7E7E7,
  1174. margin: EdgeInsets.only(top: 11, bottom: 7),
  1175. ),
  1176. Row(
  1177. children: [
  1178. Text(
  1179. '下单时间:${data.createTime}',
  1180. style: TextStyle(color: MyColors.c666666, fontSize: 11),
  1181. ),
  1182. GestureDetector(
  1183. onTap: () {
  1184. if (data.state == 0) {
  1185. MyTools()
  1186. .toPage(context, ApplyForCompensationPage(), (then) {});
  1187. }
  1188. },
  1189. behavior: HitTestBehavior.translucent,
  1190. child: Container(
  1191. decoration: BoxDecoration(
  1192. color:
  1193. data.state == 1 ? MyColors.cFFCD00 : MyColors.cFF4233,
  1194. borderRadius: BorderRadius.circular(13),
  1195. ),
  1196. height: 26,
  1197. width: 70,
  1198. child: Text(
  1199. data.state == 1 ? '申请赔付' : '立即支付',
  1200. style: TextStyle(color: Colors.white, fontSize: 12),
  1201. ),
  1202. alignment: Alignment.center,
  1203. ),
  1204. )
  1205. ],
  1206. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1207. )
  1208. ],
  1209. ),
  1210. );
  1211. }
  1212. getPunishItem(BuildContext context, ComplainBeanDataData data) {
  1213. return Container(
  1214. decoration: BoxDecoration(
  1215. color: Colors.white,
  1216. borderRadius: BorderRadius.circular(4),
  1217. ),
  1218. margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
  1219. padding: EdgeInsets.only(left: 6, right: 6, bottom: 8, top: 12),
  1220. child: Column(
  1221. children: [
  1222. Row(
  1223. children: [
  1224. Row(
  1225. children: [
  1226. Container(
  1227. child: ClipRRect(
  1228. child: netImg(imgURL(data.shopPic), 25, 25),
  1229. borderRadius: BorderRadius.circular(12.5),
  1230. ),
  1231. margin: EdgeInsets.only(right: 7),
  1232. ),
  1233. myText('${data.shopName}(${data.shopUid})', MyColors.c333333,
  1234. 14),
  1235. ],
  1236. ),
  1237. myText(data.handled ? '已处理' : '正在处理',
  1238. data.handled ? MyColors.cADD358 : MyColors.c3D6CD5, 11)
  1239. ],
  1240. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1241. ),
  1242. Container(
  1243. decoration: BoxDecoration(
  1244. color: MyColors.c19FF4233,
  1245. borderRadius: BorderRadius.circular(4),
  1246. ),
  1247. constraints: BoxConstraints(minHeight: 97),
  1248. width: double.infinity,
  1249. padding: EdgeInsets.only(left: 11, right: 11, top: 8, bottom: 8),
  1250. margin: EdgeInsets.only(top: 12, bottom: 0),
  1251. child: Column(
  1252. children: [
  1253. myText(data.content, MyColors.c333333, 13),
  1254. Visibility(
  1255. visible: data.handled,
  1256. child: Container(
  1257. child: myText(
  1258. '处罚结果:${data.handleResult}', MyColors.c333333, 11),
  1259. margin: EdgeInsets.only(top: 3, bottom: 3),
  1260. ),
  1261. ),
  1262. myText('投诉时间:${data.complainTime}', MyColors.c333333, 11),
  1263. myText('处理时间:${data.handled ? data.handleTime : '正在处理'}',
  1264. MyColors.c333333, 11),
  1265. ],
  1266. crossAxisAlignment: CrossAxisAlignment.start,
  1267. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1268. ),
  1269. ),
  1270. ],
  1271. crossAxisAlignment: CrossAxisAlignment.start,
  1272. ),
  1273. );
  1274. }
  1275. Widget getApplicationItems(MyShopBeanDataData data, BuildContext context) {
  1276. return Container(
  1277. padding: EdgeInsets.only(left: 15, right: 15),
  1278. color: Colors.white,
  1279. child: Column(
  1280. children: [
  1281. Container(
  1282. margin: EdgeInsets.only(top: 8, bottom: 6),
  1283. child: Row(
  1284. children: [
  1285. Container(
  1286. margin: EdgeInsets.only(right: 6),
  1287. child: ClipRRect(
  1288. child: netImg(imgURL(data.userPic), 42, 42),
  1289. borderRadius: BorderRadius.circular(21),
  1290. ),
  1291. ),
  1292. myText('${data.userName} 申请加入你的货帮', MyColors.c333333, 15),
  1293. Expanded(
  1294. child: Container(
  1295. child: GestureDetector(
  1296. onTap: () {
  1297. MyTools().toPage(context, ApplicationDetailsPage(data),
  1298. (then) {
  1299. EventBus().emit('申请页面返回');
  1300. });
  1301. },
  1302. behavior: HitTestBehavior.translucent,
  1303. child: Container(
  1304. decoration: BoxDecoration(
  1305. border: Border.all(color: MyColors.cFF4233, width: 1),
  1306. borderRadius: BorderRadius.circular(14),
  1307. ),
  1308. height: 28,
  1309. width: 70,
  1310. child: myText('前往验证', MyColors.cFF4233, 12),
  1311. alignment: Alignment.center,
  1312. ),
  1313. ),
  1314. alignment: Alignment.centerRight,
  1315. ),
  1316. ),
  1317. ],
  1318. ),
  1319. ),
  1320. Container(
  1321. height: 0.5,
  1322. color: MyColors.cE7E7E7,
  1323. )
  1324. ],
  1325. ),
  1326. );
  1327. }
  1328. Widget getAddAssistantItems(
  1329. MyShopBeanDataData data, BuildContext context, bool checked) {
  1330. return Container(
  1331. padding: EdgeInsets.only(left: 15, right: 15),
  1332. color: Colors.white,
  1333. child: Column(
  1334. children: [
  1335. Container(
  1336. margin: EdgeInsets.only(top: 8, bottom: 6),
  1337. child: Row(
  1338. children: [
  1339. Checkbox(
  1340. activeColor: MyColors.cFF4233,
  1341. checkColor: Colors.white,
  1342. value: checked,
  1343. onChanged: (v) {
  1344. EventBus().emit('selectChanges', [data, v]);
  1345. }),
  1346. Container(
  1347. margin: EdgeInsets.only(right: 6),
  1348. child: ClipRRect(
  1349. child: netImg(imgURL(data.userPic), 42, 42),
  1350. borderRadius: BorderRadius.circular(21),
  1351. ),
  1352. ),
  1353. myText(
  1354. '${data.userName} (${data.userUid})', MyColors.c333333, 15),
  1355. // Expanded(
  1356. // child: Container(
  1357. // child: GestureDetector(
  1358. // onTap: () {},
  1359. // behavior: HitTestBehavior.translucent,
  1360. // child: Container(
  1361. // decoration: BoxDecoration(
  1362. // border: Border.all(color: MyColors.cFF4233, width: 1),
  1363. // borderRadius: BorderRadius.circular(14),
  1364. // ),
  1365. // height: 28,
  1366. // width: 70,
  1367. // child: myText('设为助手', MyColors.cFF4233, 12),
  1368. // alignment: Alignment.center,
  1369. // ),
  1370. // ),
  1371. // alignment: Alignment.centerRight,
  1372. // ),
  1373. // ),
  1374. ],
  1375. ),
  1376. ),
  1377. Container(
  1378. height: 0.5,
  1379. color: MyColors.cE7E7E7,
  1380. )
  1381. ],
  1382. ),
  1383. );
  1384. }
  1385. Widget getGangTransferItems(
  1386. MyShopBeanDataData data, BuildContext context, bool checked) {
  1387. return Container(
  1388. padding: EdgeInsets.only(left: 15, right: 15),
  1389. color: Colors.white,
  1390. child: Column(
  1391. children: [
  1392. Container(
  1393. margin: EdgeInsets.only(top: 8, bottom: 6),
  1394. child: Row(
  1395. children: [
  1396. Checkbox(
  1397. value: checked,
  1398. activeColor: MyColors.cFF4233,
  1399. checkColor: Colors.white,
  1400. onChanged: (v) {
  1401. EventBus().emit('GangTransfer', [data, v]);
  1402. }),
  1403. Container(
  1404. margin: EdgeInsets.only(right: 6),
  1405. child: ClipRRect(
  1406. child: netImg(imgURL(data.userPic), 42, 42),
  1407. borderRadius: BorderRadius.circular(21),
  1408. ),
  1409. ),
  1410. myText(
  1411. '${data.userName} (${data.userUid})', MyColors.c333333, 15),
  1412. // Expanded(
  1413. // child: Container(
  1414. // child: GestureDetector(
  1415. // onTap: () {},
  1416. // behavior: HitTestBehavior.translucent,
  1417. // child: Container(
  1418. // decoration: BoxDecoration(
  1419. // border: Border.all(color: MyColors.cFF4233, width: 1),
  1420. // borderRadius: BorderRadius.circular(14),
  1421. // ),
  1422. // height: 28,
  1423. // width: 70,
  1424. // child: myText('设为助手', MyColors.cFF4233, 12),
  1425. // alignment: Alignment.center,
  1426. // ),
  1427. // ),
  1428. // alignment: Alignment.centerRight,
  1429. // ),
  1430. // ),
  1431. ],
  1432. ),
  1433. ),
  1434. Container(
  1435. height: 0.5,
  1436. color: MyColors.cE7E7E7,
  1437. )
  1438. ],
  1439. ),
  1440. );
  1441. }
  1442. Widget getMemberListItems(
  1443. StoreBeanDataData store, MyShopBeanDataData data, BuildContext context) {
  1444. return Container(
  1445. padding: EdgeInsets.only(left: 15, right: 15),
  1446. color: Colors.white,
  1447. child: Column(
  1448. children: [
  1449. Container(
  1450. margin: EdgeInsets.only(top: 8, bottom: 6),
  1451. child: Row(
  1452. children: [
  1453. Row(
  1454. children: [
  1455. Container(
  1456. margin: EdgeInsets.only(right: 6),
  1457. child: ClipRRect(
  1458. child: netImg(imgURL(data.userPic), 42, 42),
  1459. borderRadius: BorderRadius.circular(21),
  1460. ),
  1461. ),
  1462. myText('${data.userName} (${data.userUid})',
  1463. MyColors.c333333, 15),
  1464. Visibility(
  1465. visible: data.role != shopUserMember,
  1466. child: Container(
  1467. decoration: BoxDecoration(
  1468. color: data.role == shopUserStaff
  1469. ? MyColors.cFF4233
  1470. : MyColors.cFFCD00,
  1471. borderRadius: BorderRadius.circular(8)),
  1472. height: 16,
  1473. width: 30,
  1474. child: myText(data.role == shopUserOwner ? "帮主" : "助手",
  1475. Colors.white, 10),
  1476. alignment: Alignment.center,
  1477. margin: EdgeInsets.only(left: 5),
  1478. ),
  1479. )
  1480. ],
  1481. ),
  1482. Visibility(
  1483. visible: data.role != shopUserOwner &&
  1484. data.userUid != MyCookie().getUID(),
  1485. child: GestureDetector(
  1486. child: Container(
  1487. margin: EdgeInsets.only(right: 10),
  1488. child: SvgPicture.asset(
  1489. 'images/svg/透视.svg',
  1490. height: 25,
  1491. width: 25,
  1492. ),
  1493. ),
  1494. onTap: () {
  1495. queryWhetherThereIsANumberOfPerspectives(
  1496. data, store, context);
  1497. },
  1498. behavior: HitTestBehavior.translucent,
  1499. ),
  1500. ),
  1501. ],
  1502. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1503. ),
  1504. ),
  1505. Container(
  1506. height: 0.5,
  1507. color: MyColors.cE7E7E7,
  1508. )
  1509. ],
  1510. ),
  1511. );
  1512. }
  1513. Widget getGangsItem(StoreBeanDataData data, BuildContext context) {
  1514. return Column(
  1515. children: [
  1516. Container(
  1517. margin: EdgeInsets.only(left: 15, right: 15, top: 7),
  1518. child: Row(
  1519. children: [
  1520. Container(
  1521. margin: EdgeInsets.only(right: 6),
  1522. child: ClipRRect(
  1523. child: netImg(imgURL(data.picture), 40, 40),
  1524. borderRadius: BorderRadius.circular(20),
  1525. ),
  1526. ),
  1527. myText('${data.name}(${data.uid})', MyColors.c333333, 15),
  1528. Expanded(
  1529. child: GestureDetector(
  1530. onTap: () {
  1531. submitApplication(data);
  1532. },
  1533. behavior: HitTestBehavior.translucent,
  1534. child: Container(
  1535. alignment: Alignment.centerRight,
  1536. child: Container(
  1537. decoration: BoxDecoration(
  1538. border: Border.all(color: MyColors.cFF4233, width: 1),
  1539. borderRadius: BorderRadius.circular(14)),
  1540. height: 28,
  1541. width: 70,
  1542. child: myText('申请加入', MyColors.cFF4233, 12),
  1543. alignment: Alignment.center,
  1544. ),
  1545. ),
  1546. ),
  1547. )
  1548. ],
  1549. ),
  1550. ),
  1551. Container(
  1552. height: 0.5,
  1553. color: MyColors.cF7F7F7,
  1554. margin: EdgeInsets.only(left: 15, right: 15, top: 6),
  1555. )
  1556. ],
  1557. );
  1558. }
  1559. orderStyle(SmartOrderBeanDataData data) {
  1560. if (data.type == orderTypeThirdPlatform) {
  1561. return Container(
  1562. margin: EdgeInsets.symmetric(horizontal: 12),
  1563. child: Row(
  1564. children: [
  1565. Container(
  1566. child: SvgPicture.asset(
  1567. 'images/svg/第三方.svg',
  1568. height: 45,
  1569. width: 45,
  1570. ),
  1571. margin: EdgeInsets.only(right: 8),
  1572. height: 60,
  1573. width: 60,
  1574. decoration: BoxDecoration(
  1575. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  1576. alignment: Alignment.center,
  1577. ),
  1578. Expanded(
  1579. child: Container(
  1580. height: 60,
  1581. child: Column(
  1582. children: [
  1583. MyViews()
  1584. .myText('第三方订单(${data.uid})', MyColors.c333333, 13),
  1585. MyViews()
  1586. .myText('付款人:${data.buyerName}', MyColors.c333333, 13),
  1587. Row(
  1588. children: [
  1589. MyViews()
  1590. .myText('¥${data.amount}', MyColors.cFF4233, 12),
  1591. MyViews().myText(
  1592. 'x${data.commodityCount}', MyColors.c999999, 12),
  1593. ],
  1594. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1595. )
  1596. ],
  1597. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1598. crossAxisAlignment: CrossAxisAlignment.start,
  1599. ),
  1600. ),
  1601. ),
  1602. ],
  1603. ),
  1604. );
  1605. } else if (data.type == orderTypeAnnualFee) {
  1606. return Container(
  1607. margin: EdgeInsets.symmetric(horizontal: 12),
  1608. child: Row(
  1609. children: [
  1610. Container(
  1611. child: Image.asset(
  1612. 'images/app_logo.png',
  1613. height: 27,
  1614. width: 27,
  1615. ),
  1616. margin: EdgeInsets.only(right: 8),
  1617. height: 45,
  1618. width: 45,
  1619. decoration: BoxDecoration(
  1620. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  1621. alignment: Alignment.center,
  1622. ),
  1623. Expanded(
  1624. child: Container(
  1625. height: 45,
  1626. child: Column(
  1627. children: [
  1628. Row(
  1629. children: [
  1630. MyViews().myText('平台年费', MyColors.c333333, 13),
  1631. MyViews().myText(
  1632. '付款人:${data.buyerName}(${data.buyerUid})',
  1633. MyColors.c333333,
  1634. 13),
  1635. ],
  1636. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1637. ),
  1638. Row(
  1639. children: [
  1640. MyViews()
  1641. .myText('¥${data.amount}', MyColors.cFF4233, 12),
  1642. MyViews().myText(
  1643. 'x${data.commodityCount}', MyColors.c999999, 12),
  1644. ],
  1645. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1646. )
  1647. ],
  1648. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1649. crossAxisAlignment: CrossAxisAlignment.start,
  1650. ),
  1651. ),
  1652. ),
  1653. ],
  1654. ),
  1655. );
  1656. } else if (data.type == orderTypeAdvertise) {
  1657. return Container(
  1658. margin: EdgeInsets.symmetric(horizontal: 12),
  1659. child: Row(
  1660. children: [
  1661. Container(
  1662. child: Image.asset(
  1663. 'images/app_logo.png',
  1664. height: 27,
  1665. width: 27,
  1666. ),
  1667. margin: EdgeInsets.only(right: 8),
  1668. height: 45,
  1669. width: 45,
  1670. decoration: BoxDecoration(
  1671. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  1672. alignment: Alignment.center,
  1673. ),
  1674. Expanded(
  1675. child: Container(
  1676. height: 45,
  1677. child: Column(
  1678. children: [
  1679. Row(
  1680. children: [
  1681. MyViews().myText('广告费', MyColors.c333333, 13),
  1682. MyViews().myText(
  1683. '付款人:${data.buyerName}(${data.buyerUid})',
  1684. MyColors.c333333,
  1685. 13),
  1686. ],
  1687. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1688. ),
  1689. Row(
  1690. children: [
  1691. MyViews()
  1692. .myText('¥${data.amount}', MyColors.cFF4233, 12),
  1693. MyViews().myText(
  1694. 'x${data.commodityCount}', MyColors.c999999, 12),
  1695. ],
  1696. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1697. )
  1698. ],
  1699. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1700. crossAxisAlignment: CrossAxisAlignment.start,
  1701. ),
  1702. ),
  1703. ),
  1704. ],
  1705. ),
  1706. );
  1707. } else if (data.type == orderTypeCommodity) {
  1708. return Container(
  1709. margin: EdgeInsets.only(left: 10, right: 10),
  1710. child: Row(
  1711. children: [
  1712. MyViews().netImg(imgURL(data.commodityCover), 82, 84,
  1713. placeholder: 'images/svg/goodsDefImg.svg'),
  1714. Expanded(
  1715. child: Container(
  1716. padding: EdgeInsets.only(left: 8),
  1717. height: 82,
  1718. child: Column(
  1719. children: [
  1720. Text(
  1721. '${data.commodityTitle}',
  1722. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  1723. maxLines: 2,
  1724. overflow: TextOverflow.ellipsis,
  1725. softWrap: true,
  1726. ),
  1727. Row(
  1728. children: [
  1729. Text(
  1730. '¥${double.parse('${data.amount}').toStringAsFixed(2)}',
  1731. style:
  1732. TextStyle(color: MyColors.cFF4233, fontSize: 12),
  1733. ),
  1734. Text(
  1735. 'x${data.commodityCount}',
  1736. style:
  1737. TextStyle(color: MyColors.c999999, fontSize: 12),
  1738. ),
  1739. ],
  1740. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1741. crossAxisAlignment: CrossAxisAlignment.start,
  1742. ),
  1743. Row(
  1744. children: [
  1745. ClipRRect(
  1746. child: MyViews()
  1747. .netImg(imgURL('${data.buyerPic}'), 25, 25),
  1748. borderRadius: BorderRadius.all(Radius.circular(12.5)),
  1749. ),
  1750. Container(
  1751. margin: EdgeInsets.only(right: 5, left: 5),
  1752. child: Text(
  1753. '${data.buyerName}(${data.buyerUid})',
  1754. style: TextStyle(
  1755. color: MyColors.c333333,
  1756. fontSize: 13,
  1757. ),
  1758. maxLines: 1,
  1759. overflow: TextOverflow.ellipsis,
  1760. softWrap: true,
  1761. ),
  1762. ),
  1763. Container(
  1764. decoration: BoxDecoration(
  1765. border:
  1766. Border.all(color: MyColors.cFF4233, width: 1),
  1767. borderRadius: BorderRadius.all(
  1768. Radius.circular(2),
  1769. ),
  1770. ),
  1771. child: Text(
  1772. '买家',
  1773. style: TextStyle(
  1774. color: MyColors.cFF4233,
  1775. fontSize: 10,
  1776. ),
  1777. ),
  1778. alignment: Alignment.center,
  1779. padding:
  1780. EdgeInsets.only(bottom: 2, left: 3, right: 3),
  1781. )
  1782. ],
  1783. ),
  1784. ],
  1785. crossAxisAlignment: CrossAxisAlignment.start,
  1786. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1787. ),
  1788. ),
  1789. )
  1790. ],
  1791. ),
  1792. );
  1793. } else {
  1794. return Container(
  1795. margin: EdgeInsets.only(left: 10, right: 10),
  1796. child: Row(
  1797. children: [
  1798. MyViews().netImg(imgURL(data.commodityCover), 82, 84,
  1799. placeholder: 'images/svg/goodsDefImg.svg'),
  1800. Expanded(
  1801. child: Container(
  1802. padding: EdgeInsets.only(left: 8),
  1803. height: 82,
  1804. child: Column(
  1805. children: [
  1806. Text(
  1807. '${data.commodityTitle}',
  1808. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  1809. maxLines: 2,
  1810. overflow: TextOverflow.ellipsis,
  1811. softWrap: true,
  1812. ),
  1813. Row(
  1814. children: [
  1815. Text(
  1816. '¥${double.parse('${data.amount}').toStringAsFixed(2)}',
  1817. style:
  1818. TextStyle(color: MyColors.cFF4233, fontSize: 12),
  1819. ),
  1820. Text(
  1821. 'x${data.commodityCount}',
  1822. style:
  1823. TextStyle(color: MyColors.c999999, fontSize: 12),
  1824. ),
  1825. ],
  1826. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1827. crossAxisAlignment: CrossAxisAlignment.start,
  1828. ),
  1829. Row(
  1830. children: [
  1831. ClipRRect(
  1832. child: MyViews()
  1833. .netImg(imgURL('${data.buyerPic}'), 25, 25),
  1834. borderRadius: BorderRadius.all(Radius.circular(12.5)),
  1835. ),
  1836. Container(
  1837. margin: EdgeInsets.only(right: 5, left: 5),
  1838. child: Text(
  1839. '${data.buyerName}(${data.buyerUid})',
  1840. style: TextStyle(
  1841. color: MyColors.c333333,
  1842. fontSize: 13,
  1843. ),
  1844. maxLines: 1,
  1845. overflow: TextOverflow.ellipsis,
  1846. softWrap: true,
  1847. ),
  1848. ),
  1849. Container(
  1850. decoration: BoxDecoration(
  1851. border:
  1852. Border.all(color: MyColors.cFF4233, width: 1),
  1853. borderRadius: BorderRadius.all(
  1854. Radius.circular(2),
  1855. ),
  1856. ),
  1857. child: Text(
  1858. '买家',
  1859. style: TextStyle(
  1860. color: MyColors.cFF4233,
  1861. fontSize: 10,
  1862. ),
  1863. ),
  1864. alignment: Alignment.center,
  1865. padding:
  1866. EdgeInsets.only(bottom: 2, left: 3, right: 3),
  1867. )
  1868. ],
  1869. ),
  1870. ],
  1871. crossAxisAlignment: CrossAxisAlignment.start,
  1872. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1873. ),
  1874. ),
  1875. )
  1876. ],
  1877. ),
  1878. );
  1879. }
  1880. }
  1881. void queryWhetherThereIsANumberOfPerspectives(
  1882. MyShopBeanDataData data, StoreBeanDataData store, BuildContext context) {
  1883. MyDio().query({
  1884. "key": "user_vp",
  1885. "filters": {
  1886. "conditions": [
  1887. "user_uid == ${MyCookie().getUID()}",
  1888. "vp_key == $vpKeyXRay"
  1889. ]
  1890. },
  1891. "dims": userVpDims,
  1892. "paging": [1, 2000]
  1893. }, (response, hasError) {
  1894. UserVpBeanEntity entity =
  1895. UserVpBeanEntity().fromJson(json.decode(response.data.toString()));
  1896. if (entity.data.data.length != 0) {
  1897. MyTools().toPage(context, OtherPeopleSTurnoverPage(data), (then) {});
  1898. } else {
  1899. // showSimpleDialog('你还未获取透视道具或道具用完,请先购买次数再查看。', context, () {
  1900. // Navigator.pop(context);
  1901. // MyShopBeanDataData shop = MyShopBeanDataData();
  1902. // shop.shopUid = store.uid;
  1903. // shop.shopName = store.name;
  1904. // shop.shopPic = store.picture;
  1905. // MyTools().toPage(
  1906. // context, PrivacyProtectionPropsPage(shop, vpKeyXRay), (then) {});
  1907. // });
  1908. MyShopBeanDataData shop = MyShopBeanDataData();
  1909. shop.shopUid = store.uid;
  1910. shop.shopName = store.name;
  1911. shop.shopPic = store.picture;
  1912. MyTools().toPage(
  1913. context, PrivacyProtectionPropsPage(shop, vpKeyXRay), (then) {});
  1914. }
  1915. }, (error) {});
  1916. }
  1917. Widget pubShopItem(var data, BuildContext context) {
  1918. if (data is StoreBeanDataData) {
  1919. return GestureDetector(
  1920. onTap: () {
  1921. MyShopBeanDataData sBean = MyShopBeanDataData();
  1922. sBean.shopName = data.name;
  1923. sBean.shopPic = data.picture;
  1924. sBean.shopUid = data.uid;
  1925. sBean.ownerUid = data.ownerUid;
  1926. sBean.ownerName = data.ownerName;
  1927. sBean.ownerPic = data.ownerPic;
  1928. sBean.privateShop = data.private;
  1929. sBean.innerTrade = data.innerTrade;
  1930. sBean.shopState = data.state;
  1931. navigatorKey.currentState.push(
  1932. MaterialPageRoute(builder: (context) => GangInPage(sBean, null)));
  1933. },
  1934. behavior: HitTestBehavior.translucent,
  1935. child: Container(
  1936. margin: EdgeInsets.only(bottom: 5),
  1937. child: Card(
  1938. elevation: 2,
  1939. shadowColor: MyColors.c21333333,
  1940. child: Padding(
  1941. padding: const EdgeInsets.all(10),
  1942. child: Row(
  1943. children: [
  1944. ClipRRect(
  1945. child: MyViews().netImg(imgURL(data.picture), 70, 70,
  1946. placeholder: 'images/svg/goodsDefImg.svg'),
  1947. borderRadius: BorderRadius.circular(4),
  1948. ),
  1949. Expanded(
  1950. child: Container(
  1951. height: 70,
  1952. margin: EdgeInsets.only(left: 10),
  1953. child: Column(
  1954. children: [
  1955. myText('${data.name}(${data.uid})', MyColors.c333333,
  1956. 14),
  1957. Text(
  1958. '货帮介绍:${data.introduction}',
  1959. style: TextStyle(
  1960. color: MyColors.c666666, fontSize: 11),
  1961. maxLines: 1,
  1962. overflow: TextOverflow.ellipsis,
  1963. softWrap: true,
  1964. ),
  1965. Row(
  1966. children: [
  1967. Icon(
  1968. Icons.location_on_outlined,
  1969. size: 15,
  1970. color: MyColors.c666666,
  1971. ),
  1972. Expanded(
  1973. child: Text(
  1974. '${data.address}',
  1975. style: TextStyle(
  1976. color: MyColors.c666666, fontSize: 10),
  1977. maxLines: 1,
  1978. overflow: TextOverflow.ellipsis,
  1979. softWrap: true,
  1980. ),
  1981. ),
  1982. ],
  1983. ),
  1984. ],
  1985. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1986. crossAxisAlignment: CrossAxisAlignment.start,
  1987. ),
  1988. ),
  1989. )
  1990. ],
  1991. ),
  1992. ),
  1993. ),
  1994. ),
  1995. );
  1996. } else if (data is AdBeanDataData) {
  1997. return GestureDetector(
  1998. onTap: () {
  1999. MyTools().toPage(context, AdDetailsPage(data), (then) {});
  2000. },
  2001. behavior: HitTestBehavior.translucent,
  2002. child: Container(
  2003. margin: EdgeInsets.only(bottom: 5),
  2004. child: Card(
  2005. elevation: 2,
  2006. shadowColor: MyColors.c21333333,
  2007. child: Padding(
  2008. padding: const EdgeInsets.only(top: 10, bottom: 10, left: 10),
  2009. child: Row(
  2010. children: [
  2011. ClipRRect(
  2012. child: MyViews().netImg(imgURL(data.coverPath), 70, 70,
  2013. placeholder: 'images/svg/goodsDefImg.svg'),
  2014. borderRadius: BorderRadius.circular(4),
  2015. ),
  2016. Expanded(
  2017. child: Container(
  2018. height: 70,
  2019. margin: EdgeInsets.only(left: 10),
  2020. child: Column(
  2021. children: [
  2022. Row(
  2023. children: [
  2024. Expanded(
  2025. child: myText(
  2026. '${data.title}', MyColors.c333333, 14)),
  2027. Container(
  2028. decoration: BoxDecoration(
  2029. color: MyColors.cADD358,
  2030. borderRadius: BorderRadius.only(
  2031. topLeft: Radius.circular(8),
  2032. bottomLeft: Radius.circular(8),
  2033. ),
  2034. ),
  2035. height: 16,
  2036. width: 32,
  2037. child: myText('推广', Colors.white, 9),
  2038. alignment: Alignment.center,
  2039. ),
  2040. ],
  2041. ),
  2042. Container(
  2043. margin: EdgeInsets.only(right: 10),
  2044. child: Text(
  2045. '${data.description}',
  2046. style: TextStyle(
  2047. color: MyColors.c666666, fontSize: 11),
  2048. maxLines: 2,
  2049. overflow: TextOverflow.ellipsis,
  2050. softWrap: true,
  2051. ),
  2052. ),
  2053. ],
  2054. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2055. crossAxisAlignment: CrossAxisAlignment.start,
  2056. ),
  2057. ),
  2058. )
  2059. ],
  2060. ),
  2061. ),
  2062. ),
  2063. ),
  2064. );
  2065. }
  2066. }
  2067. }
  2068. Widget noData() {
  2069. return Center(
  2070. child: Column(
  2071. children: [
  2072. Container(
  2073. child: Image.asset('images/no_data.png'),
  2074. alignment: Alignment.center,
  2075. margin: EdgeInsets.only(top: 40),
  2076. ),
  2077. Container(
  2078. child: MyViews().myText('暂无信息', MyColors.c999999, 16),
  2079. height: 100,
  2080. alignment: Alignment.topCenter,
  2081. )
  2082. ],
  2083. mainAxisAlignment: MainAxisAlignment.center,
  2084. ),
  2085. );
  2086. }
  2087. showPayDialog(SmartOrderBeanDataData data, BuildContext context, onTap) {
  2088. showDialog(
  2089. context: context,
  2090. builder: (BuildContext context) {
  2091. return Material(
  2092. color: Colors.black12,
  2093. child: Center(
  2094. child: Container(
  2095. decoration: BoxDecoration(
  2096. borderRadius: BorderRadius.circular(16),
  2097. color: Colors.white,
  2098. ),
  2099. height: 207,
  2100. margin: EdgeInsets.symmetric(horizontal: 18),
  2101. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2102. child: Column(
  2103. children: [
  2104. Row(
  2105. children: [
  2106. Container(
  2107. decoration: BoxDecoration(
  2108. border: Border.all(color: MyColors.cEBEBEB, width: 1),
  2109. ),
  2110. child: SvgPicture.asset(
  2111. 'images/svg/支付商品.svg',
  2112. height: 28,
  2113. width: 28,
  2114. ),
  2115. height: 45,
  2116. width: 45,
  2117. alignment: Alignment.center,
  2118. ),
  2119. Container(
  2120. height: 45,
  2121. child: Column(
  2122. children: [
  2123. MyViews().myText(
  2124. '确认支付订单(${data.uid})', MyColors.c333333, 13),
  2125. MyViews()
  2126. .myText('¥${data.amount}', MyColors.cFF4233, 12),
  2127. ],
  2128. crossAxisAlignment: CrossAxisAlignment.start,
  2129. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2130. ),
  2131. margin: EdgeInsets.only(left: 10),
  2132. )
  2133. ],
  2134. ),
  2135. Container(
  2136. height: 0.5,
  2137. color: MyColors.cE7E7E7,
  2138. ),
  2139. Row(
  2140. children: [
  2141. MyViews().myText('付款人:', MyColors.c333333, 13),
  2142. Container(
  2143. child: ClipRRect(
  2144. child: MyViews().netImg(imgURL(data.buyerPic), 23, 23),
  2145. borderRadius: BorderRadius.circular(23),
  2146. ),
  2147. margin: EdgeInsets.symmetric(horizontal: 8),
  2148. ),
  2149. MyViews().myText(
  2150. '${data.buyerName}${data.buyerUid == 0 ? '' : "(${data.buyerUid})"}',
  2151. MyColors.c333333,
  2152. 13),
  2153. ],
  2154. ),
  2155. Container(
  2156. height: 0.5,
  2157. color: MyColors.cE7E7E7,
  2158. ),
  2159. Row(
  2160. children: [
  2161. MyViews().myText('收款人:', MyColors.c333333, 13),
  2162. Container(
  2163. child: ClipRRect(
  2164. child: MyViews().netImg(imgURL(data.sellerPic), 23, 23),
  2165. borderRadius: BorderRadius.circular(23),
  2166. ),
  2167. margin: EdgeInsets.symmetric(horizontal: 8),
  2168. ),
  2169. MyViews().myText(
  2170. '${data.sellerName}${data.sellerUid == 0 ? '' : '(${data.sellerUid})'}',
  2171. MyColors.c333333,
  2172. 13),
  2173. ],
  2174. ),
  2175. Container(
  2176. height: 0.5,
  2177. color: MyColors.cE7E7E7,
  2178. ),
  2179. Container(
  2180. margin: EdgeInsets.symmetric(horizontal: 10),
  2181. child: Row(
  2182. children: [
  2183. Expanded(
  2184. child: GestureDetector(
  2185. onTap: () {
  2186. Navigator.pop(context);
  2187. },
  2188. behavior: HitTestBehavior.translucent,
  2189. child: Container(
  2190. decoration: BoxDecoration(
  2191. borderRadius: BorderRadius.only(
  2192. topLeft: Radius.circular(20),
  2193. bottomLeft: Radius.circular(20),
  2194. ),
  2195. border: Border.all(
  2196. color: MyColors.cFF4233, width: 1.1),
  2197. color: Colors.white),
  2198. child: MyViews().myText('取消', MyColors.cFF4233, 14),
  2199. height: 40,
  2200. alignment: Alignment.center,
  2201. ),
  2202. ),
  2203. ),
  2204. Expanded(
  2205. child: GestureDetector(
  2206. behavior: HitTestBehavior.translucent,
  2207. onTap: onTap,
  2208. child: Container(
  2209. decoration: BoxDecoration(
  2210. borderRadius: BorderRadius.only(
  2211. topRight: Radius.circular(20),
  2212. bottomRight: Radius.circular(20),
  2213. ),
  2214. color: MyColors.cFF4233),
  2215. height: 40,
  2216. child: MyViews().myText('确定', Colors.white, 14),
  2217. alignment: Alignment.center,
  2218. ),
  2219. ),
  2220. )
  2221. ],
  2222. ),
  2223. )
  2224. ],
  2225. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2226. ),
  2227. ),
  2228. ),
  2229. );
  2230. },
  2231. );
  2232. }
  2233. showSimpleDialog(String content, BuildContext context, onTap) {
  2234. showDialog(
  2235. context: context,
  2236. builder: (BuildContext context) {
  2237. return Material(
  2238. color: Colors.black12,
  2239. child: Center(
  2240. child: Container(
  2241. decoration: BoxDecoration(
  2242. borderRadius: BorderRadius.circular(16),
  2243. color: Colors.white,
  2244. ),
  2245. height: 180,
  2246. margin: EdgeInsets.symmetric(horizontal: 18),
  2247. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2248. child: Column(
  2249. children: [
  2250. Expanded(
  2251. child: Center(
  2252. child: Container(
  2253. child: MyViews().myText(content, MyColors.c333333, 14),
  2254. margin: EdgeInsets.symmetric(horizontal: 20),
  2255. ),
  2256. ),
  2257. ),
  2258. Container(
  2259. height: 0.5,
  2260. color: MyColors.cE7E7E7,
  2261. margin: EdgeInsets.only(bottom: 12),
  2262. ),
  2263. Container(
  2264. margin: EdgeInsets.symmetric(horizontal: 10),
  2265. child: Row(
  2266. children: [
  2267. Expanded(
  2268. child: GestureDetector(
  2269. onTap: () {
  2270. Navigator.pop(context);
  2271. },
  2272. behavior: HitTestBehavior.translucent,
  2273. child: Container(
  2274. decoration: BoxDecoration(
  2275. borderRadius: BorderRadius.only(
  2276. topLeft: Radius.circular(20),
  2277. bottomLeft: Radius.circular(20),
  2278. ),
  2279. border: Border.all(
  2280. color: MyColors.cFF4233, width: 1.1),
  2281. color: Colors.white),
  2282. child: MyViews().myText('取消', MyColors.cFF4233, 14),
  2283. height: 40,
  2284. alignment: Alignment.center,
  2285. ),
  2286. ),
  2287. ),
  2288. Expanded(
  2289. child: GestureDetector(
  2290. behavior: HitTestBehavior.translucent,
  2291. onTap: onTap,
  2292. child: Container(
  2293. decoration: BoxDecoration(
  2294. borderRadius: BorderRadius.only(
  2295. topRight: Radius.circular(20),
  2296. bottomRight: Radius.circular(20),
  2297. ),
  2298. color: MyColors.cFF4233),
  2299. height: 40,
  2300. child: MyViews().myText('确定', Colors.white, 14),
  2301. alignment: Alignment.center,
  2302. ),
  2303. ),
  2304. )
  2305. ],
  2306. ),
  2307. )
  2308. ],
  2309. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2310. ),
  2311. ),
  2312. ),
  2313. );
  2314. },
  2315. );
  2316. }
  2317. updateDialog(AndroidAppVersionBeanData data, BuildContext context) {
  2318. bool startUpdate = false;
  2319. bool downloadCompleted = false;
  2320. String filePath = '';
  2321. int p = 0;
  2322. EventBus().off('允许安装');
  2323. EventBus().off('更新进度条');
  2324. showDialog(
  2325. context: context,
  2326. builder: (BuildContext context) {
  2327. return WillPopScope(
  2328. onWillPop: () {
  2329. return Future.value(false);
  2330. },
  2331. child: StreamBuilder<Object>(builder: (context, snapshot) {
  2332. return Material(
  2333. color: Colors.black12,
  2334. child: Center(
  2335. child: Container(
  2336. decoration: BoxDecoration(
  2337. borderRadius: BorderRadius.circular(16),
  2338. color: Colors.white,
  2339. ),
  2340. height: 165,
  2341. margin: EdgeInsets.symmetric(horizontal: 18),
  2342. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2343. child: StatefulBuilder(
  2344. builder: (BuildContext context,
  2345. void Function(void Function()) setState) {
  2346. EventBus().on('更新进度条', (arg) {
  2347. p = arg;
  2348. setState(() {});
  2349. });
  2350. EventBus().on('允许安装', (arg) {
  2351. downloadCompleted = true;
  2352. filePath = arg;
  2353. setState(() {});
  2354. });
  2355. if (startUpdate) {
  2356. return Column(
  2357. children: [
  2358. Container(
  2359. height: 88,
  2360. child: Column(
  2361. children: [
  2362. Container(
  2363. child: MyViews()
  2364. .myText('更新中...', MyColors.c333333, 16),
  2365. ),
  2366. SizedBox(
  2367. height: 15,
  2368. child: ClipRRect(
  2369. borderRadius: BorderRadius.circular(7.5),
  2370. child: LinearProgressIndicator(
  2371. backgroundColor: Colors.grey[200],
  2372. valueColor: AlwaysStoppedAnimation(
  2373. MyColors.cFF4233),
  2374. value: downloadCompleted
  2375. ? 1
  2376. : NumUtil.divide(p, 100),
  2377. ),
  2378. ),
  2379. ),
  2380. ],
  2381. mainAxisAlignment: MainAxisAlignment.spaceAround,
  2382. ),
  2383. ),
  2384. Container(
  2385. height: 0.5,
  2386. color: MyColors.cE7E7E7,
  2387. margin: EdgeInsets.only(bottom: 12),
  2388. ),
  2389. Container(
  2390. margin: EdgeInsets.symmetric(horizontal: 20),
  2391. child: GestureDetector(
  2392. behavior: HitTestBehavior.translucent,
  2393. onTap: () {
  2394. if (downloadCompleted) {
  2395. installApk(filePath);
  2396. }
  2397. },
  2398. child: Container(
  2399. decoration: BoxDecoration(
  2400. borderRadius: BorderRadius.circular(20),
  2401. color: downloadCompleted
  2402. ? MyColors.cFF4233
  2403. : MyColors.c999999),
  2404. height: 40,
  2405. child: MyViews().myText('安装', Colors.white, 14),
  2406. alignment: Alignment.center,
  2407. ),
  2408. ),
  2409. )
  2410. ],
  2411. mainAxisAlignment: MainAxisAlignment.center,
  2412. );
  2413. } else {
  2414. return Column(
  2415. children: [
  2416. Container(
  2417. height: 88,
  2418. child: MyViews().myText(
  2419. data.force
  2420. ? '检查到新版本(v${data.version}),请更新'
  2421. : '检查到新版本(v${data.version}),请问是否更新',
  2422. MyColors.c333333,
  2423. 14),
  2424. margin: EdgeInsets.symmetric(horizontal: 20),
  2425. alignment: Alignment.center,
  2426. ),
  2427. Container(
  2428. height: 0.5,
  2429. color: MyColors.cE7E7E7,
  2430. margin: EdgeInsets.only(bottom: 12),
  2431. ),
  2432. data.force
  2433. ? Container(
  2434. margin: EdgeInsets.symmetric(horizontal: 10),
  2435. child: Expanded(
  2436. child: GestureDetector(
  2437. behavior: HitTestBehavior.translucent,
  2438. onTap: () {
  2439. if (Platform.isAndroid) {
  2440. downloadAPK(data, context);
  2441. startUpdate = true;
  2442. setState(() {});
  2443. } else if (Platform.isIOS) {
  2444. LaunchReview.launch(
  2445. writeReview: false,
  2446. iOSAppId: appStoreID);
  2447. } else {
  2448. Navigator.pop(context);
  2449. }
  2450. },
  2451. child: Container(
  2452. decoration: BoxDecoration(
  2453. borderRadius:
  2454. BorderRadius.circular(20),
  2455. color: MyColors.cFF4233),
  2456. height: 40,
  2457. child: MyViews()
  2458. .myText('立即更新', Colors.white, 14),
  2459. alignment: Alignment.center,
  2460. ),
  2461. ),
  2462. ),
  2463. )
  2464. : Container(
  2465. margin: EdgeInsets.symmetric(horizontal: 10),
  2466. child: Row(
  2467. children: [
  2468. Expanded(
  2469. child: GestureDetector(
  2470. onTap: () {
  2471. if (data.force) {
  2472. EventBus().off('允许安装');
  2473. EventBus().off('更新进度条');
  2474. SystemNavigator.pop();
  2475. } else {
  2476. EventBus().off('允许安装');
  2477. EventBus().off('更新进度条');
  2478. Navigator.pop(context);
  2479. }
  2480. },
  2481. behavior: HitTestBehavior.translucent,
  2482. child: Container(
  2483. decoration: BoxDecoration(
  2484. borderRadius: BorderRadius.only(
  2485. topLeft: Radius.circular(20),
  2486. bottomLeft:
  2487. Radius.circular(20),
  2488. ),
  2489. border: Border.all(
  2490. color: MyColors.cFF4233,
  2491. width: 1.1),
  2492. color: Colors.white),
  2493. child: MyViews().myText(
  2494. '暂不更新', MyColors.cFF4233, 14),
  2495. height: 40,
  2496. alignment: Alignment.center,
  2497. ),
  2498. ),
  2499. ),
  2500. Expanded(
  2501. child: GestureDetector(
  2502. behavior: HitTestBehavior.translucent,
  2503. onTap: () {
  2504. if (Platform.isAndroid) {
  2505. downloadAPK(data, context);
  2506. startUpdate = true;
  2507. setState(() {});
  2508. } else if (Platform.isIOS) {
  2509. LaunchReview.launch(
  2510. writeReview: false,
  2511. iOSAppId: appStoreID);
  2512. } else {
  2513. Navigator.pop(context);
  2514. }
  2515. },
  2516. child: Container(
  2517. decoration: BoxDecoration(
  2518. borderRadius: BorderRadius.only(
  2519. topRight: Radius.circular(20),
  2520. bottomRight:
  2521. Radius.circular(20),
  2522. ),
  2523. color: MyColors.cFF4233),
  2524. height: 40,
  2525. child: MyViews().myText(
  2526. '立即更新', Colors.white, 14),
  2527. alignment: Alignment.center,
  2528. ),
  2529. ),
  2530. )
  2531. ],
  2532. ),
  2533. )
  2534. ],
  2535. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2536. );
  2537. }
  2538. },
  2539. ),
  2540. ),
  2541. ),
  2542. );
  2543. }),
  2544. );
  2545. },
  2546. );
  2547. }
  2548. downloadAPK(AndroidAppVersionBeanData data, BuildContext context) async {
  2549. Directory storageDir = await getExternalStorageDirectory();
  2550. String storagePath = storageDir.path;
  2551. File file = new File(
  2552. '$storagePath/${PinyinHelper.getShortPinyin(MyCookie().packageInfo.appName)}.apk');
  2553. if (!file.existsSync()) {
  2554. file.createSync();
  2555. }
  2556. print(apkURL(data.download));
  2557. Dio().download(apkURL(data.download), file.path,
  2558. onReceiveProgress: (int count, int total) {
  2559. EventBus().emit('更新进度条', ((count / (data.size)) * 100).floor());
  2560. }).then((value) {
  2561. print('下载完成');
  2562. EventBus().emit('允许安装', file.path);
  2563. }).catchError((e) {
  2564. print(e);
  2565. Navigator.pop(context);
  2566. EventBus().off('允许安装');
  2567. EventBus().off('更新进度条');
  2568. EasyLoading.showToast('下载失败');
  2569. });
  2570. }
  2571. Widget advertisingItems(BuildContext context, AdBeanDataData data) {
  2572. double w = (MediaQuery.of(context).size.width - 47) / 2;
  2573. List<Color> colors = [
  2574. MyColors.cADD358,
  2575. MyColors.cFF4233,
  2576. MyColors.cFF88B4,
  2577. MyColors.cFFCD00
  2578. ];
  2579. List<String> types = ['投放中', '未付费', '已结束', '未投放'];
  2580. int typeIndex;
  2581. if (data.paid == false) {
  2582. typeIndex = 1;
  2583. } else {
  2584. var sT = DateTime.parse(data.startDate);
  2585. var eT = sT.add(Duration(days: data.days));
  2586. if (sT.isBefore(DateTime.now()) && eT.isAfter(DateTime.now())) {
  2587. typeIndex = 0;
  2588. } else if (sT.isAfter(DateTime.now())) {
  2589. typeIndex = 3;
  2590. } else if (eT.isBefore(DateTime.now())) {
  2591. typeIndex = 2;
  2592. }
  2593. }
  2594. return Card(
  2595. child: Column(
  2596. children: [
  2597. ClipRRect(
  2598. child: Container(
  2599. child: Stack(
  2600. children: [
  2601. MyViews().netImg(imgURL(data.coverPath), w, w,
  2602. placeholder: 'images/svg/goodsDefImg.svg'),
  2603. Positioned(
  2604. right: 0,
  2605. top: 5,
  2606. child: Container(
  2607. decoration: BoxDecoration(
  2608. color: colors[typeIndex],
  2609. borderRadius: BorderRadius.only(
  2610. topLeft: Radius.circular(7),
  2611. bottomLeft: Radius.circular(7),
  2612. ),
  2613. ),
  2614. height: 14,
  2615. width: 32,
  2616. child: MyViews().myText(types[typeIndex], Colors.white, 8),
  2617. alignment: Alignment.center,
  2618. ),
  2619. )
  2620. ],
  2621. ),
  2622. height: w,
  2623. width: w,
  2624. ),
  2625. borderRadius: BorderRadius.only(
  2626. topRight: Radius.circular(4), topLeft: Radius.circular(4)),
  2627. ),
  2628. Expanded(
  2629. child: Padding(
  2630. padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10),
  2631. child: Column(
  2632. children: [
  2633. Text(
  2634. data.title,
  2635. style: TextStyle(color: MyColors.c333333, fontSize: 12),
  2636. maxLines: 1,
  2637. overflow: TextOverflow.ellipsis,
  2638. softWrap: true,
  2639. ),
  2640. Text(
  2641. '发布时间:${data.createTime}',
  2642. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2643. maxLines: 1,
  2644. overflow: TextOverflow.ellipsis,
  2645. softWrap: true,
  2646. ),
  2647. Text(
  2648. '开始时间:${data.startDate}',
  2649. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2650. maxLines: 1,
  2651. overflow: TextOverflow.ellipsis,
  2652. softWrap: true,
  2653. ),
  2654. Text(
  2655. '结束时间:${DateTime.parse(data.startDate).add(Duration(days: data.days)).toString().substring(0, 10)}',
  2656. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2657. maxLines: 1,
  2658. overflow: TextOverflow.ellipsis,
  2659. softWrap: true,
  2660. ),
  2661. ],
  2662. crossAxisAlignment: CrossAxisAlignment.start,
  2663. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2664. ),
  2665. ),
  2666. )
  2667. ],
  2668. crossAxisAlignment: CrossAxisAlignment.start,
  2669. ),
  2670. );
  2671. }
  2672. Future<Null> installApk(String url) async {
  2673. InstallPlugin.installApk(url, MyCookie().packageInfo.packageName)
  2674. .then((result) {
  2675. print('install apk $result');
  2676. }).catchError((error) {
  2677. print('install apk error: $error');
  2678. });
  2679. }