Commit a697e696 authored by Menethil's avatar Menethil
Browse files

小程序添加团购

parent b2d9fd3c
<!--index.wxml-->
<view class="container">
<swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="1000">
......@@ -14,6 +13,41 @@
<text>{{item.name}}</text>
</navigator>
</view>
<view class="a-section a-groupon" wx:if="{{groupons.length > 0}}">
<view class="h">
<view class="title">
<view>
<!-- <navigator url="../hotGoods/hotGoods"> -->
<text class="txt">优惠专区</text>
<!-- </navigator> -->
</view>
</view>
</view>
<view class="b">
<view class="item" wx:for="{{groupons}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.goods.id}}">
<image class="img" src="{{item.goods.picUrl}}" background-size="cover"></image>
<view class="right">
<view class="text">
<view class="header">
<text class="name">{{item.goods.name}}</text>
<view class="capsule-tag">
<zan-capsule color="#a78845" leftText="团购" rightText="{{item.groupon_member}}" />
</view>
</view>
<text class="desc">{{item.goods.brief}}</text>
<view class="price">
<view class="counterPrice">原价:¥{{item.goods.counterPrice}}</view>
<view class="retailPrice">现价:¥{{item.groupon_price}}</view>
</view>
</view>
</view>
</navigator>
</view>
</view>
</view>
<view class="a-section a-brand">
<view class="h">
<navigator url="../brand/brand">
......@@ -53,6 +87,7 @@
</view>
</view>
</view>
<view class="a-section a-popular" wx:if="{{hotGoods.length > 0}}">
<view class="h">
<view>
......@@ -76,6 +111,7 @@
</view>
</view>
</view>
<view class="a-section a-topic" wx:if="topics.length > 0">
<view class="h">
<view>
......
......@@ -123,6 +123,92 @@
height: 253rpx;
}
.a-groupon {
width: 750rpx;
height: auto;
overflow: hidden;
}
.a-groupon .b .item {
border-top: 1px solid #d9d9d9;
margin: 0 20rpx;
height: 244rpx;
width: 710rpx;
}
.a-groupon .b .img {
margin-top: 12rpx;
margin-right: 12rpx;
float: left;
width: 220rpx;
height: 220rpx;
}
.a-groupon .b .right {
float: left;
height: 244rpx;
width: 476rpx;
display: flex;
flex-flow: row nowrap;
}
.a-groupon .b .text {
display: flex;
flex-wrap: nowrap;
flex-direction: column;
justify-content: center;
overflow: hidden;
height: 244rpx;
width: 476rpx;
}
.a-groupon .b .name {
float: left;
width: 330rpx;
display: block;
color: #333;
line-height: 50rpx;
font-size: 30rpx;
}
.a-groupon .capsule-tag {
float: right;
padding-right: 0rpx;
padding-top: 8rpx;
}
.a-groupon .zan-capsule + .zan-capsule {
margin-left: 10px;
}
.a-groupon .b .desc {
width: 476rpx;
display: block;
color: #999;
line-height: 50rpx;
font-size: 25rpx;
}
.a-groupon .b .price {
width: 476rpx;
display: flex;
color: #b4282d;
line-height: 50rpx;
font-size: 33rpx;
}
.a-groupon .b .counterPrice {
text-decoration: line-through;
font-size: 28rpx;
color: #999;
}
.a-groupon .b .retailPrice {
margin-left: 30rpx;
font-size: 28rpx;
color: #a78845;
}
.a-new .b {
width: 750rpx;
height: auto;
......
......@@ -62,7 +62,17 @@ Page({
url: "/pages/auth/login/login"
});
};
},
goGroupon() {
if (app.globalData.hasLogin) {
wx.navigateTo({
url: "/pages/groupon/myGroupon/myGroupon"
});
} else {
wx.navigateTo({
url: "/pages/auth/login/login"
});
};
},
goCollect() {
if (app.globalData.hasLogin) {
......@@ -97,11 +107,6 @@ Page({
});
};
},
aboutUs: function() {
wx.navigateTo({
url: '/pages/about/about'
});
},
exitLogin: function() {
wx.showModal({
title: '',
......
......@@ -19,12 +19,12 @@
<text class="txt">优惠券</text>
</view>
</view>
<!-- <view class="item no-border">
<view class="item no-border" bindtap="goGroupon">
<view class="a">
<text class="icon gift"></text>
<text class="txt">礼品卡</text>
<text class="txt">团购</text>
</view>
</view>
</view> -->
<view class="item">
<view class="a" bindtap="goCollect">
<image class="user-menu .icon.collect" src="/static/images/icon_collect.png"></image>
......
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