2023-3-18

This commit is contained in:
2023-03-18 17:08:47 +08:00
parent b9ee4510db
commit a1abdfe8a7
8 changed files with 1128 additions and 94 deletions

View File

@@ -2,16 +2,32 @@
<view class="coupon-item">
<view class="coupon-money">
<view class="nick">{{item.name}}</view>
<view class="layof" :style="{color:theme}">{{item.amount}}</view>
<view class="end_time">{{item.endTime | formatCreateTime}}前使用</view>
<view>
<view class="demand">{{ item.minPoint }} {{ item.amount }}</view>
<view style="display: flex;flex-direction: row;
align-items: center; margin-top: 10px;">
<view class="layof" :style="{color:theme}">{{item.amount}}</view>
<view style="display: flex;flex-direction: column;flex: 1;" >
<view style="display: flex;flex-direction: row;">
<view class="demand">{{ item.minPoint }}{{ item.amount }}</view>
<view class="demand" style="margin-left: 5px;" >(限领{{item.perLimit}})</view>
</view>
<view>
<view class="end_time">有效期至{{item.endTime | formatCreateTime}}</view>
</view>
</view>
</view>
</view>
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}" @click="acceptCoupon(item)">
立即领取</view>
<!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
:url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
</view>
</template>
@@ -54,21 +70,21 @@
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
return formatDate(date, 'yyyy-MM-dd')
},
},
computed: {
...mapState(['hasLogin','hasVip', 'userInfo']),
...mapState(['hasLogin', 'hasVip', 'userInfo']),
},
methods: {
async acceptCoupon(item) {
if (this.hasLogin) {
if(this.hasVip){
if (this.hasVip) {
this.types = !this.types
uni.showLoading({
title: '请稍后'
});
let params = {
couponId: item.id
};
@@ -78,22 +94,22 @@
if (data) {
// this.$api.msg(data);
this.clickSubMethod(item)
}
uni.hideLoading();
}else{
} else {
uni.showModal({
title: '提示',
content: '您不属于惠农会员,暂不能领取此优惠券',
showCancel:false,
showCancel: false,
success: function(res) {
if (res.confirm) {
return;
}
}
}
});
}
} else {
uni.navigateTo({
url: '/pages/public/login'
@@ -115,63 +131,62 @@
<style lang='scss'>
.coupon-item {
width: 100%;
margin-left: 10px;
margin-right: 10px;
height: auto;
display: table;
display: flex;
border-radius: 10upx;
padding: 0 20upx;
margin-top: 22upx;
border: 1px solid #eeeeee;
position: relative;
background: -webkit-linear-gradient(left, hsla(134, 66%, 66%, 0.5), hsla(53, 98%, 50%, 0.5), tomato) no-repeat;
.coupon-money {
width: 465upx;
padding: 15px;
width: 520upx;
height: auto;
display: table;
float: left;
padding: 26upx 0;
display: flex;
flex-direction: column;
border-style: none dotted none none;
border-color: #eeeeee;
.nick {
width: 100%;
height: 50upx;
overflow: hidden;
/*溢出的部分隐藏*/
white-space: nowrap;
/*文本不换行*/
text-overflow: ellipsis;
/*ellipsis:文本溢出显示省略号(...clip不显示省略标记...),而是简单的裁切*/
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #ffaa00;
font-size: 20px;
}
.tit {
/* .tit {
width: 100%;
height: 50upx;
line-height: 50upx;
font-size: $font-sm;
color: $font-color-999;
}
*/
.demand {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #DF5423;
}
.layof {
width: 100%;
height: 48upx;
line-height: 30upx;
font-size: 44upx;
color: #ff9000;
font-weight: bold;
margin-right: 20px;
}
.end_time {
width: 100%;
height: 30upx;
line-height: 30upx;
font-size: $font-sm;
color: $font-color-999;
color: #E24451;
}
}
@@ -196,7 +211,7 @@
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
left: 500upx;
top: -1px;
border-radius: 0 0 40upx 40upx;
content: "";
@@ -210,7 +225,7 @@
width: 40upx;
height: 20upx;
position: absolute;
left: 460upx;
left: 500upx;
bottom: -1px;
border-radius: 40upx 40upx 0 0;
content: "";