|
|
@ -7,40 +7,48 @@ |
|
|
|
|
|
|
|
|
<swiper :style="{height: autoHeight}" :current="tab_current" @change="swiperChange"> |
|
|
<swiper :style="{height: autoHeight}" :current="tab_current" @change="swiperChange"> |
|
|
<swiper-item v-for="(tab_item, tab_index) in tab_list" :key="tab_index"> |
|
|
<swiper-item v-for="(tab_item, tab_index) in tab_list" :key="tab_index"> |
|
|
<scroll-view :style="{height: autoHeight}" :scroll-y="true"> |
|
|
|
|
|
|
|
|
<scroll-view :style="{height: autoHeight}" |
|
|
|
|
|
:scroll-y="true" |
|
|
|
|
|
@scrolltolower="scrolltolower" |
|
|
|
|
|
:refresher-enabled="true" |
|
|
|
|
|
:refresher-triggered="tab_item.isRefresher" |
|
|
|
|
|
@refresherrefresh="refresherrefresh"> |
|
|
<view class="content"> |
|
|
<view class="content"> |
|
|
<view class="card" v-for="(item, index) in 10" :key="index"> |
|
|
|
|
|
|
|
|
<view class="card" v-for="(item, index) in tab_item.list" :key="index"> |
|
|
<view class="lf-flex"> |
|
|
<view class="lf-flex"> |
|
|
<image class="goods-img"></image> |
|
|
|
|
|
|
|
|
<image class="goods-img" :src="item.items[0].item_meta.image"></image> |
|
|
<view class="info"> |
|
|
<view class="info"> |
|
|
<view class="lf-font-26 lf-color-333 lf-line-2">爱他美较大婴儿配方奶粉较大配方奶粉较2段 </view> |
|
|
|
|
|
|
|
|
<view class="lf-font-26 lf-color-333 lf-line-2">{{ item.items[0].item_name }}</view> |
|
|
<view class="lf-row-between" style="line-height: 1;"> |
|
|
<view class="lf-row-between" style="line-height: 1;"> |
|
|
<text class="lf-font-24 lf-color-777">1件;900g</text> |
|
|
|
|
|
<text class="lf-font-32 lf-font-bold" style="color: #F63434;">¥385</text> |
|
|
|
|
|
|
|
|
<text class="lf-font-24 lf-color-777">{{ item.payment.amount }}件;{{ item.items[0].item_meta.specs_text }}</text> |
|
|
|
|
|
<text class="lf-font-32 lf-font-bold" style="color: #F63434;">¥{{ item.payment.amount_yuan }}</text> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="order-num"> |
|
|
<view class="order-num"> |
|
|
<view class="deliver" v-if="index == 1" @click="deliver">发货</view> |
|
|
|
|
|
<view v-else>待付款</view> |
|
|
|
|
|
<view style="color: #F63434;">删除订单</view> |
|
|
|
|
|
|
|
|
<view class="deliver" v-if="item.status_text == '待发货'" @click="deliver(item.order_no)">发货</view> |
|
|
|
|
|
<view v-else>{{ item.status_text }}</view> |
|
|
|
|
|
<view style="color: #F63434;" @click="removeOrder(item.order_no, tab_index, index)">删除订单</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<lf-nocontent src="/static/images/empty.png" v-if="tab_item.list.length <= 0"></lf-nocontent> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</swiper-item> |
|
|
</swiper-item> |
|
|
</swiper> |
|
|
</swiper> |
|
|
|
|
|
|
|
|
<u-popup mode="bottom" v-model="show_deliver" :round="true" borderRadius="20"> |
|
|
<u-popup mode="bottom" v-model="show_deliver" :round="true" borderRadius="20"> |
|
|
<view class="popup-content"> |
|
|
<view class="popup-content"> |
|
|
<view class="title">选择物流商家</view> |
|
|
<view class="title">选择物流商家</view> |
|
|
<picker mode="selector" :range="columns" :value="select_index" @change="selectChange"> |
|
|
|
|
|
<view class="logistics" @click="show_logistics = true"> |
|
|
|
|
|
<text>{{ columns[select_index] || '请选择物流' }}</text> |
|
|
|
|
|
<text class="lf-iconfont icon--1"></text> |
|
|
|
|
|
|
|
|
<picker mode="selector" range-key="name" :range="columns" :value="select_index" @change="selectChange"> |
|
|
|
|
|
<view class="logistics"> |
|
|
|
|
|
<text>{{ (columns[select_index] && columns[select_index].name) || '请选择物流' }}</text> |
|
|
|
|
|
<text class="lf-iconfont icon-jiazai load-a" v-if="logistics_load"></text> |
|
|
|
|
|
<text class="lf-iconfont icon-xiangxia" v-else></text> |
|
|
</view> |
|
|
</view> |
|
|
</picker> |
|
|
</picker> |
|
|
<view class="title">订单编号</view> |
|
|
|
|
|
<input class="input" placeholder="请输入订单编号" v-model="orderNum" /> |
|
|
|
|
|
|
|
|
<view class="title">快递单号</view> |
|
|
|
|
|
<input class="input" placeholder="请输入快递单号" v-model="expressNum" /> |
|
|
<button class="btn" @click="confirm">确认发货</button> |
|
|
<button class="btn" @click="confirm">确认发货</button> |
|
|
</view> |
|
|
</view> |
|
|
</u-popup> |
|
|
</u-popup> |
|
|
@ -54,7 +62,8 @@ |
|
|
page: 1, |
|
|
page: 1, |
|
|
isPage: true, |
|
|
isPage: true, |
|
|
loadingClass: true, |
|
|
loadingClass: true, |
|
|
loadingText: '正在加载中' |
|
|
|
|
|
|
|
|
loadingText: '正在加载中', |
|
|
|
|
|
isRefresher: false |
|
|
} |
|
|
} |
|
|
return { |
|
|
return { |
|
|
tab_current: 0, |
|
|
tab_current: 0, |
|
|
@ -78,13 +87,13 @@ |
|
|
scrollH: 0, |
|
|
scrollH: 0, |
|
|
nav_height: 0, |
|
|
nav_height: 0, |
|
|
show_deliver: false, |
|
|
show_deliver: false, |
|
|
columns: [ |
|
|
|
|
|
'中通快递', '申通快递', '圆通快递', '国通快递', '百世汇通快递', |
|
|
|
|
|
'顺丰快递', '京东快递', '天猫快递', 'EMS特快' |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
columns: [], |
|
|
show_logistics: false, |
|
|
show_logistics: false, |
|
|
select_index: null, |
|
|
select_index: null, |
|
|
orderNum: '' |
|
|
|
|
|
|
|
|
expressNum: '', |
|
|
|
|
|
token: '', |
|
|
|
|
|
logistics_load: true, |
|
|
|
|
|
click_order_no: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -95,30 +104,155 @@ |
|
|
onLoad(){ |
|
|
onLoad(){ |
|
|
let info = uni.getSystemInfoSync(); |
|
|
let info = uni.getSystemInfoSync(); |
|
|
this.scrollH = info.screenHeight; |
|
|
this.scrollH = info.screenHeight; |
|
|
|
|
|
this.token = this.$cookieStorage.get('store_token'); |
|
|
|
|
|
this.getOrderList(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
getOrderList(options = {}){ |
|
|
|
|
|
let tabItem = this.tab_list[this.tab_current]; |
|
|
|
|
|
this.$http.get({ |
|
|
|
|
|
api: 'api/supplier/order', |
|
|
|
|
|
data: { |
|
|
|
|
|
status: String(this.tab_current) |
|
|
|
|
|
}, |
|
|
|
|
|
header: { |
|
|
|
|
|
token: this.token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
console.log("getOrderList", res); |
|
|
|
|
|
|
|
|
|
|
|
tabItem.isPage = this.$isRight(res.data.next_page_url); |
|
|
|
|
|
if(options.refresher){ |
|
|
|
|
|
tabItem.isRefresher = false; |
|
|
|
|
|
this.$msg('刷新成功', {icon: 'success'}); |
|
|
|
|
|
} |
|
|
|
|
|
if(!tabItem.isPage){ |
|
|
|
|
|
tabItem.loadingClass = false; |
|
|
|
|
|
tabItem.loadingText = '已加载全部数据~' |
|
|
|
|
|
} |
|
|
|
|
|
if(tabItem.page == 1){ |
|
|
|
|
|
tabItem.list = res.data.data.data; |
|
|
|
|
|
}else{ |
|
|
|
|
|
tabItem.list.push(...res.data.data.data); |
|
|
|
|
|
} |
|
|
|
|
|
console.log("this.tab_list", this.tab_list) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
tabChange(event){ |
|
|
tabChange(event){ |
|
|
this.tab_current = event; |
|
|
this.tab_current = event; |
|
|
|
|
|
if(this.tab_list[this.tab_current].list.length <= 0){ |
|
|
|
|
|
this.getOrderList(); |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
swiperChange(event){ |
|
|
swiperChange(event){ |
|
|
this.tab_current = event.detail.current; |
|
|
this.tab_current = event.detail.current; |
|
|
|
|
|
if(event.detail.source){ |
|
|
|
|
|
if(this.tab_list[this.tab_current].list.length <= 0){ |
|
|
|
|
|
this.getOrderList(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 物流 |
|
|
|
|
|
getLogistics(){ |
|
|
|
|
|
this.logistics_load = true; |
|
|
|
|
|
this.$http.get({ |
|
|
|
|
|
api: 'api/supplier/order/send_list', |
|
|
|
|
|
data: { |
|
|
|
|
|
order_no: this.click_order_no |
|
|
|
|
|
}, |
|
|
|
|
|
header: { |
|
|
|
|
|
token: this.token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
|
this.logistics_load = false; |
|
|
|
|
|
this.columns = res.data.data; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
deliver(){ |
|
|
|
|
|
|
|
|
deliver(order_no){ |
|
|
console.log("1111111"); |
|
|
console.log("1111111"); |
|
|
this.show_deliver = true; |
|
|
this.show_deliver = true; |
|
|
|
|
|
this.click_order_no = order_no; |
|
|
|
|
|
this.getLogistics(); |
|
|
}, |
|
|
}, |
|
|
selectChange(event){ |
|
|
selectChange(event){ |
|
|
this.select_index = event.detail.value; |
|
|
this.select_index = event.detail.value; |
|
|
|
|
|
console.log("event",event) |
|
|
}, |
|
|
}, |
|
|
// 确认发货 |
|
|
// 确认发货 |
|
|
confirm(){ |
|
|
confirm(){ |
|
|
console.log("选择的物流:", this.columns[this.select_index] || '未选择'); |
|
|
|
|
|
console.log("订单号:", this.orderNum || '未输入'); |
|
|
|
|
|
if(this.columns[this.select_index] && this.orderNum){ |
|
|
|
|
|
this.show_deliver = false; |
|
|
|
|
|
|
|
|
if(this.columns[this.select_index] && this.expressNum){ |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '正在提交' |
|
|
|
|
|
}) |
|
|
|
|
|
let method_id = this.columns[this.select_index].id; |
|
|
|
|
|
let express_no = this.expressNum; |
|
|
|
|
|
let order_no = this.click_order_no; |
|
|
|
|
|
this.$http.get({ |
|
|
|
|
|
api: 'api/supplier/order/send', |
|
|
|
|
|
data: { |
|
|
|
|
|
distribution_id: 0, |
|
|
|
|
|
method_id: method_id, |
|
|
|
|
|
express_no: express_no, |
|
|
|
|
|
order_no: order_no |
|
|
|
|
|
}, |
|
|
|
|
|
header: { |
|
|
|
|
|
token: this.token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.$msg('发货成功', {icon: 'success'}); |
|
|
|
|
|
this.show_deliver = false; |
|
|
|
|
|
}).catch(err => uni.hideLoading()); |
|
|
}else{ |
|
|
}else{ |
|
|
this.$msg('请将信息补充完整') |
|
|
this.$msg('请将信息补充完整') |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除订单 |
|
|
|
|
|
removeOrder(order_no, parentIndex, childIndex){ |
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
title: '温馨提示', |
|
|
|
|
|
content: '确定删除该订单吗?', |
|
|
|
|
|
success: result => { |
|
|
|
|
|
if(result.confirm){ |
|
|
|
|
|
this.$http.post({ |
|
|
|
|
|
api: 'api/supplier/order/delete', |
|
|
|
|
|
data: { |
|
|
|
|
|
order_no: order_no |
|
|
|
|
|
}, |
|
|
|
|
|
header: { |
|
|
|
|
|
token: this.token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
|
this.$msg(res.data.data); |
|
|
|
|
|
this.tab_list[parentIndex].list.splice(childIndex, 1); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// scroll-view 滚到底 |
|
|
|
|
|
scrolltolower(){ |
|
|
|
|
|
let tabItem = this.tab_list[this.tab_current]; |
|
|
|
|
|
if(tabItem.isPage){ |
|
|
|
|
|
tabItem.page = tabItem.page+1; |
|
|
|
|
|
this.getOrderList(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.$msg('没有更多啦~') |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
// 自定义下拉刷新 |
|
|
|
|
|
refresherrefresh(){ |
|
|
|
|
|
let tabItem = this.tab_list[this.tab_current]; |
|
|
|
|
|
tabItem.isRefresher = true; |
|
|
|
|
|
tabItem.page = 1; |
|
|
|
|
|
tabItem.isPage = true; |
|
|
|
|
|
tabItem.loadingClass = true; |
|
|
|
|
|
tabItem.loadingText = '正在加载中'; |
|
|
|
|
|
this.getOrderList({refresher: true}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -228,6 +362,16 @@ |
|
|
color: #FFFFFF; |
|
|
color: #FFFFFF; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
.load-a{ |
|
|
|
|
|
animation: my-load-a 2.5s infinite; |
|
|
|
|
|
} |
|
|
|
|
|
@keyframes my-load-a{ |
|
|
|
|
|
0%{transform: rotate(0deg);} |
|
|
|
|
|
25%{transform: rotate(90deg);} |
|
|
|
|
|
50%{transform: rotate(180deg);} |
|
|
|
|
|
75%{transform: rotate(270deg);} |
|
|
|
|
|
100%{transform: rotate(360deg);} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// tabs 样式修改 |
|
|
// tabs 样式修改 |
|
|
/deep/.u-scroll-box { |
|
|
/deep/.u-scroll-box { |
|
|
|