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
10bd72ba
Commit
10bd72ba
authored
Jun 11, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
0996b060
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
911 additions
and
944 deletions
+911
-944
goodsku.vue
components/goods/goodsku.vue
+14
-27
style1.vue
components/goods/style1.vue
+137
-141
style2.vue
components/goods/style2.vue
+154
-148
style3.vue
components/goods/style3.vue
+159
-164
style4.vue
components/goods/style4.vue
+153
-163
style5.vue
components/goods/style5.vue
+154
-162
style6.vue
components/goods/style6.vue
+140
-139
No files found.
components/goods/goodsku.vue
View file @
10bd72ba
...
...
@@ -21,9 +21,7 @@
</view>
<view
class=
"amount"
>
库存
{{
goodamount
}}
{{
g
.
unit
}}
</view>
<view
class=
"sku"
>
{{
skuObj
?
'已选择'
:
'选择'
}}
{{
sku
}}
</view>
<view
class=
"sku_close"
>
<u-icon
name=
"cross"
color=
"#9F9F9F"
@
click=
"cloGood()"
size=
"40"
/>
</view>
<view
class=
"sku_close"
><u-icon
name=
"cross"
color=
"#9F9F9F"
@
click=
"cloGood()"
size=
"40"
/></view>
</view>
</view>
<view
class=
"sku-box"
>
...
...
@@ -204,7 +202,7 @@ export default {
GoodsId
:
this
.
skuObj
.
goods_id
,
SpecificationSort
:
this
.
skuObj
.
sign_id
,
Number
:
this
.
gc
==
0
?
1
:
this
.
gc
}
,
}
},
res
=>
{
uni
.
showToast
({
...
...
@@ -225,38 +223,27 @@ export default {
}
},
buy
()
{
let
ShoppingCartIdList
=
[];
let
ShoppingCartIdList
=
[];
if
(
this
.
skuObj
&&
this
.
skuObj
.
id
)
{
let
good
=
{
DetailList
:
[],
Use_Integral
:
0
,
User_Coupon_Id
:
0
,
DeliveryMethod
:
0
,
AddressId
:
0
,
DeliveryMethod
:
0
,
AddressId
:
0
};
let
g
=
{
GoodsId
:
this
.
skuObj
.
goods_id
,
Number
:
this
.
gc
,
SpecificationSort
:
this
.
skuObj
.
sign_id
,
SpecificationSort
:
this
.
skuObj
.
sign_id
};
good
.
DetailList
.
push
(
g
);
// let g = {
// id: this.skuObj.goods_id,
// num: this.gc,
// cart_id: 0,
// goods_attr_id: this.skuObj.id,
// attr: []
// };
// this.skuObj.attr_list.forEach(x => {
// g.attr.push({
// attr_id: x.attr_id,
// attr_group_id: x.attr_group_id
// });
// });
// this.forms.list[0].goods_list.push(g);
// this.forms.list[0].mch_id = this.g.mch_id;
uni
.
navigateTo
({
url
:
'/pages/order-submit/order-submit?formData='
+
encodeURIComponent
(
JSON
.
stringify
(
good
))
+
'&IsFormShoppingCart=2&ShoppingCartIdList='
+
JSON
.
stringify
(
ShoppingCartIdList
),
url
:
'/pages/order-submit/order-submit?formData='
+
encodeURIComponent
(
JSON
.
stringify
(
good
))
+
'&IsFormShoppingCart=2&ShoppingCartIdList='
+
JSON
.
stringify
(
ShoppingCartIdList
),
complete
(
res
)
{
console
.
log
(
res
);
}
...
...
@@ -423,7 +410,7 @@ export default {
width
:
1px
;
position
:
relative
;
}
.goodsku
.chosen-info
.sku_close
{
.goodsku
.chosen-info
.sku_close
{
position
:
absolute
;
right
:
4px
;
top
:
5px
;
...
...
components/goods/style1.vue
View file @
10bd72ba
...
...
@@ -3,7 +3,7 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<div
...
...
@@ -13,17 +13,10 @@
@
click=
"openGood(item)"
:style=
"
{
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
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></div>
<image
style=
"width: calc(100vw - 24px); height: 66vw;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
...
...
@@ -41,66 +34,52 @@
:src=
"item.picUrl"
/>
<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"
>
<span
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</span>
<span
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</span>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<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-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</span>
</div>
</div>
</div>
<good-sku
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>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
components
:{
goodSku
components
:
{
goodSku
,
auth
},
props
:
[
"goodList"
,
"goodsInfo"
],
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:{}
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -108,13 +87,30 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
){
this
.
sku
=
g
this
.
showSku
=
true
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
>
...
...
components/goods/style2.vue
View file @
10bd72ba
...
...
@@ -4,7 +4,7 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'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"
>
...
...
@@ -13,17 +13,11 @@
class=
"good-two"
@
click=
"openGood(item)"
:style=
"
{
border:
goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2
? '#FFF'
: '',
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/>
</view>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></view>
<view
class=
"img-box"
>
<view
class=
"img-show"
>
<image
...
...
@@ -38,65 +32,56 @@
</view>
</view>
<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=
"price"
:style=
"
{'color':mainColor}">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</view>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
>
<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'"
/>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</view>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{
goodsInfo.buttonColor
},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</view>
</view>
</view>
</view>
</u-col>
</u-row>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
props
:
[
"goodList"
,
"goodsInfo"
],
components
:
{
goodSku
,
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -104,9 +89,30 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
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
>
...
...
@@ -166,7 +172,7 @@ export default {
-webkit-box-orient
:
vertical
;
margin
:
3px
0
;
font-size
:
13px
;
min-height
:
35px
;
min-height
:
35px
;
}
.good-two
.good-info
.good-price-info
{
display
:
flex
;
...
...
components/goods/style3.vue
View file @
10bd72ba
...
...
@@ -4,26 +4,20 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'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-col
span=
"4"
v-for=
"(item, gli) in goodList"
:key=
"gli"
<u-col
span=
"4"
v-for=
"(item, gli) in goodList"
:key=
"gli"
>
<div
class=
"good-three"
@
click=
"openGood(item)"
:style=
"
{
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<div
class=
"good-three"
@
click=
"openGood(item)"
:style=
"
{
border:
goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
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
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></div>
<div
class=
"img-box"
>
<div
class=
"img-show"
>
<image
...
...
@@ -38,49 +32,28 @@
</div>
</div>
<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"
>
<view
class=
"price"
:style=
"
{'color':mainColor}">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</view>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</view>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<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-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{
goodsInfo.buttonColor
},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'
}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</view>
</div>
</div>
...
...
@@ -88,22 +61,27 @@
</u-col>
</u-row>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</div>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
components
:{
goodSku
components
:
{
goodSku
,
auth
},
props
:
[
"goodList"
,
"goodsInfo"
],
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:{}
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -111,13 +89,30 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
){
this
.
sku
=
g
this
.
showSku
=
true
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
>
...
...
@@ -177,8 +172,8 @@ export default {
-webkit-box-orient
:
vertical
;
margin
:
3px
0
;
font-size
:
13px
;
word-break
:
break-all
;
min-height
:
34px
;
word-break
:
break-all
;
min-height
:
34px
;
}
.good-three
.good-info
.good-price-info
{
display
:
flex
;
...
...
components/goods/style4.vue
View file @
10bd72ba
...
...
@@ -4,7 +4,7 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
...
...
@@ -14,85 +14,58 @@
@
click=
"openGood(item)"
:style=
"
{
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"
>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/>
</view>
<view
class=
"img-box"
>
<image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></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-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=
"price"
:style=
"
{'color':mainColor}">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</view>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</view>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<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-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku"
:option-type=
"2"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
components
:{
goodSku
components
:
{
goodSku
,
auth
},
props
:
[
"goodList"
,
"goodsInfo"
],
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:{}
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -100,12 +73,29 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
){
this
.
sku
=
g
this
.
showSku
=
true
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;
...
...
@@ -119,7 +109,7 @@ export default {
// _val = value.split('.');
// return html = '¥'+_val[0]+'.'+_val[1];
// }
},
}
};
</
script
>
...
...
components/goods/style5.vue
View file @
10bd72ba
...
...
@@ -4,7 +4,7 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
...
...
@@ -13,87 +13,62 @@
v-for=
"(item, gli) in goodList"
:key=
"gli"
:style=
"
{
'border': goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background:
goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2
? '#FFF'
: '',
border: goodsInfo.goodsStyle == 2 ? '1px solid rgb(226, 226, 226)' : '',
background: goodsInfo.goodsStyle == 1 || goodsInfo.goodsStyle == 2 ? '#FFF' : ''
}"
>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/>
</view>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width:100%"
/></view>
<view
class=
"img-box"
>
<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"
/>
</view>
<image
style=
"width: 100%; height: 100%; border-radius: 10rpx 10rpx 0 0;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
<view
class=
"good-info"
>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-info"
>
<view
class=
"good-name"
v-if=
"goodsInfo.showGoodsName"
>
{{
item
.
name
}}
</view>
<view
class=
"good-price-info"
>
<view
class=
"price"
:style=
"
{'color':mainColor}">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</view>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</view>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<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-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku"
:option-type=
"2"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
components
:{
goodSku
components
:
{
goodSku
,
auth
},
props
:
[
"goodList"
,
"goodsInfo"
],
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:{}
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -101,13 +76,30 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
},
showSkuHandler
(
g
){
this
.
sku
=
g
this
.
showSku
=
true
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
>
...
...
components/goods/style6.vue
View file @
10bd72ba
...
...
@@ -4,7 +4,7 @@
:style=
"
{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : '',
'border-color': goodsInfo.goodsStyle == 2 ? 'rgb(226, 226, 226)' : ''
}"
>
<view
...
...
@@ -14,78 +14,58 @@
@
click=
"openGood(item)"
:style=
"
{
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"
>
<image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/>
</view>
<view
class=
"img-box"
>
<image
style=
"width: 100%; height: 100%;"
:mode=
"goodsInfo.fill == 1 ? 'aspectFill' : 'aspectFit'"
:src=
"item.picUrl"
/>
</view>
<view
class=
"tips"
v-if=
"goodsInfo.showGoodsTag"
><image
:src=
"goodsInfo.goodsTagPicUrl"
mode=
"widthFix"
style=
"width: 100%;"
/></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-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=
"price"
:style=
"
{'color':mainColor}">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
""
}}
</view>
<view
class=
"buy"
v-if=
"goodsInfo.showBuyBtn"
>
<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'"
/>
<view
class=
"price"
:style=
"
{ color: mainColor }">
{{
goodsInfo
.
showGoodsPrice
?
getPrice
(
item
.
price
)
:
''
}}
</view>
<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=
"add-o"
size=
"40"
:color=
"mainColor"
v-else-if=
"goodsInfo.buyBtn == 'add'"
/>
<u-button
type=
"primary"
size=
"mini"
:ripple=
"true"
:color=
"goodsInfo.buttonColor"
:custom-style=
"`backgroundColor:$
{goodsInfo.buttonColor},color:${
goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4
? goodsInfo.buttonColor
: '#FFF'
}`"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="
goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4
? 'circle'
: 'square'
:custom-style=
"
`backgroundColor:$
{goodsInfo.buttonColor},color:${goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4 ? goodsInfo.buttonColor : '#FFF'}`
"
:plain="goodsInfo.buyBtnStyle == 2 || goodsInfo.buyBtnStyle == 4"
:shape="goodsInfo.buyBtnStyle == 3 || goodsInfo.buyBtnStyle == 4 ? 'circle' : 'square'"
v-else
>
{{
goodsInfo
.
buyBtnText
}}
</u-button
>
{{
goodsInfo
.
buyBtnText
}}
</u-button>
</view>
</view>
</view>
</view>
<good-sku
v-if=
"showSku"
borderRadius=
"20"
v-model=
"showSku"
:good=
"sku"
:option-type=
"2"
></good-sku>
<auth
v-if=
"showAuth"
@
changeuserinfo=
"reloadUserinfo"
@
gbAuth=
"gbAuth"
></auth>
</view>
</
template
>
<
script
>
import
goodSku
from
'../goods/goodsku'
;
import
auth
from
'@/components/auth/index.vue'
;
export
default
{
props
:
[
"goodList"
,
"goodsInfo"
],
components
:
{
goodSku
,
auth
},
props
:
[
'goodList'
,
'goodsInfo'
],
data
()
{
return
{
mainColor
:
""
,
mainColor
:
''
,
activeKey
:
0
,
showSku
:
false
,
sku
:
{},
showAuth
:
false
,
u
:
{}
};
},
created
()
{
...
...
@@ -93,9 +73,30 @@ export default {
},
methods
:
{
openGood
(
item
)
{
uni
.
navigateTo
({
url
:
'/pages/goods/goods?GoodsId='
+
item
.
id
});
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
>
...
...
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