Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
3ab7d4c4
Commit
3ab7d4c4
authored
Oct 12, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5bb2da23
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
260 additions
and
195 deletions
+260
-195
style1.vue
components/goods/style1.vue
+260
-195
No files found.
components/goods/style1.vue
View file @
3ab7d4c4
...
@@ -3,22 +3,35 @@
...
@@ -3,22 +3,35 @@
:style=
"
{
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
}"
}"
>
>
<div
<div
v-for=
"(item, gli) in goodList"
v-for=
"(item, gli) in goodList"
:key=
"gli"
:key=
"gli"
class=
"good-one"
class=
"good-one-style1"
style=
"width: calc(100vw - 24px)"
@
click=
"openGood(item)"
@
click=
"openGood(item)"
:style=
"
{
:style=
"
{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
background:
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : '',
}"
}"
>
>
<div
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></div
>
<div
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<image
<image
style=
"width: calc(100vw - 24px); height: 50vw;border-top-left-radius: 10px; border-top-right-radius: 10px;"
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%"
/>
</div>
<image
style=
"
width: calc(100vw - 24px);
height: 50vw;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
:src=
"item.picUrl"
v-if=
"goodsInfo.goodsCoverProportion == '3-2'"
v-if=
"goodsInfo.goodsCoverProportion == '3-2'"
...
@@ -28,73 +41,118 @@
...
@@ -28,73 +41,118 @@
width: calc(100vw - 24px);
width: calc(100vw - 24px);
height: 100vw;
height: 100vw;
border-radius: 10rpx 10rpx 0 0;
border-radius: 10rpx 10rpx 0 0;
border-top-left-radius: 10px; border-top-right-radius: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
"
"
v-if=
"goodsInfo.goodsCoverProportion == '1-1'"
v-if=
"goodsInfo.goodsCoverProportion == '1-1'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
:src=
"item.picUrl"
/>
/>
<div
class=
"good-info"
>
<div
class=
"good-info"
>
<div
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</div>
<div
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
<view
class=
"good-sub-name"
v-if=
"item.subname"
>
{{
item
.
subname
}}
</view>
{{
item
.
name
}}
</div>
<view
class=
"good-sub-name"
v-if=
"item.subname"
>
{{
item
.
subname
}}
</view>
<div
class=
"good-price-info"
>
<div
class=
"good-price-info"
>
<view
style=
"display: flex;justify-content: space-between;width:100%;align-items: center;"
>
<view
<view
style=
"font-size:22rpx;color:#999999;"
>
style=
"
{{
item
.
thirdname
}}
display: flex;
justify-content: space-between;
width: 100%;
align-items: center;
"
>
<view
style=
"font-size: 22rpx; color: #999999"
>
{{
item
.
thirdname
}}
</view>
</view>
<view>
<view>
<span
class=
"price"
>
<span
class=
"price"
>
<span
style=
"font-size: 28rpx;font-weight: 500;margin-right: 2rpx;"
>
¥
</span>
<span
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
OriginalPrice
)
:
''
}}
style=
"font-size: 28rpx; font-weight: 500; margin-right: 2rpx"
>
¥
</span
>
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
OriginalPrice
)
:
""
}}
</span>
</span>
</view>
</view>
</view>
</view>
<span
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
style=
"display:none;"
>
<span
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
style=
"display: none"
>
<u-icon
name=
"cart-o"
size=
"40"
style=
"color:#ff4544"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
<u-icon
name=
"add-o"
size=
"40"
style=
"color:#ff4544"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
name=
"cart-o"
size=
"40"
style=
"color: #ff4544"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
style=
"color: #ff4544"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
type=
"primary"
size=
"mini"
size=
"mini"
:ripple=
"true"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
{
:custom-style=
"
{
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
backgroundColor:
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? '#FFF'
: goodsInfo.buttonColor,
color:
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF',
}"
}"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
"
v-else
v-else
>
>
{{
goodsInfo
.
buyBtnText
}}
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</u-button>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<good-sku
v-if=
"showSku"
:option-type=
"2"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
></good-sku>
<good-sku
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
v-if=
"showSku"
:option-type=
"2"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
goodSku
from
"../goods/goodsku"
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
"@/components/auth/index.vue"
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
auth
auth
,
},
},
props
:
[
'goodList'
,
'goodsInfo'
],
props
:
[
"goodList"
,
"goodsInfo"
],
data
()
{
data
()
{
return
{
return
{
mainColor
:
''
,
mainColor
:
""
,
activeKey
:
0
,
activeKey
:
0
,
showSku
:
false
,
showSku
:
false
,
sku
:
{},
sku
:
{},
showAuth
:
false
,
showAuth
:
false
,
u
:
{}
u
:
{},
};
};
},
},
created
()
{
created
()
{
...
@@ -104,38 +162,42 @@ export default {
...
@@ -104,38 +162,42 @@ export default {
openGood
(
item
)
{
openGood
(
item
)
{
//线路
//线路
if
(
item
.
goodType
==
4
)
{
if
(
item
.
goodType
==
4
)
{
var
url
=
"/pages/jiuzhai/jz_LineDetail?tcid="
+
item
.
id
+
'&configId='
+
item
.
subid
;
var
url
=
console
.
log
(
"url1"
,
url
)
"/pages/jiuzhai/jz_LineDetail?tcid="
+
item
.
id
+
"&configId="
+
item
.
subid
;
console
.
log
(
"url1"
,
url
);
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
url
url
:
url
,
});
});
}
}
//酒店
//酒店
else
if
(
item
.
goodType
==
1
)
{
else
if
(
item
.
goodType
==
1
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/hotel/detail?id="
+
item
.
id
url
:
"/pages/hotel/detail?id="
+
item
.
id
,
});
});
}
}
//餐食
//餐食
else
if
(
item
.
goodType
==
2
)
{
else
if
(
item
.
goodType
==
2
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/restaurant/detail?id='
+
item
.
id
url
:
"/pages/restaurant/detail?id="
+
item
.
id
,
});
});
}
}
//景点
//景点
else
if
(
item
.
goodType
==
3
)
{
else
if
(
item
.
goodType
==
3
)
{
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/ticketCoupons/detail?id='
+
item
.
id
url
:
"/pages/ticketCoupons/detail?id="
+
item
.
id
,
});
});
}
}
},
},
showSkuHandler
(
g
)
{
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
if
(
!
this
.
u
)
{
if
(
!
this
.
u
)
{
this
.
u
=
{
this
.
u
=
{
nickName
:
'未登录'
,
nickName
:
"未登录"
,
avatarUrl
:
''
avatarUrl
:
""
,
};
};
this
.
showAuth
=
true
;
this
.
showAuth
=
true
;
}
else
{
}
else
{
...
@@ -143,28 +205,29 @@ export default {
...
@@ -143,28 +205,29 @@ export default {
}
}
},
},
reloadUserinfo
()
{
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
"mall_UserInfo"
);
// this.showAuth = false;
// this.showAuth = false;
},
},
//关闭登录窗口
//关闭登录窗口
gbAuth
()
{
gbAuth
()
{
this
.
showAuth
=
false
;
this
.
showAuth
=
false
;
}
},
}
},
};
};
</
script
>
</
script
>
<
style
>
<
style
scoped
>
.good-one
{
.good-one-style1
{
box-sizing
:
border-box
;
margin
:
12px
;
margin
:
12px
;
position
:
relative
;
position
:
relative
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10px
;
border-radius
:
10px
;
padding-bottom
:
10px
;
padding-bottom
:
10px
;
overflow
:
hidden
;
overflow
:
hidden
;
box-shadow
:
0
4px
10px
1px
#
D2D2D
2
;
box-shadow
:
0
4px
10px
1px
#
d2d2d
2
;
}
}
.good-one
.tips
{
.good-one
-style1
.tips
{
width
:
64
rpx
;
width
:
64
rpx
;
height
:
64
rpx
;
height
:
64
rpx
;
position
:
absolute
;
position
:
absolute
;
...
@@ -172,48 +235,50 @@ export default {
...
@@ -172,48 +235,50 @@ export default {
left
:
0
;
left
:
0
;
z-index
:
4
;
z-index
:
4
;
}
}
.good-one
.guding
{
.good-one
-style1
.guding
{
position
:
relative
;
position
:
relative
;
}
}
.good-one
.guding
.img-box
{
.good-one
-style1
.guding
.img-box
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
right
:
0
;
right
:
0
;
bottom
:
0
;
bottom
:
0
;
top
:
0
;
top
:
0
;
}
}
.good-one
.good-info
{
.good-one-style1
.good-info
{
width
:
700
rpx
;
box-sizing
:
border-box
;
padding
:
12
rpx
;
padding
:
12
rpx
;
padding-bottom
:
0
;
padding-bottom
:
0
;
margin-top
:
-5px
;
margin-top
:
-5px
;
}
}
.good-one
.good-info
.good-name
{
.good-one
-style1
.good-info
.good-name
{
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
-webkit-box-orient
:
vertical
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
font-size
:
32
rpx
;
font-size
:
32
rpx
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.good-one
.good-info
.good-sub-name
{
.good-one
-style1
.good-info
.good-sub-name
{
overflow
:
hidden
;
overflow
:
hidden
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
color
:
#999999
;
color
:
#999999
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.good-one
.good-info
.good-price-info
{
.good-one
-style1
.good-info
.good-price-info
{
display
:
flex
;
display
:
flex
;
}
}
.good-one
.good-info
.good-price-info
.price
{
.good-one
-style1
.good-info
.good-price-info
.price
{
color
:
#ff4544
;
color
:
#ff4544
;
font-size
:
16px
;
font-size
:
16px
;
font-weight
:
600
;
font-weight
:
600
;
flex
:
1
;
flex
:
1
;
}
}
.good-one
.good-info
.good-price-info
.buy
{
.good-one
-style1
.good-info
.good-price-info
.buy
{
/* width: 24px; */
/* width: 24px; */
text-align
:
right
;
text-align
:
right
;
}
}
...
...
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