my_views.dart 102 KB

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