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
a3b3041f
Commit
a3b3041f
authored
Mar 17, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试规格
parent
6f68575b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
54 deletions
+71
-54
src/components/livedModel/livedGoodsDia.vue
+11
-29
src/components/livedModel/livedSelectionSpe.vue
+60
-25
No files found.
src/components/livedModel/livedGoodsDia.vue
View file @
a3b3041f
...
...
@@ -54,36 +54,14 @@ export default {
return
{
goodsList
:
[
{
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
},
{
productId
:
"102"
,
productName
:
"ad新 外衣"
,
productImgUrl
:
'http://test-bucket-ant.oss-cn-shanghai.aliyuncs.com/product/jpg/58ab315c-61d5-4799-8d1b-f0d3b0e1f0ad.jpg'
,
},
],
itemGoods
:{},
//选中商品
...
...
@@ -109,7 +87,11 @@ export default {
showSpeDia
(
val
)
{
let
productId
=
val
.
productId
;
this
.
itemGoods
.
productId
=
productId
;
wx
.
showLoading
({
title
:
'加载中...'
,
})
live
.
getProductInfo
(
productId
).
then
(
res
=>
{
wx
.
hideLoading
();
if
(
res
.
data
.
code
==
200
){
this
.
itemGoods
.
maxSale
=
Number
(
res
.
data
.
data
.
maxSuggestedRetailPrice
);
this
.
itemGoods
.
minSale
=
Number
(
res
.
data
.
data
.
minSuggestedRetailPrice
);
...
...
@@ -117,8 +99,8 @@ export default {
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
.
productPic
s
&&
res
.
data
.
data
.
productPic
s
.
length
>
0
){
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPics
[
0
].
url
);
if
(
res
.
data
.
data
.
productPic
tures
&&
res
.
data
.
data
.
productPicture
s
.
length
>
0
){
this
.
itemGoods
.
goodsImg
=
DFSImg
(
res
.
data
.
data
.
productPic
ture
s
[
0
].
url
);
}
this
.
showSpe
=
true
;
}
...
...
src/components/livedModel/livedSelectionSpe.vue
View file @
a3b3041f
...
...
@@ -4,7 +4,7 @@
<van-popup
:show=
"show"
position=
"bottom"
custom-style=
"
height: 60vh;padding:14px;
border-top-left-radius:10px;border-top-right-radius:10px;"
custom-style=
"border-top-left-radius:10px;border-top-right-radius:10px;"
:close-on-click-overlay=
"true"
@
close=
"closeDia"
>
...
...
@@ -23,19 +23,24 @@
<div
class=
"price"
v-if=
"product_goods_info.discountPrice"
>
<div>
¥
{{
product_goods_info
.
discountPrice
}}
</div>
<div
v-if=
"product_goods_info.singleItemActivityId"
>
<del
style=
"color:#666;"
>
¥
{{
product_goods_info
.
originalPrice
}}
</del>
<p
class=
"delPrice"
>
¥
{{
product_goods_info
.
originalPrice
}}
</p>
<!--
<del
style=
"color:#666;"
>
¥
{{
product_goods_info
.
originalPrice
}}
</
!
-->
-->
</div>
<div
v-else-if=
"product_goods_info.discountPrice-0
<product
_goods_info
.
goodsSuggestedRetailPrice-0
"
>
<del
style=
"color:#666;"
>
¥
{{
product_goods_info
.
goodsSuggestedRetailPrice
}}
</del>
<p
class=
"delPrice"
>
¥
{{
product_goods_info
.
goodsSuggestedRetailPrice
}}
</p>
<!--
<del
style=
"color:#666;"
>
¥
{{
product_goods_info
.
goodsSuggestedRetailPrice
}}
</del>
-->
</div>
</div>
<template
v-else-if=
"minSale
<maxSale
"
>
<div
class=
"price"
>
¥
{{
minSale
}}
-¥
{{
maxSale
}}
</div>
<del
<p
class=
"delPrice"
v-if=
"(minSale-0
<minSuggestedRetailPrice-0
)&&(
maxSale-0
<maxSuggestedRetailPrice-0
)"
>
¥
{{
minSuggestedRetailPrice
}}
-¥
{{
maxSuggestedRetailPrice
}}
</p>
<!--
<del
v-if=
"(minSale-0
<minSuggestedRetailPrice-0
)&&(
maxSale-0
<maxSuggestedRetailPrice-0
)"
>
¥
{{
minSuggestedRetailPrice
}}
-¥
{{
maxSuggestedRetailPrice
}}
</del>
>
¥
{{
minSuggestedRetailPrice
}}
-¥
{{
maxSuggestedRetailPrice
}}
</del>
-->
</
template
>
<
template
v-else
>
<div
class=
"price"
>
¥
{{
minSale
}}
</div>
...
...
@@ -69,13 +74,15 @@
</li>
</ul>
</div>
<div
class=
"buyQty flex
flex-btw
"
>
<div
class=
"ti"
>
购买数量
</div>
<div
class=
"buyQty flex"
>
<div
class=
"ti"
>
购买数量
{{buyQty}}
</div>
<van-stepper
:value=
"buyQty"
:min=
"product_goods_info.productMinCount=='0'?1:
product_goods_info.productMinCount
"
:min=
"product_goods_info.productMinCount=='0'?1:
Number(product_goods_info.productMinCount)
"
:max=
"MaxQtyNum"
@
minus=
"numMinus"
:disable-input=
"true"
@
change=
"changeQty"
input-class=
"ipt"
/>
</div>
</div>
...
...
@@ -151,7 +158,8 @@ export default {
isGetMixId
:
false
,
// 是否取价格
paramData
:
""
,
//埋点数据
maxSelectedPrice
:
0
,
// 限时特惠选中规格后划线价
allSellOut
:
false
//全部售罄标识
allSellOut
:
false
,
//全部售罄标识
isDefault
:
false
,
};
},
components
:
{},
...
...
@@ -268,11 +276,17 @@ export default {
}
});
},
changeQty
(
event
){
console
.
log
(
event
.
mp
.
detail
,
'------------------------------279'
)
this
.
buyQty
=
event
.
mp
.
detail
;
},
// 默认选中一组规格
// 两个参数goodsSpc,allSpc sku及所有规格
defaultSelection
(
goodsSpc
,
allSpc
){
console
.
log
(
goodsSpc
,
'-------371'
)
console
.
log
(
allSpc
,
'-------372'
)
// 是默认调取getMixid接口状态
this
.
isDefault
=
true
;
// console.log(goodsSpc,'-------371')
// console.log(allSpc,'-------372')
for
(
let
i
=
0
;
i
<
allSpc
.
length
;
i
++
){
for
(
let
j
=
0
;
j
<
allSpc
[
i
].
specificationValue
.
length
;
j
++
){
for
(
let
k
=
0
;
k
<
goodsSpc
.
length
;
k
++
){
...
...
@@ -323,11 +337,18 @@ export default {
},
// 取价格
getMixId
(
val
)
{
if
(
!
this
.
isDefault
){
wx
.
showLoading
({
title
:
'加载中...'
,
})
}
this
.
isDefault
=
false
;
this
.
isGetMixId
=
true
;
let
productGoodsMixId
=
this
.
product_goods_info
.
productGoodsMixId
live
.
getProductGoodsByMixId
(
productGoodsMixId
)
.
then
(
res
=>
{
wx
.
hideLoading
()
if
(
res
.
data
.
code
==
200
)
{
if
(
this
.
nonstandardGoods
==
false
)
{
res
.
data
.
data
.
specifications
.
forEach
((
item
,
index
)
=>
{
...
...
@@ -362,8 +383,8 @@ export default {
this
.
product_goods_info
.
singleItemActivityId
=
res
.
data
.
data
.
singleItemActivityId
||
''
;
this
.
buyQty
=
res
.
data
.
data
.
productMinCount
==
"0"
?
1
:
Number
(
res
.
data
.
data
.
productMinCount
);
//
this.buyQty =
//
res.data.data.productMinCount == "0" ? 1 : Number(res.data.data.productMinCount);
if
(
this
.
product_goods_info
.
oversoldFlag
!=
1
&&
this
.
product_goods_info
.
sellMaxQty
-
0
<=
0
...
...
@@ -543,6 +564,10 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.delPrice
{
text-decoration
:
line-through
;
color
:
#666
;
}
.flex
{
display
:
flex
;
}
...
...
@@ -582,7 +607,7 @@ export default {
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
8px
8px
0px
0px
;
.sku
{
padding
:
8px
9
px
;
padding
:
8px
10
px
;
position
:
relative
;
.close
{
position
:
absolute
;
...
...
@@ -636,10 +661,10 @@ export default {
}
.commoditySty
{
border-bottom
:
1px
solid
#e5e5e5
;
max-height
:
20
0px
;
overflow-y
:
scroll
;
//
max-height
:
24
0px
;
//
overflow-y
:
scroll
;
ul
{
height
:
95
%
;
height
:
100
%
;
li
{
height
:
100%
;
.property
{
...
...
@@ -648,15 +673,16 @@ export default {
}
.specification
{
div.specification-item
{
font-size
:
15px
;
border
:
1px
solid
#606060
;
border-radius
:
0.08rem
;
border-radius
:
4px
;
color
:
#606060
;
text-align
:
center
;
padding
:
0.04rem
0.16rem
;
padding
:
2px
4px
;
float
:
left
;
margin-right
:
0.16rem
;
min-width
:
0.96rem
;
margin-bottom
:
0.16rem
;
margin-right
:
6px
;
min-width
:
30px
;
margin-bottom
:
6px
;
box-sizing
:
content-box
;
div
{
text-align
:
left
;
...
...
@@ -683,12 +709,21 @@ export default {
margin-top
:
10px
;
width
:
100%
;
height
:
60px
;
justify-content
:
space-between
;
.ti{
font-size
:
14px
;
}
/
deep
/
.ipt
{
color
:
#000
!important
;
}
}
.bottom
{
margin-top
:
60px
;
.van-button
{
width
:
188px
;
height
:
49px
;
width
:
50vw
;
height
:
50px
;
text-align
:
center
;
line-height
:
50px
;
}
.toPay
{
background
:
#ff4240
;
...
...
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