This commit is contained in:
Sliverber 2024-07-01 18:04:59 +08:00
parent d6d60bac0d
commit e166cdcbfe
3 changed files with 969 additions and 586 deletions

View File

@ -17,7 +17,7 @@
userinfo: {}, userinfo: {},
areaInfo: {}, areaInfo: {},
content: '', content: '',
title:'' title: ''
} }
}, },
onLoad(options) { onLoad(options) {
@ -28,7 +28,9 @@
// //
this.title = title this.title = title
this.content = content this.content = content
this.insertPhoneNumberAndDate() this.content = this.replaceImgWithImage(this.content);
// this.insertPhoneNumberAndDate()
console.log(this.content, 'this.contentthis.contentthis.contentthis.content');
} }
}, },
@ -39,7 +41,8 @@
this.$u.get(`/app/article/list?areaId=${id}&tag=agreement`).then((res) => { this.$u.get(`/app/article/list?areaId=${id}&tag=agreement`).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.info = res.rows[0]; this.info = res.rows[0];
this.insertPhoneNumberAndDate(); this.content = this.replaceImgWithImage(this.info.content);
} else { } else {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
@ -50,10 +53,18 @@
}); });
}, },
insertPhoneNumberAndDate() { replaceImgWithImage(content) {
//   \u00A0 //   \u00A0
this.content = this.content.replace(/ /g, '\u00A0'); content = content.replace(/ /g, '\u00A0');
// <img>
content = content.replace(/<img([^>]*)>/g, (match, group1) => {
//
let cleanedGroup = group1.replace(/\s*\/$/, '');
return `<img ${cleanedGroup} style="width: 350rpx; height: auto;" />`;
});
return content;
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@
总营收 <span style="color: #4C97E7;">{{info.income.totalIncome}}</span> 总营收 <span style="color: #4C97E7;">{{info.income.totalIncome}}</span>
</view> </view>
<view class="info_li"> <view class="info_li">
累计待支付 <span style="color: #4C97E7;">{{info.income.totalIncome}}</span> 累计待支付 <span style="color: #4C97E7;">{{info.income.totalUnpaid}}</span>
</view> </view>
</view> </view>
<view class="info"> <view class="info">