配置全局变量
This commit is contained in:
+9
-9
@@ -49,15 +49,15 @@ Page({
|
||||
const reg = new RegExp("<p>","g")
|
||||
const reg1 = new RegExp("</p>","g")
|
||||
if(res.result.records && res.result.records.length){
|
||||
res.result.records.forEach(item=>{
|
||||
item.msgContent = item.msgContent.replace(reg,"")
|
||||
item.msgContent = item.msgContent.replace(reg1,"")
|
||||
const startIndex = item.msgContent.indexOf("<a")
|
||||
const endIndex = item.msgContent.lastIndexOf("</a>")
|
||||
if(startIndex > -1 && endIndex > -1 ){
|
||||
item.msgContent = item.msgContent.substring(0, startIndex) + item.msgContent.slice(endIndex + 4) + '点击报名'
|
||||
}
|
||||
})
|
||||
// res.result.records.forEach(item=>{
|
||||
// item.msgContent = item.msgContent.replace(reg,"")
|
||||
// item.msgContent = item.msgContent.replace(reg1,"")
|
||||
// const startIndex = item.msgContent.indexOf("<a")
|
||||
// const endIndex = item.msgContent.lastIndexOf("</a>")
|
||||
// if(startIndex > -1 && endIndex > -1 ){
|
||||
// item.msgContent = item.msgContent.substring(0, startIndex) + item.msgContent.slice(endIndex + 4) + '点击报名'
|
||||
// }
|
||||
// })
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
})
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</view>
|
||||
<text class="content-time">{{item.sendTime}}</text>
|
||||
</view>
|
||||
<text class="content-bottom">{{item.msgContent}}</text>
|
||||
<rich-text class="content-bottom" nodes="{{item.msgContent}}"></rich-text>
|
||||
<text class="status" wx:if="{{item.readFlag == 0}}"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user