Commit bd23b168 authored by 罗超's avatar 罗超

2

parent 775a7691
...@@ -26,6 +26,15 @@ ...@@ -26,6 +26,15 @@
.Order_Number { .Order_Number {
color: #111111; color: #111111;
font-size: 26rpx; font-size: 26rpx;
}
.Order_Name {
font-size: 28rpx;
margin-bottom: 20rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.Order_Complete { .Order_Complete {
...@@ -44,9 +53,8 @@ ...@@ -44,9 +53,8 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 32rpx; margin-top: 32rpx;
} }
.text_tree { .text_tree {
white-space: normal; white-space: normal;
color: #111111; color: #111111;
...@@ -59,49 +67,54 @@ ...@@ -59,49 +67,54 @@
margin-bottom: 17rpx; margin-bottom: 17rpx;
color: #111111; color: #111111;
font-size: 24rpx; font-size: 24rpx;
} }
.Order_tips { .Order_tips {
margin-right: 30rpx;
display: inline-block; display: inline-block;
width: 120rpx; width: 120rpx;
text-align-last: justify; text-align-last: justify;
color: #999999; color: #999999;
} }
.Order_Status{
.Order_Status {
font-size: 36rpx; font-size: 36rpx;
} }
</style> </style>
<template> <template>
<view class="orderList"> <view class="orderList">
<view class="Order_List" v-for="(item,index) in orderList" :key="index" > <van-empty description="暂无数据" v-if="orderList.length === 0" />
<view class="Order_Top"> <view v-if="orderList.length > 0">
<view class="Order_Number">订单号:{{item.OrderId}}</view> <view class="Order_List" v-for="(item,index) in orderList" :key="index">
<view class="Order_Status"> <view class="Order_Top">
<text class="Order_Complete" v-if="item.OrderState==1">正常</text> <view class="Order_Number">订单号:{{item.OrderId}}</view>
<text class="Order_Cancel" v-if="item.OrderState==2">退学</text> <view class="Order_Status">
<text class="Order_Cancel" v-if="item.OrderState==3">取消</text> <text class="Order_Complete" v-if="item.OrderState==1">正常</text>
<text class="Order_noPay" v-if="item.OrderState==4">待付款</text> <text class="Order_Cancel" v-if="item.OrderState==2">退学</text>
</view> <text class="Order_Cancel" v-if="item.OrderState==3">取消</text>
</view> <text class="Order_noPay" v-if="item.OrderState==4">待付款</text>
<view class="Order_Bottom">
<view style="width:100%;">
<view class="Order_Name">{{item.CourseName}}</view>
<view class="text_tree">{{item.ClassName}}</view>
<view class="Order_TipList">
<view class="Order_tips">下单客户:</view>
<text>{{item.GuestName}}</text>
</view> </view>
<view class="Order_TipList"> </view>
<view class="Order_tips">完成课时:</view> <view class="Order_Bottom">
<text>{{item.CompleteHours}}</text> <view style="width:100%;">
</view> <view class="Order_Name">{{item.CourseName}}</view>
<view class="Order_TipList"> <view class="text_tree">{{item.ClassName}}</view>
<view class="Order_tips">总课时:</view> <view class="Order_TipList">
<text>{{item.TotalHours}}</text> <view class="Order_tips">客户</view>
<text>{{item.GuestName}}</text>
</view>
<view class="Order_TipList">
<view class="Order_tips">完成课时</view>
<text>{{item.CompleteHours}}</text>
</view>
<view class="Order_TipList">
<view class="Order_tips">总课时</view>
<text>{{item.TotalHours}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
<Loadmore :state="pageState" />
</view> </view>
</view> </view>
</template> </template>
...@@ -118,24 +131,28 @@ ...@@ -118,24 +131,28 @@
onMounted, onMounted,
inject, inject,
} from "vue"; } from "vue";
import Loadmore from "../../components/loadmore.vue";
import bottom from "../../components/bottom"; import bottom from "../../components/bottom";
export default { export default {
components: { components: {
bottom, bottom,
Loadmore,
}, },
setup(props, context) { setup(props, context) {
let { let {
proxy proxy
} = getCurrentInstance(); } = getCurrentInstance();
let data = reactive({ let data = reactive({
pageTitle:"合同列表", pageTitle: "合同列表",
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
OrderType:1 OrderType: 1
}, },
pageCount:0, pageCount: 0,
orderList: [] orderList: [],
pageState: "more",
timer: null, //防抖
}); });
const methods = { const methods = {
jumpPage(url) { jumpPage(url) {
...@@ -145,8 +162,18 @@ ...@@ -145,8 +162,18 @@
}, },
getData() { getData() {
proxy.$request("/AppletIndex/GetOrderPage", data.msg).then((res) => { proxy.$request("/AppletIndex/GetOrderPage", data.msg).then((res) => {
console.log(res) if (data.timer) data.timer = null;
data.orderList = res.Data.PageData; if (data.msg.pageIndex === 1) {
data.orderList = res.Data.PageData;
} else {
data.orderList = [...data.orderList, ...res.Data.PageData];
}
data.pageCount = res.Data.PageCount
if (data.msg.pageIndex >= res.Data.PageCount) {
data.pageState = "none";
} else {
data.pageState = "more";
}
}); });
}, },
...@@ -158,20 +185,28 @@ ...@@ -158,20 +185,28 @@
}; };
}, },
onLoad(options) { onLoad(options) {
this.msg.OrderType=options.type this.msg.OrderType = options.type
this.getData(); this.getData();
if(options.type==1){ if (options.type == 1) {
this.pageTitle='语培订单' this.pageTitle = '语培订单'
}else if(options.type==2){ } else if (options.type == 2) {
this.pageTitle='留学订单' this.pageTitle = '留学订单'
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.pageTitle title: this.pageTitle
}); });
}, },
onReachBottom() { onReachBottom() {
if (this.msg.pageIndex < this.pageCount) {
console.log(this.msg) data.pageState = "loading";
if (this.timer) clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.msg.pageIndex++;
that.getList();
}, 1000);
} else {
this.pageState = "none";
}
} }
}; };
</script> </script>
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
import { import {
getLearningGardenList getLearningGardenList
} from "../../api/index"; } from "../../api/index";
import {
debounce
} from "../../utils/index";
import Loadmore from "../../components/loadmore.vue"; import Loadmore from "../../components/loadmore.vue";
export default { export default {
components: { components: {
......
...@@ -32,6 +32,7 @@ let request = (param) => { ...@@ -32,6 +32,7 @@ let request = (param) => {
duration: 2000, duration: 2000,
icon: "none", icon: "none",
}); });
uni.clearStorageSync();
reject() reject()
}else{ }else{
uni.showToast({ uni.showToast({
......
//请求电商接口 //请求电商接口
let host = '' let host = ''
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === "development") {
host = 'http://192.168.10.65:8088/api' // host = 'http://192.168.10.65:8088/api'
host = "https://mallapi.oytour.com/api"
} else { } else {
host = "https://mallapi.oytour.com/api" host = "https://mallapi.oytour.com/api"
} }
import Toast from '../wxcomponents/vant/toast/toast';
let request = (param) => { let request = (param) => {
//网络请求 //网络请求
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -29,27 +29,18 @@ let request = (param) => { ...@@ -29,27 +29,18 @@ let request = (param) => {
token: JHdata.MallToken token: JHdata.MallToken
}, },
success: res => { success: res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
resolve(res.data) resolve(res.data)
} else { } else {
Toast({ if (res.data.Message.indexOf('用户凭证为空') != -1 || res.data
type: 'fail', .Message.indexOf('用户凭证失效') != -1) {
message: res.data.message, uni.showToast({
onClose: () => { title: "用户凭证失效,请重新授权",
// if (res.data.resultCode === 10001 || res.data.resultCode === 10000 || res.data.resultCode === 10002 || res.data.resultCode === 10003) { duration: 2000,
// uni.reLaunch({ icon: "none",
// url: '/pages/login/login' });
// }); uni.clearStorageSync();
// } else { }
// if (res.data.message.indexOf('用户凭证为空') != -1 || res.data.message.indexOf('用户凭证失效') != -1) {
// uni.reLaunch({
// url: '/pages/login/login'
// });
// }
// }
},
});
} }
}, },
fail: (err) => { fail: (err) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment