wangfukang 3 weeks ago
parent
commit
8fca414749
  1. 54
      package1/order/orderList.vue

54
package1/order/orderList.vue

@ -66,7 +66,7 @@
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="box1"> <view class="box1" v-for="(item,index) in orderList" :key="index">
<view class="ziqu-xuanfu" style="background:red"> <view class="ziqu-xuanfu" style="background:red">
待支付 待支付
</view> </view>
@ -175,7 +175,7 @@
</view> --> </view> -->
</view> </view>
</view> </view>
<uni-load-more :status="loadStatus" /> <uni-load-more :status="loadStatus" @change="onChange" />
</view> </view>
</view> </view>
</template> </template>
@ -187,22 +187,26 @@
loadStatus: 'more', loadStatus: 'more',
tab1Checked: 'quanbu', tab1Checked: 'quanbu',
tab2Checked: 'quanbu', tab2Checked: 'quanbu',
userId:uni.getStorageSync('id'),
userId:JSON.parse(uni.getStorageSync('area')).id,
loadStatus: 'more',
totalPages: 1, totalPages: 1,
pageNum:1,
orderList:[],
searchForm:{
pageNum:1,
pageSize:10,
userId:uni.getStorageSync('id'),
regionId:JSON.parse(uni.getStorageSync('area')).id
},
menuButtonInfo: {} menuButtonInfo: {}
} }
}, },
onReachBottom() { onReachBottom() {
if (this.searchForm.pageNumber >= this.totalPages) return; if (this.searchForm.pageNum >= this.totalPages) return;
// this.status = 'loading'; // this.status = 'loading';
this.searchForm.pageNumber++; this.searchForm.pageNum++;
this.getShopList(); this.getOrderList();
}, },
onLoad(option) { onLoad(option) {
this.getOrderList()
}, },
onShow() { onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
@ -215,24 +219,24 @@
this.tab2Checked = type this.tab2Checked = type
}, },
getOrderList(){ getOrderList(){
this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => { this.loadStatus = 'loading'
uni.hideLoading(); let that = this
if (res.success && res.result) { that.tui.request("/mall/order/page", "POST", this.searchForm, false, false).then((res) => {
let orderId = res.result.id; that.loadStatus = 'nomore';
let totalAmount = res.result.totalAmount; if (res.code == 200) {
this.backendTotalAmount = totalAmount; if (that.searchForm.pageNum == 1) {
this.currentOrderId = orderId; that.orderList = res.result.records;
this.createdOrderInfo = res.result; } else {
this.$refs.payPopup.open('bottom'); that.orderList = [...that.orderList, ...res.result.records]
}
that.totalPages = res.result.pages; // pages =
that.$forceUpdate();
} else { } else {
uni.showToast({ that.tui.toast(res.message);
title: res.message || '下单失败', return;
icon: 'none'
});
} }
}).catch(err => {
uni.hideLoading(); uni.hideLoading();
}); }).catch((res) => {});
}, },
back() { back() {
uni.navigateBack() uni.navigateBack()

Loading…
Cancel
Save