|
|
|
@ -30,25 +30,25 @@ |
|
|
|
</view> |
|
|
|
<view class="order2"> |
|
|
|
<view class="order22"> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order33" @tap="changeIndex(1,3)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{daichucan}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待接单 |
|
|
|
待出餐 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order33" @tap="changeIndex(1,4)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{daiquhuo}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待取货 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order33" @tap="changeIndex(1,5)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{daisongda}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待送达 |
|
|
|
@ -56,33 +56,25 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order22"> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order33" @tap="changeIndex(1,2)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{daixiaofei}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待消费 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order33" @tap="changeIndex(1,11)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{shopData.refundCount == undefined?0:shopData.refundCount}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待退款 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order33" @tap="changeIndex(1)"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待售后 |
|
|
|
待退款/售后 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="order33" @tap="goDetail('pj')"> |
|
|
|
<view class="order44"> |
|
|
|
0 |
|
|
|
{{shopData.pendingBadReviewCount == undefined?0:shopData.pendingBadReviewCount}} |
|
|
|
</view> |
|
|
|
<view class="order55"> |
|
|
|
待回复差评 |
|
|
|
@ -104,7 +96,7 @@ |
|
|
|
<view class="data2"> |
|
|
|
<view class="data22"> |
|
|
|
<view class="data222"> |
|
|
|
0 |
|
|
|
{{shopData.orderRevenueAndCount.count}} |
|
|
|
</view> |
|
|
|
<view class="data333"> |
|
|
|
今日订单 |
|
|
|
@ -112,7 +104,7 @@ |
|
|
|
</view> |
|
|
|
<view class="data22"> |
|
|
|
<view class="data222"> |
|
|
|
0 |
|
|
|
{{shopData.orderRevenueAndCount.amount}} |
|
|
|
</view> |
|
|
|
<view class="data333"> |
|
|
|
营业额 |
|
|
|
@ -219,6 +211,11 @@ |
|
|
|
shop:{}, |
|
|
|
areaList:[], |
|
|
|
shopList: [], |
|
|
|
shopData:{}, |
|
|
|
daixiaofei:0, |
|
|
|
daichucan:0, |
|
|
|
daiquhuo:0, |
|
|
|
daisongda:0 |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
@ -228,6 +225,7 @@ |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.indexInit() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
@ -245,29 +243,6 @@ |
|
|
|
this.checkArea() |
|
|
|
} |
|
|
|
}, |
|
|
|
//切换店铺 |
|
|
|
onActionItemClick(item) { |
|
|
|
if(this.type == 'wuliu'){ |
|
|
|
this.current = item.id |
|
|
|
this.name = item.companyName |
|
|
|
}else{ |
|
|
|
this.current = item.shop.id |
|
|
|
this.name = item.shopName |
|
|
|
this.shopOwnerPhone = item.shopOwnerPhone |
|
|
|
} |
|
|
|
if (!this.shopName) return this.tui.toast('请输入新店铺名称', 2000) |
|
|
|
this.tui.request("/app/shop/modifyShopNameById", "put", { |
|
|
|
id: this.shopId, |
|
|
|
shopName: this.shopName |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code === 200) { |
|
|
|
this.getList() |
|
|
|
this.onPopupClose() |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkArea(){ |
|
|
|
this.NB.sendRequest("/auth/getShopByUser", {}, false, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
@ -378,43 +353,65 @@ |
|
|
|
url: url |
|
|
|
}) |
|
|
|
}, |
|
|
|
getData(){ |
|
|
|
that.NB.sendRequest("/mall/order/countByShop/"+uni.getStorageSync('shopId'), {}, true, 'GET', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.shopData = res.result |
|
|
|
for(let i=0;i<this.shopData.orderStatusCount.length;i++){ |
|
|
|
if(this.shopData.orderStatusCount[i].counttype){ |
|
|
|
if(this.shopData.orderStatusCount[i].counttype == 'daisong'){ |
|
|
|
this.daisongda = this.shopData.orderStatusCount[i].count |
|
|
|
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){ |
|
|
|
this.daiquhuo = this.shopData.orderStatusCount[i].count |
|
|
|
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){ |
|
|
|
this.daixiaofei = this.shopData.orderStatusCount[i].count |
|
|
|
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){ |
|
|
|
this.daichucan = this.shopData.orderStatusCount[i].count |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
//扫一扫功能 |
|
|
|
scanCodeAdd() { |
|
|
|
let that = this; |
|
|
|
uni.scanCode({ |
|
|
|
success: (res) => { |
|
|
|
if (res.scanType == "QR_CODE") { //二维码 |
|
|
|
console.log('二维码',res) |
|
|
|
// let shopId = base.decode(res.result.split(',')[1]) |
|
|
|
// if (shopId == uni.getStorageSync('shopId').substring('10', '12')) { |
|
|
|
// that.productId = base.decode(res.result.split(',')[0]) |
|
|
|
// that.toggle('bottom', base.decode(res.result.split(',')[0])); |
|
|
|
let shopId = res.result.split('@@')[1] |
|
|
|
if (shopId == uni.getStorageSync('shopId')) { |
|
|
|
let productId = res.result.split('@@')[0] |
|
|
|
uni.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确定要核销该订单吗?', |
|
|
|
success: function (res1) { |
|
|
|
if (res1.confirm) { |
|
|
|
that.NB.sendRequest("/mall/order/complete", { |
|
|
|
orderId: productId |
|
|
|
}, true, 'post', 'application/x-www-form-urlencoded').then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
uni.showToast({ |
|
|
|
title: '核销成功', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch((res) => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// } else { |
|
|
|
// that.tui.toast('您的店铺中暂无该商品!') |
|
|
|
// } |
|
|
|
} else { |
|
|
|
console.log('条形码',res) |
|
|
|
// that.NB.sendRequest("/app/product/getByBarcode", "POST", { |
|
|
|
// barcode: res.result |
|
|
|
// }, false, true).then((res1) => { |
|
|
|
// if (res1.code == 200) { |
|
|
|
// that.productId = res1.result[0].id |
|
|
|
// if (res1.result == '') { |
|
|
|
// that.tui.toast('您的店铺中暂无该商品!') |
|
|
|
// } else { |
|
|
|
// that.toggle('bottom', res1.result[0].id); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
// that.tui.toast(res.message) |
|
|
|
// } |
|
|
|
// }).catch((res) => { |
|
|
|
// that.tui.toast(res) |
|
|
|
// }) |
|
|
|
|
|
|
|
} else { |
|
|
|
that.tui.toast('未查询到此订单信息,请核实!') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
fail: (res) => { |
|
|
|
uni.showToast({ |
|
|
|
@ -425,7 +422,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
//底部tab切换组件状态改变 |
|
|
|
changeIndex(index) { |
|
|
|
changeIndex(index,type) { |
|
|
|
let that = this; |
|
|
|
this.lastIndex = this.currentIndex |
|
|
|
this.currentIndex = index |
|
|
|
@ -434,7 +431,7 @@ |
|
|
|
this.indexInit() |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
that.$refs.deLivery.init() |
|
|
|
that.$refs.deLivery.init(type) |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
that.$refs.myCenter.init() |
|
|
|
|