Commit bd41479a authored by Junling Bu's avatar Junling Bu
Browse files

feat[litemall-wx]: 小商场前端支持优惠券

parent 80ffb92f
<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
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
......@@ -91,20 +91,15 @@ Page({
};
},
goCoupon() {
wx.showToast({
title: '目前不支持',
icon: 'none',
duration: 2000
});
// if (this.data.hasLogin) {
// wx.navigateTo({
// url: "/pages/ucenter/coupon/coupon"
// });
// } else {
// wx.navigateTo({
// url: "/pages/auth/login/login"
// });
// };
if (this.data.hasLogin) {
wx.navigateTo({
url: "/pages/ucenter/couponList/couponList"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goGroupon() {
if (this.data.hasLogin) {
......
{
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"uglifyFileName": true
},
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wxa5b486c6b918ecfb",
"projectname": "litemall-wx",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 34,
"list": [
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "专题",
"pathName": "pages/topic/topic",
"query": ""
},
{
"id": -1,
"name": "专题详情",
"pathName": "pages/topicDetail/topicDetail",
"query": "id=314"
},
{
"id": -1,
"name": "专题评论列表",
"pathName": "pages/topicComment/topicComment",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "专题评论添加",
"pathName": "pages/topicCommentPost/topicCommentPost",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "品牌",
"pathName": "pages/brand/brand",
"query": ""
},
{
"id": -1,
"name": "品牌详情",
"pathName": "pages/brandDetail/brandDetail",
"query": "id=1001000"
},
{
"id": -1,
"name": "人气推荐",
"pathName": "pages/hotGoods/hotGoods",
"query": ""
},
{
"id": -1,
"name": "新品首发",
"pathName": "pages/newGoods/newGoods",
"query": ""
},
{
"id": -1,
"name": "分类",
"pathName": "pages/catalog/catalog",
"query": ""
},
{
"id": -1,
"name": "分类详情",
"pathName": "pages/category/category",
"query": "id=1008002"
},
{
"id": -1,
"name": "查找",
"pathName": "pages/search/search",
"query": ""
},
{
"id": 12,
"name": "商品",
"pathName": "pages/goods/goods",
"query": "id=1181003"
},
{
"id": -1,
"name": "商品评论列表",
"pathName": "pages/comment/comment",
"query": "valueId=1181000&type=0"
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart/cart",
"query": ""
},
{
"id": -1,
"name": "下单",
"pathName": "pages/checkout/checkout",
"query": ""
},
{
"id": -1,
"name": "支付结果",
"pathName": "pages/payResult/payResult",
"query": ""
},
{
"id": -1,
"name": "我的",
"pathName": "pages/ucenter/index/index",
"query": ""
},
{
"id": -1,
"name": "我的订单列表",
"pathName": "pages/ucenter/order/order",
"query": ""
},
{
"id": -1,
"name": "我的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": 22,
"name": "待评价的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": -1,
"name": "购买商品评价",
"pathName": "pages/commentPost/commentPost",
"query": "orderId=2&type=0&valueId=1116011"
},
{
"id": -1,
"name": "我的优惠券",
"pathName": "pages/ucenter/coupon/coupon",
"query": ""
},
{
"id": -1,
"name": "我的收藏",
"pathName": "pages/ucenter/collect/collect",
"query": ""
},
{
"id": -1,
"name": "我的足迹",
"pathName": "pages/ucenter/footprint/footprint",
"query": ""
},
{
"id": -1,
"name": "我的地址",
"pathName": "pages/ucenter/address/address",
"query": ""
},
{
"id": -1,
"name": "我的地址添加",
"pathName": "pages/ucenter/addressAdd/addressAdd",
"query": ""
},
{
"id": -1,
"name": "登录",
"pathName": "pages/auth/login/login",
"query": ""
},
{
"id": -1,
"name": "账号登录",
"pathName": "pages/auth/accountLogin/accountLogin",
"query": ""
},
{
"id": -1,
"name": "注册",
"pathName": "pages/auth/register/register",
"query": ""
},
{
"id": -1,
"name": "找回密码",
"pathName": "pages/auth/reset/reset",
"query": ""
},
{
"id": -1,
"name": "关于",
"pathName": "pages/about/about",
"query": ""
},
{
"id": -1,
"name": "测试更新",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "意见反馈",
"pathName": "pages/ucenter/feedback/feedback",
"query": ""
},
{
"id": -1,
"name": "团购专区",
"pathName": "pages/groupon/grouponList/grouponList",
"query": ""
}
]
}
}
"description": "项目配置文件。",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"uglifyFileName": true
},
"compileType": "miniprogram",
"libVersion": "2.4.0",
"appid": "wxa5b486c6b918ecfb",
"projectname": "litemall-wx",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"plugin": {
"current": -1,
"list": []
},
"game": {
"list": []
},
"miniprogram": {
"current": 37,
"list": [
{
"id": -1,
"name": "首页",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "专题",
"pathName": "pages/topic/topic",
"query": ""
},
{
"id": -1,
"name": "专题详情",
"pathName": "pages/topicDetail/topicDetail",
"query": "id=314"
},
{
"id": -1,
"name": "专题评论列表",
"pathName": "pages/topicComment/topicComment",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "专题评论添加",
"pathName": "pages/topicCommentPost/topicCommentPost",
"query": "valueId=314&type=1"
},
{
"id": -1,
"name": "品牌",
"pathName": "pages/brand/brand",
"query": ""
},
{
"id": -1,
"name": "品牌详情",
"pathName": "pages/brandDetail/brandDetail",
"query": "id=1001000"
},
{
"id": -1,
"name": "人气推荐",
"pathName": "pages/hotGoods/hotGoods",
"query": ""
},
{
"id": -1,
"name": "新品首发",
"pathName": "pages/newGoods/newGoods",
"query": ""
},
{
"id": -1,
"name": "分类",
"pathName": "pages/catalog/catalog",
"query": ""
},
{
"id": -1,
"name": "分类详情",
"pathName": "pages/category/category",
"query": "id=1008002"
},
{
"id": -1,
"name": "查找",
"pathName": "pages/search/search",
"query": ""
},
{
"id": 12,
"name": "商品",
"pathName": "pages/goods/goods",
"query": "id=1181003"
},
{
"id": -1,
"name": "商品评论列表",
"pathName": "pages/comment/comment",
"query": "valueId=1181000&type=0"
},
{
"id": -1,
"name": "购物车",
"pathName": "pages/cart/cart",
"query": ""
},
{
"id": -1,
"name": "下单",
"pathName": "pages/checkout/checkout",
"query": ""
},
{
"id": -1,
"name": "支付结果",
"pathName": "pages/payResult/payResult",
"query": ""
},
{
"id": -1,
"name": "我的",
"pathName": "pages/ucenter/index/index",
"query": ""
},
{
"id": -1,
"name": "我的订单列表",
"pathName": "pages/ucenter/order/order",
"query": ""
},
{
"id": -1,
"name": "我的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": 22,
"name": "待评价的订单详情",
"pathName": "pages/ucenter/orderDetail/orderDetail",
"query": "id=1"
},
{
"id": -1,
"name": "购买商品评价",
"pathName": "pages/commentPost/commentPost",
"query": "orderId=2&type=0&valueId=1116011"
},
{
"id": -1,
"name": "我的优惠券",
"pathName": "pages/ucenter/coupon/coupon",
"query": ""
},
{
"id": -1,
"name": "我的收藏",
"pathName": "pages/ucenter/collect/collect",
"query": ""
},
{
"id": -1,
"name": "我的足迹",
"pathName": "pages/ucenter/footprint/footprint",
"query": ""
},
{
"id": -1,
"name": "我的地址",
"pathName": "pages/ucenter/address/address",
"query": ""
},
{
"id": -1,
"name": "我的地址添加",
"pathName": "pages/ucenter/addressAdd/addressAdd",
"query": ""
},
{
"id": -1,
"name": "登录",
"pathName": "pages/auth/login/login",
"query": ""
},
{
"id": -1,
"name": "账号登录",
"pathName": "pages/auth/accountLogin/accountLogin",
"query": ""
},
{
"id": -1,
"name": "注册",
"pathName": "pages/auth/register/register",
"query": ""
},
{
"id": -1,
"name": "找回密码",
"pathName": "pages/auth/reset/reset",
"query": ""
},
{
"id": -1,
"name": "关于",
"pathName": "pages/about/about",
"query": ""
},
{
"id": -1,
"name": "测试更新",
"pathName": "pages/index/index",
"query": ""
},
{
"id": -1,
"name": "意见反馈",
"pathName": "pages/ucenter/feedback/feedback",
"query": ""
},
{
"id": -1,
"name": "团购专区",
"pathName": "pages/groupon/grouponList/grouponList",
"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"
}
]
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment