This commit is contained in:
2024-09-10 10:49:08 +08:00
parent b5fd06b800
commit dd4f5938da
6391 changed files with 722800 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
<template>
<JeepayBackground :bgColorStyle="{}">
<JeepayCustomNavbar textColor="#fff" bgDefaultColor="linear-gradient(270deg, rgba(72, 192, 255, 1) 0%, rgba(51, 157, 255, 1) 100%)" title="应用详情" backCtrl="back" />
<JeepayTableListItem viewClass="list-item-by-detail"
:title="vdata.record.appName" :subtitle="vdata.record.appId" :moreBtnList="list" />
<JeepayCard editText="编辑信息"
@editTap="go.to('/pageDevice/editPage/editPage', { navTitle: '应用名称', info: vdata.record.appName, id: vdata.record.appId, field: 'appName', api: 'app' })"
>
<JeepayDescview>
<JeepayDescviewItem title="应用名称" :desc="vdata.record.appName" />
<JeepayDescviewItem title="AppId" :desc="vdata.record.appId" />
<JeepayDescviewItem title="创建时间" :desc="vdata.record.createdAt" />
</JeepayDescview>
</JeepayCard>
<JeepayCard title="其他设置" viewStyle="margin-top: 30rpx;">
<JeepayTableListItem title="应用状态" subtitle="状态禁用后,当前应用将无法使用">
<template #titleRight>
<JeepayStateSwitch v-model:state="vdata.record.state" :showSwitchType="true" :updateStateFunc="updateState" />
</template>
</JeepayTableListItem>
<JeepayTableListItem title="是否默认" subtitle="设为默认后,该门店将成为当前商户的默认下单门店">
<template #titleRight>
<JeepayStateSwitch v-model:state="vdata.record.defaultFlag" :showSwitchType="vdata.record.defaultFlag == 0" :updateStateFunc="updateDefault" />
</template>
</JeepayTableListItem>
</JeepayCard>
</JeepayBackground>
</template>
<script setup>
import { reactive, ref } from 'vue'
import { onLoad,onUnload } from '@dcloudio/uni-app'
import { reqLoad, API_URL_MCH_APP_LIST } from '@/http/apiManager.js'
import go from '@/commons/utils/go.js'
import emit from '@/commons/utils/emit.js'
import infoBox from '@/commons/utils/infoBox.js'
onLoad((options) => {
reqLoad.getById(API_URL_MCH_APP_LIST, options.appId).then(({ bizData }) => {
vdata.record = bizData
})
})
onUnload( () => uni.$off(emit.ENAME_REF_TABLE_MCH_APP_DETAILS) )
uni.$on(emit.ENAME_REF_TABLE_MCH_APP_DETAILS, function(data){
reqLoad.getById(API_URL_MCH_APP_LIST, vdata.record.appId).then(({ bizData }) => {
vdata.record = bizData
})
})
const vdata = reactive({
record: {},
})
const payConfig = () => go.to("PAGES_APP_CONFIG", {appId: vdata.record.appId } )
const deleteApp = () => {
reqLoad.delById(API_URL_MCH_APP_LIST, vdata.record.appId).then(() => {
infoBox.showSuccessToast('删除成功')
return go.back(1, emit.ENAME_REF_TABLE_MCH_APP)
})
}
const list = reactive([
{ label: '支付配置', value: 'pay', fun: payConfig },
{ label: '删除应用', value: 'delete', color: 'red', confirmText:'您确认删除应用吗?', fun: deleteApp },
])
// 更新状态
function updateState(state) {
return reqLoad.updateById(API_URL_MCH_APP_LIST, vdata.record.appId, { state: state }).then(() => {
emit.pageEmit(emit.ENAME_REF_TABLE_MCH_APP) // 修改列表页面。
infoBox.showSuccessToast('修改成功')
})
}
// 更新状态
function updateDefault(defaultFlag) {
return reqLoad.updateById(API_URL_MCH_APP_LIST, vdata.record.appId, { defaultFlag: defaultFlag }).then(() => {
emit.pageEmit(emit.ENAME_REF_TABLE_MCH_APP) // 修改列表页面。
infoBox.showSuccessToast('修改成功')
})
}
</script>
<style lang="scss" scoped>
.default-image {
width: 50rpx;
height: 50rpx;
}
</style>

View File

