Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
sso-equity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 642ee55e
authored
Dec 08, 2021
by
李长胜
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
处理测试环境售后详情image不显示问题
1 parent
f9082d39
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
14 deletions
src/utils/util.js
src/views/sale/detail.vue
src/utils/util.js
View file @
642ee55
...
...
@@ -2,7 +2,7 @@
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date
.
prototype
.
format
=
function
(
fmt
)
{
Date
.
prototype
.
format
=
function
(
fmt
)
{
let
o
=
{
'M+'
:
this
.
getMonth
()
+
1
,
//月份
'd+'
:
this
.
getDate
(),
//日
...
...
@@ -24,27 +24,46 @@ Date.prototype.format = function(fmt) {
return
fmt
}
const
getParams
=
(
str
=
window
.
location
.
href
)
=>
{
let
params
=
str
.
split
(
'?'
)
if
(
params
.
length
<
2
)
return
{}
let
param
=
params
[
1
].
split
(
'&'
)
let
obj
=
{}
for
(
let
i
=
0
;
i
<
param
.
length
;
i
++
)
{
let
paramsA
=
param
[
i
].
split
(
'='
)
let
key
=
paramsA
[
0
]
let
value
=
paramsA
[
1
]
obj
[
key
]
=
value
}
return
obj
let
params
=
str
.
split
(
'?'
)
if
(
params
.
length
<
2
)
return
{}
let
param
=
params
[
1
].
split
(
'&'
)
let
obj
=
{}
for
(
let
i
=
0
;
i
<
param
.
length
;
i
++
)
{
let
paramsA
=
param
[
i
].
split
(
'='
)
let
key
=
paramsA
[
0
]
let
value
=
paramsA
[
1
]
obj
[
key
]
=
value
}
/**num:要转换的数值,fixed:精确几位小数 */
return
obj
}
/**num:要转换的数值,fixed:精确几位小数 */
const
decimal
=
(
num
,
fixed
)
=>
{
let
pow
=
Math
.
pow
(
10
,
fixed
)
return
Math
.
round
(
num
*
pow
)
/
pow
}
const
getHttpsImgUrl
=
(
url
)
=>
{
if
(
!
url
)
{
return
''
}
var
flag
=
url
.
startsWith
(
"http:"
)
if
(
flag
)
{
var
newurl
=
url
.
replace
(
"http:"
,
"https:"
)
//去掉http自动带的端口 :7060,https不能有
var
startPos
=
newurl
.
lastIndexOf
(
":"
)
var
endPos
=
newurl
.
indexOf
(
"/"
,
startPos
)
var
preStr
=
newurl
.
substring
(
0
,
startPos
)
var
afterStr
=
newurl
.
substring
(
endPos
)
var
finalStr
=
preStr
+
afterStr
return
finalStr
}
return
url
}
import
Vue
from
'vue'
const
utils
=
{
getParams
,
decimal
decimal
,
getHttpsImgUrl
}
Object
.
keys
(
utils
).
map
(
key
=>
{
Vue
.
prototype
[
key
]
=
utils
[
key
]
...
...
src/views/sale/detail.vue
View file @
642ee55
...
...
@@ -164,6 +164,8 @@ export default {
this
.
$apis
.
orderApi
.
getRefundDetail
(
params
).
then
(({
code
,
data
})
=>
{
if
(
code
==
0
)
{
console
.
log
(
data
,
'77777777777'
)
data
.
list
[
0
].
img
=
this
.
getHttpsImgUrl
(
data
.
list
[
0
].
img
)
data
.
list
[
0
].
goodImg
=
this
.
getHttpsImgUrl
(
data
.
list
[
0
].
goodImg
)
this
.
detailInfo
=
data
.
list
[
0
]
}
})
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment