Commit 8aeef4e0 authored by gu-jinli1118's avatar gu-jinli1118
Browse files

20230831

parent 646116b0
Pipeline #31 failed with stages
in 0 seconds
/**app.wxss**/
.container {
height: 100%;
box-sizing: border-box;
color: #333;
font-family: helvetica,'Heiti SC',PingFangSC-Light;
}
.price{
font-family: Arial;
display: inline-block;
color: #eb2444;
padding-bottom:10rpx;
padding-left:10rpx;
}
/* 价格数字显示不同大小 */
.symbol {
font-size: 24rpx;
}
.big-num {
font-size: 32rpx;
}
.small-num {
font-size: 24rpx;
}
var http = require('../../utils/http.js');
Component({
/**
* 组件的属性列表
*/
properties: {
item: Object,
type: Number,
order: Boolean,
canUse: Boolean,
index: Number,
showTimeType: Number
},
/**
* 组件的初始数据
*/
data: {
stsType: 4
},
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
attached: function() {
//console.log(this.data.item);
},
/**
* 组件的方法列表
*/
methods: {
receiveCoupon() {
var couponId = this.data.item.couponId;
http.request({
url: "/p/myCoupon/receive",
method: "POST",
data: couponId,
callBack: () => {
var coupon = this.data.item;
coupon.canReceive = false;
this.setData({
item: coupon
})
}
})
},
checkCoupon(e) {
// this.triggerEvent('checkCoupon', this.data.index);
this.triggerEvent('checkCoupon', {
couponId: e.currentTarget.dataset.couponid
});
},
/**
* 立即使用
*/
useCoupon() {
var url = '/pages/prod-classify/prod-classify?sts=' + this.data.stsType;
var id = this.data.item.couponId;
var title = "优惠券活动商品";
if (id) {
url += "&tagid=" + id + "&title=" + title;
}
wx.navigateTo({
url: url
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="coupon-item {{canUse?'':'gray'}}">
<view class='left'>
<view class="num" wx:if="{{item.couponType == 1}}">
<text class="coupon-price">{{item.reduceAmount}}</text>
</view>
<view class="num" wx:if="{{item.couponType == 2}}">
<text class="coupon-price">{{item.couponDiscount}}</text>折
</view>
<view class='condition'>
满{{item.cashCondition}}元可用
</view>
</view>
<view class='right'>
<view class="c-des">
<text class="c-type">{{item.suitableProdType==0?'通用':'商品'}}</text> {{item.suitableProdType==0?'全场通用':'指定商品可用'}}
</view>
<view class="c-date">
<text wx:if="{{showTimeType==1 && item.couponType==2}}" class="c-data-info">领券{{item.validDays}}天后失效</text>
<text wx:else class="c-data-info">{{item.startTime}}~{{item.endTime}}</text>
<text class="c-btn" wx:if="{{item.canReceive && !order}}" bindtap='receiveCoupon'>立即领取</text>
<text class="c-btn get-btn" wx:if="{{!item.canReceive && !order}}" bindtap='useCoupon'>立即使用</text>
</view>
<view wx:if="{{order && canUse}}" class="sel-btn">
<checkbox color="#eb2444" data-couponid="{{item.couponId}}" checked="{{item.choose}}" bindtap="checkCoupon"></checkbox>
</view>
</view>
<image class="tag-img" src="../../images/icon/coupon-used.png" wx:if="{{type==1}}"></image>
<image class="tag-img" src="../../images/icon/coupon-ot.png" wx:if="{{type==2}}"></image>
</view>
\ No newline at end of file
.coupon-item{
margin: 15px 0;
position: relative;
box-shadow: 1px 1px 3px rgba(0,0,0,0.15);
height: 95px;
background: #fff;
}
.coupon-item .left{
float: left;
color: #fff;
text-align: center;
border-left: 1px dashed #fff;
padding: 20px 0;
background: -webkit-gradient(linear,left top,right top,from(#F45C43),to(#eb2444));
background: -o-linear-gradient(left,#F45C43,#eb2444);
background: linear-gradient(left,#F45C43,#eb2444);
background: -webkit-linear-gradient(left,#F45C43,#eb2444);
width: 260rpx;
height: 55px;
}
.coupon-item .left .num{
font-weight:600;
font-size:36rpx;
height:70rpx;
line-height:70rpx;
font-family:arial;
}
.coupon-item .left .num .coupon-price{
font-size: 72rpx;
line-height: 72rpx;
display: inline-block;
font-family: arial;
}
.coupon-item .left .condition{
font-size: 28rpx;
line-height: 28rpx;
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 2px;
font-family: arial;
}
.coupon-item .right{
margin-left: 280rpx;
padding: 5px;
position: relative;
}
.coupon-item .right .c-des{
height: 30px;
font-size: 26rpx;
line-height: 30px;
overflow: hidden;
font-weight: 600;
}
.coupon-item .right .c-des .c-type{
font-size: 24rpx;
background: #fdf0f0;
color: #eb2444;
border-radius: 8px;
padding:3px 10px;
}
.coupon-item .right .c-date{
font-size: 24rpx;
margin-top:25px;
}
.coupon-item .right .c-date .c-data-info{
font-family: arial;
}
.coupon-item .right .c-date .c-btn{
position: absolute;
bottom:0;
right:10px;
color: #fff;
font-size: 24rpx;
font-family: arial;
border-radius: 14px;
padding:3px 7px;
/* background: -webkit-gradient(linear,left top,right top,from(#6c96da),to(#6b83d7));
background: -o-linear-gradient(left,#6c96da,#6b83d7);
background: linear-gradient(left,#6c96da,#6b83d7);
background: -webkit-linear-gradient(left,#6c96da,#6b83d7); */
background: #eb2444;
border: 1px solid #eb2444;
}
.coupon-item .right .c-date .c-btn.get-btn{
background: #fff;
border: 1px solid #eb2444;
color:#eb2444;
}
.coupon-item.gray .left{
background: #bbb;
}
.coupon-item.gray .right .c-des .c-type{
background: #bbb;
color: #fff;
}
.coupon-item.gray .right .c-date .c-btn{
display: none;
}
.coupon-item .tag-img{
position: absolute;
top:0;
right:0;
width:120rpx;
height:120rpx;
}
.coupon-item .sel-btn{
position:absolute;
right:10px;
top:35px;
}
// components/production/production.js
Component({
/**
* 组件的属性列表
*/
properties: {
item:Object,
sts:Number,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
toProdPage: function (e) {
var prodid = e.currentTarget.dataset.prodid;
wx.navigateTo({
url: '/pages/prod/prod?prodid=' + prodid,
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='prod-items' bindtap='toProdPage' data-prodid="{{item.prodId}}">
<view class='hot-imagecont'>
<image src='{{item.pic}}' class='hotsaleimg' ></image>
</view>
<view class='hot-text'>
<view class='hotprod-text'>{{item.prodName}}</view>
<view class='prod-info' wx:if='{{sts==6}}'>{{item.prodCommNumber}}评价 {{item.positiveRating}}%好评</view>
<view class='prod-text-info'>
<view class='price'>
<text wx:if='{{sts==2}}' class='deadline-price'>限时价</text>
<text class='symbol'>¥</text>
<text class='big-num'>{{wxs.parsePrice(item.price)[0]}}</text>
<text class='small-num'>.{{wxs.parsePrice(item.price)[1]}}</text>
</view>
</view>
</view>
</view>
<wxs module="wxs" src="../../wxs/number.wxs" />
\ No newline at end of file
@import "../../app.wxss";
.prod-items {
width: 375rpx;
float: left;
background: #fff;
padding-bottom: 20rpx;
box-sizing: border-box;
}
prod:nth-child(2n-1) .prod-items {
padding: 20rpx 10rpx 10rpx 20rpx;
}
prod:nth-child(2n) .prod-items {
padding: 20rpx 20rpx 10rpx 10rpx;
}
.hot-imagecont .hotsaleimg {
width:345rpx;
height:345rpx;
}
.hot-text .hotprod-text {
height: 76rpx;
font-size: 28rpx;
display: -webkit-box;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
color: #000;
}
.prod-items .hot-imagecont {
border-radius: 8rpx;
text-align: center;
font-size: 0;
}
.prod-items .hot-text {
margin-top: 20rpx;
}
.prod-items .hot-text .prod-info {
font-size: 20rpx;
color: #777;
margin-top: 8rpx;
}
.prod-items .hot-text .prod-text-info {
position: relative;
height: 50rpx;
line-height: 70rpx;
font-family: Arial;
}
.prod-items .hot-text .prod-text-info .price {
color: #eb2444;
}
.deadline-price{
font-size: 22rpx;
margin-right: 5rpx;
}
\ 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