添加:门店管理端 - 支持生成买单二维码

This commit is contained in:
wuhui_zzw 2024-01-23 14:32:55 +08:00
parent ecd96a69bb
commit 128234c85e
3 changed files with 45 additions and 4 deletions

View File

@ -4,6 +4,10 @@ import request from "@/utils/request.js";
export function promoteQrCodes(data) {
return request.get('merchant/promote_qr_code',data);
}
// 商户中心 - 买单二维码
export function onlinePaymentQrCodes(data) {
return request.get('merchant/online_payment_qr_code',data);
}
@ -16,4 +20,3 @@ export function promoteQrCodes(data) {

View File

@ -34,6 +34,7 @@
import emptyPage from '@/components/emptyPage.vue'
import shopList from '@/components/shopList';
import {promoteQrCodes} from "@/api/merchant";
import {onlinePaymentQrCodes} from "../../../api/merchant";
export default {
name: 'business',
@ -107,6 +108,12 @@ import {promoteQrCodes} from "@/api/merchant";
icon: 'iconfont icon-erweima1'
});
}
list.push({
type: 'online_payment_qr_code',
title: '买单二维码',
url: '',
icon: 'iconfont icon-erweima1'
});
return list;
}
@ -134,7 +141,10 @@ import {promoteQrCodes} from "@/api/merchant";
this.downStatus = false;
},
goNext(item){
if(item.type == 'qr_code' && this.service.qr_code_show == 1){
if(item.type == 'online_payment_qr_code'){
this.createOnlinePaymentQrCode();
}
else if(item.type == 'qr_code' && this.service.qr_code_show == 1){
this.createQrCode();
}
else if(item.type == 'customer' && this.service.status == 0){
@ -162,7 +172,7 @@ import {promoteQrCodes} from "@/api/merchant";
})
}
},
// 广 -
// - 广
createQrCode(){
let _this = this;
promoteQrCodes({ mer_id: _this.service.mer_id }).then(res => {
@ -176,6 +186,20 @@ import {promoteQrCodes} from "@/api/merchant";
});
});
},
// -
createOnlinePaymentQrCode(){
let _this = this;
onlinePaymentQrCodes({ mer_id: _this.service.mer_id }).then(res => {
if (res.status == 200) {
_this.qrCode = res.data.qr_code || '';
_this.$refs.qrCodePopup.open('center');
}
}).catch(err => {
this.$util.Tips({
title: err
});
});
},
// 广 -
closeQrCode(){
this.$refs.qrCodePopup.close();

View File

@ -7,7 +7,7 @@
<view class="left">
<image class="image" :src="mer_info.mer_avatar || '/static/images/f.png'"></image>
<view class="name" @click="merShowPopup">{{ mer_info.mer_name || '请选择门店' }}</view>
<view class="change-btn" @click="merShowPopup" v-if="mer_info.mer_id > 0">切换</view>
<view class="change-btn" @click="merShowPopup" v-if="mer_info.mer_id > 0 && default_mer_id <= 0">切换</view>
</view>
<view class="right" @click="goMenuPage('/pages/users/online_payment/payment/record')">消费记录</view>
</view>
@ -108,6 +108,7 @@ export default {
mer_info:{},
mer_list: {},
mer_search: {
mer_id: 0,
search_text: '',
},
//
@ -118,6 +119,7 @@ export default {
return_url: 'http://' + window.location.host + '/pages/users/order_list/index',
// #endif
},
default_mer_id: 0,
//
pay_list: [
{
@ -162,6 +164,14 @@ export default {
...mapGetters(['isLogin', 'userInfo', 'viewColor'])
},
onLoad(options) {
//
if(options.scene){
// console.log(" - ",options.scene)
var scene = this.$util.getUrlParams(decodeURIComponent(options.scene));
// console.log(" - ",scene)
this.default_mer_id = scene.mer_id || 0;
this.mer_search.mer_id = scene.mer_id || 0;
}
//
if (!this.isLogin) {
//
@ -213,6 +223,10 @@ export default {
searchMer(this.mer_search)
.then(res => {
_this.mer_list = res.data || {};
// 使
if(Number(_this.default_mer_id) > 0 && Object.values(_this.mer_list).length === 1){
this.selectedMer(_this.mer_list[0]);
}
})
.catch(err => {
this.$util.Tips({