Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
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
viitto
mallapp
Commits
e683e766
Commit
e683e766
authored
Oct 13, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
337412c8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
902 additions
and
901 deletions
+902
-901
style1.vue
components/goods/style1.vue
+128
-136
style2.vue
components/goods/style2.vue
+145
-144
style3.vue
components/goods/style3.vue
+153
-152
style4.vue
components/goods/style4.vue
+149
-148
style5.vue
components/goods/style5.vue
+162
-158
style6.vue
components/goods/style6.vue
+6
-2
style7.vue
components/goods/style7.vue
+159
-161
No files found.
components/goods/style1.vue
View file @
e683e766
<
template
>
<
template
>
<div
<div
: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
v-for=
"(item, gli) in goodList"
:key=
"gli"
class=
"good-one"
@
click=
"openGood(item)"
:style=
"
{
<div
v-for=
"(item, gli) in goodList"
:key=
"gli"
class=
"good-one"
@
click=
"openGood(item)"
: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"
>
<div
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></div>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/>
<image
</div>
style=
"width: calc(100vw - 24px); height: 66vw;"
<image
style=
"width: calc(100vw - 24px); height: 66vw;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
v-if=
"goodsInfo.goodsCoverProportion == '3-2'"
/>
:src=
"item.picUrl"
<image
style=
"
v-if=
"goodsInfo.goodsCoverProportion == '3-2'"
/>
<image
style=
"
width: calc(100vw - 24px);
width: calc(100vw - 24px);
height: 100vw;
height: 100vw;
border-radius: 10rpx 10rpx 0 0;
border-radius: 10rpx 10rpx 0 0;
"
"
v-if=
"goodsInfo.goodsCoverProportion == '1-1'"
v-if=
"goodsInfo.goodsCoverProportion == '1-1'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
: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"
>
{{
item
.
name
}}
</div>
<div
class=
"good-price-info"
>
<div
class=
"good-price-info"
>
...
@@ -42,137 +28,143 @@
...
@@ -42,137 +28,143 @@
<span
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<span
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
{
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
{
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
'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&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<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
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{}
}
else
{
};
this
.
showSku
=
true
;
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.good-one
{
.good-one
{
margin
:
12px
;
margin
:
12px
;
position
:
relative
;
position
:
relative
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
padding-bottom
:
10
rpx
;
padding-bottom
:
10
rpx
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.good-one
.tips
{
width
:
64
rpx
;
.good-one
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.good-one
.guding
{
}
position
:
relative
;
}
.good-one
.guding
{
.good-one
.guding
.img-box
{
position
:
relative
;
position
:
absolute
;
}
left
:
0
;
right
:
0
;
.good-one
.guding
.img-box
{
bottom
:
0
;
position
:
absolute
;
top
:
0
;
left
:
0
;
}
right
:
0
;
.good-one
.good-info
{
bottom
:
0
;
padding
:
12
rpx
;
top
:
0
;
padding-bottom
:
0
;
}
margin-top
:
-5px
;
}
.good-one
.good-info
{
.good-one
.good-info
.good-name
{
padding
:
12
rpx
;
overflow
:
hidden
;
padding-bottom
:
0
;
text-overflow
:
ellipsis
;
margin-top
:
-5px
;
display
:
-webkit-box
;
}
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
.good-one
.good-info
.good-name
{
margin-bottom
:
13px
;
overflow
:
hidden
;
}
text-overflow
:
ellipsis
;
.good-one
.good-info
.good-price-info
{
display
:
-webkit-box
;
display
:
flex
;
-webkit-line-clamp
:
2
;
}
-webkit-box-orient
:
vertical
;
.good-one
.good-info
.good-price-info
.price
{
margin-bottom
:
13px
;
color
:
#ff4544
;
}
font-size
:
14px
;
flex
:
1
;
.good-one
.good-info
.good-price-info
{
}
display
:
flex
;
.good-one
.good-info
.good-price-info
.buy
{
}
/* width: 24px; */
text-align
:
right
;
.good-one
.good-info
.good-price-info
.price
{
}
color
:
#ff4544
;
font-size
:
14px
;
flex
:
1
;
}
.good-one
.good-info
.good-price-info
.buy
{
/* width: 24px; */
text-align
:
right
;
}
</
style
>
</
style
>
components/goods/style2.vue
View file @
e683e766
<
template
>
<
template
>
<view
<view
style=
"padding: 12px; padding-bottom: 0;"
:style=
"
{
style=
"padding: 12px; padding-bottom: 0;"
: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)' : ''
}"
}">
>
<u-row
gutter=
"24"
>
<u-row
gutter=
"24"
>
<u-col
span=
"6"
v-for=
"(item, gli) in goodList"
:key=
"gli"
>
<u-col
span=
"6"
v-for=
"(item, gli) in goodList"
:key=
"gli"
>
<view
<view
class=
"good-two"
@
click=
"openGood(item)"
:style=
"
{
class=
"good-two"
@
click=
"openGood(item)"
: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' : ''
}"
}">
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></view>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/>
</view>
<view
class=
"img-box"
>
<view
class=
"img-box"
>
<view
class=
"img-show"
>
<view
class=
"img-show"
>
<image
<image
style=
"
style=
"
width: 100%;
width: 100%;
height: 100%;
height: 100%;
border-radius: 10rpx 10rpx 0 0;
border-radius: 10rpx 10rpx 0 0;
"
"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
:src=
"item.picUrl"
/>
</view>
</view>
</view>
</view>
<view
class=
"good-info"
>
<view
class=
"good-info"
>
...
@@ -40,19 +32,12 @@
...
@@ -40,19 +32,12 @@
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
{
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
{
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
'backgroundColor':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ?'#FFF' : goodsInfo.buttonColor ,
'color':goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
'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>
</view>
</view>
...
@@ -62,133 +47,149 @@
...
@@ -62,133 +47,149 @@
</u-col>
</u-col>
</u-row>
</u-row>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
goodSku
from
'../goods/goodsku'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{}
}
else
{
};
this
.
showSku
=
true
;
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.good-two
{
.good-two
{
position
:
relative
;
position
:
relative
;
margin-bottom
:
12px
;
margin-bottom
:
12px
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
overflow
:
hidden
;
overflow
:
hidden
;
padding-bottom
:
10
rpx
;
padding-bottom
:
10
rpx
;
}
}
.good-two
.tips
{
width
:
64
rpx
;
.good-two
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.good-two
.img-box
{
}
width
:
100%
;
height
:
0
;
.good-two
.img-box
{
padding-top
:
100%
;
width
:
100%
;
position
:
relative
;
height
:
0
;
}
padding-top
:
100%
;
.good-two
.img-box
.img-show
{
position
:
relative
;
position
:
absolute
;
}
left
:
0
;
top
:
0
;
.good-two
.img-box
.img-show
{
bottom
:
0
;
position
:
absolute
;
right
:
0
;
left
:
0
;
width
:
100%
;
top
:
0
;
height
:
100%
;
bottom
:
0
;
overflow
:
hidden
;
right
:
0
;
}
width
:
100%
;
.good-two
.guding
{
height
:
100%
;
position
:
relative
;
overflow
:
hidden
;
}
}
.good-two
.guding
.img-box
{
position
:
absolute
;
.good-two
.guding
{
left
:
0
;
position
:
relative
;
right
:
0
;
}
bottom
:
0
;
top
:
0
;
.good-two
.guding
.img-box
{
}
position
:
absolute
;
.good-two
.good-info
{
left
:
0
;
padding
:
6
rpx
;
right
:
0
;
margin-top
:
-5px
;
bottom
:
0
;
padding-bottom
:
0
;
top
:
0
;
}
}
.good-two
.good-info
.good-name
{
overflow
:
hidden
;
.good-two
.good-info
{
text-overflow
:
ellipsis
;
padding
:
6
rpx
;
display
:
-webkit-box
;
margin-top
:
-5px
;
-webkit-line-clamp
:
2
;
padding-bottom
:
0
;
-webkit-box-orient
:
vertical
;
}
margin
:
3px
0
;
font-size
:
13px
;
.good-two
.good-info
.good-name
{
height
:
37px
;
overflow
:
hidden
;
}
text-overflow
:
ellipsis
;
.good-two
.good-info
.good-price-info
{
display
:
-webkit-box
;
display
:
flex
;
-webkit-line-clamp
:
2
;
}
-webkit-box-orient
:
vertical
;
.good-two
.good-info
.good-price-info
.price
{
margin
:
3px
0
;
color
:
#ff4544
;
font-size
:
13px
;
flex
:
1
;
height
:
37px
;
font-size
:
14px
;
}
}
.good-two
.good-info
.good-price-info
.buy
{
.good-two
.good-info
.good-price-info
{
/* width: 24px; */
display
:
flex
;
text-align
:
right
;
}
}
.good-two
.good-info
.good-price-info
.price
{
color
:
#ff4544
;
flex
:
1
;
font-size
:
14px
;
}
.good-two
.good-info
.good-price-info
.buy
{
/* width: 24px; */
text-align
:
right
;
}
</
style
>
</
style
>
components/goods/style3.vue
View file @
e683e766
<
template
>
<
template
>
<div
<div
style=
"padding: 12px; padding-bottom: 0;"
:style=
"
{
style=
"padding: 12px; padding-bottom: 0;"
: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)' : ''
}"
}">
>
<u-row
gutter=
"24"
>
<u-row
gutter=
"24"
>
<u-col
span=
"4"
v-for=
"(item, gli) in goodList"
:key=
"gli"
>
<u-col
span=
"4"
v-for=
"(item, gli) in goodList"
:key=
"gli"
>
<div
<div
class=
"good-three"
@
click=
"openGood(item)"
:style=
"
{
class=
"good-three"
@
click=
"openGood(item)"
: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"
>
<div
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></div>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/>
</div>
<div
class=
"img-box"
>
<div
class=
"img-box"
>
<div
class=
"img-show"
>
<div
class=
"img-show"
>
<image
<image
style=
"
style=
"
width: 100%;
width: 100%;
height: 100%;
height: 100%;
border-radius: 10rpx 10rpx 0 0;
border-radius: 10rpx 10rpx 0 0;
"
"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
:src=
"item.picUrl"
/>
</div>
</div>
</div>
</div>
<div
class=
"good-info"
>
<div
class=
"good-info"
>
...
@@ -41,20 +33,13 @@
...
@@ -41,20 +33,13 @@
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${
`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
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>
</view>
</view>
...
@@ -63,142 +48,158 @@
...
@@ -63,142 +48,158 @@
</div>
</div>
</u-col>
</u-col>
</u-row>
</u-row>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<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
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{}
}
else
{
};
this
.
showSku
=
true
;
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.good-three
{
.good-three
{
position
:
relative
;
position
:
relative
;
margin-bottom
:
12px
;
margin-bottom
:
12px
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
overflow
:
hidden
;
overflow
:
hidden
;
padding-bottom
:
5px
;
padding-bottom
:
5px
;
}
}
.good-three
.tips
{
width
:
64
rpx
;
.good-three
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.good-three
.img-box
{
}
width
:
100%
;
height
:
0
;
.good-three
.img-box
{
padding-top
:
100%
;
width
:
100%
;
position
:
relative
;
height
:
0
;
}
padding-top
:
100%
;
.good-three
.img-box
.img-show
{
position
:
relative
;
position
:
absolute
;
}
left
:
0
;
top
:
0
;
.good-three
.img-box
.img-show
{
bottom
:
0
;
position
:
absolute
;
right
:
0
;
left
:
0
;
width
:
100%
;
top
:
0
;
height
:
100%
;
bottom
:
0
;
overflow
:
hidden
;
right
:
0
;
}
width
:
100%
;
.good-three
.guding
{
height
:
100%
;
position
:
relative
;
overflow
:
hidden
;
}
}
.good-three
.guding
.img-box
{
position
:
absolute
;
.good-three
.guding
{
left
:
0
;
position
:
relative
;
right
:
0
;
}
bottom
:
0
;
top
:
0
;
.good-three
.guding
.img-box
{
}
position
:
absolute
;
.good-three
.good-info
{
left
:
0
;
padding
:
6
rpx
;
right
:
0
;
margin-top
:
-5px
;
bottom
:
0
;
padding-bottom
:
0
;
top
:
0
;
}
}
.good-three
.good-info
.good-name
{
overflow
:
hidden
;
.good-three
.good-info
{
text-overflow
:
ellipsis
;
padding
:
6
rpx
;
display
:
-webkit-box
;
margin-top
:
-5px
;
-webkit-line-clamp
:
2
;
padding-bottom
:
0
;
-webkit-box-orient
:
vertical
;
}
margin
:
3px
0
;
font-size
:
13px
;
.good-three
.good-info
.good-name
{
word-break
:
break-all
;
overflow
:
hidden
;
height
:
37px
;
text-overflow
:
ellipsis
;
}
display
:
-webkit-box
;
.good-three
.good-info
.good-price-info
{
-webkit-line-clamp
:
2
;
display
:
flex
;
-webkit-box-orient
:
vertical
;
justify-items
:
center
;
margin
:
3px
0
;
align-items
:
center
;
font-size
:
13px
;
}
word-break
:
break-all
;
.good-three
.good-info
.good-price-info
.price
{
height
:
37px
;
color
:
#ff4544
;
}
flex
:
1
;
font-size
:
14px
;
.good-three
.good-info
.good-price-info
{
white-space
:
nowrap
;
display
:
flex
;
text-overflow
:
ellipsis
;
justify-items
:
center
;
overflow
:
hidden
;
align-items
:
center
;
display
:
flex
;
}
flex-direction
:
column
;
}
.good-three
.good-info
.good-price-info
.price
{
.good-three
.good-info
.good-price-info
.buy
{
color
:
#ff4544
;
width
:
24px
;
flex
:
1
;
text-align
:
right
;
font-size
:
14px
;
}
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
display
:
flex
;
flex-direction
:
column
;
}
.good-three
.good-info
.good-price-info
.buy
{
width
:
24px
;
text-align
:
right
;
}
</
style
>
</
style
>
components/goods/style4.vue
View file @
e683e766
<
template
>
<
template
>
<view
<view
style=
"padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;"
:style=
"
{
style=
"padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;"
: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)' : ''
}"
}">
>
<view
class=
"good-four"
v-for=
"(item, gli) in goodList"
:key=
"gli"
@
click=
"openGood(item)"
:style=
"
{
<view
class=
"good-four"
v-for=
"(item, gli) in goodList"
:key=
"gli"
@
click=
"openGood(item)"
: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' : ''
}"
}">
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></view>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/>
<view
class=
"img-box"
><image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/></view>
</view>
<view
class=
"img-box"
>
<image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
<view
class=
"good-info"
>
<view
class=
"good-info"
>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-price-info"
>
<view
class=
"good-price-info"
>
...
@@ -26,158 +21,164 @@
...
@@ -26,158 +21,164 @@
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
`backgroundColor:$
{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>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
goodSku
from
'../goods/goodsku'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{}
}
else
{
};
this
.
showSku
=
true
;
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false
;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
//格式化价格添加.00
// getPrice(value){
// var html,_val;
// value =Number(value).toFixed(2);
// if(value==0){
// value=0;
// return html = "¥0";
// }else if(value.split('.')[1].substring(1)==0){
// value = Number(value).toFixed(2);
// }
// _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1];
// }
}
}
//格式化价格添加.00
};
// getPrice(value){
// var html,_val;
// value =Number(value).toFixed(2);
// if(value==0){
// value=0;
// return html = "¥0";
// }else if(value.split('.')[1].substring(1)==0){
// value = Number(value).toFixed(2);
// }
// _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1];
// }
}
};
</
script
>
</
script
>
<
style
>
<
style
>
.good-four
{
.good-four
{
position
:
relative
;
position
:
relative
;
margin-bottom
:
14px
;
margin-bottom
:
14px
;
display
:
flex
;
display
:
flex
;
height
:
102px
;
height
:
102px
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
0
1px
1px
0
;
padding
:
0
1px
1px
0
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.good-four
.tips
{
width
:
64
rpx
;
.good-four
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.good-four
.img-box
{
}
width
:
100px
;
height
:
100px
;
.good-four
.img-box
{
}
width
:
100px
;
.good-four
.good-info
{
height
:
100px
;
padding
:
12px
;
}
flex
:
1
;
width
:
1
rpx
;
.good-four
.good-info
{
border
:
10
rpx
;
padding
:
12px
;
padding-bottom
:
0
;
flex
:
1
;
display
:
flex
;
width
:
1
rpx
;
flex-direction
:
column
;
border
:
10
rpx
;
/* width:20%; */
padding-bottom
:
0
;
}
display
:
flex
;
.good-four
.good-info
.good-name
{
flex-direction
:
column
;
font-size
:
13px
;
/* width:20%; */
height
:
34px
;
}
overflow
:
hidden
;
text-overflow
:
ellipsis
;
.good-four
.good-info
.good-name
{
display
:
-webkit-box
;
font-size
:
13px
;
-webkit-line-clamp
:
2
;
height
:
34px
;
-webkit-box-orient
:
vertical
;
overflow
:
hidden
;
}
text-overflow
:
ellipsis
;
.good-four
.good-info
.good-price-info
{
display
:
-webkit-box
;
display
:
flex
;
-webkit-line-clamp
:
2
;
justify-items
:
center
;
-webkit-box-orient
:
vertical
;
align-items
:
flex-end
;
}
height
:
22px
;
flex
:
1
;
.good-four
.good-info
.good-price-info
{
padding-bottom
:
10
rpx
;
display
:
flex
;
}
justify-items
:
center
;
.good-four
.good-info
.good-price-info
.price
{
align-items
:
flex-end
;
color
:
#ff4544
;
height
:
22px
;
flex
:
1
;
flex
:
1
;
font-size
:
14px
;
padding-bottom
:
10
rpx
;
white-space
:
nowrap
;
}
text-overflow
:
ellipsis
;
overflow
:
hidden
;
.good-four
.good-info
.good-price-info
.price
{
}
color
:
#ff4544
;
.good-four
.good-info
.good-price-info
.buy
{
flex
:
1
;
width
:
24px
;
font-size
:
14px
;
text-align
:
right
;
white-space
:
nowrap
;
}
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.good-four
.good-info
.good-price-info
.buy
{
width
:
24px
;
text-align
:
right
;
}
</
style
>
</
style
>
components/goods/style5.vue
View file @
e683e766
<
template
>
<
template
>
<view
<view
class=
"her-scoller"
:style=
"
{
class=
"her-scoller"
: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)' : ''
}"
}">
>
<view
class=
"good-five"
@
click=
"openGood(item)"
v-for=
"(item, gli) in goodList"
:key=
"gli"
:style=
"
{
<view
class=
"good-five"
@
click=
"openGood(item)"
v-for=
"(item, gli) in goodList"
:key=
"gli"
: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' : ''
}"
}">
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></view>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/>
</view>
<view
class=
"img-box"
>
<view
class=
"img-box"
>
<view
class=
"img-show"
>
<view
class=
"img-show"
>
<image
style=
"width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
<image
style=
"width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
</view>
</view>
</view>
<view
class=
"good-info"
>
<view
class=
"good-info"
>
...
@@ -35,171 +29,181 @@
...
@@ -35,171 +29,181 @@
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
`backgroundColor:$
{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>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</view>
</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'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{}
}
else
{
};
this
.
showSku
=
true
;
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.her-scoller
{
.her-scoller
{
overflow-x
:
auto
!important
;
overflow-x
:
auto
!important
;
padding
:
12px
;
padding
:
12px
;
/* display: flex; */
/* display: flex; */
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
/* .her-scoller::after {
/* .her-scoller::after {
clear: both;
clear: both;
content: " ";
content: " ";
display: block;
display: block;
} */
} */
.her-scoller
.good-five
{
.her-scoller
.good-five
{
position
:
relative
;
position
:
relative
;
margin-right
:
12px
;
margin-right
:
12px
;
width
:
30%
;
width
:
30%
;
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
padding-bottom
:
10
rpx
;
padding-bottom
:
10
rpx
;
display
:
inline-block
;
display
:
inline-block
;
/* float: left; */
/* float: left; */
}
}
.her-scoller
.good-five
.tips
{
width
:
64
rpx
;
.her-scoller
.good-five
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.her-scoller
.good-five
.img-box
{
}
width
:
100%
;
height
:
0
;
.her-scoller
.good-five
.img-box
{
padding-top
:
100%
;
width
:
100%
;
position
:
relative
;
height
:
0
;
}
padding-top
:
100%
;
.her-scoller
.good-five
.img-box
.img-show
{
position
:
relative
;
position
:
absolute
;
}
left
:
0
;
top
:
0
;
.her-scoller
.good-five
.img-box
.img-show
{
bottom
:
0
;
position
:
absolute
;
right
:
0
;
left
:
0
;
width
:
100%
;
top
:
0
;
height
:
100%
;
bottom
:
0
;
overflow
:
hidden
;
right
:
0
;
z-index
:
2
;
width
:
100%
;
}
height
:
100%
;
.her-scoller
.good-five
.guding
{
overflow
:
hidden
;
position
:
relative
;
z-index
:
2
;
}
}
.her-scoller
.good-five
.guding
.img-box
{
position
:
absolute
;
.her-scoller
.good-five
.guding
{
left
:
0
;
position
:
relative
;
right
:
0
;
}
bottom
:
0
;
top
:
0
;
.her-scoller
.good-five
.guding
.img-box
{
}
position
:
absolute
;
.her-scoller
.good-five
.good-info
{
left
:
0
;
padding
:
6
rpx
;
right
:
0
;
padding-bottom
:
0
;
bottom
:
0
;
}
top
:
0
;
.her-scoller
.good-five
.good-info
.good-name
{
}
overflow
:
hidden
;
text-overflow
:
ellipsis
;
.her-scoller
.good-five
.good-info
{
display
:
block
;
padding
:
6
rpx
;
-webkit-line-clamp
:
2
;
padding-bottom
:
0
;
-webkit-box-orient
:
vertical
;
}
margin-bottom
:
4
rpx
;
font-size
:
13px
;
.her-scoller
.good-five
.good-info
.good-name
{
width
:
100%
;
overflow
:
hidden
;
}
text-overflow
:
ellipsis
;
.her-scoller
.good-five
.good-info
.good-price-info
{
display
:
block
;
display
:
flex
;
-webkit-line-clamp
:
2
;
justify-items
:
center
;
-webkit-box-orient
:
vertical
;
align-items
:
center
;
margin-bottom
:
4
rpx
;
}
font-size
:
13px
;
.her-scoller
.good-five
.good-info
.good-price-info
.price
{
width
:
100%
;
color
:
#ff4544
;
}
flex
:
1
;
font-size
:
14px
;
.her-scoller
.good-five
.good-info
.good-price-info
{
white-space
:
nowrap
;
display
:
flex
;
text-overflow
:
ellipsis
;
justify-items
:
center
;
overflow
:
hidden
;
align-items
:
center
;
display
:
flex
;
}
flex-direction
:
column
;
}
.her-scoller
.good-five
.good-info
.good-price-info
.price
{
.her-scoller
.good-five
.good-info
.good-price-info
.buy
{
color
:
#ff4544
;
width
:
24px
;
flex
:
1
;
text-align
:
right
;
font-size
:
14px
;
}
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
display
:
flex
;
flex-direction
:
column
;
}
.her-scoller
.good-five
.good-info
.good-price-info
.buy
{
width
:
24px
;
text-align
:
right
;
}
</
style
>
</
style
>
components/goods/style6.vue
View file @
e683e766
...
@@ -46,8 +46,12 @@
...
@@ -46,8 +46,12 @@
</view>
</view>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</view>
</template>
</template>
...
...
components/goods/style7.vue
View file @
e683e766
<
template
>
<
template
>
<view
<view
style=
"padding:0 12px;width:100%;"
:style=
"
{
style=
"padding:0 12px;width:100%;"
: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)' : ''
}"
}">
>
<view
class=
"good-seven"
v-for=
"(item, gli) in goodList"
:key=
"gli"
@
click=
"openGood(item)"
:style=
"
{
<view
class=
"good-seven"
v-for=
"(item, gli) in goodList"
:key=
"gli"
@
click=
"openGood(item)"
: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' : ''
}"
}">
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></view>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/>
<view
class=
"img-box"
><image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/></view>
</view>
<view
class=
"img-box"
>
<image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
<view
class=
"good-info"
>
<view
class=
"good-info"
>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-price-info"
>
<view
class=
"good-price-info"
>
<view>
<view>
<u-rate
<u-rate
:current=
"item.courseScore!=null &&item.courseScore>0?item.courseScore:'5'"
:active-color=
"mainColor"
:current=
"item.courseScore!=null &&item.courseScore>0?item.courseScore:'5'"
inactive-color=
"#DDDDDD"
active-icon=
"star"
inactive-icon=
"star-o"
size=
"20"
:disabled=
"true"
></u-rate>
:active-color=
"mainColor"
inactive-color=
"#DDDDDD"
<text
class=
"good-rb-text"
>
{{
item
.
courseScore
!=
null
&&
item
.
courseScore
>
0
?
item
.
courseScore
.
toFixed
(
1
):
'5.0'
}}
分
</text>
active-icon=
"star"
inactive-icon=
"star-o"
size=
"20"
:disabled=
"true"
></u-rate>
<text
class=
"good-rb-text"
>
{{
item
.
courseScore
!=
null
&&
item
.
courseScore
>
0
?
item
.
courseScore
.
toFixed
(
1
):
'5.0'
}}
分
</text>
</view>
</view>
<view
class=
"price"
:style=
"
{ color: mainColor }" v-if="item.price>0">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
<view
class=
"price"
:style=
"
{ color: mainColor }" v-if="item.price>0">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
<span
style=
'text-decoration: line-through;margin-left: 3px;font-size: 10px;color: gray;font-family: aa;'
>
原价:
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
OriginalPrice
)
:
''
}}
</span>
<span
style=
'text-decoration: line-through;margin-left: 3px;font-size: 10px;color: gray;font-family: aa;'
>
原价:
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
OriginalPrice
)
:
''
}}
</span>
...
@@ -40,163 +29,172 @@
...
@@ -40,163 +29,172 @@
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
@
click
.
stop=
"showSkuHandler(item)"
>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"cart-o"
size=
"40"
:color=
"mainColor"
v-if=
"goodsInfo.buyBtn == 'cart'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-icon
name=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
`backgroundColor:$
{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>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku&&!u.TenantId!=27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<template
v-if=
"u&&u.TenantId==27"
>
<good-sku2
v-if=
"showSku&&u.TenantId==27"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
<good-sku2
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku2>
</
template
>
<
template
v-else
>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
</
template
>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
goodSku
from
'../goods/goodsku'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
goodSku2
from
'../goods/goodsku2'
;
import
auth
from
'@/components/auth/index.vue'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
export
default
{
components
:
{
components
:
{
goodSku
,
goodSku
,
goodSku2
,
goodSku2
,
auth
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{},
IsEducation
:
1
};
},
created
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
IsEducation
=
uni
.
getStorageSync
(
'basedata'
)
?
(
uni
.
getStorageSync
(
'basedata'
).
mall
.
setting
.
mallStyle
.
IsEducation
?
uni
.
getStorageSync
(
'basedata'
).
mall
.
setting
.
mallStyle
.
IsEducation
:
0
)
:
0
;
},
methods
:
{
openGood
(
item
)
{
if
(
this
.
IsEducation
==
1
){
uni
.
navigateTo
({
url
:
'/pages/school/courseInfo?GoodsId='
+
item
.
id
});
}
else
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
}
},
},
showSkuHandler
(
g
)
{
props
:
[
'goodList'
,
'goodsInfo'
],
this
.
sku
=
g
;
data
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
return
{
if
(
!
this
.
u
)
{
mainColor
:
''
,
this
.
u
=
{
activeKey
:
0
,
nickName
:
'未登录'
,
showSku
:
false
,
avatarUrl
:
''
sku
:
{},
};
showAuth
:
false
,
this
.
showAuth
=
true
;
u
:
{},
}
else
{
IsEducation
:
1
this
.
showSku
=
true
;
};
}
},
},
reloadUserinfo
()
{
created
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
this
.
mainColor
=
this
.
$uiConfig
.
mainColor
;
this
.
IsEducation
=
uni
.
getStorageSync
(
'basedata'
)
?
(
uni
.
getStorageSync
(
'basedata'
).
mall
.
setting
.
mallStyle
.
IsEducation
?
uni
.
getStorageSync
(
'basedata'
).
mall
.
setting
.
mallStyle
.
IsEducation
:
0
)
:
0
;
},
},
//关闭登录窗口
methods
:
{
gbAuth
()
{
openGood
(
item
)
{
this
.
showAuth
=
false
;
if
(
this
.
IsEducation
==
1
)
{
uni
.
navigateTo
({
url
:
'/pages/school/courseInfo?GoodsId='
+
item
.
id
});
}
else
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
}
},
showSkuHandler
(
g
)
{
this
.
sku
=
g
;
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
if
(
!
this
.
u
)
{
this
.
u
=
{
nickName
:
'未登录'
,
avatarUrl
:
''
};
this
.
showAuth
=
true
;
}
else
{
this
.
showSku
=
true
;
}
},
reloadUserinfo
()
{
this
.
u
=
uni
.
getStorageSync
(
'mall_UserInfo'
);
// this.showAuth = false;
},
//关闭登录窗口
gbAuth
()
{
this
.
showAuth
=
false
;
}
}
}
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
.good-seven
{
.good-seven
{
position
:
relative
;
position
:
relative
;
margin-bottom
:
14px
;
margin-bottom
:
14px
;
display
:
flex
;
display
:
flex
;
/* height: 102px; */
/* height: 102px; */
border
:
1
rpx
solid
transparent
;
border
:
1
rpx
solid
transparent
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
0
1px
1px
0
;
padding
:
0
1px
1px
0
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
.good-seven
.tips
{
width
:
64
rpx
;
.good-seven
.tips
{
height
:
64
rpx
;
width
:
64
rpx
;
position
:
absolute
;
height
:
64
rpx
;
top
:
0
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
4
;
left
:
0
;
}
z-index
:
4
;
.good-seven
.img-box
{
}
width
:
125px
;
height
:
70px
;
.good-seven
.img-box
{
border-radius
:
4px
;
width
:
125px
;
overflow
:
hidden
;
height
:
70px
;
box-shadow
:
0
4px
10px
1px
#D2D2D2
;
border-radius
:
4px
;
}
overflow
:
hidden
;
.good-seven
.good-info
{
box-shadow
:
0
4px
10px
1px
#D2D2D2
;
padding-left
:
12px
;
}
flex
:
1
;
width
:
1
rpx
;
border
:
10
rpx
;
padding-bottom
:
0
;
display
:
flex
;
flex-direction
:
column
;
/* width:20%; */
}
.good-seven
.good-info
.good-name
{
font-size
:
13px
;
height
:
34px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.good-seven
.good-info
.good-price-info
{
display
:
flex
;
justify-items
:
center
;
justify-content
:
space-between
;
align-items
:
flex-end
;
height
:
10px
;
flex
:
1
;
padding-bottom
:
10
rpx
;
}
.good-seven
.good-rb-text
{
font-size
:
11px
;
color
:
#999999
;
margin-top
:
3px
;
margin-left
:
2px
;
}
.good-seven
.good-info
.good-price-info
.price
{
.good-seven
.good-info
{
color
:
#ff4544
;
padding-left
:
12px
;
font-size
:
14px
;
flex
:
1
;
white-space
:
nowrap
;
width
:
1
rpx
;
text-overflow
:
ellipsis
;
border
:
10
rpx
;
overflow
:
hidden
;
padding-bottom
:
0
;
}
display
:
flex
;
.good-seven
.good-info
.good-price-info
.buy
{
flex-direction
:
column
;
width
:
24px
;
/* width:20%; */
text-align
:
right
;
}
}
.good-seven
.good-info
.good-name
{
font-size
:
13px
;
height
:
34px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.good-seven
.good-info
.good-price-info
{
display
:
flex
;
justify-items
:
center
;
justify-content
:
space-between
;
align-items
:
flex-end
;
height
:
10px
;
flex
:
1
;
padding-bottom
:
10
rpx
;
}
.good-seven
.good-rb-text
{
font-size
:
11px
;
color
:
#999999
;
margin-top
:
3px
;
margin-left
:
2px
;
}
.good-seven
.good-info
.good-price-info
.price
{
color
:
#ff4544
;
font-size
:
14px
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
}
.good-seven
.good-info
.good-price-info
.buy
{
width
:
24px
;
text-align
:
right
;
}
</
style
>
</
style
>
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