Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
dc5fc299
Commit
dc5fc299
authored
Aug 29, 2023
by
yaya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:钱币设置添加设置主图功能功能
parent
3844e140
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
src/api/business/goodsNew.js
src/api/business/goodsNew.js
+7
-0
src/views/goods/infoSet.vue
src/views/goods/infoSet.vue
+36
-2
No files found.
src/api/business/goodsNew.js
View file @
dc5fc299
...
@@ -47,3 +47,10 @@ export function holdOver(params) {
...
@@ -47,3 +47,10 @@ export function holdOver(params) {
data
:
params
data
:
params
})
})
}
}
export
function
setTopImage
(
params
)
{
return
request
({
url
:
'
/item/setTopImage
'
,
method
:
'
post
'
,
data
:
params
})
}
src/views/goods/infoSet.vue
View file @
dc5fc299
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
<div
v-for=
"(item, index) in imageList"
:key=
"item + index"
class=
"select_item"
>
<div
v-for=
"(item, index) in imageList"
:key=
"item + index"
class=
"select_item"
>
<img
:src=
"item"
class=
"gallery"
@
click=
"handleShowLargeDialog(item)"
>
<img
:src=
"item"
class=
"gallery"
@
click=
"handleShowLargeDialog(item)"
>
<div
class=
"edit"
@
click=
"handlerChangeImage(item)"
>
编辑
</div>
<div
class=
"edit"
@
click=
"handlerChangeImage(item)"
>
编辑
</div>
<div
v-if=
"imageList.length > 0"
class=
"set"
@
click=
"handlerSetMainImage(item, index)"
>
{{
imageMainPosition
===
index
?
'
主图
'
:
'
设为主图
'
}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -185,7 +186,7 @@ import { VuePictureCut, VuePictureCutMask, VuePictureCutMenu } from 'vue-picture
...
@@ -185,7 +186,7 @@ import { VuePictureCut, VuePictureCutMask, VuePictureCutMenu } from 'vue-picture
import
{
getToken
}
from
'
@/utils/auth
'
import
{
getToken
}
from
'
@/utils/auth
'
import
SelectImageDialog
from
'
./components/selectImageDialog
'
import
SelectImageDialog
from
'
./components/selectImageDialog
'
import
{
listCategories
}
from
'
@/api/business/goods
'
import
{
listCategories
}
from
'
@/api/business/goods
'
import
{
detailGoods
,
editGoods
,
saveImageBase64
,
saveCroppingRecord
,
deleteGood
,
holdOver
}
from
'
@/api/business/goodsNew
'
import
{
detailGoods
,
editGoods
,
saveImageBase64
,
saveCroppingRecord
,
deleteGood
,
holdOver
,
setTopImage
}
from
'
@/api/business/goodsNew
'
import
CheckLargeImageDialog
from
'
./components/CheckLargeImageDialog
'
import
CheckLargeImageDialog
from
'
./components/CheckLargeImageDialog
'
import
CutImageDialog
from
'
./components/CutImageDialog
'
import
CutImageDialog
from
'
./components/CutImageDialog
'
import
CutEditImageDialog
from
'
./components/CutEditImageDialog
'
import
CutEditImageDialog
from
'
./components/CutEditImageDialog
'
...
@@ -230,7 +231,8 @@ export default {
...
@@ -230,7 +231,8 @@ export default {
cutImageDialogVisible
:
false
,
// 钱币正反面图片操作
cutImageDialogVisible
:
false
,
// 钱币正反面图片操作
imageType
:
0
,
// 1正面 2反面
imageType
:
0
,
// 1正面 2反面
cutEditImageDialogVisible
:
false
,
// 钱币图片编辑
cutEditImageDialogVisible
:
false
,
// 钱币图片编辑
editImageUrl
:
''
// 用于处理是否合成或者替换原图
editImageUrl
:
''
,
// 用于处理是否合成或者替换原图,
imageMainPosition
:
-
1
// 用于设置主图位置
}
}
},
},
computed
:
{
computed
:
{
...
@@ -300,6 +302,7 @@ export default {
...
@@ -300,6 +302,7 @@ export default {
idExcludeList
:
this
.
goodIdList
||
[]
idExcludeList
:
this
.
goodIdList
||
[]
}
}
detailGoods
(
param
).
then
(
response
=>
{
detailGoods
(
param
).
then
(
response
=>
{
this
.
imageMainPosition
=
-
1
this
.
currentGoodId
=
response
.
data
.
data
.
id
this
.
currentGoodId
=
response
.
data
.
data
.
id
this
.
handleClearInfo
()
this
.
handleClearInfo
()
if
(
type
===
1
)
{
// 上一个
if
(
type
===
1
)
{
// 上一个
...
@@ -575,6 +578,25 @@ export default {
...
@@ -575,6 +578,25 @@ export default {
handlerChangeImage
(
imageUrl
)
{
handlerChangeImage
(
imageUrl
)
{
this
.
editImageUrl
=
imageUrl
this
.
editImageUrl
=
imageUrl
this
.
cutEditImageDialogVisible
=
true
this
.
cutEditImageDialogVisible
=
true
},
handlerSetMainImage
(
imageUrl
,
index
)
{
if
(
index
===
this
.
imageMainPosition
)
{
this
.
$message
.
info
(
'
已经是主图了哦~
'
)
return
}
const
params
=
{
id
:
this
.
goodsParams
.
id
,
topImage
:
imageUrl
}
setTopImage
(
params
).
then
(
response
=>
{
this
.
$message
.
success
(
'
设置成功
'
)
this
.
imageMainPosition
=
index
}).
catch
(
response
=>
{
this
.
$notify
.
error
({
title
:
'
失败
'
,
message
:
response
.
data
.
errmsg
||
'
请求失败
'
})
})
}
}
}
}
}
}
...
@@ -685,6 +707,18 @@ export default {
...
@@ -685,6 +707,18 @@ export default {
background
:
#000000
;
background
:
#000000
;
opacity
:
0
.6
;
opacity
:
0
.6
;
}
}
.set
{
width
:
100px
;
position
:
absolute
;
bottom
:
0
;
right
:
0
;
padding
:
5px
8px
;
font-size
:
12px
;
color
:
white
;
background
:
#000000
;
opacity
:
0
.6
;
text-align
:
center
;
}
}
}
}
}
}
}
...
...
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