From 6f456ba7bc12313f765a595dec7a90a973af65c7 Mon Sep 17 00:00:00 2001 From: woody Date: Wed, 28 May 2025 09:16:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(ticket):=20=E6=B7=BB=E5=8A=A0=E9=97=A8?= =?UTF-8?q?=E7=A5=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/request.js | 9 +- config/ticket.js | 23 + pages.json | 37 +- pages/test-ticket.vue | 95 ++++ pages/ticket/buy.vue | 851 ++++++++++++++++++++++++++++++++ pages/ticket/detail.vue | 378 +++++++++++++++ pages/ticket/index.vue | 1013 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 2397 insertions(+), 9 deletions(-) create mode 100644 config/ticket.js create mode 100644 pages/test-ticket.vue create mode 100644 pages/ticket/buy.vue create mode 100644 pages/ticket/detail.vue create mode 100644 pages/ticket/index.vue diff --git a/config/request.js b/config/request.js index 87a834b..7a85d8a 100644 --- a/config/request.js +++ b/config/request.js @@ -5,14 +5,7 @@ * @Date: 2022-05-24 14:43:45 */ import { getToken, removeToken } from '@/config/auth.js' - module.exports = vm => { - // 检查uni.$u.http是否可用 - if (!uni || !uni.$u || !uni.$u.http) { - console.warn('uni.$u.http is not available, request configuration skipped') - return - } - // 初始化请求配置 uni.$u.http.setConfig(config => { // config.baseURL = 'https://p1.hzs413.com/inter-api'; @@ -20,7 +13,7 @@ module.exports = vm => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = '/prod-api' + config.baseURL = 'http://localhost:8080' //#endif //#ifdef QA_SERVER diff --git a/config/ticket.js b/config/ticket.js new file mode 100644 index 0000000..5324a92 --- /dev/null +++ b/config/ticket.js @@ -0,0 +1,23 @@ +/* + * @Descripttion: 门票活动相关API + * @version: 1.0.0 + * @Author: Assistant + * @Date: 2025-01-22 + */ + +const http = uni.$u.http + +// 查询门票活动列表 +export const getTicketActivityList = params => + http.get('/sale/api/ticket/query-ac', { params }) + +// 查询我的门票 +export const getMyTicketList = params => + http.get('/sale/api/ticket/query', { params }) + +// 购买门票(暂时定义,等待后端提供具体接口) +export const buyTicket = data => http.post('/sale/api/ticket/pay-ticket', data) + +// 获取门票详情 +export const getTicketDetail = params => + http.get('/sale/api/ticket/detail', { params }) diff --git a/pages.json b/pages.json index aef63ae..45e9f2b 100644 --- a/pages.json +++ b/pages.json @@ -827,6 +827,41 @@ "navigationBarTitleText": "新增业绩", "enablePullDownRefresh": false } + }, + { + "path": "pages/ticket/index", + "style": { + "navigationBarTitleText": "门票活动", + "navigationBarBackgroundColor": "#fff", + "navigationBarHidden": true, + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/ticket/buy", + "style": { + "navigationBarTitleText": "自助购票", + "navigationBarBackgroundColor": "#fff", + "navigationBarHidden": true, + "navigationStyle": "custom" + } + }, + { + "path": "pages/ticket/detail", + "style": { + "navigationBarTitleText": "我的门票", + "navigationBarBackgroundColor": "#fff", + "navigationBarHidden": true, + "navigationStyle": "custom" + } + }, + { + "path": "pages/test-ticket", + "style": { + "navigationBarTitleText": "门票模块测试", + "navigationBarBackgroundColor": "#fff" + } } ], "tabBar": { @@ -854,4 +889,4 @@ "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } -} \ No newline at end of file +} diff --git a/pages/test-ticket.vue b/pages/test-ticket.vue new file mode 100644 index 0000000..a3373b7 --- /dev/null +++ b/pages/test-ticket.vue @@ -0,0 +1,95 @@ + + + + + + diff --git a/pages/ticket/buy.vue b/pages/ticket/buy.vue new file mode 100644 index 0000000..31b964e --- /dev/null +++ b/pages/ticket/buy.vue @@ -0,0 +1,851 @@ + + + + + + diff --git a/pages/ticket/detail.vue b/pages/ticket/detail.vue new file mode 100644 index 0000000..18babcc --- /dev/null +++ b/pages/ticket/detail.vue @@ -0,0 +1,378 @@ + + + + + + diff --git a/pages/ticket/index.vue b/pages/ticket/index.vue new file mode 100644 index 0000000..57be89e --- /dev/null +++ b/pages/ticket/index.vue @@ -0,0 +1,1013 @@ + + + + + +