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

Loading…
Cancel
Save