完善订单页面

This commit is contained in:
wangxiaowei
2025-12-08 01:37:33 +08:00
parent becadb1d0c
commit 4a0d0c1114
6 changed files with 348 additions and 141 deletions

View File

@ -54,10 +54,10 @@
<!-- 使用余额支付优惠的折扣 --> <!-- 使用余额支付优惠的折扣 -->
<view style="margin-top: 52rpx;" v-if="bill.dis"> <view style="margin-top: 52rpx;" v-if="bill.dis">
<view class="title1 d-b-c"> <view class="title1 d-b-c">
<view style="color: #4C9F44;">优惠</view> <view>折扣优惠</view>
<view> <view>
<text style="margin-right: 6rpx;"> - </text> <text style="margin-right: 6rpx;color: #FA2B21;"> - </text>
<price-format color="#303133" :subscript-size="30" :first-size="30" :second-size="30" :price="bill.dis"></price-format> <price-format color="#FA2B21" :subscript-size="30" :first-size="30" :second-size="30" :price="bill.dis"></price-format>
</view> </view>
</view> </view>
</view> </view>
@ -75,8 +75,9 @@
<view class="price2 bg-white" style="margin: 0; padding: 56rpx 22rpx 42rpx;"> <view class="price2 bg-white" style="margin: 0; padding: 56rpx 22rpx 42rpx;">
<view class="d-b-c price-block" style="margin: 0;"> <view class="d-b-c price-block" style="margin: 0;">
<view class="d-f d-c j-c-b"> <view class="d-f d-c j-c-b">
<view class=""> <view>
合计: <price-format color="#FF5951" :subscript-size="26" :first-size="40" :second-size="40" :price="bill.total"></price-format> 合计: <price-format color="#FF5951" :subscript-size="26" :first-size="40" :second-size="40" :price="bill.total"></price-format>
<text style="margin-left: 10rpx;color: #FA2B21;font-size: 26rpx;">8折</text>
</view> </view>
<view class="d-f j-c-c a-i-c" style="margin-top: 10rpx;" @click="closeBillPopup"> <view class="d-f j-c-c a-i-c" style="margin-top: 10rpx;" @click="closeBillPopup">
<view class="price-detail">费用明细</view> <view class="price-detail">费用明细</view>
@ -171,7 +172,7 @@
<view :class="payType == 'wxpay' ? 'item active' : 'item'" @tap="payTypeFunc('wxpay')" style="padding-bottom: 10rpx;"> <view :class="payType == 'wxpay' ? 'item active' : 'item'" @tap="payTypeFunc('wxpay')" style="padding-bottom: 10rpx;">
<view class="d-s-c"> <view class="d-s-c">
<view class="icon-box d-c-c mr10"><span class="icon iconfont icon-weixin"></span></view> <view class="icon-box d-c-c mr10"><span class="icon iconfont icon-weixin"></span></view>
<text class="key">微信支付</text> <text class="key">微信支付</text>
</view> </view>
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view> <view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
</view> </view>
@ -244,6 +245,9 @@
payType: 'wxpay', // 支付方式 wxpay\balance payType: 'wxpay', // 支付方式 wxpay\balance
balance: 0, balance: 0,
order: {}, order: {},
result: '',
loadding: true,
_submitting: false
}; };
}, },
@ -257,6 +261,17 @@
this.getData(); this.getData();
}, },
onUnload() {
switch(this.result) {
case 'success':
uni.$emit('payment', { result: true, order_id: this.orderId })
break;
case 'fail':
default: uni.$emit('payment', { result: false, order_id: this.orderId })
}
},
methods: { methods: {
getData() { getData() {
let self = this; let self = this;
@ -264,12 +279,12 @@
title: '加载中' title: '加载中'
}); });
const reserveDate = uni.getStorageSync('reserveDate') || null // const reserveDate = uni.getStorageSync('reserveDate') || null
self.date = reserveDate // self.date = reserveDate
self.countSelectedTime = reserveDate && reserveDate.duration ? reserveDate.duration : 0 // self.countSelectedTime = reserveDate && reserveDate.duration ? reserveDate.duration : 0
if (self.typeId == 2) { // if (self.typeId == 2) {
self.countSelectedTime = 4 // self.countSelectedTime = 4
} // }
// 获取余额 // 获取余额
self._post( self._post(
@ -372,7 +387,6 @@
total: result.light_all_price total: result.light_all_price
} }
} }
console.log("🚀 ~ self.bill:", self.bill)
self.loadding = false; self.loadding = false;
} }
@ -401,58 +415,158 @@
// 去支付 // 去支付
toConfirm() { toConfirm() {
if (this._submitting) return;
this._submitting = true;
if (this.countSelectedTime === 0) { if (this.countSelectedTime === 0) {
uni.showToast({title: '请选择时间后再预定', icon: 'none'}); uni.showToast({title: '请选择时间后再预定', icon: 'none'});
this._submitting = false;
return; return;
} }
const finish = () => { this._submitting = false; };
if (this.payType == 'wxpay') {
// 包装原有回调,确保无论成功失败都解锁
const oldWxPay = this.wxPay;
this.wxPay = (...args) => {
oldWxPay.apply(this, args);
this.wxPay = oldWxPay;
};
oldWxPay.call(this);
setTimeout(finish, 3000); // 兜底3秒自动解锁
} else if (this.payType == 'balance') {
const oldBalancePay = this.balancePay;
this.balancePay = (...args) => {
oldBalancePay.apply(this, args);
this.balancePay = oldBalancePay;
};
oldBalancePay.call(this);
setTimeout(finish, 3000);
} else {
finish();
}
},
// 微信支付
wxPay() {
let self = this; let self = this;
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
}); });
self._post(
'order.groundOrder/submitStoreOrder', try {
{ self._post(
app_id: self.getAppId(), 'user.groundOrder/pay',
ground_id: self.venueId, {
room_id: self.roomId, app_id: self.getAppId(),
hours: 1, order_id: this.orderId
day_time: self.date ? self.date.date : '', },
start_time: self.date ? self.date.startTime : '', function(res) {
end_time: self.date ? self.date.endTime : '', const data = res.data
}, console.log("🚀 ~ pay data:", data)
function(res) { uni.requestPayment({
console.log("🚀 ~ order res:", res) provider: 'wxpay',
self._post( timeStamp: data.payment.timeStamp,
'user.groundOrder/pay', nonceStr: data.payment.nonceStr,
{ package: 'prepay_id=' + data.payment.prepay_id,
app_id: self.getAppId(), signType: 'MD5',
order_id: res.data.lists.id paySign: data.payment.paySign,
}, success: res => {
function(res) { self.result = 'success'
const data = res.data console.log("🚀 ~ pay success res:", res)
console.log("🚀 ~ pay data:", data) uni.showToast({
uni.requestPayment({ title: '支付成功',
provider: 'wxpay', icon: 'none'
timeStamp: data.payment.timeStamp, });
nonceStr: data.payment.nonceStr, self.loadding = false;
package: 'prepay_id=' + data.payment.prepay_id,
signType: 'MD5', setTimeout(() => {
paySign: data.payment.paySign, uni.navigateBack({delta: 1})
success: res => { }, 500);
console.log("🚀 ~ pay success res:", res) },
}, fail: res => {
fail: res => { console.log("🚀 ~ pay error res:", res)
console.log("🚀 ~ pay fail res:", res) self.result = 'fail'
uni.reLaunch({ self.loadding = false;
url: '/pages/order/cg-my-order',
}); uni.showToast({
}, title: '支付失败',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 500);
},
});
}
)
} catch (error) {
console.log("🚀 ~ pay error res:", res)
self.result = 'fail'
self.loadding = false;
uni.showToast({
title: '支付失败',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 500);
}
},
// 余额支付
balancePay() {
let self = this;
uni.showLoading({
title: '加载中'
});
try {
self._post(
'ground.ground/yuePay',
{
app_id: self.getAppId(),
order_id: this.orderId
},
function(res) {
if (res.code == 1) {
self.result = 'success'
uni.showToast({
title: '支付成功',
icon: 'none'
}); });
self.loadding = false;
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 500);
} else {
self.result = 'fail'
self.loadding = false;
uni.showToast({
title: '支付失败',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 500);
} }
) }
self.loadding = false; )
} } catch (error) {
) self.result = 'fail'
self.loadding = false;
uni.showToast({
title: '支付失败',
icon: 'none'
});
setTimeout(() => {
uni.navigateBack({delta: 1})
}, 500);
}
} }
} }
}; };

