Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
6f68575b
Commit
6f68575b
authored
Mar 17, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试规格
parent
1333464e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
37 deletions
+70
-37
src/api/live.js
+7
-3
src/components/livedModel/livedGoodsDia.vue
+63
-34
src/components/livedModel/livedSelectionSpe.vue
+0
-0
No files found.
src/api/live.js
View file @
6f68575b
...
...
@@ -5,17 +5,21 @@ export default {
getLiveInfo
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/liveBroadcastInfo/getLiveBroadcastInfoByIds?liveBroadcastId=
${
options
}
`
);
},
// 查询商品详情
getProductInfo
(
options
)
{
return
requestPOST1
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_product_info?productId=
${
options
}
`
);
},
// 查询所有产品规格详情
getProductGoodsByProductInfo
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_product_goods_by_product_info`
,
options
);
return
requestPOST
1
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_product_goods_by_product_info?productInfoId=
${
options
}
`
);
},
// 获取商品所有规格
getProductGoodsSpecifications
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_goods_specifications`
,
options
);
return
requestPOST
1
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_goods_specifications?productId=
${
options
}
`
);
},
// 查询产品信息
getProductGoodsByMixId
(
options
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_product_goods_by_mix_id`
,
options
);
return
requestPOST
1
(
`
${
process
.
env
.
OLSHOP_URL
}
/product/get_product_goods_by_mix_id?productGoodsMixId=
${
options
}
`
);
},
// 添加购物车
addCart
(
options
)
{
...
...
src/components/livedModel/livedGoodsDia.vue
View file @
6f68575b
...
...
@@ -10,15 +10,15 @@
<div
class=
"list"
>
<div
class=
"item"
v-for=
"(item,index) in goodsList"
:key=
"index"
>
<div
class=
"img"
>
<img
:src=
"item.
img
"
alt
/>
<img
:src=
"item.
productImgUrl
"
alt
/>
</div>
<div
class=
"info"
>
<p
class=
"name line-clamp2"
>
{{
item
.
n
ame
}}
</p>
<p
class=
"name line-clamp2"
>
{{
item
.
productN
ame
}}
</p>
<div
class=
"bottom"
>
<div
class=
"price"
>
<p>
<span>
¥
</span>
<span>
{{
item
.
p
rice
}}
</span>
<span>
{{
item
.
minP
rice
}}
</span>
</p>
<p
class=
"del"
>
<span>
¥
</span>
...
...
@@ -34,12 +34,14 @@
</div>
</van-popup>
<!-- 选择规格弹层 -->
<livedSelectionSpe
:show=
"showSpe"
:productInfoId=
"productInfoId
"
@
closeSpeDia=
"closeSpeDia"
></livedSelectionSpe>
<livedSelectionSpe
v-if=
"showSpe"
:show=
"showSpe"
:productInfoId=
"itemGoods.productId"
:minSale=
"itemGoods.minSale"
:maxSale=
"itemGoods.maxSale"
:goodsImg=
"itemGoods.goodsImg"
:minSuggestedRetailPrice=
"itemGoods.minSuggestedRetailPrice"
:maxSuggestedRetailPrice=
"itemGoods.maxSuggestedRetailPrice"
:goodsLowerShelf=
"itemGoods.goodsLowerShelf
"
@
closeSpeDia=
"closeSpeDia"
></livedSelectionSpe>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
import
livedSelectionSpe
from
"@/components/livedModel/livedSelectionSpe"
;
import
{
DFSImg
}
from
"@/utils/index"
;
import
live
from
"@/api/live"
;
export
default
{
props
:
{
showDia
:
{
...
...
@@ -52,32 +54,40 @@ export default {
return
{
goodsList
:
[
{
name
:
"产品名称产品名称产品名称产品名称产品名称"
,
img
:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg"
,
price
:
123
coverImage
:
""
,
createDatetime
:
"2019-07-18 16:16:40"
,
createOperator
:
"44"
,
customMainPic
:
""
,
expectedArriveDate
:
""
,
firstAttrCode
:
""
,
isDelete
:
"0"
,
maxDiscountPrice
:
"83.000000"
,
maxSalePrice
:
"83.000000"
,
maxSuggestedRetailPrice
:
"81.000000"
,
metaDescription
:
""
,
metaKeywords
:
""
,
metaTitle
:
""
,
minDiscountPrice
:
"49.000000"
,
minSalePrice
:
"49.000000"
,
minSuggestedRetailPrice
:
"49.100000"
,
onsaleEndDatetime
:
null
,
onsaleStartDatetime
:
null
,
outerProductCode
:
"12355455"
,
productDetails
:
""
,
productId
:
"266"
,
productImgUrl
:
""
,
productName
:
"瑞士进口 雀巢(Nestle) 金牌 黑咖啡粉 至臻原味 速溶 咖啡豆微研磨"
,
productImgUrl
:
'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/de6ca6a1-f161-49da-8b76-3450144b4d47.jpg'
,
minSale
:
0
,
maxSale
:
0
,
goodsImg
:
0
,
minSuggestedRetailPrice
:
0
,
maxSuggestedRetailPrice
:
0
,
goodsLowerShelf
:
false
},
{
name
:
"产品名称产品名称产品名称产品名称产品名称"
,
img
:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg"
,
price
:
123
},
{
name
:
"产品名称产品名称产品名称产品名称产品名称"
,
img
:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg"
,
price
:
123
},
{
name
:
"产品名称产品名称产品名称产品名称产品名称"
,
img
:
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg"
,
price
:
123
}
],
showSpe
:
false
,
productInfoId
:
0
,
itemGoods
:{},
//选中商品
showSpe
:
false
};
},
components
:
{
...
...
@@ -85,18 +95,37 @@ export default {
},
computed
:
{},
created
()
{},
inLoad
(){
this
.
goodsList
.
forEach
((
item
,
index
)
=>
{
item
.
img
=
DFSImg
(
item
.
productImgUrl
);
})
},
mounted
()
{},
methods
:
{
// 关闭
closeDia
()
{
this
.
$emit
(
"changeStatus"
);
},
showSpeDia
(
val
){
this
.
showSpe
=
true
;
// 调用规格列表及价格信息传入组件先展示
showSpeDia
(
val
)
{
let
productId
=
val
.
productId
;
this
.
itemGoods
.
productId
=
productId
;
live
.
getProductInfo
(
productId
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
){
this
.
itemGoods
.
maxSale
=
Number
(
res
.
data
.
data
.
maxSuggestedRetailPrice
);
this
.
itemGoods
.
minSale
=
Number
(
res
.
data
.
data
.
minSuggestedRetailPrice
);
this
.
itemGoods
.
maxDiscountPrice
=
Number
(
res
.
data
.
data
.
maxDiscountPrice
);
this
.
itemGoods
.
minDiscountPrice
=
Number
(
res
.
data
.
data
.
minDiscountPrice
);
this
.
itemGoods
.
productNature
=
res
.
data
.
data
.
productNature
;
this
.
itemGoods
.
goodsLowerShelf
=
res
.
data
.
data
.
saleStatus
!=
1
?
true
:
false
;
//1 上架 0下架 true 下架
if
(
res
.
data
.
data
.
productPics
&&
res
.
data
.
data
.
productPics
.
length
>
0
){
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPics
[
0
].
url
);
}
this
.
showSpe
=
true
;
}
})
},
closeSpeDia
(){
this
.
showSpe
=
false
;
closeSpeDia
()
{
this
.
showSpe
=
false
;
}
}
};
...
...
@@ -141,7 +170,7 @@ export default {
}
.price
{
font-size
:
18px
;
.del{
.del
{
font-size
:
16px
;
text-decoration
:
line-through
;
span
{
...
...
src/components/livedModel/livedSelectionSpe.vue
View file @
6f68575b
This diff is collapsed.
Click to expand it.
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