my_views.dart 121 KB

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