oil-station/gasStation-uni/pagesMy/writeOff/writeOff.vue

253 lines
4.5 KiB
Vue
Raw Normal View History

2023-11-28 10:44:18 +08:00
<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">核销记录</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
2023-11-28 14:43:36 +08:00
<view class="tap-top">
2023-12-15 17:41:25 +08:00
2023-11-28 14:43:36 +08:00
<view class="tap-box" :class="{ 'act' : tindex == index }" v-for="(item,index) in tapList" :key="index"
2023-12-15 17:41:25 +08:00
@click="tapindex(index,item.text)">
2023-11-28 14:43:36 +08:00
<view class="">{{ item.text }}</view>
<view class="gang" :class="{ 'lan' : tindex == index }"></view>
</view>
2023-12-15 17:41:25 +08:00
</view>
<view class="ail" v-if="cardsList.length != 0 ">
<view class="box-order" v-for="(item,index) in cardsList" :key="index">
<view class="or-box-top">
<view class="chengg" style="font-weight: bold;">兑换券</view>
</view>
<view class="but-box">
<view class="huis">卡类型</view>
<view class="">{{item.cardType || "暂无"}}</view>
</view>
<view class="but-box">
<view class="huis">核销卡名</view>
<view class="reds">{{item.cardName || "暂无"}}</view>
</view>
<view class="but-box">
<view class="huis">卡券内容</view>
<view class="reds">{{item.cardContent || "暂无"}}</view>
</view>
<view class="but-box">
<view class="huis">兑换时间</view>
<view class="">{{item.updateTime || "暂无"}}</view>
</view>
</view>
2023-11-28 14:43:36 +08:00
</view>
<u-empty v-if="list.length == 0 " mode="coupon" text="内容为空"
icon="http://cdn.uviewui.com/uview/empty/coupon.png">
</u-empty>
2023-11-28 10:44:18 +08:00
</view>
</view>
</template>
<script>
2023-12-15 17:41:25 +08:00
import request from "../../utils/request";
2023-11-28 10:44:18 +08:00
export default {
data() {
return {
2024-01-09 16:12:17 +08:00
storeId: '',
2023-12-15 17:41:25 +08:00
cardsList: [],
query: {
2024-01-09 16:12:17 +08:00
storeId: '',
2023-12-18 11:15:19 +08:00
cardType: '兑换券',
2023-12-15 17:41:25 +08:00
pageNo: 1,
pageSize: 10
},
2023-11-28 10:44:18 +08:00
title: '',
2023-11-28 14:43:36 +08:00
tindex: 0,
list: [],
tapList: [{
2023-12-15 17:41:25 +08:00
text: "兑换券"
2023-11-28 14:43:36 +08:00
},
{
2023-12-15 17:41:25 +08:00
text: "洗车券"
2023-11-28 14:43:36 +08:00
},
]
2023-11-28 10:44:18 +08:00
}
},
components: {
2023-12-15 17:41:25 +08:00
},
onShow() {
2024-01-09 16:12:17 +08:00
this.query.storeId = uni.getStorageSync("storeId");
2023-12-15 17:41:25 +08:00
this.getGiftRecords()
2023-11-28 10:44:18 +08:00
},
methods: {
2023-12-15 17:41:25 +08:00
tapindex(index, item) {
this.cardsList = []
2023-11-28 14:43:36 +08:00
this.tindex = index
2023-12-15 17:41:25 +08:00
this.query.cardType = item
this.getGiftRecords()
},
getGiftRecords() {
request({
url: '/business/marketingActivity/cardExchangeRecord/selectCancelRecords',
method: 'get',
params: this.query
}).then(res => {
console.log(res)
if (res.code == 200) {
this.cardsList = res.data.records
2023-12-26 18:44:50 +08:00
// console.log(cardsList)
2023-12-15 17:41:25 +08:00
}
})
2023-11-28 14:43:36 +08:00
},
2023-11-28 10:44:18 +08:00
goback() {
uni.navigateBack()
}
2023-12-15 17:41:25 +08:00
},
2023-11-28 10:44:18 +08:00
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
2023-11-28 14:43:36 +08:00
2023-12-15 17:41:25 +08:00
.but-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
}
2023-11-28 14:43:36 +08:00
.tap-top {
width: 100%;
height: 50px;
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
}
.tap-box {
width: 33%;
text-align: center;
color: #666666;
}
.gang {
width: 35px;
height: 4px;
// background: #0000ff;
margin: 0 auto;
margin-top: 10px;
}
.act {
font-weight: bold;
color: #000;
}
.lan {
background: #0000ff;
}
2023-12-15 17:41:25 +08:00
.box-order {
width: 95%;
border-radius: 8px;
background: #ffffff;
box-sizing: border-box;
padding: 10px;
margin: 10px auto;
}
.or-box-top {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 5px 0px;
border-bottom: 1px solid #e5e5e5;
}
.chengg {
color: #1678ff;
}
.but-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
margin: 5px 0px;
}
.reds {
color: red;
}
.huis {
color: #666666;
}
.end-box {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
}
.anniu {
width: 70px;
height: 25px;
background-color: #1678ff;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
border-radius: 15px;
}
2024-01-09 16:12:17 +08:00
</style>