|
|
@ -29,11 +29,34 @@ class WebContent extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
|
|
class _WebContent extends State<WebContent> { |
|
|
|
class _WebContent extends State<WebContent> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
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 = "<a storeName=\"${storeName}\" storeId=\"${storeId}\" tenantCode=\"${tenantCode}\" href=\"/\">${cnt}</a>"; |
|
|
|
|
|
|
|
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 = "<img src=\"${cnt}\" storeName=\"${storeName}\" storeId=\"${storeId}\" tenantCode=\"${tenantCode}\" />"; |
|
|
|
|
|
|
|
htmlCnt = htmlCnt.replaceAll(element.group(0), textCnt); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
return Html( |
|
|
|
return Html( |
|
|
|
data: (widget.activity?.content??widget.article?.content??"")+"<a storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" href=\"/\">立即购买</a><img storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" src=\"https://pos.upload.gznl.top/MDAwMA==/2021/12/6edfe416-aaf9-4f0e-b2a4-4dc85db03489.jpg\" />", |
|
|
|
data: htmlCnt, |
|
|
|
|
|
|
|
// + "<a storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" href=\"/\">立即购买</a><img storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" src=\"https://pos.upload.gznl.top/MDAwMA==/2021/12/6edfe416-aaf9-4f0e-b2a4-4dc85db03489.jpg\" />", |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
"html": Style( |
|
|
|
"html": Style( |
|
|
|
backgroundColor: Colors.white |
|
|
|
backgroundColor: Colors.white |
|
|
|