Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
cf149e8c
Commit
cf149e8c
authored
Oct 29, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed
parent
c03517f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
goodDetail.vue
v3/goodDetail/goodDetail.vue
+21
-2
No files found.
v3/goodDetail/goodDetail.vue
View file @
cf149e8c
...
@@ -49,7 +49,8 @@
...
@@ -49,7 +49,8 @@
<view
class=
"detail-section"
>
<view
class=
"detail-section"
>
<text
class=
"detail-title"
>
详情信息
</text>
<text
class=
"detail-title"
>
详情信息
</text>
<view
class=
"detail-banner"
v-if=
"goodsData.goodsContent"
>
<view
class=
"detail-banner"
v-if=
"goodsData.goodsContent"
>
<rich-text
class=
"banner-text"
:nodes=
"goodsData.goodsContent"
></rich-text>
<rich-text
style=
"width: 100%; /* 或设置为具体的像素值 */ overflow-x: hidden;"
class=
"banner-text"
:nodes=
"formatRichText(goodsData.goodsContent)"
></rich-text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -84,7 +85,8 @@
...
@@ -84,7 +85,8 @@
<text
v-else
class=
"image-placeholder"
>
商品图片
</text>
<text
v-else
class=
"image-placeholder"
>
商品图片
</text>
</view>
</view>
<view
class=
"product-details"
>
<view
class=
"product-details"
>
<text
class=
"product-points"
>
{{
goodsData
.
points
}}{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
<text
class=
"product-points"
>
{{
goodsData
.
points
}}{{
goodsData
.
creditsTypeName
||
'积分'
}}
</text>
<text
class=
"product-stock"
>
库存
{{
formatCount
(
goodsData
.
exchangeCount
)
}}
件
</text>
<text
class=
"product-stock"
>
库存
{{
formatCount
(
goodsData
.
exchangeCount
)
}}
件
</text>
</view>
</view>
</view>
</view>
...
@@ -597,6 +599,23 @@ export default {
...
@@ -597,6 +599,23 @@ export default {
};
};
return
levelMap
[
memberLevelName
]
||
1
;
return
levelMap
[
memberLevelName
]
||
1
;
},
},
// 富文本格式化处理函数
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;display:block;margin-top:0;margin-bottom:0;"'
);
return
newContent
;
},
// 根据等级数字获取等级名称
// 根据等级数字获取等级名称
getUserLevelName
(
level
)
{
getUserLevelName
(
level
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment