martial-arts/pagesA/my-order/my-order.vue

106 lines
4.0 KiB
Vue
Raw Normal View History

2022-08-03 13:28:45 +00:00
<template>
<view>
<status-container titlet="我的订单" returnc="#FFFFFF">
<view slot="content" style="margin-top: -20rpx;">
<view class="posi-sticky" :style="{top:newtop+'px'}">
<swiper-tab id="tab" :list="dataList" v-model="current" @changeEv="clickTab" :itemColor="'#e42417'" :lineColor="'#e42417'"></swiper-tab>
</view>
2022-08-04 08:01:19 +00:00
<view class="bacf mar-s20 pad-x20">
2022-08-10 10:18:06 +00:00
<view @tap="$toolAll.tools.goPage(`/pagesB/order-detail/order-detail?id=${0}`)" class="bbot disac pad30 col26" v-for="(item,index) in orderList" :key="index">
<image class="flexs mar-y20" :src="item.skus[0].spu_cover" style="width: 192rpx;height: 134rpx;" mode="aspectFill" lazy-load></image>
2022-08-04 08:01:19 +00:00
<view class="fon24 width100 disjbac fc" style="height: 134rpx;">
<view class="dis width100">
2022-08-10 10:18:06 +00:00
<view class="clips2 width100">{{item.skus[0].spu_name}}</view>
<view class="mar-z50">x{{item.skus[0].num}}</view>
2022-08-04 08:01:19 +00:00
</view>
<view class="disjbac width100">
2022-08-10 10:18:06 +00:00
<view class="">实付{{item.skus[0].price}}</view>
<view v-if="item.status=='paid'" @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" style="background-color:#f37717;border: 2rpx solid #f37717;color: #FFFFFF;width: 134rpx;height: 50rpx;"></view>
<!-- <view @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" :style="{backgroundColor:['#FFFFF','#f37717','#FFFFF'][index],color:['#f37717','#FFFFFF','#969696'][index],borderColor:['#f37717','#f37717','#c9c9c9'][index]}" style="border: 2rpx solid #f37717;color: #f37717;width: 134rpx;height: 50rpx;">{{['确认收货','去付款','查看物流'][index]}}</view>
<view @tap.stop="clickBtn(index)" class="fon22 radius26 disjcac" :style="{backgroundColor:['#FFFFF','#f37717','#FFFFF'][index],color:['#f37717','#FFFFFF','#969696'][index],borderColor:['#f37717','#f37717','#c9c9c9'][index]}" style="border: 2rpx solid #f37717;color: #f37717;width: 134rpx;height: 50rpx;">{{['确认收货','去付款','查看物流'][index]}}</view> -->
2022-08-04 08:01:19 +00:00
</view>
</view>
</view>
</view>
2022-08-10 10:18:06 +00:00
<view class="pad-zy20" v-if="noMore">
2022-08-03 13:28:45 +00:00
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
</view>
</view>
</status-container>
2022-08-04 08:01:19 +00:00
<dynamic-frame ref="refFrame" :showType="showType" :tipsTitle="tipsTitle"></dynamic-frame>
2022-08-03 13:28:45 +00:00
</view>
</template>
<script>
import swiperTab from '@/components/swiper-tab/swiper-tab.vue';
import pitera from '@/components/nothing/pitera.vue';
2022-08-04 08:01:19 +00:00
import dynamicFrame from '@/components/dynamic-frame.vue';
2022-08-03 13:28:45 +00:00
export default {
2022-08-04 08:01:19 +00:00
components:{swiperTab,pitera,dynamicFrame},
2022-08-03 13:28:45 +00:00
data() {
return {
newtop:uni.getSystemInfoSync().statusBarHeight + 42,
// newtop:uni.getSystemInfoSync().statusBarHeight + (140 / 750 * uni.getSystemInfoSync().windowWidth),
current:0,
dataList:[
{title:'全部'},
{title:'待付款'},
{title:'待收货'},
{title:'已完成'},
],
2022-08-04 08:01:19 +00:00
showType:-1,
tipsTitle:'提示信息',
dynamicText:{
content:''
2022-08-10 10:18:06 +00:00
},
page:1,
size:20,
total:0,
noMore:false,
orderList:[]
2022-08-03 13:28:45 +00:00
}
},
onLoad() {
2022-08-10 10:18:06 +00:00
this.getOrderList();
},
onReachBottom() {
if(this.total!=this.orderList.length){
this.page++;
this.getOrderList();
}
2022-08-03 13:28:45 +00:00
},
methods: {
// tab点击事件
clickTab(index){
this.current = index;
2022-08-04 08:01:19 +00:00
},
// 按钮点击
clickBtn(index){
this.tipsTitle = index==2?'物流信息':'提示信息';
this.showType = [2,3,1][index];
this.$refs.refFrame.ifLogistics = true;
this.$refs.refFrame.ifAnimated = true;
2022-08-10 10:18:06 +00:00
},
// 获取我的订单列表
getOrderList(){
let params = {
page:this.page,
size:this.size
}
if(this.page==1) this.orderList = [];
this.$requst.get('/api/user/order',params).then(res=>{
if(res.code==0){
this.total = res.data.total;
this.orderList = [...this.orderList,...res.data.list];
if(this.total==this.orderList.length && this.page!=1){
this.noMore = true;
}
}
})
2022-08-03 13:28:45 +00:00
}
}
}
</script>
<style></style>