@@ -1,49 +1,65 @@ | |||
let Http = require('../../utils/http.js') | |||
let app = getApp() | |||
Page({ | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
data: { | |||
tabs: [{ | |||
key: 0, | |||
name: "待付款" | |||
}, | |||
{ | |||
key: 1, | |||
name: "已支付" | |||
}, | |||
{ | |||
key: 2, | |||
name: "已取消" | |||
} | |||
], | |||
list:[], | |||
current:'', | |||
current_scroll:'1' | |||
}, | |||
onLoad() { | |||
}, | |||
getList(key){ | |||
Http.getResquest('/api/order/list', app.globalData.token, '加载中', { | |||
pageNum: 1, | |||
pageSize: 10, | |||
orderStatus: key | |||
}, (res) => { | |||
this.setData({ | |||
list: res.data.list | |||
}) | |||
console.log(res) | |||
}) | |||
}, | |||
handleChange({detail}) { | |||
this.setData({ | |||
current: detail.key | |||
}); | |||
}, | |||
handleChangeScroll({detail}) { | |||
this.getList(detail.key) | |||
this.setData({ | |||
current_scroll: detail.key | |||
}); | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -1,8 +1,6 @@ | |||
{ | |||
"usingComponents": { | |||
"i-tab": "../../dist/tab/index", | |||
"i-tabs": "../../dist/tabs/index", | |||
"c-coupons": "../../components/coupons/index" | |||
}, | |||
"navigationBarTitleText": "我的订单" | |||
"navigationBarTitleText": "商场列表" | |||
} |
@@ -1,31 +1,3 @@ | |||
<view class="market"> | |||
<i-tabs class='tabs' current="{{ current_scroll }}" scroll bindchange="handleChangeScroll"> | |||
<i-tab class='i-tab' wx:for="{{tabs}}" wx:key="unique" key="{{item.key}}" title="{{item.name}}"></i-tab> | |||
</i-tabs> | |||
<view class='section' wx:for='{{list}}' wx:key='{{index}}'> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
<image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image> | |||
</view> | |||
<view class='info'> | |||
<view> | |||
<text>{{item.detail}}</text> | |||
<text>等待付款</text> | |||
</view> | |||
<view> | |||
<text>购买数量:</text>{{item.tenantId}}件</view> | |||
<view> | |||
<text>下单时间:</text>2018-07-10 11:30</view> | |||
</view> | |||
</view> | |||
<view class='payment'> | |||
<view> | |||
<text>¥{{item.payment}}.00</text> | |||
<text>¥{{item.paymentType}}.00</text> | |||
</view> | |||
<view> | |||
<text>支付</text> | |||
</view> | |||
</view> | |||
</view> | |||
商场列表 | |||
</view> |
@@ -1,114 +0,0 @@ | |||
.market { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.tabs { | |||
width: 100% !important; | |||
height: 88rpx; | |||
text-align: center; | |||
} | |||
.i-tab { | |||
width: 30% !important; | |||
display: inline-block; | |||
} | |||
.section { | |||
margin-top: 2%; | |||
} | |||
.detail_msg { | |||
width: 92%; | |||
height: 220rpx !important; | |||
background: #fff; | |||
display: flex; | |||
margin: 0 4%; | |||
margin-top: 2%; | |||
border-bottom: 1px solid #ededed; | |||
} | |||
.logo { | |||
width: 248rpx; | |||
height: 184rpx; | |||
border-radius: 30rpx; | |||
} | |||
.logo image { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.info view:nth-child(1) { | |||
display: flex; | |||
justify-content: space-between; | |||
padding: 0 4%; | |||
} | |||
.info { | |||
width: 100%; | |||
} | |||
.info view:nth-child(1) { | |||
margin-bottom: 72rpx; | |||
} | |||
.info view:nth-child(1) text { | |||
font-size: 30rpx; | |||
} | |||
.info view:nth-child(1) text:nth-child(2) { | |||
color: #ffae00; | |||
font-size: 24rpx; | |||
} | |||
.info view:nth-child(2), .info view:nth-child(3) { | |||
color: #ff3434; | |||
font-size: 24rpx; | |||
padding-left: 4%; | |||
} | |||
.info view:nth-child(2) text, .info view:nth-child(3) text { | |||
font-size: 22rpx; | |||
color: #b8b8b8; | |||
} | |||
.info view:nth-child(3) { | |||
margin-top: 5rpx; | |||
} | |||
.payment { | |||
width: 92%; | |||
height: 120rpx; | |||
line-height: 120rpx; | |||
padding: 0 4%; | |||
display: flex; | |||
justify-content: space-between; | |||
border-bottom: 20rpx solid #EDEDED; | |||
} | |||
.payment view:nth-child(1) text:nth-child(1) { | |||
font-size: 36rpx; | |||
color: #ff3434; | |||
font-weight: bold; | |||
} | |||
.payment view:nth-child(1) text:nth-child(2) { | |||
font-size: 24rpx; | |||
color: #b4b4b4; | |||
padding-left: 18rpx; | |||
text-decoration: line-through; | |||
} | |||
.payment view:nth-child(2) { | |||
width: 114rpx; | |||
height: 50rpx; | |||
background: #00c0ff; | |||
border-radius: 10px; | |||
line-height: 38rpx; | |||
text-align: center; | |||
margin-top: 40rpx; | |||
} | |||
.payment view:nth-child(2) text { | |||
font-size: 28rpx; | |||
color: #fff; | |||
} |
@@ -1,65 +1,52 @@ | |||
Page({ | |||
let Http = require('../../../utils/http.js') | |||
let app = getApp() | |||
/** | |||
* 页面的初始数据 | |||
*/ | |||
Page({ | |||
data: { | |||
tabs: [{ | |||
key: 0, | |||
name: "全部" | |||
}, | |||
{ | |||
key: 1, | |||
name: "待付款" | |||
}, | |||
{ | |||
key: 2, | |||
name: "已完成" | |||
} | |||
], | |||
list: [], | |||
current: '', | |||
current_scroll: '1' | |||
}, | |||
onLoad(e) { | |||
this.getList(e.id) | |||
this.setData({ | |||
current_scroll: e.id | |||
}); | |||
}, | |||
getList(key) { | |||
Http.getResquest('/api/order/list', app.globalData.token, '加载中', { | |||
pageNum: 1, | |||
pageSize: 10, | |||
orderStatus: key | |||
}, (res) => { | |||
this.setData({ | |||
list: res.data.list | |||
}) | |||
console.log(res) | |||
}) | |||
}, | |||
handleChange({ detail }) { | |||
this.setData({ | |||
current: detail.key | |||
}); | |||
}, | |||
handleChangeScroll({ detail }) { | |||
this.getList(detail.key) | |||
this.setData({ | |||
current_scroll: detail.key | |||
}); | |||
}, | |||
/** | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面初次渲染完成 | |||
*/ | |||
onReady: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面显示 | |||
*/ | |||
onShow: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面隐藏 | |||
*/ | |||
onHide: function () { | |||
}, | |||
/** | |||
* 生命周期函数--监听页面卸载 | |||
*/ | |||
onUnload: function () { | |||
}, | |||
/** | |||
* 页面相关事件处理函数--监听用户下拉动作 | |||
*/ | |||
onPullDownRefresh: function () { | |||
}, | |||
/** | |||
* 页面上拉触底事件的处理函数 | |||
*/ | |||
onReachBottom: function () { | |||
}, | |||
/** | |||
* 用户点击右上角分享 | |||
*/ | |||
onShareAppMessage: function () { | |||
} | |||
}) |
@@ -1,6 +1,7 @@ | |||
{ | |||
"usingComponents": { | |||
}, | |||
"navigationBarTitleText": "订单" | |||
} | |||
"usingComponents": { | |||
"i-tab": "../../../dist/tab/index", | |||
"i-tabs": "../../../dist/tabs/index" | |||
}, | |||
"navigationBarTitleText": "我的订单" | |||
} |
@@ -1 +1,31 @@ | |||
<text>pages/t/index.wxml</text> | |||
<view class="market"> | |||
<i-tabs class='tabs' current="{{ current_scroll }}" scroll bindchange="handleChangeScroll"> | |||
<i-tab class='i-tab' wx:for="{{tabs}}" wx:key="unique" key="{{item.key}}" title="{{item.name}}"></i-tab> | |||
</i-tabs> | |||
<view class='section' wx:for='{{list}}' wx:key='{{index}}'> | |||
<view class='detail_msg'> | |||
<view class='logo'> | |||
<image src='http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg'></image> | |||
</view> | |||
<view class='info'> | |||
<view> | |||
<text>{{item.detail}}</text> | |||
<text>等待付款</text> | |||
</view> | |||
<view> | |||
<text>购买数量:</text>{{item.tenantId}}件</view> | |||
<view> | |||
<text>下单时间:</text>2018-07-10 11:30</view> | |||
</view> | |||
</view> | |||
<view class='payment'> | |||
<view> | |||
<text>¥{{item.payment}}.00</text> | |||
<text>¥{{item.paymentType}}.00</text> | |||
</view> | |||
<view> | |||
<text>支付</text> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,114 @@ | |||
.market { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.tabs { | |||
width: 100% !important; | |||
height: 88rpx; | |||
text-align: center; | |||
} | |||
.i-tab { | |||
width: 30% !important; | |||
display: inline-block; | |||
} | |||
.section { | |||
margin-top: 2%; | |||
} | |||
.detail_msg { | |||
width: 92%; | |||
height: 220rpx !important; | |||
background: #fff; | |||
display: flex; | |||
margin: 0 4%; | |||
margin-top: 2%; | |||
border-bottom: 1px solid #ededed; | |||
} | |||
.logo { | |||
width: 248rpx; | |||
height: 184rpx; | |||
border-radius: 30rpx; | |||
} | |||
.logo image { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.info view:nth-child(1) { | |||
display: flex; | |||
justify-content: space-between; | |||
padding: 0 4%; | |||
} | |||
.info { | |||
width: 100%; | |||
} | |||
.info view:nth-child(1) { | |||
margin-bottom: 72rpx; | |||
} | |||
.info view:nth-child(1) text { | |||
font-size: 30rpx; | |||
} | |||
.info view:nth-child(1) text:nth-child(2) { | |||
color: #ffae00; | |||
font-size: 24rpx; | |||
} | |||
.info view:nth-child(2), .info view:nth-child(3) { | |||
color: #ff3434; | |||
font-size: 24rpx; | |||
padding-left: 4%; | |||
} | |||
.info view:nth-child(2) text, .info view:nth-child(3) text { | |||
font-size: 22rpx; | |||
color: #b8b8b8; | |||
} | |||
.info view:nth-child(3) { | |||
margin-top: 5rpx; | |||
} | |||
.payment { | |||
width: 92%; | |||
height: 120rpx; | |||
line-height: 120rpx; | |||
padding: 0 4%; | |||
display: flex; | |||
justify-content: space-between; | |||
border-bottom: 20rpx solid #EDEDED; | |||
} | |||
.payment view:nth-child(1) text:nth-child(1) { | |||
font-size: 36rpx; | |||
color: #ff3434; | |||
font-weight: bold; | |||
} | |||
.payment view:nth-child(1) text:nth-child(2) { | |||
font-size: 24rpx; | |||
color: #b4b4b4; | |||
padding-left: 18rpx; | |||
text-decoration: line-through; | |||
} | |||
.payment view:nth-child(2) { | |||
width: 114rpx; | |||
height: 50rpx; | |||
background: #00c0ff; | |||
border-radius: 10px; | |||
line-height: 38rpx; | |||
text-align: center; | |||
margin-top: 40rpx; | |||
} | |||
.payment view:nth-child(2) text { | |||
font-size: 28rpx; | |||
color: #fff; | |||
} |