You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

383 lines
8.8 KiB

11 months ago
<template>
11 months ago
<view class="content">
<view class="common-box">
<view class="common-types">
10 months ago
<view @click="setType(0)" :class="['common-type',type==0?'active':'']">扫码核销</view>
11 months ago
<view @click="setType(1)" :class="['common-type',type==1?'active':'']">核销码核销</view>
<view @click="setType(2)" :class="['common-type',type==2?'active':'']">手机号核销</view>
</view>
</view>
<view class="content-area flex-1 h-1rpx">
10 months ago
<template v-if="orderList.length<=0">
<view class="type0-container" v-show="type==0">
<image @click="scanCode" :src="showImg('/uploads/20241203/e114fd176d9ef85e81e57150274bcc4a.png')"></image>
<view @click="scanCode">点击扫码核销</view>
11 months ago
</view>
10 months ago
<view class="type1-container" v-show="type==1">
11 months ago
<view class="flex flex-items-center">
10 months ago
<view class="hexiao-text">输入核销码</view>
10 months ago
<input v-model="HXCode" class="hexiao-code" placeholder="请输入内容" />
11 months ago
</view>
10 months ago
<view class="hexiao-btn" @click="verifyByCode">立即核销</view>
</view>
<view class="type1-container" v-show="type==2">
<view v-if="orderList.length<=0">
<view class="flex flex-items-center">
<view class="hexiao-text">输入手机号</view>
10 months ago
<input v-model="HXPhone" class="hexiao-code" placeholder="请输入内容" />
10 months ago
</view>
<view class="tips">
<view>仅支持查询当日订单 </view>
<view>支持手机号模糊搜索不少于4位</view>
</view>
<view class="hexiao-btn" style="margin-top: 100rpx;" @click="searchByPhone">查询</view>
11 months ago
</view>
</view>
10 months ago
</template>
<view class="type1-container" v-else>
<view class="order-list" >
10 months ago
<view class="order-item" v-for="(item,i) in orderList" :key="i" @click="goOrderDetail(item)">
11 months ago
<view class="title">订单详情</view>
10 months ago
<view class="flex" >
<view class="label">下单日期:</view>
<view class="text">{{item.create_time}}</view>
</view>
<view class="flex">
<view class="label">订单号:</view>
10 months ago
<view class="text">{{item.child_id}}</view>
10 months ago
</view>
<view class="flex">
<view class="label">订单名称:</view>
10 months ago
<view class="text"> {{item.goods_title}}</view>
10 months ago
</view>
<view class="flex">
10 months ago
<view class="label">订购数量:</view>
10 months ago
<view class="text">{{item.num}}</view>
</view>
10 months ago
<view class="flex">
<view class="label">出行人数:</view>
<view class="text">{{item.contact_num}}</view>
</view>
10 months ago
<view class="flex">
<view class="label">订单状态:</view>
<view class="text">{{item.status_text}}</view>
</view>
<view class="flex">
<view class="label">时段:</view>
10 months ago
<view class="text">{{item.use_date}}</view>
10 months ago
</view>
<view class="flex">
10 months ago
<view class="label">联系电话:</view>
<view class="text">{{item.phone}}</view>
</view>
<!-- <view class="flex">
10 months ago
<view class="label">出行人:</view>
10 months ago
<view class="text">{{item.contact_name}}</view>
10 months ago
</view>
<view class="flex">
<view class="label">出行人手机号:</view>
10 months ago
<view class="text">{{item.contact_tel}}</view>
10 months ago
</view>
<view class="flex">
10 months ago
<view class="label">出行人身份证:</view>
<view class="text">{{item.id_number}}</view>
10 months ago
</view> -->
11 months ago
10 months ago
<view v-if="item.status=='SUCCESS'" class="hexiao-btn" @click="confirmVerify(item)">核销</view>
11 months ago
</view>
</view>
</view>
10 months ago
11 months ago
</view>
10 months ago
<view v-if="showScan">
11 months ago
<scanCodeVue ref="scanCodeVueRef" @success="getCode" @fail="scanFail"></scanCodeVue>
10 months ago
</view>
11 months ago
11 months ago
</view>
11 months ago
</template>
<script>
11 months ago
import scanCodeVue from "../../components/scanCode.vue"
11 months ago
export default {
11 months ago
components:{scanCodeVue},
11 months ago
data() {
return {
10 months ago
type: 1,
11 months ago
HXCode: '', // 核销码
HXPhone:"",
orderList: [],
11 months ago
showScan: false,
11 months ago
};
},
onShow() {
10 months ago
if (this.HXCode || this.HXPhone) {
let param = {child_id: this.HXCode, mobile: this.HXPhone, noNeedDataTip: true}
this.getOrderList(param)
}
11 months ago
},
11 months ago
onLoad() {
11 months ago
},
methods: {
scanCode () {
11 months ago
this.showScan = true
},
getCode (res) {
console.log(res)
this.showScan = false
10 months ago
if (res) {
let param = {child_id: res}
10 months ago
this.HXCode = res
this.HXPhone = ""
10 months ago
this.getOrderList(param)
}
11 months ago
},
scanFail(res) {
this.showScan = false
uni.showToast({
title: res,icon:"none"
11 months ago
})
},
setType (type) {
10 months ago
if (this.type != type) {
this.orderList = []
}
11 months ago
this.type = type
},
10 months ago
// 查询订单
getOrderList (param) {
10 months ago
// this.orderList = []
10 months ago
this.Post(param, '/api/Merchants/search').then(res=>{
10 months ago
if (res && res.code == 1 && res.data) {
10 months ago
this.orderList = res.data || []
10 months ago
if (this.orderList.length<=0 && !param.noNeedDataTip) {
10 months ago
uni.showToast({
title:'未查询到需核销的订单',
icon:"none"
})
}
10 months ago
}
})
11 months ago
},
10 months ago
10 months ago
// 核销搜索
11 months ago
verifyByCode () {
10 months ago
if (this.HXCode.trim() == '') {
uni.showToast({title:'请输入核销码',icon:"none"})
return
}
10 months ago
let param = {child_id: this.HXCode.trim()}
10 months ago
this.HXPhone = ""
10 months ago
this.getOrderList(param)
11 months ago
},
10 months ago
11 months ago
searchByPhone () {
10 months ago
if (this.HXPhone.trim() == '') {
11 months ago
uni.showToast({title:'请输入手机号',icon:"none"})
11 months ago
return
} else if (this.HXPhone.length < 4) {
11 months ago
uni.showToast({title:'查询手机号最低4位',icon:"none"})
11 months ago
return
}
10 months ago
let param = {mobile: this.HXPhone.trim()}
10 months ago
this.HXCode = ""
10 months ago
this.getOrderList(param)
11 months ago
},
10 months ago
// 核销
confirmVerify (item) {
11 months ago
let _this = this
uni.showModal({
title: '',
content: '确认是否核销此订单',
confirmColor: '#96684F',
success: function (res) {
if (res.confirm) {
// todo
10 months ago
_this.Post({child_id: item.child_id}, '/api/Merchants/dispose').then(res=>{
10 months ago
uni.showToast({title:'核销成功',icon:'success'})
let param = {child_id: _this.HXCode, mobile: _this.HXPhone, noNeedDataTip: true}
_this.getOrderList(param)
})
11 months ago
}
}
});
},
10 months ago
goOrderDetail (item) {
uni.navigateTo({
url:`/subPackages/order/orderDetail?id=${item.child_id}`
})
},
11 months ago
},
}
11 months ago
</script>
11 months ago
<style lang="scss" scoped>
*{
box-sizing: border-box;
}
.content {
height: calc(100vh - 44px - 50px);
overflow-x: hidden;
position: relative;
display: flex;
flex-direction: column;
}
.common-box {
height: 106rpx;
width: 100%;
flex-shrink: 0;
.common-types {
width: 100%;
background: white;
height: 106rpx;
font-size: 31rpx;
z-index: 10;
color: #010101;
font-weight: bold;
overflow: hidden;
padding: 0 88rpx;
display: flex;
justify-content: space-between;
}
.common-type {
flex-shrink: 0;
line-height: 106rpx;
height: 106rpx;
position: relative;
width: 150rpx;
text-align: center;
}
.common-type.active:after {
display: block;
width: 50%;
font-size: 0;
content: '1';
margin: auto;
position: absolute;
left: 0;
right: 0;
bottom: 1rpx;
height: 6rpx;
background: #96684F;
border-radius: 6rpx;
}
}
.content-area{
overflow-y: auto;
overflow-x: hidden;
}
.type0-container{
padding: 185rpx 0 0 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 32rpx;
color: #707070;
image{
width: 176.67rpx;
height: 176.67rpx;
display: block;
margin-bottom: 25rpx;
}
}
.type1-container{
padding: 39rpx 26rpx;
.hexiao-text{
font-weight: 500;
font-size: 28rpx;
color: #000000;
}
.hexiao-code{
margin-left: 22rpx;
width: 537rpx;
height: 107rpx;
border-radius: 7rpx;
border: 1px solid #666666;
font-size: 28rpx;
line-height: 107rpx;
padding: 0 27rpx;
}
.hexiao-btn{
width: 307rpx;
height: 80rpx;
background: #96684F;
border-radius: 40rpx;
font-weight: 500;
font-size: 36rpx;
color: #FFFFFF;
line-height: 80rpx;
text-align: center;
display: block;
margin: 174rpx auto 0;
}
.tips{
padding: 20rpx 0 0 180rpx;
font-family: PingFang SC;
font-weight: 500;
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
}
}
.order-item{
width: 100%;
background: #FFFFFF;
border-radius: 13rpx;
padding: 30rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
10 months ago
margin-bottom: 30rpx;
11 months ago
&>view{
margin-bottom: 26rpx;
}
.title{
font-size: 32rpx;
text-align: center;
}
.label{
width: 200rpx;
flex-shrink: 0;
}
.text{
flex: 1;
width: 1rpx;
color: #646464;;
}
.hexiao-btn{
margin: 0;
margin-left: auto;
10 months ago
width: 200rpx;
height: 66rpx;
line-height: 66rpx;
11 months ago
font-weight: 500;
10 months ago
font-size: 28rpx;
11 months ago
}
}
11 months ago
</style>