my_views.dart 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660
  1. import 'dart:convert';
  2. import 'dart:io';
  3. import 'dart:math' as math;
  4. import 'package:bbyyy/beans/ad_bean_entity.dart';
  5. import 'package:bbyyy/beans/android_app_version_bean_entity.dart';
  6. import 'package:bbyyy/beans/flow_bean_entity.dart';
  7. import 'package:bbyyy/beans/goods_bean_entity.dart';
  8. import 'package:bbyyy/beans/my_shop_bean_entity.dart';
  9. import 'package:bbyyy/beans/smart_order_bean_entity.dart';
  10. import 'package:bbyyy/beans/store_bean_entity.dart';
  11. import 'package:bbyyy/beans/user_bean_entity.dart';
  12. import 'package:bbyyy/beans/user_vp_bean_entity.dart';
  13. import 'package:bbyyy/https/MyDio.dart';
  14. import 'package:bbyyy/https/my_request.dart';
  15. import 'package:bbyyy/https/url.dart';
  16. import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
  17. import 'package:bbyyy/my_tools/event_bus.dart';
  18. import 'package:bbyyy/my_tools/global.dart';
  19. import 'package:bbyyy/my_tools/my_colors.dart';
  20. import 'package:bbyyy/my_tools/my_cookie.dart';
  21. import 'package:bbyyy/my_tools/my_tools.dart';
  22. import 'package:bbyyy/paegs/gang_page/application_details_page/application_details_page.dart';
  23. import 'package:bbyyy/paegs/gang_page/gang_in_page/gang_in_page.dart';
  24. import 'package:bbyyy/paegs/mine_page/order_page/apply_for_compensation_page/apply_for_compensation_page.dart';
  25. import 'package:bbyyy/paegs/mine_page/privacy_protection_props_page/privacy_protection_props_page.dart';
  26. import 'package:bbyyy/paegs/product_details_page/product_details_page.dart';
  27. import 'package:bbyyy/paegs/release_goods_page/release_goods_page.dart';
  28. import 'package:cached_network_image/cached_network_image.dart';
  29. import 'package:dio/dio.dart';
  30. import 'package:flustars/flustars.dart';
  31. import 'package:flutter/cupertino.dart';
  32. import 'package:flutter/material.dart';
  33. import 'package:flutter/services.dart';
  34. import 'package:flutter_svg/svg.dart';
  35. import 'package:install_plugin/install_plugin.dart';
  36. import 'package:lpinyin/lpinyin.dart';
  37. import 'package:path_provider/path_provider.dart';
  38. import '../beans/complain_bean_entity.dart';
  39. import '../paegs/ad_details_page/ad_details_page.dart';
  40. import '../paegs/other_people_s_turnover_page/other_people_s_turnover_page.dart';
  41. import '../paegs/pay_page/pay_page.dart';
  42. import 'const.dart';
  43. import 'dims.dart';
  44. class MyViews {
  45. Widget netImg(String path, double h, double w,
  46. {String placeholder = 'images/svg/缺省头像.svg'}) {
  47. return CachedNetworkImage(
  48. imageUrl: path,
  49. height: h,
  50. width: w,
  51. fit: BoxFit.cover,
  52. placeholder: (context, url) => SvgPicture.asset(
  53. placeholder,
  54. fit: BoxFit.cover,
  55. height: h,
  56. width: w,
  57. ),
  58. errorWidget: (context, url, error) => SvgPicture.asset(
  59. placeholder,
  60. height: h,
  61. fit: BoxFit.cover,
  62. width: w,
  63. ),
  64. );
  65. }
  66. Widget myText(String content, Color color, double fs, {double height = 1.4}) {
  67. return Text(
  68. content,
  69. style: TextStyle(color: color, fontSize: fs, height: height),
  70. );
  71. }
  72. Widget myAppBar(String title, BuildContext context, List<Widget> rW) {
  73. return Container(
  74. color: Colors.white,
  75. child: SafeArea(
  76. bottom: false,
  77. child: Container(
  78. height: 45,
  79. width: double.infinity,
  80. color: Colors.white,
  81. child: Stack(
  82. children: [
  83. Text(
  84. title,
  85. style: TextStyle(color: MyColors.c333333, fontSize: 16),
  86. ),
  87. Positioned(
  88. left: 0,
  89. child: GestureDetector(
  90. onTap: () {
  91. Navigator.pop(context);
  92. },
  93. behavior: HitTestBehavior.translucent,
  94. child: Transform.rotate(
  95. angle: math.pi,
  96. child: Padding(
  97. padding: EdgeInsets.only(
  98. left: 16, right: 16, top: 8, bottom: 8),
  99. child: SvgPicture.asset(
  100. 'images/svg/箭头.svg',
  101. color: MyColors.c333333,
  102. height: 14,
  103. ),
  104. ),
  105. ),
  106. ),
  107. ),
  108. Row(
  109. children: rW,
  110. mainAxisAlignment: MainAxisAlignment.end,
  111. )
  112. ],
  113. alignment: Alignment.center,
  114. ),
  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(
  235. height: 20,
  236. ),
  237. borderRadius: BorderRadius.all(Radius.circular(10)),
  238. ),
  239. Expanded(
  240. child: Container(
  241. margin: EdgeInsets.only(right: 5, left: 5),
  242. child: Text(
  243. '',
  244. style: TextStyle(
  245. color: MyColors.c999999,
  246. fontSize: 10,
  247. ),
  248. maxLines: 1,
  249. overflow: TextOverflow.ellipsis,
  250. softWrap: true,
  251. ),
  252. ),
  253. ),
  254. ],
  255. ),
  256. ),
  257. MyViews().netImg(imgURL(data.coverPath), w, w,
  258. placeholder: 'images/svg/goodsDefImg.svg'),
  259. Container(
  260. padding: EdgeInsets.only(right: 6, left: 6, top: 8),
  261. child: Text(
  262. '${data.title}\n${data.description}',
  263. style: TextStyle(color: Colors.black, fontSize: 12),
  264. maxLines: 1,
  265. overflow: TextOverflow.ellipsis,
  266. softWrap: true,
  267. ),
  268. ),
  269. Container(
  270. padding: EdgeInsets.only(right: 6, top: 7),
  271. child: Row(
  272. children: [
  273. Container(
  274. decoration: BoxDecoration(
  275. color: MyColors.cADD358,
  276. borderRadius: BorderRadius.only(
  277. topRight: Radius.circular(8),
  278. bottomRight: Radius.circular(8),
  279. ),
  280. ),
  281. height: 16,
  282. width: 32,
  283. child: myText('推广', Colors.white, 9),
  284. alignment: Alignment.center,
  285. ),
  286. Container(
  287. child: Text(
  288. '详情',
  289. style: TextStyle(color: MyColors.cFF4233, fontSize: 12),
  290. ),
  291. alignment: Alignment.center,
  292. padding: EdgeInsets.only(bottom: 2),
  293. decoration: BoxDecoration(
  294. border: Border.all(color: MyColors.cFF4233, width: 1),
  295. borderRadius: BorderRadius.all(Radius.circular(10))),
  296. height: 20,
  297. width: 50,
  298. )
  299. ],
  300. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  301. ),
  302. )
  303. ],
  304. crossAxisAlignment: CrossAxisAlignment.start,
  305. ),
  306. ),
  307. );
  308. }
  309. }
  310. Widget getNoPayGoodsItem(
  311. SmartOrderBeanDataData data, BuildContext context, int ownerUid) {
  312. return Container(
  313. margin: EdgeInsets.only(bottom: 10),
  314. decoration: BoxDecoration(
  315. color: Colors.white,
  316. borderRadius: BorderRadius.all(
  317. Radius.circular(4),
  318. ),
  319. ),
  320. child: Column(
  321. children: [
  322. Container(
  323. margin: EdgeInsets.only(left: 10, top: 16),
  324. child: Row(
  325. children: [
  326. ClipRRect(
  327. child: data.type == orderTypeAnnualFee || data.sellerUid == 0
  328. ? Image.asset(
  329. 'images/app_logo.png',
  330. height: 25,
  331. width: 25,
  332. )
  333. : MyViews().netImg(imgURL(data.sellerPic), 25, 25),
  334. borderRadius: BorderRadius.all(Radius.circular(12.5)),
  335. ),
  336. Container(
  337. margin: EdgeInsets.only(right: 5, left: 5),
  338. child: Text(
  339. data.type == orderTypeAnnualFee || data.sellerUid == 0
  340. ? '$appName'
  341. : '${data.sellerName}(${data.sellerUid})',
  342. style: TextStyle(
  343. color: MyColors.c333333,
  344. fontSize: 14,
  345. ),
  346. maxLines: 1,
  347. overflow: TextOverflow.ellipsis,
  348. softWrap: true,
  349. ),
  350. ),
  351. ],
  352. ),
  353. ),
  354. Container(
  355. height: 0.5,
  356. color: MyColors.cE7E7E7,
  357. margin: EdgeInsets.only(left: 10, right: 10, top: 11, bottom: 11),
  358. ),
  359. orderStyle(data),
  360. Container(
  361. height: 0.5,
  362. color: MyColors.cE7E7E7,
  363. margin: EdgeInsets.only(left: 10, right: 10, top: 11, bottom: 11),
  364. ),
  365. Container(
  366. padding: EdgeInsets.only(left: 10, right: 10, bottom: 11),
  367. child: Row(
  368. children: [
  369. Text(
  370. '下单时间:${data.createTime}',
  371. style: TextStyle(color: MyColors.c666666, fontSize: 11),
  372. ),
  373. GestureDetector(
  374. onTap: () {
  375. if (data.buyerName.contains(MyCookie().getName()) ||
  376. MyCookie().getName().contains(data.buyerName) ||
  377. MyCookie().getUID() == ownerUid) {
  378. showPayDialog(data, context, () {
  379. Navigator.pop(context);
  380. MyTools().toPage(context,
  381. PayPage(data.uid, false, data.amount), (then) {});
  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(
  1069. '第三方订单(${data.uid})', 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()
  1585. .myText('付款人:${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>(builder: (context, snapshot) {
  2327. return Material(
  2328. color: Colors.black12,
  2329. child: Center(
  2330. child: Container(
  2331. decoration: BoxDecoration(
  2332. borderRadius: BorderRadius.circular(16),
  2333. color: Colors.white,
  2334. ),
  2335. height: 165,
  2336. margin: EdgeInsets.symmetric(horizontal: 18),
  2337. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
  2338. child: StatefulBuilder(
  2339. builder: (BuildContext context,
  2340. void Function(void Function()) setState) {
  2341. EventBus().on('更新进度条', (arg) {
  2342. p = arg;
  2343. setState(() {});
  2344. });
  2345. EventBus().on('允许安装', (arg) {
  2346. downloadCompleted = true;
  2347. filePath = arg;
  2348. setState(() {});
  2349. });
  2350. if (startUpdate) {
  2351. return Column(
  2352. children: [
  2353. Container(
  2354. height: 88,
  2355. child: Column(
  2356. children: [
  2357. Container(
  2358. child: MyViews()
  2359. .myText('更新中...', MyColors.c333333, 16),
  2360. ),
  2361. SizedBox(
  2362. height: 15,
  2363. child: ClipRRect(
  2364. borderRadius: BorderRadius.circular(7.5),
  2365. child: LinearProgressIndicator(
  2366. backgroundColor: Colors.grey[200],
  2367. valueColor: AlwaysStoppedAnimation(
  2368. MyColors.cFF4233),
  2369. value: downloadCompleted
  2370. ? 1
  2371. : NumUtil.divide(p, 100),
  2372. ),
  2373. ),
  2374. ),
  2375. ],
  2376. mainAxisAlignment: MainAxisAlignment.spaceAround,
  2377. ),
  2378. ),
  2379. Container(
  2380. height: 0.5,
  2381. color: MyColors.cE7E7E7,
  2382. margin: EdgeInsets.only(bottom: 12),
  2383. ),
  2384. Container(
  2385. margin: EdgeInsets.symmetric(horizontal: 20),
  2386. child: GestureDetector(
  2387. behavior: HitTestBehavior.translucent,
  2388. onTap: () {
  2389. if (downloadCompleted) {
  2390. installApk(filePath);
  2391. }
  2392. },
  2393. child: Container(
  2394. decoration: BoxDecoration(
  2395. borderRadius: BorderRadius.circular(20),
  2396. color: downloadCompleted
  2397. ? MyColors.cFF4233
  2398. : MyColors.c999999),
  2399. height: 40,
  2400. child: MyViews().myText('安装', Colors.white, 14),
  2401. alignment: Alignment.center,
  2402. ),
  2403. ),
  2404. )
  2405. ],
  2406. mainAxisAlignment: MainAxisAlignment.center,
  2407. );
  2408. } else {
  2409. return Column(
  2410. children: [
  2411. Container(
  2412. height: 88,
  2413. child: MyViews().myText(
  2414. data.force ? '检查到新版本,请更新' : '检查到新版本,请问是否更新',
  2415. MyColors.c333333,
  2416. 14),
  2417. margin: EdgeInsets.symmetric(horizontal: 20),
  2418. alignment: Alignment.center,
  2419. ),
  2420. Container(
  2421. height: 0.5,
  2422. color: MyColors.cE7E7E7,
  2423. margin: EdgeInsets.only(bottom: 12),
  2424. ),
  2425. Container(
  2426. margin: EdgeInsets.symmetric(horizontal: 10),
  2427. child: Row(
  2428. children: [
  2429. Expanded(
  2430. child: GestureDetector(
  2431. onTap: () {
  2432. if (data.force) {
  2433. EventBus().off('允许安装');
  2434. EventBus().off('更新进度条');
  2435. SystemNavigator.pop();
  2436. } else {
  2437. EventBus().off('允许安装');
  2438. EventBus().off('更新进度条');
  2439. Navigator.pop(context);
  2440. }
  2441. },
  2442. behavior: HitTestBehavior.translucent,
  2443. child: Container(
  2444. decoration: BoxDecoration(
  2445. borderRadius: BorderRadius.only(
  2446. topLeft: Radius.circular(20),
  2447. bottomLeft: Radius.circular(20),
  2448. ),
  2449. border: Border.all(
  2450. color: MyColors.cFF4233,
  2451. width: 1.1),
  2452. color: Colors.white),
  2453. child: MyViews()
  2454. .myText('暂不更新', MyColors.cFF4233, 14),
  2455. height: 40,
  2456. alignment: Alignment.center,
  2457. ),
  2458. ),
  2459. ),
  2460. Expanded(
  2461. child: GestureDetector(
  2462. behavior: HitTestBehavior.translucent,
  2463. onTap: () {
  2464. downloadAPK(data, context);
  2465. startUpdate = true;
  2466. setState(() {});
  2467. },
  2468. child: Container(
  2469. decoration: BoxDecoration(
  2470. borderRadius: BorderRadius.only(
  2471. topRight: Radius.circular(20),
  2472. bottomRight: Radius.circular(20),
  2473. ),
  2474. color: MyColors.cFF4233),
  2475. height: 40,
  2476. child: MyViews()
  2477. .myText('立即更新', Colors.white, 14),
  2478. alignment: Alignment.center,
  2479. ),
  2480. ),
  2481. )
  2482. ],
  2483. ),
  2484. )
  2485. ],
  2486. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2487. );
  2488. }
  2489. },
  2490. ),
  2491. ),
  2492. ),
  2493. );
  2494. });
  2495. },
  2496. );
  2497. }
  2498. downloadAPK(AndroidAppVersionBeanData data, BuildContext context) async {
  2499. Directory storageDir = await getExternalStorageDirectory();
  2500. String storagePath = storageDir.path;
  2501. File file = new File(
  2502. '$storagePath/${PinyinHelper.getShortPinyin(MyCookie().packageInfo.appName)}.apk');
  2503. if (!file.existsSync()) {
  2504. file.createSync();
  2505. }
  2506. print(apkURL(data.download));
  2507. Dio().download(apkURL(data.download), file.path,
  2508. onReceiveProgress: (int count, int total) {
  2509. EventBus().emit('更新进度条', ((count / (data.size)) * 100).floor());
  2510. }).then((value) {
  2511. print('下载完成');
  2512. EventBus().emit('允许安装', file.path);
  2513. }).catchError((e) {
  2514. print(e);
  2515. Navigator.pop(context);
  2516. EventBus().off('允许安装');
  2517. EventBus().off('更新进度条');
  2518. EasyLoading.showToast('下载失败');
  2519. });
  2520. }
  2521. Widget advertisingItems(BuildContext context, AdBeanDataData data) {
  2522. double w = (MediaQuery.of(context).size.width - 47) / 2;
  2523. List<Color> colors = [
  2524. MyColors.cADD358,
  2525. MyColors.cFF4233,
  2526. MyColors.cFF88B4,
  2527. MyColors.cFFCD00
  2528. ];
  2529. List<String> types = ['投放中', '未付费', '已结束', '未投放'];
  2530. int typeIndex;
  2531. if (data.paid == false) {
  2532. typeIndex = 1;
  2533. } else {
  2534. var sT = DateTime.parse(data.startDate);
  2535. var eT = sT.add(Duration(days: data.days));
  2536. if (sT.isBefore(DateTime.now()) && eT.isAfter(DateTime.now())) {
  2537. typeIndex = 0;
  2538. } else if (sT.isAfter(DateTime.now())) {
  2539. typeIndex = 3;
  2540. } else if (eT.isBefore(DateTime.now())) {
  2541. typeIndex = 2;
  2542. }
  2543. }
  2544. return Card(
  2545. child: Column(
  2546. children: [
  2547. ClipRRect(
  2548. child: Container(
  2549. child: Stack(
  2550. children: [
  2551. MyViews().netImg(imgURL(data.coverPath), w, w,
  2552. placeholder: 'images/svg/goodsDefImg.svg'),
  2553. Positioned(
  2554. right: 0,
  2555. top: 5,
  2556. child: Container(
  2557. decoration: BoxDecoration(
  2558. color: colors[typeIndex],
  2559. borderRadius: BorderRadius.only(
  2560. topLeft: Radius.circular(7),
  2561. bottomLeft: Radius.circular(7),
  2562. ),
  2563. ),
  2564. height: 14,
  2565. width: 32,
  2566. child: MyViews().myText(types[typeIndex], Colors.white, 8),
  2567. alignment: Alignment.center,
  2568. ),
  2569. )
  2570. ],
  2571. ),
  2572. height: w,
  2573. width: w,
  2574. ),
  2575. borderRadius: BorderRadius.only(
  2576. topRight: Radius.circular(4), topLeft: Radius.circular(4)),
  2577. ),
  2578. Expanded(
  2579. child: Padding(
  2580. padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 10),
  2581. child: Column(
  2582. children: [
  2583. Text(
  2584. data.title,
  2585. style: TextStyle(color: MyColors.c333333, fontSize: 12),
  2586. maxLines: 1,
  2587. overflow: TextOverflow.ellipsis,
  2588. softWrap: true,
  2589. ),
  2590. Text(
  2591. '发布时间:${data.createTime}',
  2592. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2593. maxLines: 1,
  2594. overflow: TextOverflow.ellipsis,
  2595. softWrap: true,
  2596. ),
  2597. Text(
  2598. '开始时间:${data.startDate}',
  2599. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2600. maxLines: 1,
  2601. overflow: TextOverflow.ellipsis,
  2602. softWrap: true,
  2603. ),
  2604. Text(
  2605. '结束时间:${DateTime.parse(data.startDate).add(Duration(days: data.days)).toString().substring(0, 10)}',
  2606. style: TextStyle(color: MyColors.c999999, fontSize: 9),
  2607. maxLines: 1,
  2608. overflow: TextOverflow.ellipsis,
  2609. softWrap: true,
  2610. ),
  2611. ],
  2612. crossAxisAlignment: CrossAxisAlignment.start,
  2613. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  2614. ),
  2615. ),
  2616. )
  2617. ],
  2618. crossAxisAlignment: CrossAxisAlignment.start,
  2619. ),
  2620. );
  2621. }
  2622. Future<Null> installApk(String url) async {
  2623. InstallPlugin.installApk(url, MyCookie().packageInfo.packageName)
  2624. .then((result) {
  2625. print('install apk $result');
  2626. }).catchError((error) {
  2627. print('install apk error: $error');
  2628. });
  2629. }