my_views.dart 102 KB

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