修改:优惠券赠送及核销流程修改

This commit is contained in:
wuhui_zzw 2024-02-05 13:59:02 +08:00
parent efc8f2c3af
commit 4d7e9806f8
6 changed files with 80 additions and 30 deletions

View File

@ -60,3 +60,7 @@ export function recordIntegralList(data) {
export function quotaTransfer(data) {
return request.get(`exchange/quota_transfer`,data);
}
// 获取门店绑定的酒道馆信息
export function merBindShop(merId) {
return request.get(`exchange/mer_bind_shop/${merId}`);
}

View File

@ -545,3 +545,4 @@ export function priceRuleApi(id) {
noAuth: true
});
}

View File

@ -254,6 +254,12 @@ export default {
</script>
<style scoped lang="scss">
.business{
width: 100vw!important;
min-height: 100vh!important;
background: linear-gradient(180deg, #2291F8 0%, rgba(34,145,248,0) 100%);
}
.businessIcon {
color: #2291F8;
font-size: 80rpx;
@ -261,9 +267,9 @@ export default {
margin-bottom: 29rpx;
}
.business-header {
height: 305rpx;
background: linear-gradient(180deg, #2291F8 0%, rgba(34,145,248,0) 100%);
position: fixed;
//height: 305rpx;
//position: fixed;
padding-top: 20rpx;
width: 100%;
text-align: center;
top: 0;
@ -299,7 +305,8 @@ export default {
.business-content {
width: 100%;
padding: 0 calc((100% - (345rpx * 2)) / 3);
margin-top: 151rpx;
//margin-top: 151rpx;
margin-top: 55rpx;
display: inline-flex;
flex-wrap: wrap;
flex-direction: row;

View File

@ -133,7 +133,8 @@
import { openPaySubscribe } from '@/utils/SubscribeMessage.js';
import dayjs from '@/plugin/dayjs/dayjs.min.js';
import { HTTP_REQUEST_URL } from '@/config/app';
import spread from "../../../libs/spread";
import spread from "@/libs/spread";
import {merBindShop} from "@/api/exchange";
export default {
components: {
payment,
@ -223,11 +224,15 @@
onLoad(options) {
//
if(options.scene){
// console.log(" - ",options.scene)
console.log("接收参数 - 未转义",options.scene)
var scene = this.$util.getUrlParams(decodeURIComponent(options.scene));
// console.log(" - ",scene)
console.log("接收参数 - 转义后",scene)
this.bind_mer_id = scene.mid || 0;
this.bind_staff_id = scene.suid || 0;
//
if(this.bind_mer_id > 0 && this.bind_staff_id > 0){
this.isBindShop();
}
}
this.getCouponLst();
@ -631,6 +636,19 @@
});
},
//
isBindShop(){
let _this = this;
merBindShop(_this.bind_mer_id).then(res => {
let data = res.data || {};
let merId = data.mer_id || 0;
if(merId <= 0){
_this.$util.Tips({
title: '该商户未绑定酒道馆!',
},{tab:1,url:'/pages/user/index'});
}
})
}
},
//
onPageScroll(e) {

View File

@ -16,19 +16,26 @@
</view>
<view class='item acea-row row-center-wrapper'>
<block v-if="item.status == 0">
<view v-if="item.coupon.send_type == 5" class='money vip-coupon'>
<view class="line1 coupon_value"><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
<view v-if="item.coupon.send_type == 5 && item.coupon.type == 13" class='money vip-coupon'>
<view class="line1 coupon_value"><text class='num' style="font-size: 45rpx!important;">{{ item.brand ? item.brand.title : '逸路红' }}</text></view>
<view class="pic-num">{{ item.shopMer ? '仅 ' + item.shopMer.mer_name + ' 可用' : '全门店可用' }}</view>
<!--<view class="line1 coupon_value"><text class='num'>{{item.coupon_price}}</text></view>-->
<!--<view class="pic-num">{{ item.use_min_price }}元可用</view>-->
</view>
<view v-else class='money' :style="{ 'background-image': `url(${domain}/static/diy/couponBg${keyColor}.png)` }">
<view class="line1 coupon_value"><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
</view>
</block>
<view v-else class='money moneyGray'>
<view><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
<block v-if="item.coupon.send_type == 5 && item.coupon.type == 13">
<view class="line1 coupon_value"><text class='num'>{{ item.brand ? item.brand.title : '逸路红' }}</text></view>
<view class="pic-num">已核销</view>
</block>
<block v-else>
<view><text class='num'>{{item.coupon_price}}</text></view>
<view class="pic-num">{{ item.use_min_price }}元可用</view>
</block>
</view>
<view class='text'>
<view class='condition line1'>
@ -48,7 +55,7 @@
去使用
</navigator>
<view class='bnt1 b-color' @click="getQRcode(item.write_code)" :class="item.coupon.send_type == 5 ? 'svip-btn' : ''" hover-class="none" v-else>
使用
核销
</view>
</view>
<view class='bnt1 gray' style="position: static;" v-if="item.status==1">已使用</view>
@ -68,9 +75,6 @@
<view class="qr-code-content">
<image class="image" :src="qrCode"></image>
<view class="close-qr-code" @click="closeQrCode()">关闭</view>
<navigator :url="'/pages/users/write_off/index?write_code=8sesff42seds'" class='bnt1 b-color'>
去使用
</navigator>
</view>
</uni-popup>
</view>
@ -84,9 +88,9 @@
import {
getUserCoupons
} from '@/api/api.js';
import { createQRcode } from '@/api/user.js';
import {
mapGetters
} from "vuex";
@ -127,7 +131,7 @@
if(value){
var newDate=/\d{4}-\d{1,2}-\d{1,2}/g.exec(value)
return newDate[0]
}
}
}
},
onLoad(options) {

View File

@ -36,7 +36,7 @@
import {
HTTP_REQUEST_URL
} from '@/config/app';
import { writeOff } from '@/api/user.js';
export default {
@ -109,6 +109,16 @@
},
goCallate() {
let that = this
console.log('核销码信息:',that.write_code)
if(!that.write_code || that.write_code.length <= 0){
that.$util.Tips({
title: '无核销码信息!',
});
return false;
}
writeOff({
write_code: that.write_code,
}).then(res => {
@ -126,11 +136,17 @@
var self = this;
// #ifdef MP || APP-PLUS
wx.scanCode({
scanType: ["qrCode", "barCode"],
// scanType: ["qrCode", "barCode"],
success(res) {
console.log(res);
self.write_code = res.result
goCallate()
// self.write_code = res.result
// self.goCallate()
let page = res.path || '';
if(page){
uni.redirectTo({
url: '/' + page
})
}
},
fail(res) {
console.log(res);
@ -138,16 +154,16 @@
})
// #endif
//#ifdef H5
if (this.$wechat.isWeixin()) {
this.$wechat.wechatEvevt('scanQRCode', {
if (self.$wechat.isWeixin()) {
self.$wechat.wechatEvevt('scanQRCode', {
needResult: 1,
scanType: ["qrCode", "barCode"]
}).then(res => {
console.log(res);
this.write_code = res.resultStr
goCallate()
self.write_code = res.resultStr
self.goCallate()
}).catch(res => {
this.$util.Tips({
self.$util.Tips({
title: res
});
});;
@ -432,4 +448,4 @@
background-color: #ffffff;
}
}
</style>
</style>