Qin Dong Ming 2024-08-31 19:07:03 +08:00
commit 8c8cbde692
5 changed files with 209 additions and 37 deletions

View File

@ -57,3 +57,16 @@ export function getBirthday(data) {
data:data
})
}
export function getPostcode(code) {
return request({
url: '/port/list/getPostcode?code='+code,
method: 'GET'
})
}
export function getWeather() {
return request({
url: '/port/list/getWeather',
method: 'GET'
})
}

View File

@ -31,6 +31,16 @@ export function userRecharge(data) {
}
// 调用第三方实名认证
export function checkRealNameAuth(data) {
return request({
url: '/system/aliyun/pay/doPost',
method: 'post',
data: data
})
}
// 充值用户余额记录
export function createRechargeRecord(data) {
return request({

View File

@ -4,6 +4,25 @@
<h1>用户余额</h1>
<p>余额{{ userBalanceData.userBalance || '加载中...' }}</p>
<el-button type="primary" @click="navigateToRecharge"></el-button>
<el-dialog
title="实名认证"
:visible.sync="dialogVisible"
width="30%"
@close="handleDialogClose"
>
<el-form :model="authForm" :rules="rules" ref="authFormRef">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="authForm.name"></el-input>
</el-form-item>
<el-form-item label="身份证号" :label-width="formLabelWidth">
<el-input v-model="authForm.idCard"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"></el-button>
<el-button type="primary" @click="handleConfirm"></el-button>
</div>
</el-dialog>
</el-card>
@ -44,22 +63,36 @@
</template>
<script>
import { userBalance } from "@/api/system/user"; //
import {userBalance} from "@/api/system/user"; //
import * as echarts from 'echarts' //echarts
import {checkRealNameAuth} from "@/api/system/user";
export default {
data() {
return {
charts: "",
dialogVisible: false,
dialogFormVisible: false,
formLabelWidth: '120px',
opinionData: ["155", "400", "900", "800", "300", "900", "270","684","165","0","300","150"], //
opinionData: ["155", "400", "900", "800", "300", "900", "270", "684", "165", "0", "300", "150"], //
userBalanceData: {
userBalance: '加载中...'
},
form:{
}
authForm: {
name: '',
idCard: ''
},
rules: {
name: [
{required: true, message: '请输入姓名', trigger: 'blur'},
{min: 2, max: 10, message: '姓名长度在 2 到 10 个字符', trigger: 'blur'}
],
idCard: [
{required: true, message: '请输入身份证号', trigger: 'blur'},
{pattern: /^\d{17}[\dXx]$/, message: '身份证号格式不正确', trigger: 'blur'}
],
},
form: {}
};
},
created() {
@ -69,8 +102,51 @@ export default {
this.drawLine();
},
methods: {
navigateToRecharge() {
handleCancel() {
this.dialogVisible = false;
},
handleDialogClose() {
this.authForm.name = '';
this.authForm.idCard = '';
},
async navigateToRecharge() {
try {
const response = await checkRealNameAuth(this.authForm);
if (response.data && response.data.desc) {
//
this.$router.push('/money/zfb');
} else {
//
this.dialogVisible = true;
}
} catch (error) {
this.$message.error('实名认证检查失败,请稍后再试');
console.error('实名认证检查失败:', error);
}
},
async handleConfirm() {
this.$refs.authFormRef.validate(async (valid) => {
if (valid) {
try {
const {name, idCard} = this.authForm;
const authResponse = await checkRealNameAuth(this.authForm);
if (authResponse.data && authResponse.data.desc) {
this.$message.success('实名认证成功');
this.dialogVisible = false;
this.$router.push('/money/zfb');
} else {
this.$message.error('实名认证失败,请检查您的信息');
}
} catch (error) {
this.$message.error('实名认证验证失败,请稍后再试');
console.error('实名认证验证失败:', error);
}
} else {
console.log('error submit!!');
return false;
}
});
},
async fetchUserBalance() {
try {

View File

@ -17,9 +17,9 @@
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testPhone()" v-if="connector.connectorName=='手机号查询归属地'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testIP()" v-if="connector.connectorName=='IP查询归属地'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testNews()" v-if="connector.connectorName=='新闻头条'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="connector.connectorName=='气象预警'"></el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testWeather()" v-if="connector.connectorName=='气象预警'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testBirthdate()" v-if="connector.connectorName=='生辰助手'">API</el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="connector.connectorName=='邮编查询'"></el-button>
<el-button type="primary" style="float: right; padding: 10px 10px" @click="testMailbox()" v-if="connector.connectorName=='邮编查询'">API</el-button>
</el-card>
</el-col>
</el-row>
@ -88,31 +88,62 @@
<el-input v-model="formBirthday.hour" autocomplete="off" placeholder="请输入几点"></el-input>
</el-form-item>
<span style="font-weight: bold;font-size: 20px" v-if="formBirthday.reason==true">
{{this.formBirthday.years}}<br>
{{this.formBirthday.months}}<br>
{{this.formBirthday.days}}<br>
{{this.formBirthday.animal}}<br>
{{this.formBirthday.imonthcn}}<br>
{{this.formBirthday.idaycn}}<br>
{{this.formBirthday.cyear}}<br>
{{this.formBirthday.cmonth}}<br>
{{this.formBirthday.cday}}<br>
{{this.formBirthday.gzyear}}<br>
{{this.formBirthday.gzmonth}}<br>
{{this.formBirthday.gzday}}<br>
{{this.formBirthday.isleap}}<br>
{{this.formBirthday.ncweek}}<br>
{{this.formBirthday.isterm}}<br>
{{this.formBirthday.term}}<br>
{{this.formBirthday.astro}}<br>
{{this.formBirthday.eightall}}<br>
{{this.formBirthday.fiveall}}
years {{this.formBirthday.years}}<br>
months {{this.formBirthday.months}}<br>
days {{this.formBirthday.days}}<br>
animal {{this.formBirthday.animal}}<br>
imonthcn {{this.formBirthday.imonthcn}}<br>
idaycn {{this.formBirthday.idaycn}}<br>
cyear {{this.formBirthday.cyear}}<br>
cmonth {{this.formBirthday.cmonth}}<br>
cday {{this.formBirthday.cday}}<br>
gzyear {{this.formBirthday.gzyear}}<br>
gzmonth {{this.formBirthday.gzmonth}}<br>
gzday {{this.formBirthday.gzday}}<br>
isleap {{this.formBirthday.isleap}}<br>
ncweek {{this.formBirthday.ncweek}}<br>
isterm {{this.formBirthday.isterm}}<br>
term {{this.formBirthday.term}}<br>
astro {{this.formBirthday.astro}}<br>
eightall {{this.formBirthday.eightall}}<br>
fiveall {{this.formBirthday.fiveall}}
</span>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="getBirthday()"></el-button>
</div>
</el-dialog>
<!--邮编查询-->
<el-dialog title="邮编查询" :visible.sync="dialogFormVisible3">
<el-form :model="formPostCode">
<el-form-item label="邮编" >
<el-input v-model="formPostCode.code" autocomplete="off" placeholder="请输入邮编"></el-input>
</el-form-item>
<el-table :data="gridData2" v-if="formPostCode.reason==true">
<el-table-column property="postNumber" label="邮编" width="150"></el-table-column>
<el-table-column property="province" label="省" width="200"></el-table-column>
<el-table-column property="city" label="市"></el-table-column>
<el-table-column property="district" label="区"></el-table-column>
<el-table-column property="address" label="县"></el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="getPostcode()"></el-button>
</div>
</el-dialog>
<!-- 气象预警-->
<el-dialog title="气象预警" :visible.sync="dialogFormVisible4">
<el-aside width="100%">
<el-tree :data="data" :props="defaultProps">
<template slot-scope="{data,node}">
<span>{{data.provinceName}}{{data.cityName}}--{{data.cityCode}}</span>
</template>
</el-tree>
</el-aside>
</el-dialog>
</div>
</template>
@ -125,6 +156,8 @@ import {phonePlace} from "@/api/port/port";
import {getIpPlace} from "@/api/port/port";
import {getHeadlines} from "@/api/port/port";
import {getBirthday} from "@/api/port/port";
import {getPostcode} from "@/api/port/port";
import {getWeather} from "@/api/port/port";
export default {
//import使"
components: {},
@ -133,9 +166,26 @@ export default {
//"
return {
formWeather:{},
data:[],
defaultProps: {
children:"citys",
label:'provinceName',
},
connectorList:[],
gridData:[],
gridData2:[],
form:{},
//
formPostCode:{
code:"",
// postNumber:"",
// province:"",
// city:"",
// district:"",
// address:"",
reason:"",
},
// formInline
formInline:{
tel:"",
@ -189,6 +239,8 @@ export default {
dialogFormVisible:false,
dialogFormVisible1:false,
dialogFormVisible2:false,
dialogFormVisible3:false,
dialogFormVisible4:false,
dialogTableVisible:false,
};
},
@ -205,6 +257,26 @@ export default {
watch: {},
//",
methods: {
//
testWeather(){
getWeather().then((res)=>{
this.data=res.data;
this.dialogFormVisible4=true;
})
},
//
getPostcode(){
getPostcode(this.formPostCode.code).then((res)=>{
console.log(res.data);
this.gridData2=res.data;
this.formPostCode.reason=true;
})
},
testMailbox(){
this.dialogFormVisible3=true;
},
getBirthday(){
getBirthday(this.formBirthday).then((res)=>{
console.log(res.data);
@ -226,8 +298,8 @@ export default {
this.formBirthday.isterm=res.data.isterm;
this.formBirthday.term=res.data.term;
this.formBirthday.astro=res.data.astro;
// this.formBirthday.eightall=res.data.eightall;
// this.formBirthday.fiveall=res.data.fiveall;
this.formBirthday.eightall=res.data.eightall;
this.formBirthday.fiveall=res.data.fiveall;
})
},

View File

@ -16,15 +16,16 @@
<el-card style="margin-top: 50px;">
<h3>接口列表</h3>
<el-divider></el-divider>
<el-table :data="tableData">
<el-table-column label="">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.connectorName }}</span>
</template>
</el-table-column>
</el-table>
<!-- <el-table :data="tableData">-->
<!-- <el-table-column label="">-->
<!-- <template slot-scope="scope">-->
<!-- <span style="margin-left: 10px">{{ scope.row.connectorName }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
</el-card>
</div>
</template>
<script>