接口对接

This commit is contained in:
zwz 2026-06-16 10:58:02 +08:00
parent 2c37f4319e
commit a74c48f1cf
11 changed files with 426 additions and 435 deletions

View File

@ -1,14 +0,0 @@
import http from '@/http/api.js'
// 获取验证码
const captcha = (data) => {
return http.request({
url: '/api/blade-auth/oauth/captcha',
method: 'GET',
data
})
}
export default {
captcha,
}

View File

@ -1,36 +0,0 @@
import http from '@/http/api.js'
// 获取通知公告列表
export const getList = (params) => {
return http.request({
url: '/api/blade-desk/notice/list',
method: 'GET',
params
})
}
export const remove = (ids) => {
return http.request({
url: '/api/blade-desk/notice/remove',
method: 'post',
params: {
ids,
}
})
}
export const add = (row) => {
return http.request({
url: '/api/blade-desk/notice/submit',
method: 'post',
data: row
})
}
export const update = (row) => {
return http.request({
url: '/api/blade-desk/notice/submit',
method: 'post',
data: row
})
}

View File

@ -1,151 +0,0 @@
import http from '@/http/api.js'
/**
* 获取部门列表
* @param {*} params
* @returns
*/
export const deptList = params => {
return http.request({
url: '/api/blade-system/dept/list-page',
method: 'GET',
params: {
...params
},
});
};
/**
* 获取事项列表
* @param {*} params
* @returns
*/
export const itemList = params => {
return http.request({
url: '/api/blade-biz/item/list',
method: 'GET',
params: {
...params
},
});
};
/**
* 预约须知
* @param {*} params
* @returns
*/
export const noticeData = params => {
return http.request({
url: '/api/blade-noticeinfo/noticeInfo/list',
method: 'GET',
params: {
...params
},
});
};
/**
* 获取可用日历
* @param {*} params
* @returns
*/
export const availableDate = params => {
return http.request({
url: '/api/blade-bookingdate/bookingDate/available-week-dates',
method: 'GET',
params: {
...params
},
});
};
/**
* 查询用户信息
* @param {*} params
* @returns
*/
export const getUserInfo = params => {
return http.request({
url: '/api/blade-system/user/info',
method: 'GET',
params: {
...params
},
});
};
/**
* 提交预约
* @param {*} params
* @returns
*/
export const submit = params => {
return http.request({
url: '/api/blade-biz/booking/submit-booking',
method: 'POST',
data: {
...params
},
});
};
/**
* 查询我的预约
* @param {*} params
* @returns
*/
export const myReserve = params => {
return http.request({
url: '/api/blade-biz/booking/list',
method: 'GET',
params: {
...params
},
});
};
/**
* 取消预约
* @param {*} params
* @returns
*/
export const cancel = params => {
return http.request({
url: '/api/blade-biz/booking/cancel',
method: 'POST',
params: {
...params
},
});
};
/**
* 获取详情
* @param {*} params
* @returns
*/
export const getDetail = params => {
return http.request({
url: '/api/blade-biz/booking/detail',
method: 'GET',
params: {
...params
},
});
};
/**
* 获取是否无感取号成功
* @param {*} params
* @returns
*/
export const getIsSuccessTicket = params => {
return http.request({
url: '/api/blade-onlineticket/onlineTicket/getByYyNo',
method: 'GET',
params: {
...params
},
});
};

59
api/ticket.js Normal file
View File

@ -0,0 +1,59 @@
import http from '@/http/api.js'
/**
* 主题取号列表
* @param {*} params
* @returns
*/
export const getThemeList = params => {
return http.request({
url: 'api/blade-subject/subject/list',
method: 'GET',
params: {
...params
},
});
};
/**
* 事项列表
* @param {*} params
* @returns
*/
export const getBusinessList = params => {
return http.request({
url: 'api/blade-item/list',
method: 'GET',
params: {
...params
},
});
};
/**
* 历史取号列表
* @param {*} params
* @returns
*/
export const getHistoryList = params => {
return http.request({
url: 'api/blade-queuerecord/queueRecord/history',
method: 'GET',
params: {
...params
},
});
};
/**
* 取号
* @param {*} data { applicantName, applicantIdCard, itemId, windowId }
* @returns
*/
export const takeNumber = data => {
return http.request({
url: 'api/blade-queuerecord/queueRecord/take-number',
method: 'POST',
data
});
};

