Commit bc52288d by songbingqi

修复部分bug

parent 092d9e16
......@@ -49,6 +49,7 @@ export default {
<style lang="scss" scoped>
.big {
background: #FFFFFF;
height: 82rpx;
display: flex;
align-items: center;
......
<template>
<view class="all">
<view class="part">
<view class="part" :style="{'margin-bottom':indexValue?'200rpx':'0rpx'}">
<view class="partOne">
<view class="one_left">
<view class="type" :style="[typeBackground]">{{info.typeDesc}}</view>
......@@ -25,6 +25,9 @@
<view v-if="info.status===0">
<button class="gouse" @click="goMenu">去使用</button>
</view>
<view v-if="info.status===4">
<button class="gouse_dis">去使用</button>
</view>
</view>
</view>
</view>
......@@ -64,6 +67,7 @@
<script>
export default {
props:{
indexValue:[Boolean],
type:{
type:String,
default(){
......@@ -98,51 +102,53 @@ export default {
computed: {
typeBackground(){
const {status} = this.info
if(status!==0){
return { '--type-background': 'linear-gradient(90deg, #666666 0%, #999999 100%)' }
}else{
if(status===0 ||status===4){
return { '--type-background': 'linear-gradient(90deg, #75A2FF 0%, #B6CEFF 100%)' }
}else{
return { '--type-background': 'linear-gradient(90deg, #666666 0%, #999999 100%)' }
}
},
priceColor(){
const {status} = this.info
if(status!==0){
return { 'color': '#666666' }
}else{
return { 'color': '#0050F6' }
if(status===0 ||status===4){
return { 'color': '#0050F6' }
}else {
return { 'color': '#666666'}
}
},
priceDescColor(){
const {status} = this.info
if(status!==0){
return { 'color': '#999999' }
}else{
return { 'color': '#0050F6' }
if(status===0 ||status===4){
return { 'color': '#0050F6' }
}else {
return { 'color': '#999999'}
}
},
titleColor(){
const {status} = this.info
if(status!==0){
return { 'color': '#666666' }
}else{
return { 'color': '#333333' }
if(status===0 ||status===4){
return { 'color': '#333333' }
}else {
return { 'color': '#666666'}
}
},
timeColor(){
const {status} = this.info
if(status!==0){
return { 'color': '#999999' }
if(status===0){
return { 'color': '#333333' }
}else if(status===4) {
return { 'color': '#FE7373'}
}else{
return { 'color': '#333333' }
return { 'color': '#999999' }
}
},
descColor(){
const {status} = this.info
if(status!==0){
if(status===0 ||status===4){
return { 'color': '#999999' }
}else{
return { 'color': '#666666' }
}
}else {
return { 'color': '#999999'}
}
}
},
data(){
......@@ -171,6 +177,7 @@ export default {
<style lang="scss" scoped>
.all {
background: #FFFFFF;
.part {
width: 100%;
margin-top: 32rpx;
......@@ -283,6 +290,17 @@ export default {
color: #FFFFFF;
line-height: 52rpx;
}
.gouse_dis {
width: 128rpx;
height: 52rpx;
background: #999999;
border-radius: 2rpx;
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
line-height: 52rpx;
}
.check{
width: 40rpx;
height: 40rpx;
......
......@@ -64,9 +64,15 @@ export default {
if(item.useEndTime){
timeEnd = item.useEndTime.slice(0,11).replace(new RegExp('-','g'), '.')
}
let status = item.state===0?0:item.state===1?2:3
if(val) {
if(timeStart) {
status = 4
}
}
return {
id: item.id,
status: item.state===0?0:item.state===1?2:3,
status: status,
couponType: item.type,
typeDesc: item.categoryName,
price: item.priceDiscount===0?'免单':item.priceDiscount,
......@@ -86,7 +92,7 @@ export default {
}
})
if(val){
this.canuse = canuse
this.canuse = canuse.sort((a,b)=> {return a.status - b.status})
}else{
this.cantuse = canuse
}
......
......@@ -5,7 +5,7 @@
<swiper :current="current" class="swiper" @change="swiperChange">
<swiper-item>
<view class="list" v-if="canuse.length!=0">
<Ticket v-for="(item,index) in canuse" :key="index" :info="item" type="use" @updata="updata"/>
<Ticket v-for="(item,index) in canuse" :key="index" :info="item" :indexValue="index+1===canuse.length" type="use" @updata="updata"/>
</view>
<view class="emty" v-else>
<view class="text">暂无可用优惠券</view>
......
......@@ -13,7 +13,7 @@ const order = {
// 设置结算页面优惠卷信息
setTickerList(state, data) {
console.log(data)
const canuse = data.fitable.map(item=>{
const canuse = data.fitable.map((item,index)=>{
let timeStart = ''
let timeEnd = ''
if(item.useStartTime){
......@@ -23,6 +23,8 @@ const order = {
timeEnd = item.useEndTime.slice(0,11).replace(new RegExp('-','g'), '.')
}
return {
index:index+1,
allLength:data.fitable.length,
id: item.id,
status: 0,
couponType: item.type,
......
Markdown is supported
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