View File

@ -280,7 +280,6 @@ export default {
selectedWeekDay: '', selectedWeekDay: '',
selectedReserveTime: [], selectedReserveTime: [],
countSelectedTime: 0, countSelectedTime: 0,
submitting: false // 防止重复提交
}; };
}, },
@ -437,22 +436,14 @@ export default {
// 篮球场-立即预约 // 篮球场-立即预约
toReserve() { toReserve() {
let self = this let self = this
if (self.submitting) {
uni.showToast({
title: '正在提交,请勿重复操作',
icon: 'none'
});
return;
}
// 一进来就锁定,彻底防止高频点击 // 一进来就锁定,彻底防止高频点击
self.submitting = true;
if (self.typeId == 1) { if (self.typeId == 1) {
if (self.selectedReserveTime.length === 0) { if (self.selectedReserveTime.length === 0) {
uni.showToast({ uni.showToast({
title: '请选择预约时间', title: '请选择预约时间',
icon: 'none' icon: 'none'
}); });
self.submitting = false;
return; return;
} }
uni.showLoading({ uni.showLoading({
@ -467,11 +458,32 @@ export default {
app_id: self.getAppId(), app_id: self.getAppId(),
ground_id: self.id, ground_id: self.id,
room_list: JSON.stringify(self.selectedReserveTime), room_list: JSON.stringify(self.selectedReserveTime),
type: this.typeId
}, },
function(res) { function(res) {
self.loadding = false; self.loadding = false;
self.submitting = false;
if(res.code) { if(res.code) {
uni.$on('payment', params => {
console.log("🚀 ~ params:", params)
uni.showLoading({
title: '加载中',
mask: true,
});
setTimeout(() => {
self.loadding = false
uni.$off("payment")
if (params.result) {
uni.redirectTo({
url: `/bundle/reserve/notice?order_id=${params.order_id}`
})
} else {
uni.redirectTo({
url: '/pages/order/cg-my-order'
})
}
}, 500)
})
uni.navigateTo({ uni.navigateTo({
url: `/bundle/reserve/confirm?venueId=${self.venue.id}&roomId=${self.id}&typeId=${self.typeId}&orderId=${res.data.lists.id}` url: `/bundle/reserve/confirm?venueId=${self.venue.id}&roomId=${self.id}&typeId=${self.typeId}&orderId=${res.data.lists.id}`
}); });
@ -479,7 +491,6 @@ export default {
} }
) )
} catch (error) { } catch (error) {
self.submitting = false;
console.error('订单提交失败:', error); console.error('订单提交失败:', error);
uni.showToast({ uni.showToast({
title: '订单提交失败,请重试', title: '订单提交失败,请重试',
@ -493,13 +504,11 @@ export default {
title: '请选择预约时间', title: '请选择预约时间',
icon: 'none' icon: 'none'
}); });
self.submitting = false;
return; return;
} }
uni.navigateTo({ uni.navigateTo({
url: `/bundle/reserve/confirm?venueId=${self.venue.id}&roomId=${self.id}&typeId=${self.typeId}` url: `/bundle/reserve/confirm?venueId=${self.venue.id}&roomId=${self.id}&typeId=${self.typeId}`
}); });
self.submitting = false;
} }
}, },
@ -616,13 +625,23 @@ export default {
getReserveTime() { getReserveTime() {
let self = this; let self = this;
self._post( let params = {}
'ground.ground/getSchedule',
{ if (self.selectedWeekTimes) {
params = {
app_id: self.getAppId(), app_id: self.getAppId(),
ground_id: self.id, ground_id: self.id,
today: self.selectedWeekTimes today: self.selectedWeekTimes
}, }
} else {
params = {
app_id: self.getAppId(),
ground_id: self.id,
}
}
self._post(
'ground.ground/getSchedule',params,
function (res) { function (res) {
if (res.code) { if (res.code) {
self.cdList = res.data.lists1 self.cdList = res.data.lists1

View File

@ -9,8 +9,8 @@
</view> </view>
<view class="btn"> <view class="btn">
<view class="btn1">查看订单</view> <view class="btn1" @click="seeOrder">查看订单</view>
<view class="btn2">完成</view> <view class="btn2" @click="done">完成</view>
</view> </view>
</view> </view>
</template> </template>
@ -19,18 +19,30 @@
export default { export default {
data() { data() {
return { return {
order_id: 0
}; };
}, },
onLoad(args) { onLoad(args) {
this.getData(); this.order_id = args.order_id || 0;
}, },
methods: { methods: {
getData() { getData() {
}, },
seeOrder() {
uni.navigateTo({
url: '/pages/order/cg-my-order'
});
},
done() {
uni.reLaunch({
url: '/pages/index/index'
});
}
} }
}; };
</script> </script>

View File

@ -5,7 +5,7 @@
<view class="search-wrap2 d-b-c" style="margin-left: 30rpx;"> <view class="search-wrap2 d-b-c" style="margin-left: 30rpx;">
<view class="index-search t-c flex-1" style="border: none;background-color: #fff;border-radius: 36rpx;"> <view class="index-search t-c flex-1" style="border: none;background-color: #fff;border-radius: 36rpx;">
<span class="icon iconfont icon-sousuo"></span> <span class="icon iconfont icon-sousuo"></span>
<input type="text" v-model="form.keyWord" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f32 gray7" <input type="text" v-model="keyWord" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f32 gray7"
placeholder="搜索场馆订单" confirm-type="search" @confirm="search()"/> placeholder="搜索场馆订单" confirm-type="search" @confirm="search()"/>
</view> </view>
<!--<button class="btn ml10" @click="search()" type="default">搜索</button>--> <!--<button class="btn ml10" @click="search()" type="default">搜索</button>-->
@ -14,12 +14,17 @@
</navbar> </navbar>
<view class="top-tabbar"> <view class="top-tabbar">
<view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc(0)">全部订单</view> <view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc('all')">全部订单</view>
<view :class="state_active == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">待付款</view> <view :class="state_active == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">待付款</view>
<view :class="state_active == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">已预约</view> <view :class="state_active == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">已预约</view>
<view :class="state_active == 3 ? 'tab-item active' : 'tab-item'" @click="stateFunc(3)">已完成</view> <view :class="state_active == 3 ? 'tab-item active' : 'tab-item'" @click="stateFunc(3)">已完成</view>
<view :class="state_active == 4 ? 'tab-item active' : 'tab-item'" @click="stateFunc(4)">退订/退款</view> <view :class="state_active == 4 ? 'tab-item active' : 'tab-item'" @click="stateFunc(4)">退订/退款</view>
</view> </view>
<view class="d-f a-i-c ball-type-box">
<view class="ball" :class="ballType == 1 ? 'active' : ''" @click="changeBallType(1)">网球</view>
<view class="ball" :class="ballType == 2 ? 'active' : ''" @click="changeBallType(2)">篮球</view>
</view>
<!--列表--> <!--列表-->
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50" <scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
@scrolltolower="scrolltolowerFunc"> @scrolltolower="scrolltolowerFunc">
@ -31,19 +36,19 @@
<view class="order-head d-b-c"> <view class="order-head d-b-c">
<view class="d-f a-i-c"> <view class="d-f a-i-c">
<!-- <text class="state-text">{{ item.order_source_text }}</text> --> <!-- <text class="state-text">{{ item.order_source_text }}</text> -->
<text class="cg-name flex-1 fb">场馆名称</text> <text class="cg-name flex-1 fb" @click="toGround(item.ground_id)">{{ item.ground_name }}</text>
<image style="width: 48rpx;height: 48rpx;" src="@/static/icon/right.png" mode=""></image> <image style="width: 48rpx;height: 48rpx;" src="@/static/icon/right.png" mode=""></image>
</view> </view>
<view class="state cg-state"> <view class="state cg-state">
<text class="red">{{ item.state_text }}</text> <text class="red" v-if="item.order_status == 0">待付款</text>
<!-- <text style="color: #365A9A;">已预约</text> <text style="color: #365A9A;" v-if="item.order_status == 1">已预约</text>
<text style="color: #606266;">已完成</text> <text style="color: #606266;" v-if="item.order_status == 2">已完成</text>
<text style="color: #C9C9C9;">订单取消</text> <text style="color: #C9C9C9;" v-if="item.order_status == 3">订单取消</text>
<text style="color: #606266;">退款成功</text> --> <text style="color: #606266;" v-if="item.order_status == 4">退款成功</text>
</view> </view>
</view> </view>
<!--多个商品显示--> <!--多个商品显示-->
<view class="product-list pr" v-if="item.product.length > 1" @click="gotoOrder(item.order_id)"> <!-- <view class="product-list pr" v-if="item.product.length > 1" @click="gotoOrder(item.order_id)">
<scroll-view scroll-x="true"> <scroll-view scroll-x="true">
<view class="list d-s-c pr100"> <view class="list d-s-c pr100">
<view class="cover mr10" v-for="(img, num) in item.product" :key="num" style="width: 200rpx; height: 200rxpx;"> <view class="cover mr10" v-for="(img, num) in item.product" :key="num" style="width: 200rpx; height: 200rxpx;">
@ -59,16 +64,13 @@
</view> </view>
<view class="count">共{{ item.product.length }}件</view> <view class="count">共{{ item.product.length }}件</view>
</view> </view>
</view> </view> -->
<!--一个商品显示--> <!--一个商品显示-->
<view class="one-product d-s-c" v-else @click="gotoOrder(item.order_id)"> <view class="one-product d-s-c" @click="gotoOrder(item.order_id)">
<view class="cover" v-for="(img, num) in item.product" :key="num" style="width: 200rpx; height: 200rxpx;"> <image :src="item.image" mode="aspectFill" style="width: 200rpx; height: 200rpx; border-radius: 10rpx;"></image>
<image :src="img.image.file_path" mode="aspectFill" style="width: 200rpx; height: 200rxpx;"></image>
</view>
<view class="flex-1"> <view class="flex-1">
<view class="pro-info cg-info1">这个是场馆的分场名称</view> <view class="pro-info cg-info2">订单号:{{ item.order_sn }}</view>
<view class="pro-info cg-info2">预约时间03/18 08:00-12:00</view> <view class="pro-info cg-info3">活动日期:{{ item.trade[0].day_title }}</view>
<view class="pro-info cg-info3">预约时长2小时</view>
</view> </view>
<!-- <view class="total-count"> <!-- <view class="total-count">
@ -163,34 +165,17 @@
<view v-else class="count d-e-c ww100 redF11">取消申请中</view> <view v-else class="count d-e-c ww100 redF11">取消申请中</view>
</view> </view>
<view class="order-bts" v-else> <view class="order-bts" v-else>
<block v-if="item.order_status.value ==10"> <block>
<!-- 未支付取消订单 --> <!-- 未支付取消订单 -->
<button @click="showCancleOrderPopup(item.order_id)" class="theme-borderbtn cancel-btn" <button @click="showCancleOrderPopup(item.order_id)" class="theme-borderbtn cancel-btn"
v-if="item.pay_status.value == 10">取消订单</button> v-if="item.order_status == 0">取消订单</button>
<!-- 已支付取消订单 -->
<block v-if="item.pay_status.value == 20 && item.delivery_status.value == 10">
<button @click="cancelOrder(item.order_id)" class="theme-borderbtn pay-btn">申请取消</button>
</block>
<!-- 订单核销码 -->
<template
v-if="item.pay_status.value == 20 && item.delivery_type.value == 20 && item.delivery_status.value == 10">
<button v-if="item.order_source == 30 && item.assemble_status==20"
@click="onQRCode(item.order_id)" class="theme-borderbtn">核销码</button>
<button v-if="item.order_source != 30" @click="onQRCode(item.order_id)"
class="theme-borderbtn">核销码</button>
</template>
<!-- 订单付款 --> <!-- 订单付款 -->
<block v-if="item.pay_status.value == 10"><button class="theme-btn pay-btn" <block v-if="item.order_status == 0">
@click="onPayOrder(item.order_id)">去支付</button></block> <button class="theme-btn pay-btn" @click="onPayOrder(item.order_id)">去支付</button>
</block>
<!-- todo 缺了一个删除订单的功能,需要跟后端确认 --> <block v-if="item.order_status >= 2">
<!-- <block v-if="item.pay_status.value == 10"><button class="theme-btn del-btn" <button class="theme-btn del-btn" @click="onDelOrder(item.order_id)">删除订单</button>
@click="onDelOrder(item.order_id)">删除订单</button></block> -->
<!-- 确认收货 -->
<block v-if="item.delivery_status.value == 20 && item.receipt_status.value == 10">
<button class="theme-btn" @click="orderReceipt(item.order_id)">确认收货</button>
</block> </block>
</block> </block>
<text v-if="item.order_status.value == 21" class="count">取消申请中</text> <text v-if="item.order_status.value == 21" class="count">取消申请中</text>
@ -297,6 +282,9 @@
codeImg: '', codeImg: '',
cancelOrderPopup: false, cancelOrderPopup: false,
delOrderPopup: false, delOrderPopup: false,
orderStatus: '',
keyWord: '',
ballType: 1, // 1网球 2篮球
}; };
}, },
computed: { computed: {
@ -317,15 +305,20 @@
if (typeof e.dataType != 'undefined') { if (typeof e.dataType != 'undefined') {
this.dataType = e.dataType; this.dataType = e.dataType;
} }
if (this.dataType == 'payment') { if (this.dataType == 'all') {
this.state_active = 0;
} else if (this.dataType == 0) {
this.state_active = 1; this.state_active = 1;
} else if (this.dataType == 'received') { } else if (this.dataType == 1) {
this.state_active = 3;
} else if (this.dataType == 'comment') {
this.state_active = 4;
} else if (this.dataType == 'delivery') {
this.state_active = 2; this.state_active = 2;
} else if (this.dataType == 2) {
this.state_active = 3;
} else if (this.dataType == 4) {
this.state_active = 4;
} }
console.log("🚀 ~ this.dataType:", this.dataType)
console.log("🚀 ~ this.dataType:", this.state_active)
}, },
mounted() { mounted() {
this.init(); this.init();
@ -353,33 +346,45 @@
}); });
}, },
// 切换球类
changeBallType(type) {
let self = this;
self.ballType = type;
self.listData = [];
self.getData();
},
/*状态切换*/ /*状态切换*/
stateFunc(e) { stateFunc(e) {
console.log("🚀 ~ e:", e)
let self = this; let self = this;
console.log("🚀 ~ state_active:", self.state_active)
if (self.state_active != e) { if (self.state_active != e) {
self.page = 1; self.page = 1;
self.loading = true; self.loading = true;
self.state_active = e; self.state_active = e;
switch (e) { switch (e) {
case 0: case 'all':
self.listData = []; self.listData = [];
self.dataType = 'all'; self.dataType = 'all';
break; break;
case 1: case 1:
self.listData = []; self.listData = [];
self.dataType = 'payment'; self.dataType = 0;
break; break;
case 2: case 2:
self.listData = []; self.listData = [];
self.dataType = 'reserve'; self.dataType = 1;
break; break;
case 3: case 3:
self.listData = []; self.listData = [];
self.dataType = 'completed'; self.dataType = 2;
break; break;
case 4: case 4:
self.listData = []; self.listData = [];
self.dataType = 'comment'; self.dataType = 4;
break; break;
} }
self.getData(); self.getData();
@ -402,20 +407,47 @@
/*获取数据*/ /*获取数据*/
getData() { getData() {
// let self = this;
// self.loading = true;
// let dataType = self.dataType;
// self._get(
// 'user.order/lists', {
// dataType: dataType,
// page: self.page,
// list_rows: self.list_rows
// },
// function(res) {
// self.loading = false;
// self.listData = self.listData.concat(res.data.list.data);
// self.last_page = res.data.list.last_page;
// if (res.data.list.last_page <= 1) {
// self.no_more = true;
// } else {
// self.no_more = false;
// }
// }
// );
let self = this; let self = this;
self.loading = true; self.loading = true;
let dataType = self.dataType; let dataType = self.dataType;
self._get( if (dataType == 'all') {
'user.order/lists', { dataType = '';
dataType: dataType, }
self._post(
'order.groundOrder/orderGroundList', {
order_status: dataType,
search: self.keyWord,
page: self.page, page: self.page,
list_rows: self.list_rows size: self.list_rows,
app_id: self.getAppId(),
type: self.ballType
}, },
function(res) { function(res) {
self.loading = false; self.loading = false;
self.listData = self.listData.concat(res.data.list.data); self.listData = self.listData.concat(res.data.lists.data);
self.last_page = res.data.list.last_page; console.log("🚀 ~ self.listData:", self.listData)
if (res.data.list.last_page <= 1) { self.last_page = res.data.lists.last_page;
if (res.data.lists.last_page <= 1) {
self.no_more = true; self.no_more = true;
} else { } else {
self.no_more = false; self.no_more = false;
@ -627,6 +659,13 @@
duration: 2000, duration: 2000,
icon: 'none' icon: 'none'
}); });
},
// 跳转场馆
toGround(ground_id) {
uni.navigateTo({
url: `/bundle/reserve/details?id=${id}&typeId=${this.ballType}`
});
} }
} }
}; };
@ -692,4 +731,27 @@
} }
} }
.ball-type-box {
margin-left: 40rpx;
margin-bottom: 24rpx;
.ball {
width: 108rpx;
height: 52rpx;
text-align: center;
line-height: 52rpx;
background: #FFFFFF;
border-radius: 8rpx;
font-size: 26rpx;
color: #606266;
margin-right: 10rpx;
}
.ball.active {
background: #365A9A;
color: #FFFFFF;
}
}
</style> </style>

View File

@ -139,7 +139,7 @@ page {
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
margin-left: 20rpx; margin-left: 20rpx;
font-size: 32rpx; font-size: 28rpx;
border: 1px solid #F6220C; border: 1px solid #F6220C;
border-radius: 8px; border-radius: 8px;
background: #ffffff; background: #ffffff;
@ -238,7 +238,7 @@ page {
} }
.cg-info2 { .cg-info2 {
margin-top: 34rpx; white-space: nowrap;
font-weight: 400; font-weight: 400;
font-size: 26rpx; font-size: 26rpx;
color: #606266; color: #606266;

View File

@ -58,7 +58,7 @@
class="icon iconfont icon-jiantou"></text></view> class="icon iconfont icon-jiantou"></text></view>
</view> </view>
<view class="d-b-c w100"> <view class="d-b-c w100">
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=payment')"> <view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=0')">
<view class="icon-box pr"> <view class="icon-box pr">
<image src="/static/icon/dfk.png" mode=""></image> <image src="/static/icon/dfk.png" mode=""></image>
<text class="dot d-c-c" <text class="dot d-c-c"
@ -66,7 +66,7 @@
</view> </view>
<text>待付款</text> <text>待付款</text>
</view> </view>
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=reserve')"> <view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=1')">
<view class="icon-box pr"> <view class="icon-box pr">
<image src="/static/icon/yyy.png" mode=""></image> <image src="/static/icon/yyy.png" mode=""></image>
<text class="dot d-c-c" <text class="dot d-c-c"
@ -74,7 +74,7 @@
</view> </view>
<text class="">已预约</text> <text class="">已预约</text>
</view> </view>
<view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=completed')"> <view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=2')">
<view class="icon-box pr"> <view class="icon-box pr">
<image src="/static/icon/ywc.png" mode=""></image> <image src="/static/icon/ywc.png" mode=""></image>
<text class="dot d-c-c" <text class="dot d-c-c"
@ -82,7 +82,7 @@
</view> </view>
<text>已完成</text> <text>已完成</text>
</view> </view>
<view class="item" @click="jumpPage('/pages/order/refund/index/index')"> <view class="item" @click="jumpPage('/pages/order/cg-my-order?dataType=4')">
<view class="icon-box pr"> <view class="icon-box pr">
<image src="/static/icon/tk.png" mode=""></image> <image src="/static/icon/tk.png" mode=""></image>
<text class="dot d-c-c" <text class="dot d-c-c"