fourPayProject/51pay-uni/homePages/Agent/Rate.vue
2025-03-31 10:14:11 +08:00

137 lines
2.6 KiB
Vue

<template>
<view class="content">
<view class="container">
<headers :titles="titles"><u-icon name="arrow-left" color="#fff" size="18"></u-icon></headers>
<view class="box-t">
<view class="">微信费率(%)</view>
<view class="i-r">
<input v-model="formData.wxRate" type="number" placeholder="请输入" />
</view>
</view>
<view class="box-t">
<view class="">支付宝费率(%)</view>
<view class="i-r">
<input v-model="formData.aliRate" type="number" placeholder="请输入" />
</view>
</view>
<view class="box-t">
<view class="">云闪付费率(%)</view>
<view class="i-r">
<input v-model="formData.unionPayRate" type="number" placeholder="请输入" />
</view>
</view>
<view class="anniu" @click="updateOrSaveRate()">
修改
</view>
</view>
</view>
</template>
<script>
import headers from '../../components/header/headers.vue'
import request from '../../utils/request.js'
export default {
data() {
return {
titles: "费率设置",
msg: "1",
dataList: [],
show: false,
status: 'loading',
agentId: null,
formData: {}
}
},
onLoad(option) {
if (option.agentId) {
this.agentId = option.agentId
}
},
onShow() {
this.getAgentInfo()
},
components: {
headers
},
methods: {
//获取代理商详情
getAgentInfo() {
request({
url: '/app/uaAgent/agentInfo',
method: 'post',
data: {
objectId: this.agentId
}
}).then(res => {
this.formData.wxRate = res.agentInfo.wxRate
this.formData.aliRate = res.agentInfo.aliRate
this.formData.unionPayRate = res.agentInfo.unionPayRate
this.formData.agentId = res.agentInfo.id
this.$forceUpdate()
})
},
updateOrSaveRate(audit) {
request({
url: '/app/uaAgent/updateOrSaveRate',
method: 'post',
data: this.formData
}).then(res => {
uni.navigateBack()
})
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #fff;
height: 100vh;
}
.container {
width: 100%;
background: #fff;
box-sizing: border-box;
padding-top: 88px;
}
.box-t {
width: 95%;
box-sizing: border-box;
padding: 10px 15px;
display: flex;
align-items: center;
box-shadow: 3px 3px 7px -2px #d8d8d8;
justify-content: space-between;
margin: 10px auto;
}
.i-r {
text-align: right;
}
.anniu {
width: 50%;
border-radius: 50px;
background: #E4612E;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
color: white;
box-sizing: border-box;
padding: 15px;
margin-top: 50px;
}
</style>