|
|
|
@ -2,8 +2,8 @@ |
|
|
|
<view> |
|
|
|
<lf-nav :spreadOut="true" :showIcon="true" bgColor="white" title="在线商城订单" @changeHeight="e => nav_height = e"></lf-nav> |
|
|
|
<view class="lf-row-between lf-bg-white" style="padding: 0 32rpx;"> |
|
|
|
<view class="online-tab" :class="online_tab==0?'online-active':''" @click="online_tab = 0">线上订单</view> |
|
|
|
<view class="online-tab" :class="online_tab==1?'online-active':''" @click="online_tab = 1">线下订单</view> |
|
|
|
<view class="online-tab" :class="online_tab==0?'online-active':''" @click="changeTab(0)">线上订单</view> |
|
|
|
<view class="online-tab" :class="online_tab==1?'online-active':''" @click="changeTab(1)">线下订单</view> |
|
|
|
</view> |
|
|
|
<view v-if="online_tab == 0"> |
|
|
|
<view class="special_tab"> |
|
|
|
@ -18,29 +18,29 @@ |
|
|
|
<swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex"> |
|
|
|
<scroll-view :style="{height: autoHeight}" class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="tabItem.isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
|
|
|
|
|
<view v-for="(item2,index2) of tabItem.list" :key="index2" class="online-card" @click="$url('/pages/order/newdetail/newdetail')"> |
|
|
|
<view v-for="(item2,index2) of tabItem.list" :key="index2" class="online-card" @click="$url('/pages/order/newdetail/newdetail?order_id='+item2.order_no)"> |
|
|
|
<view class="lf-font-24 lf-color-777"> |
|
|
|
订单编号783974398749328 |
|
|
|
订单编号{{item2.order_no}} |
|
|
|
</view> |
|
|
|
<view class="lf-m-t-30"> |
|
|
|
<text class="lf-iconfont icon-Group- lf-font-28"></text> |
|
|
|
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">精品超市</text> |
|
|
|
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">{{item2.from}}</text> |
|
|
|
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text> |
|
|
|
</view> |
|
|
|
<view v-for="i of 5"> |
|
|
|
<view v-for="(i,index3) of item2.items" :key="index3"> |
|
|
|
<view class="lf-m-t-30" style="display: flex;"> |
|
|
|
<image class="content-img" src="https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png" mode="aspectFill"></image> |
|
|
|
<image class="content-img" :src="i.item_meta.image" mode="aspectFill"></image> |
|
|
|
<view class="lf-m-l-15"> |
|
|
|
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">爱他美较大婴儿配方奶粉较大婴儿配方奶粉较大婴儿配方奶粉2段 900g</view> |
|
|
|
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">{{i.item_name}}</view> |
|
|
|
<view class="lf-font-24 lf-color-777 lf-m-t-14 lf-row-between"> |
|
|
|
<view>1件;900g</view> |
|
|
|
<view class="lf-font-32 lf-color-price">¥385</view> |
|
|
|
<view>{{i.item_meta.specs_text}}</view> |
|
|
|
<view class="lf-font-32 lf-color-price">¥{{item2.items_total_yuan}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-30 lf-m-b-50"> |
|
|
|
<view class="lf-font-24 lf-color-777">订单关闭</view> |
|
|
|
<view class="lf-color-price lf-font-24">删除订单</view> |
|
|
|
<view class="lf-font-24 lf-color-777">{{item2.status_text}}</view> |
|
|
|
<!-- <view class="lf-color-price lf-font-24">删除订单</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -62,30 +62,26 @@ |
|
|
|
<!-- <view class="special_tab"> |
|
|
|
<u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="current" @change="tabChange"></u-tabs> |
|
|
|
</view> --> |
|
|
|
<swiper :style="{height: autoHeightTwo, width: '750rpx', background: '#fff'}" :current="current" @change="swiperChange"> |
|
|
|
<swiper-item v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex"> |
|
|
|
<scroll-view :style="{height: autoHeightTwo}" class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="tabItem.isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
|
<scroll-view :style="{height: autoHeightTwo}" class="com" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher" @scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh"> |
|
|
|
|
|
|
|
<view class="item" v-for="(item, index) in 10" :key="index"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<text class="lf-font-36 lf-color-black lf-font-bold lf-color-price">-¥250</text> |
|
|
|
<text class="lf-font-24 lf-color-555">线上-商城内消费</text> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-20"> |
|
|
|
<text class="lf-font-24 lf-color-555">¥374.38</text> |
|
|
|
<text class="lf-font-24 lf-color-777">2021-09-01 18:27:58</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item" v-for="(item, index) in list" :key="index"> |
|
|
|
<view class="lf-row-between"> |
|
|
|
<text class="lf-font-36 lf-color-black lf-font-bold lf-color-price">{{item.balance.balance}}</text> |
|
|
|
<text class="lf-font-24 lf-color-555">{{item.balance.note}}</text> |
|
|
|
</view> |
|
|
|
<view class="lf-row-between lf-m-t-20"> |
|
|
|
<text class="lf-font-24 lf-color-555">¥{{item.balance.current}}</text> |
|
|
|
<text class="lf-font-24 lf-color-777">{{item.created_at}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="loading-more lf-m-b-10"> |
|
|
|
<text :class="{'loading-more-text': tabItem.loadingClass}" v-if="tabItem.list.length">{{tabItem.loadingText}}</text> |
|
|
|
<lf-nocontent v-else></lf-nocontent> |
|
|
|
</view> |
|
|
|
<view class="loading-more lf-m-b-10"> |
|
|
|
<text :class="{'loading-more-text': loadingClass}" v-if="list.length">{{loadingText}}</text> |
|
|
|
<lf-nocontent v-else></lf-nocontent> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</scroll-view> |
|
|
|
</swiper-item> |
|
|
|
</swiper> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
@ -99,48 +95,8 @@ |
|
|
|
{ |
|
|
|
id: 1, |
|
|
|
name: '全部', |
|
|
|
list: [ |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
} |
|
|
|
], |
|
|
|
type: '', |
|
|
|
list: [], |
|
|
|
isRefresher: false, |
|
|
|
loadingClass: false, |
|
|
|
loadingText: '正在加载中', |
|
|
|
@ -150,38 +106,8 @@ |
|
|
|
{ |
|
|
|
id: 2, |
|
|
|
name: '代付款', |
|
|
|
list: [ |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
} |
|
|
|
], |
|
|
|
type: 1, |
|
|
|
list: [], |
|
|
|
isRefresher: false, |
|
|
|
loadingClass: true, |
|
|
|
loadingText: '正在加载中', |
|
|
|
@ -190,39 +116,9 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 3, |
|
|
|
name: '秒杀单', |
|
|
|
list: [ |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
} |
|
|
|
], |
|
|
|
name: '待发货', |
|
|
|
type: 2, |
|
|
|
list: [], |
|
|
|
isRefresher: false, |
|
|
|
loadingClass: true, |
|
|
|
loadingText: '正在加载中', |
|
|
|
@ -231,39 +127,9 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 4, |
|
|
|
name: '待提货', |
|
|
|
list: [ |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
} |
|
|
|
], |
|
|
|
name: '待收货', |
|
|
|
type: 3, |
|
|
|
list: [], |
|
|
|
isRefresher: false, |
|
|
|
loadingClass: true, |
|
|
|
loadingText: '正在加载中', |
|
|
|
@ -272,39 +138,9 @@ |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 5, |
|
|
|
name: '待发货', |
|
|
|
list: [ |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: 10, |
|
|
|
original_price: "4111.00", |
|
|
|
picture: "https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png", |
|
|
|
pictures: ["https://hainan.lanzulive.com/storage/images/v2-deb89623e0ee2a2dad34bcded6dfd1ed_1440w.png"], |
|
|
|
price: "2412.00", |
|
|
|
product_id: 1008, |
|
|
|
sale: 0, |
|
|
|
title: "三亚悦榕庄(Banyan Tree Sanya Resort and Spa)" |
|
|
|
} |
|
|
|
], |
|
|
|
name: '已完成', |
|
|
|
type: 4, |
|
|
|
list: [], |
|
|
|
isRefresher: false, |
|
|
|
loadingClass: true, |
|
|
|
loadingText: '正在加载中', |
|
|
|
@ -312,12 +148,15 @@ |
|
|
|
isPage: true |
|
|
|
} |
|
|
|
], |
|
|
|
list: [], |
|
|
|
current: 0, |
|
|
|
windowHeight: 0, |
|
|
|
loadingClass: false, |
|
|
|
loadingText: '没有更多数据啦~', |
|
|
|
scrollH: '', |
|
|
|
nav_height: '', |
|
|
|
isRefresher: false, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -331,27 +170,123 @@ |
|
|
|
onLoad(){ |
|
|
|
let info = uni.getSystemInfoSync(); |
|
|
|
this.scrollH = info.screenHeight; |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
changeTab(index) { |
|
|
|
this.online_tab = index |
|
|
|
if(this.online_tab == 0) { |
|
|
|
this.getData(); |
|
|
|
}else { |
|
|
|
this.getUploadList(); |
|
|
|
} |
|
|
|
}, |
|
|
|
getUploadList(options={}) { |
|
|
|
this.$http |
|
|
|
.post({ |
|
|
|
api: 'api/offline/order', |
|
|
|
data:{ |
|
|
|
page:this.page |
|
|
|
}, |
|
|
|
header: { |
|
|
|
Authorization: `Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjVkYTY5YjM5NWFhYzM5NzVmMzI3ZTEwZDEyMzAzZjI5MzE4ZmU2OGE2Njg0MTU0MWVjMjQ2NWM4ZWJkYjRlMTUwMmY1NWM0NDlkOTcxZDdjIn0.eyJhdWQiOiIzIiwianRpIjoiNWRhNjliMzk1YWFjMzk3NWYzMjdlMTBkMTIzMDNmMjkzMThmZTY4YTY2ODQxNTQxZWMyNDY1YzhlYmRiNGUxNTAyZjU1YzQ0OWQ5NzFkN2MiLCJpYXQiOjE2MzIzODY3NDAsIm5iZiI6MTYzMjM4Njc0MCwiZXhwIjoxNjYzOTIyNzQwLCJzdWIiOiIxIiwic2NvcGVzIjpbXX0.am-szF_sZcjtyOnEJT1DHMnr1hjAZ90MJc1Pc3AD3FrcQU5xb-u43ddL70ZmM3OxxLTZlmrB8OA3XJYREMtcz26MzwOMfopB9A5AH1EjHiFCV_368cq4ZpXNFi_Sn_LrY9Wje0-WMvkznF8tbrdCNrZn5YyIV47cwEnUNQrrREX4OhcgrSfNvwnh8_O_fueBwws9yY3tTlvVB7-AvG2urFI5XCzygsE3llE0wxF5ZJO1T5QRYLDse2BQ3d9feFzO5_7FiVspKr8DrJUlZP-Zz02UgIDIA_PX0UO2M0KeBwqPYq2d5uEnXT8or7K9coSnHRqbbr4qn6iczxDu4ofM58oCcaPycbtI3RvP2SMZuWmX8fXw-T99XltK_uJEU_wlIkrjvabzyo3tkrxRrwmzJEb3Yf4Lbah_xtfi24Nsu9SRjdw8YoiF6YhuuU5YaOn-wLltgmugfYpkFpEOneVAxoMjkm5IxZAJYMXF-DeSpdOoiTmuIRZYX4GDa55s_31r0YMyF6IIQNUvOjHHk-sJSHG0kPd5QivLP7dxE5XndwyFKAOeM97X2TjdYMhJz0EBCyS4Y_pI6AFWsxJkKsa0aqvBAeJyOV9k8kbYwtPeeBhBNsDWSlGBEZYMcoAv-C-IBZzd7gu2Ceh_MJPItrnsvj8W43Cv1TwxD26bJyt9EUY` |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res.data.status) { |
|
|
|
let isPage = res.data.per_page == 15?true:false; |
|
|
|
this.isPage = isPage; |
|
|
|
if(!isPage) { |
|
|
|
this.loadingClass = false; |
|
|
|
this.loadingText = '没有更多数据啦~'; |
|
|
|
} |
|
|
|
if(options.type == 'pageRefresh') { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}else if(options.type == 'scrollRefresh') { |
|
|
|
this.isRefresher = false; |
|
|
|
} |
|
|
|
if(this.page == 1) { |
|
|
|
this.list = res.data.data.data; |
|
|
|
}else { |
|
|
|
this.list.push(...res.data.data.data); |
|
|
|
} |
|
|
|
console.log('数组列表',this.list) |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
content: res.message || '请下拉页面刷新重试', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
} |
|
|
|
wx.hideLoading(); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showModal({ |
|
|
|
content: '请求失败', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
tabChange(index){ |
|
|
|
this.current = index; |
|
|
|
this.clearTabItem(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
getData() { |
|
|
|
getData(options ={}) { |
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
let isPage = false; |
|
|
|
tab_item.isPage = isPage; |
|
|
|
if(!isPage){ |
|
|
|
tab_item.loadingClass = false; |
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
} |
|
|
|
tab_item.isRefresher = false; |
|
|
|
console.log('=====adada===',tab_item) |
|
|
|
this.$http |
|
|
|
.get({ |
|
|
|
api: 'api/order/list', |
|
|
|
data:{ |
|
|
|
status: tab_item.type, |
|
|
|
page: tab_item.page, |
|
|
|
type: 0, |
|
|
|
channel: '' |
|
|
|
}, |
|
|
|
header: { |
|
|
|
Authorization: this.$cookieStorage.get('user_token') |
|
|
|
}, |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res.data.status) { |
|
|
|
let isPage = tab_item.page < res.data.meta.pagination.total_pages?true:false; |
|
|
|
tab_item.isPage = isPage; |
|
|
|
if(!isPage) { |
|
|
|
tab_item.loadingClass = false; |
|
|
|
tab_item.loadingText = '没有更多数据啦~'; |
|
|
|
} |
|
|
|
if(options.type == 'pageRefresh') { |
|
|
|
uni.stopPullDownRefresh(); |
|
|
|
}else if(options.type == 'scrollRefresh') { |
|
|
|
tab_item.isRefresher = false; |
|
|
|
} |
|
|
|
if(tab_item.page == 1) { |
|
|
|
tab_item.list = res.data.data; |
|
|
|
}else { |
|
|
|
tab_item.list.push(...res.data.data); |
|
|
|
} |
|
|
|
console.log('数组列表',tab_item.list) |
|
|
|
} else { |
|
|
|
wx.showModal({ |
|
|
|
content: res.message || '请下拉页面刷新重试', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
} |
|
|
|
wx.hideLoading(); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showModal({ |
|
|
|
content: '请求失败', |
|
|
|
showCancel: false |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 滑块下标值变化 |
|
|
|
swiperChange(event){ |
|
|
|
this.current = event.detail.current; |
|
|
|
if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
// 页面触底,加载下一页 |
|
|
|
onScrolltolower(){ |
|
|
|
@ -360,25 +295,35 @@ |
|
|
|
tab_item.page = tab_item.page + 1; |
|
|
|
this.getData(); |
|
|
|
} |
|
|
|
if(this.isPage) { |
|
|
|
this.page = this.page + 1; |
|
|
|
this.getUploadList() |
|
|
|
} |
|
|
|
}, |
|
|
|
// scroll-view 下拉刷新 |
|
|
|
onRefresherrefresh(){ |
|
|
|
this.$u.throttle(() => { |
|
|
|
this.clearTabItem(); |
|
|
|
this.getData(); |
|
|
|
this.refreshFn({type: 'scrollRefresh'}); |
|
|
|
}, 200); |
|
|
|
}, |
|
|
|
clearTabItem(){ |
|
|
|
// 下拉刷新处理 |
|
|
|
refreshFn(options){ |
|
|
|
let tab_item = this.tab_list[this.current]; |
|
|
|
tab_item.page = 1; |
|
|
|
tab_item.isPage = true; |
|
|
|
tab_item.isRefresher = true; |
|
|
|
tab_item.loadingClass = true; |
|
|
|
tab_item.loadingText = '正在加载中'; |
|
|
|
tab_item.list = []; |
|
|
|
this.$set(this.tab_list, this.current, tab_item); |
|
|
|
// this.$refs.uWaterfallFather[this.current].clear(); |
|
|
|
} |
|
|
|
tab_item.isRefresher = true; |
|
|
|
tab_item.loadingText = '正在加载中'; |
|
|
|
this.getData(options); |
|
|
|
this.page = 1; |
|
|
|
this.isPage = true; |
|
|
|
this.loadingClass = true; |
|
|
|
this.list = []; |
|
|
|
this.isRefresher = true; |
|
|
|
this.loadingText = '正在加载中'; |
|
|
|
this.getUploadList(options); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|