|
@@ -163,7 +163,7 @@
|
|
<!-- 图文介绍 -->
|
|
<!-- 图文介绍 -->
|
|
<view v-if="description" class="wrap-descriptiontwo">
|
|
<view v-if="description" class="wrap-descriptiontwo">
|
|
<view style="padding: 36rpx 24rpx 36rpx;">图文介绍</view>
|
|
<view style="padding: 36rpx 24rpx 36rpx;">图文介绍</view>
|
|
- <view v-html="description">{{description}} </view>
|
|
|
|
|
|
+ <u-parse :content="description" :selectable="true"></u-parse>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -226,6 +226,7 @@
|
|
import env from '../../config/env.js'
|
|
import env from '../../config/env.js'
|
|
import $http from '@/utils/request.js'
|
|
import $http from '@/utils/request.js'
|
|
import ActivityHelp from '@/components/activity-help/activity-help.vue'
|
|
import ActivityHelp from '@/components/activity-help/activity-help.vue'
|
|
|
|
+ import { formatRichText } from '@/utils/util.js'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
ActivityHelp
|
|
ActivityHelp
|
|
@@ -302,10 +303,20 @@
|
|
})
|
|
})
|
|
this.awardsList = awardsList
|
|
this.awardsList = awardsList
|
|
// 处理富文本
|
|
// 处理富文本
|
|
|
|
+ // #ifndef MP-ALIPAY
|
|
const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
|
|
const description = res.data.description.replaceAll(".jpg\"", ".jpg?imageView2/2/w/750\"")
|
|
.replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
|
|
.replaceAll(".jpeg\"", ".jpeg?imageView2/2/w/750\"").replaceAll(".png\"",
|
|
".png?imageView2/2/w/750\"");
|
|
".png?imageView2/2/w/750\"");
|
|
- this.description = this.formatRichText(description);
|
|
|
|
|
|
+ this.description = formatRichText(description);
|
|
|
|
+ // #endif
|
|
|
|
+
|
|
|
|
+ // #ifdef MP-ALIPAY
|
|
|
|
+ res.data.description.split(".jpg\"").join(".jpg?imageView2/2/w/750\"")
|
|
|
|
+ res.data.description.split(".jpeg\"").join(".jpeg?imageView2/2/w/750\"")
|
|
|
|
+ res.data.description.split(".png\"").join(".png?imageView2/2/w/750\"")
|
|
|
|
+ this.description = formatRichText(res.data.description);
|
|
|
|
+ // #endif
|
|
|
|
+
|
|
let timestamp = parseInt(new Date().getTime())
|
|
let timestamp = parseInt(new Date().getTime())
|
|
this.activityTime = this.info.endTime - timestamp
|
|
this.activityTime = this.info.endTime - timestamp
|
|
this.activityTimeTwo = this.info.startTime - timestamp
|
|
this.activityTimeTwo = this.info.startTime - timestamp
|
|
@@ -362,33 +373,6 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 处理富文本里的图片宽度自适应
|
|
|
|
- * 1.去掉img标签里的style、width、height属性
|
|
|
|
- * 2.img标签添加style属性:max-width:100%;height:auto
|
|
|
|
- * 3.修改所有style里的width属性为max-width:100%
|
|
|
|
- * 4.去掉<br/>标签
|
|
|
|
- * @param html
|
|
|
|
- * @returns {void|string|*}
|
|
|
|
- */
|
|
|
|
- formatRichText(html) { //控制小程序中图片大小
|
|
|
|
- let newContent = html.replace(/<img[^>]*>/gi, function(match, capture) {
|
|
|
|
- match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
|
|
|
|
- match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
|
|
|
|
- match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
|
|
|
|
- return match;
|
|
|
|
- });
|
|
|
|
- newContent = newContent.replace(/style="[^"]+"/gi, function(match, capture) {
|
|
|
|
- match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
|
|
|
|
- 'max-width:100%;');
|
|
|
|
- return match;
|
|
|
|
- });
|
|
|
|
- newContent = newContent.replace(/<br[^>]*\/>/gi, '');
|
|
|
|
- newContent = newContent.replace(/\<img/gi,
|
|
|
|
- '<img style="max-width:100%;height:auto;font-size: 0;margin-top: -5px;"');
|
|
|
|
- return newContent;
|
|
|
|
- },
|
|
|
|
getBaseInfo() {
|
|
getBaseInfo() {
|
|
$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
|
|
$http.post('/api/v1/mp/user/getLoginUserinfo', {}).then(res => {
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|