添加:酒道馆、烟酒馆添加提货券核销记录
添加:酒道馆、烟酒店核销提货券时记录核销方商户信息 修复:提货券过期后依然可以正常使用的问题
This commit is contained in:
parent
6850c7d547
commit
926ecd2ca7
|
|
@ -707,10 +707,14 @@ export function convertMerchantIntegral(merId,data) {
|
|||
export function createQRcode(data) {
|
||||
return request.get("coupon/create_qrcode", data);
|
||||
}
|
||||
// 完成核销操作
|
||||
// 提货券 - 核销
|
||||
export function writeOff(data) {
|
||||
return request.post("coupon/write_off", data);
|
||||
}
|
||||
// 提货券 - 核销记录
|
||||
export function writeOffRecord(data) {
|
||||
return request.get("coupon/write_off_record", data);
|
||||
}
|
||||
// 完成核销操作
|
||||
export function vipExchangeCode(data) {
|
||||
return request.post("sVip/vipExchangeCode", data);
|
||||
|
|
|
|||
|
|
@ -592,6 +592,12 @@
|
|||
"style": {
|
||||
"navigationBarTitleText": "提货券核销"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "write_off/record",
|
||||
"style": {
|
||||
"navigationBarTitleText": "核销记录"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -63,8 +63,9 @@ export default {
|
|||
if(!this.service) return [];
|
||||
const merId = this.service.mer_id;
|
||||
const list = [];
|
||||
// 商户类别:0=普通商户,1=酒道馆,2=供应商,3=烟酒店
|
||||
let merchantInfo = this.service.merchant || {};
|
||||
if(this.service.status){
|
||||
if(this.service.status && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
type: 'customer',
|
||||
title: '客服记录',
|
||||
|
|
@ -72,52 +73,54 @@ export default {
|
|||
icon: 'iconfont icon-kefujilu'
|
||||
});
|
||||
}
|
||||
if(this.service.is_verify){
|
||||
if(merchantInfo.merchant_type == 1 || merchantInfo.merchant_type == 3){
|
||||
// 酒道馆核销用户优惠券
|
||||
list.push({
|
||||
title: '提货券核销',
|
||||
url: '/pages/users/write_off/index',
|
||||
icon: 'iconfont icon-dingdanhexiao'
|
||||
});
|
||||
}else{
|
||||
// 普通商户核销用户订单
|
||||
list.push({
|
||||
title: '订单核销',
|
||||
url: '/pages/admin/order_cancellation/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-dingdanhexiao'
|
||||
});
|
||||
}
|
||||
if(this.service.is_verify && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '订单核销',
|
||||
url: '/pages/admin/order_cancellation/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-dingdanhexiao'
|
||||
});
|
||||
}
|
||||
if(this.service.customer){
|
||||
if(this.service.is_verify && [1,3].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '提货券核销',
|
||||
url: '/pages/users/write_off/index',
|
||||
icon: 'iconfont icon-dingdanhexiao'
|
||||
});
|
||||
list.push({
|
||||
title: '核销记录',
|
||||
url: '/pages/users/write_off/record',
|
||||
icon: 'iconfont icon-daihexiao'
|
||||
});
|
||||
}
|
||||
if(this.service.customer && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '订单管理',
|
||||
url: '/pages/admin/order/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-dingdanguanli'
|
||||
});
|
||||
}
|
||||
if(this.service.is_goods){
|
||||
if(this.service.is_goods && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '商品管理',
|
||||
url: '/pages/product/list/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-shangjiaguanli'
|
||||
});
|
||||
}
|
||||
if(this.service.is_user){
|
||||
if(this.service.is_user && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '顾客管理',
|
||||
url: '/pages/admin/custom/index?mer_id=' + merId,
|
||||
icon: 'iconfont icon-kehu-xuanzhong'
|
||||
});
|
||||
}
|
||||
if(this.service.staff_manage){
|
||||
if(this.service.staff_manage && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '客服经理',
|
||||
url: '/pages/admin/business/staff?mer_id=' + merId,
|
||||
icon: 'iconfont icon-kehu-xuanzhong'
|
||||
});
|
||||
}
|
||||
if(this.service.qr_code_show){
|
||||
if(this.service.qr_code_show && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
type: 'qr_code',
|
||||
title: '推广码',
|
||||
|
|
@ -125,7 +128,7 @@ export default {
|
|||
icon: 'iconfont icon-erweima1'
|
||||
});
|
||||
}
|
||||
if(this.service.online_payment){
|
||||
if(this.service.online_payment && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
type: 'online_payment_qr_code',
|
||||
title: '买单码',
|
||||
|
|
@ -133,26 +136,15 @@ export default {
|
|||
icon: 'iconfont icon-erweima1'
|
||||
});
|
||||
}
|
||||
if(this.service.product_exchange){
|
||||
if(merchantInfo.merchant_type == 1 || merchantInfo.merchant_type == 3){
|
||||
// 酒道馆核销用户优惠券
|
||||
// list.push({
|
||||
// type: 'exchange_qr_code',
|
||||
// title: '特色酒兑换',
|
||||
// url: '',
|
||||
// icon: 'iconfont icon-erweima1'
|
||||
// });
|
||||
}else{
|
||||
// 普通商户核销用户订单
|
||||
list.push({
|
||||
type: 'exchange_qr_code',
|
||||
title: '特色菜兑换',
|
||||
url: '',
|
||||
icon: 'iconfont icon-erweima1'
|
||||
});
|
||||
}
|
||||
if(this.service.product_exchange && [0].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
type: 'exchange_qr_code',
|
||||
title: '特色菜兑换',
|
||||
url: '',
|
||||
icon: 'iconfont icon-erweima1'
|
||||
});
|
||||
}
|
||||
if(this.service.purchase_permission){
|
||||
if(this.service.purchase_permission && [1,3].includes(Number(merchantInfo.merchant_type))){
|
||||
list.push({
|
||||
title: '进货',
|
||||
url: '/pages/supplier/stock/with_goods',
|
||||
|
|
@ -174,13 +166,10 @@ export default {
|
|||
return false;
|
||||
}
|
||||
// 设置页面标题
|
||||
this.pageTitle = '门店商家管理';
|
||||
this.pageTitle = '联盟商家管理';
|
||||
if(this.is_sys == 1) this.pageTitle = '平台管理';
|
||||
if(this.is_sys == 2) this.pageTitle = '酒道馆管理';
|
||||
else if(this.is_sys == 3) this.pageTitle = '烟酒店管理';
|
||||
|
||||
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.pageTitle
|
||||
})
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<view class="scan_bg"></view>
|
||||
<view v-if="!iShidden" class="whiteBg">
|
||||
<view class="input">
|
||||
<input type="number" placeholder-class='placeholder' placeholder="请输入核销码"
|
||||
<input type="text" placeholder-class='placeholder' placeholder="请输入核销码"
|
||||
v-model="write_code" />
|
||||
<text @tap="goCallate">核销</text>
|
||||
</view>
|
||||
|
|
@ -29,14 +29,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {mapGetters} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import {
|
||||
HTTP_REQUEST_URL
|
||||
} from '@/config/app';
|
||||
|
||||
import {HTTP_REQUEST_URL} from '@/config/app';
|
||||
import { writeOff } from '@/api/user.js';
|
||||
|
||||
export default {
|
||||
|
|
@ -55,28 +50,17 @@
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
|
||||
...mapGetters(['isLogin', 'userInfo', 'viewColor', 'shopIsLogin', 'shopMerId'])
|
||||
},
|
||||
onLoad(options) {
|
||||
let _this = this;
|
||||
console.log(_this)
|
||||
if (options.scene) {
|
||||
// console.log('转换前参数:', options.scene)
|
||||
console.log('转换前参数:', options.scene)
|
||||
let scene = _this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||
console.log('转换后参数:', scene);
|
||||
// console.log('转换后参数:', scene);
|
||||
if(scene.write_code) {
|
||||
this.write_code = scene.write_code
|
||||
writeOff({
|
||||
write_code: this.write_code,
|
||||
}).then(res => {
|
||||
this.$util.Tips({
|
||||
title: res.message
|
||||
});
|
||||
}).catch(res => {
|
||||
this.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
this.goCallate();
|
||||
}
|
||||
}
|
||||
// 判断:是否登录
|
||||
|
|
@ -109,27 +93,19 @@
|
|||
},
|
||||
goCallate() {
|
||||
let that = this
|
||||
|
||||
console.log('核销码信息:',that.write_code)
|
||||
|
||||
if(!that.write_code || that.write_code.length <= 0){
|
||||
that.$util.Tips({
|
||||
title: '无核销码信息!',
|
||||
});
|
||||
let params = {
|
||||
write_code: that.write_code,
|
||||
mer_id: that.shopMerId,
|
||||
};
|
||||
if(!params.write_code || params.write_code.length <= 0){
|
||||
that.$util.Tips({title: '无核销码信息!'});
|
||||
return false;
|
||||
}
|
||||
|
||||
writeOff({
|
||||
write_code: that.write_code,
|
||||
}).then(res => {
|
||||
that.$util.Tips({
|
||||
title: res.message
|
||||
});
|
||||
}).catch(res => {
|
||||
that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
});
|
||||
writeOff(params).then(res => {
|
||||
that.$util.Tips({title: res.message});
|
||||
}).catch(res => {
|
||||
that.$util.Tips({title: res});
|
||||
});
|
||||
},
|
||||
// 扫码核销
|
||||
scanCode() {
|
||||
|
|
@ -181,6 +157,7 @@
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
// height: 100vh;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,248 @@
|
|||
<template>
|
||||
<view :style="viewColor">
|
||||
<!--核销记录列表-->
|
||||
<view class='coupon-list' v-if="couponsList.length">
|
||||
<view v-for='(item,index) in couponsList' :key="index">
|
||||
<view class="store-info acea-row row-between-wrapper" v-if="item.user">
|
||||
<view class="store_name acea-row row-between-wrapper">
|
||||
<image class="image" v-if="item.user.avatar" :src="item.user.avatar || ''"></image>
|
||||
<text class="name">{{item.user.nickname || ''}}</text>
|
||||
<text class="name" v-if="item.user.uid > 0">({{item.user.uid}})</text>
|
||||
</view>
|
||||
</view>
|
||||
<!--卡券信息-->
|
||||
<view class='item acea-row row-center-wrapper'>
|
||||
<view class='money moneyGray'>
|
||||
<view class="line1 coupon_value"><text class='num'>{{ item.couponUser ? (item.couponUser.title || '逸路红') : '逸路红' }}</text></view>
|
||||
<view class="pic-num">已核销</view>
|
||||
</view>
|
||||
<view class='text'>
|
||||
<view class='condition line1'>
|
||||
<view class="line1 coupon-title">{{item.coupon_title}}</view>
|
||||
</view>
|
||||
<view class='data acea-row row-between-wrapper'>
|
||||
核销时间:{{ item.create_time }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--登录弹框-->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import authorize from '@/components/Authorize';
|
||||
import {writeOffRecord} from "@/api/user";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
authorize
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 登录授权
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false ,//是否隐藏授权
|
||||
// 列表
|
||||
couponsList: [],
|
||||
loading: false,
|
||||
limit:15,
|
||||
page:1,
|
||||
isScroll:true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['isLogin', 'userInfo', 'viewColor', 'shopIsLogin', 'shopMerId'])
|
||||
},
|
||||
onLoad(options) {
|
||||
if (this.isLogin) {
|
||||
this.getUseCoupons();
|
||||
} else {
|
||||
this.isAuto = true;
|
||||
this.isShowAuth = true
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 授权回调
|
||||
onLoadFun() {
|
||||
this.isShowAuth = false;
|
||||
},
|
||||
// 授权关闭
|
||||
authColse(e) {
|
||||
this.isShowAuth = e
|
||||
},
|
||||
// 获取核销记录
|
||||
getUseCoupons() {
|
||||
let that = this;
|
||||
if(!this.isScroll) return
|
||||
// 查询信息
|
||||
let params = {
|
||||
mer_id: that.shopMerId,
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
};
|
||||
writeOffRecord(params).then(res => {
|
||||
that.loading = true;
|
||||
that.couponsList = that.couponsList.concat(res.data.list)
|
||||
that.isScroll = that.couponsList.length < res.data.count
|
||||
that.page++
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getUseCoupons()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.coupon-list{
|
||||
width: 100vw;
|
||||
min-height: 100vh!important;
|
||||
margin: 0!important;
|
||||
padding: 30rpx!important;
|
||||
}
|
||||
|
||||
|
||||
.navTabBox{
|
||||
background: #fff;
|
||||
height: 90rpx;
|
||||
}
|
||||
.longTab{
|
||||
display: flex;
|
||||
text-align: center;
|
||||
}
|
||||
.tab-item{
|
||||
width: 50%;
|
||||
display: inline-block;
|
||||
line-height: 90rpx;
|
||||
text{
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.tab-item.on{
|
||||
color: var(--view-theme);
|
||||
text{
|
||||
&:after{
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 90%;
|
||||
height: 3rpx;
|
||||
background-color: var(--view-theme);
|
||||
position: absolute;
|
||||
left: 5%;
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.b-color {
|
||||
background-color: var(--view-theme);
|
||||
}
|
||||
.pic-num {
|
||||
color: #ffffff;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.coupon-list .item .text .condition {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.condition .line-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 90rpx;
|
||||
height: 40rpx !important;
|
||||
padding: 0 10rpx;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: var(--view-minorColor);
|
||||
border: 1px solid var(--view-theme);
|
||||
opacity: 1;
|
||||
border-radius: 22rpx;
|
||||
font-size: 20rpx !important;
|
||||
color: var(--view-theme);
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.condition .coupon-title{
|
||||
width: 280rpx;
|
||||
}
|
||||
.store-info{
|
||||
background: #fff;
|
||||
padding: 18rpx 20rpx;
|
||||
position: relative;
|
||||
&::before,&::after{
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 100%;
|
||||
position: absolute;
|
||||
bottom: -12rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
&::before{
|
||||
left: -10rpx;
|
||||
}
|
||||
&::after{
|
||||
right: -10rpx;
|
||||
}
|
||||
.image{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 100%;
|
||||
margin-right: 9rpx;
|
||||
}
|
||||
.name{
|
||||
color: #282828;
|
||||
}
|
||||
.store{
|
||||
color: var(--view-theme);
|
||||
font-size: 20rpx;
|
||||
padding: 2rpx 15rpx;
|
||||
border: 1px solid var(--view-theme);
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
.svip-btn{
|
||||
background-color: #E8C077;
|
||||
}
|
||||
.noCommodity{
|
||||
width: 100%;
|
||||
.pictrue{
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
.coupon_value{
|
||||
max-width: 220rpx;
|
||||
}
|
||||
// 二维码弹框
|
||||
.qr-code-content{
|
||||
width: 80vw;
|
||||
.image{
|
||||
width: 80vw;
|
||||
height: 80vw;
|
||||
}
|
||||
.close-qr-code{
|
||||
position: fixed;
|
||||
top: 35rpx;
|
||||
right: 70rpx;
|
||||
color: #FFFFFF;
|
||||
border: 2rpx solid #FFFFFF;
|
||||
height: 40rpx;
|
||||
line-height: 36rpx;
|
||||
padding: 0 20rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue