Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 a35fba12
authored
Feb 14, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
功能开发
1 parent
708c2728
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
146 additions
and
11 deletions
src/main.js
src/views/purchase/components/goodsDetailCom.vue
src/main.js
View file @
a35fba1
...
@@ -60,9 +60,31 @@ if (!isProd) {
...
@@ -60,9 +60,31 @@ if (!isProd) {
Vue
.
prototype
.
$EventBus
=
new
Vue
()
Vue
.
prototype
.
$EventBus
=
new
Vue
()
var
baseConfig
=
{
var
baseConfig
=
{
// 系统名字
sysName
:
"嘀加智享车生活"
,
// 系统说明
subName
:
"让你的生意慧简单"
,
// 是否需要注册-true;false
hasReg
:
false
,
// 是否需要配置账号权限;true-有权限,从后台获取权限信息;false-无需权限
hasAuth
:
true
,
subShopMerchantName
:
true
,
// 是否显示财务列表二级流量方
env
:
"production"
,
alipayPath
:
"https://dj.glsx.com.cn/dj-carlife-web-alipay/#/alipay"
,
css_url
:
"https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/index.css"
,
axios
:
{
axios
:
{
baseURL
:
"https://dj.glsx.com.cn/rop-dj-smartcarlife/router"
,
appkey
:
"d7ffc3346fc9a45bccaaa35300d59022"
,
appkey
:
"d7ffc3346fc9a45bccaaa35300d59022"
,
secret
:
"4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353"
secret
:
"4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353"
,
timeout
:
50000
,
result
:
{
data_key
:
"data"
,
message_key
:
"message"
,
code_key
:
"code"
,
code_success_value
:
0
,
code_message_map
:
{}
}
}
}
}
}
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
...
...
src/views/purchase/components/goodsDetailCom.vue
View file @
a35fba1
...
@@ -13,16 +13,23 @@
...
@@ -13,16 +13,23 @@
</div>
</div>
<div
class=
"goodsInfoCom__right"
>
<div
class=
"goodsInfoCom__right"
>
<p
class=
"title"
>
{{
goodsInfo
.
goodsName
}}
</p>
<p
class=
"title
two-line-ellipsis
"
>
{{
goodsInfo
.
goodsName
}}
</p>
<div
class=
"priceCon"
>
<div
class=
"priceCon"
>
<span
class=
"price"
>
价格:
{{
handleItemInfo
.
purchasePrice
}}
</span>
<span
class=
"price"
>
价格:
<span
<span
class=
"turnover"
>
成交量:
{{
handleItemInfo
.
price
}}
笔
</span>
class=
"priceNum"
>
¥
{{
handleItemInfo
.
purchasePrice
}}
</span></span>
<span
class=
"turnover"
>
成交量:
<span
class=
"num"
>
{{
goodsInfo
.
purchaseOrderCount
}}
笔
</span></span>
</div>
</div>
<div
class=
"skuCon"
>
<div
class=
"skuCon"
>
<div
class=
"label"
>
规格:
</div>
<div
class=
"label"
>
规格:
</div>
<div
class=
"skuItem"
<div
class=
"itemCon"
>
v-for=
"(item,index) in goodsInfo.upgradeGoodsList"
<div
class=
"skuItem one-line-ellipsis pointer"
:key=
"index"
>
{{
item
.
upgradeGoodsName
}}
</div>
:class=
"
{active: index === selectIndex}"
v-for="(item,index) in goodsInfo.upgradeGoodsList"
:key="index"
@click="selectIndex = index; setHandleItemInfo(item)">
{{
item
.
upgradeGoodsName
}}
</div>
</div>
</div>
</div>
<div
class=
"munCom"
>
<div
class=
"munCom"
>
<div
class=
"label"
>
数量:
</div>
<div
class=
"label"
>
数量:
</div>
...
@@ -84,8 +91,8 @@ export default {
...
@@ -84,8 +91,8 @@ export default {
selectIndex
:
0
,
selectIndex
:
0
,
handleItemInfo
:
{
handleItemInfo
:
{
goodsNumber
:
1
,
goodsNumber
:
1
,
upgradeGoodsId
:
''
upgradeGoodsId
:
''
,
purchasePrice
:
0
}
}
}
}
},
},
...
@@ -123,7 +130,22 @@ export default {
...
@@ -123,7 +130,22 @@ export default {
console
.
log
(
res
)
console
.
log
(
res
)
// let data = res.data
// let data = res.data
// let {goodsName,} = res
// let {goodsName,} = res
this
.
goodsInfo
=
data
this
.
goodsInfo
=
res
// 调试用
for
(
let
index
=
0
;
index
<
12
;
index
++
)
{
this
.
goodsInfo
.
upgradeGoodsList
[
index
]
=
this
.
goodsInfo
.
upgradeGoodsList
[
0
]
}
// 默认选中第一个
const
item
=
this
.
goodsInfo
.
upgradeGoodsList
[
0
]
item
&&
setHandleItemInfo
(
item
)
})
},
setHandleItemInfo
(
item
)
{
const
{
upgradeGoodsId
,
purchasePrice
}
=
item
this
.
handleItemInfo
=
object
.
assign
(
this
.
handleItemInfo
,
{
upgradeGoodsId
,
purchasePrice
})
})
},
},
handleDetailClose
()
{
handleDetailClose
()
{
...
@@ -131,7 +153,7 @@ export default {
...
@@ -131,7 +153,7 @@ export default {
},
},
updateCarShopping
()
{
updateCarShopping
()
{
// this.$emit('updateCarShopping')
// this.$emit('updateCarShopping')
this
.
$message
.
success
(
'加入购物车成功'
)
this
.
$EventBus
.
$emit
(
'updateCarShopping'
)
this
.
$EventBus
.
$emit
(
'updateCarShopping'
)
}
}
}
}
...
@@ -139,4 +161,95 @@ export default {
...
@@ -139,4 +161,95 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.goodsInfoCom
{
display
:
flex
;
.goodsInfoCom__left
{
width
:
400px
;
height
:
400px
;
img
{
width
:
100%
;
height
:
100%
;
}
}
.goodsInfoCom__right
{
flex
:
1
;
margin-left
:
20px
;
.title
{
margin
:
0
;
font-weight
:
600
;
font-size
:
20px
;
color
:
#333333
;
}
.priceCon
{
box-sizing
:
border-box
;
width
:
100%
;
height
:
65px
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding
:
0
10px
;
margin
:
16px
0
20px
;
background
:
#f2f5fb
;
border-radius
:
2px
;
color
:
#666666
;
.price
{
display
:
flex
;
align-items
:
center
;
margin-left
:
8px
;
}
.num
{
margin-left
:
8px
;
}
.priceNum
{
font-weight
:
600
;
font-size
:
30px
;
color
:
#ee3040
;
}
}
.skuCon
{
display
:
flex
;
.label
{
box-sizing
:
border-box
;
width
:
60px
;
height
:
36px
;
text-align
:
center
;
padding-left
:
18px
;
line-height
:
36px
;
color
:
#666666
;
}
//
flex-wrap
:
wrap
;
//
align-items
:
center
;
.itemCon
{
flex
:
1
;
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
}
.skuItem
{
box-sizing
:
border-box
;
width
:
234px
;
height
:
36px
;
background
:
#ffffff
;
border
:
1px
solid
#e7edf9
;
border-radius
:
2px
;
color
:
#333333
;
text-align
:
center
;
line-height
:
36px
;
padding
:
0
10px
;
margin-bottom
:
16px
;
&.active
{
border
:
1px
solid
#185efe
;
}
}
}
}
}
.productDetailsImg
{
width
:
100%
;
height
:
338px
;
}
.munCom
{
display
:
flex
;
margin-bottom
:
20px
;
}
</
style
>
</
style
>
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