Commit ccb327a9 authored by haitao's avatar haitao

fd

parent ac1514c7
......@@ -5,8 +5,8 @@
<!-- @tap="demoaudio" -->
<view class="tit">店铺名称:{{ storeinfo.shop_name }}</view>
<!-- {{shop.shop_name}} -->
<view class="jiu">
<view class="jiu_01">
<view :class="['jiu', shop_type == 'ele'?'':'jus-b']">
<view class="jiu_01" v-if="shop_type == 'ele'">
<view @tap="saoma">
<image class="img" src="/static/icon/1.png" mode=""></image>
<view>扫码入库</view>
......
......@@ -95,11 +95,6 @@
},
//快速发货 确认发货
async oneKeyShipmentsfun(){
// if(this.order_id.replace(/\s*/g,"")==""){
// this.$api.msg("没有获取到您的订单信息");
// return false;
// }
if(this.chindtext==""){
this.$api.msg("请选中快速公司");
return false;
......@@ -108,29 +103,20 @@
this.$api.msg("物流单号不能为空");
return false;
}
//this.$api.msg("数据还没对接呢");
let res = await oneKeyShipments({
logisticCode:this.logscode,//物流好 快递单号 订单号
shipperName:this.chindtext,//名称 快递公司编号 名称
order_id:this.order_id,//订单id 订单id
vendor_id:this.vendor,
});
if(res.code==0){
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success(res) {
uni.redirectTo({
url: '/pages/order/shopOrder'
})
// uni.navigateBack({
// //delta: 2
// });
uni.$emit("isDelorder",{action: 'oneKeyShipments'});
uni.navigateBack({}); //返回上一页
}
})
}else{
......
......@@ -11,7 +11,7 @@
<!-- v-if="tabactive==1" -->
<view class="listorder" >
<view class="orderItem" v-for="(item,index) in order" :key="index">
<view class="orderItem" v-for="(item,indexMax) in order" :key="indexMax">
<view class="order_head flex ali-c jus-b">
<view class="headl flex ali-c">
<image class="storeicon" src="/static/news/storeicon.png" mode=""></image>
......@@ -50,17 +50,11 @@
</view>
</view>
<view v-if="productList.operation!=''" class="order_foot bodbod flex jus-e mb-20 mt-20">
<block v-for="(action,index) in productList.operation" :key="index">
<view class='btnss ' :data-orderid='item.order_id' :data-vendor='index1' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view>
<view class='btnss' :data-index="indexMax" :data-orderid='item.order_id' :data-vendor='index1' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view>
</block>
</view>
</view>
</view>
<view class="pricebox flex ali-c jus-b">
......@@ -70,19 +64,11 @@
<view class="heji">合计<text class="fuhao">¥</text><text class="shuzi">{{item.total}}</text></view>
</view>
<view class="order_foot flex jus-e">
<!-- 已发货 -->
<block v-for="(action,index) in item.order_operation" :key="index">
<view class='btnss ' :data-orderid='item.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view>
<view class='btnss' :data-index="indexMax" :data-orderid='item.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view>
</block>
<!-- <block v-if="item.products.length<=1" v-for="(action,index) in item.order_operation" :key="index">
<view class='btnitem ' :data-vendor="item.products[index1][0].vendor_id" :data-orderid='item.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view>
</block> -->
</view>
</view>
......@@ -118,6 +104,8 @@
currentTab:0,
sale_status:"",
isshowtop:false,
action:'',
}
},
computed: {
......@@ -127,16 +115,18 @@
},
//下拉刷新
onPullDownRefresh(){
this.is_loading_done=false;
this.pageNum = 0;
this.order = [];
this.initializedata();
// uni.stopPullDownRefresh();//结束下拉刷新
},
//监听滚动
onPageScroll(e){
//console.log(e.scrollTop);
onUnload(){ //页面卸载的时候
uni.setStorageSync('obj',{order_id:'',index:-1});
uni.$off('isDelorder'); //取消监听
uni.setStorageSync('scrollTop',0);
},
onPageScroll(e){ //监听滚动
uni.setStorageSync('scrollTop',e.scrollTop);
//处理返回顶部
if(e.scrollTop>400){
this.isshowtop = true;
......@@ -144,20 +134,16 @@
this.isshowtop = false;
}
},
//滚动到最底部
onReachBottom(){
console.log("11");
onReachBottom(){ //滚动到最底部
if(!this.is_loading_done){
this.initializedata();
}
},
onLoad(options) {
var that = this;
this.statusTab=options.current ? options.current : "all";// 订单状态
this.status= options.status ? options.status : "all";
this.is_dianping= options.is_dianping ? options.is_dianping : 0;
let params = {};
orderStatus(params).then(res => {
if (res.code == 0) {
......@@ -165,15 +151,51 @@
this.order_status_list = order_status_list;
}
})
this.initializedata();
},
onShow() {
this.is_loading_done=false;
this.pageNum = 0;
this.order = [];
this.initializedata();
this.action='';
uni.$on("isDelorder", res => {
let index=uni.getStorageSync('obj').index;
let order=this.order;
this.action=res.action;
if(res.action=="oneKeyShipments"){ //确认发货
if(this.status!='all'){ //只有不是在全部订单下才删除这一项
order.splice(index,1); //删除某项
this.$set(this,'order',order);
}else{
this.listDeal();
}
}
uni.$off('isDelorder'); //取消监听
})
if(this.action==''){
this.listDeal();
}
},
methods:{
listDeal(){
let order_id=uni.getStorageSync('obj').order_id;
let index=uni.getStorageSync('obj').index;
uni.showLoading({title:"请稍后..."});
orderList({
status: this.status,
is_dianping: this.is_dianping,
sale_status: this.sale_status,
page: Math.ceil((index+1)/10)
}).then(res => {
uni.hideLoading();
for(let item of res.data){
if(item.order_id==order_id){
this.$set(this.order,index,item);
break;
}
}
})
},
totkxq(data){
uni.showModal({
title: '退款原因',
......@@ -192,7 +214,6 @@
},
//点击切换
taggletab(event){
// this.$api.msg("点击了");
let that = this;
let statusTab = event.currentTarget.dataset.statustab;
let status = event.currentTarget.dataset.status;
......@@ -225,18 +246,18 @@
title: '加载中...'
});
orderList(params).then(res => {
uni.stopPullDownRefresh();
uni.hideLoading();//结束加载
console.log(res);
if (res.data == null || res.data.length == 0) {
this.is_loading_done= true;
this.$api.msg("没有更多了~");
} else {
this.order = [...this.order,...res.data]
}
uni.hideLoading();
uni.stopPullDownRefresh();
uni.hideLoading();//结束加载
if (res.data == null || res.data.length == 0) {
this.is_loading_done= true;
this.$api.msg("没有更多了~");
} else {
this.order = [...this.order,...res.data]
}
uni.pageScrollTo({
scrollTop: uni.getStorageSync('scrollTop'),
duration: 0
});
})
},
/**
......@@ -247,10 +268,11 @@
let action = event.currentTarget.dataset.action;
let order_id = event.currentTarget.dataset.orderid;
let vendor = event.currentTarget.dataset.vendor;
let index = Number(event.currentTarget.dataset.index);;
uni.setStorageSync('obj',{order_id,index});
switch (action) {
case 'oneKeyCancel': //一键核销 OK
that.requestOrder(order_id, action);
// oneKeyCancel
console.info("一键核销");
break;
case 'oneKeyShipments': //一键发货 OK
......@@ -259,18 +281,17 @@
break;
case 'checkLogistics': //查看物流
that.logistics(order_id, action,vendor);
// this.$api.msg("开发中,敬请期待~");
console.info("查看物流");
break;
case 'orderDetails': //订单详情
console.info("订单详情");
console.info("订单详情");
that.orderDetails(order_id,order_id);
break;
case 'consentRefund'://同意退款
this.clrefund(1,order_id);
this.clrefund(1,order_id,index);
break;
case 'refuseRefund'://拒绝退款
this.clrefund(2,order_id);
this.clrefund(2,order_id,index);
break;
default:
//其他的 退款啥的 处理ok了
......@@ -279,31 +300,46 @@
}
},
//处理退款
async clrefund(type,orderid){
let res = {}
if(type==1){
//同意
res = await consentRefund({
order_id:orderid
});
}else if(type==2){
//拒绝
res = await refuseRefund({
order_id:orderid
});
}
if(res.code==0){
this.$api.msg(res.msg);
setTimeout(()=>{
uni.redirectTo({
url: '/pages/order/shopOrder?status=' + this.status + "&current=" + this.statusTab,
})
},1000)
}else{
this.$api.msg(res.msg);
}
clrefund(type,orderid,index){
uni.showModal({
title: '提示',
content:type==1?'是否确定退款?':'是否拒绝退款',
success:(res)=> {
if(res.confirm){
new Promise((reslove, reject) =>{
if(type==1){ //同意退款
consentRefund({order_id:orderid}).then(res=>{
reslove(res)
}).catch(err=>{
reject(err)
})
}else{ //拒绝退款
refuseRefund({order_id:orderid}).then(res=>{
reslove(res);
}).catch(err=>{
reject(err)
})
}
}).then((res)=>{
if(res.code==0){
if(this.status!="all"){
let order=this.order;
order.splice(index,1); //删除某项
this.$set(this,'order',order);
}else{
this.listDeal();
}
}else{
this.$api.msg(returnRes.msg);
}
}).catch((err)=>{
console.log(err,'失败了');
//this.$api.msg(err.msg)
})
}
}
})
},
//查看物流
logistics: function (order_id, action,vendor) {
......@@ -313,16 +349,13 @@
},
//跳转订单详情 商家查看店铺的订单详情
orderDetails: function (order_id) {
uni.navigateTo({//?
//url: '/pages/shopOrderDetails/shopOrderDetails?order_id=' + order_id,
uni.navigateTo({
url:`/pages/order/shoporderdetail/shoporderdetail?order_id=${order_id}`,
})
},
// 跳转发快递订单 ok 发货
express (order_id, action,vendor) {
uni.navigateTo({
url: '/pages/order/delivery/delivery?order_id=' + order_id + '&action=' + action + '&vendor=' + vendor
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment