订单列表页面

This commit is contained in:
wans 2020-07-09 13:45:12 +08:00
parent 22e26ccbc5
commit af044d1e4e
5 changed files with 65 additions and 24 deletions

View File

@ -54,6 +54,9 @@ Page({
venuesProjectId : self.data.selectVenuesProject,
bookingItemList : self.data.mySelectItem
}
wx.showLoading({
title: '请稍等',
});
app.restAjax.post(app.restAjax.path('{venueUrl}/app/booking/savebookinginfo',[app.venueUrl]), param, {headers : {token:self.data.token}}, function(code,data){
if(code == 200){
wx.showToast({
@ -67,6 +70,8 @@ Page({
}
},function(code,data){
app.dialog.msg(data.msg);
},function(){
wx.hideLoading();
});
},
@ -283,7 +288,6 @@ Page({
if(!self.checkPhoneNumber()){
return false;
}
console.log('go');
app.restAjax.get(app.restAjax.path('{venueUrl}/api/sms/getverificationcode/' + self.data.phoneNumber, [app.venueUrl]), {}, null,
function (code, data) {
if (code == 200) {
@ -309,7 +313,6 @@ Page({
}
},
function (code, data) {
console.log(data)
wx.showToast({
title: data.msg,
icon: 'none',

View File

@ -104,6 +104,14 @@ Page({
},
})
},
/**
* 跳转到我的预订列表
*/
toMyOrder: function() {
wx.navigateTo({
url: '../order/order',
})
},
/**
* 跳转到我的志愿团队页面
*/

View File

@ -11,6 +11,10 @@
<view class="main">
<view class="main-title">常用功能</view>
<view class="main-container">
<view class="main-box" bindtap="toMyOrder">
<image src="../../images/my-sign.png"></image>
<view class="title">我的预订</view>
</view>
<view class="main-box">
<image src="../../images/my-sign.png"></image>
<view class="title">我的报名</view>

View File

@ -1,3 +1,4 @@
var app = getApp();
// pages/order/order.js
Page({
@ -5,14 +6,52 @@ Page({
* 页面的初始数据
*/
data: {
venueUrl : app.venueUrl,
imgRoute : '/route/file/downloadfile/true/',
token: '',
orderList:[],
page: 1,
rows: 10,
total: 0
},
//查询订单列表
listOrderList: function() {
var self = this;
app.dialog.loading('请稍等');
app.restAjax.get(app.restAjax.path('{venueUrl}/app/booking/listpagemyticket', [app.venueUrl]),
{page: self.data.page,rows: self.data.rows}, {headers:{token : self.data.token}},
function (code, data) {
data.rows.forEach(element => {
element.venuePanorama = element.venuePanorama.split(',')[0]
});
self.setData({
orderList: data.rows,
page: data.page,
total: data.total
});
console.log(self.data.orderList);
},
function (code, data) {
app.dialog.msg(data.msg);
},function(){
wx.hideLoading();
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.getStorage({
key: 'token',
success: (result) => {
this.setData({
token : result.data
})
this.listOrderList();
}
})
},
/**

View File

@ -1,30 +1,17 @@
<view class="order">
<view class="order-box">
<view class="order-box" wx:for="{{orderList}}" wx:key="inedx">
<view class="order-img">
<image src="../../images/center-bg.png"></image>
<image src="{{venueUrl}}{{imgRoute}}{{item.venuePanorama}}"></image>
</view>
<view class="order-info">
<view class="venue-project">
<view class="venue">场馆场馆场馆场馆</view>
<view class="project">篮球</view>
<view class="venue">{{item.venuesName}}</view>
<view class="project">{{item.projectName}}</view>
</view>
<view class="order-text">订单编号01010101</view>
<view class="order-text">下单时间2020-01-01</view>
<view class="price">¥15元</view>
</view>
</view>
<view class="order-box">
<view class="order-img">
<image src="../../images/center-bg.png"></image>
</view>
<view class="order-info">
<view class="venue-project">
<view class="venue">场馆场馆场馆场馆</view>
<view class="project">篮球</view>
</view>
<view class="order-text">订单编号01010101</view>
<view class="order-text">下单时间2020-01-01</view>
<view class="price">¥15元</view>
<view class="order-text">订单编号:{{item.serial}}</view>
<view class="order-text">下单时间:{{item.gmtCreate}}</view>
<view class="price" wx:if="{{item.price == '0' || item.price == ''}}">¥15元</view>
<view class="price" wx:else>¥{{item.price}}元</view>
</view>
</view>
</view>