my_views.dart 102 KB

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