my_views.dart 121 KB

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