my_views.dart 113 KB

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