From aed786989786ecba6e37a4fd4b0467706038019a Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Fri, 24 Dec 2021 16:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0html=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=82=B9=E5=87=BB=E8=B7=B3=E8=BD=AC,=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=AD=A3=E5=88=99=E8=A1=A8=E8=BE=BE=E5=BC=8F:ubb=20?= =?UTF-8?q?=E8=BD=AC=20html=20,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../headlines/headlines_collection.dart | 2 +- lib/retrofit/min_api.dart | 8 ++++-- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 8 +++--- lib/retrofit/retrofit_api.g.dart | 2 +- lib/union/union_page.dart | 4 +-- lib/web/web_view/web_content.dart | 27 +++++++++++++++++-- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/lib/community/headlines/headlines_collection.dart b/lib/community/headlines/headlines_collection.dart index 07c48dfe..77ae7f4d 100644 --- a/lib/community/headlines/headlines_collection.dart +++ b/lib/community/headlines/headlines_collection.dart @@ -107,7 +107,7 @@ class _HeadlinesCollection extends State { Container( margin: EdgeInsets.only(right:4), padding:EdgeInsets.only(left:2,right:2), - height: 16.h, + height:22.h, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 3ee52d73..5b7f9a02 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,8 +21,8 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -32,6 +32,10 @@ const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +const base_url = "http://192.168.10.142:8765/app/";///詹云久 +const baseUrl = "http://192.168.10.142:8765/app/";///詹云久 + + // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 02d9988a..ef360ca1 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.142:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index cf056f6e..fc8414cb 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -53,8 +53,8 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -66,8 +66,8 @@ const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const baseUrl = "http://192.168.10.37:8766/app/"; -// const base_url = "http://192.168.10.142:8766/app/";///詹云久 -// const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 +const base_url = "http://192.168.10.142:8766/app/";///詹云久 +const baseUrl = "http://192.168.10.142:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index d1a64c02..0adf7d45 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.142:8766/app/'; } final Dio _dio; diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 47d25624..26ae3486 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -454,7 +454,7 @@ class _UnionPage extends State Expanded( flex: 1, child: Container( - height: 100.h, + // height: 100.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.end, @@ -610,7 +610,7 @@ class _UnionPage extends State return AlertDialog( content: Container( width: MediaQuery.of(context).size.width - 84, - height: 110.h, + height: 130.h, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 12c66f9c..16227c23 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -29,11 +29,34 @@ class WebContent extends StatefulWidget { class _WebContent extends State { - @override Widget build(BuildContext context) { + var htmlCnt = widget.activity?.content??widget.article?.content??""; + var regex = RegExp("\\[jump.*?\\].*?\\[/jump\\]"); + var match = regex.allMatches(htmlCnt); + if(match.length > 0){ + match.forEach((element) { + var viewType = RegExp("viewType=\"(.+?)\"").firstMatch(element.group(0)).group(1); + if(viewType == "text"){ + var cnt = RegExp("\\](.*?)\\[").firstMatch(element.group(0)).group(1); + var storeId = RegExp("storeId=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var storeName = RegExp("storeName=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var tenantCode = RegExp("tenantCode=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var textCnt = "${cnt}"; + htmlCnt = htmlCnt.replaceAll(element.group(0), textCnt); + }else if(viewType == "img"){ + var cnt = RegExp("\\](.*?)\\[").firstMatch(element.group(0)).group(1); + var storeId = RegExp("storeId=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var storeName = RegExp("storeName=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var tenantCode = RegExp("tenantCode=\"(.+?)\"").firstMatch(element.group(0)).group(1); + var textCnt = ""; + htmlCnt = htmlCnt.replaceAll(element.group(0), textCnt); + } + }); + } return Html( - data: (widget.activity?.content??widget.article?.content??"")+"立即购买", + data: htmlCnt, + // + "立即购买", style: { "html": Style( backgroundColor: Colors.white