my_views.dart 113 KB

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