Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
bd41479a
Commit
bd41479a
authored
Dec 10, 2018
by
Junling Bu
Browse files
feat[litemall-wx]: 小商场前端支持优惠券
parent
80ffb92f
Changes
24
Show whitespace changes
Inline
Side-by-side
litemall-wx/pages/ucenter/couponSelect/couponSelect.wxml
0 → 100644
View file @
bd41479a
<view class="container">
<scroll-view class="coupon-list" scroll-y="true" scroll-top="{{scrollTop}}">
<view class="unselect" bindtap='unselectCoupon'>不选择优惠券</view>
<view class="item" wx:for="{{couponList}}" wx:for-index="index" wx:for-item="item" wx:key="id" bindtap="selectCoupon" data-id="{{item.id}}">
<view class="tag">{{item.tag}}</view>
<view class="content">
<view class="left">
<view class="discount">{{item.discount}}元</view>
<view class="min"> 满{{item.min}}元使用</view>
</view>
<view class="right">
<view class="name">{{item.name}}</view>
<view class="time"> 有效期:{{item.startTime}} - {{item.endTime}}</view>
</view>
</view>
<view class="condition">
<text class="txt">{{item.desc}}</text>
<image src="{{item.pic}}" class="icon"></image>
</view>
</view>
</scroll-view>
</view>
\ No newline at end of file
litemall-wx/pages/ucenter/couponSelect/couponSelect.wxss
0 → 100644
View file @
bd41479a
page {
background: #f4f4f4;
min-height: 100%;
}
.container {
background: #f4f4f4;
min-height: 100%;
padding-top: 30rpx;
}
.coupon-list {
width: 750rpx;
height: 100%;
overflow: hidden;
}
.unselect {
height: 80rpx;
border: none;
width: 700rpx;
background: #28b43b;
color: #fff;
font-size: 40rpx;
text-align: center;
margin-bottom: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
}
.item {
position: relative;
height: 290rpx;
width: 700rpx;
background: linear-gradient(to right, #cfa568, #e3bf79);
margin-bottom: 30rpx;
margin-left: 30rpx;
margin-right: 30rpx;
padding-top: 52rpx;
}
.tag {
height: 32rpx;
background: #a48143;
padding-left: 16rpx;
padding-right: 16rpx;
position: absolute;
left: 20rpx;
color: #fff;
top: 20rpx;
font-size: 20rpx;
text-align: center;
line-height: 32rpx;
}
.content {
margin-top: 24rpx;
margin-left: 40rpx;
display: flex;
margin-right: 40rpx;
flex-direction: row;
}
.content .left {
flex: 1;
}
.discount {
font-size: 50rpx;
color: #b4282d;
}
.min {
color: #fff;
}
.content .right {
width: 400rpx;
}
.name {
font-size: 44rpx;
color: #fff;
margin-bottom: 14rpx;
}
.time {
font-size: 24rpx;
color: #fff;
line-height: 30rpx;
}
.condition {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
height: 78rpx;
background: rgba(0, 0, 0, 0.08);
padding: 24rpx 40rpx;
display: flex;
flex-direction: row;
}
.condition .txt {
display: block;
height: 30rpx;
flex: 1;
overflow: hidden;
font-size: 24rpx;
line-height: 30rpx;
color: #fff;
}
.condition .icon {
margin-left: 30rpx;
width: 24rpx;
height: 24rpx;
}
\ No newline at end of file
litemall-wx/pages/ucenter/index/index.js
View file @
bd41479a
...
@@ -91,20 +91,15 @@ Page({
...
@@ -91,20 +91,15 @@ Page({
};
};
},
},
goCoupon
()
{
goCoupon
()
{
wx
.
showToast
({
if
(
this
.
data
.
hasLogin
)
{
title
:
'
目前不支持
'
,
wx
.
navigateTo
({
icon
:
'
none
'
,
url
:
"
/pages/ucenter/couponList/couponList
"
duration
:
2000
});
});
// if (this.data.hasLogin) {
}
else
{
// wx.navigateTo({
wx
.
navigateTo
({
// url: "/pages/ucenter/coupon/coupon"
url
:
"
/pages/auth/login/login
"
// });
});
// } else {
};
// wx.navigateTo({
// url: "/pages/auth/login/login"
// });
// };
},
},
goGroupon
()
{
goGroupon
()
{
if
(
this
.
data
.
hasLogin
)
{
if
(
this
.
data
.
hasLogin
)
{
...
...
litemall-wx/project.config.json
View file @
bd41479a
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
3
4
,
"current"
:
3
7
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -240,6 +240,23 @@
...
@@ -240,6 +240,23 @@
"name"
:
"团购专区"
,
"name"
:
"团购专区"
,
"pathName"
:
"pages/groupon/grouponList/grouponList"
,
"pathName"
:
"pages/groupon/grouponList/grouponList"
,
"query"
:
""
"query"
:
""
},
{
"id"
:
-1
,
"name"
:
"选择优惠券"
,
"pathName"
:
"pages/ucenter/couponSelect/couponSelect"
,
"query"
:
""
},
{
"id"
:
-1
,
"name"
:
"我的优惠券列表"
,
"pathName"
:
"pages/ucenter/couponList/couponList"
,
"query"
:
""
},
{
"id"
:
-1
,
"name"
:
"优惠券列表"
,
"pathName"
:
"pages/coupon/coupon"
}
}
]
]
}
}
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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