源文件
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-modal v-model:visible="vdata.visible" title="自动获取渠道用户ID" :footer="null" :width="300" @ok="handleClose">
|
||||
<div style="width:100%;margin-bottom:20px;text-align:center">
|
||||
<div id="qrCodeUrl" style="width: 300px" class="qrcode" />
|
||||
<QrcodeVue :value="vdata.qrImgUrl" :size="250" class="qrcode" />
|
||||
<hr>
|
||||
<span>{{ vdata.payText }}</span>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import ReconnectingWebSocket from 'reconnectingwebsocket'
|
||||
// import vueQr from 'vue-qr'
|
||||
import QrcodeVue from 'qrcode.vue'
|
||||
import { $getWebSocketPrefix, $getChannelUserQrImgUrl } from '@/api/manage'
|
||||
import { reactive, getCurrentInstance} from 'vue'
|
||||
|
||||
// 获取全局函数
|
||||
const { $infoBox } = getCurrentInstance()!.appContext.config.globalProperties
|
||||
|
||||
|
||||
const emit = defineEmits(['changeChannelUserId'])
|
||||
const vdata = reactive({
|
||||
visible: false,
|
||||
qrImgUrl: '',
|
||||
payText: '', // 二维码底部描述文字
|
||||
transferOrderWebSocket: null as any, // 支付订单webSocket对象 //TODO 修改了webSocket类型
|
||||
extObject: null // 扩展对象, 将原样返回。
|
||||
})
|
||||
|
||||
|
||||
defineExpose({showModal})
|
||||
// show
|
||||
function showModal (appId, ifCode, extObject) {
|
||||
|
||||
vdata.extObject = extObject
|
||||
// 关闭上一个webSocket监听
|
||||
if (vdata.transferOrderWebSocket) {
|
||||
// console.log( vdata.transferOrderWebSocket)
|
||||
vdata.transferOrderWebSocket.close()
|
||||
}
|
||||
|
||||
// 根据不同的支付方式,展示不同的信息
|
||||
vdata.payText = ''
|
||||
if (ifCode === 'wxpay') {
|
||||
vdata.payText = '请使用微信客户端"扫一扫"'
|
||||
} else if (ifCode === 'alipay') {
|
||||
vdata.payText = '请使用支付宝客户端"扫一扫"'
|
||||
}
|
||||
|
||||
// 当前客户端CID
|
||||
const cid = appId + new Date().getTime()
|
||||
// 获取二维码地址
|
||||
$getChannelUserQrImgUrl(ifCode, appId, cid).then(res => {
|
||||
//console.log( vdata.qrImgUrl,'11111111')
|
||||
|
||||
vdata.qrImgUrl = res
|
||||
|
||||
vdata.visible = true // 打开弹窗
|
||||
|
||||
// 监听响应结果
|
||||
vdata.transferOrderWebSocket = new ReconnectingWebSocket($getWebSocketPrefix() + '/api/anon/ws/channelUserId/' + appId + '/' + cid)
|
||||
vdata.transferOrderWebSocket!.onopen = () => {}
|
||||
vdata.transferOrderWebSocket!.onmessage = (msgObject) => {
|
||||
emit('changeChannelUserId', { channelUserId: msgObject.data, extObject: vdata.extObject }) // 上层赋值
|
||||
handleClose()
|
||||
}
|
||||
})
|
||||
}
|
||||
function handleClose () {
|
||||
if (vdata.transferOrderWebSocket) {
|
||||
|
||||
|
||||
vdata.transferOrderWebSocket.close()
|
||||
}
|
||||
vdata.visible = false
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.describe {
|
||||
img {
|
||||
width: 30px;
|
||||
height: 25px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
20
jeepay-ui-merchant/src/components/GlobalFooter/index.vue
Normal file
20
jeepay-ui-merchant/src/components/GlobalFooter/index.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<global-footer class="footer custom-render">
|
||||
<template v-slot:links>
|
||||
</template>
|
||||
<template v-slot:copyright>
|
||||
<a href="http://www.jeequan.com" target="_blank">@计全科技</a>
|
||||
</template>
|
||||
</global-footer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { GlobalFooter } from '@ant-design-vue/pro-layout'
|
||||
|
||||
export default {
|
||||
name: 'ProGlobalFooter',
|
||||
components: {
|
||||
GlobalFooter
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<a-dropdown placement="bottomRight">
|
||||
<span class="ant-pro-account-avatar">
|
||||
<a-avatar size="small" :src="greetImg" class="antd-pro-global-header-index-avatar" />
|
||||
<span>{{ currentUserName }}</span>
|
||||
</span>
|
||||
<template v-slot:overlay>
|
||||
<a-menu class="ant-pro-drop-down menu" :selected-keys="[]">
|
||||
|
||||
<a-menu-item v-if="$access('ENT_C_USERINFO')" key="settings" @click="handleToSettings">
|
||||
<a-icon type="setting" />
|
||||
账户设置
|
||||
</a-menu-item>
|
||||
|
||||
<a-menu-divider />
|
||||
|
||||
<a-menu-item key="logout" @click="handleLogout">
|
||||
<a-icon type="logout" />
|
||||
退出登录
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AvatarDropdown',
|
||||
props: {
|
||||
},
|
||||
data: function () {
|
||||
return {
|
||||
// currentUserName: this.$store.state.user.userName
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 返回用户名
|
||||
currentUserName () {
|
||||
return this.$store.state.user.userName
|
||||
},
|
||||
// 返回头像
|
||||
greetImg () {
|
||||
return this.$store.state.user.avatarImgPath
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleToSettings () {
|
||||
this.$router.push({ name: 'ENT_C_USERINFO' })
|
||||
},
|
||||
handleLogout: function (e) {
|
||||
this.$infoBox.confirmPrimary('确认退出?', '', () => {
|
||||
this.$store.dispatch('Logout').then(() => {
|
||||
this.$router.push({ name: 'login' })
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.ant-pro-drop-down {
|
||||
/deep/ .action {
|
||||
margin-right: 8px;
|
||||
}
|
||||
/deep/ .ant-dropdown-menu-item {
|
||||
min-width: 160px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div :class="wrpCls">
|
||||
<avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="prefixCls" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AvatarDropdown from './AvatarDropdown'
|
||||
// import store from '@/store'
|
||||
|
||||
export default {
|
||||
name: 'RightContent',
|
||||
components: {
|
||||
AvatarDropdown
|
||||
},
|
||||
props: {
|
||||
prefixCls: {
|
||||
type: String,
|
||||
default: 'ant-pro-global-header-index-action'
|
||||
},
|
||||
isMobile: {
|
||||
type: Boolean,
|
||||
default: () => false
|
||||
},
|
||||
topMenu: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
theme: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
showMenu: true,
|
||||
currentUser: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
wrpCls () {
|
||||
return {
|
||||
'ant-pro-global-header-index-right': true,
|
||||
[`ant-pro-global-header-index-${(this.isMobile || !this.topMenu) ? 'light' : this.theme}`]: true
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// console.log(store)
|
||||
this.currentUser = {
|
||||
name: 'dd'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
30
jeepay-ui-merchant/src/components/GlobalLoad/GlobalLoad.vue
Normal file
30
jeepay-ui-merchant/src/components/GlobalLoad/GlobalLoad.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="loading">
|
||||
<div>
|
||||
<a-spin size="large" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'GlobalLoad',
|
||||
data () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.loading{
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
z-index:100;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(255,255,255,0.25);
|
||||
}
|
||||
</style>
|
||||
82
jeepay-ui-merchant/src/components/NProgress/nprogress.less
Normal file
82
jeepay-ui-merchant/src/components/NProgress/nprogress.less
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Make clicks pass-through */
|
||||
#nprogress {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#nprogress .bar {
|
||||
background: var(--ant-primary-color);
|
||||
|
||||
position: fixed;
|
||||
z-index: 1031;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
}
|
||||
|
||||
/* Fancy blur effect */
|
||||
#nprogress .peg {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width: 100px;
|
||||
height: 100%;
|
||||
box-shadow: 0 0 10px var(--ant-primary-color),
|
||||
0 0 5px var(--ant-primary-color);
|
||||
opacity: 1;
|
||||
|
||||
-webkit-transform: rotate(3deg) translate(0px, -4px);
|
||||
-ms-transform: rotate(3deg) translate(0px, -4px);
|
||||
transform: rotate(3deg) translate(0px, -4px);
|
||||
}
|
||||
|
||||
/* Remove these to get rid of the spinner */
|
||||
#nprogress .spinner {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 1031;
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
#nprogress .spinner-icon {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
box-sizing: border-box;
|
||||
|
||||
border: solid 2px transparent;
|
||||
border-top-color: var(--ant-primary-color);
|
||||
border-left-color: var(--ant-primary-color);
|
||||
border-radius: 50%;
|
||||
|
||||
-webkit-animation: nprogress-spinner 400ms linear infinite;
|
||||
animation: nprogress-spinner 400ms linear infinite;
|
||||
}
|
||||
|
||||
.nprogress-custom-parent {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nprogress-custom-parent #nprogress .spinner,
|
||||
.nprogress-custom-parent #nprogress .bar {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@-webkit-keyframes nprogress-spinner {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes nprogress-spinner {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user