my_views.dart 110 KB

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