添加发票对接功能

This commit is contained in:
wangxiaowei
2026-01-08 17:23:46 +08:00
parent a564ef78bd
commit 83bc147a48
5 changed files with 165 additions and 14 deletions

View File

@ -158,8 +158,8 @@
"scope.userLocation" : {
"desc" : "获取您与体育场馆的距离"
},
"scope.camera": {
"desc": "需要获取摄像头权限进行人脸录入"
"scope.camera" : {
"desc" : "需要获取摄像头权限进行人脸录入"
}
}
},

View File

@ -952,6 +952,17 @@
}
}
},
{
"path": "pages/order/invoice",
"style": {
"navigationBarTitleText": "开发票",
"app-plus": {
//#ifdef H5
"titleNView": false
//#endif
}
}
},
{
"path": "pages/order/cg-my-order",
"style": {

View File

@ -135,6 +135,10 @@
<button class="theme-btn del-btn" @click="onDelOrder(item.id)">删除订单</button>
</block>
<block v-if="item.order_status == 3 && item.fp_status == 0">
<button class="theme-btn pay-btn" @click="toInvoice(item.id)">去开票</button>
</block>
<!-- 在篮球场下且订单是已预约有个人脸录入 -->
<block v-if="item.order_status == 1 && ballType == 2 && item.face_status == 0">
<button class="theme-btn pay-btn" @click="onTakePhoto(item.id)">人脸录入</button>
@ -469,14 +473,18 @@
// 跳转支付页面
onPayOrder(groundId = 0, orderId = 0) {
let self = this;
console.log("🚀 ~ methods.onPayOrder:", groundId, orderId, self.ballType)
if (self.ballType == 1) {
// 网球场
self.gotoPage(`/bundle/reserve/confirm?orderId=${orderId}&venueId=${groundId}&typeId=1`);
return
} else if (self.ballType == 2) {
// 篮球场
self.gotoPage(`/bundle/reserve/confirm?orderId=${orderId}&venueId=${groundId}&typeId=2`);
return
}
},
cancelAdvance(e) {
let self = this;
let order_id = e;
@ -587,7 +595,15 @@
uni.navigateTo({
url: `/bundle/face/face-info?order_id=${order_id}`
});
}
},
// 去开票
toInvoice(order_id) {
console.log("🚀 ~ methods.toInvoice:")
uni.navigateTo({
url: `/pages/order/invoice?order_id=${order_id}`
});
},
}
};
</script>

View File

@ -32,14 +32,14 @@
</view>
<!-- 交易完成 -->
<!-- 订单进行中 -->
<view class="status-text" style="width: 100%;" v-if="detail.order_status == 2">
感谢预定场馆,期待下次再见
您的订单正在进行中
</view>
<!-- 进行中 -->
<!-- 已完成 -->
<view class="status-text" style="width: 100%;" v-if="detail.order_status == 3">
您的订单正在进行中
感谢预定场馆,期待下次再见
</view>
<!-- 订单取消 -->
@ -183,7 +183,7 @@
</view>
<template v-if="detail.order_source != 80">
<view v-if="detail.order_status.value != 20 && detail.order_status.value != 30" class="foot-btns">
<view v-if="detail.order_status != 20 && detail.order_status != 30 && detail.order_status != 3" class="foot-btns">
<!-- 待支付 -->
<templte class="ww100" v-if="detail.order_status == 0">
<view class="d-b-c ww100">
@ -519,16 +519,16 @@
// 网球场
self.gotoPage(`/bundle/reserve/confirm?orderId=${self.order_id}&venueId=${groundId}&typeId=1`);
return
} else if (self.ballType == 2) {
// 篮球场
self.gotoPage(`/bundle/reserve/confirm?orderId=${self.order_id}&venueId=${groundId}&typeId=2`);
return
}
},
// 再次预定
againReserve() {
this.gotoPage(`/bundle/reserve/details?id=${this.detail.ground_id}&ballType=${this.ballType}`);
// toGround(ground_id) {
// uni.navigateTo({
// url: `/bundle/reserve/details?id=${ground_id}&typeId=${this.ballType}`
// });
this.gotoPage(`/bundle/reserve/details?id=${this.detail.ground_id}&typeId=${this.ballType}`);
},
// 联系商家

124
pages/order/invoice.vue Normal file
View File

@ -0,0 +1,124 @@
<template>
<view class="">
<view class="bg-white mx32 box">
<view class="mt20 px20">
<input class="p20 border-tb" name="alipay_name" type="text" v-model="form.gmfnsrsbh" placeholder-class="grary" placeholder="请输入税号" />
</view>
<view class="mt20 px20">
<input class="p20 border-tb" name="alipay_name" type="text" v-model="form.gmfmc" placeholder-class="grary" placeholder="请输入抬头" />
</view>
<view class="mt20 px20">
<input class="p20 border-tb" name="alipay_name" type="text" v-model="form.emials" placeholder-class="grary" placeholder="请输入邮箱" />
</view>
</view>
<view class="w-full d-c-c mt100 mb50">
<view class="again-btn" @click="submit">提交</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
order_id: 0,
form: {
gmfnsrsbh: '',
gmfmc: '',
emials: '',
}
};
},
onLoad(args) {
this.order_id = args.order_id;
console.log('order_id', this.order_id);
},
methods: {
submit() {
if (!this.form.gmfnsrsbh) {
uni.showToast({
title: '请输入税号',
icon: 'none'
});
return;
}
if (!this.form.gmfmc) {
uni.showToast({
title: '请输入抬头',
icon: 'none'
});
return;
}
if (!this.form.emials) {
uni.showToast({
title: '请输入邮箱',
icon: 'none'
});
return;
}
uni.showLoading({
title: '正在处理'
});
let self = this;
self._post(
'invoice.invoice/getInvoice',
{
order_id: self.order_id,
emails: self.form.emials,
gmfmc: self.form.gmfmc,
gmfnsrsbh: self.form.gmfnsrsbh
},
function(res) {
uni.hideLoading();
setTimeout(() => {
uni.showToast({
title: '开票成功',
duration: 2000,
icon: 'success'
});
}, 800)
uni.navigateBack();
}
);
}
}
};
</script>
<style lang="scss">
.box {
margin-top: 32rpx;
border-radius: 16rpx;
}
.mx32 {
margin-left: 32rpx;
margin-right: 32rpx;
}
.mt100 {
margin-top: 100rpx;
}
.px20 {
padding-left: 20rpx;
padding-right: 20rpx;
}
.again-btn {
width: 630rpx;
height: 90rpx;
text-align: center;
line-height: 90rpx;
background: #365A9A;
border-radius: 8rpx;
font-size: 32rpx;
color: #FFFFFF;
}
</style>