8a5a4ea6 by zhangmeng

票务

1 parent 3544a940
...@@ -647,8 +647,6 @@ async function getTicketOrderInfoFN() { ...@@ -647,8 +647,6 @@ async function getTicketOrderInfoFN() {
647 } finally { 647 } finally {
648 648
649 } 649 }
650
651
652 console.log(form.value) 650 console.log(form.value)
653 } 651 }
654 652
...@@ -705,6 +703,17 @@ function startforGetData() { ...@@ -705,6 +703,17 @@ function startforGetData() {
705 startforGetData() 703 startforGetData()
706 } 704 }
707 }) 705 })
706 } else if (type.value == 'ticket') {
707 getTicketOrderInfoFN().then(res => {
708 if (form.value.payDate) {
709 if (handle) {
710 clearTimeout(handle)
711 handle = null
712 }
713 } else {
714 startforGetData()
715 }
716 })
708 } else { 717 } else {
709 getData().then(res => { 718 getData().then(res => {
710 if (form.value.payDate) { 719 if (form.value.payDate) {
......
1 <template> 1 <template>
2 <div> 2 <div>
3 <div class="box"> 3 <div class="box">
4 <el-card class="mb60 mt30" v-loading="loading"> 4 <el-card v-loading="loading" class="mb60 mt30">
5 <div class="text-center mt30"> 5 <div class="text-center mt30">
6 <el-icon color="#32B16C" size="80"> 6 <el-icon color="#32B16C" size="80">
7 <SuccessFilled/> 7 <SuccessFilled/>
8 </el-icon> 8 </el-icon>
9 <p class="text-success mb20">{{ language == 0 ? '支付成功' : 'successfully!' }}</p> 9 <p class="text-success mb20">{{ language == 0 ? '支付成功' : 'successfully!' }}</p>
10 10
11 <el-button type="primary" class="btn-lineG mb60" @click="goBillDetail" round> 11 <el-button class="btn-lineG mb60" round type="primary" @click="goBillDetail">
12 {{ language == 0 ? '返回订单详情' : 'Return order details' }} 12 {{ language == 0 ? '返回订单详情' : 'Return order details' }}
13 </el-button> 13 </el-button>
14 </div> 14 </div>
...@@ -26,18 +26,18 @@ import {useStorage} from "@vueuse/core/index"; ...@@ -26,18 +26,18 @@ import {useStorage} from "@vueuse/core/index";
26 26
27 const route = useRoute() 27 const route = useRoute()
28 const router = useRouter() 28 const router = useRouter()
29 const language= useStorage('language',0) 29 const language = useStorage('language', 0)
30 const orderId = ref(route.query.orderId) 30 const orderId = ref(route.query.orderId)
31 const type = ref('') 31 const type = ref('')
32 const loading = ref(false) 32 const loading = ref(false)
33 33
34 onMounted(() => { 34 onMounted(() => {
35 var code = decodeURIComponent(orderId.value) 35 let code = decodeURIComponent(orderId.value)
36 console.log(code) 36 console.log(code)
37 loading.value = true 37 loading.value = true
38 callbackPalPay(code).then(res => { 38 callbackPalPay(code).then(res => {
39 loading.value = false 39 loading.value = false
40 type.value = res.data.orderType 40 type.value = res.data.orderType
41 }) 41 })
42 }) 42 })
43 43
...@@ -52,6 +52,6 @@ function goBillDetail() { ...@@ -52,6 +52,6 @@ function goBillDetail() {
52 } 52 }
53 </script> 53 </script>
54 54
55 <style scoped lang="scss"> 55 <style lang="scss" scoped>
56 56
57 </style> 57 </style>
......
...@@ -142,7 +142,7 @@ import { ...@@ -142,7 +142,7 @@ import {
142 listApi, 142 listApi,
143 getTicketListApi, getTicketInfoByActivityId, 143 getTicketListApi, getTicketInfoByActivityId,
144 } from '@/apiPc/booking' 144 } from '@/apiPc/booking'
145 import {ElMessage} from "element-plus"; 145 import {ElMessage, ElMessageBox} from "element-plus";
146 import {languageFormat} from "@/viewsPc/seat/utils/language.js"; 146 import {languageFormat} from "@/viewsPc/seat/utils/language.js";
147 import useUserStore from "/@/store/modules/user"; 147 import useUserStore from "/@/store/modules/user";
148 import {useStorage} from "@vueuse/core/index"; 148 import {useStorage} from "@vueuse/core/index";
...@@ -208,110 +208,6 @@ const formRef = ref(null) ...@@ -208,110 +208,6 @@ const formRef = ref(null)
208 const TickForm = ref({}) 208 const TickForm = ref({})
209 let timer = null; 209 let timer = null;
210 210
211
212 // const payment = reactive({
213 // showCodeDialog: false,
214 // btn_loading: false,
215 // form: {
216 // viewers: [],
217 // phone: "",
218 // },
219 // qrInfo: {},
220 // qrCodeData: "",
221 // paymentHandle() {
222 // if (payment.form.viewers.length != order.data?.seatInfo?.length)
223 // return ElMessage({
224 // type: "warning",
225 // message: languageFormat(
226 // language.value,
227 // "观看人与购买票数不符",
228 // "The number of viewers does not match the number of tickets purchased."
229 // ),
230 // });
231 // if (!payment.form.phone)
232 // return ElMessage({
233 // type: "warning",
234 // message: languageFormat(
235 // language.value,
236 // "请输入联系电话",
237 // "Please enter the contact phone number."
238 // ),
239 // });
240 // // if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(payment.form.phone)) {
241 // // return ElMessage({
242 // // type: "warning",
243 // // message: languageFormat(
244 // // language.value,
245 // // "联系电话格式不正确",
246 // // "The format of the contact phone is incorrect."
247 // // ),
248 // // });
249 // // }
250 // loading.value = true
251 // payOrder({
252 // contactPhone: payment.form.phone,
253 // customerIds: payment.form.viewers,
254 // orderToken: order.data?.orderToken,
255 // payType: language.value == 0 ? 1 : 2,
256 // paymentAmount: order.data?.paymentAmount,
257 // }).then((res) => {
258 // if (res.data.language == "zh-cn") {
259 // payment.qrInfo = res.data;
260 // qrcode.toDataURL(res.data.scanCodeUrl, (err, url) => {
261 // if (url) {
262 // payment.qrCodeData = url;
263 // }
264 // });
265 // payment.showCodeDialog = true;
266 // startCheckSuccessListener(res.data.orderSn, props.activityId);
267 // } else {
268 // // TODO:这里是英文环境支付
269 // location.href = res.data.scanCodeUrl
270 // }
271 // }).finally(() => {
272 // loading.value = false
273 // });
274 // },
275 // handleCloce() {
276 // payment.showCodeDialog = false;
277 // payment.qrCodeData = "";
278 // clearInterval(timer);
279 // timer = null;
280 // router.replace({
281 // path: "/seat/order",
282 // });
283 // },
284 // });
285
286 // const order = reactive({
287 // data: null,
288 // fetchData() {
289 // confirmOrder({
290 // actId: props.activityId,
291 // openType: route.query.openType,
292 // sessionId: route.query.sessionId,
293 // sitePlace: route.query.sitePlace,
294 // ticketType: route.query.ticketType,
295 // seatIds: route.query.seatIds.split(","),
296 // }).then((res) => {
297 // this.data = res.data;
298 // });
299 // },
300 // });
301
302 // const audience = reactive({
303 // data: [],
304 // fetchData() {
305 // viewPeopleList().then((res) => {
306 // audience.data = res.data;
307 // });
308 // },
309 // });
310
311 // audience.fetchData();
312 // order.fetchData();
313
314
315 customerList() 211 customerList()
316 212
317 function changeGroup() { 213 function changeGroup() {
...@@ -359,10 +255,27 @@ async function paymentHandle() { ...@@ -359,10 +255,27 @@ async function paymentHandle() {
359 } 255 }
360 256
361 await formRef.value.validate() 257 await formRef.value.validate()
362 const res = await submitOrderTicket(orderForm.value) 258
363 if (res.code == 200) { 259 await ElMessageBox.confirm(language.value == 0 ? '确认提交订单吗?' : 'Confirm to submit the order?', {
364 ElMessage.success('提交成功') 260 confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
365 } 261 cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
262 type: 'warning'
263 }).then(async () => {
264 const res = await submitOrderTicket(orderForm.value)
265 if (res.code == 200 && res.data.orderId > 0) {
266 // 去付钱
267 router.push({
268 name: 'bookingPay',
269 query: {
270 orderId: res.data.orderId,
271 money: res.data.total,
272 type: 'ticket'
273 }
274 })
275 } else {
276 ElMessage.warning(language.value == 0 ? '下单失败,' : 'Order failure')
277 }
278 })
366 } 279 }
367 280
368 async function getDetail() { 281 async function getDetail() {
......
...@@ -37,43 +37,46 @@ ...@@ -37,43 +37,46 @@
37 <div class="address"> 37 <div class="address">
38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }} 38 {{ triggerLanguage(language, "地址", "Location") }}{{ matchForm.address }}
39 </div> 39 </div>
40
40 <!-- 时间 --> 41 <!-- 时间 -->
41 <div class="select_item_box"> 42 <div class="select_item_box">
42 <div class="label"> 43 <div class="label">
43 {{ triggerLanguage(language, "票档", "Tickets") }} 44 {{ triggerLanguage(language, "时间", "Event Date & Time") }}
44 </div> 45 </div>
45 <div class="select_item"> 46 <div class="select_item">
46 <div 47 <div
47 v-for="(it, index) in tickClass" 48 v-for="(it, index) in tickList"
48 :key="index" 49 :key="index"
49 :class="[ 50 :class="[
50 it.id == selectForm.latId ? 'tagActive' : 'tag', 51 it.id == selectForm.id ? 'tagActive' : 'tag',
52 it.isView==0?'forbid':''
51 ]" 53 ]"
52 @click="select(it)" 54 @click="selectTick(it)"
53 > 55 >
54 {{ it.name }} 56 {{ it.name }} <span v-if="it.ticketType==1" class="tao">{{
57 language == 0 ? '套票' : 'Package ticket'
58 }}</span>
55 </div> 59 </div>
56 </div> 60 </div>
57 </div> 61 </div>
58 <!-- 时间 --> 62 <!-- 票档 -->
59 <div class="select_item_box"> 63 <div class="select_item_box">
60 <div class="label"> 64 <div class="label">
61 {{ triggerLanguage(language, "时间", "Event Date & Time") }} 65 {{ triggerLanguage(language, "票档", "Tickets") }}
62 </div> 66 </div>
63 <div class="select_item"> 67 <div class="select_item">
64 <div 68 <div
65 v-for="(it, index) in tickList" 69 v-for="(it, index) in tickClass"
66 :key="index" 70 :key="index"
67 :class="[ 71 :class="[
68 it.id == selectForm.id ? 'tagActive' : 'tag', 72 it.id == selectForm.latId ? 'tagActive' : 'tag',
69 ]" 73 ]"
70 @click="selectTick(it)" 74 @click="select(it)"
71 > 75 >
72 {{ it.name }} 76 {{ it.name }}
73 </div> 77 </div>
74 </div> 78 </div>
75 </div> 79 </div>
76
77 <!-- button --> 80 <!-- button -->
78 <div class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()"> 81 <div class="btn forPc" style="margin-left: 40px" @click="toSelectSeat()">
79 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }} 82 {{ triggerLanguage(language, "添加观影人", "Add Moviegoers") }}
...@@ -106,6 +109,7 @@ const user = computed(() => useUserStore().user) ...@@ -106,6 +109,7 @@ const user = computed(() => useUserStore().user)
106 const route = useRoute(); 109 const route = useRoute();
107 const router = useRouter(); 110 const router = useRouter();
108 const activeId = ref(route.params.activeId) 111 const activeId = ref(route.params.activeId)
112 const flag = ref(false)
109 const props = defineProps({ 113 const props = defineProps({
110 activityId: [String, Number], 114 activityId: [String, Number],
111 }); 115 });
...@@ -140,6 +144,13 @@ async function getTicketList() { ...@@ -140,6 +144,13 @@ async function getTicketList() {
140 async function getTicketListType() { 144 async function getTicketListType() {
141 const res = await listApi({latId: selectForm.value.latId}) 145 const res = await listApi({latId: selectForm.value.latId})
142 tickList.value = res.rows 146 tickList.value = res.rows
147 flag.value = tickList.value.some((item) => {
148 return item.isView == 0
149 })
150 tickList.value.forEach(v => {
151 if (flag.value && v.ticketType == 1) v.isView = 0
152 })
153
143 } 154 }
144 155
145 function select(v) { 156 function select(v) {
...@@ -148,14 +159,14 @@ function select(v) { ...@@ -148,14 +159,14 @@ function select(v) {
148 } 159 }
149 160
150 function selectTick(v) { 161 function selectTick(v) {
151 selectForm.value.id = v.id 162 if (v.isView != 0) selectForm.value.id = v.id
152 } 163 }
153 164
154 function toSelectSeat() { 165 function toSelectSeat() {
155 if (!selectForm.value.latId) return ElMessage.error(language == 0 ? "请选择票档" : 'Please select a ticket file') 166 if (!selectForm.value.latId) return ElMessage.error(language == 0 ? "请选择票档" : 'Please select a ticket file')
156 if (!selectForm.value.id) return ElMessage.error(language == 0 ? "请选择时间" : 'Please select time') 167 if (!selectForm.value.id) return ElMessage.error(language == 0 ? "请选择时间" : 'Please select time')
157 if (!user.value) { 168 if (!user.value) {
158 useStore().setVisitor() 169 useStore.setVisitor()
159 return 170 return
160 } 171 }
161 router.push({ 172 router.push({
...@@ -242,6 +253,11 @@ function toSelectSeat() { ...@@ -242,6 +253,11 @@ function toSelectSeat() {
242 flex-shrink: 0; 253 flex-shrink: 0;
243 } 254 }
244 255
256 .forbid {
257 opacity: 0.5;
258 cursor: not-allowed !important;
259 }
260
245 .select_item { 261 .select_item {
246 display: flex; 262 display: flex;
247 flex-wrap: wrap; 263 flex-wrap: wrap;
...@@ -280,6 +296,13 @@ function toSelectSeat() { ...@@ -280,6 +296,13 @@ function toSelectSeat() {
280 cursor: pointer; 296 cursor: pointer;
281 } 297 }
282 298
299 .tao {
300 border: 1px solid #493ceb;
301 font-size: 14px;
302 color: #493ceb;
303 margin-left: 10px;
304 }
305
283 .tagDisabled { 306 .tagDisabled {
284 padding: 12px 18px; 307 padding: 12px 18px;
285 background: #878787; 308 background: #878787;
......
1 import { defineConfig, loadEnv } from 'vite' 1 import {defineConfig, loadEnv} from 'vite'
2 import path, { resolve } from 'path' 2 import path, {resolve} from 'path'
3 import createVitePlugins from './vite/plugins' 3 import createVitePlugins from './vite/plugins'
4 import inject from '@rollup/plugin-inject' 4 import inject from '@rollup/plugin-inject'
5 import commonjs from '@rollup/plugin-commonjs' 5 import commonjs from '@rollup/plugin-commonjs'
6 // import legacy from '@vitejs/plugin-legacy' 6 // import legacy from '@vitejs/plugin-legacy'
7 7
8 // https://vitejs.dev/config/ 8 // https://vitejs.dev/config/
9 export default defineConfig(({ mode, command }) => { 9 export default defineConfig(({mode, command}) => {
10 const env = loadEnv(mode, process.cwd()) 10 const env = loadEnv(mode, process.cwd())
11 return { 11 return {
12 // 部署生产环境和开发环境下的URL。 12 // 部署生产环境和开发环境下的URL。
...@@ -70,30 +70,30 @@ export default defineConfig(({ mode, command }) => { ...@@ -70,30 +70,30 @@ export default defineConfig(({ mode, command }) => {
70 rewrite: (p) => p.replace(/^\/dev-api\/ztx-train/, '') 70 rewrite: (p) => p.replace(/^\/dev-api\/ztx-train/, '')
71 }, 71 },
72 '/dev-api/ztx-match': { 72 '/dev-api/ztx-match': {
73 // target: 'http://192.168.1.118:8083', 73 target: 'http://192.168.1.118:8083',
74 target: 'https://jijin.wtwuxicenter.com/stage-api', 74 // target: 'https://jijin.wtwuxicenter.com/stage-api',
75 changeOrigin: true, 75 changeOrigin: true,
76 rewrite: (p) => p.replace(/^\/dev-api\/ztx-match/, '') 76 rewrite: (p) => p.replace(/^\/dev-api\/ztx-match/, '')
77 }, 77 },
78 '/dev-api/ztx-webSite': { 78 '/dev-api/ztx-webSite': {
79 target: 'https://wdsfwuxicenter.com/stage-api/', 79 // target: 'https://dance.itechtop.cn/stage-api',
80 target: 'http://192.168.1.118:8081/',
80 changeOrigin: true, 81 changeOrigin: true,
81 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '') 82 rewrite: (p) => p.replace(/^\/dev-api\/ztx-webSite/, '')
82 }, 83 },
83 '/dev-api': { 84 '/dev-api': {
84 // target: 'http://192.168.1.118:8081/', 85 target: 'http://192.168.1.118:8081/',
85 // target: 'http://192.168.1.131:8081/', 86 // target: 'http://192.168.1.131:8081/',
86 target: 'https://jijin.wtwuxicenter.com/stage-api', 87 // target: 'https://jijin.wtwuxicenter.com/stage-api',
87 // target: 'http://124.70.181.90:1880/stage-api',
88 // target: 'https://wdsfwuxicenter.com/stage-api/', 88 // target: 'https://wdsfwuxicenter.com/stage-api/',
89 changeOrigin: true, 89 changeOrigin: true,
90 rewrite: (p) => p.replace(/^\/dev-api/, '') 90 rewrite: (p) => p.replace(/^\/dev-api/, '')
91 }, 91 },
92 '/ticket': { 92 '/ticket': {
93 // target: 'http://192.168.1.131:8098/', 93 target: 'http://192.168.1.118:8098/',
94 // target: 'http://192.168.1.131:8081/', 94 // target: 'http://192.168.1.131:8081/',
95 // target: 'http://124.70.181.90:1880/h5/', 95 // target: 'https://jijin.wtwuxicenter.com/ticket',
96 target: 'https://ticketh5.wdsfwuxicenter.com/h5/', 96 // target: 'https://ticketh5.wdsfwuxicenter.com/ticket',
97 changeOrigin: true, 97 changeOrigin: true,
98 rewrite: (p) => p.replace(/^\/ticket/, '') 98 rewrite: (p) => p.replace(/^\/ticket/, '')
99 } 99 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!