@@ -0,0 +1,40 @@
<template>
<view class="page-wrapper">
<JeepayCustomNavbar title="应用管理" backCtrl="back" />
<JSearchTitle place="搜索应用" @tap="go.toSearchPage('mchApp')" />
<JeepayTableList ref="jeepayTableListRef" :reqTableDataFunc="reqTableDataFunc">
<template #tableBody="{ record }">
<MchAppRender :record="record" />
</template>
</JeepayTableList>
</view>
</template>
<script setup>
import { nextTick, reactive, ref } from "vue"
import { onReachBottom, onShow, onUnload } from '@dcloudio/uni-app'
import go from '@/commons/utils/go.js'
import emit from '@/commons/utils/emit.js'
import { reqLoad, API_URL_MCH_APP_LIST } from "@/http/apiManager.js"
import MchAppRender from '@/pages/list/render/MchAppRender.vue'
const jeepayTableListRef = ref()
onReachBottom(() => { })
// 监听 更新事件
onUnload( () => uni.$off(emit.ENAME_REF_TABLE_MCH_APP) )
uni.$on(emit.ENAME_REF_TABLE_MCH_APP, function(data){
jeepayTableListRef.value.refTable(true)
})
// 请求
function reqTableDataFunc (params) {
return reqLoad.list(API_URL_MCH_APP_LIST, params)
}
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,98 @@
<template>
<JeepayBackground >
<JeepayCustomNavbar title="应用支付配置" backCtrl="back" />
<JSearchTitle place="搜索支付方式代码、名称" @click=" () => go.toSearchPage('payPassage', {appId: vdata.searchData.appId})">
<template #right>
<view class="pay-type" @tap="single.open(vdata.searchData.wayType)">
{{ getSearchWayTypeStr() }}
<image src="/pageDevice/static/devIconImg/icon-arrow-down.svg" mode="scaleToFill" />
</view>
</template>
</JSearchTitle>
<JeepayTableList ref="jeepayTableListRef" :reqTableDataFunc="reqTableDataFunc" :searchData="vdata.searchData" >
<template #tableBody="{ record }">
<AppConfigRender :record="record" :configAppId="vdata.searchData.appId" />
</template>
</JeepayTableList>
<JSinglePopup title="请选择支付类型" ref="single" :list="list" @confirm="confirm" />
</JeepayBackground>
</template>
<script setup>
import { reactive, ref } from 'vue'
import { onLoad, onUnload, onReachBottom } from '@dcloudio/uni-app'
import { reqLoad, API_URL_PAY_PASSAGE_LIST } from '@/http/apiManager.js'
import go from '@/commons/utils/go.js'
import emit from '@/commons/utils/emit.js'
import infoBox from '@/commons/utils/infoBox.js'
import AppConfigRender from '@/pages/list/render/AppConfigRender.vue'
// 触底刷新
onReachBottom(() => { })
const jeepayTableListRef = ref(null)
// 监听 更新事件
onUnload( () => uni.$off(emit.ENAME_REF_PAY_PASSAGE_LIST) )
uni.$on(emit.ENAME_REF_PAY_PASSAGE_LIST, function(data){
jeepayTableListRef.value.refTable(true)
})
const vdata = reactive({
searchData: {},
})
onLoad((options) => {
vdata.searchData.appId = options.appId
})
// 请求
function reqTableDataFunc (params) {
return reqLoad.list(API_URL_PAY_PASSAGE_LIST, params)
}
const single = ref(null)
const list = reactive([
{ label: '全部类型', value: '' },
{ label: '微信', value: 'WECHAT' },
{ label: '支付宝', value: 'ALIPAY' },
{ label: '云闪付', value: 'YSFPAY' },
{ label: '银联', value: 'UNIONPAY' },
{ label: '其他', value: 'OTHER' },
])
const confirm = (e) => {
vdata.searchData.wayType = e.value
jeepayTableListRef.value.refTable(true)
}
function getSearchWayTypeStr(){
if(!vdata.searchData.wayType){
return "全部类型"
}
return list.filter(r => r.value == vdata.searchData.wayType)[0].label
}
</script>
<style lang="scss" scoped>
.pay-type {
display: flex;
align-items: center;
margin-left: 40rpx;
font-size: 30rpx;
font-weight: 400;
color: #222425;
image {
margin-left: 10rpx;
width: 40rpx;
height: 40rpx;
}
}
</style>