View File

@ -20,7 +20,7 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操
config.header['Blade-Requested-With'] = 'BladeHttpRequest'; config.header['Blade-Requested-With'] = 'BladeHttpRequest';
// 客户端认证参数 // 客户端认证参数
config.header['Authorization'] = 'Basic ' + Base64.encode(clientId + ':' + clientSecret); config.header['Authorization'] = 'Basic ' + Base64.encode(clientId + ':' + clientSecret);
// #ifndef H5 // #ifndef H5
let url = config.url let url = config.url
if (process.env.NODE_ENV == 'development' && !url.startsWith("http")) { if (process.env.NODE_ENV == 'development' && !url.startsWith("http")) {
@ -44,8 +44,8 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操
/** /**
/* /*
if (!token) { // 如果token不存在return Promise.reject(config) 会取消本次请求 if (!token) { // 如果token不存在return Promise.reject(config) 会取消本次请求
return Promise.reject(config) return Promise.reject(config)
} }
**/ **/
return config return config
}, config => { // 可使用async await 做异步操作 }, config => { // 可使用async await 做异步操作

View File

@ -1,5 +1,5 @@
{ {
"name": "住房保障预约", "name": "环江取号机",
"appid": "__UNI__8FD82FF", "appid": "__UNI__8FD82FF",
"description": "", "description": "",
"versionName": "2.0.0", "versionName": "2.0.0",
@ -104,11 +104,6 @@
}, },
"h5": { "h5": {
"template": "template.h5.html", "template": "template.h5.html",
"publicPath": "/housingAssuranceBookingMobile/",
"router": {
"mode": "hash",
"base": "/housingAssuranceBookingMobile"
},
"optimization": { "optimization": {
"treeShaking": { "treeShaking": {
"enable": true "enable": true
@ -117,18 +112,12 @@
"devServer": { "devServer": {
"proxy": { "proxy": {
"/api": { "/api": {
"target": "http://192.168.3.111:8181", "target": "http://192.168.3.130:8079",
// "target" : "http://192.168.3.100:2891", // "target" : "http://192.168.3.100:2891",
//"target" : "https://rider.bladex.vip/api", //"target" : "https://rider.bladex.vip/api",
"pathRewrite": { "pathRewrite": {
"^/api": "/" "^/api": "/"
} }
},
"/epoint-web-cs": {
"target": "https://gxqzzfbzzx.cn",
"pathRewrite": {
"^/epoint-web-cs": "/"
}
} }
}, },
"port": "" "port": ""

View File

@ -4,16 +4,20 @@
<template #main> <template #main>
<view class="wrap"> <view class="wrap">
<view class="list-card"> <view class="list-card">
<view class="item" v-for="(item,idx) in businessList" :key="idx"> <view class="page-title" v-if="titleName">{{ titleName }}</view>
<view class="item" v-for="(item, idx) in businessList" :key="idx">
<view class="left"> <view class="left">
<text class="dot"></text> <text class="dot"></text>
<text class="title-text">{{ item.name }}</text> <text class="title-text">{{ item.itemName }}</text>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view class="btn-guide" @click="openGuide(item)">办事指南</view> <view class="btn-guide" @click="openGuide(item)">办事指南</view>
<view class="btn-take" @click="toTakeNum(item)">取号</view> <view class="btn-take" @click="toTakeNum(item)">取号</view>
</view> </view>
</view> </view>
<view class="empty" v-if="businessList.length === 0">
暂无事项
</view>
</view> </view>
</view> </view>
</template> </template>
@ -22,50 +26,118 @@
<script> <script>
import Container from '@/components/container/container.vue' import Container from '@/components/container/container.vue'
import {
getBusinessList,
getHistoryList,
takeNumber,
} from '@/api/ticket.js'
export default { export default {
components: { components: {
Container Container
}, },
data() { data() {
return { return {
businessList: [{ titleName: '',
name: '个人社保参保证明查询打印' source: '',
}, subjectId: '',
{ deptId: '',
name: '城镇职工基本养老保险关系转移接续申请' idcard: '',
}, businessList: []
{
name: '住房公积金个人住房贷款购房"一件事"'
},
{
name: '租赁非公共租赁住房提取'
},
{
name: '租赁公共租赁住房提取'
},
{
name: '住房档案变更(房屋坐落变更)'
},
]
} }
}, },
onLoad(options) {
this.source = options.source || ''
this.subjectId = options.subjectId || ''
this.deptId = options.deptId || ''
this.idcard = options.idcard || ''
this.titleName = options.titleName || options.subjectName || options.deptName || ''
this.fetchList()
},
methods: { methods: {
// //
goBack() { goBack() {
uni.navigateBack() uni.navigateBack()
}, },
// // source
toTakeNum(row) { async fetchList() {
uni.showToast({ let res = null
title: '取号成功', try {
icon: 'none' switch (this.source) {
}) case 'history':
//
if (!this.idcard) {
console.warn('历史取号缺少身份证号')
return
}
res = await getHistoryList({
applicantIdCard: this.idcard
})
break
case 'business':
//
res = await getBusinessList({
status: 1
})
break
case 'subject':
default:
// / source
const params = { status: 1 }
if (this.subjectId) {
params.subjectId = this.subjectId
} else if (this.deptId) {
params.deptId = this.deptId
} else {
//
}
res = await getBusinessList(params)
break
}
if (res && res.success && res.data) {
this.businessList = res.data.records || []
}
} catch (e) {
console.error('获取列表失败', e)
}
}, },
// /
// ID itemId id
getItemId(item) {
return item.itemId || item.id
},
//
async toTakeNum(row) {
if (!this.idcard) {
uni.showToast({
title: '请先刷身份证',
icon: 'none'
})
return
}
try {
const res = await takeNumber({
applicantIdCard: this.idcard,
itemId: this.getItemId(row)
})
if (res.success) {
uni.showToast({
title: '取号成功',
icon: 'none'
})
}
} catch (e) {
console.error('取号失败', e)
}
},
//
openGuide(item) { openGuide(item) {
const id = this.getItemId(item)
uni.navigateTo({ uni.navigateTo({
url: `/pages/home/guide?theme=${item}` url: `/pages/home/guide?id=${id}&itemName=${item.itemName}`
}) })
} }
} }
@ -94,6 +166,16 @@
overflow-y: auto; overflow-y: auto;
} }
.page-title {
font-size: 36px;
font-weight: bold;
color: rgba(51, 51, 51, 1);
text-align: center;
padding: 20px 0 30px;
border-bottom: 2px solid rgba(188, 200, 209, 1);
margin-bottom: 20px;
}
.item { .item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -149,4 +231,11 @@
padding: 1.2vh 3vw; padding: 1.2vh 3vw;
border-radius: 99px; border-radius: 99px;
} }
</style>
.empty {
text-align: center;
font-size: 30px;
color: #999;
padding: 100px 0;
}
</style>

View File

@ -1,13 +1,13 @@
<template> <template>
<Container backBtn logoutBtn @handleBack="handleBack" > <Container backBtn logoutBtn @handleBack="handleBack">
<template #main> <template #main>
<view class="theme-page"> <view class="theme-page">
<view class="card"> <view class="card">
<view class="title">部门取号</view> <view class="title">部门取号</view>
<view class="btn-group"> <view class="btn-group">
<view class="btn-item" v-for="(item, index) in themeList" :key="index" <view class="btn-item" v-for="(item, index) in deptList" :key="index"
@click="handleSelect(item)"> @click="handleSelect(item)">
{{ item }} {{ item.deptName }}
</view> </view>
</view> </view>
</view> </view>
@ -18,6 +18,9 @@
<script> <script>
import Container from '@/components/container/container.vue' import Container from '@/components/container/container.vue'
import {
getList,
} from '@/api/system/dept.js'
export default { export default {
components: { components: {
@ -25,27 +28,36 @@
}, },
data() { data() {
return { return {
themeList: [ deptList: [],
'住房城乡建设厅', idcard: ''
'直属单位住房保障中心',
'公积金',
'职业资格',
'教育服务',
'婚姻生育',
'户籍户政',
'医疗医保'
]
} }
}, },
onLoad(options) {
this.idcard = options.idcard || ''
},
mounted() {
this.fetchDeptList()
},
methods: { methods: {
handleBack() { handleBack() {
uni.navigateBack() uni.navigateBack()
}, },
handleSelect(item) { handleSelect(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/home/businessList?theme=${item}` url: `/pages/home/businessList?source=dept&deptId=${item.id}&deptName=${item.deptName}&idcard=${this.idcard}`
}) })
},
async fetchDeptList() {
try {
const res = await getList({ parentId: '1123598813738675202' })
if (res.success && res.data) {
this.deptList = res.data.records || res.data || []
}
} catch (e) {
console.error('获取部门列表失败', e)
}
} }
} }
} }
@ -104,4 +116,4 @@
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
cursor: pointer; cursor: pointer;
} }
</style> </style>

View File

@ -2,12 +2,13 @@
<view class="container"> <view class="container">
<Container> <Container>
<template #main> <template #main>
<view class="card" @click="goRoute"> <view class="card">
<!-- 身份证图标区域 --> <!-- 身份证图标区域 -->
<view class="id-card"> <view class="id-card">
</view> </view>
<!-- 提示文字 --> <!-- 提示文字 -->
<text class="tip">请刷身份证取号</text> <text class="tip">请刷身份证取号</text>
<input v-model="inputVal" placeholder="请输入内容" confirm-type="done" @confirm="goRoute" />
</view> </view>
</template> </template>
</Container> </Container>
@ -23,6 +24,7 @@
}, },
data() { data() {
return { return {
inputVal: '',
currentTime: '' currentTime: ''
} }
}, },
@ -47,9 +49,9 @@
const seconds = String(now.getSeconds()).padStart(2, '0') const seconds = String(now.getSeconds()).padStart(2, '0')
this.currentTime = `${year}${month}${day}${hours}:${minutes}:${seconds}` this.currentTime = `${year}${month}${day}${hours}:${minutes}:${seconds}`
}, },
goRoute(){ goRoute() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/home/ticket' url: `/pages/home/ticket?idcard=${this.inputVal}`
}) })
} }
} }
@ -91,4 +93,9 @@
font-weight: 500; font-weight: 500;
letter-spacing: 0.2vh; letter-spacing: 0.2vh;
} }
</style>
::v-deep .uni-input-wrapper {
width: 800rpx;
border: 2rpx solid #ccc;
}
</style>

View File

@ -7,7 +7,7 @@
<view class="btn-group"> <view class="btn-group">
<view class="btn-item" v-for="(item, index) in themeList" :key="index" <view class="btn-item" v-for="(item, index) in themeList" :key="index"
@click="handleSelect(item)"> @click="handleSelect(item)">
{{ item }} {{ item.subjectName }}
</view> </view>
</view> </view>
</view> </view>
@ -18,6 +18,9 @@
<script> <script>
import Container from '@/components/container/container.vue' import Container from '@/components/container/container.vue'
import {
getThemeList,
} from '@/api/ticket.js'
export default { export default {
components: { components: {
@ -25,18 +28,16 @@
}, },
data() { data() {
return { return {
themeList: [ themeList: [],
'就业创业', idcard: ''
'社会保障',
'公积金',
'职业资格',
'教育服务',
'婚姻生育',
'户籍户政',
'医疗医保'
]
} }
}, },
onLoad(options) {
this.idcard = options.idcard || ''
},
mounted() {
this.fetchThemeList()
},
methods: { methods: {
handleBack() { handleBack() {
uni.navigateBack() uni.navigateBack()
@ -44,8 +45,19 @@
handleSelect(item) { handleSelect(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/home/businessList?theme=${item}` url: `/pages/home/businessList?source=subject&subjectId=${item.id}&subjectName=${item.subjectName}&idcard=${this.idcard}`
}) })
},
async fetchThemeList() {
try {
const res = await getThemeList({ status: 1 })
if (res.success && res.data) {
this.themeList = res.data.records || []
}
} catch (e) {
console.error('获取主题列表失败', e)
}
} }
} }
} }
@ -104,4 +116,4 @@
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
cursor: pointer; cursor: pointer;
} }
</style> </style>

View File

@ -1,177 +1,201 @@
<template> <template>
<Container logoutBtn> <Container logoutBtn>
<template #main> <template #main>
<view class="home-page"> <view class="home-page">
<!-- 左侧四大功能按钮 --> <!-- 左侧四大功能按钮 -->
<view class="btn-group"> <view class="btn-group">
<view class="btn-item blue" @click="goTheme"> </view> <view class="btn-item blue" @click="goTheme"> </view>
<view class="btn-item green" @click="goDept"> </view> <view class="btn-item green" @click="goDept"> </view>
<view class="btn-item orange" @click="goHistory"> </view> <view class="btn-item orange" @click="goHistory"> </view>
<view class="btn-item red" @click="goBusiness"> </view> <view class="btn-item red" @click="goBusiness"> </view>
</view> </view>
<!-- 右侧热门推荐 --> <!-- 右侧热门推荐 -->
<view class="hot-recommend"> <view class="hot-recommend">
<view class="recommend-title">热门推荐</view> <view class="recommend-title">热门推荐</view>
<view class="recommend-list"> <view class="recommend-list">
<view class="recommend-item" v-for="(item, index) in recommendList" :key="index"> <view class="recommend-item" v-for="(item, index) in recommendList" :key="index" @click="handleSelect(item)">
<text class="dot"></text> <text class="dot"></text>
<text class="text">{{ item }}</text> <text class="text">{{ item.itemName }}</text>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
</Container> </Container>
</template> </template>
<script> <script>
import Container from '@/components/container/container.vue' import Container from '@/components/container/container.vue'
import { getBusinessList } from '@/api/ticket.js'
export default { export default {
components: { components: {
Container Container
}, },
data() { data() {
return { return {
recommendList: [ recommendList: [],
'公有住房、全额集资建房退房', idcard: ''
'职务(职称)晋升后住房面积未达标户住房补贴业务', }
'公有住房、全额集资建房退房', },
'公有住房、全额集资建房退房', onLoad(options) {
'公有住房、全额集资建房退房', this.idcard = options.idcard || ''
'职务(职称)晋升后住房面积未达标户住房补贴业务' },
] mounted() {
} this.fetchHotList()
}, },
methods: { methods: {
// //
goTheme() { async fetchHotList() {
uni.navigateTo({ try {
url: '/pages/home/theme' const res = await getBusinessList({
}) hot: 1,
}, status: 1,
// current: 1,
goDept() { size: 6,
uni.navigateTo({ descs: 'create_time,id'
url: '/pages/home/dept' })
}) if (res.success && res.data) {
}, this.recommendList = res.data.records || []
// }
goHistory() { } catch (e) {
uni.navigateTo({ console.error('获取热门事项失败', e)
url: `/pages/home/businessList` }
}) },
},
// //
goBusiness() { handleSelect(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/home/businessList` url: `/pages/home/guide?id=${item.id}&itemName=${item.itemName}`
}) })
} },
}
} //
goTheme() {
uni.navigateTo({
url: `/pages/home/theme?idcard=${this.idcard}`
})
},
//
goDept() {
uni.navigateTo({
url: `/pages/home/dept?idcard=${this.idcard}`
})
},
//
goHistory() {
uni.navigateTo({
url: `/pages/home/businessList?source=history&idcard=${this.idcard}&titleName=历史取号`
})
},
//
goBusiness() {
uni.navigateTo({
url: `/pages/home/businessList?source=business&titleName=业务取号`
})
}
}
}
</script> </script>
<style scoped> <style scoped>
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
.home-page { .home-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
padding: 0 5%; padding: 0 5%;
box-sizing: border-box; box-sizing: border-box;
} }
/* 左侧按钮组 */ /* 左侧按钮组 */
.btn-group { .btn-group {
/* width: 60%; */ /* width: 60%; */
/* height: 85%; */ /* height: 85%; */
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
/* justify-content: space-between; */ /* justify-content: space-between; */
align-content: space-around; align-content: space-around;
} }
.btn-item { .btn-item {
width: 500px; width: 500px;
height: 340px; height: 340px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.btn-item.blue { .btn-item.blue {
margin-right: 60px; margin-right: 60px;
margin-bottom: 60px; margin-bottom: 60px;
background: url('../../static/images/ticket/theme_bg.png'); background: url('../../static/images/ticket/theme_bg.png');
background-size: 100% 100%; background-size: 100% 100%;
} }
.btn-item.green { .btn-item.green {
background: url('../../static/images/ticket/dept_bg.png'); background: url('../../static/images/ticket/dept_bg.png');
background-size: 100% 100%; background-size: 100% 100%;
} }
.btn-item.orange { .btn-item.orange {
margin-right: 60px; margin-right: 60px;
background: url('../../static/images/ticket/history_bg.png'); background: url('../../static/images/ticket/history_bg.png');
background-size: 100% 100%; background-size: 100% 100%;
} }
.btn-item.red { .btn-item.red {
background: url('../../static/images/ticket/business_bg.png'); background: url('../../static/images/ticket/business_bg.png');
background-size: 100% 100%; background-size: 100% 100%;
} }
/* 右侧热门推荐 */
.hot-recommend {
width: 55%;
height: 740px;
background: #fff;
border-radius: 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
padding: 40px 40px 16px;
box-sizing: border-box;
}
.recommend-title {
font-size: 40px;
font-weight: bold;
color: rgba(51, 51, 51, 1);
text-align: center;
margin-bottom: 30px;
}
/* 右侧热门推荐 */ .recommend-list {
.hot-recommend { display: flex;
width: 55%; flex-direction: column;
height: 740px; justify-content: space-around;
background: #fff; height: 85%;
border-radius: 20px; }
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
padding: 40px 40px 16px;
box-sizing: border-box;
}
.recommend-title { .recommend-item {
font-size: 40px; display: flex;
font-weight: bold; align-items: flex-start;
color: rgba(51, 51, 51, 1); line-height: 1.5;
text-align: center; }
margin-bottom: 30px;
}
.recommend-list { .dot {
display: flex; color: #4080ff;
flex-direction: column; font-size: 30px;
justify-content: space-around; margin-right: 10px;
height: 85%; }
}
.recommend-item { .text {
display: flex; font-size: 30px;
align-items: flex-start; color: rgba(51, 51, 51, 1);
line-height: 1.5; }
} </style>
.dot {
color: #4080ff;
font-size: 30px;
margin-right: 10px;
}
.text {
font-size: 30px;
color: rgba(51, 51, 51, 1);
}
</style>