['核销记录样式改版,新增老板端筛选记录,优惠券首页新增返回按钮']

This commit is contained in:
2021-09-22 12:00:35 +08:00
parent aa1788fa8d
commit 4b23dba0cc
6 changed files with 117 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="Record" v-if="loaded">
<view class="record-top">
<image src="/static/images/record_bg.png" mode="widthFix" class="record-bg" />
<image src="/static/images/ver-bg.png" mode="widthFix" class="record-bg" />
<view class="record-top-nav">
<view :class="['record-top-item',type==='year'?'selectTopItem':'']" @click="selectType('year')">按年
</view>
@@ -31,10 +31,22 @@
</view>
</view>
<view class="boss" v-if="isBos">
<view class="boss-left">
<image src="/static/images/boss.png" mode="mode" class="boss-img">我是BOSS
</view>
<view class="boss-right" @click="shopShow = true">
<u-select v-model="shopShow" :list="ShopList" @confirm="shopConfirm" value-name='store_id'
label-name='name' />
门店<u-icon name="arrow-down" color="#606266" label-color='#606266' margin-right='10' label-pos='left'
:label='store_id?store_name:"全部门店"' size="28" />
</view>
</view>
<!-- 列表 -->
<view class="lists" v-if="lists.length>0">
<view class="list-item" v-for="(item,index) in lists" :key='index'>
<view class="list-item-title">
<view class="left">
<view class="tags">{{scantype === 'goods'?'权证核销':'优惠券核销'}}</view>
@@ -42,39 +54,41 @@
<view class='title' v-else>{{item.coupon.title}}</view>
</view>
<!-- <view class="right"> -->
<!-- <u-icon name="checkmark-circle-fill" size='50' color='#e93340' /> -->
<!-- <u-icon name="checkmark-circle-fill" size='50' color='#e93340' /> -->
<!-- </view> -->
</view>
<view class="list-item-content" v-if='scantype === "goods"'>
<image class="good-img" :src="item.goods_sku.cover" mode="aspectFill" />
<view class="list-item-right">
<view class="content-item">核销商品数量X {{item.qty}} </view>
<view class="content-item" >核销商品规格{{item.goods_sku.unit || '通用规格'}}</view>
<view class="content-item">核销商品规格{{item.goods_sku.unit || '通用规格'}}</view>
<view class="content-item">核销时间{{item.used_at}}</view>
</view>
</view>
<view class="list-item-content" v-else>
<image class="good-img" v-if='item.source.type ==="goods"' :src="item.source.cover" mode="aspectFill" />
<image class="good-img" v-if='item.source.type ==="goods"' :src="item.source.cover"
mode="aspectFill" />
<view class="list-item-right">
<view class="content-item" v-if='item.source.type ==="goods"'>兑换商品名称{{item.source.name}} </view>
<view class="content-item" v-if='item.source.type ==="goods"'>兑换商品名称{{item.source.name}}
</view>
<view class="content-item"> 优惠券规格 {{item.coupon.full}} {{item.coupon.price}} </view>
<view class="content-item" >优惠券类型{{item.coupon.type.text}}</view>
<view class="content-item">优惠券类型{{item.coupon.type.text}}</view>
<view class="content-item">核销时间{{item.used_at}}</view>
</view>
</view>
<view class="person">
<image class="avatar" :src="item.clerk.avatar" mode="aspectFill" />
{{item.clerk.nickname}}
<view class="shop-name">{{item.store.name}}</view>
</view>
</view>
</view>
<!-- 无列表 -->
<no-list v-if="lists.length === 0 && scantype === 'goods'" name='no-in' txt="没有任何权证核销记录" />
<no-list v-if="lists.length === 0 && scantype === 'coupons'" name='no-out' txt="没有任何优惠券记录" />
<no-list v-if="lists.length === 0 && scantype === 'coupons'" name='no-out' txt="没有任何优惠券核销记录" />
<!-- <u-toast ref="uToast" /> -->
<u-toast ref="uToast" />
@@ -104,7 +118,12 @@
currentMonth: new Date().toISOString().slice(0, 7),
currentYear: new Date().toISOString().slice(0, 4),
account: '',
loaded:false
loaded: false,
shopShow: false,
ShopList: [],
store_name: '',
store_id: '',
isBos:false
}
},
onLoad() {
@@ -130,21 +149,23 @@
page: this.page,
date_type: this.type,
date: this.date,
type: 'my'
store_id:this.store_id
}
let apiUrl = ''
if(this.scantype === 'goods'){
apiUrl = 'manages/warrants/logs'
}else{
if (this.scantype === 'goods') {
apiUrl = 'manages/warrants/logs'
} else {
apiUrl = 'coupons/verify/logs/coupons'
}
scanList(apiUrl,data).then(res => {
scanList(apiUrl, data).then(res => {
console.log(res)
this.account = res.all
this.lists = this.lists.concat(res.lists.data)
this.has_more = res.lists.page.has_more
this.loaded = true
this.ShopList = [{name:'全部',store_id:''},...res.stores]
this.isBos = res.isBos
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
@@ -157,6 +178,7 @@
selectCoinType(type) {
if (this.scantype !== type) {
this.scantype = type
this.store_id = ''
this.reset()
}
},
@@ -180,6 +202,7 @@
day: false
}
this.date = this.currentYear
this.store_id = ''
this.reset()
break;
case 'month':
@@ -190,6 +213,7 @@
day: false
}
this.date = this.currentMonth
this.store_id = ''
this.reset()
break;
case 'day':
@@ -200,12 +224,13 @@
day: false
}
this.date = this.currentDay
this.store_id = ''
this.reset()
break;
}
}
},
// 点击确认按钮
// 点击确认按钮年月日
confirm(e) {
let type = this.type
switch (type) {
@@ -222,6 +247,12 @@
this.reset()
break;
}
},
// 筛选门店信息
shopConfirm(e) {
this.store_id = e[0].value
this.store_name = e[0].label
this.reset()
}
}
}
@@ -238,7 +269,7 @@
.record-top {
width: calc(100% - 60rpx);
height: 360rpx;
background-image: linear-gradient(to left, #f40c50, #f40c50);
background-image: linear-gradient(to left, #076cff, #076cff);
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: $main-color, $alpha: 0.4);
margin: 0 30rpx;
border-radius: 20rpx;
@@ -337,10 +368,46 @@
}
}
.boss {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 30rpx;
background-color: #fff;
.boss-left {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 32rpx;
font-weight: bold;
}
.boss-right {
font-size: 28rpx;
u-icon {
padding-left: 20rpx;
}
}
.boss-img {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
margin-right: 20rpx;
}
}
// 列表
.lists {
box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #000, $alpha: 0.4);
// box-shadow: 0 10rpx 20rpx 0rpx rgba($color: #000, $alpha: 0.4);
padding: 20rpx;
.list-item {
background-color: #fff;
width: 100%;
@@ -357,14 +424,16 @@
justify-content: space-between;
box-sizing: border-box;
padding: 20rpx 0;
.left{
.left {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
.title{
.title {
width: 520rpx;
overflow: hidden;
font-size: 30rpx;
@@ -372,21 +441,23 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.tags{
.tags {
padding: 4rpx 10rpx;
border-radius: 20rpx 0 20rpx 0;
background-color: #f40c50;
background-color: #076cff;
font-size: 26rpx;
color: #fff;
}
}
// .right{
// padding: 20rpx 30rpx;
// }
}
.list-item-content{
.list-item-content {
width: 100%;
color: #999;
padding: 20rpx 0;
@@ -396,21 +467,24 @@
justify-content: flex-start;
box-sizing: border-box;
border-bottom: solid 1rpx #f7f7f7;
.good-img{
.good-img {
margin-right: 20rpx;
width: 160rpx;
height: 160rpx;
border-radius: 10rpx;
}
.list-item-right{
.list-item-right {
flex: 1;
.content-item{
.content-item {
padding: 10rpx 0;
}
}
}
.person{
.person {
display: flex;
flex-direction: row;
align-items: center;
@@ -419,14 +493,16 @@
font-size: 30rpx;
padding: 20rpx 0 0 0;
font-weight: bold;
.avatar{
.avatar {
width: 70rpx;
height: 70rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.shop-name{
background-color: #f40c50;
.shop-name {
background-color: #076cff;
color: #fff;
font-size: 24rpx;
font-weight: 400;
@@ -435,7 +511,7 @@
margin-left: 20rpx;
}
}
}
}
</style>