Commit bc52288d by songbingqi

修复部分bug

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