修改
This commit is contained in:
parent
005536128c
commit
013682286d
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app">
|
<view class="app">
|
||||||
<!-- <view class="tabs">
|
<view class="tabs">
|
||||||
<view class="tab-item">
|
<view class="tab-item">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
券
|
券
|
||||||
@ -9,58 +9,65 @@
|
|||||||
{{total}}张
|
{{total}}张
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="statuss">
|
<view class="statuss">
|
||||||
<view class="statusitem" :style="couponstatus==''?'color: #F44B2F;':''">
|
<view class="statusitem" @tap="changingcoupon('')" :style="couponstatus==''?'color: #F44B2F;':''">
|
||||||
全部
|
全部
|
||||||
</view>
|
</view>
|
||||||
<span> |</span>
|
<span> |</span>
|
||||||
<view class="statusitem" :style="couponstatus=='NOT_USED'?'color: #F44B2F;':''">
|
<view class="statusitem" @tap="changingcoupon('NOT_USED')"
|
||||||
待领取
|
:style="couponstatus=='NOT_USED'?'color: #F44B2F;':''">
|
||||||
|
未使用
|
||||||
</view>
|
</view>
|
||||||
<span> |</span>
|
<span> |</span>
|
||||||
<view class="statusitem" :style="couponstatus=='USED'?'color: #F44B2F;':''">
|
<view class="statusitem" @tap="changingcoupon('USED')"
|
||||||
|
:style="couponstatus=='USED'?'color: #F44B2F;':''">
|
||||||
已使用
|
已使用
|
||||||
</view>
|
</view>
|
||||||
<span> |</span>
|
<span> |</span>
|
||||||
<view class="statusitem" :style="couponstatus=='EXPIRED'?'color: #F44B2F;':''">
|
<view class="statusitem" @tap="changingcoupon('EXPIRED')"
|
||||||
|
:style="couponstatus=='EXPIRED'?'color: #F44B2F;':''">
|
||||||
已过期
|
已过期
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="rollup">
|
<view class="rollup" v-if="couponlist">
|
||||||
<view class="item">
|
<view class="item" v-for="(item,index) in couponlist" :key="index"
|
||||||
<view class="top" style="background: #EFECEC;color: #4B4B4B;">
|
:style="item.useStatus!='NOT_USED'?'height:180rpx':''">
|
||||||
|
<view class="top" :style="item.useStatus!='NOT_USED'?'background: #EFECEC;color: #4B4B4B;':''">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<span class="text">
|
<span class="text">
|
||||||
¥
|
¥
|
||||||
</span>
|
</span>
|
||||||
<span class="price">
|
<span class="price">
|
||||||
0
|
{{item.couponPrice}}
|
||||||
</span>
|
</span>
|
||||||
</view>
|
</view>
|
||||||
<view class="what" style="background: #EFECEC;">
|
<view class="what" :style="item.useStatus!='NOT_USED'?'background: #DADADA;;':''">
|
||||||
名字
|
{{item.couponTitle}}
|
||||||
</view>
|
</view>
|
||||||
<view class="texts">
|
<view class="texts">
|
||||||
满10可用
|
满{{item.couponConsumePrice}}可用
|
||||||
</view>
|
</view>
|
||||||
<view class="time">
|
<view class="time">
|
||||||
有效期至
|
有效期至{{item.expirationEndTime}}
|
||||||
</view>
|
</view>
|
||||||
<view class="btngq">
|
<view class="btngq" v-if="item.useStatus!='NOT_USED'">
|
||||||
已过期
|
{{item.useStatus=='EXPIRED'?'已过期':''}}
|
||||||
|
{{item.useStatus=='USED'?'已使用':''}}
|
||||||
|
</view>
|
||||||
|
<view class="btn" v-else @tap='goshoping'>
|
||||||
|
{{item.useStatus=='NOT_USED'?'使用':''}}
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="btn">
|
|
||||||
使用
|
|
||||||
</view> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom" v-if="item.useStatus=='NOT_USED'||item.useStatus=='RECEIVE'">
|
||||||
新人福利
|
领取来源:{{item.receiveSource =='NEW_PEOPLE_WELFARE'?'新人福利':''}}
|
||||||
|
{{item.receiveSource =='EVENT_GIFT'?'活动赠送':''}}
|
||||||
|
{{item.receiveSource =='CONSUME_REBATE'?'消费返券':''}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="noorder">
|
<view class="noorder" v-if="couponlist==null||couponlist.length==0">
|
||||||
<u-empty mode="coupon" icon-size='220'></u-empty>
|
<u-empty mode="coupon" icon-size='220'></u-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -68,6 +75,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
selectCoupon
|
||||||
|
} from '@/api/pagesB/coupon/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -75,11 +85,52 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
couponlist: null,
|
couponlist: null,
|
||||||
total: 0,
|
total: 0,
|
||||||
couponstatus: ''
|
couponstatus: '', //状态
|
||||||
|
patientId: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() {
|
||||||
methods: {},
|
this.pageNum = 1
|
||||||
|
var that = this
|
||||||
|
const value = uni.getStorageSync('patientId');
|
||||||
|
if (value) {
|
||||||
|
that.patientId = value
|
||||||
|
that.getlist();
|
||||||
|
} else {
|
||||||
|
that.$refs.uToast.show({
|
||||||
|
title: '未登录,请先登录',
|
||||||
|
type: 'error',
|
||||||
|
duration: '2000',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getlist() {
|
||||||
|
selectCoupon(this.pageNum, this.pageSize, this.patientId, this.couponstatus).then(res => {
|
||||||
|
if (res.rows.length > 0) {
|
||||||
|
this.couponlist = res.rows
|
||||||
|
}
|
||||||
|
this.total = res.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changingcoupon(item) {
|
||||||
|
this.pageNum = 1
|
||||||
|
if (this.couponstatus == item) {
|
||||||
|
this.couponstatus = ''
|
||||||
|
} else {
|
||||||
|
this.couponstatus = item
|
||||||
|
}
|
||||||
|
selectCoupon(this.pageNum, this.pageSize, this.patientId, this.couponstatus).then(res => {
|
||||||
|
this.couponlist = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goshoping() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/shopping/shopping'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
if (this.couponlist.length >= this.total) {} else {
|
if (this.couponlist.length >= this.total) {} else {
|
||||||
this.pageNum++;
|
this.pageNum++;
|
||||||
@ -101,5 +152,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import './coupon.scss'
|
@import "./coupon.scss";
|
||||||
</style>
|
</style>
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.2 KiB |
Loading…
Reference in New Issue
Block a user