parent
5c0b61202e
commit
4d1ac44417
|
|
@ -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>
|
||||
|
|
@ -95,16 +95,8 @@
|
|||
<view class='close-btn' @click="qrCodeTypeClose">取消</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<!-- 二维码弹框 -->
|
||||
<uni-popup ref="qrCodePopup" type="center">
|
||||
<view class="qr-code-content">
|
||||
<image class="image" :src="promotion_qr_code"></image>
|
||||
<view class="close-qr-code" @click="qrCodeClose()">关闭</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
|
||||
<!--二维码弹框-->
|
||||
<qr-code :isShow="qr_code_show" :params="qr_code_params" @close="qr_code_show = false"></qr-code>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -112,13 +104,15 @@
|
|||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
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";
|
||||
|
||||
export default {
|
||||
name: 'business',
|
||||
components: {
|
||||
authorize,
|
||||
qrCode
|
||||
},
|
||||
computed: {
|
||||
staging_list() {
|
||||
|
|
@ -205,7 +199,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'supplier'
|
||||
type: 'agent_supplier'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -216,7 +210,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 9,
|
||||
}
|
||||
});
|
||||
|
|
@ -226,7 +220,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 10,
|
||||
}
|
||||
});
|
||||
|
|
@ -238,7 +232,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 2,
|
||||
}
|
||||
});
|
||||
|
|
@ -250,7 +244,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 3,
|
||||
}
|
||||
});
|
||||
|
|
@ -260,7 +254,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 4,
|
||||
}
|
||||
});
|
||||
|
|
@ -272,7 +266,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 5,
|
||||
}
|
||||
});
|
||||
|
|
@ -284,7 +278,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 6,
|
||||
}
|
||||
});
|
||||
|
|
@ -296,7 +290,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 7,
|
||||
}
|
||||
});
|
||||
|
|
@ -306,7 +300,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 8,
|
||||
}
|
||||
});
|
||||
|
|
@ -316,7 +310,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 1,
|
||||
}
|
||||
});
|
||||
|
|
@ -326,7 +320,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 0,
|
||||
}
|
||||
});
|
||||
|
|
@ -336,7 +330,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 4,
|
||||
}
|
||||
});
|
||||
|
|
@ -346,7 +340,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 6,
|
||||
}
|
||||
});
|
||||
|
|
@ -356,7 +350,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 7,
|
||||
}
|
||||
});
|
||||
|
|
@ -368,7 +362,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'subordinate',
|
||||
type: 'agent_subordinate',
|
||||
level: 11,
|
||||
}
|
||||
});
|
||||
|
|
@ -380,7 +374,7 @@ export default {
|
|||
url: '',
|
||||
icon: 'icon-erweima1',
|
||||
params: {
|
||||
type: 'merchant',
|
||||
type: 'agent_merchant',
|
||||
merchant_type: 3,
|
||||
}
|
||||
});
|
||||
|
|
@ -419,7 +413,9 @@ export default {
|
|||
corporate_name: '',
|
||||
agent_info: {},
|
||||
children: {},
|
||||
promotion_qr_code: '',
|
||||
// 二维码信息
|
||||
qr_code_show: false,
|
||||
qr_code_params: {},
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
|
@ -532,27 +528,11 @@ export default {
|
|||
qrCodeTypeSelected(menu){
|
||||
let _this = this;
|
||||
_this.qrCodeTypeClose();
|
||||
_this.promotion_qr_code = '';
|
||||
|
||||
// 显示二维码弹框
|
||||
let params = menu.params || {};
|
||||
params.agent_id = _this.agent_info.id || 0;
|
||||
// 请求获取推广二维码
|
||||
inviteSupplierJoinQrCode(params).then(res => {
|
||||
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();
|
||||
this.qr_code_params = params;
|
||||
this.qr_code_show = true;
|
||||
},
|
||||
// 管理门店 - 模拟登录
|
||||
storeManagement(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue