Commit b72b9db8 by 李伟康

commit

1 parent 5ae8c7d9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="index"> <div class="index">
<template v-if="$route.meta.isTab"> <template v-if="$route.meta.isTab">
<tab <tab
:list="['新车精品礼券','商城优惠券']" :list="tabList"
@change="change" @change="change"
:index="tabIndex" :index="tabIndex"
sticky sticky
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div class="info"> <div class="info">
<div class="top"> <div class="top">
<div class="title">{{i.couponName}}</div> <div class="title">{{i.couponName}}</div>
<div class="num">剩余:{{i.remainAmount || i.residueAmount}}张</div> <div class="num">剩余:{{i.remainAmount || i.residueAmount || 0}}张</div>
<div <div
:class="['btn', 'y-center', 'text-center', {'disabled-btn':tabIndex == 0?i.remainAmount<1:i.residueAmount<1}]" :class="['btn', 'y-center', 'text-center', {'disabled-btn':tabIndex == 0?i.remainAmount<1:i.residueAmount<1}]"
@click="showShareModel(i)" @click="showShareModel(i)"
...@@ -75,22 +75,33 @@ ...@@ -75,22 +75,33 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { shareMixin, pageMixin, discountTypeMixin } from '@/mixins' import { shareMixin, pageMixin, discountTypeMixin } from '@/mixins'
import { couponApi, boutiquecouponApi } from '@/api' import { couponApi, boutiquecouponApi } from '@/api'
const tabList = ['新车精品礼券', '商城优惠券']
export default { export default {
name: 'coupon', name: 'coupon',
mixins: [shareMixin, pageMixin, discountTypeMixin], mixins: [shareMixin, pageMixin, discountTypeMixin],
data() { data() {
return {} return {
tabList
}
}, },
mounted() {}, mounted() {},
methods: { methods: {
getList_0(pageNum) { getList_0(pageNum) {
let { list } = this let { list } = this
boutiquecouponApi.getBoutiqueCouponList({ pageNum }).then(res => { boutiquecouponApi.getBoutiqueCouponList({ pageNum }).then(res => {
this.hideLoading()
console.log('精品礼券', res) console.log('精品礼券', res)
if (res.total == 0) {
this.showLoading()
this.tabList = ['商城优惠券']
this.getList_1(pageNum)
return
}else{
this.tabList = tabList
}
this.flag = true this.flag = true
this.list = list.concat(res.list) this.list = list.concat(res.list)
this.total = res.total this.total = res.total
this.hideLoading()
}) })
}, },
getList_1(pageNum) { getList_1(pageNum) {
...@@ -130,11 +141,11 @@ export default { ...@@ -130,11 +141,11 @@ export default {
padding: 0 14px; padding: 0 14px;
flex-shrink: 0; flex-shrink: 0;
text-align: center; text-align: center;
span{ span {
font-size: 10px; font-size: 10px;
} }
} }
.clear-padding{ .clear-padding {
padding: 0; padding: 0;
} }
.info { .info {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!