增加:公共小程序码弹框组件

修改:运营中心 - 小程序码弹框修改为使用公共组件,不在单独处理
This commit is contained in:
wuhui_zzw 2024-06-14 10:33:42 +08:00
parent 5c0b61202e
commit 4d1ac44417
2 changed files with 131 additions and 48 deletions

View File

@ -0,0 +1,103 @@
<template>
<view class="components-qrCode-content">
<uni-popup ref="qrCodePopup" type="center" :is-mask-click="false" :mask-click="false">
<view class="qr-code-content">
<image class="image" :src="qr_code"></image>
<view class="close-qr-code" @click="qrCodeClose()">关闭</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {getQrCodeLink} from "@/api/api";
export default {
props: {
//
isShow: {
type: Boolean,
default: false
},
//
params: {
type: Object,
default() {
return {};
}
},
},
components: {},
data() {
return {
qr_code: '',
};
},
watch: {
isShow: {
handler(newValue) {
// console.log('',newValue)
if(newValue) this.getQrCodeInfo();
else this.$refs.qrCodePopup.close();
},
deep: true
},
},
mounted() {},
methods: {
//
getQrCodeInfo(){
let _this = this;
uni.showLoading({title: '处理中...', mask: true})
getQrCodeLink(_this.params).then(res => {
if (res.status == 200) {
_this.qr_code = res.data.qr_code || '';
_this.qrCodeShow();
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
//
qrCodeShow(){
this.$refs.qrCodePopup.open('center');
uni.hideLoading();
},
//
qrCodeClose(){
this.$emit('close');
},
}
}
</script>
<style scoped lang="scss">
.components-qrCode-content{
//
.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>

View File

@ -95,16 +95,8 @@
<view class='close-btn' @click="qrCodeTypeClose">取消</view> <view class='close-btn' @click="qrCodeTypeClose">取消</view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 二维码弹框 --> <!--二维码弹框-->
<uni-popup ref="qrCodePopup" type="center"> <qr-code :isShow="qr_code_show" :params="qr_code_params" @close="qr_code_show = false"></qr-code>
<view class="qr-code-content">
<image class="image" :src="promotion_qr_code"></image>
<view class="close-qr-code" @click="qrCodeClose()">关闭</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
@ -112,13 +104,15 @@
<script> <script>
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import {roleAndCorrelationRole,inviteSupplierJoinQrCode} from "@/api/agent"; import qrCode from "@/components/diyPopup/qrCode";
import {roleAndCorrelationRole} from "@/api/agent";
import {storeLoginSimulation} from "@/api/store"; import {storeLoginSimulation} from "@/api/store";
export default { export default {
name: 'business', name: 'business',
components: { components: {
authorize, authorize,
qrCode
}, },
computed: { computed: {
staging_list() { staging_list() {
@ -205,7 +199,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'supplier' type: 'agent_supplier'
} }
}); });
} }
@ -216,7 +210,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 9, level: 9,
} }
}); });
@ -226,7 +220,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 10, level: 10,
} }
}); });
@ -238,7 +232,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 2, level: 2,
} }
}); });
@ -250,7 +244,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 3, level: 3,
} }
}); });
@ -260,7 +254,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 4, level: 4,
} }
}); });
@ -272,7 +266,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 5, level: 5,
} }
}); });
@ -284,7 +278,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 6, level: 6,
} }
}); });
@ -296,7 +290,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 7, level: 7,
} }
}); });
@ -306,7 +300,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 8, level: 8,
} }
}); });
@ -316,7 +310,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 1, merchant_type: 1,
} }
}); });
@ -326,7 +320,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 0, merchant_type: 0,
} }
}); });
@ -336,7 +330,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 4, merchant_type: 4,
} }
}); });
@ -346,7 +340,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 6, merchant_type: 6,
} }
}); });
@ -356,7 +350,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 7, merchant_type: 7,
} }
}); });
@ -368,7 +362,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'subordinate', type: 'agent_subordinate',
level: 11, level: 11,
} }
}); });
@ -380,7 +374,7 @@ export default {
url: '', url: '',
icon: 'icon-erweima1', icon: 'icon-erweima1',
params: { params: {
type: 'merchant', type: 'agent_merchant',
merchant_type: 3, merchant_type: 3,
} }
}); });
@ -419,7 +413,9 @@ export default {
corporate_name: '', corporate_name: '',
agent_info: {}, agent_info: {},
children: {}, children: {},
promotion_qr_code: '', //
qr_code_show: false,
qr_code_params: {},
} }
}, },
onLoad(options) { onLoad(options) {
@ -532,27 +528,11 @@ export default {
qrCodeTypeSelected(menu){ qrCodeTypeSelected(menu){
let _this = this; let _this = this;
_this.qrCodeTypeClose(); _this.qrCodeTypeClose();
_this.promotion_qr_code = ''; //
let params = menu.params || {}; let params = menu.params || {};
params.agent_id = _this.agent_info.id || 0; params.agent_id = _this.agent_info.id || 0;
// 广 this.qr_code_params = params;
inviteSupplierJoinQrCode(params).then(res => { this.qr_code_show = true;
if (res.status == 200) {
_this.promotion_qr_code = res.data.qr_code || '';
_this.qrCodeShow();
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
// 广 -
qrCodeShow(){
this.$refs.qrCodePopup.open('center');
},
// 广 -
qrCodeClose(){
this.$refs.qrCodePopup.close();
}, },
// - // -
storeManagement(){ storeManagement(){