my_views.dart 111 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893
  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. width: 30,
  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 == orderTypeOfflineTransfer ||
  1861. data.type == orderTypeOfflinePay) {
  1862. //线下付款
  1863. return Container(
  1864. margin: EdgeInsets.only(left: 10, right: 10),
  1865. child: Row(
  1866. children: [
  1867. Container(
  1868. child: SvgPicture.asset(
  1869. 'images/svg/线下付款.svg',
  1870. height: 45,
  1871. width: 45,
  1872. ),
  1873. margin: EdgeInsets.only(right: 8),
  1874. height: 60,
  1875. width: 60,
  1876. decoration: BoxDecoration(
  1877. border: Border.all(color: MyColors.cEBEBEB, width: 1)),
  1878. alignment: Alignment.center,
  1879. ),
  1880. Expanded(
  1881. child: Container(
  1882. padding: EdgeInsets.only(left: 8),
  1883. height: 60,
  1884. child: Column(
  1885. children: [
  1886. Text(
  1887. data.type == orderTypeOfflineTransfer ? '到店付款' : '线下收款',
  1888. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  1889. maxLines: 2,
  1890. overflow: TextOverflow.ellipsis,
  1891. softWrap: true,
  1892. ),
  1893. Row(
  1894. children: [
  1895. Text(
  1896. '¥${double.parse('${data.amount}').toStringAsFixed(2)}',
  1897. style:
  1898. TextStyle(color: MyColors.cFF4233, fontSize: 12),
  1899. ),
  1900. Text(
  1901. 'x${data.commodityCount}',
  1902. style:
  1903. TextStyle(color: MyColors.c999999, fontSize: 12),
  1904. ),
  1905. ],
  1906. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1907. crossAxisAlignment: CrossAxisAlignment.start,
  1908. ),
  1909. Row(
  1910. children: [
  1911. ClipRRect(
  1912. child: MyViews()
  1913. .netImg(imgURL('${data.buyerPic}'), 20, 20),
  1914. borderRadius: BorderRadius.all(Radius.circular(10)),
  1915. ),
  1916. Container(
  1917. margin: EdgeInsets.only(right: 5, left: 5),
  1918. child: Text(
  1919. '${data.buyerName}(${hideUID(data.buyerUid.toString())})',
  1920. style: TextStyle(
  1921. color: MyColors.c333333,
  1922. fontSize: 13,
  1923. ),
  1924. maxLines: 1,
  1925. overflow: TextOverflow.ellipsis,
  1926. softWrap: true,
  1927. ),
  1928. ),
  1929. // Container(
  1930. // decoration: BoxDecoration(
  1931. // border:
  1932. // Border.all(color: MyColors.cFF4233, width: 1),
  1933. // borderRadius: BorderRadius.all(
  1934. // Radius.circular(2),
  1935. // ),
  1936. // ),
  1937. // child: Text(
  1938. // '买家',
  1939. // style: TextStyle(
  1940. // color: MyColors.cFF4233,
  1941. // fontSize: 10,
  1942. // ),
  1943. // ),
  1944. // alignment: Alignment.center,
  1945. // padding:
  1946. // EdgeInsets.only(bottom: 2, left: 3, right: 3),
  1947. // )
  1948. ],
  1949. ),
  1950. ],
  1951. crossAxisAlignment: CrossAxisAlignment.start,
  1952. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1953. ),
  1954. ),
  1955. )
  1956. ],
  1957. ),
  1958. );
  1959. } else {
  1960. return Container(
  1961. margin: EdgeInsets.only(left: 10, right: 10),
  1962. child: Row(
  1963. children: [
  1964. MyViews().netImg(imgURL(data.commodityCover), 82, 84,
  1965. placeholder: 'images/svg/goodsDefImg.svg'),
  1966. Expanded(
  1967. child: Container(
  1968. padding: EdgeInsets.only(left: 8),
  1969. height: 82,
  1970. child: Column(
  1971. children: [
  1972. Text(
  1973. '${data.commodityTitle}',
  1974. style: TextStyle(color: MyColors.c333333, fontSize: 13),
  1975. maxLines: 2,
  1976. overflow: TextOverflow.ellipsis,
  1977. softWrap: true,
  1978. ),
  1979. Row(
  1980. children: [
  1981. Text(
  1982. '¥${double.parse('${data.amount}').toStringAsFixed(2)}',
  1983. style:
  1984. TextStyle(color: MyColors.cFF4233, fontSize: 12),
  1985. ),
  1986. Text(
  1987. 'x${data.commodityCount}',
  1988. style:
  1989. TextStyle(color: MyColors.c999999, fontSize: 12),
  1990. ),
  1991. ],
  1992. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  1993. crossAxisAlignment: CrossAxisAlignment.start,
  1994. ),
  1995. Row(
  1996. children: [
  1997. ClipRRect(
  1998. child: MyViews()
  1999. .netImg(imgURL('${data.buyerPic}'), 25, 25),
  2000. borderRadius: BorderRadius.all(Radius.circular(12.5)),
  2001. ),
  2002. Container(
  2003. margin: EdgeInsets.only(right: 5, left: 5),
  2004. child: Text(
  2005. '${data.buyerName}(${hideUID(data.buyerUid.toString())})',
  2006. style: TextStyle(
  2007. color: MyColors.c333333,
  2008. fontSize: 13,
  2009. ),
  2010. maxLines: 1,
  2011. overflow: TextOverflow.ellipsis,
  2012. softWrap: true,
  2013. ),
  2014. ),
  2015. // Container(
  2016. // decoration: BoxDecoration(
  2017. // border:
  2018. // Border.all(color: MyColors.cFF4233, width: 1),
  2019. // borderRadius: BorderRadius.all(
  2020. // Radius.circular(2),
  2021. // ),
  2022. // ),
  2023. // child: Text(
  2024. // '买家',
  2025. // style: TextStyle(
  2026. // color: MyColors.cFF4233,
  2027. // fontSize: 10,
  2028. // ),
  2029. // ),
  2030. // alignment: Alignment.center,
  2031. // padding:
  2032. // EdgeInsets.only(bottom: 2, left: 3, right: 3),
  2033. // )
  2034. ],
  2035. ),
  2036. ],
  2037. crossAxisAlignment: CrossAxisAlignment.start,
  2038. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2039. ),
  2040. ),
  2041. )
  2042. ],
  2043. ),
  2044. );
  2045. }
  2046. }
  2047. void queryWhetherThereIsANumberOfPerspectives(
  2048. MyShopBeanDataData data, StoreBeanDataData store, BuildContext context) {
  2049. MyDio().query({
  2050. "key": "user_vp",
  2051. "filters": {
  2052. "conditions": [
  2053. "user_uid == ${MyCookie().getUID()}",
  2054. "vp_key == $vpKeyXRay"
  2055. ]
  2056. },
  2057. "dims": userVpDims,
  2058. "paging": [1, 2000]
  2059. }, (response, hasError) {
  2060. UserVpBeanEntity entity =
  2061. UserVpBeanEntity().fromJson(json.decode(response.data.toString()));
  2062. if (entity.data.data.length != 0) {
  2063. MyTools().toPage(context, OtherPeopleSTurnoverPage(data), (then) {});
  2064. } else {
  2065. // showSimpleDialog('你还未获取透视道具或道具用完,请先购买次数再查看。', context, () {
  2066. // Navigator.pop(context);
  2067. // MyShopBeanDataData shop = MyShopBeanDataData();
  2068. // shop.shopUid = store.uid;
  2069. // shop.shopName = store.name;
  2070. // shop.shopPic = store.picture;
  2071. // MyTools().toPage(
  2072. // context, PrivacyProtectionPropsPage(shop, vpKeyXRay), (then) {});
  2073. // });
  2074. MyShopBeanDataData shop = MyShopBeanDataData();
  2075. shop.shopUid = store.uid;
  2076. shop.shopName = store.name;
  2077. shop.shopPic = store.picture;
  2078. MyTools().toPage(
  2079. context, PrivacyProtectionPropsPage(shop, vpKeyXRay), (then) {});
  2080. }
  2081. }, (error) {});
  2082. }
  2083. Widget pubShopItem(var data, BuildContext context) {
  2084. if (data is StoreBeanDataData) {
  2085. return GestureDetector(
  2086. onTap: () {
  2087. MyShopBeanDataData sBean = MyShopBeanDataData();
  2088. sBean.shopName = data.name;
  2089. sBean.shopPic = data.picture;
  2090. sBean.shopUid = data.uid;
  2091. sBean.ownerUid = data.ownerUid;
  2092. sBean.ownerName = data.ownerName;
  2093. sBean.ownerPic = data.ownerPic;
  2094. sBean.privateShop = data.private;
  2095. sBean.innerTrade = data.innerTrade;
  2096. sBean.shopState = data.state;
  2097. navigatorKey.currentState.push(
  2098. MaterialPageRoute(builder: (context) => GangInPage(sBean, null)));
  2099. },
  2100. behavior: HitTestBehavior.translucent,
  2101. child: Container(
  2102. decoration: BoxDecoration(
  2103. boxShadow: [BoxShadow(
  2104. color: MyColors.c7FE1E1E1,
  2105. blurRadius: 5.0,
  2106. ),],
  2107. color: Colors.white,
  2108. borderRadius: BorderRadius.circular(4),
  2109. ),
  2110. margin: EdgeInsets.only(bottom: 6.5,left: 16,right: 16,top: 6.5),
  2111. child: Padding(
  2112. padding: const EdgeInsets.all(10),
  2113. child: Row(
  2114. children: [
  2115. ClipRRect(
  2116. child: MyViews().netImg(imgURL(data.picture), 70, 70,
  2117. placeholder: 'images/svg/goodsDefImg.svg'),
  2118. borderRadius: BorderRadius.circular(4),
  2119. ),
  2120. Expanded(
  2121. child: Container(
  2122. height: 70,
  2123. margin: EdgeInsets.only(left: 10),
  2124. child: Column(
  2125. children: [
  2126. myText('${data.name}(${data.uid})', MyColors.c333333,
  2127. 14),
  2128. Text(
  2129. '货帮介绍:${data.introduction}',
  2130. style: TextStyle(
  2131. color: MyColors.c666666, fontSize: 11),
  2132. maxLines: 1,
  2133. overflow: TextOverflow.ellipsis,
  2134. softWrap: true,
  2135. ),
  2136. Row(
  2137. children: [
  2138. Icon(
  2139. Icons.location_on_outlined,
  2140. size: 15,
  2141. color: MyColors.c666666,
  2142. ),
  2143. Expanded(
  2144. child: Text(
  2145. '${data.address}',
  2146. style: TextStyle(
  2147. color: MyColors.c666666, fontSize: 10),
  2148. maxLines: 1,
  2149. overflow: TextOverflow.ellipsis,
  2150. softWrap: true,
  2151. ),
  2152. ),
  2153. ],
  2154. ),
  2155. ],
  2156. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2157. crossAxisAlignment: CrossAxisAlignment.start,
  2158. ),
  2159. ),
  2160. )
  2161. ],
  2162. ),
  2163. ),
  2164. ),
  2165. );
  2166. } else if (data is AdBeanDataData) {
  2167. return GestureDetector(
  2168. onTap: () {
  2169. MyTools().toPage(context, AdDetailsPage(data), (then) {});
  2170. },
  2171. behavior: HitTestBehavior.translucent,
  2172. child: Container(
  2173. margin: EdgeInsets.only(bottom: 6.5,left: 16,right: 16,top: 6.5),
  2174. decoration: BoxDecoration(boxShadow: [BoxShadow(
  2175. color: MyColors.c7FE1E1E1,
  2176. blurRadius: 5.0,
  2177. ),],
  2178. color: Colors.white,
  2179. borderRadius: BorderRadius.circular(4),),
  2180. child: Padding(
  2181. padding: const EdgeInsets.only(top: 10, bottom: 10, left: 10),
  2182. child: Row(
  2183. children: [
  2184. ClipRRect(
  2185. child: MyViews().netImg(imgURL(data.coverPath), 70, 70,
  2186. placeholder: 'images/svg/goodsDefImg.svg'),
  2187. borderRadius: BorderRadius.circular(4),
  2188. ),
  2189. Expanded(
  2190. child: Container(
  2191. height: 70,
  2192. margin: EdgeInsets.only(left: 10),
  2193. child: Column(
  2194. children: [
  2195. Row(
  2196. children: [
  2197. Expanded(
  2198. child: myText(
  2199. '${data.title}', MyColors.c333333, 14)),
  2200. Container(
  2201. decoration: BoxDecoration(
  2202. color: MyColors.cADD358,
  2203. borderRadius: BorderRadius.only(
  2204. topLeft: Radius.circular(8),
  2205. bottomLeft: Radius.circular(8),
  2206. ),
  2207. ),
  2208. height: 16,
  2209. width: 32,
  2210. child: myText('推广', Colors.white, 9),
  2211. alignment: Alignment.center,
  2212. ),
  2213. ],
  2214. ),
  2215. Visibility(
  2216. visible: data.mobile.isNotEmpty,
  2217. child: Container(
  2218. margin: EdgeInsets.only(right: 10),
  2219. child: Text(
  2220. '联系电话:${data.mobile}',
  2221. style: TextStyle(
  2222. color: MyColors.c666666, fontSize: 11),
  2223. maxLines: 2,
  2224. overflow: TextOverflow.ellipsis,
  2225. softWrap: true,
  2226. ),
  2227. ),
  2228. ),
  2229. Container(
  2230. margin: EdgeInsets.only(right: 10),
  2231. child: Text(
  2232. '${data.description}',
  2233. style: TextStyle(
  2234. color: MyColors.c666666, fontSize: 11),
  2235. maxLines: 2,
  2236. overflow: TextOverflow.ellipsis,
  2237. softWrap: true,
  2238. ),
  2239. ),
  2240. ],
  2241. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2242. crossAxisAlignment: CrossAxisAlignment.start,
  2243. ),
  2244. ),
  2245. )
  2246. ],
  2247. ),
  2248. ),
  2249. ),
  2250. );
  2251. }
  2252. }
  2253. }
  2254. Widget noData() {
  2255. return Center(
  2256. child: Column(
  2257. children: [
  2258. Container(
  2259. child: Image.asset('images/no_data.png'),
  2260. alignment: Alignment.center,
  2261. margin: EdgeInsets.only(top: 40),
  2262. ),
  2263. Container(
  2264. child: MyViews().myText('暂无信息', MyColors.c999999, 16),
  2265. height: 100,
  2266. alignment: Alignment.topCenter,
  2267. )
  2268. ],
  2269. mainAxisAlignment: MainAxisAlignment.center,
  2270. ),
  2271. );
  2272. }
  2273. showPayDialog(SmartOrderBeanDataData data, BuildContext context, onTap) {
  2274. showDialog(
  2275. context: context,
  2276. builder: (BuildContext context) {
  2277. return Material(
  2278. color: Colors.black12,
  2279. child: Center(
  2280. child: Container(
  2281. decoration: BoxDecoration(
  2282. borderRadius: BorderRadius.circular(16),
  2283. color: Colors.white,
  2284. ),
  2285. height: 207,
  2286. margin: EdgeInsets.symmetric(horizontal: 18),
  2287. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2288. child: Column(
  2289. children: [
  2290. Row(
  2291. children: [
  2292. Container(
  2293. decoration: BoxDecoration(
  2294. border: Border.all(color: MyColors.cEBEBEB, width: 1),
  2295. ),
  2296. child: SvgPicture.asset(
  2297. 'images/svg/支付商品.svg',
  2298. height: 28,
  2299. width: 28,
  2300. ),
  2301. height: 45,
  2302. width: 45,
  2303. alignment: Alignment.center,
  2304. ),
  2305. Container(
  2306. height: 45,
  2307. child: Column(
  2308. children: [
  2309. MyViews().myText(
  2310. '确认支付订单(${data.uid})', MyColors.c333333, 13),
  2311. MyViews()
  2312. .myText('¥${data.amount}', MyColors.cFF4233, 12),
  2313. ],
  2314. crossAxisAlignment: CrossAxisAlignment.start,
  2315. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2316. ),
  2317. margin: EdgeInsets.only(left: 10),
  2318. )
  2319. ],
  2320. ),
  2321. Container(
  2322. height: 0.5,
  2323. color: MyColors.cE7E7E7,
  2324. ),
  2325. Row(
  2326. children: [
  2327. MyViews().myText('付款人:', MyColors.c333333, 13),
  2328. Container(
  2329. child: ClipRRect(
  2330. child: MyViews().netImg(imgURL(data.buyerPic), 23, 23),
  2331. borderRadius: BorderRadius.circular(23),
  2332. ),
  2333. margin: EdgeInsets.symmetric(horizontal: 8),
  2334. ),
  2335. MyViews().myText(
  2336. '${data.buyerName}${data.buyerUid == 0 ? '' : "(${hideUID(data.buyerUid.toString())})"}',
  2337. MyColors.c333333,
  2338. 13),
  2339. ],
  2340. ),
  2341. Container(
  2342. height: 0.5,
  2343. color: MyColors.cE7E7E7,
  2344. ),
  2345. Row(
  2346. children: [
  2347. MyViews().myText('收款人:', MyColors.c333333, 13),
  2348. Container(
  2349. child: ClipRRect(
  2350. child: MyViews().netImg(imgURL(data.sellerPic), 23, 23),
  2351. borderRadius: BorderRadius.circular(23),
  2352. ),
  2353. margin: EdgeInsets.symmetric(horizontal: 8),
  2354. ),
  2355. MyViews().myText(
  2356. '${data.sellerName}${data.sellerUid == 0 ? '' : '(${hideUID(data.sellerUid.toString())})'}',
  2357. MyColors.c333333,
  2358. 13),
  2359. ],
  2360. ),
  2361. Container(
  2362. height: 0.5,
  2363. color: MyColors.cE7E7E7,
  2364. ),
  2365. Container(
  2366. margin: EdgeInsets.symmetric(horizontal: 10),
  2367. child: Row(
  2368. children: [
  2369. Expanded(
  2370. child: GestureDetector(
  2371. onTap: () {
  2372. Navigator.pop(context);
  2373. },
  2374. behavior: HitTestBehavior.translucent,
  2375. child: Container(
  2376. decoration: BoxDecoration(
  2377. borderRadius: BorderRadius.only(
  2378. topLeft: Radius.circular(20),
  2379. bottomLeft: Radius.circular(20),
  2380. ),
  2381. border: Border.all(
  2382. color: MyColors.cFF4233, width: 1.1),
  2383. color: Colors.white),
  2384. child: MyViews().myText('取消', MyColors.cFF4233, 14),
  2385. height: 40,
  2386. alignment: Alignment.center,
  2387. ),
  2388. ),
  2389. ),
  2390. Expanded(
  2391. child: GestureDetector(
  2392. behavior: HitTestBehavior.translucent,
  2393. onTap: onTap,
  2394. child: Container(
  2395. decoration: BoxDecoration(
  2396. borderRadius: BorderRadius.only(
  2397. topRight: Radius.circular(20),
  2398. bottomRight: Radius.circular(20),
  2399. ),
  2400. color: MyColors.cFF4233),
  2401. height: 40,
  2402. child: MyViews().myText('确定', Colors.white, 14),
  2403. alignment: Alignment.center,
  2404. ),
  2405. ),
  2406. )
  2407. ],
  2408. ),
  2409. )
  2410. ],
  2411. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2412. ),
  2413. ),
  2414. ),
  2415. );
  2416. },
  2417. );
  2418. }
  2419. showSimpleDialog(String content, BuildContext context, onTap) {
  2420. showDialog(
  2421. context: context,
  2422. builder: (BuildContext context) {
  2423. return Material(
  2424. color: Colors.black12,
  2425. child: Center(
  2426. child: Container(
  2427. decoration: BoxDecoration(
  2428. borderRadius: BorderRadius.circular(16),
  2429. color: Colors.white,
  2430. ),
  2431. height: 180,
  2432. margin: EdgeInsets.symmetric(horizontal: 18),
  2433. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2434. child: Column(
  2435. children: [
  2436. Expanded(
  2437. child: Center(
  2438. child: Container(
  2439. child: MyViews().myText(content, MyColors.c333333, 14),
  2440. margin: EdgeInsets.symmetric(horizontal: 20),
  2441. ),
  2442. ),
  2443. ),
  2444. Container(
  2445. height: 0.5,
  2446. color: MyColors.cE7E7E7,
  2447. margin: EdgeInsets.only(bottom: 12),
  2448. ),
  2449. Container(
  2450. margin: EdgeInsets.symmetric(horizontal: 10),
  2451. child: Row(
  2452. children: [
  2453. Expanded(
  2454. child: GestureDetector(
  2455. onTap: () {
  2456. Navigator.pop(context);
  2457. },
  2458. behavior: HitTestBehavior.translucent,
  2459. child: Container(
  2460. decoration: BoxDecoration(
  2461. borderRadius: BorderRadius.only(
  2462. topLeft: Radius.circular(20),
  2463. bottomLeft: Radius.circular(20),
  2464. ),
  2465. border: Border.all(
  2466. color: MyColors.cFF4233, width: 1.1),
  2467. color: Colors.white),
  2468. child: MyViews().myText('取消', MyColors.cFF4233, 14),
  2469. height: 40,
  2470. alignment: Alignment.center,
  2471. ),
  2472. ),
  2473. ),
  2474. Expanded(
  2475. child: GestureDetector(
  2476. behavior: HitTestBehavior.translucent,
  2477. onTap: onTap,
  2478. child: Container(
  2479. decoration: BoxDecoration(
  2480. borderRadius: BorderRadius.only(
  2481. topRight: Radius.circular(20),
  2482. bottomRight: Radius.circular(20),
  2483. ),
  2484. color: MyColors.cFF4233),
  2485. height: 40,
  2486. child: MyViews().myText('确定', Colors.white, 14),
  2487. alignment: Alignment.center,
  2488. ),
  2489. ),
  2490. )
  2491. ],
  2492. ),
  2493. )
  2494. ],
  2495. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2496. ),
  2497. ),
  2498. ),
  2499. );
  2500. },
  2501. );
  2502. }
  2503. updateDialog(AndroidAppVersionBeanData data, BuildContext context) {
  2504. bool startUpdate = false;
  2505. bool downloadCompleted = false;
  2506. String filePath = '';
  2507. int p = 0;
  2508. EventBus().off('允许安装');
  2509. EventBus().off('更新进度条');
  2510. showDialog(
  2511. context: context,
  2512. builder: (BuildContext context) {
  2513. return WillPopScope(
  2514. onWillPop: () {
  2515. return Future.value(false);
  2516. },
  2517. child: StreamBuilder<Object>(builder: (context, snapshot) {
  2518. return Material(
  2519. color: Colors.black12,
  2520. child: Center(
  2521. child: Container(
  2522. decoration: BoxDecoration(
  2523. borderRadius: BorderRadius.circular(16),
  2524. color: Colors.white,
  2525. ),
  2526. height: 165,
  2527. margin: EdgeInsets.symmetric(horizontal: 18),
  2528. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2529. child: StatefulBuilder(
  2530. builder: (BuildContext context,
  2531. void Function(void Function()) setState) {
  2532. EventBus().on('更新进度条', (arg) {
  2533. p = arg;
  2534. setState(() {});
  2535. });
  2536. EventBus().on('允许安装', (arg) {
  2537. downloadCompleted = true;
  2538. filePath = arg;
  2539. setState(() {});
  2540. });
  2541. if (startUpdate) {
  2542. return Column(
  2543. children: [
  2544. Container(
  2545. height: 88,
  2546. child: Column(
  2547. children: [
  2548. Container(
  2549. child: MyViews()
  2550. .myText('更新中...', MyColors.c333333, 16),
  2551. ),
  2552. SizedBox(
  2553. height: 15,
  2554. child: ClipRRect(
  2555. borderRadius: BorderRadius.circular(7.5),
  2556. child: LinearProgressIndicator(
  2557. backgroundColor: Colors.grey[200],
  2558. valueColor: AlwaysStoppedAnimation(
  2559. MyColors.cFF4233),
  2560. value: downloadCompleted
  2561. ? 1
  2562. : NumUtil.divide(p, 100),
  2563. ),
  2564. ),
  2565. ),
  2566. ],
  2567. mainAxisAlignment: MainAxisAlignment.spaceAround,
  2568. ),
  2569. ),
  2570. Container(
  2571. height: 0.5,
  2572. color: MyColors.cE7E7E7,
  2573. margin: EdgeInsets.only(bottom: 12),
  2574. ),
  2575. Container(
  2576. margin: EdgeInsets.symmetric(horizontal: 20),
  2577. child: GestureDetector(
  2578. behavior: HitTestBehavior.translucent,
  2579. onTap: () {
  2580. if (downloadCompleted) {
  2581. installApk(filePath);
  2582. }
  2583. },
  2584. child: Container(
  2585. decoration: BoxDecoration(
  2586. borderRadius: BorderRadius.circular(20),
  2587. color: downloadCompleted
  2588. ? MyColors.cFF4233
  2589. : MyColors.c999999),
  2590. height: 40,
  2591. child: MyViews().myText('安装', Colors.white, 14),
  2592. alignment: Alignment.center,
  2593. ),
  2594. ),
  2595. )
  2596. ],
  2597. mainAxisAlignment: MainAxisAlignment.center,
  2598. );
  2599. } else {
  2600. return Column(
  2601. children: [
  2602. Container(
  2603. height: 88,
  2604. child: MyViews().myText(
  2605. data.force
  2606. ? '检查到新版本(v${data.version}),本次属于强制更新,如不同意更新,将退出APP'
  2607. : '检查到新版本(v${data.version}),请问是否更新',
  2608. MyColors.c333333,
  2609. 14),
  2610. margin: EdgeInsets.symmetric(horizontal: 20),
  2611. alignment: Alignment.center,
  2612. ),
  2613. Container(
  2614. height: 0.5,
  2615. color: MyColors.cE7E7E7,
  2616. margin: EdgeInsets.only(bottom: 12),
  2617. ),
  2618. data.force
  2619. ? Expanded(
  2620. child: GestureDetector(
  2621. behavior: HitTestBehavior.translucent,
  2622. onTap: () {
  2623. if (Platform.isAndroid) {
  2624. downloadAPK(data, context);
  2625. startUpdate = true;
  2626. setState(() {});
  2627. } else if (Platform.isIOS) {
  2628. LaunchReview.launch(
  2629. writeReview: false,
  2630. iOSAppId: appStoreID);
  2631. } else {
  2632. Navigator.pop(context);
  2633. }
  2634. },
  2635. child: Container(
  2636. margin:
  2637. EdgeInsets.symmetric(horizontal: 10),
  2638. decoration: BoxDecoration(
  2639. borderRadius:
  2640. BorderRadius.circular(20),
  2641. color: MyColors.cFF4233),
  2642. height: 40,
  2643. child: MyViews()
  2644. .myText('立即更新', Colors.white, 14),
  2645. alignment: Alignment.center,
  2646. ),
  2647. ),
  2648. )
  2649. : Row(
  2650. children: [
  2651. Expanded(
  2652. child: GestureDetector(
  2653. onTap: () {
  2654. if (data.force) {
  2655. EventBus().off('允许安装');
  2656. EventBus().off('更新进度条');
  2657. SystemNavigator.pop();
  2658. } else {
  2659. EventBus().off('允许安装');
  2660. EventBus().off('更新进度条');
  2661. Navigator.pop(context);
  2662. }
  2663. },
  2664. behavior: HitTestBehavior.translucent,
  2665. child: Container(
  2666. margin: EdgeInsets.only(left: 10),
  2667. decoration: BoxDecoration(
  2668. borderRadius: BorderRadius.only(
  2669. topLeft: Radius.circular(20),
  2670. bottomLeft: Radius.circular(20),
  2671. ),
  2672. border: Border.all(
  2673. color: MyColors.cFF4233,
  2674. width: 1.1),
  2675. color: Colors.white),
  2676. child: MyViews().myText(
  2677. '暂不更新', MyColors.cFF4233, 14),
  2678. height: 40,
  2679. alignment: Alignment.center,
  2680. ),
  2681. ),
  2682. ),
  2683. Expanded(
  2684. child: GestureDetector(
  2685. behavior: HitTestBehavior.translucent,
  2686. onTap: () {
  2687. if (Platform.isAndroid) {
  2688. downloadAPK(data, context);
  2689. startUpdate = true;
  2690. setState(() {});
  2691. } else if (Platform.isIOS) {
  2692. LaunchReview.launch(
  2693. writeReview: false,
  2694. iOSAppId: appStoreID);
  2695. } else {
  2696. Navigator.pop(context);
  2697. }
  2698. },
  2699. child: Container(
  2700. margin: EdgeInsets.only(right: 10),
  2701. decoration: BoxDecoration(
  2702. borderRadius: BorderRadius.only(
  2703. topRight: Radius.circular(20),
  2704. bottomRight:
  2705. Radius.circular(20),
  2706. ),
  2707. color: MyColors.cFF4233),
  2708. height: 40,
  2709. child: MyViews()
  2710. .myText('立即更新', Colors.white, 14),
  2711. alignment: Alignment.center,
  2712. ),
  2713. ),
  2714. )
  2715. ],
  2716. )
  2717. ],
  2718. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2719. );
  2720. }
  2721. },
  2722. ),
  2723. ),
  2724. ),
  2725. );
  2726. }),
  2727. );
  2728. },
  2729. );
  2730. }
  2731. downloadAPK(AndroidAppVersionBeanData data, BuildContext context) async {
  2732. Directory storageDir = await getExternalStorageDirectory();
  2733. String storagePath = storageDir.path;
  2734. File file = new File(
  2735. '$storagePath/${PinyinHelper.getShortPinyin(MyCookie().packageInfo.appName)}.apk');
  2736. if (!file.existsSync()) {
  2737. file.createSync();
  2738. }
  2739. print(apkURL(data.download));
  2740. Dio().download(apkURL(data.download), file.path,
  2741. onReceiveProgress: (int count, int total) {
  2742. EventBus().emit('更新进度条', ((count / (data.size)) * 100).floor());
  2743. }).then((value) {
  2744. print('下载完成');
  2745. EventBus().emit('允许安装', file.path);
  2746. }).catchError((e) {
  2747. print(e);
  2748. Navigator.pop(context);
  2749. EventBus().off('允许安装');
  2750. EventBus().off('更新进度条');
  2751. EasyLoading.showToast('下载失败');
  2752. });
  2753. }
  2754. Widget advertisingItems(BuildContext context, AdBeanDataData data) {
  2755. double w = (MediaQuery.of(context).size.width - 47) / 2;
  2756. List<Color> colors = [
  2757. MyColors.cADD358,
  2758. MyColors.cFF4233,
  2759. MyColors.cFF88B4,
  2760. MyColors.cFFCD00
  2761. ];
  2762. List<String> types = ['投放中', '未付费', '已结束', '未投放'];
  2763. int typeIndex;
  2764. if (data.paid == false) {
  2765. typeIndex = 1;
  2766. } else {
  2767. var sT = DateTime.parse(data.startDate);
  2768. var eT = sT.add(Duration(days: data.days));
  2769. if (sT.isBefore(DateTime.now()) && eT.isAfter(DateTime.now())) {
  2770. typeIndex = 0;
  2771. } else if (sT.isAfter(DateTime.now())) {
  2772. typeIndex = 3;
  2773. } else if (eT.isBefore(DateTime.now())) {
  2774. typeIndex = 2;
  2775. }
  2776. }
  2777. return Card(
  2778. child: Column(
  2779. children: [
  2780. ClipRRect(
  2781. child: Container(
  2782. child: Stack(
  2783. children: [
  2784. MyViews().netImg(imgURL(data.coverPath), w, w,
  2785. placeholder: 'images/svg/goodsDefImg.svg'),
  2786. Positioned(
  2787. right: 0,
  2788. top: 5,
  2789. child: Container(
  2790. decoration: BoxDecoration(
  2791. color: colors[typeIndex],
  2792. borderRadius: BorderRadius.only(
  2793. topLeft: Radius.circular(7),
  2794. bottomLeft: Radius.circular(7),
  2795. ),
  2796. ),
  2797. height: 14,
  2798. width: 32,
  2799. child: MyViews().myText(types[typeIndex], Colors.white, 8),
  2800. alignment: Alignment.center,
  2801. ),
  2802. )
  2803. ],
  2804. ),
  2805. height: w,
  2806. width: w,
  2807. ),
  2808. borderRadius: BorderRadius.only(
  2809. topRight: Radius.circular(4), topLeft: Radius.circular(4)),
  2810. ),
  2811. Expanded(
  2812. child: Padding(
  2813. padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10),
  2814. child: Column(
  2815. children: [
  2816. Text(
  2817. data.title,
  2818. style: TextStyle(color: MyColors.c333333, fontSize: 12),
  2819. maxLines: 1,
  2820. overflow: TextOverflow.ellipsis,
  2821. softWrap: true,
  2822. ),
  2823. Text(
  2824. '发布时间:${data.createTime}',
  2825. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2826. maxLines: 1,
  2827. overflow: TextOverflow.ellipsis,
  2828. softWrap: true,
  2829. ),
  2830. Text(
  2831. '开始时间:${data.startDate}',
  2832. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2833. maxLines: 1,
  2834. overflow: TextOverflow.ellipsis,
  2835. softWrap: true,
  2836. ),
  2837. Text(
  2838. '结束时间:${DateTime.parse(data.startDate).add(Duration(days: data.days)).toString().substring(0, 10)}',
  2839. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2840. maxLines: 1,
  2841. overflow: TextOverflow.ellipsis,
  2842. softWrap: true,
  2843. ),
  2844. ],
  2845. crossAxisAlignment: CrossAxisAlignment.start,
  2846. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2847. ),
  2848. ),
  2849. )
  2850. ],
  2851. crossAxisAlignment: CrossAxisAlignment.start,
  2852. ),
  2853. );
  2854. }
  2855. Future<Null> installApk(String url) async {
  2856. InstallPlugin.installApk(url, MyCookie().packageInfo.packageName)
  2857. .then((result) {
  2858. print('install apk $result');
  2859. }).catchError((error) {
  2860. print('install apk error: $error');
  2861. });
  2862. }