Browse Source

add ticket check modal

privacy
刘嘉炜 1 year ago
parent
commit
e67c28471a
  1. 247
      src/components/order_list/modal/ticket_check.vue
  2. 8
      src/components/organize_order/organize_order.vue
  3. 55
      src/components/reservation_order/reservation_order.vue
  4. 7
      src/components/site/order_modal/order_modal.vue
  5. 11
      src/components/timing_order/timing_order.vue
  6. 7
      src/js/api.js
  7. 25
      src/pages/order_list/order_list.vue
  8. 28
      src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue
  9. 26
      src/subpackage/device/pages/order_details/order_details.vue

247
src/components/order_list/modal/ticket_check.vue

@ -0,0 +1,247 @@
<template>
<view>
<view class="modal-mask" v-if="isShow">
<view class="time-ticket-check">
<image @click="hide" class="ttc-close" mode="aspectFit" src="/static/images/icon/x_close.png"></image>
<view class="ttc-title">核销次票</view>
<view class="ttc-container">
<view class="ttc-ticket-info">
<view class="tti-line">到期时间{{ orderInfo.end_time || '-' }}</view>
<view class="tti-line">剩余待使用{{ orderInfo.available_num || 0 }}</view>
</view>
<view class="tc-check-number">
<veiew class="tcn-text"><text class="tt-txt">*</text>核销次数</veiew>
<veiw class="tcn-operate">
<view class="to-btn" @click="numOperate('reduce')"></view>
<view class="to-ipt">
<input
:disabled="orderInfo.available_num === 1"
class="ti-input"
type="number"
placeholder="0"
v-model="ticketNumber"
/>
</view>
<view class="to-btn add" @click="numOperate('add')"></view>
</veiw>
<veiew class="tcn-text"></veiew>
</view>
<view class="tc-tip">确认核销数量后系统将会自动核销对应数量的票核销后待使用的验证码状态更改为已使用</view>
</view>
<view class="ttc-btns">
<view class="tb-btn" @click="hide">取消</view>
<view class="tb-btn active" @click="confirm">确认</view>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '../../../utils/util.js';
import { servers } from '../../../js/server';
import { API } from '../../../js/api';
export default {
data() {
return {
isShow: false,
ticketNumber: 1,
orderInfo: {},
orderIndex: -1,
}
},
methods: {
numOperate(type){
let { ticketNumber, orderInfo } = this;
let { available_num } = orderInfo;
if(+available_num === 0)return;
if(type === 'add'){
if(+ticketNumber >= +available_num)return;
this.ticketNumber++;
}else{
if(+ticketNumber <= 1)return;
this.ticketNumber--;
}
},
confirm(){
let { ticketNumber, orderInfo } = this;
let { available_num, id } = orderInfo;
if(+available_num === 0)return;
if(+ticketNumber > +available_num)return util.showNone('核销次数不能大于剩余次数');
this.getOrderInfo({
order_no: orderInfo.order_no,
stadium_id: orderInfo.stadium_id
})
this.hide();
},
getOrderInfo({
order_no,
stadium_id
}){
let { orderIndex } = this;
util.showLoad();
servers.get({
url: API.order.reservationDetail,
data: { order_no, stadium_id },
failMsg: '加载订单信息失败!'
})
.then(res => {
util.hideLoad();
this.$emit('confirm', { orderInfo: res || {}, orderIndex });
})
},
show({ info, index }) {
let { orderInfo } = this;
this.orderInfo = info || {};
this.orderIndex = index;
this.isShow = true;
this.$emit('show');
if(orderInfo?.id !== info?.id){
this.ticketNumber = 1;
}
},
hide() {
this.isShow = false;
this.$emit('hide');
}
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.modal-mask{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,.5);
}
.time-ticket-check{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding-top: 78upx;
padding-bottom: 80upx;
width: 620upx;
background-color: #fff;
border-radius: 10upx;
}
.ttc-close{
position: absolute;
right: 30upx;
top: 30upx;
display: block;
width: 34upx;
height: 34upx;
}
.ttc-title{
text-align: center;
font-size: 32upx;
font-weight: 500;
line-height: 44upx;
color: #333;
}
.ttc-container{
padding: 32upx 62upx;
}
.ttc-ticket-info{
.tti-line{
font-size: 28upx;
line-height: 48upx;
color: #333;
@include textHide(1);
}
}
.tc-check-number{
margin-top: 50upx;
@include centerFlex(space-between);
.tcn-text{
font-size: 28upx;
line-height: 48upx;
color: #333;
.tt-txt{
color: #EA5061;
}
}
.tcn-operate{
margin-left: auto;
margin-right: 20upx;
@include centerFlex(center);
.to-btn{
position: relative;
width: 58upx;
height: 56upx;
background-color: #F2F2F7;
&::before{
content: '';
position: absolute;
display: block;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 24upx;
height: 4upx;
border-radius: 2upx;
background-color: #9A9A9D;
}
&.add{
&::after{
content: '';
position: absolute;
display: block;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 4upx;
height: 24upx;
border-radius: 2upx;
background-color: #9A9A9D;
}
}
}
.to-ipt{
margin: 0 4upx;
width: 132upx;
height: 56upx;
background-color: #F2F2F7;
.ti-input{
width: 100%;
height: 100%;
font-size: 28upx;
color: #333;
text-align: center;
}
}
}
}
.tc-tip{
margin-top: 28upx;
font-size: 24upx;
line-height: 48upx;
color: #9a9a9d;
}
.ttc-btns{
@include centerFlex(center);
.tb-btn{
margin: 0 20upx;
width: 240upx;
line-height: 84upx;
text-align: center;
border: 2upx solid $themeColor;
border-radius: 10upx;
font-size: 32upx;
font-weight: 500;
color: $themeColor;
&.active{
background-color: $themeColor;
color: #fff;
}
}
}
</style>

8
src/components/organize_order/organize_order.vue

@ -82,12 +82,8 @@ export default {
methods:{
toOrderDetails(){
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 10
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
// this.$emit('orderDetailChange');
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=10`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
},
clickSendAmount(){
let that = this

55
src/components/reservation_order/reservation_order.vue

@ -67,9 +67,8 @@
</view>
<view class="ro-bot">
<view class="rb-total">实付款 <text class="rt-txt"> ¥{{orderInfo.pay_amount || '0'}}</text></view>
<view class="rb-btn" v-if="orderInfo.order_type == 1" @click.stop="verifyBtn">核销</view>
</view>
<!-- <view class="ro-bot-line" v-if="orderInfo.verify_type!=0">核销方式{{zh_verify_type(orderInfo.verify_type)}} {{orderInfo.verify_time || '-'}}</view>
<view class="ro-bot-line" v-if="orderInfo.pay_status == 4">退款时间{{orderInfo.refund_time || '-'}}</view> -->
</view>
</template>
@ -115,6 +114,9 @@ export default {
},
},
methods:{
verifyBtn(){
this.$emit('verify')
},
zh_order_status(orderInfo = {}){
// -101使2使34退
let _status = orderInfo.pay_status || '';
@ -141,11 +143,8 @@ export default {
},
detailChange(){
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 3
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=3`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
}
}
@ -213,41 +212,33 @@ export default {
padding-top: 20upx;
padding-bottom: 30upx;
border-top: 2upx solid #D8D8D8;
.rb-line{
@include centerFlex(space-between);
.rl-view{
line-height: 40upx;
font-size: 24upx;
color: #9c9c9f;
&:first-child{
margin-right: 20upx;
flex-shrink: 0;
}
&+.rl-view{
flex-grow: 1;
text-align: right;
@include textHide(1);
}
}
display: flex;
justify-content: space-between;
.rb-btn{
margin-left: 12upx;
flex-shrink: 0;
width: 192upx;
line-height: 80upx;
text-align: center;
border-radius: 10upx;
font-size: 32upx;
font-weight: 500;
color: #fff;
background-color: $themeColor;
}
.rb-total{
flex-grow: 1;
line-height: 40upx;
text-align: right;
font-size: 24upx;
color: #9c9c9f;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.rt-txt{
color: #1A1A1A;
margin-left: 10rpx;
}
}
}
.ro-bot-line{
height: 90upx;
line-height: 90upx;
border-top: 2upx solid #D8D8D8;
font-size: 24upx;
color: #9c9c9f;
@include textHide(1);
}
}
</style>

7
src/components/site/order_modal/order_modal.vue

@ -271,11 +271,8 @@ export default {
},
toOrderInfo(){
let { orderInfo, queryInfo } = this;
let _query = {}
_query["stadium_id"] = queryInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 3
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
let _str = `stadium_id=${queryInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=3`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
},
toShare(){
let { orderInfo, queryInfo } = this;

11
src/components/timing_order/timing_order.vue

@ -76,11 +76,12 @@ export default {
methods:{
toOrderDetails(){
let { orderInfo } = this
let _query = {}
_query["stadium_id"] = orderInfo.stadium_id
_query["order_no"] = orderInfo.order_no
_query["order_type"] = 1
util.routeTo(`/subpackage/device/pages/order_details/order_details?query=${util.jsonStr(_query)}`,'nT');
// let _query = {}
// _query["stadium_id"] = orderInfo.stadium_id
// _query["order_no"] = orderInfo.order_no
// _query["order_type"] = 1
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=1`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
// this.$emit('orderDetailChange');
},
timeEndBtn(){

7
src/js/api.js

@ -140,6 +140,13 @@ API['writeOff'] = {
}
// 20230817 【ID1001370】 商家助手次卡订单增加核销功能
API['order'] = {
reservationDetail:`${ORIGIN}/admin/assistant/stadiumOrder/detail`, //k-订单管理-场馆预约订单-预约场馆订单详情/ 次卡订单详情
}
export default { ORIGIN, API };

25
src/pages/order_list/order_list.vue

@ -47,7 +47,7 @@
</view>
<view class="ol-order-list" v-if="orderList&&orderList.length">
<view class="ool-item" v-for="(e,i) in orderList" :key="i" >
<reservation-order :order-info="e" v-if="orderType == 3"></reservation-order>
<reservation-order :order-info="e" v-if="orderType == 3" @verify="reservationVerify(i)"></reservation-order>
<membership-order :order-info="e" v-if="orderType == 4"></membership-order>
<integral-order :order-info="e" v-if="orderType == 5"></integral-order>
<timing-order :order-info="e" @refreshList="refreshList" v-if="orderType == 1"></timing-order>
@ -113,6 +113,12 @@
<view class="pl-btn active" @click="confirmPeriod">确定</view>
</view>
</view>
<!-- 次票核销弹窗 -->
<ticket-check
ref="ticketCheckModal"
@confirm="verifyConfirm"
></ticket-check>
</view>
</template>
@ -137,6 +143,8 @@
import ym_card from '../../components/order_list/ym_card/ym_card.vue'; //
import stored_value_card from '../../components/order_list/stored_value_card/stored_value_card.vue'; //
import ticket_check from '../../components/order_list/modal/ticket_check.vue';
import util from '../../utils/util';
import { servers } from '../../js/server';
import { API } from '../../js/api';
@ -163,6 +171,8 @@
'retail': retail,
'ym-card': ym_card,
'stored-value-card': stored_value_card,
'ticket-check': ticket_check,
},
computed:{
isStoreInfo(){
@ -260,6 +270,19 @@
},
methods: {
reservationVerify(index){
let { orderList } = this;
this.$refs.ticketCheckModal.show({
info: orderList?.[index] || {},
index,
});
},
verifyConfirm({ orderInfo, orderIndex }){
if(!orderInfo?.id || isNaN(orderIndex) ||+orderIndex < 0)return;
let _orderList = this?.orderList?.slice() || [];
_orderList[orderIndex] = orderInfo;
this.orderList = _orderList;
},
tabChange: util.debounce(function(ID){
if(this.curTabID === ID)return;
this.curTabID = ID;

28
src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue

@ -35,11 +35,18 @@
</view>
</block>
<!-- 待使用 未绑定ic卡 -->
<view :class="['rh-ic', orderInfo.bind_iccard_info.id > 0?'rh-ic-untie':'']" @click="orderInfo.bind_iccard_info.id > 0?bindICCardChange(1):bindICCardChange(2)">{{ orderInfo.bind_iccard_info.id > 0?'解绑IC卡':'绑定IC卡' }}</view>
<view
:class="['rh-ic', orderInfo.bind_iccard_info.id > 0?'rh-ic-untie':'']"
@click="orderInfo.bind_iccard_info.id > 0?bindICCardChange(1):bindICCardChange(2)"
>{{ orderInfo.bind_iccard_info.id > 0?'解绑IC卡':'绑定IC卡' }}</view>
</block>
</view>
<view class="rp-box">
<view class="rb-title">验证信息<text>({{orderInfo.available_num || 0}}张可用)</text></view>
<view class="rb-title">
验证信息
<text>({{orderInfo.available_num || 0}}张可用)</text>
<view class="rb-verify-btn">核销</view>
</view>
<!-- 人次+随时用 -->
<view class="rb-time" v-if="orderInfo.person_number_rule.order_method==1">
<view>有效期至</view>
@ -616,6 +623,18 @@ export default {
font-size: 28rpx;
margin-left: 28rpx;
}
.rb-verify-btn{
display: inline-block;
margin-left: 28upx;
width: 132upx;
line-height: 64upx;
text-align: center;
border-radius: 10upx;
font-size: 32upx;
font-weight: 500;
color: #fff;
background-color: $themeColor;
}
}
.rb-time{
line-height: 48rpx;
@ -656,17 +675,18 @@ export default {
.s-btn{
flex-shrink: 0;
margin-left: 10upx;
padding: 0 22upx;
padding: 0 18upx;
height: 44upx;
line-height: 44upx;
font-size: 28upx;
border-radius: 10upx;
background-color: $themeColor;
background-color: #68C43B;
color: #fff;
}
}
.rs-active{
>view:first-child{
font-weight: 500;
color: #009874;
}
}

26
src/subpackage/device/pages/order_details/order_details.vue

@ -27,6 +27,8 @@
<view class="ri-btn" @click="confirmRefund">确认退款</view>
</view>
</view>
<!-- 次票核销弹窗 -->
<ticket-check></ticket-check>
</view>
</template>
@ -35,7 +37,7 @@
import reservationSiteDetail from '../../components/order/reservation_site_detail/reservation_site_detail.vue';
import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue';
import organizeDetail from '../../components/order/organize_detail/organize_detail.vue';
import ticket_check from '../../../../components/order_list/modal/ticket_check.vue';
import util from '../../../../utils/util';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
@ -46,6 +48,7 @@
'reservation-site-detail': reservationSiteDetail,
'reservation-people-detail': reservationPeopleDetail,
'organize-detail': organizeDetail,
'ticket-check': ticket_check,
},
computed:{
titleName(){
@ -74,19 +77,16 @@
}
},
onLoad(options) {
console.log(options)
let _query = util.jsonPar(options.query);
this.optionsQuery = _query
console.log(_query)
this.$nextTick(_=>{
uni.setNavigationBarTitle({
title: this.titleName
})
})
this.optionsQuery = options;
this.getPageInfo({
orderType: _query.order_type,
stadium_id: _query.stadium_id,
order_no: _query.order_no,
orderType: options.order_type,
stadium_id: options.stadium_id,
order_no: options.order_no,
});
this.$nextTick(_=>{
uni.setNavigationBarTitle({ title: this.titleName });
})
},
methods: {

Loading…
Cancel
Save