12407fb9 by zhangmeng

提交

1 parent e35d8ebc
......@@ -40,17 +40,19 @@
style="width: 320px"
/>
</el-form-item>
<el-form-item :label="language == 0 ? '观看人' : 'Viewer'" prop="customerList">
<el-form-item :label="language == 0 ? '观看人' : 'Viewer'" prop="message">
<div class="p_box">
<div class="people">
<el-checkbox-group v-model="orderForm.customerList" @change="changeGroup">
<el-checkbox-group v-model="orderForm.message" @change="changeGroup">
<div
v-for="(it, index) in personnelList" :key="index" class="prople_item">
<div>
<div class="name">{{ it.name }}</div>
<div class="name">{{ it.name }}
<span v-if="it.discount" class="tag_t p-right">优惠</span>
</div>
<div class="idcard">{{ it.idCard }}</div>
</div>
<el-checkbox :value="it.id"/>
<el-checkbox :value="it"/>
</div>
</el-checkbox-group>
</div>
......@@ -80,8 +82,17 @@
{{ languageFormat(language, "套票", "Package ticket") }}
</span>
</div>
<p>通票</p>
<div class="ticket detail_top">
{{ language == 0 ? tickType.price : tickType.priceEn }}
<span> {{ language == 0 ? '元' : 'Euro' }}</span>
{{ languageFormat(language, "票档", "Ticket file") }}
x 1
{{ languageFormat(language, "张", "tickets") }}
</div>
<p>优惠票</p>
<div class="ticket">
{{ tickType.price }}
{{ language == 0 ? tickType.rebatePrice : tickType.rebatePriceEn }}
<span> {{ language == 0 ? '元' : 'Euro' }}</span>
{{ languageFormat(language, "票档", "Ticket file") }}
x 1
......@@ -95,7 +106,7 @@
<div class="price_num">
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{
language == 0 ? price.total_cn : price.total_en
language == 0 ? (price.total_cn * 1).toFixed(2) : (price.total_en * 1).toFixed(2)
}}
</div>
</div>
......@@ -110,7 +121,7 @@
</span>
<span class="value">
<span>{{ language == 0 ? "¥" : "€" }}</span>
{{ language == 0 ? price.total_cn : price.total_en }}
{{ language == 0 ? (price.total_cn * 1).toFixed(2) : (price.total_en * 1).toFixed(2) }}
</span>
</div>
<div class="pay" @click="paymentHandle">
......@@ -118,16 +129,6 @@
</div>
</div>
<el-dialog
v-model="payment.showCodeDialog"
title="支付"
width="300"
@closed="payment.handleCloce()"
>
<div>
<img :src="payment.qrCodeData" alt class="qrcode"/>
</div>
</el-dialog>
</div>
</el-card>
......@@ -164,6 +165,8 @@ const props = defineProps({
});
const form = ref({})
const personnelList = ref([])
const customerArr_q = ref([])//全票人
const customerArr_b = ref([])//优惠票人
const orderForm = ref({
activeId: route.params.activeId,
atId: route.params.latId,
......@@ -171,7 +174,8 @@ const orderForm = ref({
ticketDate: null,
ticketType: null,
phone: null,
customerList: [],
customerList: [],//人员ids列表
message: [],//完整的人员列表
num: 0,
total: null
})
......@@ -196,7 +200,7 @@ const rules = ref({
trigger: "blur"
},
],
customerList: [
message: [
{
required: true,
message: languageFormat(language, "请选择观众", "Please select the audience"),
......@@ -210,9 +214,37 @@ let timer = null;
customerList()
function changeGroup() {
orderForm.value.num = orderForm.value.customerList.length
getTicketTotal()
function changeGroup(e) {
// console.log(e)
if (orderForm.value.message.length == 5) {
ElMessageBox.confirm(language.value == 0 ? '最多只能选择5个观众' : 'You can only select up to 5 audience members', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
} else {
orderForm.value.num = orderForm.value.message.length
orderForm.value.customerList = orderForm.value.message.map(v => v.id)
customerArr_q.value = orderForm.value.message.filter(v => !v.discount)
customerArr_b.value = orderForm.value.message.filter(v => v.discount)
// 计算价格
price.value = {
total_en: 0,
total_cn: 0
}
orderForm.value.message.forEach(v => {
if (v.discount) {
price.value.total_cn += (tickType.value.rebatePrice * 1)
price.value.total_en += (tickType.value.rebatePriceEn * 1)
} else {
price.value.total_cn += (tickType.value.price * 1)
price.value.total_en += (tickType.value.priceEn * 1)
}
})
}
console.log(orderForm.value.message)
}
// 获取人员列表
......@@ -221,18 +253,13 @@ async function customerList() {
personnelList.value = res.rows
}
// 获取价格
async function getTicketTotal() {
const res = await getTicketTotalApi(orderForm.value)
price.value = res.data
orderForm.value.total = language == 0 ? price.value.total_cn : price.value.total_en
}
// 获取票档信息
async function getTicketListType() {
const res = await listApi({latId: orderForm.value.latId})
tickType.value = res.rows.find(item => item.id == orderForm.value.attId)
orderForm.value.ticketDate = JSON.stringify(tickType.value)
console.log(tickType.value)
}
getTicketListType()
......@@ -242,7 +269,6 @@ async function getTicketList() {
const res = await getTicketListApi({activityId: route.params.activeId})
matchType.value = res.rows.find(item => item.id == orderForm.value.atId)
orderForm.value.ticketType = JSON.stringify(matchType.value)
}
getTicketList()
......@@ -261,7 +287,11 @@ async function paymentHandle() {
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(async () => {
const res = await submitOrderTicket(orderForm.value)
const res = await submitOrderTicket({
...orderForm.value,
message: JSON.stringify(orderForm.value.message),
total: language.value == 0 ? price.value.total_cn : price.value.total_en
})
if (res.code == 200 && res.data.orderId > 0) {
// 去付钱
router.push({
......@@ -393,6 +423,8 @@ div {
align-items: center;
padding: 14px 0;
border-bottom: 1px solid #dcdfe6;
width: 100%;
position: relative;
&:last-child {
border: none;
......@@ -402,6 +434,12 @@ div {
font-size: 16px;
color: #929aa0;
margin-bottom: 20px;
.tag_t {
position: absolute;
right: 30px;
padding: 8px;
}
}
.idcard {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!