Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bcb7531b
authored
Apr 29, 2024
by
赵月辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改购物车金额计算接口
parent
823aee2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
17 deletions
+51
-17
src/api/computingResource.js
+8
-0
src/views/computingResource/shoppingCart.vue
+34
-13
src/views/console/overview.vue
+9
-4
No files found.
src/api/computingResource.js
View file @
bcb7531b
...
...
@@ -92,6 +92,14 @@ export function shoppingEdit (query) {
})
}
// 计算资源购物车计算金额接口
export
function
shoppingComputerVo
(
ids
)
{
return
request
({
url
:
`/api/v1/shoppingComputerVo/
${
ids
}
`
,
method
:
'get'
})
}
// 计算资源购物车删除接口
export
function
shoppingDelete
(
ids
)
{
return
request
({
...
...
src/views/computingResource/shoppingCart.vue
View file @
bcb7531b
...
...
@@ -15,8 +15,8 @@
<div
class=
"page-main"
>
<div
class=
"detail-info"
>
<el-table
:data=
"tableData"
@
selection-change=
"tableSelectionChange"
>
<el-table-column
type=
"selection"
/>
<el-table
:data=
"tableData"
row-key=
"id"
@
selection-change=
"tableSelectionChange"
>
<el-table-column
type=
"selection"
reserve-selection
/>
<el-table-column
label=
"资源型号"
prop=
"model"
/>
<el-table-column
label=
"配置详情"
width=
"150px"
>
<template
#
default=
"
{row}">
...
...
@@ -40,7 +40,7 @@
v-model=
"row.useNum"
:min=
"1"
controls-position=
"right"
@
change=
"edit(row)"
@
change=
"edit
Num
(row)"
style=
"width: 80px"
/>
</
template
>
</el-table-column>
...
...
@@ -95,7 +95,13 @@
</template>
<
script
name=
"ConfirmOrder"
setup
>
import
{
shoppingList
,
shoppingEdit
,
shoppingDelete
,
shoppingSubmit
}
from
'@/api/computingResource.js'
import
{
shoppingList
,
shoppingEdit
,
shoppingDelete
,
shoppingSubmit
,
shoppingComputerVo
}
from
'@/api/computingResource.js'
import
{
ref
,
computed
}
from
'vue'
import
{
ElMessageBox
}
from
'element-plus'
import
{
useRouter
}
from
'vue-router'
...
...
@@ -126,23 +132,38 @@ const ids = ref([])
function
tableSelectionChange
(
value
)
{
ids
.
value
=
value
.
map
(
row
=>
row
.
id
)
shoppingComputer
()
}
const
totalPrice
=
computed
(()
=>
{
const
list
=
tableData
.
value
.
filter
(
item
=>
{
return
ids
.
value
.
includes
(
item
.
id
)
})
let
price
=
0
list
.
forEach
(
i
=>
price
+=
parseFloat
(
i
.
publicTotalPrice
))
return
price
})
//
const totalPrice = computed(() => {
//
const list = tableData.value.filter(item => {
//
return ids.value.includes(item.id)
//
})
//
let price = 0
//
list.forEach(i => price += parseFloat(i.publicTotalPrice))
//
return price
//
})
function
edit
(
row
)
{
function
edit
Num
(
row
)
{
shoppingEdit
({
id
:
row
.
id
,
useNum
:
row
.
useNum
}).
then
(
res
=>
{
shoppingComputer
()
getList
()
})
}
const
totalPrice
=
ref
(
0
)
function
shoppingComputer
()
{
if
(
!
ids
.
value
.
length
)
{
totalPrice
.
value
=
0
return
}
shoppingComputerVo
(
ids
.
value
).
then
(
res
=>
{
totalPrice
.
value
=
res
.
data
.
totalPulicPrice
})
}
function
confirmDel
(
row
)
{
const
idsValue
=
row
?.
id
?
row
.
id
:
ids
.
value
shoppingDelete
(
idsValue
).
then
(
res
=>
{
...
...
src/views/console/overview.vue
View file @
bcb7531b
...
...
@@ -8,7 +8,8 @@
<el-button
type=
"primary"
@
click=
"$router.push('/console/authentication')"
>
申请认证
</el-button>
</div>
<el-alert
v-if=
"infoData.status === '待审核'"
style=
"width: 300px"
class=
"mb20"
show-icon
title=
"您的企业认证已提交,请等待审核"
type=
"info"
effect=
"dark"
/>
<el-alert
v-if=
"infoData.status === '待审核'"
style=
"width: 300px"
class=
"mb20"
show-icon
title=
"您的企业认证已提交,请等待审核"
type=
"info"
effect=
"dark"
/>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
...
...
@@ -20,13 +21,13 @@
</
template
>
<div
class=
"flex base-info"
>
<div
class=
"left"
>
<el-image
src=
"
"
fit=
"cover"
></el-image>
<el-image
:src=
"baseUrl + infoData.avatar
"
fit=
"cover"
></el-image>
<el-tag
v-if=
"infoData.status === '审核通过'"
type=
"success"
>
已认证
</el-tag>
<el-tag
v-else
type=
"warning"
>
未认证
</el-tag>
</div>
<el-form
label-width=
"110px"
label-position=
"left"
>
<el-form-item
label=
"账号昵称:"
>
<div>
{{ infoData.
user
Name }}
</div>
<div>
{{ infoData.
nick
Name }}
</div>
<el-icon
@
click=
"$router.push('/user/profile')"
>
<Edit/>
</el-icon>
...
...
@@ -90,7 +91,9 @@
<el-tag
v-if=
"infoData.status === '待审核'"
type=
"primary"
class=
"mr5"
>
待审核
</el-tag>
<el-tag
v-if=
"infoData.status === '审核通过'"
type=
"primary"
class=
"mr5"
>
审核通过
</el-tag>
<el-button
v-if=
"infoData.status === '驳回'"
type=
"primary"
link
@
click=
"handleViewReason"
>
查看驳回理由
</el-button>
<el-button
v-if=
"infoData.status === '驳回'"
type=
"primary"
link
@
click=
"handleViewReason"
>
查看驳回理由
</el-button>
</el-form-item>
</el-form>
</div>
...
...
@@ -123,6 +126,8 @@ import { auditInfo } from '@/api/console.js'
import
{
ref
}
from
'vue'
import
{
ElMessageBox
}
from
'element-plus'
const
baseUrl
=
import
.
meta
.
env
.
VITE_APP_BASE_API
const
infoData
=
ref
({})
function
getAuditInfo
()
{
...
...
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