my_views.dart 102 KB

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