源文件
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,.5)" :safe-area="false">
|
||||
<!-- 通用弹窗 -->
|
||||
<view class="card-wrapper">
|
||||
<view class="card-title disFlexCenter">选择支付渠道</view>
|
||||
<view class="card-main">
|
||||
<block v-for="v in payConfigList" :key="v.ifCode">
|
||||
<payCard :ifName="v.ifName" :paywayFee="v.paywayFee" :bgColor="v.bgColor" :icon="v.icon">
|
||||
<template #right>
|
||||
<view class="state"> <switch :checked="v.configState == 1" style="margin: 0; transform: scale(1.2)" color="#7737fe" @change="stateChange($event, v)" /> </view>
|
||||
</template>
|
||||
</payCard>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
<jeepayConfirm ref="refConfirm" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { $getPayChannelList, $savePayConfig } from '@/http/apiManager.js'
|
||||
import payCard from './payCard.vue'
|
||||
|
||||
const emits = defineEmits(['upDataList'])
|
||||
// 支付应用的列表
|
||||
const payConfigList = reactive([])
|
||||
const refConfirm = ref(null)
|
||||
const popup = ref(null)
|
||||
const params = {
|
||||
appId: undefined,
|
||||
wayCode: undefined,
|
||||
}
|
||||
let index = undefined
|
||||
const open = (appId, wayCode, i) => {
|
||||
index = i
|
||||
params.appId = appId
|
||||
params.wayCode = wayCode
|
||||
getConfigList(appId, wayCode)
|
||||
}
|
||||
|
||||
const stateChange = (e, val) => {
|
||||
val.configState = Number(e.detail.value)
|
||||
refConfirm.value.comfirmOpen(
|
||||
() => {
|
||||
$savePayConfig({
|
||||
appId: params.appId,
|
||||
wayCode: params.wayCode,
|
||||
ifCode: val.ifCode,
|
||||
state: val.configState,
|
||||
}).then((res) => {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'success|none',
|
||||
mask: true,
|
||||
})
|
||||
getConfigList(params.appId, params.wayCode, true)
|
||||
emits('upDataList', { index, state: val.configState })
|
||||
})
|
||||
},
|
||||
`${val.configState == 1 ? '确认启用该通道?开启后将会将其他通道关闭' : '确认关闭该渠道?'}`,
|
||||
() => {
|
||||
val.configState = Number(!e.detail.value)
|
||||
}
|
||||
)
|
||||
}
|
||||
// 获取可配置渠道
|
||||
const getConfigList = (appId, wayCode, ifOpen) => {
|
||||
$getPayChannelList(appId, wayCode).then(({ bizData }) => {
|
||||
if (bizData.records.length != 0) {
|
||||
payConfigList.length = 0
|
||||
Object.assign(payConfigList, bizData.records)
|
||||
if (ifOpen) return
|
||||
popup.value.open()
|
||||
} else {
|
||||
uni.showToast({ title: '暂无可配置渠道', icon: 'none' })
|
||||
}
|
||||
})
|
||||
}
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card-wrapper {
|
||||
max-height: 70vh;
|
||||
|
||||
border-radius: 32rpx 32rpx 0 0;
|
||||
background-color: #fff;
|
||||
.card-main {
|
||||
height: calc(70vh - 110rpx - 170rpx);
|
||||
padding-bottom: 60rpx;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.card-title {
|
||||
margin-bottom: 10rpx;
|
||||
height: 110rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
border-bottom: 1rpx solid rgba(0, 0, 0, 0.07);
|
||||
}
|
||||
.card-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
height: 170rpx;
|
||||
border-top: 1rpx solid #ededed;
|
||||
button {
|
||||
flex: 1;
|
||||
height: 110rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 33rpx;
|
||||
font-weight: 500;
|
||||
&::after {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.cancel {
|
||||
margin-right: 30rpx;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
.confirm {
|
||||
color: #fff;
|
||||
background: linear-gradient(270deg, rgba(35, 143, 252, 1) 0%, rgba(26, 102, 255, 1) 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.disFlexCenter {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
114
jeepay-ui-uapp-agent/pageWork/appManage/components/appCard.vue
Normal file
114
jeepay-ui-uapp-agent/pageWork/appManage/components/appCard.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<view class="card-wrapper" :style="{ '--state-bg-color': state == 1 ? '#7737FE' : '#B3B3B3' }">
|
||||
<view class="app-header">
|
||||
<image src="/static/navImg/icon-app.svg" mode="scaleToFill" />
|
||||
<view class="app-info">
|
||||
<view class="app-title">
|
||||
<view class="app-name single-text-beyond">{{ appName }}</view>
|
||||
<view class="app-state">{{ state == 1 ? '已启用' : '已禁用' }}</view>
|
||||
</view>
|
||||
<view class="sub-title">{{ appId }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mch-info">
|
||||
<view class="left">
|
||||
<image src="/pageWork/static/images/icon-mch-black.svg" mode="scaleToFill" />
|
||||
<view class="mch-title"> {{ mchName }} </view>
|
||||
</view>
|
||||
<view class="right"> {{ mchNo }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
appName: { type: String }, //应用名称
|
||||
mchNo: { type: String }, // 用户号
|
||||
state: [String, Number], //状态
|
||||
appId: { type: String }, //应用id
|
||||
mchName: { type: String }, // 用户名称
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.card-wrapper {
|
||||
padding: 0.1rpx 30rpx;
|
||||
height: 257rpx;
|
||||
background-color: #fff;
|
||||
border-bottom: 1rpx solid #ededed;
|
||||
.app-header {
|
||||
display: flex;
|
||||
margin-top: 30rpx;
|
||||
height: 92rpx;
|
||||
image {
|
||||
margin-right: 20rpx;
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
}
|
||||
.app-info {
|
||||
flex: 1;
|
||||
.app-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
text {
|
||||
font-size: 33rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
.app-name{
|
||||
width: 440rpx;
|
||||
}
|
||||
.app-state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
&::before {
|
||||
content: '';
|
||||
display: block;
|
||||
margin-right: 15rpx;
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
border-radius: 50%;
|
||||
background-color: var(--state-bg-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
.sub-title {
|
||||
margin-top: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
.mch-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20rpx;
|
||||
margin-top: 20rpx;
|
||||
height: 80rpx;
|
||||
background-color: #f7f7f7;
|
||||
border-radius: 10rpx;
|
||||
font-size: 29rpx;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
image {
|
||||
margin-right: 10rpx;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
.mch-title {
|
||||
width: 232rpx;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
color: #8c8c8c;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<view class="pay-wrapper">
|
||||
<view class="pay-info">
|
||||
<view class="pay-logo disFlexCenter" :style="{ backgroundColor: bgColor }">
|
||||
<image :src="icon" mode="scaleToFill" />
|
||||
</view>
|
||||
|
||||
<view class="info-main">
|
||||
<view class="pay-title">
|
||||
<text>{{ ifName }}</text>
|
||||
<slot name="right" />
|
||||
</view>
|
||||
<view class="pay-rate">单笔费率:{{ paywayFee.feeRate * 100 }}%</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
ifName: { typ: String }, //通道标题
|
||||
bgColor: { type: String }, //logo 背景颜色
|
||||
icon: { type: String }, // logo地址
|
||||
paywayFee: { type: Object, default: () => ({}) }, //费率
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pay-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 40rpx;
|
||||
height: 170rpx;
|
||||
.pay-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
.pay-logo {
|
||||
margin-right: 20rpx;
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
border-radius: 20rpx;
|
||||
background-color: #07112d;
|
||||
image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
.info-main {
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
.pay-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.pay-rate {
|
||||
margin-top: 15rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 400;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.disFlexCenter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user