Commit fab3a01b by 高淑倩

add: 我的订单_全部

parent 2f72d947
......@@ -50,7 +50,8 @@ wxService.page({
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}, {
listUrl: "https://hwimagecdn.ihotwind.cn//544/201906/1b41a9a3247d42c89e0c461e2faaf6c1_512_512.jpg"
}]
}],
trade: '' // 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
},
/**
......@@ -64,25 +65,25 @@ wxService.page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.initOrderList(this.data.pageNo, this.data.pageSize)
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
},
initOrderList(pageNo, pageSize) {
initOrderList(pageNo, pageSize,trade) {
if (this.data.noMoreFlag) { // 没有更多数据了,不调用接口
return false
}
wx.showLoading({
title: '加载中',
mask: true
})
wxService.post(`/sale/order/list?pageNo=${pageNo}&pageSize=${pageSize}`).then(res => {
const params = {trade}
wxService.post(`/sale/trade/buyer/history?pageNum=${pageNo}&pageSize=${pageSize}`, params).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
wx.hideLoading()
this.setData({
orderList: this.data.pageNo == 1 ? [...data.content] : [...this.data.orderList, ...data.content],
totalPages: data.totalPages
orderList: this.data.pageNo == 1 ? [...data] : [...this.data.orderList, ...data],
noMoreFlag: data.length < pageSize ? true : false
})
}
}
......@@ -107,17 +108,11 @@ wxService.page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
if (this.data.pageNo < this.data.totalPages) {
this.setData({
pageNo: this.data.pageNo + 1,
}, () => {
this.initOrderList(this.data.pageNo, this.data.pageSize)
})
} else {
this.setData({
noMoreFlag: true
this.initOrderList(this.data.pageNo, this.data.pageSize,this.data.trade)
})
}
},
/**
......
......@@ -22,26 +22,26 @@
<view class="order-header">
<view class="order-number">
<text>订单号</text>
<text class="number">{{item.orderNo}}</text>
<text class="number">{{item.id}}</text>
</view>
<text class="order-status">待付款</text>
</view>
<view class="pro-list">
<scroll-view scroll-x="true">
<view class="uploadWrap" scroll-x="true">
<block wx:for='{{subImgs}}' wx:for-item="sub" wx:key="s" >
<block wx:for='{{item.skuVOList}}' wx:for-item="sub" wx:key="s" >
<view class="upload_Item">
<image class="upload_Item_img" src="{{sub.listUrl}}" bindtap='goProDetail' data-id='{{sub.goodsId}}'></image>
<image class="upload_Item_img" src="{{sub.mainImgUrl}}" bindtap='goProDetail' data-id='{{sub.goodsId}}'></image>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="pro-number">
<text class="total-pro">共5件商品</text>
<text class="total-pro">共{{item.skuCount}}件商品</text>
<view class="total-price">
实付
<text class="price">¥{{item.realPayMoney/100}}</text>
<text class="price">¥{{item.payAmount}}</text>
</view>
</view>
<view class="btn-group">
......
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