driver-manage/pages/teacher/orderManage.vue
2024-08-28 11:51:49 +08:00

405 lines
7.1 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="c_">
<view class="con">
<view class="content">
<!-- <view class="tab-list">
<view @click="findOrderListByState(index)" class="tab-box" :class="{ 'lv-size' : tabindex == index }"
v-for="(item,index) in tablist" :key="index">
<view class="">{{item.name}}</view>
<view class="gang" :class="{ 'lv-gang' : tabindex == index }"></view>
</view>
</view> -->
<u-empty mode="list" v-if="orderList.length==0 ">
</u-empty>
<view class="box_" v-for="(item,index) in orderList" :key="index">
<view class="box-top">
<view class="">
<view class="h-title">订单编号{{item.orderNumber}}</view>
<view class="hui-x">{{item.createTime}}</view>
</view>
</view>
<view class="box-ds">
<view class="left-box">
<image :src="imagesUrl + item.photo" mode=""></image>
</view>
<view class="">
<!-- <view class="box-title">AI智能</view> -->
<view class="box-title">{{item.courseName}}</view>
<view class="wrap-box">
<view class="price_">{{item.coursePrice}}</view>
</view>
</view>
</view>
<view class="liang-box">
<view class="lb-box" style="margin-bottom: 5px;">
<view class="">学员</view>
<view style="color: #333333;">{{item.name}}</view>
</view>
<view class="lb-box">
<view class="">联系电话</view>
<view style="color: #333333;">{{item.phone}}</view>
</view>
</view>
<view class="right-icon">
<view class="">提成:</view>
<view style="font-size: 20px;color: #FB423B;">{{item.deduct ||0 }}</view>
</view>
</view>
</view>
<u-popup :show="isState" @close="stateExitClick" @open="open">
<view class="statePage">
<view @click="chnageListDataIndex(index)" :class="{reactw: listDataIndex === index}"
style="margin: 0 20rpx;" v-for="(item, index) in listData" class="state-item">{{item}}</view>
</view>
</u-popup>
</view>
</view>
</template>
<script>
import request from "@/utils/request.js"
import {
imagesUrl
} from "@/config.js"
export default {
data() {
return {
tabindex: 0,
tablist: [{
name: '全部订单'
},
{
name: '已报名'
},
{
name: '已付款'
},
{
name: '已面签'
}
],
userId: null,
listData: ["全部订单", "已报名", "已付款", "已面签"],
listDataIndex: 0,
orderList: [],
isState: false
}
},
// open(){
// this.$refs.popup.open('top')
// },
onShow() {
this.findOrderListByState(0)
},
onPullDownRefresh() {
console.log("刷新");
uni.stopPullDownRefresh()
},
onReachBottom() {
// this.show = true
setTimeout(() => {
console.log("加载执行");
}, 2000)
},
methods: {
async findOrderListByState(index) {
this.tabindex = index
let state = null
if (index == 1) {
state = 0
} else if (index == 2) {
state = 1
} else if (index == 3) {
state = 2
}
let res = await request({
url: '/drivingSchool/system/pass/checkList',
method: 'get',
})
this.orderList = res.rows
console.log(e);
},
// getindex(index) {
// this.tabindex = index
// },
goDetails(id) {
uni.navigateTo({
url: `/pages/index/orderDetails?id=${id}`
})
},
changeStateClick(userId, state) {
this.isState = true
this.userId = userId
this.listDataIndex = state
console.log(userId, state, "ddsda")
},
stateExitClick() {
this.isState = false
},
async chnageListDataIndex(index) {
console.log("添加添加", index)
this.listDataIndex = index
this.isState = false
this.tabindex = index
let state = null
if (index == 1) {
state = 0
} else if (index == 2) {
state = 1
} else if (index == 3) {
state = 2
}
let res = await request({
url: `/system/pay`,
method: 'put',
data: {
id: this.userId,
state: state
}
})
this.findOrderList()
}
}
}
</script>
<style scoped lang="scss">
.reactw {
color: red;
}
.statePage {
height: 400rpx;
display: flex;
justify-content: center;
align-items: center;
}
.box-right {
padding: 10rpx;
border: 1rpx solid #ccc;
border-radius: 12rpx;
margin-left: 130rpx;
}
.con {
width: 100%;
background: #f4f5f6;
}
.c_ {
width: 100%;
height: 100vh;
background: #f4f5f6;
}
.content {
width: 100%;
background: #f4f5f6;
box-sizing: border-box;
}
.tab-list {
width: 100%;
height: 50px;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
}
.tab-box {
width: 25%;
text-align: center;
font-weight: 400;
font-size: 14px;
}
.lv-size {
font-weight: bold;
font-size: 14px;
color: #4AA76F !important;
}
.gang {
width: 16px;
height: 3px;
// background: #4AA76F;
margin: 0px auto;
margin-top: 10px;
}
.lv-gang {
background: #4AA76F !important;
}
.box_ {
width: 95%;
margin: 15px auto;
background: #FFFFFF;
border-radius: 8px;
box-sizing: border-box;
padding: 15px;
}
.box-top {
width: 100%;
border-bottom: 1px solid #DDDDDD;
box-sizing: border-box;
padding-bottom: 10px;
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.icon-huang {
width: 48px;
height: 20px;
background: #FFFFFF;
border-radius: 3px 3px 3px 3px;
border: 1px solid #EDA23A;
color: #EDA23A;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.h-title {
font-size: 12px;
color: #333333;
margin-bottom: 10px;
}
.hui-x {
font-size: 12px;
color: #999999;
}
.box-ds {
display: flex;
align-items: center;
}
.left-box {
width: 106px;
height: 66px;
overflow: hidden;
border-radius: 6px;
margin-right: 10px;
image {
width: 100%;
height: 100%;
}
}
.box-title {
font-weight: 800;
font-size: 14px;
color: #333333;
margin-bottom: 5px;
}
.wrap-box {
width: 100%;
box-sizing: border-box;
display: flex;
align-items: center;
flex-wrap: wrap;
}
.icon-lv {
background: #E6F5F0;
border-radius: 2px 2px 2px 2px;
box-sizing: border-box;
padding: 5px;
font-weight: 400;
font-size: 10px;
font-size: 10px;
color: #4AA76F;
margin-right: 10px;
}
.icon-h {
background: #FFEDD4;
border-radius: 2px 2px 2px 2px;
box-sizing: border-box;
padding: 5px;
font-weight: 400;
font-size: 10px;
font-size: 10px;
color: #EDA23A;
}
.price_ {
font-weight: bold;
font-size: 14px;
color: #FB423B;
margin-right: 15px;
}
.sc {
font-size: 10px;
color: #AAAAAA;
text-decoration-line: line-through;
text-transform: none;
}
.liang-box {
border-top: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
box-sizing: border-box;
padding: 10px 0px;
margin-top: 10px;
}
.lb-box {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #999999;
}
.right-icon {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 12px;
font-weight: bold;
margin-top: 10px;
}
</style>